diff --git a/action/index.cjs b/action/index.cjs index 5f6dbf9a..ef1fb027 100644 --- a/action/index.cjs +++ b/action/index.cjs @@ -1,247 +1,225 @@ -"use strict";var Mie=Object.create;var aE=Object.defineProperty;var Lie=Object.getOwnPropertyDescriptor;var Fie=Object.getOwnPropertyNames;var Uie=Object.getPrototypeOf,jie=Object.prototype.hasOwnProperty;var j=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var q=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},_r=(e,t)=>{for(var n in t)aE(e,n,{get:t[n],enumerable:!0})},zie=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Fie(t))!jie.call(e,r)&&r!==n&&aE(e,r,{get:()=>t[r],enumerable:!(i=Lie(t,r))||i.enumerable});return e};var gt=(e,t,n)=>(n=e!=null?Mie(Uie(e)):{},zie(t||!e||!e.__esModule?aE(n,"default",{value:e,enumerable:!0}):n,e));var Ze=q(Pn=>{"use strict";var cE=Symbol.for("yaml.alias"),zU=Symbol.for("yaml.document"),ib=Symbol.for("yaml.map"),GU=Symbol.for("yaml.pair"),lE=Symbol.for("yaml.scalar"),ob=Symbol.for("yaml.seq"),Bo=Symbol.for("yaml.node.type"),Gie=e=>!!e&&typeof e=="object"&&e[Bo]===cE,Vie=e=>!!e&&typeof e=="object"&&e[Bo]===zU,Bie=e=>!!e&&typeof e=="object"&&e[Bo]===ib,qie=e=>!!e&&typeof e=="object"&&e[Bo]===GU,VU=e=>!!e&&typeof e=="object"&&e[Bo]===lE,Wie=e=>!!e&&typeof e=="object"&&e[Bo]===ob;function BU(e){if(e&&typeof e=="object")switch(e[Bo]){case ib:case ob:return!0}return!1}function Hie(e){if(e&&typeof e=="object")switch(e[Bo]){case cE:case ib:case lE:case ob:return!0}return!1}var Kie=e=>(VU(e)||BU(e))&&!!e.anchor;Pn.ALIAS=cE;Pn.DOC=zU;Pn.MAP=ib;Pn.NODE_TYPE=Bo;Pn.PAIR=GU;Pn.SCALAR=lE;Pn.SEQ=ob;Pn.hasAnchor=Kie;Pn.isAlias=Gie;Pn.isCollection=BU;Pn.isDocument=Vie;Pn.isMap=Bie;Pn.isNode=Hie;Pn.isPair=qie;Pn.isScalar=VU;Pn.isSeq=Wie});var Kf=q(uE=>{"use strict";var gn=Ze(),Sr=Symbol("break visit"),qU=Symbol("skip children"),lo=Symbol("remove node");function sb(e,t){let n=WU(t);gn.isDocument(e)?gu(null,e.contents,n,Object.freeze([e]))===lo&&(e.contents=null):gu(null,e,n,Object.freeze([]))}sb.BREAK=Sr;sb.SKIP=qU;sb.REMOVE=lo;function gu(e,t,n,i){let r=HU(e,t,n,i);if(gn.isNode(r)||gn.isPair(r))return KU(e,i,r),gu(e,r,n,i);if(typeof r!="symbol"){if(gn.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o{"use strict";var JU=Ze(),Jie=Kf(),Zie={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Yie=e=>e.replace(/[!,[\]{}]/g,t=>Zie[t]),Jf=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+Yie(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(t&&i.length>0&&JU.isNode(t.contents)){let o={};Jie.visit(t.contents,(s,a)=>{JU.isNode(a)&&a.tag&&(o[a.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||r.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(` -`)}};Jf.defaultYaml={explicit:!1,version:"1.2"};Jf.defaultTags={"!!":"tag:yaml.org,2002:"};ZU.Directives=Jf});var cb=q(Zf=>{"use strict";var YU=Ze(),Qie=Kf();function Xie(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function QU(e){let t=new Set;return Qie.visit(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function XU(e,t){for(let n=1;;++n){let i=`${e}${n}`;if(!t.has(i))return i}}function eoe(e,t){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=QU(e));let s=XU(t,r);return r.add(s),s},setAnchors:()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(YU.isScalar(s.node)||YU.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:i}}Zf.anchorIsValid=Xie;Zf.anchorNames=QU;Zf.createNodeAnchors=eoe;Zf.findNewAnchor=XU});var pE=q(ej=>{"use strict";function Yf(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r{"use strict";var toe=Ze();function tj(e,t,n){if(Array.isArray(e))return e.map((i,r)=>tj(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!toe.hasAnchor(e))return e.toJSON(t,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!n?.keep?Number(e):e}nj.toJS=tj});var lb=q(ij=>{"use strict";var noe=pE(),rj=Ze(),roe=Is(),fE=class{constructor(t){Object.defineProperty(this,rj.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!rj.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=roe.toJS(this,"",s);if(typeof r=="function")for(let{count:c,res:l}of s.anchors.values())r(l,c);return typeof o=="function"?noe.applyReviver(o,{"":a},"",a):a}};ij.NodeBase=fE});var Qf=q(oj=>{"use strict";var ioe=cb(),ooe=Kf(),yu=Ze(),soe=lb(),aoe=Is(),mE=class extends soe.NodeBase{constructor(t){super(yu.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],ooe.visit(t,{Node:(o,s)=>{(yu.isAlias(s)||yu.hasAnchor(s))&&i.push(s)}}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}if(r&&n){let{anchors:o,doc:s,maxAliasCount:a}=n,c=o.get(r);if(c||(aoe.toJS(r,null,n),c=o.get(r)),c?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=ub(s,r,o)),c.count*c.aliasCount>a)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}return r}toJSON(t,n){if(!n)return{source:this.source};let i=this.resolve(n.doc,n);if(!i){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return n.anchors.get(i).res}toString(t,n,i){let r=`*${this.source}`;if(t){if(ioe.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${r} `}return r}};function ub(e,t,n){if(yu.isAlias(t)){let i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(yu.isCollection(t)){let i=0;for(let r of t.items){let o=ub(e,r,n);o>i&&(i=o)}return i}else if(yu.isPair(t)){let i=ub(e,t.key,n),r=ub(e,t.value,n);return Math.max(i,r)}return 1}oj.Alias=mE});var an=q(gE=>{"use strict";var coe=Ze(),loe=lb(),uoe=Is(),doe=e=>!e||typeof e!="function"&&typeof e!="object",As=class extends loe.NodeBase{constructor(t){super(coe.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:uoe.toJS(this.value,t,n)}toString(){return String(this.value)}};As.BLOCK_FOLDED="BLOCK_FOLDED";As.BLOCK_LITERAL="BLOCK_LITERAL";As.PLAIN="PLAIN";As.QUOTE_DOUBLE="QUOTE_DOUBLE";As.QUOTE_SINGLE="QUOTE_SINGLE";gE.Scalar=As;gE.isScalarValue=doe});var Xf=q(aj=>{"use strict";var poe=Qf(),lc=Ze(),sj=an(),foe="tag:yaml.org,2002:";function moe(e,t,n){if(t){let i=n.filter(o=>o.tag===t),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>i.identify?.(e)&&!i.format)}function goe(e,t,n){if(lc.isDocument(e)&&(e=e.contents),lc.isNode(e))return e;if(lc.isPair(e)){let d=n.schema[lc.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:s,sourceObjects:a}=n,c;if(i&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=r(e)),new poe.Alias(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=foe+t.slice(2));let l=moe(e,t,s.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new sj.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?s[lc.MAP]:Symbol.iterator in Object(e)?s[lc.SEQ]:s[lc.MAP]}o&&(o(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new sj.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}aj.createNode=goe});var pb=q(db=>{"use strict";var hoe=Xf(),uo=Ze(),yoe=lb();function hE(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){let o=t[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return hoe.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var cj=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,yE=class extends yoe.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>uo.isNode(i)||uo.isPair(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(cj(t))this.add(n);else{let[i,...r]=t,o=this.get(i,!0);if(uo.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,hE(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){let[n,...i]=t;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(uo.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){let[i,...r]=t,o=this.get(i,!0);return r.length===0?!n&&uo.isScalar(o)?o.value:o:uo.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!uo.isPair(n))return!1;let i=n.value;return i==null||t&&uo.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){let[n,...i]=t;if(i.length===0)return this.has(n);let r=this.get(n,!0);return uo.isCollection(r)?r.hasIn(i):!1}setIn(t,n){let[i,...r]=t;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(uo.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,hE(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};db.Collection=yE;db.collectionFromPath=hE;db.isEmptyPath=cj});var em=q(fb=>{"use strict";var boe=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function bE(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var voe=(e,t,n)=>e.endsWith(` -`)?bE(n,t):n.includes(` +"use strict";var Bse=Object.create;var iT=Object.defineProperty;var Vse=Object.getOwnPropertyDescriptor;var qse=Object.getOwnPropertyNames;var Wse=Object.getPrototypeOf,Hse=Object.prototype.hasOwnProperty;var O=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var H=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},kr=(e,t)=>{for(var n in t)iT(e,n,{get:t[n],enumerable:!0})},Kse=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qse(t))!Hse.call(e,i)&&i!==n&&iT(e,i,{get:()=>t[i],enumerable:!(r=Vse(t,i))||r.enumerable});return e};var gt=(e,t,n)=>(n=e!=null?Bse(Wse(e)):{},Kse(t||!e||!e.__esModule?iT(n,"default",{value:e,enumerable:!0}):n,e));var Je=H(Cn=>{"use strict";var oT=Symbol.for("yaml.alias"),Nz=Symbol.for("yaml.document"),xb=Symbol.for("yaml.map"),Dz=Symbol.for("yaml.pair"),sT=Symbol.for("yaml.scalar"),Eb=Symbol.for("yaml.seq"),qo=Symbol.for("yaml.node.type"),Jse=e=>!!e&&typeof e=="object"&&e[qo]===oT,Zse=e=>!!e&&typeof e=="object"&&e[qo]===Nz,Yse=e=>!!e&&typeof e=="object"&&e[qo]===xb,Qse=e=>!!e&&typeof e=="object"&&e[qo]===Dz,Oz=e=>!!e&&typeof e=="object"&&e[qo]===sT,Xse=e=>!!e&&typeof e=="object"&&e[qo]===Eb;function Mz(e){if(e&&typeof e=="object")switch(e[qo]){case xb:case Eb:return!0}return!1}function eae(e){if(e&&typeof e=="object")switch(e[qo]){case oT:case xb:case sT:case Eb:return!0}return!1}var tae=e=>(Oz(e)||Mz(e))&&!!e.anchor;Cn.ALIAS=oT;Cn.DOC=Nz;Cn.MAP=xb;Cn.NODE_TYPE=qo;Cn.PAIR=Dz;Cn.SCALAR=sT;Cn.SEQ=Eb;Cn.hasAnchor=tae;Cn.isAlias=Jse;Cn.isCollection=Mz;Cn.isDocument=Zse;Cn.isMap=Yse;Cn.isNode=eae;Cn.isPair=Qse;Cn.isScalar=Oz;Cn.isSeq=Xse});var dm=H(aT=>{"use strict";var mn=Je(),_r=Symbol("break visit"),Lz=Symbol("skip children"),co=Symbol("remove node");function Tb(e,t){let n=Fz(t);mn.isDocument(e)?Yl(null,e.contents,n,Object.freeze([e]))===co&&(e.contents=null):Yl(null,e,n,Object.freeze([]))}Tb.BREAK=_r;Tb.SKIP=Lz;Tb.REMOVE=co;function Yl(e,t,n,r){let i=jz(e,t,n,r);if(mn.isNode(i)||mn.isPair(i))return Uz(e,r,i),Yl(e,i,n,r);if(typeof i!="symbol"){if(mn.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o{"use strict";var zz=Je(),nae=dm(),rae={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},iae=e=>e.replace(/[!,[\]{}]/g,t=>rae[t]),pm=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[o,s]=r;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);let o=this.tags[r];if(o)try{return o+decodeURIComponent(i)}catch(s){return n(String(s)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+iae(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(t&&r.length>0&&zz.isNode(t.contents)){let o={};nae.visit(t.contents,(s,a)=>{zz.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of r)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||i.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(` +`)}};pm.defaultYaml={explicit:!1,version:"1.2"};pm.defaultTags={"!!":"tag:yaml.org,2002:"};Gz.Directives=pm});var Ab=H(fm=>{"use strict";var Bz=Je(),oae=dm();function sae(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Vz(e){let t=new Set;return oae.visit(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function qz(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function aae(e,t){let n=[],r=new Map,i=null;return{onAnchor:o=>{n.push(o),i??(i=Vz(e));let s=qz(t,i);return i.add(s),s},setAnchors:()=>{for(let o of n){let s=r.get(o);if(typeof s=="object"&&s.anchor&&(Bz.isScalar(s.node)||Bz.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:r}}fm.anchorIsValid=sae;fm.anchorNames=Vz;fm.createNodeAnchors=aae;fm.findNewAnchor=qz});var lT=H(Wz=>{"use strict";function mm(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,o=r.length;i{"use strict";var cae=Je();function Hz(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Hz(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!cae.hasAnchor(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=o=>{r.res=o,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}Kz.toJS=Hz});var Rb=H(Zz=>{"use strict";var lae=lT(),Jz=Je(),uae=xs(),uT=class{constructor(t){Object.defineProperty(this,Jz.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){if(!Jz.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=uae.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?lae.applyReviver(o,{"":a},"",a):a}};Zz.NodeBase=uT});var gm=H(Yz=>{"use strict";var dae=Ab(),pae=dm(),Xl=Je(),fae=Rb(),mae=xs(),dT=class extends fae.NodeBase{constructor(t){super(Xl.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],pae.visit(t,{Node:(o,s)=>{(Xl.isAlias(s)||Xl.hasAnchor(s))&&r.push(s)}}),n&&(n.aliasResolveCache=r));let i;for(let o of r){if(o===this)break;o.anchor===this.source&&(i=o)}if(i&&n){let{anchors:o,doc:s,maxAliasCount:a}=n,c=o.get(i);if(c||(mae.toJS(i,null,n),c=o.get(i)),c?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Pb(s,i,o)),c.count*c.aliasCount>a)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}return i}toJSON(t,n){if(!n)return{source:this.source};let r=this.resolve(n.doc,n);if(!r){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return n.anchors.get(r).res}toString(t,n,r){let i=`*${this.source}`;if(t){if(dae.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${i} `}return i}};function Pb(e,t,n){if(Xl.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Xl.isCollection(t)){let r=0;for(let i of t.items){let o=Pb(e,i,n);o>r&&(r=o)}return r}else if(Xl.isPair(t)){let r=Pb(e,t.key,n),i=Pb(e,t.value,n);return Math.max(r,i)}return 1}Yz.Alias=dT});var an=H(pT=>{"use strict";var gae=Je(),hae=Rb(),yae=xs(),bae=e=>!e||typeof e!="function"&&typeof e!="object",Es=class extends hae.NodeBase{constructor(t){super(gae.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:yae.toJS(this.value,t,n)}toString(){return String(this.value)}};Es.BLOCK_FOLDED="BLOCK_FOLDED";Es.BLOCK_LITERAL="BLOCK_LITERAL";Es.PLAIN="PLAIN";Es.QUOTE_DOUBLE="QUOTE_DOUBLE";Es.QUOTE_SINGLE="QUOTE_SINGLE";pT.Scalar=Es;pT.isScalarValue=bae});var hm=H(Xz=>{"use strict";var vae=gm(),Ya=Je(),Qz=an(),wae="tag:yaml.org,2002:";function kae(e,t,n){if(t){let r=n.filter(o=>o.tag===t),i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function _ae(e,t,n){if(Ya.isDocument(e)&&(e=e.contents),Ya.isNode(e))return e;if(Ya.isPair(e)){let d=n.schema[Ya.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n,c;if(r&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=i(e)),new vae.Alias(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=wae+t.slice(2));let l=kae(e,t,s.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new Qz.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?s[Ya.MAP]:Symbol.iterator in Object(e)?s[Ya.SEQ]:s[Ya.MAP]}o&&(o(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new Qz.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}Xz.createNode=_ae});var Nb=H(Cb=>{"use strict";var $ae=hm(),lo=Je(),Sae=Rb();function fT(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){let o=t[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=r,r=s}else r=new Map([[o,r]])}return $ae.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var eG=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,mT=class extends Sae.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>lo.isNode(r)||lo.isPair(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(eG(t))this.add(n);else{let[r,...i]=t,o=this.get(r,!0);if(lo.isCollection(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,fT(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){let[n,...r]=t;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(lo.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){let[r,...i]=t,o=this.get(r,!0);return i.length===0?!n&&lo.isScalar(o)?o.value:o:lo.isCollection(o)?o.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!lo.isPair(n))return!1;let r=n.value;return r==null||t&&lo.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){let[n,...r]=t;if(r.length===0)return this.has(n);let i=this.get(n,!0);return lo.isCollection(i)?i.hasIn(r):!1}setIn(t,n){let[r,...i]=t;if(i.length===0)this.set(r,n);else{let o=this.get(r,!0);if(lo.isCollection(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,fT(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};Cb.Collection=mT;Cb.collectionFromPath=fT;Cb.isEmptyPath=eG});var ym=H(Db=>{"use strict";var xae=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function gT(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Eae=(e,t,n)=>e.endsWith(` +`)?gT(n,t):n.includes(` `)?` -`+bE(n,t):(e.endsWith(" ")?"":" ")+n;fb.indentComment=bE;fb.lineComment=voe;fb.stringifyComment=boe});var uj=q(tm=>{"use strict";var woe="flow",vE="block",mb="quoted";function koe(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!r||r<0)return e;rr-Math.max(2,o)?l.push(0):d=r-i);let p,f,m=!1,g=-1,h=-1,b=-1;n===vE&&(g=lj(e,g,t.length),g!==-1&&(d=g+c));for(let w;w=e[g+=1];){if(n===mb&&w==="\\"){switch(h=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if(w===` -`)n===vE&&(g=lj(e,g,t.length)),d=g+t.length+c,p=void 0;else{if(w===" "&&f&&f!==" "&&f!==` +`+gT(n,t):(e.endsWith(" ")?"":" ")+n;Db.indentComment=gT;Db.lineComment=Eae;Db.stringifyComment=xae});var nG=H(bm=>{"use strict";var Tae="flow",hT="block",Ob="quoted";function Iae(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return e;ii-Math.max(2,o)?l.push(0):d=i-r);let p,f,m=!1,g=-1,h=-1,v=-1;n===hT&&(g=tG(e,g,t.length),g!==-1&&(d=g+c));for(let w;w=e[g+=1];){if(n===Ob&&w==="\\"){switch(h=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}v=g}if(w===` +`)n===hT&&(g=tG(e,g,t.length)),d=g+t.length+c,p=void 0;else{if(w===" "&&f&&f!==" "&&f!==` `&&f!==" "){let k=e[g+1];k&&k!==" "&&k!==` -`&&k!==" "&&(p=g)}if(g>=d)if(p)l.push(p),d=p+c,p=void 0;else if(n===mb){for(;f===" "||f===" ";)f=w,w=e[g+=1],m=!0;let k=g>b+1?g-2:h-1;if(u[k])return e;l.push(k),u[k]=!0,d=k+c,p=void 0}else m=!0}f=w}if(m&&a&&a(),l.length===0)return e;s&&s();let y=e.slice(0,l[0]);for(let w=0;w{"use strict";var Mi=an(),Rs=uj(),hb=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),yb=e=>/^(%|---|\.\.\.)/m.test(e);function $oe(e,t,n){if(!t||t<0)return!1;let i=t-n,r=e.length;if(r<=i)return!1;for(let o=0,s=0;oi)return!0;if(s=o+1,r-s<=i)return!1}return!0}function nm(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(yb(e)?" ":""),s="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(s+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{s+=n.slice(a,c);let u=n.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+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||n[c+2]==='"'||n.length=d)if(p)l.push(p),d=p+c,p=void 0;else if(n===Ob){for(;f===" "||f===" ";)f=w,w=e[g+=1],m=!0;let k=g>v+1?g-2:h-1;if(u[k])return e;l.push(k),u[k]=!0,d=k+c,p=void 0}else m=!0}f=w}if(m&&a&&a(),l.length===0)return e;s&&s();let b=e.slice(0,l[0]);for(let w=0;w{"use strict";var Fi=an(),Ts=nG(),Lb=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Fb=e=>/^(%|---|\.\.\.)/m.test(e);function Aae(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let o=0,s=0;or)return!0;if(s=o+1,i-s<=r)return!1}return!0}function vm(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Fb(e)?" ":""),s="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(s+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{s+=n.slice(a,c);let u=n.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+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length -`;let d,p;for(p=n.length;p>0;--p){let _=n[p-1];if(_!==` -`&&_!==" "&&_!==" ")break}let f=n.substring(p),m=f.indexOf(` +`;let d,p;for(p=n.length;p>0;--p){let $=n[p-1];if($!==` +`&&$!==" "&&$!==" ")break}let f=n.substring(p),m=f.indexOf(` `);m===-1?d="-":n===f||m!==f.length-1?(d="+",o&&o()):d="",f&&(n=n.slice(0,-f.length),f[f.length-1]===` -`&&(f=f.slice(0,-1)),f=f.replace(kE,`$&${l}`));let g=!1,h,b=-1;for(h=0;h{S=!0});let E=Rs.foldFlowLines(`${y}${_}${f}`,l,Rs.FOLD_BLOCK,x);if(!S)return`>${k} -${l}${E}`}return n=n.replace(/\n+/g,`$&${l}`),`|${k} -${l}${y}${n}${f}`}function _oe(e,t,n,i){let{type:r,value:o}=e,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&o.includes(` -`)||u&&/[[\]{},]/.test(o))return bu(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` -`)?bu(o,t):gb(e,t,n,i);if(!a&&!u&&r!==Mi.Scalar.PLAIN&&o.includes(` -`))return gb(e,t,n,i);if(yb(o)){if(c==="")return t.forceBlockIndent=!0,gb(e,t,n,i);if(a&&c===l)return bu(o,t)}let d=o.replace(/\n+/g,`$& -${c}`);if(s){let p=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:f,tags:m}=t.doc.schema;if(m.some(p)||f?.some(p))return bu(o,t)}return a?d:Rs.foldFlowLines(d,c,Rs.FOLD_FLOW,hb(t,!1))}function Soe(e,t,n,i){let{implicitKey:r,inFlow:o}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==Mi.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Mi.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Mi.Scalar.BLOCK_FOLDED:case Mi.Scalar.BLOCK_LITERAL:return r||o?bu(s.value,t):gb(s,t,n,i);case Mi.Scalar.QUOTE_DOUBLE:return nm(s.value,t);case Mi.Scalar.QUOTE_SINGLE:return wE(s.value,t);case Mi.Scalar.PLAIN:return _oe(s,t,n,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=t.options,p=r&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}dj.stringifyString=Soe});var im=q($E=>{"use strict";var xoe=cb(),Ns=Ze(),Eoe=em(),Toe=rm();function Ioe(e,t){let n=Object.assign({blockQuote:!0,commentString:Eoe.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},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Aoe(e,t){if(t.tag){let r=e.filter(o=>o.tag===t.tag);if(r.length>0)return r.find(o=>o.format===t.format)??r[0]}let n,i;if(Ns.isScalar(t)){i=t.value;let r=e.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(s=>s.test);o.length>0&&(r=o)}n=r.find(o=>o.format===t.format)??r.find(o=>!o.format)}else i=t,n=e.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Roe(e,t,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(Ns.isScalar(e)||Ns.isCollection(e))&&e.anchor;o&&xoe.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let s=e.tag??(t.default?null:t.tag);return s&&r.push(i.directives.tagString(s)),r.join(" ")}function Noe(e,t,n,i){if(Ns.isPair(e))return e.toString(t,n,i);if(Ns.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r,o=Ns.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>r=c});r??(r=Aoe(t.doc.schema.tags,o));let s=Roe(o,r,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let a=typeof r.stringify=="function"?r.stringify(o,t,n,i):Ns.isScalar(o)?Toe.stringifyString(o,t,n,i):o.toString(t,n,i);return s?Ns.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} -${t.indent}${a}`:a}$E.createStringifyContext=Ioe;$E.stringify=Noe});var gj=q(mj=>{"use strict";var qo=Ze(),pj=an(),fj=im(),om=em();function Coe({key:e,value:t},n,i,r){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,p=qo.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(qo.isCollection(e)||!qo.isNode(e)&&typeof e=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let f=!d&&(!e||p&&t==null&&!n.inFlow||qo.isCollection(e)||(qo.isScalar(e)?e.type===pj.Scalar.BLOCK_FOLDED||e.type===pj.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(d||!o),indent:a+c});let m=!1,g=!1,h=fj.stringify(e,n,()=>m=!0,()=>g=!0);if(!f&&!n.inFlow&&h.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(o||t==null)return m&&i&&i(),h===""?"?":f?`? ${h}`:h}else if(o&&!d||t==null&&f)return h=`? ${h}`,p&&!m?h+=om.lineComment(h,n.indent,l(p)):g&&r&&r(),h;m&&(p=null),f?(p&&(h+=om.lineComment(h,n.indent,l(p))),h=`? ${h} -${a}:`):(h=`${h}:`,p&&(h+=om.lineComment(h,n.indent,l(p))));let b,y,w;qo.isNode(t)?(b=!!t.spaceBefore,y=t.commentBefore,w=t.comment):(b=!1,y=null,w=null,t&&typeof t=="object"&&(t=s.createNode(t))),n.implicitKey=!1,!f&&!p&&qo.isScalar(t)&&(n.indentAtStart=h.length+1),g=!1,!u&&c.length>=2&&!n.inFlow&&!f&&qo.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let k=!1,_=fj.stringify(t,n,()=>k=!0,()=>g=!0),S=" ";if(p||b||y){if(S=b?` -`:"",y){let x=l(y);S+=` -${om.indentComment(x,n.indent)}`}_===""&&!n.inFlow?S===` +`&&(f=f.slice(0,-1)),f=f.replace(bT,`$&${l}`));let g=!1,h,v=-1;for(h=0;h{S=!0});let T=Ts.foldFlowLines(`${b}${$}${f}`,l,Ts.FOLD_BLOCK,E);if(!S)return`>${k} +${l}${T}`}return n=n.replace(/\n+/g,`$&${l}`),`|${k} +${l}${b}${n}${f}`}function Rae(e,t,n,r){let{type:i,value:o}=e,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&o.includes(` +`)||u&&/[[\]{},]/.test(o))return eu(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` +`)?eu(o,t):Mb(e,t,n,r);if(!a&&!u&&i!==Fi.Scalar.PLAIN&&o.includes(` +`))return Mb(e,t,n,r);if(Fb(o)){if(c==="")return t.forceBlockIndent=!0,Mb(e,t,n,r);if(a&&c===l)return eu(o,t)}let d=o.replace(/\n+/g,`$& +${c}`);if(s){let p=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:f,tags:m}=t.doc.schema;if(m.some(p)||f?.some(p))return eu(o,t)}return a?d:Ts.foldFlowLines(d,c,Ts.FOLD_FLOW,Lb(t,!1))}function Pae(e,t,n,r){let{implicitKey:i,inFlow:o}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==Fi.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Fi.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Fi.Scalar.BLOCK_FOLDED:case Fi.Scalar.BLOCK_LITERAL:return i||o?eu(s.value,t):Mb(s,t,n,r);case Fi.Scalar.QUOTE_DOUBLE:return vm(s.value,t);case Fi.Scalar.QUOTE_SINGLE:return yT(s.value,t);case Fi.Scalar.PLAIN:return Rae(s,t,n,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=t.options,p=i&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}rG.stringifyString=Pae});var km=H(vT=>{"use strict";var Cae=Ab(),Is=Je(),Nae=ym(),Dae=wm();function Oae(e,t){let n=Object.assign({blockQuote:!0,commentString:Nae.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},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Mae(e,t){if(t.tag){let i=e.filter(o=>o.tag===t.tag);if(i.length>0)return i.find(o=>o.format===t.format)??i[0]}let n,r;if(Is.isScalar(t)){r=t.value;let i=e.filter(o=>o.identify?.(r));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}n=i.find(o=>o.format===t.format)??i.find(o=>!o.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Lae(e,t,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],o=(Is.isScalar(e)||Is.isCollection(e))&&e.anchor;o&&Cae.anchorIsValid(o)&&(n.add(o),i.push(`&${o}`));let s=e.tag??(t.default?null:t.tag);return s&&i.push(r.directives.tagString(s)),i.join(" ")}function Fae(e,t,n,r){if(Is.isPair(e))return e.toString(t,n,r);if(Is.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,o=Is.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=Mae(t.doc.schema.tags,o));let s=Lae(o,i,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,t,n,r):Is.isScalar(o)?Dae.stringifyString(o,t,n,r):o.toString(t,n,r);return s?Is.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} +${t.indent}${a}`:a}vT.createStringifyContext=Oae;vT.stringify=Fae});var aG=H(sG=>{"use strict";var Wo=Je(),iG=an(),oG=km(),_m=ym();function jae({key:e,value:t},n,r,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,p=Wo.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(Wo.isCollection(e)||!Wo.isNode(e)&&typeof e=="object"){let E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let f=!d&&(!e||p&&t==null&&!n.inFlow||Wo.isCollection(e)||(Wo.isScalar(e)?e.type===iG.Scalar.BLOCK_FOLDED||e.type===iG.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(d||!o),indent:a+c});let m=!1,g=!1,h=oG.stringify(e,n,()=>m=!0,()=>g=!0);if(!f&&!n.inFlow&&h.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(o||t==null)return m&&r&&r(),h===""?"?":f?`? ${h}`:h}else if(o&&!d||t==null&&f)return h=`? ${h}`,p&&!m?h+=_m.lineComment(h,n.indent,l(p)):g&&i&&i(),h;m&&(p=null),f?(p&&(h+=_m.lineComment(h,n.indent,l(p))),h=`? ${h} +${a}:`):(h=`${h}:`,p&&(h+=_m.lineComment(h,n.indent,l(p))));let v,b,w;Wo.isNode(t)?(v=!!t.spaceBefore,b=t.commentBefore,w=t.comment):(v=!1,b=null,w=null,t&&typeof t=="object"&&(t=s.createNode(t))),n.implicitKey=!1,!f&&!p&&Wo.isScalar(t)&&(n.indentAtStart=h.length+1),g=!1,!u&&c.length>=2&&!n.inFlow&&!f&&Wo.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let k=!1,$=oG.stringify(t,n,()=>k=!0,()=>g=!0),S=" ";if(p||v||b){if(S=v?` +`:"",b){let E=l(b);S+=` +${_m.indentComment(E,n.indent)}`}$===""&&!n.inFlow?S===` `&&w&&(S=` `):S+=` -${n.indent}`}else if(!f&&qo.isCollection(t)){let x=_[0],E=_.indexOf(` -`),T=E!==-1,A=n.inFlow??t.flow??t.items.length===0;if(T||!A){let L=!1;if(T&&(x==="&"||x==="!")){let F=_.indexOf(" ");x==="&"&&F!==-1&&F{"use strict";var hj=require("process");function Poe(e,...t){e==="debug"&&console.log(...t)}function Doe(e,t){(e==="debug"||e==="warn")&&(typeof hj.emitWarning=="function"?hj.emitWarning(t):console.warn(t))}_E.debug=Poe;_E.warn=Doe});var $b=q(kb=>{"use strict";var wb=Ze(),yj=an(),bb="<<",vb={identify:e=>e===bb||typeof e=="symbol"&&e.description===bb,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new yj.Scalar(Symbol(bb)),{addToJSMap:bj}),stringify:()=>bb},Ooe=(e,t)=>(vb.identify(t)||wb.isScalar(t)&&(!t.type||t.type===yj.Scalar.PLAIN)&&vb.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===vb.tag&&n.default);function bj(e,t,n){let i=vj(e,n);if(wb.isSeq(i))for(let r of i.items)xE(e,t,r);else if(Array.isArray(i))for(let r of i)xE(e,t,r);else xE(e,t,i)}function xE(e,t,n){let i=vj(e,n);if(!wb.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,e,Map);for(let[o,s]of r)t instanceof Map?t.has(o)||t.set(o,s):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function vj(e,t){return e&&wb.isAlias(t)?t.resolve(e.doc,e):t}kb.addMergeToJSMap=bj;kb.isMergeKey=Ooe;kb.merge=vb});var TE=q($j=>{"use strict";var Moe=SE(),wj=$b(),Loe=im(),kj=Ze(),EE=Is();function Foe(e,t,{key:n,value:i}){if(kj.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(wj.isMergeKey(e,n))wj.addMergeToJSMap(e,t,i);else{let r=EE.toJS(n,"",e);if(t instanceof Map)t.set(r,EE.toJS(i,r,e));else if(t instanceof Set)t.add(r);else{let o=Uoe(n,r,e),s=EE.toJS(i,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}function Uoe(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(kj.isNode(e)&&n?.doc){let i=Loe.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=e.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),Moe.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}$j.addPairToJSMap=Foe});var Cs=q(IE=>{"use strict";var _j=Xf(),joe=gj(),zoe=TE(),_b=Ze();function Goe(e,t,n){let i=_j.createNode(e,void 0,n),r=_j.createNode(t,void 0,n);return new Sb(i,r)}var Sb=class e{constructor(t,n=null){Object.defineProperty(this,_b.NODE_TYPE,{value:_b.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return _b.isNode(n)&&(n=n.clone(t)),_b.isNode(i)&&(i=i.clone(t)),new e(n,i)}toJSON(t,n){let i=n?.mapAsMap?new Map:{};return zoe.addPairToJSMap(n,i,this)}toString(t,n,i){return t?.doc?joe.stringifyPair(this,t,n,i):JSON.stringify(this)}};IE.Pair=Sb;IE.createPair=Goe});var AE=q(xj=>{"use strict";var uc=Ze(),Sj=im(),xb=em();function Voe(e,t,n){return(t.inFlow??e.flow?qoe:Boe)(e,t,n)}function Boe({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:o,type:null}),d=!1,p=[];for(let m=0;mh=null,()=>d=!0);h&&(b+=xb.lineComment(b,o,l(h))),d&&h&&(d=!1),p.push(i+b)}let f;if(p.length===0)f=r.start+r.end;else{f=p[0];for(let m=1;m{"use strict";var cG=require("process");function Uae(e,...t){e==="debug"&&console.log(...t)}function zae(e,t){(e==="debug"||e==="warn")&&(typeof cG.emitWarning=="function"?cG.emitWarning(t):console.warn(t))}wT.debug=Uae;wT.warn=zae});var Bb=H(Gb=>{"use strict";var zb=Je(),lG=an(),jb="<<",Ub={identify:e=>e===jb||typeof e=="symbol"&&e.description===jb,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new lG.Scalar(Symbol(jb)),{addToJSMap:uG}),stringify:()=>jb},Gae=(e,t)=>(Ub.identify(t)||zb.isScalar(t)&&(!t.type||t.type===lG.Scalar.PLAIN)&&Ub.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Ub.tag&&n.default);function uG(e,t,n){let r=dG(e,n);if(zb.isSeq(r))for(let i of r.items)_T(e,t,i);else if(Array.isArray(r))for(let i of r)_T(e,t,i);else _T(e,t,r)}function _T(e,t,n){let r=dG(e,n);if(!zb.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,e,Map);for(let[o,s]of i)t instanceof Map?t.has(o)||t.set(o,s):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function dG(e,t){return e&&zb.isAlias(t)?t.resolve(e.doc,e):t}Gb.addMergeToJSMap=uG;Gb.isMergeKey=Gae;Gb.merge=Ub});var ST=H(mG=>{"use strict";var Bae=kT(),pG=Bb(),Vae=km(),fG=Je(),$T=xs();function qae(e,t,{key:n,value:r}){if(fG.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(pG.isMergeKey(e,n))pG.addMergeToJSMap(e,t,r);else{let i=$T.toJS(n,"",e);if(t instanceof Map)t.set(i,$T.toJS(r,i,e));else if(t instanceof Set)t.add(i);else{let o=Wae(n,i,e),s=$T.toJS(r,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}function Wae(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(fG.isNode(e)&&n?.doc){let r=Vae.createStringifyContext(n.doc,{});r.anchors=new Set;for(let o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=e.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Bae.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}mG.addPairToJSMap=qae});var As=H(xT=>{"use strict";var gG=hm(),Hae=aG(),Kae=ST(),Vb=Je();function Jae(e,t,n){let r=gG.createNode(e,void 0,n),i=gG.createNode(t,void 0,n);return new qb(r,i)}var qb=class e{constructor(t,n=null){Object.defineProperty(this,Vb.NODE_TYPE,{value:Vb.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Vb.isNode(n)&&(n=n.clone(t)),Vb.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(t,n){let r=n?.mapAsMap?new Map:{};return Kae.addPairToJSMap(n,r,this)}toString(t,n,r){return t?.doc?Hae.stringifyPair(this,t,n,r):JSON.stringify(this)}};xT.Pair=qb;xT.createPair=Jae});var ET=H(yG=>{"use strict";var Qa=Je(),hG=km(),Wb=ym();function Zae(e,t,n){return(t.inFlow??e.flow?Qae:Yae)(e,t,n)}function Yae({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:o,type:null}),d=!1,p=[];for(let m=0;mh=null,()=>d=!0);h&&(v+=Wb.lineComment(v,o,l(h))),d&&h&&(d=!1),p.push(r+v)}let f;if(p.length===0)f=i.start+i.end;else{f=p[0];for(let m=1;mh=null);l||(l=d.length>u||b.includes(` -`)),m0&&(l||(l=d.reduce((y,w)=>y+w.length+2,2)+(b.length+2)>t.options.lineWidth)),l&&(b+=",")),h&&(b+=xb.lineComment(b,i,a(h))),d.push(b),u=d.length}let{start:p,end:f}=n;if(d.length===0)return p+f;if(!l){let m=d.reduce((g,h)=>g+h.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=p;for(let g of d)m+=g?` -${o}${r}${g}`:` +`+Wb.indentComment(l(e),c),a&&a()):d&&s&&s(),f}function Qae({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=t;r+=o;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let m=0;mh=null);l||(l=d.length>u||v.includes(` +`)),m0&&(l||(l=d.reduce((b,w)=>b+w.length+2,2)+(v.length+2)>t.options.lineWidth)),l&&(v+=",")),h&&(v+=Wb.lineComment(v,r,a(h))),d.push(v),u=d.length}let{start:p,end:f}=n;if(d.length===0)return p+f;if(!l){let m=d.reduce((g,h)=>g+h.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=p;for(let g of d)m+=g?` +${o}${i}${g}`:` `;return`${m} -${r}${f}`}else return`${p}${s}${d.join(" ")}${s}${f}`}function Eb({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=xb.indentComment(t(i),e);n.push(o.trimStart())}}xj.stringifyCollection=Voe});var Ds=q(NE=>{"use strict";var Woe=AE(),Hoe=TE(),Koe=pb(),Ps=Ze(),Tb=Cs(),Joe=an();function sm(e,t){let n=Ps.isScalar(t)?t.value:t;for(let i of e)if(Ps.isPair(i)&&(i.key===t||i.key===n||Ps.isScalar(i.key)&&i.key.value===n))return i}var RE=class extends Koe.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ps.MAP,t),this.items=[]}static from(t,n,i){let{keepUndefined:r,replacer:o}=i,s=new this(t),a=(c,l)=>{if(typeof o=="function")l=o.call(n,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||r)&&s.items.push(Tb.createPair(c,l,i))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){let i;Ps.isPair(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Tb.Pair(t,t?.value):i=new Tb.Pair(t.key,t.value);let r=sm(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Ps.isScalar(r.value)&&Joe.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(t){let n=sm(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let r=sm(this.items,t)?.value;return(!n&&Ps.isScalar(r)?r.value:r)??void 0}has(t){return!!sm(this.items,t)}set(t,n){this.add(new Tb.Pair(t,n),!0)}toJSON(t,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)Hoe.addPairToJSMap(n,r,o);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(let r of this.items)if(!Ps.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Woe.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}};NE.YAMLMap=RE;NE.findPair=sm});var vu=q(Tj=>{"use strict";var Zoe=Ze(),Ej=Ds(),Yoe={collection:"map",default:!0,nodeClass:Ej.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return Zoe.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ej.YAMLMap.from(e,t,n)};Tj.map=Yoe});var Os=q(Ij=>{"use strict";var Qoe=Xf(),Xoe=AE(),ese=pb(),Ab=Ze(),tse=an(),nse=Is(),CE=class extends ese.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ab.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Ib(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let i=Ib(t);if(typeof i!="number")return;let r=this.items[i];return!n&&Ab.isScalar(r)?r.value:r}has(t){let n=Ib(t);return typeof n=="number"&&n=0?t:null}Ij.YAMLSeq=CE});var wu=q(Rj=>{"use strict";var rse=Ze(),Aj=Os(),ise={collection:"seq",default:!0,nodeClass:Aj.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return rse.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Aj.YAMLSeq.from(e,t,n)};Rj.seq=ise});var am=q(Nj=>{"use strict";var ose=rm(),sse={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),ose.stringifyString(e,t,n,i)}};Nj.string=sse});var Rb=q(Dj=>{"use strict";var Cj=an(),Pj={identify:e=>e==null,createNode:()=>new Cj.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Cj.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Pj.test.test(e)?e:t.options.nullStr};Dj.nullTag=Pj});var PE=q(Mj=>{"use strict";var ase=an(),Oj={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ase.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Oj.test.test(e)){let i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};Mj.boolTag=Oj});var ku=q(Lj=>{"use strict";function cse({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=t-(o.length-s-1);for(;a-- >0;)o+="0"}return o}Lj.stringifyNumber=cse});var OE=q(Nb=>{"use strict";var lse=an(),DE=ku(),use={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:DE.stringifyNumber},dse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():DE.stringifyNumber(e)}},pse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new lse.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:DE.stringifyNumber};Nb.float=pse;Nb.floatExp=dse;Nb.floatNaN=use});var LE=q(Pb=>{"use strict";var Fj=ku(),Cb=e=>typeof e=="bigint"||Number.isInteger(e),ME=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Uj(e,t,n){let{value:i}=e;return Cb(i)&&i>=0?n+i.toString(t):Fj.stringifyNumber(e)}var fse={identify:e=>Cb(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>ME(e,2,8,n),stringify:e=>Uj(e,8,"0o")},mse={identify:Cb,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ME(e,0,10,n),stringify:Fj.stringifyNumber},gse={identify:e=>Cb(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ME(e,2,16,n),stringify:e=>Uj(e,16,"0x")};Pb.int=mse;Pb.intHex=gse;Pb.intOct=fse});var zj=q(jj=>{"use strict";var hse=vu(),yse=Rb(),bse=wu(),vse=am(),wse=PE(),FE=OE(),UE=LE(),kse=[hse.map,bse.seq,vse.string,yse.nullTag,wse.boolTag,UE.intOct,UE.int,UE.intHex,FE.floatNaN,FE.floatExp,FE.float];jj.schema=kse});var Bj=q(Vj=>{"use strict";var $se=an(),_se=vu(),Sse=wu();function Gj(e){return typeof e=="bigint"||Number.isInteger(e)}var Db=({value:e})=>JSON.stringify(e),xse=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Db},{identify:e=>e==null,createNode:()=>new $se.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Db},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Db},{identify:Gj,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Gj(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Db}],Ese={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Tse=[_se.map,Sse.seq].concat(xse,Ese);Vj.schema=Tse});var zE=q(qj=>{"use strict";var cm=require("buffer"),jE=an(),Ise=rm(),Ase={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof cm.Buffer=="function")return cm.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r{"use strict";var Ob=Ze(),GE=Cs(),Rse=an(),Nse=Os();function Wj(e,t){if(Ob.isSeq(e))for(let n=0;n1&&t("Each pair must have its own sequence indicator");let r=i.items[0]||new GE.Pair(new Rse.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} -${r.key.commentBefore}`:i.commentBefore),i.comment){let o=r.value??r.key;o.comment=o.comment?`${i.comment} -${o.comment}`:i.comment}i=r}e.items[n]=Ob.isPair(i)?i:new GE.Pair(i)}}else t("Expected a sequence for this tag");return e}function Hj(e,t,n){let{replacer:i}=n,r=new Nse.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof i=="function"&&(s=i.call(t,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;r.items.push(GE.createPair(a,c,n))}return r}var Cse={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Wj,createNode:Hj};Mb.createPairs=Hj;Mb.pairs=Cse;Mb.resolvePairs=Wj});var qE=q(BE=>{"use strict";var Kj=Ze(),VE=Is(),lm=Ds(),Pse=Os(),Jj=Lb(),dc=class e extends Pse.YAMLSeq{constructor(){super(),this.add=lm.YAMLMap.prototype.add.bind(this),this.delete=lm.YAMLMap.prototype.delete.bind(this),this.get=lm.YAMLMap.prototype.get.bind(this),this.has=lm.YAMLMap.prototype.has.bind(this),this.set=lm.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,s;if(Kj.isPair(r)?(o=VE.toJS(r.key,"",n),s=VE.toJS(r.value,o,n)):o=VE.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(t,n,i){let r=Jj.createPairs(t,n,i),o=new this;return o.items=r.items,o}};dc.tag="tag:yaml.org,2002:omap";var Dse={collection:"seq",identify:e=>e instanceof Map,nodeClass:dc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=Jj.resolvePairs(e,t),i=[];for(let{key:r}of n.items)Kj.isScalar(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new dc,n)},createNode:(e,t,n)=>dc.from(e,t,n)};BE.YAMLOMap=dc;BE.omap=Dse});var ez=q(WE=>{"use strict";var Zj=an();function Yj({value:e,source:t},n){return t&&(e?Qj:Xj).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Qj={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Zj.Scalar(!0),stringify:Yj},Xj={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Zj.Scalar(!1),stringify:Yj};WE.falseTag=Xj;WE.trueTag=Qj});var tz=q(Fb=>{"use strict";var Ose=an(),HE=ku(),Mse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:HE.stringifyNumber},Lse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():HE.stringifyNumber(e)}},Fse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Ose.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:HE.stringifyNumber};Fb.float=Fse;Fb.floatExp=Lse;Fb.floatNaN=Mse});var rz=q(dm=>{"use strict";var nz=ku(),um=e=>typeof e=="bigint"||Number.isInteger(e);function Ub(e,t,n,{intAsBigInt:i}){let r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return r==="-"?BigInt(-1)*s:s}let o=parseInt(e,n);return r==="-"?-1*o:o}function KE(e,t,n){let{value:i}=e;if(um(i)){let r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return nz.stringifyNumber(e)}var Use={identify:um,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Ub(e,2,2,n),stringify:e=>KE(e,2,"0b")},jse={identify:um,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Ub(e,1,8,n),stringify:e=>KE(e,8,"0")},zse={identify:um,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Ub(e,0,10,n),stringify:nz.stringifyNumber},Gse={identify:um,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Ub(e,2,16,n),stringify:e=>KE(e,16,"0x")};dm.int=zse;dm.intBin=Use;dm.intHex=Gse;dm.intOct=jse});var ZE=q(JE=>{"use strict";var Gb=Ze(),jb=Cs(),zb=Ds(),pc=class e extends zb.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;Gb.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new jb.Pair(t.key,null):n=new jb.Pair(t,null),zb.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let i=zb.findPair(this.items,t);return!n&&Gb.isPair(i)?Gb.isScalar(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=zb.findPair(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new jb.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof r=="function"&&(s=r.call(n,s,s)),o.items.push(jb.createPair(s,null,i));return o}};pc.tag="tag:yaml.org,2002:set";var Vse={collection:"map",identify:e=>e instanceof Set,nodeClass:pc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>pc.from(e,t,n),resolve(e,t){if(Gb.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new pc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};JE.YAMLSet=pc;JE.set=Vse});var QE=q(Vb=>{"use strict";var Bse=ku();function YE(e,t){let n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=s=>t?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*r(60)+r(a),r(0));return n==="-"?r(-1)*o:o}function iz(e){let{value:t}=e,n=s=>s;if(typeof t=="bigint")n=s=>BigInt(s);else if(isNaN(t)||!isFinite(t))return Bse.stringifyNumber(e);let i="";t<0&&(i="-",t*=n(-1));let r=n(60),o=[t%r];return t<60?o.unshift(0):(t=(t-o[0])/r,o.unshift(t%r),t>=60&&(t=(t-o[0])/r,o.unshift(t))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var qse={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>YE(e,n),stringify:iz},Wse={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>YE(e,!1),stringify:iz},oz={identify:e=>e 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(e){let t=e.match(oz.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,o||0,s||0,a||0,c),u=t[8];if(u&&u!=="Z"){let d=YE(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Vb.floatTime=Wse;Vb.intTime=qse;Vb.timestamp=oz});var cz=q(az=>{"use strict";var Hse=vu(),Kse=Rb(),Jse=wu(),Zse=am(),Yse=zE(),sz=ez(),XE=tz(),Bb=rz(),Qse=$b(),Xse=qE(),eae=Lb(),tae=ZE(),eT=QE(),nae=[Hse.map,Jse.seq,Zse.string,Kse.nullTag,sz.trueTag,sz.falseTag,Bb.intBin,Bb.intOct,Bb.int,Bb.intHex,XE.floatNaN,XE.floatExp,XE.float,Yse.binary,Qse.merge,Xse.omap,eae.pairs,tae.set,eT.intTime,eT.floatTime,eT.timestamp];az.schema=nae});var bz=q(rT=>{"use strict";var pz=vu(),rae=Rb(),fz=wu(),iae=am(),oae=PE(),tT=OE(),nT=LE(),sae=zj(),aae=Bj(),mz=zE(),pm=$b(),gz=qE(),hz=Lb(),lz=cz(),yz=ZE(),qb=QE(),uz=new Map([["core",sae.schema],["failsafe",[pz.map,fz.seq,iae.string]],["json",aae.schema],["yaml11",lz.schema],["yaml-1.1",lz.schema]]),dz={binary:mz.binary,bool:oae.boolTag,float:tT.float,floatExp:tT.floatExp,floatNaN:tT.floatNaN,floatTime:qb.floatTime,int:nT.int,intHex:nT.intHex,intOct:nT.intOct,intTime:qb.intTime,map:pz.map,merge:pm.merge,null:rae.nullTag,omap:gz.omap,pairs:hz.pairs,seq:fz.seq,set:yz.set,timestamp:qb.timestamp},cae={"tag:yaml.org,2002:binary":mz.binary,"tag:yaml.org,2002:merge":pm.merge,"tag:yaml.org,2002:omap":gz.omap,"tag:yaml.org,2002:pairs":hz.pairs,"tag:yaml.org,2002:set":yz.set,"tag:yaml.org,2002:timestamp":qb.timestamp};function lae(e,t,n){let i=uz.get(t);if(i&&!e)return n&&!i.includes(pm.merge)?i.concat(pm.merge):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{let o=Array.from(uz.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)r=r.concat(o);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(pm.merge)),r.reduce((o,s)=>{let a=typeof s=="string"?dz[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(dz).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},[])}rT.coreKnownTags=cae;rT.getTags=lae});var sT=q(vz=>{"use strict";var iT=Ze(),uae=vu(),dae=wu(),pae=am(),Wb=bz(),fae=(e,t)=>e.keyt.key?1:0,oT=class e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(t)?Wb.getTags(t,"compat"):t?Wb.getTags(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?Wb.coreKnownTags:{},this.tags=Wb.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,iT.MAP,{value:uae.map}),Object.defineProperty(this,iT.SCALAR,{value:pae.string}),Object.defineProperty(this,iT.SEQ,{value:dae.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?fae:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};vz.Schema=oT});var kz=q(wz=>{"use strict";var mae=Ze(),aT=im(),fm=em();function gae(e,t){let n=[],i=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");let r=aT.createStringifyContext(e,t),{commentString:o}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=o(e.commentBefore);n.unshift(fm.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(mae.isNode(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){let u=o(e.contents.commentBefore);n.push(fm.indentComment(u,""))}r.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=aT.stringify(e.contents,r,()=>a=null,c);a&&(l+=fm.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(aT.stringify(e.contents,r));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);c.includes(` -`)?(n.push("..."),n.push(fm.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(fm.indentComment(o(c),"")))}return n.join(` +${i}${f}`}else return`${p}${s}${d.join(" ")}${s}${f}`}function Hb({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let o=Wb.indentComment(t(r),e);n.push(o.trimStart())}}yG.stringifyCollection=Zae});var Ps=H(IT=>{"use strict";var Xae=ET(),ece=ST(),tce=Nb(),Rs=Je(),Kb=As(),nce=an();function $m(e,t){let n=Rs.isScalar(t)?t.value:t;for(let r of e)if(Rs.isPair(r)&&(r.key===t||r.key===n||Rs.isScalar(r.key)&&r.key.value===n))return r}var TT=class extends tce.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Rs.MAP,t),this.items=[]}static from(t,n,r){let{keepUndefined:i,replacer:o}=r,s=new this(t),a=(c,l)=>{if(typeof o=="function")l=o.call(n,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(Kb.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){let r;Rs.isPair(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Kb.Pair(t,t?.value):r=new Kb.Pair(t.key,t.value);let i=$m(this.items,r.key),o=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Rs.isScalar(i.value)&&nce.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(o){let s=this.items.findIndex(a=>o(r,a)<0);s===-1?this.items.push(r):this.items.splice(s,0,r)}else this.items.push(r)}delete(t){let n=$m(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let i=$m(this.items,t)?.value;return(!n&&Rs.isScalar(i)?i.value:i)??void 0}has(t){return!!$m(this.items,t)}set(t,n){this.add(new Kb.Pair(t,n),!0)}toJSON(t,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let o of this.items)ece.addPairToJSMap(n,i,o);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(let i of this.items)if(!Rs.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Xae.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}};IT.YAMLMap=TT;IT.findPair=$m});var tu=H(vG=>{"use strict";var rce=Je(),bG=Ps(),ice={collection:"map",default:!0,nodeClass:bG.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return rce.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>bG.YAMLMap.from(e,t,n)};vG.map=ice});var Cs=H(wG=>{"use strict";var oce=hm(),sce=ET(),ace=Nb(),Zb=Je(),cce=an(),lce=xs(),AT=class extends ace.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Zb.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Jb(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let r=Jb(t);if(typeof r!="number")return;let i=this.items[r];return!n&&Zb.isScalar(i)?i.value:i}has(t){let n=Jb(t);return typeof n=="number"&&n=0?t:null}wG.YAMLSeq=AT});var nu=H(_G=>{"use strict";var uce=Je(),kG=Cs(),dce={collection:"seq",default:!0,nodeClass:kG.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return uce.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>kG.YAMLSeq.from(e,t,n)};_G.seq=dce});var Sm=H($G=>{"use strict";var pce=wm(),fce={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),pce.stringifyString(e,t,n,r)}};$G.string=fce});var Yb=H(EG=>{"use strict";var SG=an(),xG={identify:e=>e==null,createNode:()=>new SG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new SG.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&xG.test.test(e)?e:t.options.nullStr};EG.nullTag=xG});var RT=H(IG=>{"use strict";var mce=an(),TG={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new mce.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&TG.test.test(e)){let r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};IG.boolTag=TG});var ru=H(AG=>{"use strict";function gce({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=t-(o.length-s-1);for(;a-- >0;)o+="0"}return o}AG.stringifyNumber=gce});var CT=H(Qb=>{"use strict";var hce=an(),PT=ru(),yce={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:PT.stringifyNumber},bce={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():PT.stringifyNumber(e)}},vce={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new hce.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:PT.stringifyNumber};Qb.float=vce;Qb.floatExp=bce;Qb.floatNaN=yce});var DT=H(ev=>{"use strict";var RG=ru(),Xb=e=>typeof e=="bigint"||Number.isInteger(e),NT=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function PG(e,t,n){let{value:r}=e;return Xb(r)&&r>=0?n+r.toString(t):RG.stringifyNumber(e)}var wce={identify:e=>Xb(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>NT(e,2,8,n),stringify:e=>PG(e,8,"0o")},kce={identify:Xb,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>NT(e,0,10,n),stringify:RG.stringifyNumber},_ce={identify:e=>Xb(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>NT(e,2,16,n),stringify:e=>PG(e,16,"0x")};ev.int=kce;ev.intHex=_ce;ev.intOct=wce});var NG=H(CG=>{"use strict";var $ce=tu(),Sce=Yb(),xce=nu(),Ece=Sm(),Tce=RT(),OT=CT(),MT=DT(),Ice=[$ce.map,xce.seq,Ece.string,Sce.nullTag,Tce.boolTag,MT.intOct,MT.int,MT.intHex,OT.floatNaN,OT.floatExp,OT.float];CG.schema=Ice});var MG=H(OG=>{"use strict";var Ace=an(),Rce=tu(),Pce=nu();function DG(e){return typeof e=="bigint"||Number.isInteger(e)}var tv=({value:e})=>JSON.stringify(e),Cce=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:tv},{identify:e=>e==null,createNode:()=>new Ace.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:tv},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:tv},{identify:DG,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>DG(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:tv}],Nce={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Dce=[Rce.map,Pce.seq].concat(Cce,Nce);OG.schema=Dce});var FT=H(LG=>{"use strict";var xm=require("buffer"),LT=an(),Oce=wm(),Mce={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof xm.Buffer=="function")return xm.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i{"use strict";var nv=Je(),jT=As(),Lce=an(),Fce=Cs();function FG(e,t){if(nv.isSeq(e))for(let n=0;n1&&t("Each pair must have its own sequence indicator");let i=r.items[0]||new jT.Pair(new Lce.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore} +${i.key.commentBefore}`:r.commentBefore),r.comment){let o=i.value??i.key;o.comment=o.comment?`${r.comment} +${o.comment}`:r.comment}r=i}e.items[n]=nv.isPair(r)?r:new jT.Pair(r)}}else t("Expected a sequence for this tag");return e}function jG(e,t,n){let{replacer:r}=n,i=new Fce.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof r=="function"&&(s=r.call(t,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(jT.createPair(a,c,n))}return i}var jce={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:FG,createNode:jG};rv.createPairs=jG;rv.pairs=jce;rv.resolvePairs=FG});var GT=H(zT=>{"use strict";var UG=Je(),UT=xs(),Em=Ps(),Uce=Cs(),zG=iv(),Xa=class e extends Uce.YAMLSeq{constructor(){super(),this.add=Em.YAMLMap.prototype.add.bind(this),this.delete=Em.YAMLMap.prototype.delete.bind(this),this.get=Em.YAMLMap.prototype.get.bind(this),this.has=Em.YAMLMap.prototype.has.bind(this),this.set=Em.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let o,s;if(UG.isPair(i)?(o=UT.toJS(i.key,"",n),s=UT.toJS(i.value,o,n)):o=UT.toJS(i,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,s)}return r}static from(t,n,r){let i=zG.createPairs(t,n,r),o=new this;return o.items=i.items,o}};Xa.tag="tag:yaml.org,2002:omap";var zce={collection:"seq",identify:e=>e instanceof Map,nodeClass:Xa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=zG.resolvePairs(e,t),r=[];for(let{key:i}of n.items)UG.isScalar(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Xa,n)},createNode:(e,t,n)=>Xa.from(e,t,n)};zT.YAMLOMap=Xa;zT.omap=zce});var WG=H(BT=>{"use strict";var GG=an();function BG({value:e,source:t},n){return t&&(e?VG:qG).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var VG={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new GG.Scalar(!0),stringify:BG},qG={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new GG.Scalar(!1),stringify:BG};BT.falseTag=qG;BT.trueTag=VG});var HG=H(ov=>{"use strict";var Gce=an(),VT=ru(),Bce={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:VT.stringifyNumber},Vce={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():VT.stringifyNumber(e)}},qce={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Gce.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:VT.stringifyNumber};ov.float=qce;ov.floatExp=Vce;ov.floatNaN=Bce});var JG=H(Im=>{"use strict";var KG=ru(),Tm=e=>typeof e=="bigint"||Number.isInteger(e);function sv(e,t,n,{intAsBigInt:r}){let i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return i==="-"?BigInt(-1)*s:s}let o=parseInt(e,n);return i==="-"?-1*o:o}function qT(e,t,n){let{value:r}=e;if(Tm(r)){let i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return KG.stringifyNumber(e)}var Wce={identify:Tm,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>sv(e,2,2,n),stringify:e=>qT(e,2,"0b")},Hce={identify:Tm,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>sv(e,1,8,n),stringify:e=>qT(e,8,"0")},Kce={identify:Tm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>sv(e,0,10,n),stringify:KG.stringifyNumber},Jce={identify:Tm,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>sv(e,2,16,n),stringify:e=>qT(e,16,"0x")};Im.int=Kce;Im.intBin=Wce;Im.intHex=Jce;Im.intOct=Hce});var HT=H(WT=>{"use strict";var lv=Je(),av=As(),cv=Ps(),ec=class e extends cv.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;lv.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new av.Pair(t.key,null):n=new av.Pair(t,null),cv.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let r=cv.findPair(this.items,t);return!n&&lv.isPair(r)?lv.isScalar(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=cv.findPair(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new av.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){let{replacer:i}=r,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof i=="function"&&(s=i.call(n,s,s)),o.items.push(av.createPair(s,null,r));return o}};ec.tag="tag:yaml.org,2002:set";var Zce={collection:"map",identify:e=>e instanceof Set,nodeClass:ec,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ec.from(e,t,n),resolve(e,t){if(lv.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new ec,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};WT.YAMLSet=ec;WT.set=Zce});var JT=H(uv=>{"use strict";var Yce=ru();function KT(e,t){let n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=s=>t?BigInt(s):Number(s),o=r.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return n==="-"?i(-1)*o:o}function ZG(e){let{value:t}=e,n=s=>s;if(typeof t=="bigint")n=s=>BigInt(s);else if(isNaN(t)||!isFinite(t))return Yce.stringifyNumber(e);let r="";t<0&&(r="-",t*=n(-1));let i=n(60),o=[t%i];return t<60?o.unshift(0):(t=(t-o[0])/i,o.unshift(t%i),t>=60&&(t=(t-o[0])/i,o.unshift(t))),r+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Qce={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>KT(e,n),stringify:ZG},Xce={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>KT(e,!1),stringify:ZG},YG={identify:e=>e 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(e){let t=e.match(YG.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,o||0,s||0,a||0,c),u=t[8];if(u&&u!=="Z"){let d=KT(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};uv.floatTime=Xce;uv.intTime=Qce;uv.timestamp=YG});var eB=H(XG=>{"use strict";var ele=tu(),tle=Yb(),nle=nu(),rle=Sm(),ile=FT(),QG=WG(),ZT=HG(),dv=JG(),ole=Bb(),sle=GT(),ale=iv(),cle=HT(),YT=JT(),lle=[ele.map,nle.seq,rle.string,tle.nullTag,QG.trueTag,QG.falseTag,dv.intBin,dv.intOct,dv.int,dv.intHex,ZT.floatNaN,ZT.floatExp,ZT.float,ile.binary,ole.merge,sle.omap,ale.pairs,cle.set,YT.intTime,YT.floatTime,YT.timestamp];XG.schema=lle});var uB=H(eI=>{"use strict";var iB=tu(),ule=Yb(),oB=nu(),dle=Sm(),ple=RT(),QT=CT(),XT=DT(),fle=NG(),mle=MG(),sB=FT(),Am=Bb(),aB=GT(),cB=iv(),tB=eB(),lB=HT(),pv=JT(),nB=new Map([["core",fle.schema],["failsafe",[iB.map,oB.seq,dle.string]],["json",mle.schema],["yaml11",tB.schema],["yaml-1.1",tB.schema]]),rB={binary:sB.binary,bool:ple.boolTag,float:QT.float,floatExp:QT.floatExp,floatNaN:QT.floatNaN,floatTime:pv.floatTime,int:XT.int,intHex:XT.intHex,intOct:XT.intOct,intTime:pv.intTime,map:iB.map,merge:Am.merge,null:ule.nullTag,omap:aB.omap,pairs:cB.pairs,seq:oB.seq,set:lB.set,timestamp:pv.timestamp},gle={"tag:yaml.org,2002:binary":sB.binary,"tag:yaml.org,2002:merge":Am.merge,"tag:yaml.org,2002:omap":aB.omap,"tag:yaml.org,2002:pairs":cB.pairs,"tag:yaml.org,2002:set":lB.set,"tag:yaml.org,2002:timestamp":pv.timestamp};function hle(e,t,n){let r=nB.get(t);if(r&&!e)return n&&!r.includes(Am.merge)?r.concat(Am.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let o=Array.from(nB.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)i=i.concat(o);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Am.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?rB[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(rB).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},[])}eI.coreKnownTags=gle;eI.getTags=hle});var rI=H(dB=>{"use strict";var tI=Je(),yle=tu(),ble=nu(),vle=Sm(),fv=uB(),wle=(e,t)=>e.keyt.key?1:0,nI=class e{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(t)?fv.getTags(t,"compat"):t?fv.getTags(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?fv.coreKnownTags:{},this.tags=fv.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,tI.MAP,{value:yle.map}),Object.defineProperty(this,tI.SCALAR,{value:vle.string}),Object.defineProperty(this,tI.SEQ,{value:ble.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?wle:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};dB.Schema=nI});var fB=H(pB=>{"use strict";var kle=Je(),iI=km(),Rm=ym();function _le(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");let i=iI.createStringifyContext(e,t),{commentString:o}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=o(e.commentBefore);n.unshift(Rm.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(kle.isNode(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){let u=o(e.contents.commentBefore);n.push(Rm.indentComment(u,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=iI.stringify(e.contents,i,()=>a=null,c);a&&(l+=Rm.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(iI.stringify(e.contents,i));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);c.includes(` +`)?(n.push("..."),n.push(Rm.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(Rm.indentComment(o(c),"")))}return n.join(` `)+` -`}wz.stringifyDocument=gae});var mm=q($z=>{"use strict";var hae=Qf(),$u=pb(),ai=Ze(),yae=Cs(),bae=Is(),vae=sT(),wae=kz(),cT=cb(),kae=pE(),$ae=Xf(),lT=dE(),uT=class e{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ai.NODE_TYPE,{value:ai.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new lT.Directives({version:s}),this.setSchema(s,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){let t=Object.create(e.prototype,{[ai.NODE_TYPE]:{value:ai.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ai.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){_u(this.contents)&&this.contents.add(t)}addIn(t,n){_u(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let i=cT.anchorNames(this);t.anchor=!n||i.has(n)?cT.findNewAnchor(n||"a",i):n}return new hae.Alias(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){let h=y=>typeof y=="number"||y instanceof String||y instanceof Number,b=n.filter(h).map(String);b.length>0&&(n=n.concat(b)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=i??{},{onAnchor:d,setAnchors:p,sourceObjects:f}=cT.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:f},g=$ae.createNode(t,u,m);return a&&ai.isCollection(g)&&(g.flow=!0),p(),g}createPair(t,n,i={}){let r=this.createNode(t,null,i),o=this.createNode(n,null,i);return new yae.Pair(r,o)}delete(t){return _u(this.contents)?this.contents.delete(t):!1}deleteIn(t){return $u.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):_u(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return ai.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return $u.isEmptyPath(t)?!n&&ai.isScalar(this.contents)?this.contents.value:this.contents:ai.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return ai.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return $u.isEmptyPath(t)?this.contents!==void 0:ai.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=$u.collectionFromPath(this.schema,[t],n):_u(this.contents)&&this.contents.set(t,n)}setIn(t,n){$u.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=$u.collectionFromPath(this.schema,Array.from(t),n):_u(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new lT.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new lT.Directives({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new vae.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=bae.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?kae.applyReviver(s,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return wae.stringifyDocument(this,t)}};function _u(e){if(ai.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}$z.Document=uT});var ym=q(hm=>{"use strict";var gm=class extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}},dT=class extends gm{constructor(t,n,i){super("YAMLParseError",t,n,i)}},pT=class extends gm{constructor(t,n,i){super("YAMLWarning",t,n,i)}},_ae=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,s=e.substring(t.lineStarts[i-1],t.lineStarts[i]).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"),i>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 -`),s=a+s}if(/[^ ]/.test(s)){let a=1,c=n.linePos[1];c?.line===i&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-o)));let l=" ".repeat(o)+"^".repeat(a);n.message+=`: +`}pB.stringifyDocument=_le});var Pm=H(mB=>{"use strict";var $le=gm(),iu=Nb(),si=Je(),Sle=As(),xle=xs(),Ele=rI(),Tle=fB(),oI=Ab(),Ile=lT(),Ale=hm(),sI=cT(),aI=class e{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,si.NODE_TYPE,{value:si.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:s}=o;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new sI.Directives({version:s}),this.setSchema(s,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){let t=Object.create(e.prototype,{[si.NODE_TYPE]:{value:si.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=si.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ou(this.contents)&&this.contents.add(t)}addIn(t,n){ou(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let r=oI.anchorNames(this);t.anchor=!n||r.has(n)?oI.findNewAnchor(n||"a",r):n}return new $le.Alias(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){let h=b=>typeof b=="number"||b instanceof String||b instanceof Number,v=n.filter(h).map(String);v.length>0&&(n=n.concat(v)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:p,sourceObjects:f}=oI.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:f},g=Ale.createNode(t,u,m);return a&&si.isCollection(g)&&(g.flow=!0),p(),g}createPair(t,n,r={}){let i=this.createNode(t,null,r),o=this.createNode(n,null,r);return new Sle.Pair(i,o)}delete(t){return ou(this.contents)?this.contents.delete(t):!1}deleteIn(t){return iu.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):ou(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return si.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return iu.isEmptyPath(t)?!n&&si.isScalar(this.contents)?this.contents.value:this.contents:si.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return si.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return iu.isEmptyPath(t)?this.contents!==void 0:si.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=iu.collectionFromPath(this.schema,[t],n):ou(this.contents)&&this.contents.set(t,n)}setIn(t,n){iu.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=iu.collectionFromPath(this.schema,Array.from(t),n):ou(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new sI.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new sI.Directives({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Ele.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=xle.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Ile.applyReviver(s,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Tle.stringifyDocument(this,t)}};function ou(e){if(si.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}mB.Document=aI});var Dm=H(Nm=>{"use strict";var Cm=class extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}},cI=class extends Cm{constructor(t,n,r){super("YAMLParseError",t,n,r)}},lI=class extends Cm{constructor(t,n,r){super("YAMLWarning",t,n,r)}},Rle=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,s=e.substring(t.lineStarts[r-1],t.lineStarts[r]).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"),r>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`),s=a+s}if(/[^ ]/.test(s)){let a=1,c=n.linePos[1];c?.line===r&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);n.message+=`: ${s} ${l} -`}};hm.YAMLError=gm;hm.YAMLParseError=dT;hm.YAMLWarning=pT;hm.prettifyError=_ae});var bm=q(_z=>{"use strict";function Sae(e,{flow:t,indicator:n,next:i,offset:r,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",p="",f=!1,m=!1,g=null,h=null,b=null,y=null,w=null,k=null,_=null;for(let E of e)switch(m&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&o(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(l&&E.type!=="comment"&&E.type!=="newline"&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),E.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&E.source.includes(" ")&&(g=E),u=!0;break;case"comment":{u||o(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=E.source.substring(1)||" ";d?d+=p+T:d=T,p="",l=!1;break}case"newline":l?d?d+=E.source:(!k||n!=="seq-item-ind")&&(c=!0):p+=E.source,l=!0,f=!0,(h||b)&&(y=E),u=!0;break;case"anchor":h&&o(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&o(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=E,_??(_=E.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(E,"MULTIPLE_TAGS","A node can have at most one tag"),b=E,_??(_=E.offset),l=!1,u=!1,m=!0;break}case n:(h||b)&&o(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),k&&o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),k=E,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){w&&o(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=E,l=!1,u=!1;break}default:o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,u=!1}let S=e[e.length-1],x=S?S.offset+S.source.length:r;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:k,spaceBefore:c,comment:d,hasNewline:f,anchor:h,tag:b,newlineAfterProp:y,end:x,start:_??x}}_z.resolveProps=Sae});var Hb=q(Sz=>{"use strict";function fT(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` -`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(fT(t.key)||fT(t.value))return!0}return!1;default:return!0}}Sz.containsNewline=fT});var mT=q(xz=>{"use strict";var xae=Hb();function Eae(e,t,n){if(t?.type==="flow-collection"){let i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&xae.containsNewline(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}xz.flowIndentCheck=Eae});var gT=q(Tz=>{"use strict";var Ez=Ze();function Tae(e,t,n){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,s)=>o===s||Ez.isScalar(o)&&Ez.isScalar(s)&&o.value===s.value;return t.some(o=>r(o.key,n))}Tz.mapIncludes=Tae});var Pz=q(Cz=>{"use strict";var Iz=Cs(),Iae=Ds(),Az=bm(),Aae=Hb(),Rz=mT(),Rae=gT(),Nz="All mapping items must start at the same column";function Nae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??Iae.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,l=null;for(let u of i.items){let{start:d,key:p,sep:f,value:m}=u,g=Az.resolveProps(d,{indicator:"explicit-key-ind",next:p??f?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),h=!g.found;if(h){if(p&&(p.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==i.indent&&r(c,"BAD_INDENT",Nz)),!g.anchor&&!g.tag&&!f){l=g.end,g.comment&&(a.comment?a.comment+=` -`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||Aae.containsNewline(p))&&r(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==i.indent&&r(c,"BAD_INDENT",Nz);n.atKey=!0;let b=g.end,y=p?e(n,p,g,r):t(n,b,d,null,g,r);n.schema.compat&&Rz.flowIndentCheck(i.indent,p,r),n.atKey=!1,Rae.mapIncludes(n,a.items,y)&&r(b,"DUPLICATE_KEY","Map keys must be unique");let w=Az.resolveProps(f??[],{indicator:"map-value-ind",next:m,offset:y.range[2],onError:r,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=w.end,w.found){h&&(m?.type==="block-map"&&!w.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start{"use strict";var Cae=Os(),Pae=bm(),Dae=mT();function Oae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??Cae.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=i.offset,l=null;for(let{start:u,value:d}of i.items){let p=Pae.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(a.comment=p.comment);continue}let f=d?e(n,d,p,r):t(n,p.end,u,null,p,r);n.schema.compat&&Dae.flowIndentCheck(i.indent,d,r),c=f.range[2],a.items.push(f)}return a.range=[i.offset,c,l??c],a}Dz.resolveBlockSeq=Oae});var Su=q(Mz=>{"use strict";function Mae(e,t,n,i){let r="";if(e){let o=!1,s="";for(let a of e){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";r?r+=s+u:r=u,s="";break}case"newline":r&&(s+=c),o=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:r,offset:t}}Mz.resolveEnd=Mae});var jz=q(Uz=>{"use strict";var Lae=Ze(),Fae=Cs(),Lz=Ds(),Uae=Os(),jae=Su(),Fz=bm(),zae=Hb(),Gae=gT(),hT="Block collections are not allowed within flow collections",yT=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Vae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?Lz.YAMLMap:Uae.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=i.offset+i.start.source.length;for(let h=0;h0){let h=jae.resolveEnd(m,g,n.options.strict,r);h.comment&&(l.comment?l.comment+=` -`+h.comment:l.comment=h.comment),l.range=[i.offset,g,h.offset]}else l.range=[i.offset,g,g];return l}Uz.resolveFlowCollection=Vae});var Gz=q(zz=>{"use strict";var Bae=Ze(),qae=an(),Wae=Ds(),Hae=Os(),Kae=Pz(),Jae=Oz(),Zae=jz();function bT(e,t,n,i,r,o){let s=n.type==="block-map"?Kae.resolveBlockMap(e,t,n,i,o):n.type==="block-seq"?Jae.resolveBlockSeq(e,t,n,i,o):Zae.resolveFlowCollection(e,t,n,i,o),a=s.constructor;return r==="!"||r===a.tagName?(s.tag=a.tagName,s):(r&&(s.tag=r),s)}function Yae(e,t,n,i,r){let o=i.tag,s=o?t.directives.tagName(o.source,p=>r(o,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:f}=i,m=p&&o?p.offset>o.offset?p:o:p??o;m&&(!f||f.offsetp.tag===s&&p.collection===a);if(!c){let p=t.schema.knownTags[s];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?r(o,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),bT(e,t,n,r,s)}let l=bT(e,t,n,r,s,c),u=c.resolve?.(l,p=>r(o,"TAG_RESOLVE_FAILED",p),t.options)??l,d=Bae.isNode(u)?u:new qae.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}zz.composeCollection=Yae});var wT=q(Vz=>{"use strict";var vT=an();function Qae(e,t,n){let i=t.offset,r=Xae(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?vT.Scalar.BLOCK_FOLDED:vT.Scalar.BLOCK_LITERAL,s=t.source?ece(t.source):[],a=s.length;for(let g=s.length-1;g>=0;--g){let h=s[g][1];if(h===""||h==="\r")a=g;else break}if(a===0){let g=r.chomp==="+"&&s.length>0?` -`.repeat(Math.max(1,s.length-1)):"",h=i+r.length;return t.source&&(h+=t.source.length),{value:g,type:o,comment:r.comment,range:[i,h,h]}}let c=t.indent+r.indent,l=t.offset+r.length,u=0;for(let g=0;gc&&(c=h.length);else{h.length=a;--g)s[g][0].length>c&&(a=g+1);let d="",p="",f=!1;for(let g=0;gc||b[0]===" "?(p===" "?p=` +`}};Nm.YAMLError=Cm;Nm.YAMLParseError=cI;Nm.YAMLWarning=lI;Nm.prettifyError=Rle});var Om=H(gB=>{"use strict";function Ple(e,{flow:t,indicator:n,next:r,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",p="",f=!1,m=!1,g=null,h=null,v=null,b=null,w=null,k=null,$=null;for(let T of e)switch(m&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&o(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(l&&T.type!=="comment"&&T.type!=="newline"&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),T.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&T.source.includes(" ")&&(g=T),u=!0;break;case"comment":{u||o(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=T.source.substring(1)||" ";d?d+=p+A:d=A,p="",l=!1;break}case"newline":l?d?d+=T.source:(!k||n!=="seq-item-ind")&&(c=!0):p+=T.source,l=!0,f=!0,(h||v)&&(b=T),u=!0;break;case"anchor":h&&o(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&o(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=T,$??($=T.offset),l=!1,u=!1,m=!0;break;case"tag":{v&&o(T,"MULTIPLE_TAGS","A node can have at most one tag"),v=T,$??($=T.offset),l=!1,u=!1,m=!0;break}case n:(h||v)&&o(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),k&&o(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),k=T,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){w&&o(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=T,l=!1,u=!1;break}default:o(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),l=!1,u=!1}let S=e[e.length-1],E=S?S.offset+S.source.length:i;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=s||r?.type==="block-map"||r?.type==="block-seq")&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:k,spaceBefore:c,comment:d,hasNewline:f,anchor:h,tag:v,newlineAfterProp:b,end:E,start:$??E}}gB.resolveProps=Ple});var mv=H(hB=>{"use strict";function uI(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` +`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(uI(t.key)||uI(t.value))return!0}return!1;default:return!0}}hB.containsNewline=uI});var dI=H(yB=>{"use strict";var Cle=mv();function Nle(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Cle.containsNewline(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}yB.flowIndentCheck=Nle});var pI=H(vB=>{"use strict";var bB=Je();function Dle(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r=="function"?r:(o,s)=>o===s||bB.isScalar(o)&&bB.isScalar(s)&&o.value===s.value;return t.some(o=>i(o.key,n))}vB.mapIncludes=Dle});var xB=H(SB=>{"use strict";var wB=As(),Ole=Ps(),kB=Om(),Mle=mv(),_B=dI(),Lle=pI(),$B="All mapping items must start at the same column";function Fle({composeNode:e,composeEmptyNode:t},n,r,i,o){let s=o?.nodeClass??Ole.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:p,sep:f,value:m}=u,g=kB.resolveProps(d,{indicator:"explicit-key-ind",next:p??f?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),h=!g.found;if(h){if(p&&(p.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&i(c,"BAD_INDENT",$B)),!g.anchor&&!g.tag&&!f){l=g.end,g.comment&&(a.comment?a.comment+=` +`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||Mle.containsNewline(p))&&i(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==r.indent&&i(c,"BAD_INDENT",$B);n.atKey=!0;let v=g.end,b=p?e(n,p,g,i):t(n,v,d,null,g,i);n.schema.compat&&_B.flowIndentCheck(r.indent,p,i),n.atKey=!1,Lle.mapIncludes(n,a.items,b)&&i(v,"DUPLICATE_KEY","Map keys must be unique");let w=kB.resolveProps(f??[],{indicator:"map-value-ind",next:m,offset:b.range[2],onError:i,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=w.end,w.found){h&&(m?.type==="block-map"&&!w.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start{"use strict";var jle=Cs(),Ule=Om(),zle=dI();function Gle({composeNode:e,composeEmptyNode:t},n,r,i,o){let s=o?.nodeClass??jle.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let p=Ule.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?i(p.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(a.comment=p.comment);continue}let f=d?e(n,d,p,i):t(n,p.end,u,null,p,i);n.schema.compat&&zle.flowIndentCheck(r.indent,d,i),c=f.range[2],a.items.push(f)}return a.range=[r.offset,c,l??c],a}EB.resolveBlockSeq=Gle});var su=H(IB=>{"use strict";function Ble(e,t,n,r){let i="";if(e){let o=!1,s="";for(let a of e){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&r(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:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:i,offset:t}}IB.resolveEnd=Ble});var CB=H(PB=>{"use strict";var Vle=Je(),qle=As(),AB=Ps(),Wle=Cs(),Hle=su(),RB=Om(),Kle=mv(),Jle=pI(),fI="Block collections are not allowed within flow collections",mI=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Zle({composeNode:e,composeEmptyNode:t},n,r,i,o){let s=r.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?AB.YAMLMap:Wle.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let h=0;h0){let h=Hle.resolveEnd(m,g,n.options.strict,i);h.comment&&(l.comment?l.comment+=` +`+h.comment:l.comment=h.comment),l.range=[r.offset,g,h.offset]}else l.range=[r.offset,g,g];return l}PB.resolveFlowCollection=Zle});var DB=H(NB=>{"use strict";var Yle=Je(),Qle=an(),Xle=Ps(),eue=Cs(),tue=xB(),nue=TB(),rue=CB();function gI(e,t,n,r,i,o){let s=n.type==="block-map"?tue.resolveBlockMap(e,t,n,r,o):n.type==="block-seq"?nue.resolveBlockSeq(e,t,n,r,o):rue.resolveFlowCollection(e,t,n,r,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function iue(e,t,n,r,i){let o=r.tag,s=o?t.directives.tagName(o.source,p=>i(o,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:f}=r,m=p&&o?p.offset>o.offset?p:o:p??o;m&&(!f||f.offsetp.tag===s&&p.collection===a);if(!c){let p=t.schema.knownTags[s];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?i(o,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),gI(e,t,n,i,s)}let l=gI(e,t,n,i,s,c),u=c.resolve?.(l,p=>i(o,"TAG_RESOLVE_FAILED",p),t.options)??l,d=Yle.isNode(u)?u:new Qle.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}NB.composeCollection=iue});var yI=H(OB=>{"use strict";var hI=an();function oue(e,t,n){let r=t.offset,i=sue(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let o=i.mode===">"?hI.Scalar.BLOCK_FOLDED:hI.Scalar.BLOCK_LITERAL,s=t.source?aue(t.source):[],a=s.length;for(let g=s.length-1;g>=0;--g){let h=s[g][1];if(h===""||h==="\r")a=g;else break}if(a===0){let g=i.chomp==="+"&&s.length>0?` +`.repeat(Math.max(1,s.length-1)):"",h=r+i.length;return t.source&&(h+=t.source.length),{value:g,type:o,comment:i.comment,range:[r,h,h]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let g=0;gc&&(c=h.length);else{h.length=a;--g)s[g][0].length>c&&(a=g+1);let d="",p="",f=!1;for(let g=0;gc||v[0]===" "?(p===" "?p=` `:!f&&p===` `&&(p=` -`),d+=p+h.slice(c)+b,p=` -`,f=!0):b===""?p===` +`),d+=p+h.slice(c)+v,p=` +`,f=!0):v===""?p===` `?d+=` `:p=` -`:(d+=p+b,p=" ",f=!1)}switch(r.chomp){case"-":break;case"+":for(let g=a;g{"use strict";var kT=an(),tce=Su();function nce(e,t,n){let{offset:i,type:r,source:o,end:s}=e,a,c,l=(p,f,m)=>n(i+p,f,m);switch(r){case"scalar":a=kT.Scalar.PLAIN,c=rce(o,l);break;case"single-quoted-scalar":a=kT.Scalar.QUOTE_SINGLE,c=ice(o,l);break;case"double-quoted-scalar":a=kT.Scalar.QUOTE_DOUBLE,c=oce(o,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let u=i+o.length,d=tce.resolveEnd(s,u,t,n);return{value:c,type:a,comment:d.comment,range:[i,u,d.offset]}}function rce(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Bz(e)}function ice(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Bz(e.slice(1,-1)).replace(/''/g,"'")}function Bz(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let i,r;try{i=new RegExp("(?{"use strict";var bI=an(),cue=su();function lue(e,t,n){let{offset:r,type:i,source:o,end:s}=e,a,c,l=(p,f,m)=>n(r+p,f,m);switch(i){case"scalar":a=bI.Scalar.PLAIN,c=uue(o,l);break;case"single-quoted-scalar":a=bI.Scalar.QUOTE_SINGLE,c=due(o,l);break;case"double-quoted-scalar":a=bI.Scalar.QUOTE_DOUBLE,c=pue(o,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}let u=r+o.length,d=cue.resolveEnd(s,u,t,n);return{value:c,type:a,comment:d.comment,range:[r,u,d.offset]}}function uue(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),MB(e)}function due(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),MB(e.slice(1,-1)).replace(/''/g,"'")}function MB(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=new RegExp("(?o?e.slice(o,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function sce(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===` -`||i==="\r")&&!(i==="\r"&&e[t+2]!==` -`);)i===` +`:(o+=s+l,s=" "),a=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=a,n=c.exec(e),o+s+(n?.[1]??"")}function pue(e,t){let n="";for(let r=1;ro?e.slice(o,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function fue(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===` +`||r==="\r")&&!(r==="\r"&&e[t+2]!==` +`);)r===` `&&(n+=` -`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}var ace={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function cce(e,t,n,i){let r=e.substr(t,n),s=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}qz.resolveFlowScalar=nce});var Kz=q(Hz=>{"use strict";var fc=Ze(),Wz=an(),lce=wT(),uce=$T();function dce(e,t,n,i){let{value:r,type:o,comment:s,range:a}=t.type==="block-scalar"?lce.resolveBlockScalar(e,t,i):uce.resolveFlowScalar(t,e.options.strict,i),c=n?e.directives.tagName(n.source,d=>i(n,"TAG_RESOLVE_FAILED",d)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[fc.SCALAR]:c?l=pce(e.schema,r,c,n,i):t.type==="scalar"?l=fce(e,r,t,i):l=e.schema[fc.SCALAR];let u;try{let d=l.resolve(r,p=>i(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=fc.isScalar(d)?d:new Wz.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);i(n??t,"TAG_RESOLVE_FAILED",p),u=new Wz.Scalar(r)}return u.range=a,u.source=r,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function pce(e,t,n,i,r){if(n==="!")return e[fc.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[fc.SCALAR])}function fce({atKey:e,directives:t,schema:n},i,r,o){let s=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(i))||n[fc.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(i))??n[fc.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),l=t.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(r,"TAG_RESOLVE_FAILED",u,!0)}}return s}Hz.composeScalar=dce});var Zz=q(Jz=>{"use strict";function mce(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];r?.type==="space";)e+=r.source.length,r=t[++i];break}}return e}Jz.emptyScalarPosition=mce});var Xz=q(ST=>{"use strict";var gce=Qf(),hce=Ze(),yce=Gz(),Yz=Kz(),bce=Su(),vce=Zz(),wce={composeNode:Qz,composeEmptyNode:_T};function Qz(e,t,n,i){let r=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=n,l,u=!0;switch(t.type){case"alias":l=kce(e,t,i),(a||c)&&i(t,"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=Yz.composeScalar(e,t,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=yce.composeCollection(wce,e,t,n,i),a&&(l.anchor=a.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);i(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=_T(e,t.offset,void 0,null,n,i)),a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!hce.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(t.type==="scalar"&&t.source===""?l.comment=s:l.commentBefore=s),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function _T(e,t,n,i,{spaceBefore:r,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:vce.emptyScalarPosition(t,n,i),indent:-1,source:""},d=Yz.composeScalar(e,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function kce({options:e},{offset:t,source:n,end:i},r){let o=new gce.Alias(n.substring(1));o.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+n.length,a=bce.resolveEnd(i,s,e.strict,r);return o.range=[t,s,a.offset],a.comment&&(o.comment=a.comment),o}ST.composeEmptyNode=_T;ST.composeNode=Qz});var nG=q(tG=>{"use strict";var $ce=mm(),eG=Xz(),_ce=Su(),Sce=bm();function xce(e,t,{offset:n,start:i,value:r,end:o},s){let a=Object.assign({_directives:t},e),c=new $ce.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Sce.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?eG.composeNode(l,r,u,s):eG.composeEmptyNode(l,u.end,i,null,u,s);let d=c.contents.range[2],p=_ce.resolveEnd(o,d,!1,s);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}tG.composeDoc=xce});var ET=q(oG=>{"use strict";var Ece=require("process"),Tce=dE(),Ice=mm(),vm=ym(),rG=Ze(),Ace=nG(),Rce=Su();function wm(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function iG(e){let t="",n=!1,i=!1;for(let r=0;r{"use strict";var tc=Je(),FB=an(),hue=yI(),yue=vI();function bue(e,t,n,r){let{value:i,type:o,comment:s,range:a}=t.type==="block-scalar"?hue.resolveBlockScalar(e,t,r):yue.resolveFlowScalar(t,e.options.strict,r),c=n?e.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[tc.SCALAR]:c?l=vue(e.schema,i,c,n,r):t.type==="scalar"?l=wue(e,i,t,r):l=e.schema[tc.SCALAR];let u;try{let d=l.resolve(i,p=>r(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=tc.isScalar(d)?d:new FB.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);r(n??t,"TAG_RESOLVE_FAILED",p),u=new FB.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 vue(e,t,n,r,i){if(n==="!")return e[tc.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[tc.SCALAR])}function wue({atKey:e,directives:t,schema:n},r,i,o){let s=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(r))||n[tc.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[tc.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),l=t.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}jB.composeScalar=bue});var GB=H(zB=>{"use strict";function kue(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];i?.type==="space";)e+=i.source.length,i=t[++r];break}}return e}zB.emptyScalarPosition=kue});var qB=H(kI=>{"use strict";var _ue=gm(),$ue=Je(),Sue=DB(),BB=UB(),xue=su(),Eue=GB(),Tue={composeNode:VB,composeEmptyNode:wI};function VB(e,t,n,r){let i=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=n,l,u=!0;switch(t.type){case"alias":l=Iue(e,t,r),(a||c)&&r(t,"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=BB.composeScalar(e,t,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Sue.composeCollection(Tue,e,t,n,r),a&&(l.anchor=a.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);r(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=wI(e,t.offset,void 0,null,n,r)),a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!$ue.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(t.type==="scalar"&&t.source===""?l.comment=s:l.commentBefore=s),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function wI(e,t,n,r,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:Eue.emptyScalarPosition(t,n,r),indent:-1,source:""},d=BB.composeScalar(e,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 Iue({options:e},{offset:t,source:n,end:r},i){let o=new _ue.Alias(n.substring(1));o.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+n.length,a=xue.resolveEnd(r,s,e.strict,i);return o.range=[t,s,a.offset],a.comment&&(o.comment=a.comment),o}kI.composeEmptyNode=wI;kI.composeNode=VB});var KB=H(HB=>{"use strict";var Aue=Pm(),WB=qB(),Rue=su(),Pue=Om();function Cue(e,t,{offset:n,start:r,value:i,end:o},s){let a=Object.assign({_directives:t},e),c=new Aue.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Pue.resolveProps(r,{indicator:"doc-start",next:i??o?.[0],offset:n,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?WB.composeNode(l,i,u,s):WB.composeEmptyNode(l,u.end,r,null,u,s);let d=c.contents.range[2],p=Rue.resolveEnd(o,d,!1,s);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}HB.composeDoc=Cue});var $I=H(YB=>{"use strict";var Nue=require("process"),Due=cT(),Oue=Pm(),Mm=Dm(),JB=Je(),Mue=KB(),Lue=su();function Lm(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function ZB(e){let t="",n=!1,r=!1;for(let i=0;i{let s=wm(n);o?this.warnings.push(new vm.YAMLWarning(s,i,r)):this.errors.push(new vm.YAMLParseError(s,i,r))},this.directives=new Tce.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:i,afterEmptyLine:r}=iG(this.prelude);if(i){let o=t.contents;if(n)t.comment=t.comment?`${t.comment} -${i}`:i;else if(r||t.directives.docStart||!o)t.commentBefore=i;else if(rG.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];rG.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${i} -${a}`:i}else{let s=o.commentBefore;o.commentBefore=s?`${i} -${s}`:i}}if(n){for(let o=0;o{let o=wm(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=Ace.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new vm.YAMLParseError(wm(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new vm.YAMLParseError(wm(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Rce.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new vm.YAMLParseError(wm(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let i=Object.assign({_directives:this.directives},this.options),r=new Ice.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};oG.Composer=xT});var cG=q(Kb=>{"use strict";var Nce=wT(),Cce=$T(),Pce=ym(),sG=rm();function Dce(e,t=!0,n){if(e){let i=(r,o,s)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,o,s);else throw new Pce.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Cce.resolveFlowScalar(e,t,i);case"block-scalar":return Nce.resolveBlockScalar({options:{strict:t}},e,i)}}return null}function Oce(e,t){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:s="PLAIN"}=t,a=sG.stringifyString({type:s,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:i,source:` +`)+(o.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var _I=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,o)=>{let s=Lm(n);o?this.warnings.push(new Mm.YAMLWarning(s,r,i)):this.errors.push(new Mm.YAMLParseError(s,r,i))},this.directives=new Due.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:r,afterEmptyLine:i}=ZB(this.prelude);if(r){let o=t.contents;if(n)t.comment=t.comment?`${t.comment} +${r}`:r;else if(i||t.directives.docStart||!o)t.commentBefore=r;else if(JB.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];JB.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${r} +${a}`:r}else{let s=o.commentBefore;o.commentBefore=s?`${r} +${s}`:r}}if(n){for(let o=0;o{let o=Lm(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=Mue.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new Mm.YAMLParseError(Lm(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new Mm.YAMLParseError(Lm(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=Lue.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Mm.YAMLParseError(Lm(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let r=Object.assign({_directives:this.directives},this.options),i=new Oue.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};YB.Composer=_I});var eV=H(gv=>{"use strict";var Fue=yI(),jue=vI(),Uue=Dm(),QB=wm();function zue(e,t=!0,n){if(e){let r=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,o,s);else throw new Uue.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return jue.resolveFlowScalar(e,t,r);case"block-scalar":return Fue.resolveBlockScalar({options:{strict:t}},e,r)}}return null}function Gue(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=t,a=QB.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:r,source:` `}];switch(a[0]){case"|":case">":{let l=a.indexOf(` `),u=a.substring(0,l),d=a.substring(l+1)+` -`,p=[{type:"block-scalar-header",offset:o,indent:i,source:u}];return aG(p,c)||p.push({type:"newline",offset:-1,indent:i,source:` -`}),{type:"block-scalar",offset:o,indent:i,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:a,end:c};default:return{type:"scalar",offset:o,indent:i,source:a,end:c}}}function Mce(e,t,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:s}=n,a="indent"in e?e.indent:null;if(i&&typeof a=="number"&&(a+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.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=sG.stringifyString({type:s,value:t},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Lce(e,c);break;case'"':TT(e,c,"double-quoted-scalar");break;case"'":TT(e,c,"single-quoted-scalar");break;default:TT(e,c,"scalar")}}function Lce(e,t){let n=t.indexOf(` -`),i=t.substring(0,n),r=t.substring(n+1)+` -`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,e.source=r}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:i}];aG(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` -`});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:r})}}function aG(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function TT(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let i=e.props.slice(1),r=t.length;e.props[0].type==="block-scalar-header"&&(r-=e.props[0].source.length);for(let o of i)o.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:` -`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let i="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:i,source:t,end:r})}}}Kb.createScalarToken=Oce;Kb.resolveAsScalar=Dce;Kb.setScalarValue=Mce});var uG=q(lG=>{"use strict";var Fce=e=>"type"in e?Zb(e):Jb(e);function Zb(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=Zb(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=Jb(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=Jb(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=Jb(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function Jb({start:e,key:t,sep:n,value:i}){let r="";for(let o of e)r+=o.source;if(t&&(r+=Zb(t)),n)for(let o of n)r+=o.source;return i&&(r+=Zb(i)),r}lG.stringify=Fce});var mG=q(fG=>{"use strict";var IT=Symbol("break visit"),Uce=Symbol("skip children"),dG=Symbol("remove item");function mc(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),pG(Object.freeze([]),e,t)}mc.BREAK=IT;mc.SKIP=Uce;mc.REMOVE=dG;mc.itemAtPath=(e,t)=>{let n=e;for(let[i,r]of t){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};mc.parentCollection=(e,t)=>{let n=mc.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function pG(e,t,n){let i=n(t,e);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=t[r];if(o&&"items"in o){for(let s=0;s{"use strict";var AT=cG(),jce=uG(),zce=mG(),RT="\uFEFF",NT="",CT="",PT="",Gce=e=>!!e&&"items"in e,Vce=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Bce(e){switch(e){case RT:return"";case NT:return"";case CT:return"";case PT:return"";default:return JSON.stringify(e)}}function qce(e){switch(e){case RT:return"byte-order-mark";case NT:return"doc-mode";case CT:return"flow-error-end";case PT:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`,p=[{type:"block-scalar-header",offset:o,indent:r,source:u}];return XB(p,c)||p.push({type:"newline",offset:-1,indent:r,source:` +`}),{type:"block-scalar",offset:o,indent:r,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:a,end:c};default:return{type:"scalar",offset:o,indent:r,source:a,end:c}}}function Bue(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=n,a="indent"in e?e.indent:null;if(r&&typeof a=="number"&&(a+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.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=QB.stringifyString({type:s,value:t},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Vue(e,c);break;case'"':SI(e,c,"double-quoted-scalar");break;case"'":SI(e,c,"single-quoted-scalar");break;default:SI(e,c,"scalar")}}function Vue(e,t){let n=t.indexOf(` +`),r=t.substring(0,n),i=t.substring(n+1)+` +`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=r,e.source=i}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:r}];XB(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` +`});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:i})}}function XB(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function SI(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let r=e.props.slice(1),i=t.length;e.props[0].type==="block-scalar-header"&&(i-=e.props[0].source.length);for(let o of r)o.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:e.offset+t.length,indent:e.indent,source:` +`};delete e.items,Object.assign(e,{type:n,source:t,end:[i]});break}default:{let r="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}gv.createScalarToken=Gue;gv.resolveAsScalar=zue;gv.setScalarValue=Bue});var nV=H(tV=>{"use strict";var que=e=>"type"in e?yv(e):hv(e);function yv(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=yv(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=hv(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=hv(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=hv(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function hv({start:e,key:t,sep:n,value:r}){let i="";for(let o of e)i+=o.source;if(t&&(i+=yv(t)),n)for(let o of n)i+=o.source;return r&&(i+=yv(r)),i}tV.stringify=que});var sV=H(oV=>{"use strict";var xI=Symbol("break visit"),Wue=Symbol("skip children"),rV=Symbol("remove item");function nc(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),iV(Object.freeze([]),e,t)}nc.BREAK=xI;nc.SKIP=Wue;nc.REMOVE=rV;nc.itemAtPath=(e,t)=>{let n=e;for(let[r,i]of t){let o=n?.[r];if(o&&"items"in o)n=o.items[i];else return}return n};nc.parentCollection=(e,t)=>{let n=nc.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function iV(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(let i of["key","value"]){let o=t[i];if(o&&"items"in o){for(let s=0;s{"use strict";var EI=eV(),Hue=nV(),Kue=sV(),TI="\uFEFF",II="",AI="",RI="",Jue=e=>!!e&&"items"in e,Zue=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Yue(e){switch(e){case TI:return"";case II:return"";case AI:return"";case RI:return"";default:return JSON.stringify(e)}}function Que(e){switch(e){case TI:return"byte-order-mark";case II:return"doc-mode";case AI:return"flow-error-end";case RI: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(e[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}xr.createScalarToken=AT.createScalarToken;xr.resolveAsScalar=AT.resolveAsScalar;xr.setScalarValue=AT.setScalarValue;xr.stringify=jce.stringify;xr.visit=zce.visit;xr.BOM=RT;xr.DOCUMENT=NT;xr.FLOW_END=CT;xr.SCALAR=PT;xr.isCollection=Gce;xr.isScalar=Vce;xr.prettyToken=Bce;xr.tokenType=qce});var MT=q(hG=>{"use strict";var km=Yb();function Li(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}var gG=new Set("0123456789ABCDEFabcdef"),Wce=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Qb=new Set(",[]{}"),Hce=new Set(` ,[]{} -\r `),DT=e=>!e||Hce.has(e),OT=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(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`: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(e[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}$r.createScalarToken=EI.createScalarToken;$r.resolveAsScalar=EI.resolveAsScalar;$r.setScalarValue=EI.setScalarValue;$r.stringify=Hue.stringify;$r.visit=Kue.visit;$r.BOM=TI;$r.DOCUMENT=II;$r.FLOW_END=AI;$r.SCALAR=RI;$r.isCollection=Jue;$r.isScalar=Zue;$r.prettyToken=Yue;$r.tokenType=Que});var NI=H(cV=>{"use strict";var Fm=bv();function ji(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}var aV=new Set("0123456789ABCDEFabcdef"),Xue=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),vv=new Set(",[]{}"),ede=new Set(` ,[]{} +\r `),PI=e=>!e||ede.has(e),CI=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(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[t+1]===` -`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){let r=this.buffer[i+t+1];if(r===` -`||!r&&!this.atEnd)return t+i+1}return n===` -`||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&Li(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Li(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Li(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);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(DT),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Li(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":n+=1;break;case` +`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){let i=this.buffer[r+t+1];if(i===` +`||!i&&!this.atEnd)return t+r+1}return n===` +`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ji(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!ji(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ji(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);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(PI),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ji(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":n+=1;break;case` `:t=o,n=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(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(` -`,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===` -`;)i=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let o=t-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+n>a)t=o;else break}while(!0);return yield km.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let o=this.buffer[i+1];if(Li(o)||t&&Qb.has(o))break;n=i}else if(Li(r)){let o=this.buffer[i+1];if(r==="\r"&&(o===` -`?(i+=1,r=` -`,o=this.buffer[i+1]):n=i),o==="#"||t&&Qb.has(o))break;if(r===` -`){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(t&&Qb.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield km.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(DT),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(Li(i)||n&&Qb.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Li(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Wce.has(n))n=this.buffer[++t];else if(n==="%"&&gG.has(this.buffer[t+1])&&gG.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===` +`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(` +`,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===` +`;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let o=t-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+n>a)t=o;else break}while(!0);return yield Fm.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let o=this.buffer[r+1];if(ji(o)||t&&vv.has(o))break;n=r}else if(ji(i)){let o=this.buffer[r+1];if(i==="\r"&&(o===` +`?(r+=1,i=` +`,o=this.buffer[r+1]):n=r),o==="#"||t&&vv.has(o))break;if(i===` +`){let s=this.continueScalar(r+1);if(s===-1)break;r=Math.max(r,s-2)}}else{if(t&&vv.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Fm.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(PI),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(ji(r)||n&&vv.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ji(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Xue.has(n))n=this.buffer[++t];else if(n==="%"&&aV.has(this.buffer[t+1])&&aV.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===` `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};hG.Lexer=OT});var FT=q(yG=>{"use strict";var LT=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[o]{"use strict";var Kce=require("process"),bG=Yb(),Jce=MT();function Ms(e,t){for(let n=0;n=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function ev(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.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(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&wG(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&vG(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};cV.Lexer=CI});var OI=H(lV=>{"use strict";var DI=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[o]{"use strict";var tde=require("process"),uV=bv(),nde=NI();function Ns(e,t){for(let n=0;n=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function kv(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.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(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&pV(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&dV(i.start)===-1&&(n.indent===0||i.start.every(o=>o.type!=="comment"||o.indent=t.indent){let i=!this.onKeyLine&&this.indent===t.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&n.sep&&!n.value){let s=[];for(let a=0;at.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),t.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(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ms(n.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(kG(n.key)&&!Ms(n.sep,"newline")){let s=xu(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ms(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=xu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ms(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{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);r||n.value?(t.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ms(n.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 i&&t.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){ev(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ms(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Xb(i),o=xu(r);wG(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){kv(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&n.sep&&!n.value){let s=[];for(let a=0;at.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(o.push(this.sourceToken),t.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(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ns(n.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(fV(n.key)&&!Ns(n.sep,"newline")){let s=au(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ns(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=au(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ns(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{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||n.value?(t.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ns(n.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 r&&t.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){kv(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ns(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=wv(r),o=au(i);pV(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){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 n=Xb(t),i=xu(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Xb(t),i=xu(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){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:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};$G.Parser=UT});var TG=q(_m=>{"use strict";var _G=ET(),Zce=mm(),$m=ym(),Yce=SE(),Qce=Ze(),Xce=FT(),SG=jT();function xG(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Xce.LineCounter||null,prettyErrors:t}}function ele(e,t={}){let{lineCounter:n,prettyErrors:i}=xG(t),r=new SG.Parser(n?.addNewLine),o=new _G.Composer(t),s=Array.from(o.compose(r.parse(e)));if(i&&n)for(let a of s)a.errors.forEach($m.prettifyError(e,n)),a.warnings.forEach($m.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function EG(e,t={}){let{lineCounter:n,prettyErrors:i}=xG(t),r=new SG.Parser(n?.addNewLine),o=new _G.Composer(t),s=null;for(let a of o.compose(r.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new $m.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(s.errors.forEach($m.prettifyError(e,n)),s.warnings.forEach($m.prettifyError(e,n))),s}function tle(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);let r=EG(e,n);if(!r)return null;if(r.warnings.forEach(o=>Yce.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function nle(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){let{keepUndefined:r}=n??t??{};if(!r)return}return Qce.isDocument(e)&&!i?e.toString(n):new Zce.Document(e,i,n).toString(n)}_m.parse=tle;_m.parseAllDocuments=ele;_m.parseDocument=EG;_m.stringify=nle});var gc=q(lt=>{"use strict";var rle=ET(),ile=mm(),ole=sT(),zT=ym(),sle=Qf(),Ls=Ze(),ale=Cs(),cle=an(),lle=Ds(),ule=Os(),dle=Yb(),ple=MT(),fle=FT(),mle=jT(),tv=TG(),IG=Kf();lt.Composer=rle.Composer;lt.Document=ile.Document;lt.Schema=ole.Schema;lt.YAMLError=zT.YAMLError;lt.YAMLParseError=zT.YAMLParseError;lt.YAMLWarning=zT.YAMLWarning;lt.Alias=sle.Alias;lt.isAlias=Ls.isAlias;lt.isCollection=Ls.isCollection;lt.isDocument=Ls.isDocument;lt.isMap=Ls.isMap;lt.isNode=Ls.isNode;lt.isPair=Ls.isPair;lt.isScalar=Ls.isScalar;lt.isSeq=Ls.isSeq;lt.Pair=ale.Pair;lt.Scalar=cle.Scalar;lt.YAMLMap=lle.YAMLMap;lt.YAMLSeq=ule.YAMLSeq;lt.CST=dle;lt.Lexer=ple.Lexer;lt.LineCounter=fle.LineCounter;lt.Parser=mle.Parser;lt.parse=tv.parse;lt.parseAllDocuments=tv.parseAllDocuments;lt.parseDocument=tv.parseDocument;lt.stringify=tv.stringify;lt.visit=IG.visit;lt.visitAsync=IG.visitAsync});var hd=q((kKe,S4)=>{"use strict";var dge="2.0.0",pge=Number.MAX_SAFE_INTEGER||9007199254740991,fge=16,mge=250,gge=["major","premajor","minor","preminor","patch","prepatch","prerelease"];S4.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:fge,MAX_SAFE_BUILD_LENGTH:mge,MAX_SAFE_INTEGER:pge,RELEASE_TYPES:gge,SEMVER_SPEC_VERSION:dge,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var vg=q(($Ke,x4)=>{"use strict";var hge=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};x4.exports=hge});var yd=q((ho,E4)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:OC,MAX_SAFE_BUILD_LENGTH:yge,MAX_LENGTH:bge}=hd(),vge=vg();ho=E4.exports={};var wge=ho.re=[],kge=ho.safeRe=[],ue=ho.src=[],$ge=ho.safeSrc=[],de=ho.t={},_ge=0,MC="[a-zA-Z0-9-]",Sge=[["\\s",1],["\\d",bge],[MC,yge]],xge=e=>{for(let[t,n]of Sge)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},Fe=(e,t,n)=>{let i=xge(t),r=_ge++;vge(e,r,t),de[e]=r,ue[r]=t,$ge[r]=i,wge[r]=new RegExp(t,n?"g":void 0),kge[r]=new RegExp(i,n?"g":void 0)};Fe("NUMERICIDENTIFIER","0|[1-9]\\d*");Fe("NUMERICIDENTIFIERLOOSE","\\d+");Fe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${MC}*`);Fe("MAINVERSION",`(${ue[de.NUMERICIDENTIFIER]})\\.(${ue[de.NUMERICIDENTIFIER]})\\.(${ue[de.NUMERICIDENTIFIER]})`);Fe("MAINVERSIONLOOSE",`(${ue[de.NUMERICIDENTIFIERLOOSE]})\\.(${ue[de.NUMERICIDENTIFIERLOOSE]})\\.(${ue[de.NUMERICIDENTIFIERLOOSE]})`);Fe("PRERELEASEIDENTIFIER",`(?:${ue[de.NONNUMERICIDENTIFIER]}|${ue[de.NUMERICIDENTIFIER]})`);Fe("PRERELEASEIDENTIFIERLOOSE",`(?:${ue[de.NONNUMERICIDENTIFIER]}|${ue[de.NUMERICIDENTIFIERLOOSE]})`);Fe("PRERELEASE",`(?:-(${ue[de.PRERELEASEIDENTIFIER]}(?:\\.${ue[de.PRERELEASEIDENTIFIER]})*))`);Fe("PRERELEASELOOSE",`(?:-?(${ue[de.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ue[de.PRERELEASEIDENTIFIERLOOSE]})*))`);Fe("BUILDIDENTIFIER",`${MC}+`);Fe("BUILD",`(?:\\+(${ue[de.BUILDIDENTIFIER]}(?:\\.${ue[de.BUILDIDENTIFIER]})*))`);Fe("FULLPLAIN",`v?${ue[de.MAINVERSION]}${ue[de.PRERELEASE]}?${ue[de.BUILD]}?`);Fe("FULL",`^${ue[de.FULLPLAIN]}$`);Fe("LOOSEPLAIN",`[v=\\s]*${ue[de.MAINVERSIONLOOSE]}${ue[de.PRERELEASELOOSE]}?${ue[de.BUILD]}?`);Fe("LOOSE",`^${ue[de.LOOSEPLAIN]}$`);Fe("GTLT","((?:<|>)?=?)");Fe("XRANGEIDENTIFIERLOOSE",`${ue[de.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Fe("XRANGEIDENTIFIER",`${ue[de.NUMERICIDENTIFIER]}|x|X|\\*`);Fe("XRANGEPLAIN",`[v=\\s]*(${ue[de.XRANGEIDENTIFIER]})(?:\\.(${ue[de.XRANGEIDENTIFIER]})(?:\\.(${ue[de.XRANGEIDENTIFIER]})(?:${ue[de.PRERELEASE]})?${ue[de.BUILD]}?)?)?`);Fe("XRANGEPLAINLOOSE",`[v=\\s]*(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:${ue[de.PRERELEASELOOSE]})?${ue[de.BUILD]}?)?)?`);Fe("XRANGE",`^${ue[de.GTLT]}\\s*${ue[de.XRANGEPLAIN]}$`);Fe("XRANGELOOSE",`^${ue[de.GTLT]}\\s*${ue[de.XRANGEPLAINLOOSE]}$`);Fe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${OC}})(?:\\.(\\d{1,${OC}}))?(?:\\.(\\d{1,${OC}}))?`);Fe("COERCE",`${ue[de.COERCEPLAIN]}(?:$|[^\\d])`);Fe("COERCEFULL",ue[de.COERCEPLAIN]+`(?:${ue[de.PRERELEASE]})?(?:${ue[de.BUILD]})?(?:$|[^\\d])`);Fe("COERCERTL",ue[de.COERCE],!0);Fe("COERCERTLFULL",ue[de.COERCEFULL],!0);Fe("LONETILDE","(?:~>?)");Fe("TILDETRIM",`(\\s*)${ue[de.LONETILDE]}\\s+`,!0);ho.tildeTrimReplace="$1~";Fe("TILDE",`^${ue[de.LONETILDE]}${ue[de.XRANGEPLAIN]}$`);Fe("TILDELOOSE",`^${ue[de.LONETILDE]}${ue[de.XRANGEPLAINLOOSE]}$`);Fe("LONECARET","(?:\\^)");Fe("CARETTRIM",`(\\s*)${ue[de.LONECARET]}\\s+`,!0);ho.caretTrimReplace="$1^";Fe("CARET",`^${ue[de.LONECARET]}${ue[de.XRANGEPLAIN]}$`);Fe("CARETLOOSE",`^${ue[de.LONECARET]}${ue[de.XRANGEPLAINLOOSE]}$`);Fe("COMPARATORLOOSE",`^${ue[de.GTLT]}\\s*(${ue[de.LOOSEPLAIN]})$|^$`);Fe("COMPARATOR",`^${ue[de.GTLT]}\\s*(${ue[de.FULLPLAIN]})$|^$`);Fe("COMPARATORTRIM",`(\\s*)${ue[de.GTLT]}\\s*(${ue[de.LOOSEPLAIN]}|${ue[de.XRANGEPLAIN]})`,!0);ho.comparatorTrimReplace="$1$2$3";Fe("HYPHENRANGE",`^\\s*(${ue[de.XRANGEPLAIN]})\\s+-\\s+(${ue[de.XRANGEPLAIN]})\\s*$`);Fe("HYPHENRANGELOOSE",`^\\s*(${ue[de.XRANGEPLAINLOOSE]})\\s+-\\s+(${ue[de.XRANGEPLAINLOOSE]})\\s*$`);Fe("STAR","(<|>)?=?\\s*\\*");Fe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Fe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var gk=q((_Ke,T4)=>{"use strict";var Ege=Object.freeze({loose:!0}),Tge=Object.freeze({}),Ige=e=>e?typeof e!="object"?Ege:e:Tge;T4.exports=Ige});var LC=q((SKe,R4)=>{"use strict";var I4=/^[0-9]+$/,A4=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:eA4(t,e);R4.exports={compareIdentifiers:A4,rcompareIdentifiers:Age}});var On=q((xKe,C4)=>{"use strict";var hk=vg(),{MAX_LENGTH:N4,MAX_SAFE_INTEGER:yk}=hd(),{safeRe:bk,t:vk}=yd(),Rge=gk(),{compareIdentifiers:FC}=LC(),Nge=(e,t)=>{let n=t.split(".");if(n.length>e.length)return!1;for(let i=0;iN4)throw new TypeError(`version is longer than ${N4} characters`);hk("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=t.trim().match(n.loose?bk[vk.LOOSE]:bk[vk.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>yk||this.major<0)throw new TypeError("Invalid major version");if(this.minor>yk||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>yk||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){let o=+r;if(o>=0&&ot.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let i=this.prerelease[n],r=t.prerelease[n];if(hk("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return FC(i,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let i=this.build[n],r=t.build[n];if(hk("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return FC(i,r)}while(++n)}inc(t,n,i){if(t.startsWith("pre")){if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let r=`-${n}`.match(this.options.loose?bk[vk.PRERELEASELOOSE]:bk[vk.PRERELEASE]);if(!r||r[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let r=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let o=[n,r];if(i===!1&&(o=[n]),Nge(this.prerelease,n)){let s=this.prerelease[n.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};C4.exports=UC});var Xs=q((EKe,D4)=>{"use strict";var P4=On(),Cge=(e,t,n=!1)=>{if(e instanceof P4)return e;try{return new P4(e,t)}catch(i){if(!n)return null;throw i}};D4.exports=Cge});var M4=q((TKe,O4)=>{"use strict";var Pge=Xs(),Dge=(e,t)=>{let n=Pge(e,t);return n?n.version:null};O4.exports=Dge});var F4=q((IKe,L4)=>{"use strict";var Oge=Xs(),Mge=(e,t)=>{let n=Oge(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};L4.exports=Mge});var z4=q((AKe,j4)=>{"use strict";var U4=On(),Lge=(e,t,n,i,r)=>{typeof n=="string"&&(r=i,i=n,n=void 0);try{return new U4(e instanceof U4?e.version:e,n).inc(t,i,r).version}catch{return null}};j4.exports=Lge});var B4=q((RKe,V4)=>{"use strict";var G4=Xs(),Fge=(e,t)=>{let n=G4(e,null,!0),i=G4(t,null,!0),r=n.compare(i);if(r===0)return null;let o=r>0,s=o?n:i,a=o?i:n,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return n.major!==i.major?u+"major":n.minor!==i.minor?u+"minor":n.patch!==i.patch?u+"patch":"prerelease"};V4.exports=Fge});var W4=q((NKe,q4)=>{"use strict";var Uge=On(),jge=(e,t)=>new Uge(e,t).major;q4.exports=jge});var K4=q((CKe,H4)=>{"use strict";var zge=On(),Gge=(e,t)=>new zge(e,t).minor;H4.exports=Gge});var Z4=q((PKe,J4)=>{"use strict";var Vge=On(),Bge=(e,t)=>new Vge(e,t).patch;J4.exports=Bge});var Q4=q((DKe,Y4)=>{"use strict";var qge=Xs(),Wge=(e,t)=>{let n=qge(e,t);return n&&n.prerelease.length?n.prerelease:null};Y4.exports=Wge});var ui=q((OKe,e6)=>{"use strict";var X4=On(),Hge=(e,t,n)=>new X4(e,n).compare(new X4(t,n));e6.exports=Hge});var n6=q((MKe,t6)=>{"use strict";var Kge=ui(),Jge=(e,t,n)=>Kge(t,e,n);t6.exports=Jge});var i6=q((LKe,r6)=>{"use strict";var Zge=ui(),Yge=(e,t)=>Zge(e,t,!0);r6.exports=Yge});var wk=q((FKe,s6)=>{"use strict";var o6=On(),Qge=(e,t,n)=>{let i=new o6(e,n),r=new o6(t,n);return i.compare(r)||i.compareBuild(r)};s6.exports=Qge});var c6=q((UKe,a6)=>{"use strict";var Xge=wk(),ehe=(e,t)=>e.sort((n,i)=>Xge(n,i,t));a6.exports=ehe});var u6=q((jKe,l6)=>{"use strict";var the=wk(),nhe=(e,t)=>e.sort((n,i)=>the(i,n,t));l6.exports=nhe});var wg=q((zKe,d6)=>{"use strict";var rhe=ui(),ihe=(e,t,n)=>rhe(e,t,n)>0;d6.exports=ihe});var kk=q((GKe,p6)=>{"use strict";var ohe=ui(),she=(e,t,n)=>ohe(e,t,n)<0;p6.exports=she});var jC=q((VKe,f6)=>{"use strict";var ahe=ui(),che=(e,t,n)=>ahe(e,t,n)===0;f6.exports=che});var zC=q((BKe,m6)=>{"use strict";var lhe=ui(),uhe=(e,t,n)=>lhe(e,t,n)!==0;m6.exports=uhe});var $k=q((qKe,g6)=>{"use strict";var dhe=ui(),phe=(e,t,n)=>dhe(e,t,n)>=0;g6.exports=phe});var _k=q((WKe,h6)=>{"use strict";var fhe=ui(),mhe=(e,t,n)=>fhe(e,t,n)<=0;h6.exports=mhe});var GC=q((HKe,y6)=>{"use strict";var ghe=jC(),hhe=zC(),yhe=wg(),bhe=$k(),vhe=kk(),whe=_k(),khe=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return ghe(e,n,i);case"!=":return hhe(e,n,i);case">":return yhe(e,n,i);case">=":return bhe(e,n,i);case"<":return vhe(e,n,i);case"<=":return whe(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};y6.exports=khe});var v6=q((KKe,b6)=>{"use strict";var $he=On(),_he=Xs(),{safeRe:Sk,t:xk}=yd(),She=(e,t)=>{if(e instanceof $he)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?Sk[xk.COERCEFULL]:Sk[xk.COERCE]);else{let c=t.includePrerelease?Sk[xk.COERCERTLFULL]:Sk[xk.COERCERTL],l;for(;(l=c.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||l.index+l[0].length!==n.index+n[0].length)&&(n=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(n===null)return null;let i=n[2],r=n[3]||"0",o=n[4]||"0",s=t.includePrerelease&&n[5]?`-${n[5]}`:"",a=t.includePrerelease&&n[6]?`+${n[6]}`:"";return _he(`${i}.${r}.${o}${s}${a}`,t)};b6.exports=She});var k6=q((JKe,w6)=>{"use strict";var xhe=Xs(),Ehe=hd(),The=On(),Ihe=(e,t,n)=>{if(!Ehe.RELEASE_TYPES.includes(t))return null;let i=Ahe(e,n);return i&&Rhe(i,t)},Ahe=(e,t)=>{let n=e instanceof The?e.version:e;return xhe(n,t)},Rhe=(e,t)=>{if(Nhe(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Nhe=e=>e.startsWith("pre");w6.exports=Ihe});var _6=q((ZKe,$6)=>{"use strict";var VC=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let r=this.map.keys().next().value;this.delete(r)}this.map.set(t,n)}return this}};$6.exports=VC});var di=q((YKe,T6)=>{"use strict";var Che=/\s+/g,BC=class e{constructor(t,n){if(n=Dhe(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof qC)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(Che," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(r=>!x6(r[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&Vhe(r[0])){this.set=[r];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let n=this.set[t];for(let i=0;i0&&(this.formatted+=" "),this.formatted+=n[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(Ghe,"");let i=((this.options.includePrerelease&&jhe)|(this.options.loose&&zhe))+":"+t,r=S6.get(i);if(r)return r;let o=this.options.loose,s=o?cr[Mn.HYPHENRANGELOOSE]:cr[Mn.HYPHENRANGE];t=t.replace(s,eye(this.options.includePrerelease)),Tt("hyphen replace",t),t=t.replace(cr[Mn.COMPARATORTRIM],Lhe),Tt("comparator trim",t),t=t.replace(cr[Mn.TILDETRIM],Fhe),Tt("tilde trim",t),t=t.replace(cr[Mn.CARETTRIM],Uhe),Tt("caret trim",t);let a=t.split(" ").map(d=>Bhe(d,this.options)).join(" ").split(/\s+/).map(d=>Xhe(d,this.options));o&&(a=a.filter(d=>(Tt("loose invalid filter",d,this.options),!!d.match(cr[Mn.COMPARATORLOOSE])))),Tt("range list",a);let c=new Map,l=a.map(d=>new qC(d,this.options));for(let d of l){if(x6(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return S6.set(i,u),u}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>E6(i,n)&&t.set.some(r=>E6(r,n)&&i.every(o=>r.every(s=>o.intersects(s,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Ohe(t,this.options)}catch{return!1}for(let n=0;ne.value==="<0.0.0-0",Vhe=e=>e.value==="",E6=(e,t)=>{let n=!0,i=e.slice(),r=i.pop();for(;n&&i.length;)n=i.every(o=>r.intersects(o,t)),r=i.pop();return n},Bhe=(e,t)=>(e=e.replace(cr[Mn.BUILD],""),Tt("comp",e,t),e=Khe(e,t),Tt("caret",e),e=Whe(e,t),Tt("tildes",e),e=Zhe(e,t),Tt("xrange",e),e=Qhe(e,t),Tt("stars",e),e),bn=e=>!e||e.toLowerCase()==="x"||e==="*",qhe=(e,t,n)=>bn(e)&&!bn(t)||bn(t)&&n&&!bn(n),Whe=(e,t)=>e.trim().split(/\s+/).map(n=>Hhe(n,t)).join(" "),Hhe=(e,t)=>{let n=t.loose?cr[Mn.TILDELOOSE]:cr[Mn.TILDE],i=t.includePrerelease?"-0":"";return e.replace(n,(r,o,s,a,c)=>{Tt("tilde",e,r,o,s,a,c);let l;return bn(o)?l="":bn(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:bn(a)?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:c?(Tt("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,Tt("tilde return",l),l})},Khe=(e,t)=>e.trim().split(/\s+/).map(n=>Jhe(n,t)).join(" "),Jhe=(e,t)=>{Tt("caret",e,t);let n=t.loose?cr[Mn.CARETLOOSE]:cr[Mn.CARET],i=t.includePrerelease?"-0":"";return e.replace(n,(r,o,s,a,c)=>{Tt("caret",e,r,o,s,a,c);let l;return bn(o)?l="":bn(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:bn(a)?o==="0"?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(Tt("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(Tt("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Tt("caret return",l),l})},Zhe=(e,t)=>(Tt("replaceXRanges",e,t),e.split(/\s+/).map(n=>Yhe(n,t)).join(" ")),Yhe=(e,t)=>{e=e.trim();let n=t.loose?cr[Mn.XRANGELOOSE]:cr[Mn.XRANGE];return e.replace(n,(i,r,o,s,a,c)=>{if(Tt("xRange",e,i,r,o,s,a,c),qhe(o,s,a))return e;let l=bn(o),u=l||bn(s),d=u||bn(a),p=d;return r==="="&&p&&(r=""),c=t.includePrerelease?"-0":"",l?r===">"||r==="<"?i="<0.0.0-0":i="*":r&&p?(u&&(s=0),a=0,r===">"?(r=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):r==="<="&&(r="<",u?o=+o+1:s=+s+1),r==="<"&&(c="-0"),i=`${r+o}.${s}.${a}${c}`):u?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),Tt("xRange return",i),i})},Qhe=(e,t)=>(Tt("replaceStars",e,t),e.trim().replace(cr[Mn.STAR],"")),Xhe=(e,t)=>(Tt("replaceGTE0",e,t),e.trim().replace(cr[t.includePrerelease?Mn.GTE0PRE:Mn.GTE0],"")),eye=e=>(t,n,i,r,o,s,a,c,l,u,d,p)=>(bn(i)?n="":bn(r)?n=`>=${i}.0.0${e?"-0":""}`:bn(o)?n=`>=${i}.${r}.0${e?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,bn(l)?c="":bn(u)?c=`<${+l+1}.0.0-0`:bn(d)?c=`<${l}.${+u+1}.0-0`:p?c=`<=${l}.${u}.${d}-${p}`:e?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),tye=(e,t,n)=>{for(let i=0;i0){let r=e[i].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}});var kg=q((QKe,P6)=>{"use strict";var $g=Symbol("SemVer ANY"),KC=class e{static get ANY(){return $g}constructor(t,n){if(n=I6(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),HC("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===$g?this.value="":this.value=this.operator+this.semver.version,HC("comp",this)}parse(t){let n=this.options.loose?A6[R6.COMPARATORLOOSE]:A6[R6.COMPARATOR],i=t.match(n);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new N6(i[2],this.options.loose):this.semver=$g}toString(){return this.value}test(t){if(HC("Comparator.test",t,this.options.loose),this.semver===$g||t===$g)return!0;if(typeof t=="string")try{t=new N6(t,this.options)}catch{return!1}return WC(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new C6(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new C6(this.value,n).test(t.semver):(n=I6(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||WC(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||WC(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};P6.exports=KC;var I6=gk(),{safeRe:A6,t:R6}=yd(),WC=GC(),HC=vg(),N6=On(),C6=di()});var _g=q((XKe,D6)=>{"use strict";var nye=di(),rye=(e,t,n)=>{try{t=new nye(t,n)}catch{return!1}return t.test(e)};D6.exports=rye});var M6=q((eJe,O6)=>{"use strict";var iye=di(),oye=(e,t)=>new iye(e,t).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));O6.exports=oye});var F6=q((tJe,L6)=>{"use strict";var sye=On(),aye=di(),cye=(e,t,n)=>{let i=null,r=null,o=null;try{o=new aye(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||r.compare(s)===-1)&&(i=s,r=new sye(i,n))}),i};L6.exports=cye});var j6=q((nJe,U6)=>{"use strict";var lye=On(),uye=di(),dye=(e,t,n)=>{let i=null,r=null,o=null;try{o=new uye(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||r.compare(s)===1)&&(i=s,r=new lye(i,n))}),i};U6.exports=dye});var V6=q((rJe,G6)=>{"use strict";var JC=On(),pye=di(),z6=wg(),fye=(e,t)=>{e=new pye(e,t);let n=new JC("0.0.0");if(e.test(n)||(n=new JC("0.0.0-0"),e.test(n)))return n;n=null;for(let i=0;i{let a=new JC(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||z6(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||z6(n,o))&&(n=o)}return n&&e.test(n)?n:null};G6.exports=fye});var q6=q((iJe,B6)=>{"use strict";var mye=di(),gye=(e,t)=>{try{return new mye(e,t).range||"*"}catch{return null}};B6.exports=gye});var Ek=q((oJe,J6)=>{"use strict";var hye=On(),K6=kg(),{ANY:yye}=K6,bye=di(),vye=_g(),W6=wg(),H6=kk(),wye=_k(),kye=$k(),$ye=(e,t,n,i)=>{e=new hye(e,i),t=new bye(t,i);let r,o,s,a,c;switch(n){case">":r=W6,o=wye,s=H6,a=">",c=">=";break;case"<":r=H6,o=kye,s=W6,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(vye(e,t,i))return!1;for(let l=0;l{f.semver===yye&&(f=new K6(">=0.0.0")),d=d||f,p=p||f,r(f.semver,d.semver,i)?d=f:s(f.semver,p.semver,i)&&(p=f)}),d.operator===a||d.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0};J6.exports=$ye});var Y6=q((sJe,Z6)=>{"use strict";var _ye=Ek(),Sye=(e,t,n)=>_ye(e,t,">",n);Z6.exports=Sye});var X6=q((aJe,Q6)=>{"use strict";var xye=Ek(),Eye=(e,t,n)=>xye(e,t,"<",n);Q6.exports=Eye});var nW=q((cJe,tW)=>{"use strict";var eW=di(),Tye=(e,t,n)=>(e=new eW(e,n),t=new eW(t,n),e.intersects(t,n));tW.exports=Tye});var iW=q((lJe,rW)=>{"use strict";var Iye=_g(),Aye=ui();rW.exports=(e,t,n)=>{let i=[],r=null,o=null,s=e.sort((u,d)=>Aye(u,d,n));for(let u of s)Iye(u,t,n)?(o=u,r||(r=u)):(o&&i.push([r,o]),o=null,r=null);r&&i.push([r,null]);let a=[];for(let[u,d]of i)u===d?a.push(u):!d&&u===s[0]?a.push("*"):d?u===s[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length{"use strict";var oW=di(),QC=kg(),{ANY:ZC}=QC,YC=_g(),XC=ui(),Rye=(e,t,n={})=>{if(e===t)return!0;e=new oW(e,n),t=new oW(t,n);let i=!1;e:for(let r of e.set){for(let o of t.set){let s=Cye(r,o,n);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},Nye=[new QC(">=0.0.0-0")],sW=[new QC(">=0.0.0")],Cye=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===ZC){if(t.length===1&&t[0].semver===ZC)return!0;n.includePrerelease?e=Nye:e=sW}if(t.length===1&&t[0].semver===ZC){if(n.includePrerelease)return!0;t=sW}let i=new Set,r,o;for(let f of e)f.operator===">"||f.operator===">="?r=aW(r,f,n):f.operator==="<"||f.operator==="<="?o=cW(o,f,n):i.add(f.semver);if(i.size>1)return null;let s;if(r&&o){if(s=XC(r.semver,o.semver,n),s>0)return null;if(s===0&&(r.operator!==">="||o.operator!=="<="))return null}for(let f of i){if(r&&!YC(f,String(r),n)||o&&!YC(f,String(o),n))return null;for(let m of t)if(!YC(f,String(m),n))return!1;return!0}let a,c,l,u,d=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=r&&!n.includePrerelease&&r.semver.prerelease.length?r.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of t){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",r){if(p&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch&&(p=!1),f.operator===">"||f.operator===">="){if(a=aW(r,f,n),a===f&&a!==r)return!1}else if(r.operator===">="&&!f.test(r.semver))return!1}if(o){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(c=cW(o,f,n),c===f&&c!==o)return!1}else if(o.operator==="<="&&!f.test(o.semver))return!1}if(!f.operator&&(o||r)&&s!==0)return!1}return!(r&&l&&!o&&s!==0||o&&u&&!r&&s!==0||p||d)},aW=(e,t,n)=>{if(!e)return t;let i=XC(e.semver,t.semver,n);return i>0?e:i<0||t.operator===">"&&e.operator===">="?t:e},cW=(e,t,n)=>{if(!e)return t;let i=XC(e.semver,t.semver,n);return i<0?e:i>0||t.operator==="<"&&e.operator==="<="?t:e};lW.exports=Rye});var Dc=q((dJe,fW)=>{"use strict";var eP=yd(),dW=hd(),Pye=On(),pW=LC(),Dye=Xs(),Oye=M4(),Mye=F4(),Lye=z4(),Fye=B4(),Uye=W4(),jye=K4(),zye=Z4(),Gye=Q4(),Vye=ui(),Bye=n6(),qye=i6(),Wye=wk(),Hye=c6(),Kye=u6(),Jye=wg(),Zye=kk(),Yye=jC(),Qye=zC(),Xye=$k(),ebe=_k(),tbe=GC(),nbe=v6(),rbe=k6(),ibe=kg(),obe=di(),sbe=_g(),abe=M6(),cbe=F6(),lbe=j6(),ube=V6(),dbe=q6(),pbe=Ek(),fbe=Y6(),mbe=X6(),gbe=nW(),hbe=iW(),ybe=uW();fW.exports={parse:Dye,valid:Oye,clean:Mye,inc:Lye,diff:Fye,major:Uye,minor:jye,patch:zye,prerelease:Gye,compare:Vye,rcompare:Bye,compareLoose:qye,compareBuild:Wye,sort:Hye,rsort:Kye,gt:Jye,lt:Zye,eq:Yye,neq:Qye,gte:Xye,lte:ebe,cmp:tbe,coerce:nbe,truncate:rbe,Comparator:ibe,Range:obe,satisfies:sbe,toComparators:abe,maxSatisfying:cbe,minSatisfying:lbe,minVersion:ube,validRange:dbe,outside:pbe,gtr:fbe,ltr:mbe,intersects:gbe,simplifyRange:hbe,subset:ybe,SemVer:Pye,re:eP.re,src:eP.src,tokens:eP.t,SEMVER_SPEC_VERSION:dW.SEMVER_SPEC_VERSION,RELEASE_TYPES:dW.RELEASE_TYPES,compareIdentifiers:pW.compareIdentifiers,rcompareIdentifiers:pW.rcompareIdentifiers}});var AZ=q((qtt,IZ)=>{IZ.exports=require("util").inspect});var JZ=q((Wtt,KZ)=>{var KD=typeof Map=="function"&&Map.prototype,UD=Object.getOwnPropertyDescriptor&&KD?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,D$=KD&&UD&&typeof UD.get=="function"?UD.get:null,RZ=KD&&Map.prototype.forEach,JD=typeof Set=="function"&&Set.prototype,jD=Object.getOwnPropertyDescriptor&&JD?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,O$=JD&&jD&&typeof jD.get=="function"?jD.get:null,NZ=JD&&Set.prototype.forEach,fEe=typeof WeakMap=="function"&&WeakMap.prototype,dh=fEe?WeakMap.prototype.has:null,mEe=typeof WeakSet=="function"&&WeakSet.prototype,ph=mEe?WeakSet.prototype.has:null,gEe=typeof WeakRef=="function"&&WeakRef.prototype,CZ=gEe?WeakRef.prototype.deref:null,hEe=Boolean.prototype.valueOf,yEe=Object.prototype.toString,bEe=Function.prototype.toString,vEe=String.prototype.match,ZD=String.prototype.slice,Ia=String.prototype.replace,wEe=String.prototype.toUpperCase,PZ=String.prototype.toLowerCase,GZ=RegExp.prototype.test,DZ=Array.prototype.concat,xo=Array.prototype.join,kEe=Array.prototype.slice,OZ=Math.floor,VD=typeof BigInt=="function"?BigInt.prototype.valueOf:null,zD=Object.getOwnPropertySymbols,BD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Qn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Wd||!0)?Symbol.toStringTag:null,VZ=Object.prototype.propertyIsEnumerable,MZ=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function LZ(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||GZ.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var i=e<0?-OZ(-e):OZ(e);if(i!==e){var r=String(i),o=ZD.call(t,r.length+1);return Ia.call(r,n,"$&_")+"."+Ia.call(Ia.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ia.call(t,n,"$&_")}var qD=AZ(),FZ=qD.custom,UZ=qZ(FZ)?FZ:null;KZ.exports=function e(t,n,i,r){var o=n||{};if(Ta(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ta(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Ta(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ta(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ta(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return HZ(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?LZ(t,c):c}if(typeof t=="bigint"){var l=String(t)+"n";return a?LZ(t,l):l}var u=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=u&&u>0&&typeof t=="object")return WD(t)?"[Array]":"[Object]";var d=UEe(o,i);if(typeof r>"u")r=[];else if(WZ(r,t)>=0)return"[Circular]";function p(K,te,D){if(te&&(r=kEe.call(r),r.push(te)),D){var X={depth:o.depth};return Ta(o,"quoteStyle")&&(X.quoteStyle=o.quoteStyle),e(K,X,i+1,r)}return e(K,o,i+1,r)}if(typeof t=="function"&&!jZ(t)){var f=REe(t),m=P$(t,p);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(m.length>0?" { "+xo.call(m,", ")+" }":"")}if(qZ(t)){var g=Wd?Ia.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):BD.call(t);return typeof t=="object"&&!Wd?uh(g):g}if(MEe(t)){for(var h="<"+PZ.call(String(t.nodeName)),b=t.attributes||[],y=0;y",h}if(WD(t)){if(t.length===0)return"[]";var w=P$(t,p);return d&&!FEe(w)?"["+HD(w,d)+"]":"[ "+xo.call(w,", ")+" ]"}if(SEe(t)){var k=P$(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!VZ.call(t,"cause")?"{ ["+String(t)+"] "+xo.call(DZ.call("[cause]: "+p(t.cause),k),", ")+" }":k.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+xo.call(k,", ")+" }"}if(typeof t=="object"&&s){if(UZ&&typeof t[UZ]=="function"&&qD)return qD(t,{depth:u-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(NEe(t)){var _=[];return RZ&&RZ.call(t,function(K,te){_.push(p(te,t,!0)+" => "+p(K,t))}),zZ("Map",D$.call(t),_,d)}if(DEe(t)){var S=[];return NZ&&NZ.call(t,function(K){S.push(p(K,t))}),zZ("Set",O$.call(t),S,d)}if(CEe(t))return GD("WeakMap");if(OEe(t))return GD("WeakSet");if(PEe(t))return GD("WeakRef");if(EEe(t))return uh(p(Number(t)));if(IEe(t))return uh(p(VD.call(t)));if(TEe(t))return uh(hEe.call(t));if(xEe(t))return uh(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!_Ee(t)&&!jZ(t)){var x=P$(t,p),E=MZ?MZ(t)===Object.prototype:t instanceof Object||t.constructor===Object,T=t instanceof Object?"":"null prototype",A=!E&&Qn&&Object(t)===t&&Qn in t?ZD.call(Aa(t),8,-1):T?"Object":"",L=E||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",F=L+(A||T?"["+xo.call(DZ.call([],A||[],T||[]),": ")+"] ":"");return x.length===0?F+"{}":d?F+"{"+HD(x,d)+"}":F+"{ "+xo.call(x,", ")+" }"}return String(t)};function BZ(e,t,n){var i=(n.quoteStyle||t)==="double"?'"':"'";return i+e+i}function $Ee(e){return Ia.call(String(e),/"/g,""")}function WD(e){return Aa(e)==="[object Array]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function _Ee(e){return Aa(e)==="[object Date]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function jZ(e){return Aa(e)==="[object RegExp]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function SEe(e){return Aa(e)==="[object Error]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function xEe(e){return Aa(e)==="[object String]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function EEe(e){return Aa(e)==="[object Number]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function TEe(e){return Aa(e)==="[object Boolean]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function qZ(e){if(Wd)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!BD)return!1;try{return BD.call(e),!0}catch{}return!1}function IEe(e){if(!e||typeof e!="object"||!VD)return!1;try{return VD.call(e),!0}catch{}return!1}var AEe=Object.prototype.hasOwnProperty||function(e){return e in this};function Ta(e,t){return AEe.call(e,t)}function Aa(e){return yEe.call(e)}function REe(e){if(e.name)return e.name;var t=vEe.call(bEe.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function WZ(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,i="... "+n+" more character"+(n>1?"s":"");return HZ(ZD.call(e,0,t.maxStringLength),t)+i}var r=Ia.call(Ia.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,LEe);return BZ(r,"single",t)}function LEe(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+wEe.call(t.toString(16))}function uh(e){return"Object("+e+")"}function GD(e){return e+" { ? }"}function zZ(e,t,n,i){var r=i?HD(n,i):xo.call(n,", ");return e+" ("+t+") {"+r+"}"}function FEe(e){for(var t=0;t=0)return!1;return!0}function UEe(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=xo.call(Array(e.indent+1)," ");else return null;return{base:n,prev:xo.call(Array(t+1),n)}}function HD(e,t){if(e.length===0)return"";var n=` -`+t.prev+t.base;return n+xo.call(e,","+n)+` -`+t.prev}function P$(e,t){var n=WD(e),i=[];if(n){i.length=e.length;for(var r=0;ree,decodeFieldSignature:()=>k9,decodeMethodSignature:()=>w9,readAssembly:()=>s_});function sNe(e){if(e.length<64||e.readUInt16LE(0)!==23117)return null;let t=e.readUInt32LE(60);if(t+24>e.length||e.readUInt32LE(t)!==17744)return null;let n=e.readUInt16LE(t+6),i=e.readUInt16LE(t+20),r=t+24;if(i===0)return null;let o=e.readUInt16LE(r),s=r+(o===523?112:96),a=[],c=r+i;for(let f=0;fe.length)break;a.push({virtualSize:e.readUInt32LE(m+8),virtualAddress:e.readUInt32LE(m+12),rawAddress:e.readUInt32LE(m+20)})}let l=e.readUInt32LE(s+112);if(l===0)return null;let u=g9(l,a);if(u===null||u+16>e.length)return null;let d=e.readUInt32LE(u+8),p=g9(d,a);return p===null?null:{offset:p,sections:a}}function g9(e,t){for(let n of t)if(e>=n.virtualAddress&&ee.length||e.readUInt32LE(t)!==1112167234)return null;let n=e.readUInt32LE(t+12),i=t+16+n+2,r=e.readUInt16LE(i);i+=2;let o=new Map;for(let c=0;c"||h.startsWith("<"))continue;let b=$Ne(i,r,l,f),y=v9(i,m[3]),w=[],k=[];for(let _ of y9(m[4],f,r,4,o.length)){let S=o[_];if(!h9(S[0]))continue;let x=i.string(S[1]);x.startsWith("<")||(w.push(x),k.push(`${x}: ${k9(i,i.blob(S[2]))}`))}for(let _ of y9(m[5],f,r,5,s.length)){let S=s[_];if(!h9(S[2]))continue;let x=i.string(S[3]);x.startsWith("<")||/^(get_|set_|add_|remove_)/.test(x)||(w.push(x),k.push(`${x}${w9(i,i.blob(S[4]))}`))}for(let _ of u.get(f+1)??[]){let S=i.string(a[_][1]);S.startsWith("<")||(w.push(S),k.push(`${S} { get; set; }`))}for(let _ of d.get(f+1)??[]){let S=i.string(c[_][1]);S.startsWith("<")||(w.push(S),k.push(`event ${S}`))}p.push({fullName:b,kind:kNe(g,y),members:[...new Set(w)],signatures:[...new Set(k)]})}return p}function kNe(e,t){return e&gNe?"interface":t==="System.Enum"?"enum":t==="System.ValueType"?"struct":t==="System.MulticastDelegate"||t==="System.Delegate"?"delegate":"class"}function $Ne(e,t,n,i){let r=[],o=i;for(let s=0;s<16;s++){let a=t[o];if(!a)break;r.unshift(e.string(a[1]));let c=n.get(o+1);if(c===void 0){let l=e.string(a[2]);return l?`${l}.${r.join("+")}`:r.join("+")}o=c-1}return r.join("+")}function v9(e,t){let n=t&3,i=t>>2;if(i===0)return null;if(n===0){let r=e.table(ee.TypeDef)[i-1];if(!r)return null;let o=e.string(r[2]),s=e.string(r[1]);return o?`${o}.${s}`:s}if(n===1){let r=e.table(ee.TypeRef)[i-1];if(!r)return null;let o=e.string(r[2]),s=e.string(r[1]);return o?`${o}.${s}`:s}return null}function y9(e,t,n,i,r){let o=n[t+1]?.[i]??r+1,s=[];for(let a=e;a`}let o=No(t,n);n+=o.width;let s=Ji(e,t,n);n=s.offset;let a=[];for(let c=0;c=t.length);c++){let l=Ji(e,t,n);n=l.offset,a.push(l.text)}return`${r}(${a.join(", ")}): ${s.text}`}function k9(e,t){return t.length<2?"?":Ji(e,t,1).text}function Ji(e,t,n){let i=n,r=t[i++];if(r===void 0)return{text:"?",offset:i};let o=_Ne[r];if(o)return{text:o,offset:i};switch(r){case 15:{let s=Ji(e,t,i);return{text:`${s.text}*`,offset:s.offset}}case 16:{let s=Ji(e,t,i);return{text:`ref ${s.text}`,offset:s.offset}}case 29:{let s=Ji(e,t,i);return{text:`${s.text}[]`,offset:s.offset}}case 69:{let s=Ji(e,t,i);return{text:s.text,offset:s.offset}}case 17:case 18:{let s=No(t,i);return i+=s.width,{text:v9(e,s.value)??"object",offset:i}}case 19:case 30:{let s=No(t,i);return i+=s.width,{text:`${r===19?"T":"M"}${s.value}`,offset:i}}case 21:{let s=Ji(e,t,i);i=s.offset;let a=No(t,i);i+=a.width;let c=[];for(let l=0;l`,offset:i}}case 20:{let s=Ji(e,t,i);i=s.offset;let a=No(t,i);i+=a.width;for(let c of["sizes","lowBounds"]){let l=No(t,i);i+=l.width;for(let u=0;u{"use strict";Ut={type:"u16"},Ct={type:"u32"},Ht={type:"string"},DO={type:"guid"},mr={type:"blob"},Pt=e=>({type:"rid",table:e}),wn=e=>({type:"coded",family:e}),ee={Module:0,TypeRef:1,TypeDef:2,Field:4,MethodDef:6,Param:8,InterfaceImpl:9,MemberRef:10,Constant:11,CustomAttribute:12,FieldMarshal:13,DeclSecurity:14,ClassLayout:15,FieldLayout:16,StandAloneSig:17,EventMap:18,Event:20,PropertyMap:21,Property:23,MethodSemantics:24,MethodImpl:25,ModuleRef:26,TypeSpec:27,ImplMap:28,FieldRVA:29,Assembly:32,AssemblyRef:35,File:38,ExportedType:39,ManifestResource:40,NestedClass:41,GenericParam:42,MethodSpec:43,GenericParamConstraint:44},cNe={TypeDefOrRef:[ee.TypeDef,ee.TypeRef,ee.TypeSpec],HasConstant:[ee.Field,ee.Param,ee.Property],HasCustomAttribute:[ee.MethodDef,ee.Field,ee.TypeRef,ee.TypeDef,ee.Param,ee.InterfaceImpl,ee.MemberRef,ee.Module,ee.DeclSecurity,ee.Property,ee.Event,ee.StandAloneSig,ee.ModuleRef,ee.TypeSpec,ee.Assembly,ee.AssemblyRef,ee.File,ee.ExportedType,ee.ManifestResource,ee.GenericParam,ee.GenericParamConstraint,ee.MethodSpec],HasFieldMarshal:[ee.Field,ee.Param],HasDeclSecurity:[ee.TypeDef,ee.MethodDef,ee.Assembly],MemberRefParent:[ee.TypeDef,ee.TypeRef,ee.ModuleRef,ee.MethodDef,ee.TypeSpec],HasSemantics:[ee.Event,ee.Property],MethodDefOrRef:[ee.MethodDef,ee.MemberRef],MemberForwarded:[ee.Field,ee.MethodDef],Implementation:[ee.File,ee.AssemblyRef,ee.ExportedType],CustomAttributeType:[null,null,ee.MethodDef,ee.MemberRef,null],ResolutionScope:[ee.Module,ee.ModuleRef,ee.AssemblyRef,ee.TypeRef],TypeOrMethodDef:[ee.TypeDef,ee.MethodDef]},lNe={0:[Ut,Ht,DO,DO,DO],1:[wn("ResolutionScope"),Ht,Ht],2:[Ct,Ht,Ht,wn("TypeDefOrRef"),Pt(ee.Field),Pt(ee.MethodDef)],3:[Pt(ee.Field)],4:[Ut,Ht,mr],5:[Pt(ee.MethodDef)],6:[Ct,Ut,Ut,Ht,mr,Pt(ee.Param)],7:[Pt(ee.Param)],8:[Ut,Ut,Ht],9:[Pt(ee.TypeDef),wn("TypeDefOrRef")],10:[wn("MemberRefParent"),Ht,mr],11:[Ut,wn("HasConstant"),mr],12:[wn("HasCustomAttribute"),wn("CustomAttributeType"),mr],13:[wn("HasFieldMarshal"),mr],14:[Ut,wn("HasDeclSecurity"),mr],15:[Ut,Ct,Pt(ee.TypeDef)],16:[Ct,Pt(ee.Field)],17:[mr],18:[Pt(ee.TypeDef),Pt(ee.Event)],19:[Pt(ee.Event)],20:[Ut,Ht,wn("TypeDefOrRef")],21:[Pt(ee.TypeDef),Pt(ee.Property)],22:[Pt(ee.Property)],23:[Ut,Ht,mr],24:[Ut,Pt(ee.MethodDef),wn("HasSemantics")],25:[Pt(ee.TypeDef),wn("MethodDefOrRef"),wn("MethodDefOrRef")],26:[Ht],27:[mr],28:[Ut,wn("MemberForwarded"),Ht,Pt(ee.ModuleRef)],29:[Ct,Pt(ee.Field)],30:[Ct,Ct],31:[Ct],32:[Ct,Ut,Ut,Ut,Ut,Ct,mr,Ht,Ht],33:[Ct],34:[Ct,Ct,Ct],35:[Ut,Ut,Ut,Ut,Ct,mr,Ht,Ht,mr],36:[Ct,Pt(ee.AssemblyRef)],37:[Ct,Ct,Ct,Pt(ee.AssemblyRef)],38:[Ct,Ht,mr],39:[Ct,Ct,Ht,Ht,wn("Implementation")],40:[Ct,Ct,Ht,wn("Implementation")],41:[Pt(ee.TypeDef),Pt(ee.TypeDef)],42:[Ut,Ut,wn("TypeOrMethodDef"),Ht],43:[wn("MethodDefOrRef"),mr],44:[Pt(ee.GenericParam),wn("TypeDefOrRef")]},OO=class{constructor(t,n,i){this.strings=t;this.blobs=n;let r=i.readUInt8(6),o=i.readBigUInt64LE(8),s=new Map,a=24;for(let u=0;u<64;u++)o>>BigInt(u)&1n&&(s.set(u,i.readUInt32LE(a)),a+=4);let c={string:r&1?4:2,guid:r&2?4:2,blob:r&4?4:2},l=u=>{switch(u.type){case"u16":return 2;case"u32":return 4;case"string":return c.string;case"guid":return c.guid;case"blob":return c.blob;case"rid":return(s.get(u.table)??0)<65536?2:4;case"coded":{let d=cNe[u.family],p=Math.ceil(Math.log2(d.length));return Math.max(...d.map(m=>m===null?0:s.get(m)??0))<1<<16-p?2:4}}};for(let[u,d]of s){let p=lNe[u];if(!p)break;let f=p.map(l),m=f.reduce((h,b)=>h+b,0),g=[];for(let h=0;hi.length);h++){let b=[],y=a;for(let w of f)b.push(w===2?i.readUInt16LE(y):i.readUInt32LE(y)),y+=w;g.push(b),a+=m}this.rows.set(u,g)}}strings;blobs;rows=new Map;table(t){return this.rows.get(t)??[]}string(t){if(t>=this.strings.length)return"";let n=t;for(;n=this.blobs.length)return Buffer.alloc(0);let{value:n,width:i}=No(this.blobs,t);return this.blobs.subarray(t+i,t+i+n)}};uNe=7,dNe=1,pNe=2,fNe=4,mNe=7,gNe=32,hNe=7,yNe=4,bNe=6,vNe=5;_Ne={1:"void",2:"bool",3:"char",4:"sbyte",5:"byte",6:"short",7:"ushort",8:"int",9:"uint",10:"long",11:"ulong",12:"float",13:"double",14:"string",22:"TypedReference",24:"IntPtr",25:"UIntPtr",28:"object"}});function M(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}function v(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}var gr=j(()=>{});function Yr(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}var pl,Da=j(()=>{pl=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{let t=Object.prototype.toString.call(e);if(t==="[object Error]"||t==="[object DOMException]"){let n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)}});var J,Dt,In,Zi,fl,ap,ml,gl,hl,yl,bl,vl,wl,kl,kt=j(()=>{Da();J=class extends Error{},Dt=class e extends J{constructor(t,n,i,r,o){super(`${e.makeMessage(t,n,i)}`),this.status=t,this.headers=r,this.requestID=r?.get("request-id"),this.workspaceID=r?.get("anthropic-workspace-id"),this.error=n,this.type=o??null}static makeMessage(t,n,i){let r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):i;return t&&r?`${t} ${r}`:t?`${t} status code (no body)`:r||"(no status code or body)"}static generate(t,n,i,r){if(!t||!r)return new Zi({message:i,cause:pl(n)});let o=n,s=o?.error?.type;return t===400?new ml(t,o,i,r,s):t===401?new gl(t,o,i,r,s):t===403?new hl(t,o,i,r,s):t===404?new yl(t,o,i,r,s):t===409?new bl(t,o,i,r,s):t===422?new vl(t,o,i,r,s):t===429?new wl(t,o,i,r,s):t>=500?new kl(t,o,i,r,s):new e(t,o,i,r,s)}},In=class extends Dt{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},Zi=class extends Dt{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}},fl=class extends Zi{constructor({message:t}={}){super({message:t??"Request timed out."})}},ap=class extends J{constructor(t,{cause:n}={}){super(t??"Retryable error."),n!==void 0&&(this.cause=n)}},ml=class extends Dt{},gl=class extends Dt{},hl=class extends Dt{},yl=class extends Dt{},bl=class extends Dt{},vl=class extends Dt{},wl=class extends Dt{},kl=class extends Dt{}});function Ih(e){return typeof e!="object"?{}:e??{}}function VO(e){if(!e)return!0;for(let t in e)return!1;return!0}function m5(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function BO(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}var hCe,f5,er,GO,d_,$l,hr=j(()=>{kt();hCe=/^[a-z][a-z0-9+.-]*:/i,f5=e=>hCe.test(e),er=e=>(er=Array.isArray,er(e)),GO=er;d_=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new J(`${e} must be an integer`);if(t<0)throw new J(`${e} must be a positive integer`);return t},$l=e=>{try{return JSON.parse(e)}catch{return}}});var Yi,cp=j(()=>{Yi=(e,t)=>new Promise(n=>{if(t?.aborted)return n();let i=()=>{clearTimeout(r),n()},r=setTimeout(()=>{t?.removeEventListener("abort",i),n()},e);t?.addEventListener("abort",i,{once:!0})})});var Si,Ah=j(()=>{Si="0.125.0"});function yCe(){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"}function vCe(){if(typeof navigator>"u"||!navigator)return null;let e=[{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:t,pattern:n}of e){let i=n.exec(navigator.userAgent);if(i){let r=i[1]||0,o=i[2]||0,s=i[3]||0;return{browser:t,version:`${r}.${o}.${s}`}}}return null}var b5,bCe,g5,h5,y5,Rh,p_=j(()=>{Ah();b5=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";bCe=()=>{let e=yCe();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":h5(Deno.build.os),"X-Stainless-Arch":g5(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":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":h5(globalThis.process.platform??"unknown"),"X-Stainless-Arch":g5(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=vCe();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};g5=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",h5=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown"),Rh=()=>y5??(y5=bCe())});function wCe(e,t){return()=>e.removeEventListener("abort",t)}function w5(e,t,n){f_.set(e,wCe(t,n))}function k5(e,t){f_.has(t)&&v5?.register(e,t,t)}function Co(e){let t=f_.get(e);t&&(f_.delete(e),v5?.unregister(e),t())}var f_,v5,m_=j(()=>{f_=new WeakMap,v5=typeof globalThis.FinalizationRegistry=="function"?new globalThis.FinalizationRegistry(e=>Co(e)):null});function $5(){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 qO(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function g_(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return qO({start(){},async pull(n){let{done:i,value:r}=await t.next();i?n.close():n.enqueue(r)},async cancel(){await t.return?.()}})}function Nh(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){let n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function _5(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var lp=j(()=>{});var Ch,S5,WO=j(()=>{Ch=class{},S5=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)})});var HO,KO,JO,x5,ZO=j(()=>{HO="RFC3986",KO=e=>String(e),JO={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:KO},x5="RFC1738"});function T5(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function QO(e,t){if(er(e)){let n=[];for(let i=0;i{ZO();hr();h_=(e,t)=>(h_=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),h_(e,t)),Po=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),YO=1024,E5=(e,t,n,i,r)=>{if(e.length===0)return e;let o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="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=YO?o.slice(a,a+YO):o,l=[];for(let u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||r===x5&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Po[d];continue}if(d<2048){l[l.length]=Po[192|d>>6]+Po[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Po[224|d>>12]+Po[128|d>>6&63]+Po[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Po[240|d>>18]+Po[128|d>>12&63]+Po[128|d>>6&63]+Po[128|d&63]}s+=l.join("")}return s}});function _Ce(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"}function C5(e,t,n,i,r,o,s,a,c,l,u,d,p,f,m,g,h,b){let y=e,w=b,k=0,_=!1;for(;(w=w.get(XO))!==void 0&&!_;){let A=w.get(e);if(k+=1,typeof A<"u"){if(A===k)throw new RangeError("Cyclic object value");_=!0}typeof w.get(XO)>"u"&&(k=0)}if(typeof l=="function"?y=l(t,y):y instanceof Date?y=p?.(y):n==="comma"&&er(y)&&(y=QO(y,function(A){return A instanceof Date?p?.(A):A})),y===null){if(o)return c&&!g?c(t,kn.encoder,h,"key",f):t;y=""}if(_Ce(y)||T5(y)){if(c){let A=g?t:c(t,kn.encoder,h,"key",f);return[m?.(A)+"="+m?.(c(y,kn.encoder,h,"value",f))]}return[m?.(t)+"="+m?.(String(y))]}let S=[];if(typeof y>"u")return S;let x;if(n==="comma"&&er(y))g&&c&&(y=QO(y,c)),x=[{value:y.length>0?y.join(",")||null:void 0}];else if(er(l))x=l;else{let A=Object.keys(y);x=u?A.sort(u):A}let E=a?String(t).replace(/\./g,"%2E"):String(t),T=i&&er(y)&&y.length===1?E+"[]":E;if(r&&er(y)&&y.length===0)return T+"[]";for(let A=0;A"u"?e.encodeDotInKeys?!0:kn.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:kn.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:kn.allowEmptyArrays,arrayFormat:o,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:kn.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?kn.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:kn.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:kn.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:kn.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:kn.encodeValuesOnly,filter:r,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:kn.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:kn.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:kn.strictNullHandling}}function P5(e,t={}){let n=e,i=SCe(t),r,o;typeof i.filter=="function"?(o=i.filter,n=o("",n)):er(i.filter)&&(o=i.filter,r=o);let s=[];if(typeof n!="object"||n===null)return"";let a=R5[i.arrayFormat],c=a==="comma"&&i.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);let l=new WeakMap;for(let p=0;p0?d+u:""}var R5,N5,A5,kn,XO,D5=j(()=>{I5();ZO();hr();R5={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},N5=function(e,t){Array.prototype.push.apply(e,er(t)?t:[t])},kn={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:E5,encodeValuesOnly:!1,format:HO,formatter:KO,indices:!1,serializeDate(e){return(A5??(A5=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1};XO={}});function O5(e){return P5(e,{arrayFormat:"brackets"})}var eM=j(()=>{D5()});var Do={};_r(Do,{child_process:()=>tM,crypto:()=>Oa,fs:()=>fs,os:()=>ECe,path:()=>xe,stream:()=>y_,util:()=>nM});var tM,Oa,fs,ECe,xe,y_,nM,Mr=j(()=>{tM=gt(require("node:child_process"),1),Oa=gt(require("node:crypto"),1),fs=gt(require("node:fs"),1),ECe=gt(require("node:os"),1),xe=gt(require("node:path"),1),y_=gt(require("node:stream"),1),nM=gt(require("node:util"),1)});function v_(e){if(!e)return;let t;try{t=new URL(e)}catch(i){throw new dt(`Invalid token endpoint base URL "${e}": ${i}`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(t.protocol==="http:"&&(n==="localhost"||n==="127.0.0.1"||n==="::1")))throw new dt(`Refusing to send credential over non-https token endpoint "${e}"`)}async function w_(e,t){let n=await ICe(e),i;try{i=JSON.parse(n)}catch{throw new dt(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,Lr(n),t)}if(!i.access_token)throw new dt(`Token endpoint response missing access_token: ${JSON.stringify(Lr(i))}`,e.status,Lr(i),t);if(i.token_type&&i.token_type.toLowerCase()!=="bearer")throw new dt(`Token endpoint response: unsupported token_type "${i.token_type}" (want Bearer)`,e.status,Lr(i),t);return i}function Lr(e){if(e==null)return e;if(typeof e=="string"){let t;try{t=JSON.parse(e)}catch{return e.length<=rM?e:e.slice(0,rM)+`... <${e.length-rM} more chars>`}return JSON.stringify(Lr(t))}if(typeof e=="object"&&!Array.isArray(e)){let t={};for(let[n,i]of Object.entries(e))TCe.has(n)&&(t[n]=i);return t}return null}async function k_(e,t=n=>console.warn(`anthropic-sdk: ${n}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:n}=await Promise.resolve().then(()=>(Mr(),Do)),i=e,r;try{i=await n.promises.realpath(e),r=await n.promises.stat(i)}catch{return}let o=r.mode&511;if(o&18)throw new dt(`Credentials file at ${i} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${i}\`.`);if(o&36)throw new dt(`Credentials file at ${i} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${i}\` before retrying.`);typeof process.getuid=="function"&&r.uid!==process.getuid()&&t(`credentials file at ${i} is owned by uid ${r.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function $_(e,t){let{fs:n,path:i}=await Promise.resolve().then(()=>(Mr(),Do)),r=i.dirname(e);await n.promises.mkdir(r,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await n.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await n.promises.rename(o,e)}catch(s){throw await n.promises.unlink(o).catch(()=>{}),s}try{let s=await n.promises.open(r,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function ICe(e){if(!e.body)return"";let t=e.body.getReader(),n=[],i=0;for(;;){let{done:o,value:s}=await t.read();if(o)break;if(i+s.length>M5){let a=M5-i;a>0&&n.push(s.subarray(0,a)),await t.cancel();break}n.push(s),i+=s.length}let r;if(n.length===1)r=n[0];else{r=new Uint8Array(n.reduce((s,a)=>s+a.length,0));let o=0;for(let s of n)r.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(r)}var L5,F5,b_,_l,U5,j5,up,z5,M5,rM,TCe,dt,dp=j(()=>{kt();L5="urn:ietf:params:oauth:grant-type:jwt-bearer",F5="refresh_token",b_="/v1/oauth/token",_l="oauth-2025-04-20",U5="oidc-federation-2026-04-01",j5=120,up=30,z5=5,M5=1<<20;rM=2e3,TCe=new Set(["error","error_description","error_uri"]);dt=class extends J{constructor(t,n=null,i=null,r=null){super(t),this.statusCode=n,this.body=i,this.requestId=r}}});function Qi(){return Math.floor(Date.now()/1e3)}var Ph=j(()=>{});var __,G5=j(()=>{dp();Ph();__=class{constructor(t,n){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=t,this.onAdvisoryRefreshError=n}async getToken(){let t=this.nextForce;this.nextForce=!1;let n=this.cached;if(t||n==null)return(await this.refresh(t)).token;if(n.expiresAt==null)return n.token;let i=n.expiresAt-Qi();return i>j5?n.token:i>up?(this.backgroundRefresh(),n.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(t=!1){return this.pendingRefresh&&!t?this.pendingRefresh:this.doRefresh(t)}backgroundRefresh(){this.pendingRefresh||Qi()-this.lastAdvisoryError{this.lastAdvisoryError=Qi(),this.onAdvisoryRefreshError?.(t)})}doRefresh(t=!1){return this.pendingRefresh=this.provider(t?{forceRefresh:!0}:void 0).then(n=>(this.cached=n,this.pendingRefresh=null,n),n=>{throw this.pendingRefresh=null,n}),this.pendingRefresh}}});var ze,pp=j(()=>{ze=e=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0}});function q5(e){let t=0;for(let r of e)t+=r.length;let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.length;return n}function Ma(e){let t;return(V5??(t=new globalThis.TextEncoder,V5=t.encode.bind(t)))(e)}function Sl(e){let t;return(B5??(t=new globalThis.TextDecoder,B5=t.decode.bind(t)))(e)}var V5,B5,xl=j(()=>{});var W5,iM=j(()=>{kt();xl();W5=e=>{if(typeof globalThis.Buffer<"u"){let t=globalThis.Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(typeof atob<"u"){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;ix_[n]?Dh:t[e].bind(t)}function sM(e,t){let n=H5.get(e);if(n&&n[0]===t)return n[1];let i={error:S_("error",e,t),warn:S_("warn",e,t),info:S_("info",e,t),debug:S_("debug",e,t)};return H5.set(e,[t,i]),i}function qe(e){let t=e.logger,n=e.logLevel??"off";return t?sM(t,n):ACe}function J5(){let e=ze("ANTHROPIC_LOG");return(!oM||e!==K5)&&(K5=e,oM=sM(console,E_(e,"process.env['ANTHROPIC_LOG']",sM(console,Oh))??Oh)),oM}var Oh,x_,E_,ACe,H5,K5,oM,Oo,Xi=j(()=>{hr();pp();Oh="warn",x_={off:0,error:200,warn:300,info:400,debug:500},E_=(e,t,n)=>{if(e){if(m5(x_,e))return e;n.warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(x_))}`)}};ACe={error:Dh,warn:Dh,info:Dh,debug:Dh},H5=new WeakMap;Oo=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="api-key"||t.toLowerCase()==="x-api-key"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e)});var T_,aM=j(()=>{T_=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return T_=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^n()&15>>+i/4).toString(16))}});var cM=j(()=>{hr();iM();pp();Xi();aM();cp();eM()});function Z5(e){if(!e)throw new Error("profile name is empty");if(e==="."||e==="..")throw new Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw new Error(`profile name "${e}" must not contain path separators`);if(!RCe.test(e))throw new Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var I_,RCe,Y5,Q5,lM,NCe,X5,uM=j(()=>{p_();cM();I_="1.0",RCe=/^[A-Za-z0-9_.-]+$/;Y5=async e=>{var t,n;let i=await lM();if(i===null)return null;let r=e??await X5();if(r===null)return null;Z5(r);let{fs:o,path:s}=await Promise.resolve().then(()=>(Mr(),Do)),a=s.join(i,"configs",`${r}.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=ze("ANTHROPIC_ORGANIZATION_ID"),p=ze("ANTHROPIC_IDENTITY_TOKEN_FILE"),f=ze("ANTHROPIC_FEDERATION_RULE_ID");return f&&d?{fromFile:!1,config:{organization_id:d,workspace_id:ze("ANTHROPIC_WORKSPACE_ID"),base_url:ze("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:f,service_account_id:ze("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:p?{source:"file",path:p}:void 0,scope:ze("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=ze("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=ze("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=ze("ANTHROPIC_BASE_URL")),(t=l.authentication).scope??(t.scope=ze("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=ze("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(l.authentication.identity_token={source:"file",path:d})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=ze("ANTHROPIC_FEDERATION_RULE_ID")??""),(n=l.authentication).service_account_id??(n.service_account_id=ze("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}},Q5=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let n=await lM();if(!n)return null;let i=t??await X5();if(!i)return null;Z5(i);let{path:r}=await Promise.resolve().then(()=>(Mr(),Do));return r.join(n,"credentials",`${i}.json`)},lM=async()=>{if(!NCe())return null;let{path:e}=await Promise.resolve().then(()=>(Mr(),Do)),t=ze("ANTHROPIC_CONFIG_DIR");if(t)return t;if(Rh()["X-Stainless-OS"]==="Windows"){let o=ze("APPDATA");if(o)return e.join(o,"Anthropic");let s=ze("USERPROFILE");return s?e.join(s,"AppData","Roaming","Anthropic"):null}let i=ze("XDG_CONFIG_HOME");if(i)return e.join(i,"anthropic");let r=ze("HOME");return r?e.join(r,".config","anthropic"):null},NCe=()=>{let e=Rh()["X-Stainless-Runtime"];return e==="node"||e==="deno"},X5=async()=>{let e=await lM();if(!e)return null;let t=ze("ANTHROPIC_PROFILE");if(t)return t;let{fs:n,path:i}=await Promise.resolve().then(()=>(Mr(),Do)),r=i.join(e,"active_config");try{return(await n.promises.readFile(r,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read ${r}: ${o}`);return"default"}}});function dM(e){if(!e)throw new J("Identity token file path is empty");return async()=>{let{fs:t}=await Promise.resolve().then(()=>(Mr(),Do)),n;try{n=await t.promises.readFile(e,"utf-8")}catch(r){throw new J(`Failed to read identity token file at ${e}: ${r}`)}let i=n.trim();if(!i)throw new J(`Identity token file at ${e} is empty`);return i}}function eQ(e){if(!e)throw new J("Identity token value is empty");return()=>e}var tQ=j(()=>{kt()});function nQ(e){return async()=>{v_(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16*1024)throw new dt(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let n={grant_type:L5,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};e.serviceAccountId&&(n.service_account_id=e.serviceAccountId),e.workspaceId&&(n.workspace_id=e.workspaceId);let i=`${e.baseURL}${b_}`,r;try{r=await e.fetch(i,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${_l},${U5}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Si} oidcFederationProvider`},body:JSON.stringify(n)})}catch(c){throw new dt(`Failed to reach token endpoint ${i}: ${c}`)}let o=r.headers.get("Request-Id");if(!r.ok){let c=await r.text().catch(()=>""),l=Lr(c),u="";throw r.status===401&&(u=` Ensure your federation rule matches your identity token. ${e.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 dt(`Token exchange failed with status ${r.status}${o?` (request-id ${o})`:""}: ${l}${u}`,r.status,l,o)}let s=await w_(r,o),a=Number(s.expires_in);if(!Number.isFinite(a))throw new dt(`Token endpoint response missing required fields: ${JSON.stringify(Lr(s))}`,r.status,Lr(s),o);return{token:s.access_token,expiresAt:Qi()+a}}}var rQ=j(()=>{dp();Ph();Ah()});function iQ(e){return async t=>{let{fs:n}=await Promise.resolve().then(()=>(Mr(),Do));await k_(e.credentialsPath,e.onSafetyWarning);let i;try{i=await n.promises.readFile(e.credentialsPath,"utf-8")}catch(h){throw new dt(`Credentials file not found at ${e.credentialsPath}: ${h}`)}let r;try{r=JSON.parse(i)}catch(h){throw new dt(`Credentials file at ${e.credentialsPath} is not valid JSON: ${h}`)}let o=r.access_token;if(!o)throw new dt(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=r.expires_at;if(!t?.forceRefresh&&(s==null||Qi()"");throw new dt(`User OAuth refresh failed (HTTP ${u.status}): ${Lr(h)}`,u.status,Lr(h),d)}let p=await w_(u,d),f=Number(p.expires_in);if(!Number.isFinite(f))throw new dt(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Lr(p))}`,u.status,Lr(p),d);let m=Qi()+f,g=p.refresh_token||a;return await $_(e.credentialsPath,{...r,version:I_,type:"oauth_token",access_token:p.access_token,expires_at:m,refresh_token:g}),{token:p.access_token,expiresAt:m}}}var oQ=j(()=>{uM();dp();Ph();Ah()});function pM(e,t){let n=e.authentication.credentials_path??null,i=(e.base_url||t.baseURL).replace(/\/+$/,""),r=CCe(e,n,i,t),o={};return e.workspace_id&&e.authentication.type==="user_oauth"&&(o["anthropic-workspace-id"]=e.workspace_id),{provider:r,extraHeaders:o,baseURL:e.base_url||void 0}}async function sQ(e,t){let n=await Y5(t);if(!n)return null;let{config:i,fromFile:r}=n,o=i.authentication.credentials_path||!r?i:{...i,authentication:{...i.authentication,credentials_path:await Q5(i,t)??void 0}};return pM(o,e)}function CCe(e,t,n,i){switch(e.authentication.type){case"oidc_federation":{let r=e.authentication,o=PCe(r);if(!o)throw new dt("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!r.federation_rule_id)throw new dt("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new dt("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=nQ({identityTokenProvider:o,federationRuleId:r.federation_rule_id,organizationId:e.organization_id,serviceAccountId:r.service_account_id,workspaceId:e.workspace_id,baseURL:n,fetch:i.fetch,userAgent:i.userAgent});return t?DCe(s,t,i.onCacheWriteError,i.onSafetyWarning):s}case"user_oauth":{if(!t)throw new dt("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return iQ({credentialsPath:t,clientId:e.authentication.client_id,baseURL:n,fetch:i.fetch,userAgent:i.userAgent,onSafetyWarning:i.onSafetyWarning})}default:{let r=e.authentication.type;throw new dt(`authentication.type "${r}" is not a known authentication type`)}}}function PCe(e){if(e.identity_token){let i=e.identity_token.source;if(i!=="file")throw new dt(`identity_token.source "${i}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new dt('identity_token.source "file" requires a non-empty path');return dM(e.identity_token.path)}let t=ze("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return dM(t);let n=ze("ANTHROPIC_IDENTITY_TOKEN");return n?eQ(n):null}function DCe(e,t,n,i){return async r=>{let{fs:o}=await Promise.resolve().then(()=>(Mr(),Do));await k_(t,i);let s;try{let c=await o.promises.readFile(t,"utf-8");s=JSON.parse(c);let l=s?.access_token;if(l&&!r?.forceRefresh){let u=s?.expires_at;if(u==null||Qi(){pp();uM();dp();Ph();tQ();rQ();oQ()});function OCe(e,t){for(let r=t??0;r{gr();xl();ms=class{constructor(){Qr.set(this,void 0),Xr.set(this,void 0),M(this,Qr,new Uint8Array,"f"),M(this,Xr,null,"f")}decode(t){if(t==null)return[];let n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?Ma(t):t;M(this,Qr,q5([v(this,Qr,"f"),n]),"f");let i=[],r;for(;(r=OCe(v(this,Qr,"f"),v(this,Xr,"f")))!=null;){if(r.carriage&&v(this,Xr,"f")==null){M(this,Xr,r.index,"f");continue}if(v(this,Xr,"f")!=null&&(r.index!==v(this,Xr,"f")+1||r.carriage)){i.push(Sl(v(this,Qr,"f").subarray(0,v(this,Xr,"f")-1))),M(this,Qr,v(this,Qr,"f").subarray(v(this,Xr,"f")),"f"),M(this,Xr,null,"f");continue}let o=v(this,Xr,"f")!==null?r.preceding-1:r.preceding,s=Sl(v(this,Qr,"f").subarray(0,o));i.push(s),M(this,Qr,v(this,Qr,"f").subarray(r.index),"f"),M(this,Xr,null,"f")}return i}flush(){return v(this,Qr,"f").length?this.decode(` -`):[]}};Qr=new WeakMap,Xr=new WeakMap;ms.NEWLINE_CHARS=new Set([` -`,"\r"]);ms.NEWLINE_REGEXP=/\r\n|[\n\r]/g});async function*lQ(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new J("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 J("Attempted to iterate over a response with no body");let n=new mM,i=new ms,r=Nh(e.body);for await(let o of MCe(r))for(let s of i.decode(o)){let a=n.decode(s);a&&(yield a)}for(let o of i.flush()){let s=n.decode(o);s&&(yield s)}}async function*MCe(e){let t=new Uint8Array;for await(let n of e){if(n==null)continue;let i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Ma(n):n,r=new Uint8Array(t.length+i.length);r.set(t),r.set(i,t.length),t=r;let o;for(;(o=cQ(t))!==-1;)yield t.subarray(0,o),t=t.subarray(o)}t.length>0&&(yield t)}function LCe(e,t){let n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}var Mh,Fr,mM,Lh=j(()=>{gr();kt();lp();fM();lp();Da();hr();xl();Xi();kt();m_();Fr=class e{constructor(t,n,i){this.iterator=t,Mh.set(this,void 0),this.controller=n,M(this,Mh,i,"f")}static rawEvents(t,n=new AbortController){return lQ(t,n)}static fromSSEResponse(t,n,i){let r=!1,o=i?qe(i):console;async function*s(){if(r)throw new J("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(let c of lQ(t,n)){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==="user.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==="session.updated"||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"||c.event==="event_start"||c.event==="event_delta"||c.event==="system.message")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=$l(c.data)??c.data,u=l?.error?.type;throw new Dt(void 0,l,void 0,t.headers,u)}}a=!0}catch(c){if(Yr(c))return;throw c}finally{a||n.abort(),Co(n)}}return new e(s,n,i)}static fromReadableStream(t,n,i){let r=!1;async function*o(){let a=new ms,c=Nh(t);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(r)throw new J("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(let c of o())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(Yr(c))return;throw c}finally{a||n.abort(),Co(n)}}return new e(s,n,i)}[(Mh=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],n=[],i=this.iterator(),r=o=>({next:()=>{if(o.length===0){let s=i.next();t.push(s),n.push(s)}return o.shift()}});return[new e(()=>r(t),this.controller,v(this,Mh,"f")),new e(()=>r(n),this.controller,v(this,Mh,"f"))]}toReadableStream(){let t=this,n;return qO({async start(){n=t[Symbol.asyncIterator]()},async pull(i){try{let{value:r,done:o}=await n.next();if(o)return i.close();let s=Ma(JSON.stringify(r)+` -`);i.enqueue(s)}catch(r){i.error(r)}},async cancel(){await n.return?.()}})}};mM=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,i,r]=LCe(t,":");return r.startsWith(" ")&&(r=r.substring(1)),n==="event"?this.event=r:n==="data"&&this.data.push(r),null}}});async function A_(e,t){let{response:n,requestLogID:i,retryOfRequestLogID:r,startTime:o}=t,s=await(async()=>{if(t.options.stream)return qe(e).debug("response",n.status,n.url,n.headers,n.body),Fr.fromSSEResponse(n,t.controller,e);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let p=await n.json();return Fh(p,n)}return await n.text()})().finally(()=>{!t.options.stream&&!t.options.__binaryResponse&&Co(t.controller)});return qe(e).debug(`[${i}] response parsed`,Oo({retryOfRequestLogID:r,url:n.url,status:n.status,body:s,durationMs:Date.now()-o})),s}function Fh(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperties(e,{_request_id:{value:t.headers.get("request-id"),enumerable:!1},_workspace_id:{value:t.headers.get("anthropic-workspace-id"),enumerable:!1}})}var R_=j(()=>{Lh();Xi();m_()});function gM(e){return typeof e=="object"&&e!==null&&dQ.has(e)}function pQ(e){let t=new Set;for(;typeof e=="object"&&e!==null&&!t.has(e);){if(t.add(e),gM(e)||Yr(e)||e instanceof Zi||e instanceof ap)return!0;e=e.cause}return!1}function hM(e,t,n,i){return async(r,o={})=>{if(t.length===0)return e.call(void 0,r,o);let s=o.headers instanceof Headers?o.headers:new Headers(o.headers),a=await UCe(e,t,n,i)({...o,headers:s,url:typeof r=="string"?r:r instanceof URL?r.href:r.url});if(a.bodyUsed||a.body?.locked)throw new J("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return a}}function FCe(e,t){let n=new WeakMap;return{options:e,logger:t?qe(t):J5(),parse(i){if(e?.stream&&i.ok)return uQ(i,e,t);let r=n.get(i);return r||(r=uQ(i,e,t),n.set(i,r)),r}}}async function uQ(e,t,n){if(e.bodyUsed||e.body?.locked)throw new J("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(t?.stream&&e.ok)return Fr.fromSSEResponse(e.clone(),new AbortController,n);if(e.status===204)return null;if(t?.__binaryResponse)return e;let r=e.headers.get("content-type")?.split(";")[0]?.trim();return r?.includes("application/json")||r?.endsWith("+json")?e.headers.get("content-length")==="0"?void 0:Fh(await e.clone().json(),e):await e.clone().text()}function UCe(e,t,n,i){let r=async({url:s,...a})=>{try{return await e.call(void 0,s,a)}catch(c){let l=pl(c);throw dQ.add(l),l}},o=FCe(n,i);for(let s=t.length-1;s>=0;s--){let a=t[s],c=r;r=async l=>a(l,c,o)}return r}var dQ,fQ=j(()=>{Da();R_();Xi();kt();Lh();dQ=new WeakSet});var Uh,La,N_=j(()=>{gr();R_();La=class e extends Promise{constructor(t,n,i=A_){super(r=>{r(null)}),this.responsePromise=n,this.parseResponse=i,Uh.set(this,void 0),M(this,Uh,t,"f")}_thenUnwrap(t){return new e(v(this,Uh,"f"),this.responsePromise,async(n,i)=>Fh(t(await this.parseResponse(n,i),i),i.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){let[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(v(this,Uh,"f"),t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}};Uh=new WeakMap});var C_,jh,fp,pn,le,P_,De=j(()=>{gr();kt();R_();N_();hr();jh=class{constructor(t,n,i,r){C_.set(this,void 0),M(this,C_,t,"f"),this.options=r,this.response=n,this.body=i}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let t=this.nextPageRequestOptions();if(!t)throw new J("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await v(this,C_,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(C_=new WeakMap,Symbol.asyncIterator)](){for await(let t of this.iterPages())for(let n of t.getPaginatedItems())yield n}},fp=class extends La{constructor(t,n,i){super(t,n,async(r,o)=>new i(r,o.response,await A_(r,o),o.options))}async*[Symbol.asyncIterator](){let t=await this;for await(let n of t)yield n}},pn=class extends jh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.has_more=i.has_more||!1,this.first_id=i.first_id||null,this.last_id=i.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let n=this.first_id;return n?{...this.options,query:{...Ih(this.options.query),before_id:n}}:null}let t=this.last_id;return t?{...this.options,query:{...Ih(this.options.query),after_id:t}}:null}},le=class extends jh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.next_page=i.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...Ih(this.options.query),page:t}}:null}},P_=class extends jh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.next_page=i.next_page||null,this.prev_page=i.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...Ih(this.options.query),page:t}}:null}}});function El(e,t,n){return bM(),new File(e,t??"unknown_file",n)}function zh(e,t){let n=typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"";return t?n.split(/[\\/]/).pop()||void 0:n}function zCe(e){let t=typeof e=="function"?e:e.fetch,n=mQ.get(t);if(n)return n;let i=(async()=>{try{let r="Response"in t?t.Response:(await t("data:,")).constructor,o=new FormData;return o.toString()!==await new r(o).text()}catch{return!0}})();return mQ.set(t,i),i}var bM,vM,xi,mQ,GCe,yM,gs=j(()=>{lp();bM=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};vM=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",xi=async(e,t,n=!0)=>({...e,body:await GCe(e.body,t,n)}),mQ=new WeakMap;GCe=async(e,t,n=!0)=>{if(!await zCe(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let i=new FormData;return await Promise.all(Object.entries(e||{}).map(([r,o])=>yM(i,r,o,n))),i},yM=async(e,t,n,i)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response){let r={},o=n.headers.get("Content-Type");o&&(r={type:o}),e.append(t,El([await n.blob()],zh(n,i),r))}else if(vM(n))e.append(t,El([await new Response(g_(n)).blob()],zh(n,i)));else if(n instanceof Blob)e.append(t,El([n],zh(n,i)||void 0,{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(r=>yM(e,t+"[]",r,i)));else{if(typeof n.then=="function")throw new TypeError(`Received a Promise for "${t}"; await it first, e.g. \`await toFile(...)\``);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))throw new TypeError(`Received ${n.constructor.name} for "${t}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);if(typeof n=="object")await Promise.all(Object.entries(n).map(([r,o])=>yM(e,`${t}[${r}]`,o,i)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}}});async function Gh(e,t,n){if(bM(),e=await e,t||(t=zh(e,!0)),VCe(e))return e instanceof File&&t==null&&n==null?e:El([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(BCe(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),El(await wM(r),t,n)}let i=await wM(e);if(!n?.type){let r=i.find(o=>typeof o=="object"&&"type"in o&&o.type);typeof r=="string"&&(n={...n,type:r})}return El(i,t,n)}async function wM(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(gQ(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(vM(e))for await(let n of e)t.push(...await wM(n));else{let n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${qCe(e)}`)}return t}function qCe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}var gQ,VCe,BCe,hQ=j(()=>{gs();gs();gQ=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",VCe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&gQ(e),BCe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function"});var kM=j(()=>{hQ()});var yQ=j(()=>{});var Z,Se=j(()=>{Z=class{constructor(t){this._client=t}}});function*HCe(e){if(!e)return;if(bQ in e){let{values:i,nulls:r}=e;yield*i.entries();for(let o of r)yield[o,null];return}let t=!1,n;e instanceof Headers?n=e.entries():GO(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let i of n){let r=i[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");let o=GO(i[1])?i[1]:[i[1]],s=!1;for(let a of o)a!==void 0&&(t&&!s&&(s=!0,yield[r,D_]),yield[r,a])}}var bQ,D_,KCe,$M,I,Ne=j(()=>{hr();bQ=Symbol.for("brand.privateNullableHeaders");D_=Symbol("clear"),KCe=new Set(["x-stainless-helper"]),$M=(e,t)=>{let n=e?e.split(",").map(i=>i.trim()).filter(Boolean):[];for(let i of t.split(",").map(r=>r.trim()))i&&!n.includes(i)&&n.push(i);return n.join(", ")},I=e=>{let t=new Headers,n=new Set;for(let i of e){let r=new Set;for(let[o,s]of HCe(i)){let a=o.toLowerCase();if(KCe.has(a)){if(s===D_)continue;s===null?(t.delete(o),n.add(a)):(t.set(o,$M(t.get(o),s)),n.delete(a));continue}(s===D_||!r.has(a))&&(t.delete(o),r.add(a),s===D_)||(s===null?(t.delete(o),n.add(a)):(t.append(o,s),n.delete(a)))}}return{[bQ]:!0,values:t,nulls:n}}});function wQ(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var vQ,JCe,N,Me=j(()=>{kt();vQ=Object.freeze(Object.create(null)),JCe=(e=wQ)=>function(n,...i){if(n.length===1)return n[0];let r=!1,o=[],s=n.reduce((u,d,p)=>{/[?#]/.test(d)&&(r=!0);let f=i[p],m=(r?encodeURIComponent:e)(""+f);return p!==i.length&&(f==null||typeof f=="object"&&f.toString===Object.getPrototypeOf(Object.getPrototypeOf(f.hasOwnProperty??vQ)??vQ)?.toString)&&(m=f+"",o.push({start:u.length+d.length,length:m.length,error:`Value of type ${Object.prototype.toString.call(f).slice(8,-1)} is not a valid path parameter`})),u+d+(p===i.length?"":m)},""),a=s.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;for(;(l=c.exec(a))!==null;)o.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(o.sort((u,d)=>u.start-d.start),o.length>0){let u=0,d=o.reduce((p,f)=>{let m=" ".repeat(f.start-u),g="^".repeat(f.length);return u=f.start+f.length,p+m+g},"");throw new J(`Path parameters result in path with invalid segments: +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){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 n=wv(t),r=au(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=wv(t),r=au(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){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:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};mV.Parser=MI});var vV=H(Um=>{"use strict";var gV=$I(),rde=Pm(),jm=Dm(),ide=kT(),ode=Je(),sde=OI(),hV=LI();function yV(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new sde.LineCounter||null,prettyErrors:t}}function ade(e,t={}){let{lineCounter:n,prettyErrors:r}=yV(t),i=new hV.Parser(n?.addNewLine),o=new gV.Composer(t),s=Array.from(o.compose(i.parse(e)));if(r&&n)for(let a of s)a.errors.forEach(jm.prettifyError(e,n)),a.warnings.forEach(jm.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function bV(e,t={}){let{lineCounter:n,prettyErrors:r}=yV(t),i=new hV.Parser(n?.addNewLine),o=new gV.Composer(t),s=null;for(let a of o.compose(i.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new jm.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(jm.prettifyError(e,n)),s.warnings.forEach(jm.prettifyError(e,n))),s}function cde(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);let i=bV(e,n);if(!i)return null;if(i.warnings.forEach(o=>ide.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:r},n))}function lde(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=n??t??{};if(!i)return}return ode.isDocument(e)&&!r?e.toString(n):new rde.Document(e,r,n).toString(n)}Um.parse=cde;Um.parseAllDocuments=ade;Um.parseDocument=bV;Um.stringify=lde});var rc=H(ct=>{"use strict";var ude=$I(),dde=Pm(),pde=rI(),FI=Dm(),fde=gm(),Ds=Je(),mde=As(),gde=an(),hde=Ps(),yde=Cs(),bde=bv(),vde=NI(),wde=OI(),kde=LI(),_v=vV(),wV=dm();ct.Composer=ude.Composer;ct.Document=dde.Document;ct.Schema=pde.Schema;ct.YAMLError=FI.YAMLError;ct.YAMLParseError=FI.YAMLParseError;ct.YAMLWarning=FI.YAMLWarning;ct.Alias=fde.Alias;ct.isAlias=Ds.isAlias;ct.isCollection=Ds.isCollection;ct.isDocument=Ds.isDocument;ct.isMap=Ds.isMap;ct.isNode=Ds.isNode;ct.isPair=Ds.isPair;ct.isScalar=Ds.isScalar;ct.isSeq=Ds.isSeq;ct.Pair=mde.Pair;ct.Scalar=gde.Scalar;ct.YAMLMap=hde.YAMLMap;ct.YAMLSeq=yde.YAMLSeq;ct.CST=bde;ct.Lexer=vde.Lexer;ct.LineCounter=wde.LineCounter;ct.Parser=kde.Parser;ct.parse=_v.parse;ct.parseAllDocuments=_v.parseAllDocuments;ct.parseDocument=_v.parseDocument;ct.stringify=_v.stringify;ct.visit=wV.visit;ct.visitAsync=wV.visitAsync});var Qu=H((w3e,hW)=>{"use strict";var bye="2.0.0",vye=Number.MAX_SAFE_INTEGER||9007199254740991,wye=16,kye=250,_ye=["major","premajor","minor","preminor","patch","prepatch","prerelease"];hW.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:wye,MAX_SAFE_BUILD_LENGTH:kye,MAX_SAFE_INTEGER:vye,RELEASE_TYPES:_ye,SEMVER_SPEC_VERSION:bye,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Mg=H((k3e,yW)=>{"use strict";var $ye=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};yW.exports=$ye});var Xu=H((go,bW)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:CN,MAX_SAFE_BUILD_LENGTH:Sye,MAX_LENGTH:xye}=Qu(),Eye=Mg();go=bW.exports={};var Tye=go.re=[],Iye=go.safeRe=[],pe=go.src=[],Aye=go.safeSrc=[],fe=go.t={},Rye=0,NN="[a-zA-Z0-9-]",Pye=[["\\s",1],["\\d",xye],[NN,Sye]],Cye=e=>{for(let[t,n]of Pye)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},Fe=(e,t,n)=>{let r=Cye(t),i=Rye++;Eye(e,i,t),fe[e]=i,pe[i]=t,Aye[i]=r,Tye[i]=new RegExp(t,n?"g":void 0),Iye[i]=new RegExp(r,n?"g":void 0)};Fe("NUMERICIDENTIFIER","0|[1-9]\\d*");Fe("NUMERICIDENTIFIERLOOSE","\\d+");Fe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${NN}*`);Fe("MAINVERSION",`(${pe[fe.NUMERICIDENTIFIER]})\\.(${pe[fe.NUMERICIDENTIFIER]})\\.(${pe[fe.NUMERICIDENTIFIER]})`);Fe("MAINVERSIONLOOSE",`(${pe[fe.NUMERICIDENTIFIERLOOSE]})\\.(${pe[fe.NUMERICIDENTIFIERLOOSE]})\\.(${pe[fe.NUMERICIDENTIFIERLOOSE]})`);Fe("PRERELEASEIDENTIFIER",`(?:${pe[fe.NONNUMERICIDENTIFIER]}|${pe[fe.NUMERICIDENTIFIER]})`);Fe("PRERELEASEIDENTIFIERLOOSE",`(?:${pe[fe.NONNUMERICIDENTIFIER]}|${pe[fe.NUMERICIDENTIFIERLOOSE]})`);Fe("PRERELEASE",`(?:-(${pe[fe.PRERELEASEIDENTIFIER]}(?:\\.${pe[fe.PRERELEASEIDENTIFIER]})*))`);Fe("PRERELEASELOOSE",`(?:-?(${pe[fe.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${pe[fe.PRERELEASEIDENTIFIERLOOSE]})*))`);Fe("BUILDIDENTIFIER",`${NN}+`);Fe("BUILD",`(?:\\+(${pe[fe.BUILDIDENTIFIER]}(?:\\.${pe[fe.BUILDIDENTIFIER]})*))`);Fe("FULLPLAIN",`v?${pe[fe.MAINVERSION]}${pe[fe.PRERELEASE]}?${pe[fe.BUILD]}?`);Fe("FULL",`^${pe[fe.FULLPLAIN]}$`);Fe("LOOSEPLAIN",`[v=\\s]*${pe[fe.MAINVERSIONLOOSE]}${pe[fe.PRERELEASELOOSE]}?${pe[fe.BUILD]}?`);Fe("LOOSE",`^${pe[fe.LOOSEPLAIN]}$`);Fe("GTLT","((?:<|>)?=?)");Fe("XRANGEIDENTIFIERLOOSE",`${pe[fe.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Fe("XRANGEIDENTIFIER",`${pe[fe.NUMERICIDENTIFIER]}|x|X|\\*`);Fe("XRANGEPLAIN",`[v=\\s]*(${pe[fe.XRANGEIDENTIFIER]})(?:\\.(${pe[fe.XRANGEIDENTIFIER]})(?:\\.(${pe[fe.XRANGEIDENTIFIER]})(?:${pe[fe.PRERELEASE]})?${pe[fe.BUILD]}?)?)?`);Fe("XRANGEPLAINLOOSE",`[v=\\s]*(${pe[fe.XRANGEIDENTIFIERLOOSE]})(?:\\.(${pe[fe.XRANGEIDENTIFIERLOOSE]})(?:\\.(${pe[fe.XRANGEIDENTIFIERLOOSE]})(?:${pe[fe.PRERELEASELOOSE]})?${pe[fe.BUILD]}?)?)?`);Fe("XRANGE",`^${pe[fe.GTLT]}\\s*${pe[fe.XRANGEPLAIN]}$`);Fe("XRANGELOOSE",`^${pe[fe.GTLT]}\\s*${pe[fe.XRANGEPLAINLOOSE]}$`);Fe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${CN}})(?:\\.(\\d{1,${CN}}))?(?:\\.(\\d{1,${CN}}))?`);Fe("COERCE",`${pe[fe.COERCEPLAIN]}(?:$|[^\\d])`);Fe("COERCEFULL",pe[fe.COERCEPLAIN]+`(?:${pe[fe.PRERELEASE]})?(?:${pe[fe.BUILD]})?(?:$|[^\\d])`);Fe("COERCERTL",pe[fe.COERCE],!0);Fe("COERCERTLFULL",pe[fe.COERCEFULL],!0);Fe("LONETILDE","(?:~>?)");Fe("TILDETRIM",`(\\s*)${pe[fe.LONETILDE]}\\s+`,!0);go.tildeTrimReplace="$1~";Fe("TILDE",`^${pe[fe.LONETILDE]}${pe[fe.XRANGEPLAIN]}$`);Fe("TILDELOOSE",`^${pe[fe.LONETILDE]}${pe[fe.XRANGEPLAINLOOSE]}$`);Fe("LONECARET","(?:\\^)");Fe("CARETTRIM",`(\\s*)${pe[fe.LONECARET]}\\s+`,!0);go.caretTrimReplace="$1^";Fe("CARET",`^${pe[fe.LONECARET]}${pe[fe.XRANGEPLAIN]}$`);Fe("CARETLOOSE",`^${pe[fe.LONECARET]}${pe[fe.XRANGEPLAINLOOSE]}$`);Fe("COMPARATORLOOSE",`^${pe[fe.GTLT]}\\s*(${pe[fe.LOOSEPLAIN]})$|^$`);Fe("COMPARATOR",`^${pe[fe.GTLT]}\\s*(${pe[fe.FULLPLAIN]})$|^$`);Fe("COMPARATORTRIM",`(\\s*)${pe[fe.GTLT]}\\s*(${pe[fe.LOOSEPLAIN]}|${pe[fe.XRANGEPLAIN]})`,!0);go.comparatorTrimReplace="$1$2$3";Fe("HYPHENRANGE",`^\\s*(${pe[fe.XRANGEPLAIN]})\\s+-\\s+(${pe[fe.XRANGEPLAIN]})\\s*$`);Fe("HYPHENRANGELOOSE",`^\\s*(${pe[fe.XRANGEPLAINLOOSE]})\\s+-\\s+(${pe[fe.XRANGEPLAINLOOSE]})\\s*$`);Fe("STAR","(<|>)?=?\\s*\\*");Fe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Fe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Mk=H((_3e,vW)=>{"use strict";var Nye=Object.freeze({loose:!0}),Dye=Object.freeze({}),Oye=e=>e?typeof e!="object"?Nye:e:Dye;vW.exports=Oye});var DN=H(($3e,_W)=>{"use strict";var wW=/^[0-9]+$/,kW=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:ekW(t,e);_W.exports={compareIdentifiers:kW,rcompareIdentifiers:Mye}});var Dn=H((S3e,SW)=>{"use strict";var Lk=Mg(),{MAX_LENGTH:$W,MAX_SAFE_INTEGER:Fk}=Qu(),{safeRe:jk,t:Uk}=Xu(),Lye=Mk(),{compareIdentifiers:ON}=DN(),Fye=(e,t)=>{let n=t.split(".");if(n.length>e.length)return!1;for(let r=0;r$W)throw new TypeError(`version is longer than ${$W} characters`);Lk("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=t.trim().match(n.loose?jk[Uk.LOOSE]:jk[Uk.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Fk||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Fk||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Fk||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&ot.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],i=t.prerelease[n];if(Lk("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return ON(r,i)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let r=this.build[n],i=t.build[n];if(Lk("build compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return ON(r,i)}while(++n)}inc(t,n,r){if(t.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let i=`-${n}`.match(this.options.loose?jk[Uk.PRERELEASELOOSE]:jk[Uk.PRERELEASE]);if(!i||i[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let o=[n,i];if(r===!1&&(o=[n]),Fye(this.prerelease,n)){let s=this.prerelease[n.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};SW.exports=MN});var Zs=H((x3e,EW)=>{"use strict";var xW=Dn(),jye=(e,t,n=!1)=>{if(e instanceof xW)return e;try{return new xW(e,t)}catch(r){if(!n)return null;throw r}};EW.exports=jye});var IW=H((E3e,TW)=>{"use strict";var Uye=Zs(),zye=(e,t)=>{let n=Uye(e,t);return n?n.version:null};TW.exports=zye});var RW=H((T3e,AW)=>{"use strict";var Gye=Zs(),Bye=(e,t)=>{let n=Gye(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};AW.exports=Bye});var NW=H((I3e,CW)=>{"use strict";var PW=Dn(),Vye=(e,t,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new PW(e instanceof PW?e.version:e,n).inc(t,r,i).version}catch{return null}};CW.exports=Vye});var MW=H((A3e,OW)=>{"use strict";var DW=Zs(),qye=(e,t)=>{let n=DW(e,null,!0),r=DW(t,null,!0),i=n.compare(r);if(i===0)return null;let o=i>0,s=o?n:r,a=o?r:n,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"};OW.exports=qye});var FW=H((R3e,LW)=>{"use strict";var Wye=Dn(),Hye=(e,t)=>new Wye(e,t).major;LW.exports=Hye});var UW=H((P3e,jW)=>{"use strict";var Kye=Dn(),Jye=(e,t)=>new Kye(e,t).minor;jW.exports=Jye});var GW=H((C3e,zW)=>{"use strict";var Zye=Dn(),Yye=(e,t)=>new Zye(e,t).patch;zW.exports=Yye});var VW=H((N3e,BW)=>{"use strict";var Qye=Zs(),Xye=(e,t)=>{let n=Qye(e,t);return n&&n.prerelease.length?n.prerelease:null};BW.exports=Xye});var li=H((D3e,WW)=>{"use strict";var qW=Dn(),ebe=(e,t,n)=>new qW(e,n).compare(new qW(t,n));WW.exports=ebe});var KW=H((O3e,HW)=>{"use strict";var tbe=li(),nbe=(e,t,n)=>tbe(t,e,n);HW.exports=nbe});var ZW=H((M3e,JW)=>{"use strict";var rbe=li(),ibe=(e,t)=>rbe(e,t,!0);JW.exports=ibe});var zk=H((L3e,QW)=>{"use strict";var YW=Dn(),obe=(e,t,n)=>{let r=new YW(e,n),i=new YW(t,n);return r.compare(i)||r.compareBuild(i)};QW.exports=obe});var eH=H((F3e,XW)=>{"use strict";var sbe=zk(),abe=(e,t)=>e.sort((n,r)=>sbe(n,r,t));XW.exports=abe});var nH=H((j3e,tH)=>{"use strict";var cbe=zk(),lbe=(e,t)=>e.sort((n,r)=>cbe(r,n,t));tH.exports=lbe});var Lg=H((U3e,rH)=>{"use strict";var ube=li(),dbe=(e,t,n)=>ube(e,t,n)>0;rH.exports=dbe});var Gk=H((z3e,iH)=>{"use strict";var pbe=li(),fbe=(e,t,n)=>pbe(e,t,n)<0;iH.exports=fbe});var LN=H((G3e,oH)=>{"use strict";var mbe=li(),gbe=(e,t,n)=>mbe(e,t,n)===0;oH.exports=gbe});var FN=H((B3e,sH)=>{"use strict";var hbe=li(),ybe=(e,t,n)=>hbe(e,t,n)!==0;sH.exports=ybe});var Bk=H((V3e,aH)=>{"use strict";var bbe=li(),vbe=(e,t,n)=>bbe(e,t,n)>=0;aH.exports=vbe});var Vk=H((q3e,cH)=>{"use strict";var wbe=li(),kbe=(e,t,n)=>wbe(e,t,n)<=0;cH.exports=kbe});var jN=H((W3e,lH)=>{"use strict";var _be=LN(),$be=FN(),Sbe=Lg(),xbe=Bk(),Ebe=Gk(),Tbe=Vk(),Ibe=(e,t,n,r)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return _be(e,n,r);case"!=":return $be(e,n,r);case">":return Sbe(e,n,r);case">=":return xbe(e,n,r);case"<":return Ebe(e,n,r);case"<=":return Tbe(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};lH.exports=Ibe});var dH=H((H3e,uH)=>{"use strict";var Abe=Dn(),Rbe=Zs(),{safeRe:qk,t:Wk}=Xu(),Pbe=(e,t)=>{if(e instanceof Abe)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?qk[Wk.COERCEFULL]:qk[Wk.COERCE]);else{let c=t.includePrerelease?qk[Wk.COERCERTLFULL]:qk[Wk.COERCERTL],l;for(;(l=c.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||l.index+l[0].length!==n.index+n[0].length)&&(n=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(n===null)return null;let r=n[2],i=n[3]||"0",o=n[4]||"0",s=t.includePrerelease&&n[5]?`-${n[5]}`:"",a=t.includePrerelease&&n[6]?`+${n[6]}`:"";return Rbe(`${r}.${i}.${o}${s}${a}`,t)};uH.exports=Pbe});var fH=H((K3e,pH)=>{"use strict";var Cbe=Zs(),Nbe=Qu(),Dbe=Dn(),Obe=(e,t,n)=>{if(!Nbe.RELEASE_TYPES.includes(t))return null;let r=Mbe(e,n);return r&&Lbe(r,t)},Mbe=(e,t)=>{let n=e instanceof Dbe?e.version:e;return Cbe(n,t)},Lbe=(e,t)=>{if(Fbe(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Fbe=e=>e.startsWith("pre");pH.exports=Obe});var gH=H((J3e,mH)=>{"use strict";var UN=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,n)}return this}};mH.exports=UN});var ui=H((Z3e,vH)=>{"use strict";var jbe=/\s+/g,zN=class e{constructor(t,n){if(n=zbe(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof GN)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(jbe," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!yH(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Zbe(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let n=this.set[t];for(let r=0;r0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(Jbe,"");let r=((this.options.includePrerelease&&Hbe)|(this.options.loose&&Kbe))+":"+t,i=hH.get(r);if(i)return i;let o=this.options.loose,s=o?lr[On.HYPHENRANGELOOSE]:lr[On.HYPHENRANGE];t=t.replace(s,ave(this.options.includePrerelease)),It("hyphen replace",t),t=t.replace(lr[On.COMPARATORTRIM],Vbe),It("comparator trim",t),t=t.replace(lr[On.TILDETRIM],qbe),It("tilde trim",t),t=t.replace(lr[On.CARETTRIM],Wbe),It("caret trim",t);let a=t.split(" ").map(d=>Ybe(d,this.options)).join(" ").split(/\s+/).map(d=>sve(d,this.options));o&&(a=a.filter(d=>(It("loose invalid filter",d,this.options),!!d.match(lr[On.COMPARATORLOOSE])))),It("range list",a);let c=new Map,l=a.map(d=>new GN(d,this.options));for(let d of l){if(yH(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return hH.set(r,u),u}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(r=>bH(r,n)&&t.set.some(i=>bH(i,n)&&r.every(o=>i.every(s=>o.intersects(s,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Gbe(t,this.options)}catch{return!1}for(let n=0;ne.value==="<0.0.0-0",Zbe=e=>e.value==="",bH=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(o=>i.intersects(o,t)),i=r.pop();return n},Ybe=(e,t)=>(e=e.replace(lr[On.BUILD],""),It("comp",e,t),e=tve(e,t),It("caret",e),e=Xbe(e,t),It("tildes",e),e=rve(e,t),It("xrange",e),e=ove(e,t),It("stars",e),e),yn=e=>!e||e.toLowerCase()==="x"||e==="*",Qbe=(e,t,n)=>yn(e)&&!yn(t)||yn(t)&&n&&!yn(n),Xbe=(e,t)=>e.trim().split(/\s+/).map(n=>eve(n,t)).join(" "),eve=(e,t)=>{let n=t.loose?lr[On.TILDELOOSE]:lr[On.TILDE],r=t.includePrerelease?"-0":"";return e.replace(n,(i,o,s,a,c)=>{It("tilde",e,i,o,s,a,c);let l;return yn(o)?l="":yn(s)?l=`>=${o}.0.0${r} <${+o+1}.0.0-0`:yn(a)?l=`>=${o}.${s}.0${r} <${o}.${+s+1}.0-0`:c?(It("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,It("tilde return",l),l})},tve=(e,t)=>e.trim().split(/\s+/).map(n=>nve(n,t)).join(" "),nve=(e,t)=>{It("caret",e,t);let n=t.loose?lr[On.CARETLOOSE]:lr[On.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(i,o,s,a,c)=>{It("caret",e,i,o,s,a,c);let l;return yn(o)?l="":yn(s)?l=`>=${o}.0.0${r} <${+o+1}.0.0-0`:yn(a)?o==="0"?l=`>=${o}.${s}.0${r} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${r} <${+o+1}.0.0-0`:c?(It("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(It("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),It("caret return",l),l})},rve=(e,t)=>(It("replaceXRanges",e,t),e.split(/\s+/).map(n=>ive(n,t)).join(" ")),ive=(e,t)=>{e=e.trim();let n=t.loose?lr[On.XRANGELOOSE]:lr[On.XRANGE];return e.replace(n,(r,i,o,s,a,c)=>{if(It("xRange",e,r,i,o,s,a,c),Qbe(o,s,a))return e;let l=yn(o),u=l||yn(s),d=u||yn(a),p=d;return i==="="&&p&&(i=""),c=t.includePrerelease?"-0":"",l?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&p?(u&&(s=0),a=0,i===">"?(i=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",u?o=+o+1:s=+s+1),i==="<"&&(c="-0"),r=`${i+o}.${s}.${a}${c}`):u?r=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(r=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),It("xRange return",r),r})},ove=(e,t)=>(It("replaceStars",e,t),e.trim().replace(lr[On.STAR],"")),sve=(e,t)=>(It("replaceGTE0",e,t),e.trim().replace(lr[t.includePrerelease?On.GTE0PRE:On.GTE0],"")),ave=e=>(t,n,r,i,o,s,a,c,l,u,d,p)=>(yn(r)?n="":yn(i)?n=`>=${r}.0.0${e?"-0":""}`:yn(o)?n=`>=${r}.${i}.0${e?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,yn(l)?c="":yn(u)?c=`<${+l+1}.0.0-0`:yn(d)?c=`<${l}.${+u+1}.0-0`:p?c=`<=${l}.${u}.${d}-${p}`:e?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),cve=(e,t,n)=>{for(let r=0;r0){let i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var Fg=H((Y3e,xH)=>{"use strict";var jg=Symbol("SemVer ANY"),qN=class e{static get ANY(){return jg}constructor(t,n){if(n=wH(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),VN("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===jg?this.value="":this.value=this.operator+this.semver.version,VN("comp",this)}parse(t){let n=this.options.loose?kH[_H.COMPARATORLOOSE]:kH[_H.COMPARATOR],r=t.match(n);if(!r)throw new TypeError(`Invalid comparator: ${t}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new $H(r[2],this.options.loose):this.semver=jg}toString(){return this.value}test(t){if(VN("Comparator.test",t,this.options.loose),this.semver===jg||t===jg)return!0;if(typeof t=="string")try{t=new $H(t,this.options)}catch{return!1}return BN(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new SH(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new SH(this.value,n).test(t.semver):(n=wH(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||BN(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||BN(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};xH.exports=qN;var wH=Mk(),{safeRe:kH,t:_H}=Xu(),BN=jN(),VN=Mg(),$H=Dn(),SH=ui()});var Ug=H((Q3e,EH)=>{"use strict";var lve=ui(),uve=(e,t,n)=>{try{t=new lve(t,n)}catch{return!1}return t.test(e)};EH.exports=uve});var IH=H((X3e,TH)=>{"use strict";var dve=ui(),pve=(e,t)=>new dve(e,t).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));TH.exports=pve});var RH=H((e8e,AH)=>{"use strict";var fve=Dn(),mve=ui(),gve=(e,t,n)=>{let r=null,i=null,o=null;try{o=new mve(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!r||i.compare(s)===-1)&&(r=s,i=new fve(r,n))}),r};AH.exports=gve});var CH=H((t8e,PH)=>{"use strict";var hve=Dn(),yve=ui(),bve=(e,t,n)=>{let r=null,i=null,o=null;try{o=new yve(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!r||i.compare(s)===1)&&(r=s,i=new hve(r,n))}),r};PH.exports=bve});var OH=H((n8e,DH)=>{"use strict";var WN=Dn(),vve=ui(),NH=Lg(),wve=(e,t)=>{e=new vve(e,t);let n=new WN("0.0.0");if(e.test(n)||(n=new WN("0.0.0-0"),e.test(n)))return n;n=null;for(let r=0;r{let a=new WN(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||NH(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||NH(n,o))&&(n=o)}return n&&e.test(n)?n:null};DH.exports=wve});var LH=H((r8e,MH)=>{"use strict";var kve=ui(),_ve=(e,t)=>{try{return new kve(e,t).range||"*"}catch{return null}};MH.exports=_ve});var Hk=H((i8e,zH)=>{"use strict";var $ve=Dn(),UH=Fg(),{ANY:Sve}=UH,xve=ui(),Eve=Ug(),FH=Lg(),jH=Gk(),Tve=Vk(),Ive=Bk(),Ave=(e,t,n,r)=>{e=new $ve(e,r),t=new xve(t,r);let i,o,s,a,c;switch(n){case">":i=FH,o=Tve,s=jH,a=">",c=">=";break;case"<":i=jH,o=Ive,s=FH,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Eve(e,t,r))return!1;for(let l=0;l{f.semver===Sve&&(f=new UH(">=0.0.0")),d=d||f,p=p||f,i(f.semver,d.semver,r)?d=f:s(f.semver,p.semver,r)&&(p=f)}),d.operator===a||d.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0};zH.exports=Ave});var BH=H((o8e,GH)=>{"use strict";var Rve=Hk(),Pve=(e,t,n)=>Rve(e,t,">",n);GH.exports=Pve});var qH=H((s8e,VH)=>{"use strict";var Cve=Hk(),Nve=(e,t,n)=>Cve(e,t,"<",n);VH.exports=Nve});var KH=H((a8e,HH)=>{"use strict";var WH=ui(),Dve=(e,t,n)=>(e=new WH(e,n),t=new WH(t,n),e.intersects(t,n));HH.exports=Dve});var ZH=H((c8e,JH)=>{"use strict";var Ove=Ug(),Mve=li();JH.exports=(e,t,n)=>{let r=[],i=null,o=null,s=e.sort((u,d)=>Mve(u,d,n));for(let u of s)Ove(u,t,n)?(o=u,i||(i=u)):(o&&r.push([i,o]),o=null,i=null);i&&r.push([i,null]);let a=[];for(let[u,d]of r)u===d?a.push(u):!d&&u===s[0]?a.push("*"):d?u===s[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length{"use strict";var YH=ui(),JN=Fg(),{ANY:HN}=JN,KN=Ug(),ZN=li(),Lve=(e,t,n={})=>{if(e===t)return!0;e=new YH(e,n),t=new YH(t,n);let r=!1;e:for(let i of e.set){for(let o of t.set){let s=jve(i,o,n);if(r=r||s!==null,s)continue e}if(r)return!1}return!0},Fve=[new JN(">=0.0.0-0")],QH=[new JN(">=0.0.0")],jve=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===HN){if(t.length===1&&t[0].semver===HN)return!0;n.includePrerelease?e=Fve:e=QH}if(t.length===1&&t[0].semver===HN){if(n.includePrerelease)return!0;t=QH}let r=new Set,i,o;for(let f of e)f.operator===">"||f.operator===">="?i=XH(i,f,n):f.operator==="<"||f.operator==="<="?o=eK(o,f,n):r.add(f.semver);if(r.size>1)return null;let s;if(i&&o){if(s=ZN(i.semver,o.semver,n),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let f of r){if(i&&!KN(f,String(i),n)||o&&!KN(f,String(o),n))return null;for(let m of t)if(!KN(f,String(m),n))return!1;return!0}let a,c,l,u,d=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of t){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",i){if(p&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch&&(p=!1),f.operator===">"||f.operator===">="){if(a=XH(i,f,n),a===f&&a!==i)return!1}else if(i.operator===">="&&!f.test(i.semver))return!1}if(o){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(c=eK(o,f,n),c===f&&c!==o)return!1}else if(o.operator==="<="&&!f.test(o.semver))return!1}if(!f.operator&&(o||i)&&s!==0)return!1}return!(i&&l&&!o&&s!==0||o&&u&&!i&&s!==0||p||d)},XH=(e,t,n)=>{if(!e)return t;let r=ZN(e.semver,t.semver,n);return r>0?e:r<0||t.operator===">"&&e.operator===">="?t:e},eK=(e,t,n)=>{if(!e)return t;let r=ZN(e.semver,t.semver,n);return r<0?e:r>0||t.operator==="<"&&e.operator==="<="?t:e};tK.exports=Lve});var _c=H((u8e,oK)=>{"use strict";var YN=Xu(),rK=Qu(),Uve=Dn(),iK=DN(),zve=Zs(),Gve=IW(),Bve=RW(),Vve=NW(),qve=MW(),Wve=FW(),Hve=UW(),Kve=GW(),Jve=VW(),Zve=li(),Yve=KW(),Qve=ZW(),Xve=zk(),ewe=eH(),twe=nH(),nwe=Lg(),rwe=Gk(),iwe=LN(),owe=FN(),swe=Bk(),awe=Vk(),cwe=jN(),lwe=dH(),uwe=fH(),dwe=Fg(),pwe=ui(),fwe=Ug(),mwe=IH(),gwe=RH(),hwe=CH(),ywe=OH(),bwe=LH(),vwe=Hk(),wwe=BH(),kwe=qH(),_we=KH(),$we=ZH(),Swe=nK();oK.exports={parse:zve,valid:Gve,clean:Bve,inc:Vve,diff:qve,major:Wve,minor:Hve,patch:Kve,prerelease:Jve,compare:Zve,rcompare:Yve,compareLoose:Qve,compareBuild:Xve,sort:ewe,rsort:twe,gt:nwe,lt:rwe,eq:iwe,neq:owe,gte:swe,lte:awe,cmp:cwe,coerce:lwe,truncate:uwe,Comparator:dwe,Range:pwe,satisfies:fwe,toComparators:mwe,maxSatisfying:gwe,minSatisfying:hwe,minVersion:ywe,validRange:bwe,outside:vwe,gtr:wwe,ltr:kwe,intersects:_we,simplifyRange:$we,subset:Swe,SemVer:Uve,re:YN.re,src:YN.src,tokens:YN.t,SEMVER_SPEC_VERSION:rK.SEMVER_SPEC_VERSION,RELEASE_TYPES:rK.RELEASE_TYPES,compareIdentifiers:iK.compareIdentifiers,rcompareIdentifiers:iK.rcompareIdentifiers}});var k8=H((Vit,w8)=>{w8.exports=require("util").inspect});var z8=H((qit,U8)=>{var qO=typeof Map=="function"&&Map.prototype,MO=Object.getOwnPropertyDescriptor&&qO?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t$=qO&&MO&&typeof MO.get=="function"?MO.get:null,_8=qO&&Map.prototype.forEach,WO=typeof Set=="function"&&Set.prototype,LO=Object.getOwnPropertyDescriptor&&WO?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,n$=WO&&LO&&typeof LO.get=="function"?LO.get:null,$8=WO&&Set.prototype.forEach,wIe=typeof WeakMap=="function"&&WeakMap.prototype,Ih=wIe?WeakMap.prototype.has:null,kIe=typeof WeakSet=="function"&&WeakSet.prototype,Ah=kIe?WeakSet.prototype.has:null,_Ie=typeof WeakRef=="function"&&WeakRef.prototype,S8=_Ie?WeakRef.prototype.deref:null,$Ie=Boolean.prototype.valueOf,SIe=Object.prototype.toString,xIe=Function.prototype.toString,EIe=String.prototype.match,HO=String.prototype.slice,xa=String.prototype.replace,TIe=String.prototype.toUpperCase,x8=String.prototype.toLowerCase,D8=RegExp.prototype.test,E8=Array.prototype.concat,So=Array.prototype.join,IIe=Array.prototype.slice,T8=Math.floor,UO=typeof BigInt=="function"?BigInt.prototype.valueOf:null,FO=Object.getOwnPropertySymbols,zO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Id=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Qn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Id||!0)?Symbol.toStringTag:null,O8=Object.prototype.propertyIsEnumerable,I8=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function A8(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||D8.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-T8(-e):T8(e);if(r!==e){var i=String(r),o=HO.call(t,i.length+1);return xa.call(i,n,"$&_")+"."+xa.call(xa.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return xa.call(t,n,"$&_")}var GO=k8(),R8=GO.custom,P8=L8(R8)?R8:null;U8.exports=function e(t,n,r,i){var o=n||{};if(Sa(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Sa(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Sa(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Sa(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Sa(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return j8(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?A8(t,c):c}if(typeof t=="bigint"){var l=String(t)+"n";return a?A8(t,l):l}var u=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=u&&u>0&&typeof t=="object")return BO(t)?"[Array]":"[Object]";var d=WIe(o,r);if(typeof i>"u")i=[];else if(F8(i,t)>=0)return"[Circular]";function p(Z,re,L){if(re&&(i=IIe.call(i),i.push(re)),L){var te={depth:o.depth};return Sa(o,"quoteStyle")&&(te.quoteStyle=o.quoteStyle),e(Z,te,r+1,i)}return e(Z,o,r+1,i)}if(typeof t=="function"&&!C8(t)){var f=LIe(t),m=e$(t,p);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(m.length>0?" { "+So.call(m,", ")+" }":"")}if(L8(t)){var g=Id?xa.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):zO.call(t);return typeof t=="object"&&!Id?Th(g):g}if(BIe(t)){for(var h="<"+x8.call(String(t.nodeName)),v=t.attributes||[],b=0;b",h}if(BO(t)){if(t.length===0)return"[]";var w=e$(t,p);return d&&!qIe(w)?"["+VO(w,d)+"]":"[ "+So.call(w,", ")+" ]"}if(PIe(t)){var k=e$(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!O8.call(t,"cause")?"{ ["+String(t)+"] "+So.call(E8.call("[cause]: "+p(t.cause),k),", ")+" }":k.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+So.call(k,", ")+" }"}if(typeof t=="object"&&s){if(P8&&typeof t[P8]=="function"&&GO)return GO(t,{depth:u-r});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(FIe(t)){var $=[];return _8&&_8.call(t,function(Z,re){$.push(p(re,t,!0)+" => "+p(Z,t))}),N8("Map",t$.call(t),$,d)}if(zIe(t)){var S=[];return $8&&$8.call(t,function(Z){S.push(p(Z,t))}),N8("Set",n$.call(t),S,d)}if(jIe(t))return jO("WeakMap");if(GIe(t))return jO("WeakSet");if(UIe(t))return jO("WeakRef");if(NIe(t))return Th(p(Number(t)));if(OIe(t))return Th(p(UO.call(t)));if(DIe(t))return Th($Ie.call(t));if(CIe(t))return Th(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!RIe(t)&&!C8(t)){var E=e$(t,p),T=I8?I8(t)===Object.prototype:t instanceof Object||t.constructor===Object,A=t instanceof Object?"":"null prototype",R=!T&&Qn&&Object(t)===t&&Qn in t?HO.call(Ea(t),8,-1):A?"Object":"",j=T||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",U=j+(R||A?"["+So.call(E8.call([],R||[],A||[]),": ")+"] ":"");return E.length===0?U+"{}":d?U+"{"+VO(E,d)+"}":U+"{ "+So.call(E,", ")+" }"}return String(t)};function M8(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function AIe(e){return xa.call(String(e),/"/g,""")}function BO(e){return Ea(e)==="[object Array]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function RIe(e){return Ea(e)==="[object Date]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function C8(e){return Ea(e)==="[object RegExp]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function PIe(e){return Ea(e)==="[object Error]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function CIe(e){return Ea(e)==="[object String]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function NIe(e){return Ea(e)==="[object Number]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function DIe(e){return Ea(e)==="[object Boolean]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function L8(e){if(Id)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!zO)return!1;try{return zO.call(e),!0}catch{}return!1}function OIe(e){if(!e||typeof e!="object"||!UO)return!1;try{return UO.call(e),!0}catch{}return!1}var MIe=Object.prototype.hasOwnProperty||function(e){return e in this};function Sa(e,t){return MIe.call(e,t)}function Ea(e){return SIe.call(e)}function LIe(e){if(e.name)return e.name;var t=EIe.call(xIe.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function F8(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return j8(HO.call(e,0,t.maxStringLength),t)+r}var i=xa.call(xa.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,VIe);return M8(i,"single",t)}function VIe(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+TIe.call(t.toString(16))}function Th(e){return"Object("+e+")"}function jO(e){return e+" { ? }"}function N8(e,t,n,r){var i=r?VO(n,r):So.call(n,", ");return e+" ("+t+") {"+i+"}"}function qIe(e){for(var t=0;t=0)return!1;return!0}function WIe(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=So.call(Array(e.indent+1)," ");else return null;return{base:n,prev:So.call(Array(t+1),n)}}function VO(e,t){if(e.length===0)return"";var n=` +`+t.prev+t.base;return n+So.call(e,","+n)+` +`+t.prev}function e$(e,t){var n=BO(e),r=[];if(n){r.length=e.length;for(var i=0;ine,decodeFieldSignature:()=>fQ,decodeMethodSignature:()=>pQ,readAssembly:()=>T$});function fNe(e){if(e.length<64||e.readUInt16LE(0)!==23117)return null;let t=e.readUInt32LE(60);if(t+24>e.length||e.readUInt32LE(t)!==17744)return null;let n=e.readUInt16LE(t+6),r=e.readUInt16LE(t+20),i=t+24;if(r===0)return null;let o=e.readUInt16LE(i),s=i+(o===523?112:96),a=[],c=i+r;for(let f=0;fe.length)break;a.push({virtualSize:e.readUInt32LE(m+8),virtualAddress:e.readUInt32LE(m+12),rawAddress:e.readUInt32LE(m+20)})}let l=e.readUInt32LE(s+112);if(l===0)return null;let u=aQ(l,a);if(u===null||u+16>e.length)return null;let d=e.readUInt32LE(u+8),p=aQ(d,a);return p===null?null:{offset:p,sections:a}}function aQ(e,t){for(let n of t)if(e>=n.virtualAddress&&ee.length||e.readUInt32LE(t)!==1112167234)return null;let n=e.readUInt32LE(t+12),r=t+16+n+2,i=e.readUInt16LE(r);r+=2;let o=new Map;for(let c=0;c"||h.startsWith("<"))continue;let v=ANe(r,i,l,f),b=dQ(r,m[3]),w=[],k=[];for(let $ of lQ(m[4],f,i,4,o.length)){let S=o[$];if(!cQ(S[0]))continue;let E=r.string(S[1]);E.startsWith("<")||(w.push(E),k.push(`${E}: ${fQ(r,r.blob(S[2]))}`))}for(let $ of lQ(m[5],f,i,5,s.length)){let S=s[$];if(!cQ(S[2]))continue;let E=r.string(S[3]);E.startsWith("<")||/^(get_|set_|add_|remove_)/.test(E)||(w.push(E),k.push(`${E}${pQ(r,r.blob(S[4]))}`))}for(let $ of u.get(f+1)??[]){let S=r.string(a[$][1]);S.startsWith("<")||(w.push(S),k.push(`${S} { get; set; }`))}for(let $ of d.get(f+1)??[]){let S=r.string(c[$][1]);S.startsWith("<")||(w.push(S),k.push(`event ${S}`))}p.push({fullName:v,kind:INe(g,b),members:[...new Set(w)],signatures:[...new Set(k)]})}return p}function INe(e,t){return e&_Ne?"interface":t==="System.Enum"?"enum":t==="System.ValueType"?"struct":t==="System.MulticastDelegate"||t==="System.Delegate"?"delegate":"class"}function ANe(e,t,n,r){let i=[],o=r;for(let s=0;s<16;s++){let a=t[o];if(!a)break;i.unshift(e.string(a[1]));let c=n.get(o+1);if(c===void 0){let l=e.string(a[2]);return l?`${l}.${i.join("+")}`:i.join("+")}o=c-1}return i.join("+")}function dQ(e,t){let n=t&3,r=t>>2;if(r===0)return null;if(n===0){let i=e.table(ne.TypeDef)[r-1];if(!i)return null;let o=e.string(i[2]),s=e.string(i[1]);return o?`${o}.${s}`:s}if(n===1){let i=e.table(ne.TypeRef)[r-1];if(!i)return null;let o=e.string(i[2]),s=e.string(i[1]);return o?`${o}.${s}`:s}return null}function lQ(e,t,n,r,i){let o=n[t+1]?.[r]??i+1,s=[];for(let a=e;a`}let o=Ro(t,n);n+=o.width;let s=Yi(e,t,n);n=s.offset;let a=[];for(let c=0;c=t.length);c++){let l=Yi(e,t,n);n=l.offset,a.push(l.text)}return`${i}(${a.join(", ")}): ${s.text}`}function fQ(e,t){return t.length<2?"?":Yi(e,t,1).text}function Yi(e,t,n){let r=n,i=t[r++];if(i===void 0)return{text:"?",offset:r};let o=RNe[i];if(o)return{text:o,offset:r};switch(i){case 15:{let s=Yi(e,t,r);return{text:`${s.text}*`,offset:s.offset}}case 16:{let s=Yi(e,t,r);return{text:`ref ${s.text}`,offset:s.offset}}case 29:{let s=Yi(e,t,r);return{text:`${s.text}[]`,offset:s.offset}}case 69:{let s=Yi(e,t,r);return{text:s.text,offset:s.offset}}case 17:case 18:{let s=Ro(t,r);return r+=s.width,{text:dQ(e,s.value)??"object",offset:r}}case 19:case 30:{let s=Ro(t,r);return r+=s.width,{text:`${i===19?"T":"M"}${s.value}`,offset:r}}case 21:{let s=Yi(e,t,r);r=s.offset;let a=Ro(t,r);r+=a.width;let c=[];for(let l=0;l`,offset:r}}case 20:{let s=Yi(e,t,r);r=s.offset;let a=Ro(t,r);r+=a.width;for(let c of["sizes","lowBounds"]){let l=Ro(t,r);r+=l.width;for(let u=0;u{"use strict";zt={type:"u16"},Dt={type:"u32"},Kt={type:"string"},PM={type:"guid"},gr={type:"blob"},Ot=e=>({type:"rid",table:e}),vn=e=>({type:"coded",family:e}),ne={Module:0,TypeRef:1,TypeDef:2,Field:4,MethodDef:6,Param:8,InterfaceImpl:9,MemberRef:10,Constant:11,CustomAttribute:12,FieldMarshal:13,DeclSecurity:14,ClassLayout:15,FieldLayout:16,StandAloneSig:17,EventMap:18,Event:20,PropertyMap:21,Property:23,MethodSemantics:24,MethodImpl:25,ModuleRef:26,TypeSpec:27,ImplMap:28,FieldRVA:29,Assembly:32,AssemblyRef:35,File:38,ExportedType:39,ManifestResource:40,NestedClass:41,GenericParam:42,MethodSpec:43,GenericParamConstraint:44},gNe={TypeDefOrRef:[ne.TypeDef,ne.TypeRef,ne.TypeSpec],HasConstant:[ne.Field,ne.Param,ne.Property],HasCustomAttribute:[ne.MethodDef,ne.Field,ne.TypeRef,ne.TypeDef,ne.Param,ne.InterfaceImpl,ne.MemberRef,ne.Module,ne.DeclSecurity,ne.Property,ne.Event,ne.StandAloneSig,ne.ModuleRef,ne.TypeSpec,ne.Assembly,ne.AssemblyRef,ne.File,ne.ExportedType,ne.ManifestResource,ne.GenericParam,ne.GenericParamConstraint,ne.MethodSpec],HasFieldMarshal:[ne.Field,ne.Param],HasDeclSecurity:[ne.TypeDef,ne.MethodDef,ne.Assembly],MemberRefParent:[ne.TypeDef,ne.TypeRef,ne.ModuleRef,ne.MethodDef,ne.TypeSpec],HasSemantics:[ne.Event,ne.Property],MethodDefOrRef:[ne.MethodDef,ne.MemberRef],MemberForwarded:[ne.Field,ne.MethodDef],Implementation:[ne.File,ne.AssemblyRef,ne.ExportedType],CustomAttributeType:[null,null,ne.MethodDef,ne.MemberRef,null],ResolutionScope:[ne.Module,ne.ModuleRef,ne.AssemblyRef,ne.TypeRef],TypeOrMethodDef:[ne.TypeDef,ne.MethodDef]},hNe={0:[zt,Kt,PM,PM,PM],1:[vn("ResolutionScope"),Kt,Kt],2:[Dt,Kt,Kt,vn("TypeDefOrRef"),Ot(ne.Field),Ot(ne.MethodDef)],3:[Ot(ne.Field)],4:[zt,Kt,gr],5:[Ot(ne.MethodDef)],6:[Dt,zt,zt,Kt,gr,Ot(ne.Param)],7:[Ot(ne.Param)],8:[zt,zt,Kt],9:[Ot(ne.TypeDef),vn("TypeDefOrRef")],10:[vn("MemberRefParent"),Kt,gr],11:[zt,vn("HasConstant"),gr],12:[vn("HasCustomAttribute"),vn("CustomAttributeType"),gr],13:[vn("HasFieldMarshal"),gr],14:[zt,vn("HasDeclSecurity"),gr],15:[zt,Dt,Ot(ne.TypeDef)],16:[Dt,Ot(ne.Field)],17:[gr],18:[Ot(ne.TypeDef),Ot(ne.Event)],19:[Ot(ne.Event)],20:[zt,Kt,vn("TypeDefOrRef")],21:[Ot(ne.TypeDef),Ot(ne.Property)],22:[Ot(ne.Property)],23:[zt,Kt,gr],24:[zt,Ot(ne.MethodDef),vn("HasSemantics")],25:[Ot(ne.TypeDef),vn("MethodDefOrRef"),vn("MethodDefOrRef")],26:[Kt],27:[gr],28:[zt,vn("MemberForwarded"),Kt,Ot(ne.ModuleRef)],29:[Dt,Ot(ne.Field)],30:[Dt,Dt],31:[Dt],32:[Dt,zt,zt,zt,zt,Dt,gr,Kt,Kt],33:[Dt],34:[Dt,Dt,Dt],35:[zt,zt,zt,zt,Dt,gr,Kt,Kt,gr],36:[Dt,Ot(ne.AssemblyRef)],37:[Dt,Dt,Dt,Ot(ne.AssemblyRef)],38:[Dt,Kt,gr],39:[Dt,Dt,Kt,Kt,vn("Implementation")],40:[Dt,Dt,Kt,vn("Implementation")],41:[Ot(ne.TypeDef),Ot(ne.TypeDef)],42:[zt,zt,vn("TypeOrMethodDef"),Kt],43:[vn("MethodDefOrRef"),gr],44:[Ot(ne.GenericParam),vn("TypeDefOrRef")]},CM=class{constructor(t,n,r){this.strings=t;this.blobs=n;let i=r.readUInt8(6),o=r.readBigUInt64LE(8),s=new Map,a=24;for(let u=0;u<64;u++)o>>BigInt(u)&1n&&(s.set(u,r.readUInt32LE(a)),a+=4);let c={string:i&1?4:2,guid:i&2?4:2,blob:i&4?4:2},l=u=>{switch(u.type){case"u16":return 2;case"u32":return 4;case"string":return c.string;case"guid":return c.guid;case"blob":return c.blob;case"rid":return(s.get(u.table)??0)<65536?2:4;case"coded":{let d=gNe[u.family],p=Math.ceil(Math.log2(d.length));return Math.max(...d.map(m=>m===null?0:s.get(m)??0))<1<<16-p?2:4}}};for(let[u,d]of s){let p=hNe[u];if(!p)break;let f=p.map(l),m=f.reduce((h,v)=>h+v,0),g=[];for(let h=0;hr.length);h++){let v=[],b=a;for(let w of f)v.push(w===2?r.readUInt16LE(b):r.readUInt32LE(b)),b+=w;g.push(v),a+=m}this.rows.set(u,g)}}strings;blobs;rows=new Map;table(t){return this.rows.get(t)??[]}string(t){if(t>=this.strings.length)return"";let n=t;for(;n=this.blobs.length)return Buffer.alloc(0);let{value:n,width:r}=Ro(this.blobs,t);return this.blobs.subarray(t+r,t+r+n)}};yNe=7,bNe=1,vNe=2,wNe=4,kNe=7,_Ne=32,$Ne=7,SNe=4,xNe=6,ENe=5;RNe={1:"void",2:"bool",3:"char",4:"sbyte",5:"byte",6:"short",7:"ushort",8:"int",9:"uint",10:"long",11:"ulong",12:"float",13:"double",14:"string",22:"TypedReference",24:"IntPtr",25:"UIntPtr",28:"object"}});function D(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function y(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}var er=O(()=>{});function Jr(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}var el,Pa=O(()=>{el=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{let t=Object.prototype.toString.call(e);if(t==="[object Error]"||t==="[object DOMException]"){let n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)}});var Y,Mt,Tn,Qi,tl,Bd,nl,rl,il,ol,sl,al,cl,ll,_t=O(()=>{Pa();Y=(()=>{class e extends Error{}return e})(),Mt=class e extends Y{constructor(t,n,r,i,o){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get("request-id"),this.workspaceID=i?.get("anthropic-workspace-id"),this.error=n,this.type=o??null}static makeMessage(t,n,r){let i=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return t&&i?`${t} ${i}`:t?`${t} status code (no body)`:i||"(no status code or body)"}static generate(t,n,r,i){if(!t||!i)return new Qi({message:r,cause:el(n)});let o=n,s=o?.error?.type;return t===400?new nl(t,o,r,i,s):t===401?new rl(t,o,r,i,s):t===403?new il(t,o,r,i,s):t===404?new ol(t,o,r,i,s):t===409?new sl(t,o,r,i,s):t===422?new al(t,o,r,i,s):t===429?new cl(t,o,r,i,s):t>=500?new ll(t,o,r,i,s):new e(t,o,r,i,s)}},Tn=class extends Mt{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},Qi=class extends Mt{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}},tl=class extends Qi{constructor({message:t}={}){super({message:t??"Request timed out."})}},Bd=class extends Y{constructor(t,{cause:n}={}){super(t??"Retryable error."),n!==void 0&&(this.cause=n)}},nl=class extends Mt{},rl=class extends Mt{},il=class extends Mt{},ol=class extends Mt{},sl=class extends Mt{},al=class extends Mt{},cl=class extends Mt{},ll=class extends Mt{}});function qh(e){return typeof e!="object"?{}:e??{}}function UM(e){if(!e)return!0;for(let t in e)return!1;return!0}function sX(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zM(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}var $De,oX,tr,jM,C$,ul,$i=O(()=>{_t();$De=/^[a-z][a-z0-9+.-]*:/i,oX=e=>$De.test(e),tr=e=>(tr=Array.isArray,tr(e)),jM=tr;C$=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new Y(`${e} must be an integer`);if(t<0)throw new Y(`${e} must be a positive integer`);return t},ul=e=>{try{return JSON.parse(e)}catch{return}}});var Xi,Vd=O(()=>{Xi=(e,t)=>new Promise(n=>{if(t?.aborted)return n();let r=()=>{clearTimeout(i),n()},i=setTimeout(()=>{t?.removeEventListener("abort",r),n()},e);t?.addEventListener("abort",r,{once:!0})})});var Si,Wh=O(()=>{Si="0.131.0"});function SDe(){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"}function EDe(){if(typeof navigator>"u"||!navigator)return null;let e=[{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:t,pattern:n}of e){let r=n.exec(navigator.userAgent);if(r){let i=r[1]||0,o=r[2]||0,s=r[3]||0;return{browser:t,version:`${i}.${o}.${s}`}}}return null}var uX,xDe,aX,cX,lX,Hh,N$=O(()=>{Wh();uX=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";xDe=()=>{let e=SDe();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":cX(Deno.build.os),"X-Stainless-Arch":aX(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":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":cX(globalThis.process.platform??"unknown"),"X-Stainless-Arch":aX(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=EDe();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};aX=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",cX=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown"),Hh=()=>lX??(lX=xDe())});function TDe(e,t){return()=>e.removeEventListener("abort",t)}function pX(e,t,n){D$.set(e,TDe(t,n))}function fX(e,t){D$.has(t)&&dX?.register(e,t,t)}function Po(e){let t=D$.get(e);t&&(D$.delete(e),dX?.unregister(e),t())}var D$,dX,O$=O(()=>{D$=new WeakMap,dX=typeof globalThis.FinalizationRegistry=="function"?new globalThis.FinalizationRegistry(e=>Po(e)):null});function mX(){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 GM(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function M$(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return GM({start(){},async pull(n){let{done:r,value:i}=await t.next();r?n.close():n.enqueue(i)},async cancel(){await t.return?.()}})}function Kh(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){let n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function gX(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var qd=O(()=>{});var Jh,hX,BM=O(()=>{Jh=class{},hX=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)})});var VM,qM,WM,yX,HM=O(()=>{VM="RFC3986",qM=e=>String(e),WM={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:qM},yX="RFC1738"});function vX(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function JM(e,t){if(tr(e)){let n=[];for(let r=0;r{HM();$i();L$=(e,t)=>(L$=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),L$(e,t)),Co=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),KM=1024,bX=(e,t,n,r,i)=>{if(e.length===0)return e;let o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="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=KM?o.slice(a,a+KM):o,l=[];for(let u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===yX&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Co[d];continue}if(d<2048){l[l.length]=Co[192|d>>6]+Co[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Co[224|d>>12]+Co[128|d>>6&63]+Co[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Co[240|d>>18]+Co[128|d>>12&63]+Co[128|d>>6&63]+Co[128|d&63]}s+=l.join("")}return s}});function RDe(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"}function SX(e,t,n,r,i,o,s,a,c,l,u,d,p,f,m,g,h,v){let b=e,w=v,k=0,$=!1;for(;(w=w.get(ZM))!==void 0&&!$;){let R=w.get(e);if(k+=1,typeof R<"u"){if(R===k)throw new RangeError("Cyclic object value");$=!0}typeof w.get(ZM)>"u"&&(k=0)}if(typeof l=="function"?b=l(t,b):b instanceof Date?b=p?.(b):n==="comma"&&tr(b)&&(b=JM(b,function(R){return R instanceof Date?p?.(R):R})),b===null){if(o)return c&&!g?c(t,wn.encoder,h,"key",f):t;b=""}if(RDe(b)||vX(b)){if(c){let R=g?t:c(t,wn.encoder,h,"key",f);return[m?.(R)+"="+m?.(c(b,wn.encoder,h,"value",f))]}return[m?.(t)+"="+m?.(String(b))]}let S=[];if(typeof b>"u")return S;let E;if(n==="comma"&&tr(b))g&&c&&(b=JM(b,c)),E=[{value:b.length>0?b.join(",")||null:void 0}];else if(tr(l))E=l;else{let R=Object.keys(b);E=u?R.sort(u):R}let T=a?String(t).replace(/\./g,"%2E"):String(t),A=r&&tr(b)&&b.length===1?T+"[]":T;if(i&&tr(b)&&b.length===0)return A+"[]";for(let R=0;R"u"?e.encodeDotInKeys?!0:wn.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:wn.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:wn.allowEmptyArrays,arrayFormat:o,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:wn.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?wn.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:wn.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:wn.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:wn.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:wn.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:wn.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:wn.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:wn.strictNullHandling}}function xX(e,t={}){let n=e,r=PDe(t),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):tr(r.filter)&&(o=r.filter,i=o);let s=[];if(typeof n!="object"||n===null)return"";let a=_X[r.arrayFormat],c=a==="comma"&&r.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);let l=new WeakMap;for(let p=0;p0?d+u:""}var _X,$X,kX,wn,ZM,EX=O(()=>{wX();HM();$i();_X={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},$X=function(e,t){Array.prototype.push.apply(e,tr(t)?t:[t])},wn={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:bX,encodeValuesOnly:!1,format:VM,formatter:qM,indices:!1,serializeDate(e){return(kX??(kX=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1};ZM={}});function TX(e){return xX(e,{arrayFormat:"brackets"})}var YM=O(()=>{EX()});var No={};kr(No,{child_process:()=>QM,crypto:()=>Ca,fs:()=>ms,os:()=>NDe,path:()=>Ie,stream:()=>F$,util:()=>XM});var QM,Ca,ms,NDe,Ie,F$,XM,Dr=O(()=>{QM=gt(require("node:child_process"),1),Ca=gt(require("node:crypto"),1),ms=gt(require("node:fs"),1),NDe=gt(require("node:os"),1),Ie=gt(require("node:path"),1),F$=gt(require("node:stream"),1),XM=gt(require("node:util"),1)});function U$(e){if(!e)return;let t;try{t=new URL(e)}catch(r){throw new ut(`Invalid token endpoint base URL "${e}": ${r}`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(t.protocol==="http:"&&(n==="localhost"||n==="127.0.0.1"||n==="::1")))throw new ut(`Refusing to send credential over non-https token endpoint "${e}"`)}async function z$(e,t){let n=await ODe(e),r;try{r=JSON.parse(n)}catch{throw new ut(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,Or(n),t)}if(!r.access_token)throw new ut(`Token endpoint response missing access_token: ${JSON.stringify(Or(r))}`,e.status,Or(r),t);if(r.token_type&&r.token_type.toLowerCase()!=="bearer")throw new ut(`Token endpoint response: unsupported token_type "${r.token_type}" (want Bearer)`,e.status,Or(r),t);return r}function Or(e){if(e==null)return e;if(typeof e=="string"){let t;try{t=JSON.parse(e)}catch{return e.length<=eL?e:e.slice(0,eL)+`... <${e.length-eL} more chars>`}return JSON.stringify(Or(t))}if(typeof e=="object"&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))DDe.has(n)&&(t[n]=r);return t}return null}async function G$(e,t=n=>console.warn(`anthropic-sdk: ${n}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:n}=await Promise.resolve().then(()=>(Dr(),No)),r=e,i;try{r=await n.promises.realpath(e),i=await n.promises.stat(r)}catch{return}let o=i.mode&511;if(o&18)throw new ut(`Credentials file at ${r} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${r}\`.`);if(o&36)throw new ut(`Credentials file at ${r} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${r}\` before retrying.`);typeof process.getuid=="function"&&i.uid!==process.getuid()&&t(`credentials file at ${r} is owned by uid ${i.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function B$(e,t){let{fs:n,path:r}=await Promise.resolve().then(()=>(Dr(),No)),i=r.dirname(e);await n.promises.mkdir(i,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await n.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await n.promises.rename(o,e)}catch(s){throw await n.promises.unlink(o).catch(()=>{}),s}try{let s=await n.promises.open(i,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function ODe(e){if(!e.body)return"";let t=e.body.getReader(),n=[],r=0;for(;;){let{done:o,value:s}=await t.read();if(o)break;if(r+s.length>IX){let a=IX-r;a>0&&n.push(s.subarray(0,a)),await t.cancel();break}n.push(s),r+=s.length}let i;if(n.length===1)i=n[0];else{i=new Uint8Array(n.reduce((s,a)=>s+a.length,0));let o=0;for(let s of n)i.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(i)}var AX,RX,j$,dl,PX,CX,Wd,NX,IX,eL,DDe,ut,Hd=O(()=>{_t();AX="urn:ietf:params:oauth:grant-type:jwt-bearer",RX="refresh_token",j$="/v1/oauth/token",dl="oauth-2025-04-20",PX="oidc-federation-2026-04-01",CX=120,Wd=30,NX=5,IX=1<<20;eL=2e3,DDe=new Set(["error","error_description","error_uri"]);ut=class extends Y{constructor(t,n=null,r=null,i=null){super(t),this.statusCode=n,this.body=r,this.requestId=i}}});function eo(){return Math.floor(Date.now()/1e3)}var Zh=O(()=>{});var V$,DX=O(()=>{Hd();Zh();V$=class{constructor(t,n){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=t,this.onAdvisoryRefreshError=n}async getToken(){let t=this.nextForce;this.nextForce=!1;let n=this.cached;if(t||n==null)return(await this.refresh(t)).token;if(n.expiresAt==null)return n.token;let r=n.expiresAt-eo();return r>CX?n.token:r>Wd?(this.backgroundRefresh(),n.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(t=!1){return this.pendingRefresh&&!t?this.pendingRefresh:this.doRefresh(t)}backgroundRefresh(){this.pendingRefresh||eo()-this.lastAdvisoryError{this.lastAdvisoryError=eo(),this.onAdvisoryRefreshError?.(t)})}doRefresh(t=!1){return this.pendingRefresh=this.provider(t?{forceRefresh:!0}:void 0).then(n=>(this.cached=n,this.pendingRefresh=null,n),n=>{throw this.pendingRefresh=null,n}),this.pendingRefresh}}});var Ge,Kd=O(()=>{Ge=e=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0}});function LX(e){let t=0;for(let i of e)t+=i.length;let n=new Uint8Array(t),r=0;for(let i of e)n.set(i,r),r+=i.length;return n}function Jd(e){let t;return(OX??(t=new globalThis.TextEncoder,OX=t.encode.bind(t)))(e)}function pl(e){let t;return(MX??(t=new globalThis.TextDecoder,MX=t.decode.bind(t)))(e)}var OX,MX,Zd=O(()=>{});var FX,tL=O(()=>{_t();FX=e=>{if(typeof globalThis.Buffer<"u"){let t=globalThis.Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(typeof atob<"u"){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;rW$[n]?Yd:t[e].bind(t)}function rL(e,t){let n=jX.get(e);if(n&&n[0]===t)return n[1];let r={error:q$("error",e,t),warn:q$("warn",e,t),info:q$("info",e,t),debug:q$("debug",e,t)};return jX.set(e,[t,r]),r}function ze(e){let t=e.logger,n=e.logLevel??"off";return t?rL(t,n):MDe}function zX(){let e=Ge("ANTHROPIC_LOG");return(!nL||e!==UX)&&(UX=e,nL=rL(console,H$(e,"process.env['ANTHROPIC_LOG']",rL(console,Yh))??Yh)),nL}function Do(e,t,n){e.debug!==Yd&&e.debug(t,LDe(n))}var Yh,W$,H$,MDe,jX,UX,nL,LDe,xi=O(()=>{$i();Kd();Yh="warn",W$={off:0,error:200,warn:300,info:400,debug:500},H$=(e,t,n)=>{if(e){if(sX(W$,e))return e;n.warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(W$))}`)}};MDe={error:Yd,warn:Yd,info:Yd,debug:Yd},jX=new WeakMap;LDe=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="api-key"||t.toLowerCase()==="x-api-key"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e)});var K$,iL=O(()=>{K$=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return K$=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))}});var GX=O(()=>{$i();tL();Kd();xi();iL();Vd();YM()});function BX(e){if(!e)throw new Error("profile name is empty");if(e==="."||e==="..")throw new Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw new Error(`profile name "${e}" must not contain path separators`);if(!FDe.test(e))throw new Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var J$,FDe,VX,qX,oL,jDe,WX,sL=O(()=>{N$();GX();J$="1.0",FDe=/^[A-Za-z0-9_.-]+$/;VX=async e=>{var t,n;let r=await oL();if(r===null)return null;let i=e??await WX();if(i===null)return null;BX(i);let{fs:o,path:s}=await Promise.resolve().then(()=>(Dr(),No)),a=s.join(r,"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=Ge("ANTHROPIC_ORGANIZATION_ID"),p=Ge("ANTHROPIC_IDENTITY_TOKEN_FILE"),f=Ge("ANTHROPIC_FEDERATION_RULE_ID");return f&&d?{fromFile:!1,config:{organization_id:d,workspace_id:Ge("ANTHROPIC_WORKSPACE_ID"),base_url:Ge("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:f,service_account_id:Ge("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:p?{source:"file",path:p}:void 0,scope:Ge("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=Ge("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=Ge("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=Ge("ANTHROPIC_BASE_URL")),(t=l.authentication).scope??(t.scope=Ge("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=Ge("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(l.authentication.identity_token={source:"file",path:d})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=Ge("ANTHROPIC_FEDERATION_RULE_ID")??""),(n=l.authentication).service_account_id??(n.service_account_id=Ge("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}},qX=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let n=await oL();if(!n)return null;let r=t??await WX();if(!r)return null;BX(r);let{path:i}=await Promise.resolve().then(()=>(Dr(),No));return i.join(n,"credentials",`${r}.json`)},oL=async()=>{if(!jDe())return null;let{path:e}=await Promise.resolve().then(()=>(Dr(),No)),t=Ge("ANTHROPIC_CONFIG_DIR");if(t)return t;if(Hh()["X-Stainless-OS"]==="Windows"){let o=Ge("APPDATA");if(o)return e.join(o,"Anthropic");let s=Ge("USERPROFILE");return s?e.join(s,"AppData","Roaming","Anthropic"):null}let r=Ge("XDG_CONFIG_HOME");if(r)return e.join(r,"anthropic");let i=Ge("HOME");return i?e.join(i,".config","anthropic"):null},jDe=()=>{let e=Hh()["X-Stainless-Runtime"];return e==="node"||e==="deno"},WX=async()=>{let e=await oL();if(!e)return null;let t=Ge("ANTHROPIC_PROFILE");if(t)return t;let{fs:n,path:r}=await Promise.resolve().then(()=>(Dr(),No)),i=r.join(e,"active_config");try{return(await n.promises.readFile(i,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read ${i}: ${o}`);return"default"}}});function aL(e){if(!e)throw new Y("Identity token file path is empty");return async()=>{let{fs:t}=await Promise.resolve().then(()=>(Dr(),No)),n;try{n=await t.promises.readFile(e,"utf-8")}catch(i){throw new Y(`Failed to read identity token file at ${e}: ${i}`)}let r=n.trim();if(!r)throw new Y(`Identity token file at ${e} is empty`);return r}}function HX(e){if(!e)throw new Y("Identity token value is empty");return()=>e}var KX=O(()=>{_t()});function JX(e){return async()=>{U$(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16*1024)throw new ut(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let n={grant_type:AX,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};e.serviceAccountId&&(n.service_account_id=e.serviceAccountId),e.workspaceId&&(n.workspace_id=e.workspaceId);let r=`${e.baseURL}${j$}`,i;try{i=await e.fetch(r,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${dl},${PX}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Si} oidcFederationProvider`},body:JSON.stringify(n)})}catch(c){throw new ut(`Failed to reach token endpoint ${r}: ${c}`)}let o=i.headers.get("Request-Id");if(!i.ok){let c=await i.text().catch(()=>""),l=Or(c),u="";throw i.status===401&&(u=` Ensure your federation rule matches your identity token. ${e.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 ut(`Token exchange failed with status ${i.status}${o?` (request-id ${o})`:""}: ${l}${u}`,i.status,l,o)}let s=await z$(i,o),a=Number(s.expires_in);if(!Number.isFinite(a))throw new ut(`Token endpoint response missing required fields: ${JSON.stringify(Or(s))}`,i.status,Or(s),o);return{token:s.access_token,expiresAt:eo()+a}}}var ZX=O(()=>{Hd();Zh();Wh()});function YX(e){return async t=>{let{fs:n}=await Promise.resolve().then(()=>(Dr(),No));await G$(e.credentialsPath,e.onSafetyWarning);let r;try{r=await n.promises.readFile(e.credentialsPath,"utf-8")}catch(h){throw new ut(`Credentials file not found at ${e.credentialsPath}: ${h}`)}let i;try{i=JSON.parse(r)}catch(h){throw new ut(`Credentials file at ${e.credentialsPath} is not valid JSON: ${h}`)}let o=i.access_token;if(!o)throw new ut(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=i.expires_at;if(!t?.forceRefresh&&(s==null||eo()"");throw new ut(`User OAuth refresh failed (HTTP ${u.status}): ${Or(h)}`,u.status,Or(h),d)}let p=await z$(u,d),f=Number(p.expires_in);if(!Number.isFinite(f))throw new ut(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Or(p))}`,u.status,Or(p),d);let m=eo()+f,g=p.refresh_token||a;return await B$(e.credentialsPath,{...i,version:J$,type:"oauth_token",access_token:p.access_token,expires_at:m,refresh_token:g}),{token:p.access_token,expiresAt:m}}}var QX=O(()=>{sL();Hd();Zh();Wh()});function cL(e,t){let n=e.authentication.credentials_path??null,r=(e.base_url||t.baseURL).replace(/\/+$/,""),i=UDe(e,n,r,t),o={};return e.workspace_id&&e.authentication.type==="user_oauth"&&(o["anthropic-workspace-id"]=e.workspace_id),{provider:i,extraHeaders:o,baseURL:e.base_url||void 0}}async function XX(e,t){let n=await VX(t);if(!n)return null;let{config:r,fromFile:i}=n,o=r.authentication.credentials_path||!i?r:{...r,authentication:{...r.authentication,credentials_path:await qX(r,t)??void 0}};return cL(o,e)}function UDe(e,t,n,r){switch(e.authentication.type){case"oidc_federation":{let i=e.authentication,o=zDe(i);if(!o)throw new ut("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!i.federation_rule_id)throw new ut("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new ut("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=JX({identityTokenProvider:o,federationRuleId:i.federation_rule_id,organizationId:e.organization_id,serviceAccountId:i.service_account_id,workspaceId:e.workspace_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent});return t?GDe(s,t,r.onCacheWriteError,r.onSafetyWarning):s}case"user_oauth":{if(!t)throw new ut("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return YX({credentialsPath:t,clientId:e.authentication.client_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent,onSafetyWarning:r.onSafetyWarning})}default:{let i=e.authentication.type;throw new ut(`authentication.type "${i}" is not a known authentication type`)}}}function zDe(e){if(e.identity_token){let r=e.identity_token.source;if(r!=="file")throw new ut(`identity_token.source "${r}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new ut('identity_token.source "file" requires a non-empty path');return aL(e.identity_token.path)}let t=Ge("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return aL(t);let n=Ge("ANTHROPIC_IDENTITY_TOKEN");return n?HX(n):null}function GDe(e,t,n,r){return async i=>{let{fs:o}=await Promise.resolve().then(()=>(Dr(),No));await G$(t,r);let s;try{let c=await o.promises.readFile(t,"utf-8");s=JSON.parse(c);let l=s?.access_token;if(l&&!i?.forceRefresh){let u=s?.expires_at;if(u==null||eo(){Kd();sL();Hd();Zh();KX();ZX();QX()});function BDe(e,t){for(let i=t??0;i{er();Zd();Qh=(()=>{class e{constructor(){Zr.set(this,void 0),Yr.set(this,void 0),D(this,Zr,new Uint8Array,"f"),D(this,Yr,null,"f")}decode(n){if(n==null)return[];let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Jd(n):n;D(this,Zr,LX([y(this,Zr,"f"),r]),"f");let i=[],o;for(;(o=BDe(y(this,Zr,"f"),y(this,Yr,"f")))!=null;){if(o.carriage&&y(this,Yr,"f")==null){D(this,Yr,o.index,"f");continue}if(y(this,Yr,"f")!=null&&(o.index!==y(this,Yr,"f")+1||o.carriage)){i.push(pl(y(this,Zr,"f").subarray(0,y(this,Yr,"f")-1))),D(this,Zr,y(this,Zr,"f").subarray(y(this,Yr,"f")),"f"),D(this,Yr,null,"f");continue}let s=y(this,Yr,"f")!==null?o.preceding-1:o.preceding,a=pl(y(this,Zr,"f").subarray(0,s));i.push(a),D(this,Zr,y(this,Zr,"f").subarray(o.index),"f"),D(this,Yr,null,"f")}return i}flush(){return y(this,Zr,"f").length?this.decode(` +`):[]}}return Zr=new WeakMap,Yr=new WeakMap,e.NEWLINE_CHARS=new Set([` +`,"\r"]),e.NEWLINE_REGEXP=/\r\n|[\n\r]/g,e})()});async function*t7(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Y("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 Y("Attempted to iterate over a response with no body");let n=new uL,r=new Qh,i=Kh(e.body);for await(let o of i)for(let s of r.decode(o)){let a=n.decode(s);a&&(yield a)}for(let o of r.flush()){let s=n.decode(o);s&&(yield s)}}function VDe(e,t){let n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}var Xh,Ei,uL,ey=O(()=>{er();_t();qd();lL();qd();Pa();$i();Zd();xi();_t();O$();Ei=(()=>{class e{constructor(n,r,i){this.iterator=n,Xh.set(this,void 0),this.controller=r,D(this,Xh,i,"f")}static rawEvents(n,r=new AbortController){return t7(n,r)}static fromSSEResponse(n,r,i){let o=!1,s=i?ze(i):console;async function*a(){if(o)throw new Y("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let c=!1;try{for await(let l of t7(n,r)){if(l.event==="completion")try{yield JSON.parse(l.data)}catch(u){throw s.error("Could not parse message into JSON:",l.data),s.error("From chunk:",l.raw),u}if(l.event==="message_start"||l.event==="message_delta"||l.event==="message_stop"||l.event==="content_block_start"||l.event==="content_block_delta"||l.event==="content_block_stop"||l.event==="message"||l.event==="user.message"||l.event==="user.interrupt"||l.event==="user.tool_confirmation"||l.event==="user.custom_tool_result"||l.event==="user.tool_result"||l.event==="agent.message"||l.event==="agent.thinking"||l.event==="agent.tool_use"||l.event==="agent.tool_result"||l.event==="agent.mcp_tool_use"||l.event==="agent.mcp_tool_result"||l.event==="agent.custom_tool_use"||l.event==="agent.thread_context_compacted"||l.event==="session.status_running"||l.event==="session.status_idle"||l.event==="session.status_rescheduled"||l.event==="session.status_terminated"||l.event==="session.error"||l.event==="session.deleted"||l.event==="session.updated"||l.event==="span.model_request_start"||l.event==="span.model_request_end"||l.event==="span.outcome_evaluation_start"||l.event==="span.outcome_evaluation_ongoing"||l.event==="span.outcome_evaluation_end"||l.event==="user.define_outcome"||l.event==="agent.thread_message_received"||l.event==="agent.thread_message_sent"||l.event==="agent.session_thread_message_received"||l.event==="agent.session_thread_message_sent"||l.event==="session.thread_created"||l.event==="session.thread_status_created"||l.event==="session.thread_status_running"||l.event==="session.thread_status_idle"||l.event==="session.thread_status_rescheduled"||l.event==="session.thread_status_terminated"||l.event==="event_start"||l.event==="event_delta"||l.event==="system.message")try{yield JSON.parse(l.data)}catch(u){throw s.error("Could not parse message into JSON:",l.data),s.error("From chunk:",l.raw),u}if(l.event!=="ping"&&l.event==="error"){let u=ul(l.data)??l.data,d=u?.error?.type;throw new Mt(void 0,u,void 0,n.headers,d)}}c=!0}catch(l){if(Jr(l))return;throw l}finally{c||r.abort(),Po(r)}}return new e(a,r,i)}static fromReadableStream(n,r,i){let o=!1;async function*s(){let c=new Qh,l=Kh(n);for await(let u of l)for(let d of c.decode(u))yield d;for(let u of c.flush())yield u}async function*a(){if(o)throw new Y("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let c=!1;try{for await(let l of s())c||l&&(yield JSON.parse(l));c=!0}catch(l){if(Jr(l))return;throw l}finally{c||r.abort(),Po(r)}}return new e(a,r,i)}[(Xh=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let n=[],r=[],i=this.iterator(),o=s=>({next:()=>{if(s.length===0){let a=i.next();n.push(a),r.push(a)}return s.shift()}});return[new e(()=>o(n),this.controller,y(this,Xh,"f")),new e(()=>o(r),this.controller,y(this,Xh,"f"))]}toReadableStream(){let n=this,r;return GM({async start(){r=n[Symbol.asyncIterator]()},async pull(i){try{let{value:o,done:s}=await r.next();if(s)return i.close();let a=Jd(JSON.stringify(o)+` +`);i.enqueue(a)}catch(o){i.error(o)}},async cancel(){await r.return?.()}})}}return e})();uL=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,r,i]=VDe(t,":");return i.startsWith(" ")&&(i=i.substring(1)),n==="event"?this.event=i:n==="data"&&this.data.push(i),null}}});async function Z$(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:i,startTime:o}=t,s=await(async()=>{if(t.options.stream)return ze(e).debug("response",n.status,n.url,n.headers,n.body),Ei.fromSSEResponse(n,t.controller,e);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let p=await n.json();return ty(p,n)}return await n.text()})().finally(()=>{!t.options.stream&&!t.options.__binaryResponse&&Po(t.controller)});return Do(ze(e),`[${r}] response parsed`,{retryOfRequestLogID:i,url:n.url,status:n.status,body:s,durationMs:Date.now()-o}),s}function ty(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperties(e,{_request_id:{value:t.headers.get("request-id"),enumerable:!1},_workspace_id:{value:t.headers.get("anthropic-workspace-id"),enumerable:!1}})}var Y$=O(()=>{ey();xi();O$()});function dL(e){return typeof e=="object"&&e!==null&&r7.has(e)}function i7(e){let t=new Set;for(;typeof e=="object"&&e!==null&&!t.has(e);){if(t.add(e),dL(e)||Jr(e)||e instanceof Qi||e instanceof Bd)return!0;e=e.cause}return!1}function pL(e,t,n,r){return async(i,o={})=>{if(t.length===0)return e.call(void 0,i,o);let s=o.headers instanceof Headers?o.headers:new Headers(o.headers),a=await WDe(e,t,n,r)({...o,headers:s,url:typeof i=="string"?i:i instanceof URL?i.href:i.url});if(a.bodyUsed||a.body?.locked)throw new Y("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return a}}function qDe(e,t){let n=new WeakMap;return{options:e,logger:t?ze(t):zX(),parse(r){if(e?.stream&&r.ok)return n7(r,e,t);let i=n.get(r);return i||(i=n7(r,e,t),n.set(r,i)),i}}}async function n7(e,t,n){if(e.bodyUsed||e.body?.locked)throw new Y("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(t?.stream&&e.ok)return Ei.fromSSEResponse(e.clone(),new AbortController,n);if(e.status===204)return null;if(t?.__binaryResponse)return e;let i=e.headers.get("content-type")?.split(";")[0]?.trim();return i?.includes("application/json")||i?.endsWith("+json")?e.headers.get("content-length")==="0"?void 0:ty(await e.clone().json(),e):await e.clone().text()}function WDe(e,t,n,r){let i=async({url:s,...a})=>{try{return await e.call(void 0,s,a)}catch(c){let l=el(c);throw r7.add(l),l}},o=qDe(n,r);for(let s=t.length-1;s>=0;s--){let a=t[s],c=i;i=async l=>a(l,c,o)}return i}var r7,o7=O(()=>{Pa();Y$();xi();_t();ey();r7=new WeakSet});var ny,Qd,Q$=O(()=>{er();Y$();Qd=(()=>{class e extends Promise{constructor(n,r,i=Z$){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=i,ny.set(this,void 0),D(this,ny,n,"f")}_thenUnwrap(n){return new e(y(this,ny,"f"),this.responsePromise,async(r,i)=>ty(n(await this.parseResponse(r,i),i),i.response))}asResponse(){return this.responsePromise.then(n=>n.response)}async withResponse(){let[n,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:n,response:r,request_id:r.headers.get("request-id"),workspace_id:r.headers.get("anthropic-workspace-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(n=>this.parseResponse(y(this,ny,"f"),n))),this.parsedPromise}then(n,r){return this.parse().then(n,r)}catch(n){return this.parse().catch(n)}finally(n){return this.parse().finally(n)}}return ny=new WeakMap,e})()});var X$,fL,tS,dt,G,eS,ie=O(()=>{er();_t();Y$();Q$();$i();fL=(()=>{class e{constructor(n,r,i,o){X$.set(this,void 0),D(this,X$,n,"f"),this.options=o,this.response=r,this.body=i}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let n=this.nextPageRequestOptions();if(!n)throw new Y("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await y(this,X$,"f").requestAPIList(this.constructor,n)}async*iterPages(){let n=this;for(yield n;n.hasNextPage();)n=await n.getNextPage(),yield n}async*[(X$=new WeakMap,Symbol.asyncIterator)](){for await(let n of this.iterPages())for(let r of n.getPaginatedItems())yield r}}return e})(),tS=(()=>{class e extends Qd{constructor(n,r,i){super(n,r,async(o,s)=>new i(o,s.response,await Z$(o,s),s.options))}async*[Symbol.asyncIterator](){let n=await this;for await(let r of n)yield r}}return e})(),dt=class extends fL{constructor(t,n,r,i){super(t,n,r,i),this.data=r.data||[],this.has_more=r.has_more||!1,this.first_id=r.first_id||null,this.last_id=r.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let n=this.first_id;return n?{...this.options,query:{...qh(this.options.query),before_id:n}}:null}let t=this.last_id;return t?{...this.options,query:{...qh(this.options.query),after_id:t}}:null}},G=class extends fL{constructor(t,n,r,i){super(t,n,r,i),this.data=r.data||[],this.next_page=r.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.nextPageRequestOptions()!=null}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...qh(this.options.query),page:t}}:null}},eS=class extends fL{constructor(t,n,r,i){super(t,n,r,i),this.data=r.data||[],this.next_page=r.next_page||null,this.prev_page=r.prev_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.nextPageRequestOptions()!=null}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...qh(this.options.query),page:t}}:null}}});function fl(e,t,n){return gL(),new File(e,t??"",n)}function ry(e,t){let n=typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"";return t?n.split(/[\\/]/).pop()||void 0:n}function KDe(e){let t=typeof e=="function"?e:e.fetch,n=s7.get(t);if(n)return n;let r=(async()=>{try{let i="Response"in t?t.Response:(await t("data:,")).constructor,o=new FormData;return o.toString()!==await new i(o).text()}catch{return!0}})();return s7.set(t,r),r}var gL,hL,In,s7,JDe,mL,Ti=O(()=>{qd();gL=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};hL=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",In=async(e,t,n=!0)=>({...e,body:await JDe(e.body,t,n)}),s7=new WeakMap;JDe=async(e,t,n=!0)=>{if(!await KDe(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let r=new FormData;return await Promise.all(Object.entries(e||{}).map(([i,o])=>mL(r,i,o,n))),r},mL=async(e,t,n,r)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response){let i={},o=n.headers.get("Content-Type");o&&(i={type:o}),e.append(t,fl([await n.blob()],ry(n,r),i))}else if(hL(n))e.append(t,fl([await new Response(M$(n)).blob()],ry(n,r)));else if(n instanceof Blob){let o=typeof File<"u"&&n instanceof File?n.name:ry(n,r);e.append(t,fl([n],o,{type:n.type}))}else if(Array.isArray(n))await Promise.all(n.map(i=>mL(e,t+"[]",i,r)));else{if(typeof n.then=="function")throw new TypeError(`Received a Promise for "${t}"; await it first, e.g. \`await toFile(...)\``);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))throw new TypeError(`Received ${n.constructor.name} for "${t}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);if(typeof n=="object")await Promise.all(Object.entries(n).map(([i,o])=>mL(e,`${t}[${i}]`,o,r)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}}});async function iy(e,t,n){if(gL(),e=await e,t||(t=e instanceof File?e.name:ry(e,!0)),ZDe(e))return e instanceof File&&t==null&&n==null?e:fl([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(YDe(e)){let i=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),fl(await yL(i),t,n)}let r=await yL(e);if(!n?.type){let i=r.find(o=>typeof o=="object"&&"type"in o&&o.type);typeof i=="string"&&(n={...n,type:i})}return fl(r,t,n)}async function yL(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(a7(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(hL(e))for await(let n of e)t.push(...await yL(n));else{let n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${QDe(e)}`)}return t}function QDe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}var a7,ZDe,YDe,c7=O(()=>{Ti();Ti();a7=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",ZDe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&a7(e),YDe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function"});var bL=O(()=>{c7()});var l7=O(()=>{});var P,X=O(()=>{P=class{constructor(t){this._client=t}}});function*eOe(e){if(!e)return;if(u7 in e){let{values:r,nulls:i}=e;yield*r.entries();for(let o of i)yield[o,null];return}let t=!1,n;e instanceof Headers?n=e.entries():jM(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let r of n){let i=r[0];if(typeof i!="string")throw new TypeError("expected header name to be a string");let o=jM(r[1])?r[1]:[r[1]],s=!1;for(let a of o)a!==void 0&&(t&&!s&&(s=!0,yield[i,nS]),yield[i,a])}}var u7,nS,tOe,vL,I,Ee=O(()=>{$i();u7=Symbol.for("brand.privateNullableHeaders");nS=Symbol("clear"),tOe=new Set(["x-stainless-helper"]),vL=(e,t)=>{let n=e?e.split(",").map(r=>r.trim()).filter(Boolean):[];for(let r of t.split(",").map(i=>i.trim()))r&&!n.includes(r)&&n.push(r);return n.join(", ")},I=e=>{let t=new Headers,n=new Set;for(let r of e){let i=new Set;for(let[o,s]of eOe(r)){let a=o.toLowerCase();if(tOe.has(a)){if(s===nS)continue;s===null?(t.delete(o),n.add(a)):(t.set(o,vL(t.get(o),s)),n.delete(a));continue}(s===nS||!i.has(a))&&(t.delete(o),i.add(a),s===nS)||(s===null?(t.delete(o),n.add(a)):(t.append(o,s),n.delete(a)))}}return{[u7]:!0,values:t,nulls:n}}});function p7(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var d7,nOe,x,me=O(()=>{_t();d7=Object.freeze(Object.create(null)),nOe=(e=p7)=>function(n,...r){if(n.length===1)return n[0];let i=!1,o=[],s=n.reduce((u,d,p)=>{/[?#]/.test(d)&&(i=!0);let f=r[p],m=(i?encodeURIComponent:e)(""+f);return p!==r.length&&(f==null||typeof f=="object"&&f.toString===Object.getPrototypeOf(Object.getPrototypeOf(f.hasOwnProperty??d7)??d7)?.toString)&&(m=f+"",o.push({start:u.length+d.length,length:m.length,error:`Value of type ${Object.prototype.toString.call(f).slice(8,-1)} is not a valid path parameter`})),u+d+(p===r.length?"":m)},""),a=s.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;for(;(l=c.exec(a))!==null;)o.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(o.sort((u,d)=>u.start-d.start),o.length>0){let u=0,d=o.reduce((p,f)=>{let m=" ".repeat(f.start-u),g="^".repeat(f.length);return u=f.start+f.length,p+m+g},"");throw new Y(`Path parameters result in path with invalid segments: ${o.map(p=>p.error).join(` `)} ${s} -${d}`)}return s},N=JCe(wQ)});var mp,_M=j(()=>{Se();De();Ne();Me();mp=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/deployment_runs/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var gp,SM=j(()=>{Se();De();Ne();Me();gp=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/deployments?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/deployments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/deployments/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/deployments?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}pause(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/pause?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}run(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/run?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}unpause(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/unpause?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var hp,xM=j(()=>{Se();De();Ne();Me();hp=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/dreams?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/dreams/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/dreams?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/dreams/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}cancel(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/dreams/${t}/cancel?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});function Bh(e){return{[Mo]:e}}function O_(e){return typeof e=="object"&&e!==null&&Vh in e}function EM(e,t){let n=new Set;if(e)for(let i of e)O_(i)&&n.add(i[Vh]);if(t)for(let i of t){O_(i)&&n.add(i[Vh]);let r=i.content;if(Array.isArray(r))for(let o of r)O_(o)&&n.add(o[Vh])}return Array.from(n)}function L_(e,t){let n=EM(e,t);return n.length===0?{}:{[Mo]:n.join(", ")}}function F_(e){return O_(e)?{[Mo]:e[Vh]}:{}}var Mo,M_,Vh,eo=j(()=>{Mo="x-stainless-helper",M_="x-stainless-helper-method";Vh=Symbol("anthropic.sdk.stainlessHelper")});var yp,TM=j(()=>{Se();De();Ne();eo();gs();Me();yp=class extends Z{list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/files?beta=true",le,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/files/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}download(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/files/${t}/content?beta=true`,{...i,headers:I([{Accept:"application/binary",...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/files/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}upload(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/files?beta=true",xi({body:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},F_(o.file),n?.headers])},this._client))}}});var bp,IM=j(()=>{Se();De();Ne();Me();bp=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/models/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/models?beta=true",pn,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var vp,AM=j(()=>{Se();De();Ne();Me();vp=class extends Z{create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/user_profiles?beta=true",{body:r,...n,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/user_profiles/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/user_profiles/${t}?beta=true`,{body:o,...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/user_profiles?beta=true",le,{query:r,...n,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}createEnrollmentURL(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/user_profiles/${t}/enrollment_url?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}}});var _Q=q(ei=>{"use strict";var nPe=ei&&ei.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})();Object.defineProperty(ei,"__esModule",{value:!0});var fn=256,RM=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var n="",i=0;i>>18&63),n+=this._encodeByte(r>>>12&63),n+=this._encodeByte(r>>>6&63),n+=this._encodeByte(r>>>0&63)}var o=t.length-i;if(o>0){var r=t[i]<<16|(o===2?t[i+1]<<8:0);n+=this._encodeByte(r>>>18&63),n+=this._encodeByte(r>>>12&63),o===2?n+=this._encodeByte(r>>>6&63):n+=this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var n=this._getPaddingLength(t),i=t.length-n,r=new Uint8Array(this.maxDecodedLength(i)),o=0,s=0,a=0,c=0,l=0,u=0,d=0;s>>4,r[o++]=l<<4|u>>>2,r[o++]=u<<6|d,a|=c&fn,a|=l&fn,a|=u&fn,a|=d&fn;if(s>>4,a|=c&fn,a|=l&fn),s>>2,a|=u&fn),s>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=fn;return n+=(42-t&t-44)>>>8&-fn+t-43+62,n+=(46-t&t-48)>>>8&-fn+t-47+63,n+=(47-t&t-58)>>>8&-fn+t-48+52,n+=(64-t&t-91)>>>8&-fn+t-65+0,n+=(96-t&t-123)>>>8&-fn+t-97+26,n},e.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var i=t.length-1;i>=0&&t[i]===this._paddingCharacter;i--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},e})();ei.Coder=RM;var qh=new RM;function rPe(e){return qh.encode(e)}ei.encode=rPe;function iPe(e){return qh.decode(e)}ei.decode=iPe;var kQ=(function(e){nPe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(n){var i=n;return i+=65,i+=25-n>>>8&6,i+=51-n>>>8&-75,i+=61-n>>>8&-13,i+=62-n>>>8&49,String.fromCharCode(i)},t.prototype._decodeChar=function(n){var i=fn;return i+=(44-n&n-46)>>>8&-fn+n-45+62,i+=(94-n&n-96)>>>8&-fn+n-95+63,i+=(47-n&n-58)>>>8&-fn+n-48+52,i+=(64-n&n-91)>>>8&-fn+n-65+0,i+=(96-n&n-123)>>>8&-fn+n-97+26,i},t})(RM);ei.URLSafeCoder=kQ;var $Q=new kQ;function oPe(e){return $Q.encode(e)}ei.encodeURLSafe=oPe;function sPe(e){return $Q.decode(e)}ei.decodeURLSafe=sPe;ei.encodedLength=function(e){return qh.encodedLength(e)};ei.maxDecodedLength=function(e){return qh.maxDecodedLength(e)};ei.decodedLength=function(e){return qh.decodedLength(e)}});var xQ=q((SQ,U_)=>{(function(e,t){var n={};t(n);var i=n.default;for(var r in n)i[r]=n[r];typeof U_=="object"&&typeof U_.exports=="object"?U_.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(SQ,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=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 n(d,p,f,m,g){for(var h,b,y,w,k,_,S,x,E,T,A,L,F;g>=64;){for(h=p[0],b=p[1],y=p[2],w=p[3],k=p[4],_=p[5],S=p[6],x=p[7],T=0;T<16;T++)A=m+T*4,d[T]=(f[A]&255)<<24|(f[A+1]&255)<<16|(f[A+2]&255)<<8|f[A+3]&255;for(T=16;T<64;T++)E=d[T-2],L=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,E=d[T-15],F=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,d[T]=(L+d[T-7]|0)+(F+d[T-16]|0);for(T=0;T<64;T++)L=(((k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7))+(k&_^~k&S)|0)+(x+(t[T]+d[T]|0)|0)|0,F=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&b^h&y^b&y)|0,x=S,S=_,_=k,k=w+L|0,w=y,y=b,b=h,h=L+F|0;p[0]+=h,p[1]+=b,p[2]+=y,p[3]+=w,p[4]+=k,p[5]+=_,p[6]+=S,p[7]+=x,m+=64,g-=64}return m}var i=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.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 p=0;p0){for(;this.bufferLength<64&&f>0;)this.buffer[this.bufferLength++]=p[m++],f--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(f>=64&&(m=n(this.temp,this.state,p,m,f),f%=64);f>0;)this.buffer[this.bufferLength++]=p[m++],f--;return this},d.prototype.finish=function(p){if(!this.finished){var f=this.bytesHashed,m=this.bufferLength,g=f/536870912|0,h=f<<3,b=f%64<56?64:128;this.buffer[m]=128;for(var y=m+1;y>>24&255,this.buffer[b-7]=g>>>16&255,this.buffer[b-6]=g>>>8&255,this.buffer[b-5]=g>>>0&255,this.buffer[b-4]=h>>>24&255,this.buffer[b-3]=h>>>16&255,this.buffer[b-2]=h>>>8&255,this.buffer[b-1]=h>>>0&255,n(this.temp,this.state,this.buffer,0,b),this.finished=!0}for(var y=0;y<8;y++)p[y*4+0]=this.state[y]>>>24&255,p[y*4+1]=this.state[y]>>>16&255,p[y*4+2]=this.state[y]>>>8&255,p[y*4+3]=this.state[y]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var f=0;fthis.blockSize)new i().update(p).finish(f).clean();else for(var m=0;m1&&p.update(d),f&&p.update(f),p.update(m),p.finish(d),m[0]++}var c=new Uint8Array(e.digestLength);function l(d,p,f,m){p===void 0&&(p=c),m===void 0&&(m=32);for(var g=new Uint8Array([1]),h=s(p,d),b=new r(h),y=new Uint8Array(b.digestLength),w=y.length,k=new Uint8Array(m),_=0;_>>24&255,b[1]=S>>>16&255,b[2]=S>>>8&255,b[3]=S>>>0&255,g.reset(),g.update(p),g.update(b),g.finish(w);for(var x=0;x{"use strict";Object.defineProperty(NM,"__esModule",{value:!0});NM.timingSafeEqual=aPe;function EQ(e,t=""){if(!e)throw new Error(t)}function aPe(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),EQ(e instanceof DataView),EQ(t instanceof DataView);let n=e.byteLength,i=0,r=-1;for(;++r{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.Webhook=wp.WebhookVerificationError=void 0;var IQ=_Q(),cPe=xQ(),lPe=TQ(),AQ=300,CM=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Fa=class e extends CM{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};wp.WebhookVerificationError=Fa;var j_=class e{constructor(t,n){if(n?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,i=>i.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=IQ.decode(t)}if(this.key.length===0)throw new Error("Secret can't be empty.")}verify(t,n,i){var r;let o=(r=i?.jsonParse)!==null&&r!==void 0?r:!0,s={};for(let g of Object.keys(n))s[g.toLowerCase()]=n[g];let a=s["webhook-id"],c=s["webhook-signature"],l=s["webhook-timestamp"];if(!c||!a||!l)throw new Fa("Missing required headers");let u=this.verifyTimestamp(l),p=this.sign(a,u,t).split(",")[1],f=c.split(" "),m=new globalThis.TextEncoder;for(let g of f){let[h,b]=g.split(",");if(h==="v1"&&(0,lPe.timingSafeEqual)(m.encode(b),m.encode(p))){let y=t.toString();return y===""?void 0:o?JSON.parse(y):void 0}}throw new Fa("No matching signature found")}sign(t,n,i){if(typeof i!="string")if(i.constructor.name==="Buffer")i=i.toString();else throw new Error("Expected payload to be of type string or Buffer.");let r=new TextEncoder,o=Math.floor(n.getTime()/1e3),s=r.encode(`${t}.${o}.${i}`);return`v1,${IQ.encode(cPe.hmac(this.key,s))}`}verifyTimestamp(t){let n=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(Number.isNaN(i))throw new Fa("Invalid Signature Headers");if(n-i>AQ)throw new Fa("Message timestamp too old");if(i>n+AQ)throw new Fa("Message timestamp too new");return new Date(i*1e3)}};wp.Webhook=j_;j_.prefix="whsec_"});var NQ,kp,PM=j(()=>{Se();NQ=gt(RQ(),1),kp=class extends Z{parseUnverified(t){return JSON.parse(t)}unwrap(t,n){let i=n?.headers;if(i==null)throw new Error("Webhook headers are required in order to verify the signature");let r=n.key===void 0?this._client.webhookKey:n.key;if(!r)throw new Error("Webhook key must not be null or empty in order to unwrap");return new NQ.Webhook(r).verify(t,i),JSON.parse(t)}}});var $p,DM=j(()=>{Se();De();Ne();Me();$p=class extends Z{list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/agents/${t}/versions?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var Tl,OM=j(()=>{Se();DM();DM();De();Ne();Me();Tl=class extends Z{constructor(){super(...arguments),this.versions=new $p(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/agents?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.get(N`/v1/agents/${t}?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/agents/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/agents?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/agents/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Tl.Versions=$p});function Ua(e,t){if(!e)return()=>{};if(e.aborted)return t.abort(),()=>{};let n=()=>t.abort();return e.addEventListener("abort",n),()=>e.removeEventListener("abort",n)}var z_=j(()=>{});function An(e,t){return e instanceof Dt&&e.status===t}function CQ(e){return e instanceof Dt&&typeof e.status=="number"&&e.status>=400&&e.status<500}function ja(e){return CQ(e)&&!An(e,408)&&!An(e,409)&&!An(e,429)}function G_(e,t,n){return Math.min(t*2**e,n)}function MM(e,t){return e+Math.random()*(t-e)}function V_(e){return e*(1-Math.random()*.25)}var _p=j(()=>{kt()});function B_(e,{authToken:t,helper:n}){if(!t)throw new J(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(t)}`);let i=e,r=i._options.defaultHeaders,o=i._authState?.extraHeaders,s=o?Object.fromEntries(Object.entries(o).filter(([c])=>{let l=c.toLowerCase();return l!=="authorization"&&l!=="x-api-key"})):void 0,a=I([s,r,{[Mo]:n}]);return e.withOptions({apiKey:null,authToken:t,baseURL:e.baseURL,credentials:void 0,defaultHeaders:a})}var LM=j(()=>{kt();Ne();eo()});function yPe(e){return G_(e,mPe,gPe)}function bPe(){let t=globalThis.process?.env?.HOSTNAME;return t?`${t}-${T_()}`:T_()}var Sp,q_,Ei,W_,H_,K_,Wh,Hh,xp,Ep,J_,Tp,Kh,fPe,mPe,gPe,hPe,za,FM,Z_=j(()=>{gr();kt();Xi();cp();aM();z_();Ne();_p();LM();_p();fPe=999,mPe=1e3,gPe=6e4,hPe=3e5,za=class{constructor(t){Sp.set(this,void 0),q_.set(this,!1),Ei.set(this,void 0),W_.set(this,void 0),H_.set(this,void 0),K_.set(this,void 0),Wh.set(this,void 0),Hh.set(this,void 0),xp.set(this,void 0),this.client=t.client,this.environmentId=t.environmentId,this.environmentKey=t.environmentKey,this.workerId=t.workerId??bPe(),M(this,Sp,B_(t.client,{authToken:t.environmentKey,helper:"environments-work-poller"}),"f"),M(this,H_,t.autoStop??!0,"f"),M(this,K_,t.drain??!1,"f"),M(this,Wh,t.blockMs===void 0?fPe:t.blockMs,"f"),M(this,Hh,t.reclaimOlderThanMs??null,"f"),M(this,xp,t.requestOptions,"f"),M(this,Ei,new AbortController,"f"),M(this,W_,Ua(t.signal,v(this,Ei,"f")),"f")}get signal(){return v(this,Ei,"f").signal}abort(){v(this,Ei,"f").abort()}async*[(Sp=new WeakMap,q_=new WeakMap,Ei=new WeakMap,W_=new WeakMap,H_=new WeakMap,K_=new WeakMap,Wh=new WeakMap,Hh=new WeakMap,xp=new WeakMap,Symbol.asyncIterator)](){if(v(this,q_,"f"))throw new J("Cannot iterate over a consumed WorkPoller");M(this,q_,!0,"f");let t=qe(this.client);t.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let n=new FM(t,this.environmentId);try{let i=0;for(;!v(this,Ei,"f").signal.aborted;){let r;try{r=await v(this,Sp,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...v(this,Wh,"f")!==null?{block_ms:v(this,Wh,"f")}:{},...v(this,Hh,"f")!==null?{reclaim_older_than_ms:v(this,Hh,"f")}:{}},{headers:I([v(this,xp,"f")?.headers]),signal:v(this,Ei,"f").signal})}catch(o){if(v(this,Ei,"f").signal.aborted)return;if(ja(o))throw t.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=V_(yPe(i));t.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),i++,await Yi(s,v(this,Ei,"f").signal);continue}if(i=0,r==null){if(v(this,K_,"f"))return;n.onEmptyPoll(),await Yi(MM(1e3,3e3),v(this,Ei,"f").signal);continue}n.onClaim(),t.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:r.id,work_type:r.data.type});try{await v(this,Sp,"f").beta.environments.work.ack(r.id,{environment_id:r.environment_id},{headers:I([v(this,xp,"f")?.headers]),signal:v(this,Ei,"f").signal})}catch(o){t.error("ack failed",{work_id:r.id,error:String(o)});continue}try{yield r}finally{if(v(this,H_,"f"))try{await v(this,Sp,"f").beta.environments.work.stop(r.id,{environment_id:r.environment_id},{headers:I([v(this,xp,"f")?.headers])})}catch(o){An(o,409)||t.warn("stop failed",{work_id:r.id,error:String(o)})}}}}finally{v(this,W_,"f").call(this)}}};FM=class{constructor(t,n){Ep.set(this,void 0),J_.set(this,void 0),Tp.set(this,void 0),Kh.set(this,0),M(this,Ep,t,"f"),M(this,J_,n,"f")}onEmptyPoll(){let t=Date.now(),n={component:"work-poller",environment_id:v(this,J_,"f")};v(this,Tp,"f")===void 0?(M(this,Tp,M(this,Kh,t,"f"),"f"),v(this,Ep,"f").info("idle; polling for work",n)):t-v(this,Kh,"f")>=hPe?(M(this,Kh,t,"f"),v(this,Ep,"f").info(`still polling; idle for ${Math.round((t-v(this,Tp,"f"))/1e3)}s`,n)):v(this,Ep,"f").debug("poll returned no work",n)}onClaim(){M(this,Tp,void 0,"f")}};Ep=new WeakMap,J_=new WeakMap,Tp=new WeakMap,Kh=new WeakMap});var Ip,Ga,Ap,Y_,PQ=j(()=>{gr();Y_=class{constructor(){Ip.set(this,[]),Ga.set(this,[]),Ap.set(this,!1)}push(t){if(v(this,Ap,"f"))return!1;let n=v(this,Ga,"f").shift();return n?n({done:!1,value:t}):v(this,Ip,"f").push(t),!0}close(){if(!v(this,Ap,"f"))for(M(this,Ap,!0,"f");v(this,Ga,"f").length>0;)v(this,Ga,"f").shift()({done:!0,value:void 0})}next(t){return v(this,Ip,"f").length>0?Promise.resolve({done:!1,value:v(this,Ip,"f").shift()}):v(this,Ap,"f")||t?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(n=>{let i=o=>{t?.removeEventListener("abort",r),n(o)},r=()=>{let o=v(this,Ga,"f").indexOf(i);o>=0&&v(this,Ga,"f").splice(o,1),n({done:!0,value:void 0})};v(this,Ga,"f").push(i),t?.addEventListener("abort",r,{once:!0})})}tryShift(){return v(this,Ip,"f").shift()}};Ip=new WeakMap,Ga=new WeakMap,Ap=new WeakMap});var Ae,Il=j(()=>{Ae=class extends Error{constructor(t){let n=typeof t=="string"?t:t.map(i=>i.type==="text"?i.text:`[${i.type}]`).join(" ");super(n),this.name="ToolError",this.content=t}}});function UM(e){return"name"in e?e.name:"mcp_server_name"in e?e.mcp_server_name:e.type}function vPe(e){return e instanceof Ae?e.content:`Error: ${e instanceof Error?e.message:String(e)}`}async function DQ(e,t,n){try{let i=e.parse?e.parse(t):t;return{content:await e.run(i,n),isError:!1}}catch(i){return{content:vPe(i),isError:!0}}}var OQ=j(()=>{Il()});function BQ(e){return e.type==="session.status_idle"&&e.stop_reason?.type==="end_turn"}function TPe(e,t,n){return e.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:e.id,is_error:t,content:n}:{type:"user.tool_result",tool_use_id:e.id,is_error:t,content:n}}function IPe(e){if(typeof e=="string")return[{type:"text",text:e||"(no output)"}];let t=e.map(n=>n.type==="text"?{type:"text",text:n.text||"(no output)"}:n.type==="image"||n.type==="document"?n:n.type==="search_result"?{type:"search_result",source:n.source,title:n.title,content:n.content.map(i=>({type:"text",text:i.text})),citations:{enabled:n.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(n)});return t.length>0?t:[{type:"text",text:"(no output)"}]}var Jh,rS,Rp,Al,to,Kt,Q_,jn,X_,Zh,iS,mn,Cp,ti,Pp,Va,Np,hs,oS,Yh,Ti,eS,GQ,MQ,LQ,FQ,jM,UQ,tS,nS,zM,jQ,VQ,zQ,wPe,kPe,$Pe,_Pe,SPe,xPe,EPe,GM,Ba,sS=j(()=>{gr();kt();Xi();cp();_p();z_();PQ();Ne();eo();OQ();zQ=500,wPe=1e4,kPe=12e4,$Pe=3e4,_Pe=1e3,SPe=3e4,xPe=5*6e4,EPe=6e4;GM=class{constructor(t,n){Jh.set(this,void 0),rS.set(this,void 0),Rp.set(this,new Set),Al.set(this,!1),to.set(this,void 0),M(this,Jh,t,"f"),M(this,rS,n,"f")}noteEvent(t){t.type!=="user.tool_confirmation"&&(BQ(t)?this.arm():this.disarm())}block(t){v(this,Rp,"f").add(t),v(this,to,"f")!==void 0&&(M(this,Al,!0,"f"),clearTimeout(v(this,to,"f")),M(this,to,void 0,"f"))}unblock(t){v(this,Rp,"f").delete(t),v(this,Rp,"f").size===0&&v(this,Al,"f")&&this.arm()}arm(){if(!(v(this,Jh,"f")<=0)){if(v(this,Rp,"f").size>0){M(this,Al,!0,"f");return}M(this,Al,!1,"f"),v(this,to,"f")!==void 0&&clearTimeout(v(this,to,"f")),M(this,to,setTimeout(v(this,rS,"f"),v(this,Jh,"f")),"f")}}disarm(){M(this,Al,!1,"f"),v(this,to,"f")!==void 0&&(clearTimeout(v(this,to,"f")),M(this,to,void 0,"f"))}};Jh=new WeakMap,rS=new WeakMap,Rp=new WeakMap,Al=new WeakMap,to=new WeakMap;Ba=class{constructor(t,n){Kt.add(this),Q_.set(this,!1),jn.set(this,void 0),X_.set(this,void 0),Zh.set(this,void 0),iS.set(this,void 0),mn.set(this,void 0),Cp.set(this,new Set),ti.set(this,new Set),Pp.set(this,new Map),Va.set(this,new Map),Np.set(this,new Y_),hs.set(this,0),oS.set(this,xPe),Yh.set(this,null),Ti.set(this,void 0),this.client=n.client,this.sessionId=t,this.tools=n.tools,this.maxIdleMs=n.maxIdleMs??EPe,M(this,mn,qe(n.client),"f"),M(this,iS,new Map(n.tools.map(i=>[UM(i),i])),"f"),M(this,jn,new AbortController,"f"),M(this,X_,Ua(n.signal,v(this,jn,"f")),"f"),M(this,Zh,n.requestOptions,"f"),M(this,Ti,new GM(this.maxIdleMs,()=>{v(this,mn,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),v(this,jn,"f").abort()}),"f")}get signal(){return v(this,jn,"f").signal}abort(){v(this,jn,"f").abort()}_setSendRetryWindow(t){M(this,oS,t,"f")}async*[(Q_=new WeakMap,jn=new WeakMap,X_=new WeakMap,Zh=new WeakMap,iS=new WeakMap,mn=new WeakMap,Cp=new WeakMap,ti=new WeakMap,Pp=new WeakMap,Va=new WeakMap,Np=new WeakMap,hs=new WeakMap,oS=new WeakMap,Yh=new WeakMap,Ti=new WeakMap,Kt=new WeakSet,Symbol.asyncIterator)](){if(v(this,Q_,"f"))throw new J("Cannot iterate over a consumed SessionToolRunner");M(this,Q_,!0,"f"),v(this,mn,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let t=v(this,Kt,"m",GQ).call(this).catch(n=>{v(this,jn,"f").signal.aborted||v(this,mn,"f").error("stream loop failed",{error:String(n)}),v(this,jn,"f").abort()});try{for(;;){let i=await v(this,Np,"f").next(v(this,jn,"f").signal);if(i.done)break;yield i.value}await t;let n;for(;(n=v(this,Np,"f").tryShift())!==void 0;)yield n}finally{v(this,jn,"f").abort(),v(this,Ti,"f").disarm(),await t;try{await v(this,Kt,"m",VQ).call(this)}catch(n){v(this,mn,"f").warn("drain failed",{error:String(n)})}v(this,Np,"f").close();for(let n of this.tools)try{await n.close?.()}catch(i){v(this,mn,"f").warn("tool.close failed",{tool:UM(n),error:String(i)})}v(this,X_,"f").call(this)}}};eS=function(){return{...v(this,Zh,"f"),headers:I([Bh("session-tool-runner"),v(this,Zh,"f")?.headers]),signal:v(this,jn,"f").signal}},GQ=async function(){let t=v(this,jn,"f"),n=zQ;for(;!t.signal.aborted;){try{let i=await this.client.beta.sessions.events.stream(this.sessionId,{},v(this,Kt,"m",eS).call(this));await v(this,Kt,"m",MQ).call(this);for await(let r of i)if(n=zQ,await v(this,Kt,"m",FQ).call(this,r))return}catch(i){if(t.signal.throwIfAborted(),ja(i))throw v(this,mn,"f").error("permanent stream failure, shutting down",{error:String(i)}),t.abort(),i;v(this,mn,"f").warn("stream disconnected, reconnecting",{error:String(i),backoff_ms:n})}t.signal.throwIfAborted(),await Yi(n,t.signal),n=Math.min(n*2,wPe)}},MQ=async function(){let t=v(this,jn,"f"),n=[],i=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},v(this,Kt,"m",eS).call(this)))v(this,Kt,"m",LQ).call(this,s,n),i=BQ(s)}catch(s){t.signal.throwIfAborted(),v(this,mn,"f").warn("reconcile list failed",{error:String(s)});for(let a of n)v(this,Cp,"f").delete(a.id);return}let r=n.filter(s=>!v(this,ti,"f").has(s.id));v(this,Ti,"f").disarm();for(let s of r)await v(this,Kt,"m",jM).call(this,s);for(let s of[...v(this,Va,"f").values()]){let a=v(this,Pp,"f").get(s.id);a!==void 0&&await v(this,Kt,"m",tS).call(this,s,a)}let o=r.filter(s=>!v(this,ti,"f").has(s.id)&&!v(this,Va,"f").has(s.id));i&&o.length===0?v(this,Ti,"f").arm():v(this,Ti,"f").disarm()},LQ=function(t,n){t.type==="agent.tool_use"||t.type==="agent.custom_tool_use"?(v(this,Cp,"f").add(t.id),v(this,ti,"f").has(t.id)||n.push(t)):t.type==="user.tool_result"?v(this,ti,"f").add(t.tool_use_id):t.type==="user.custom_tool_result"?v(this,ti,"f").add(t.custom_tool_use_id):t.type==="user.tool_confirmation"&&(v(this,ti,"f").has(t.tool_use_id)||v(this,Pp,"f").set(t.tool_use_id,t.result))},FQ=async function(t){switch(v(this,Ti,"f").noteEvent(t),t.type){case"agent.tool_use":case"agent.custom_tool_use":return v(this,Cp,"f").has(t.id)||(v(this,Cp,"f").add(t.id),await v(this,Kt,"m",jM).call(this,t)),!1;case"user.tool_confirmation":return await v(this,Kt,"m",UQ).call(this,t),!1;case"user.tool_result":return v(this,ti,"f").add(t.tool_use_id),!1;case"user.custom_tool_result":return v(this,ti,"f").add(t.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return v(this,mn,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),v(this,jn,"f").abort(),!0;default:return!1}},jM=async function(t){let n=t.evaluated_permission,i=n==="deny"?"deny":v(this,Pp,"f").get(t.id);if(i===void 0){n===void 0||n==="allow"?await v(this,Kt,"m",zM).call(this,t,void 0):v(this,Va,"f").has(t.id)||(v(this,mn,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Va,"f").set(t.id,t),v(this,Ti,"f").block(t.id));return}await v(this,Kt,"m",tS).call(this,t,i)},UQ=async function(t){v(this,Pp,"f").set(t.tool_use_id,t.result);let n=v(this,Va,"f").get(t.tool_use_id);n!==void 0&&await v(this,Kt,"m",tS).call(this,n,t.result)},tS=async function(t,n){let i=v(this,Va,"f").delete(t.id);if(n==="allow"){v(this,mn,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),i||v(this,Ti,"f").block(t.id);try{await v(this,Kt,"m",zM).call(this,t,"allow")}finally{v(this,Ti,"f").unblock(t.id)}return}i&&v(this,Ti,"f").unblock(t.id),v(this,ti,"f").add(t.id),v(this,mn,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Kt,"m",nS).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:"deny"})},nS=function(t){v(this,Np,"f").push(t)},zM=async function(t,n){var i,r;if(!v(this,ti,"f").has(t.id)){v(this,mn,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),M(this,hs,(i=v(this,hs,"f"),i++,i),"f");try{let o=v(this,iS,"f").get(t.name);if(!o){v(this,mn,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Kt,"m",nS).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:n});return}let s,a,c=new AbortController,l=Ua(v(this,jn,"f").signal,c),u=setTimeout(()=>c.abort(),kPe);try{let f=await DQ(o,t.input,{toolUse:t,toolUseBlock:t,signal:c.signal});s=f.content,a=f.isError}finally{clearTimeout(u),l()}let d=TPe(t,a,IPe(s)),p=await v(this,Kt,"m",jQ).call(this,d,t.id);v(this,Kt,"m",nS).call(this,{event:t,result:d,toolUseId:t.id,name:t.name,isError:a,posted:p,confirmation:n})}finally{M(this,hs,(r=v(this,hs,"f"),r--,r),"f"),v(this,hs,"f")===0&&v(this,Yh,"f")?.call(this)}}},jQ=async function(t,n){let i=v(this,jn,"f"),r=Date.now(),o,s=0;for(;;){s++,i.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[t]},v(this,Kt,"m",eS).call(this)),v(this,ti,"f").add(n),!0}catch(a){if(o=a,ja(a))break;let c=v(this,oS,"f")-(Date.now()-r);if(c<=0)break;let l=Math.min(V_(G_(s-1,_Pe,SPe)),c);v(this,mn,"f").warn("tool result send failed; retrying",{tool_use_id:n,attempt:s,backoff_ms:l,error:String(a)}),await Yi(l,i.signal)}}return v(this,mn,"f").error("failed to send tool result",{tool_use_id:n,attempts:s,error:String(o)}),!1},VQ=async function(){v(this,hs,"f")!==0&&(await Promise.race([new Promise(t=>M(this,Yh,t,"f")),Yi($Pe)]),M(this,Yh,null,"f"),v(this,hs,"f")>0&&v(this,mn,"f").warn("drain timeout exceeded"))}});function aS(e,t){if(!(e>=Qh))throw new J(`${t} must be at least ${Qh}ms (got ${e}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`)}var Xh,Qh,cS=j(()=>{kt();Xh=15e3,Qh=5e3});var qQ=j(()=>{cM()});function Rl(e){if(e.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${e.name}" must be an object, but got ${e.inputSchema.type}`);return{type:"custom",name:e.name,input_schema:e.inputSchema,description:e.description,run:e.run,parse:t=>t,...e.close?{close:e.close}:{}}}var WQ=j(()=>{VM();qQ()});function Dp(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}var BM=j(()=>{});function lS(e,t){let n=xe.relative(e,t);return n===""||!n.startsWith(".."+xe.sep)&&n!==".."&&!xe.isAbsolute(n)}async function qM(e,t){for(let n of e)if(lS(await ey(xe.resolve(n)),t))return n}function ny(e){let t=e?.code;return typeof t=="string"?t:void 0}async function ey(e){let t=[],n=e,i=0;for(;;){let r;try{r=await Nl.realpath(n)}catch(o){let s;try{s=(await Nl.lstat(n)).isSymbolicLink()}catch(a){let c=ny(a);if(c!=="ENOENT"&&c!=="ENOTDIR")throw a;let l=xe.dirname(n);if(l===n)throw a;t.push(xe.basename(n)),n=l;continue}if(!s)throw o;if(++i>RPe)throw Object.assign(new Error("too many levels of symbolic links"),{code:"ELOOP"});n=xe.resolve(xe.dirname(n),await Nl.readlink(n));continue}return t.length?xe.join(r,...t.reverse()):r}}async function HQ(e,t,n){let i=n?.allowedRoots??[],r=await ey(xe.resolve(e)),o;try{o=await ey(xe.resolve(r,t))}catch(a){throw new Ae(Op(a,`path ${JSON.stringify(t)}`))}if(lS(r,o)||await qM(i,o)!==void 0)return o;let s=i.length?"the session's working directory and its other permitted directories":"the session's working directory";throw new Ae(`path ${JSON.stringify(t)} is outside ${s}`)}async function WM(e,t){let n=xe.dirname(e),i=xe.join(n,`.tmp-${process.pid}-${Oa.randomUUID()}`),r=await Nl.stat(e).then(s=>s.mode&511,()=>{}),o;try{o=await Nl.open(i,"wx",APe),r!==void 0&&await o.chmod(r),await o.writeFile(t,"utf-8"),await o.sync(),await o.close(),o=void 0,await Nl.rename(i,e)}catch(s){throw o&&await o.close().catch(()=>{}),await Nl.unlink(i).catch(()=>{}),s}}function Op(e,t){let n=ny(e);switch(n){case"ENOENT":return`${t}: no such file or directory`;case"EACCES":case"EPERM":return`${t}: permission denied`;case"ENOTDIR":return`${t}: not a directory`;case"EISDIR":return`${t}: is a directory`;case"ELOOP":return`${t}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${t}: file name too long`;case"ENOSPC":return`${t}: no space left on device`;case"EMFILE":case"ENFILE":return`${t}: too many open files`;default:return`${t}: ${n!==void 0?`i/o error (${n})`:"i/o error"}`}}var Nl,ty,APe,RPe,HM=j(()=>{Mr();Il();Nl=fs.promises,ty=448,APe=384;RPe=40});async function JQ(e){let{client:t,sessionId:n}=e;if(!t)return async()=>{};let i=qe(t),r=e.session;if(!r){if(n===void 0)return async()=>{};i.warn("AgentToolContext.sessionId is deprecated and costs an extra session fetch; fetch the session once and set `session` instead",{component:"agent-tool-context"}),r=await t.beta.sessions.retrieve(n)}let o=xe.resolve(e.workdir,"skills"),s=[];for(let a of r.agent.skills)try{let c=await t.beta.skills.versions.retrieve(a.version,{skill_id:a.skill_id}),l=xe.basename(c.name.trim());(l===""||l==="."||l==="..")&&(l=a.skill_id);let u=xe.resolve(o,l);if(u!==o&&!u.startsWith(o+xe.sep)){i.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:c.name});continue}let d=await t.beta.skills.versions.download(c.id,{skill_id:a.skill_id});await Ii.rm(u,{recursive:!0,force:!0}),await Ii.mkdir(u,{recursive:!0,mode:ty}),s.push(u),await ZM(d,u),i.info("downloaded skill",{component:"agent-tool-context",skill_id:a.skill_id,version:c.id,dest:u})}catch(c){i.warn("failed to download skill",{component:"agent-tool-context",skill_id:a.skill_id,error:String(c)})}return async()=>{for(let a of s)await Ii.rm(a,{recursive:!0,force:!0}).catch(c=>{i.warn("failed to clean up skill",{component:"agent-tool-context",dest:a,error:String(c)})})}}function CPe(e){for(let t of e){let n=t.trim();if(n&&(xe.isAbsolute(n)||n.split(/[\\/]/).includes("..")))throw new J(`refusing to extract unsafe archive member: ${n}`)}}function KQ(e){let t=e.split(` -`);return t[t.length-1]===""&&t.pop(),t}function DPe(e,t){return/^[\x20-\x7E]+$/.test(t)&&!/[\\^#]/.test(t)&&!(e==="unzip"&&t.startsWith("-"))}function OPe(e,t,n){let i=KQ(t),r=KQ(n);if(i.length!==r.length)throw new J(JM);let o=[],s=[];return i.forEach((a,c)=>{if(PPe[e].has(r[c].charAt(0))){o.push(a);return}if(!DPe(e,a))throw new J(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(a)}`);s.push(a)}),{plain:o,special:s}}async function ZQ(e){for(let t of await Ii.readdir(e,{withFileTypes:!0}))if(t.isDirectory())await ZQ(xe.join(e,t.name));else if(!t.isFile())throw new J(JM)}async function KM(e,t){try{let{stdout:n}=await NPe(e,t);return n}catch(n){throw ny(n)==="ENOENT"?new J(`skill extraction requires the \`${e}\` command, but it was not found on PATH`):n}}function MPe(e){let t,n=!1;for(let i of e){let r=i.trim().split("/").filter(s=>s!==""&&s!==".");if(r.length===0)continue;let o=r[0];if(t===void 0)t=o;else if(o!==t)return"";r.length>1&&(n=!0)}return t!==void 0&&n?t:""}async function ZM(e,t){let n=xe.join(t,`.skill-archive-${process.pid}-${Date.now()}`);if(!e.body)throw new J("skill download response had no body");await y_.promises.pipeline(y_.Readable.fromWeb(e.body),fs.createWriteStream(n));let i=xe.join(xe.dirname(t),`.skill-stage-${process.pid}-${Date.now()}`),r=xe.join(xe.dirname(t),`.skill-exclude-${process.pid}-${Date.now()}`);try{let o=await FPe(n,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,a=s?"unzip":"tar",c=await KM(a,s?["-Z1",n]:["-tf",n]),l=await KM(a,s?["-Z","--h","--t",n]:["-tvf",n]),{plain:u,special:d}=OPe(a,c,l);CPe([...u,...d]);let p=MPe(u);await Ii.mkdir(i,{recursive:!0,mode:ty}),u.length>0&&await KM(a,await LPe(a,n,i,d,r)),await ZQ(i);let f=p?xe.join(i,p):i,m=await Ii.readdir(f).catch(g=>{throw ny(g)==="ENOENT"?new J(JM):g});for(let g of m)await Ii.rename(xe.join(f,g),xe.join(t,g))}finally{await Ii.rm(n,{force:!0}),await Ii.rm(r,{force:!0}),await Ii.rm(i,{recursive:!0,force:!0})}}async function LPe(e,t,n,i,r){let o=i.map(s=>s.replace(/[*?[\\]/g,"\\$&"));return e==="unzip"?["-oq",t,"-d",n,...o.length>0?["-x",...o]:[]]:o.length===0?["-xf",t,"-C",n]:(await Ii.writeFile(r,o.join(` +${d}`)}return s},x=nOe(p7)});var Xd,wL=O(()=>{X();ie();Ee();me();Xd=class extends P{retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(x`/v1/deployment_runs/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",G,{query:o,...n,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}}});var ep,kL=O(()=>{X();ie();Ee();me();ep=class extends P{create(t,n){let{betas:r,workspace_id:i,...o}=t;return this._client.post("/v1/deployments?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(x`/v1/deployments/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}update(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(x`/v1/deployments/${t}?beta=true`,{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/deployments?beta=true",G,{query:o,...n,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}archive(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(x`/v1/deployments/${t}/archive?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}pause(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(x`/v1/deployments/${t}/pause?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}run(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(x`/v1/deployments/${t}/run?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}unpause(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(x`/v1/deployments/${t}/unpause?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}}});var tp,_L=O(()=>{X();ie();Ee();me();tp=class extends P{create(t,n){let{betas:r,workspace_id:i,...o}=t;return this._client.post("/v1/dreams?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(x`/v1/dreams/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/dreams?beta=true",G,{query:o,...n,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}archive(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(x`/v1/dreams/${t}/archive?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}cancel(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(x`/v1/dreams/${t}/cancel?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}}});function rS(e){return{[Oo]:e}}function ml(e){return typeof e=="object"&&e!==null&&gs in e}function $L(e,t){let n=new Set;if(e)for(let r of e)ml(r)&&n.add(r[gs]);if(t)for(let r of t){ml(r)&&n.add(r[gs]);let i=r.content;if(Array.isArray(i))for(let o of i){ml(o)&&n.add(o[gs]);let s=o?.tool?.definition;ml(s)&&n.add(s[gs])}}return Array.from(n)}function iS(e,t){let n=$L(e,t);return n.length===0?{}:{[Oo]:n.join(", ")}}function oS(e){return ml(e)?{[Oo]:e[gs]}:{}}var Oo,np,gs,Ii=O(()=>{Oo="x-stainless-helper",np="x-stainless-helper-method";gs=Symbol("anthropic.sdk.stainlessHelper")});var rp,SL=O(()=>{X();ie();Ee();Ii();Ti();me();rp=class extends P{list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/files?beta=true",G,{query:o,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.delete(x`/v1/files/${t}?beta=true`,{...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}download(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(x`/v1/files/${t}/content?beta=true`,{...r,headers:I([{Accept:"application/binary",...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(x`/v1/files/${t}?beta=true`,{...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}upload(t,n){let{betas:r,workspace_id:i,...o}=t;return this._client.post("/v1/files?beta=true",In({body:o,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},oS(o.file),n?.headers])},this._client))}}});var ip,xL=O(()=>{X();ie();Ee();me();ip=class extends P{retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(x`/v1/models/${t}?beta=true`,{...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/models?beta=true",dt,{query:o,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}}});var op,EL=O(()=>{X();ie();Ee();me();op=class extends P{create(t,n){let{betas:r,workspace_id:i,...o}=t;return this._client.post("/v1/user_profiles?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(x`/v1/user_profiles/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}update(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(x`/v1/user_profiles/${t}?beta=true`,{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/user_profiles?beta=true",G,{query:o,...n,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}createEnrollmentURL(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(x`/v1/user_profiles/${t}/enrollment_url?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}}});var g7=H(Qr=>{"use strict";var lOe=Qr&&Qr.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(Qr,"__esModule",{value:!0});var pn=256,TL=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var n="",r=0;r>>18&63),n+=this._encodeByte(i>>>12&63),n+=this._encodeByte(i>>>6&63),n+=this._encodeByte(i>>>0&63)}var o=t.length-r;if(o>0){var i=t[r]<<16|(o===2?t[r+1]<<8:0);n+=this._encodeByte(i>>>18&63),n+=this._encodeByte(i>>>12&63),o===2?n+=this._encodeByte(i>>>6&63):n+=this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var n=this._getPaddingLength(t),r=t.length-n,i=new Uint8Array(this.maxDecodedLength(r)),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&pn,a|=l&pn,a|=u&pn,a|=d&pn;if(s>>4,a|=c&pn,a|=l&pn),s>>2,a|=u&pn),s>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=pn;return n+=(42-t&t-44)>>>8&-pn+t-43+62,n+=(46-t&t-48)>>>8&-pn+t-47+63,n+=(47-t&t-58)>>>8&-pn+t-48+52,n+=(64-t&t-91)>>>8&-pn+t-65+0,n+=(96-t&t-123)>>>8&-pn+t-97+26,n},e.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var r=t.length-1;r>=0&&t[r]===this._paddingCharacter;r--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},e})();Qr.Coder=TL;var oy=new TL;function uOe(e){return oy.encode(e)}Qr.encode=uOe;function dOe(e){return oy.decode(e)}Qr.decode=dOe;var f7=(function(e){lOe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(n){var r=n;return r+=65,r+=25-n>>>8&6,r+=51-n>>>8&-75,r+=61-n>>>8&-13,r+=62-n>>>8&49,String.fromCharCode(r)},t.prototype._decodeChar=function(n){var r=pn;return r+=(44-n&n-46)>>>8&-pn+n-45+62,r+=(94-n&n-96)>>>8&-pn+n-95+63,r+=(47-n&n-58)>>>8&-pn+n-48+52,r+=(64-n&n-91)>>>8&-pn+n-65+0,r+=(96-n&n-123)>>>8&-pn+n-97+26,r},t})(TL);Qr.URLSafeCoder=f7;var m7=new f7;function pOe(e){return m7.encode(e)}Qr.encodeURLSafe=pOe;function fOe(e){return m7.decode(e)}Qr.decodeURLSafe=fOe;Qr.encodedLength=function(e){return oy.encodedLength(e)};Qr.maxDecodedLength=function(e){return oy.maxDecodedLength(e)};Qr.decodedLength=function(e){return oy.decodedLength(e)}});var y7=H((h7,sS)=>{(function(e,t){var n={};t(n);var r=n.default;for(var i in n)r[i]=n[i];typeof sS=="object"&&typeof sS.exports=="object"?sS.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):e.sha256=r})(h7,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=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 n(d,p,f,m,g){for(var h,v,b,w,k,$,S,E,T,A,R,j,U;g>=64;){for(h=p[0],v=p[1],b=p[2],w=p[3],k=p[4],$=p[5],S=p[6],E=p[7],A=0;A<16;A++)R=m+A*4,d[A]=(f[R]&255)<<24|(f[R+1]&255)<<16|(f[R+2]&255)<<8|f[R+3]&255;for(A=16;A<64;A++)T=d[A-2],j=(T>>>17|T<<15)^(T>>>19|T<<13)^T>>>10,T=d[A-15],U=(T>>>7|T<<25)^(T>>>18|T<<14)^T>>>3,d[A]=(j+d[A-7]|0)+(U+d[A-16]|0);for(A=0;A<64;A++)j=(((k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7))+(k&$^~k&S)|0)+(E+(t[A]+d[A]|0)|0)|0,U=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&v^h&b^v&b)|0,E=S,S=$,$=k,k=w+j|0,w=b,b=v,v=h,h=j+U|0;p[0]+=h,p[1]+=v,p[2]+=b,p[3]+=w,p[4]+=k,p[5]+=$,p[6]+=S,p[7]+=E,m+=64,g-=64}return m}var r=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.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 p=0;p0){for(;this.bufferLength<64&&f>0;)this.buffer[this.bufferLength++]=p[m++],f--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(f>=64&&(m=n(this.temp,this.state,p,m,f),f%=64);f>0;)this.buffer[this.bufferLength++]=p[m++],f--;return this},d.prototype.finish=function(p){if(!this.finished){var f=this.bytesHashed,m=this.bufferLength,g=f/536870912|0,h=f<<3,v=f%64<56?64:128;this.buffer[m]=128;for(var b=m+1;b>>24&255,this.buffer[v-7]=g>>>16&255,this.buffer[v-6]=g>>>8&255,this.buffer[v-5]=g>>>0&255,this.buffer[v-4]=h>>>24&255,this.buffer[v-3]=h>>>16&255,this.buffer[v-2]=h>>>8&255,this.buffer[v-1]=h>>>0&255,n(this.temp,this.state,this.buffer,0,v),this.finished=!0}for(var b=0;b<8;b++)p[b*4+0]=this.state[b]>>>24&255,p[b*4+1]=this.state[b]>>>16&255,p[b*4+2]=this.state[b]>>>8&255,p[b*4+3]=this.state[b]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var f=0;fthis.blockSize)new r().update(p).finish(f).clean();else for(var m=0;m1&&p.update(d),f&&p.update(f),p.update(m),p.finish(d),m[0]++}var c=new Uint8Array(e.digestLength);function l(d,p,f,m){p===void 0&&(p=c),m===void 0&&(m=32);for(var g=new Uint8Array([1]),h=s(p,d),v=new i(h),b=new Uint8Array(v.digestLength),w=b.length,k=new Uint8Array(m),$=0;$>>24&255,v[1]=S>>>16&255,v[2]=S>>>8&255,v[3]=S>>>0&255,g.reset(),g.update(p),g.update(v),g.finish(w);for(var E=0;E{"use strict";Object.defineProperty(IL,"__esModule",{value:!0});IL.timingSafeEqual=mOe;function b7(e,t=""){if(!e)throw new Error(t)}function mOe(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),b7(e instanceof DataView),b7(t instanceof DataView);let n=e.byteLength,r=0,i=-1;for(;++i{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});sp.Webhook=sp.WebhookVerificationError=void 0;var w7=g7(),gOe=y7(),hOe=v7(),k7=300,AL=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Na=class e extends AL{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};sp.WebhookVerificationError=Na;var aS=class e{constructor(t,n){if(n?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,r=>r.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=w7.decode(t)}if(this.key.length===0)throw new Error("Secret can't be empty.")}verify(t,n,r){var i;let o=(i=r?.jsonParse)!==null&&i!==void 0?i:!0,s={};for(let g of Object.keys(n))s[g.toLowerCase()]=n[g];let a=s["webhook-id"],c=s["webhook-signature"],l=s["webhook-timestamp"];if(!c||!a||!l)throw new Na("Missing required headers");let u=this.verifyTimestamp(l),p=this.sign(a,u,t).split(",")[1],f=c.split(" "),m=new globalThis.TextEncoder;for(let g of f){let[h,v]=g.split(",");if(h==="v1"&&(0,hOe.timingSafeEqual)(m.encode(v),m.encode(p))){let b=t.toString();return b===""?void 0:o?JSON.parse(b):void 0}}throw new Na("No matching signature found")}sign(t,n,r){if(typeof r!="string")if(r.constructor.name==="Buffer")r=r.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(n.getTime()/1e3),s=i.encode(`${t}.${o}.${r}`);return`v1,${w7.encode(gOe.hmac(this.key,s))}`}verifyTimestamp(t){let n=Math.floor(Date.now()/1e3),r=parseInt(t,10);if(Number.isNaN(r))throw new Na("Invalid Signature Headers");if(n-r>k7)throw new Na("Message timestamp too old");if(r>n+k7)throw new Na("Message timestamp too new");return new Date(r*1e3)}};sp.Webhook=aS;aS.prefix="whsec_"});var $7,ap,RL=O(()=>{X();$7=gt(_7(),1),ap=class extends P{parseUnverified(t){return JSON.parse(t)}unwrap(t,n){let r=n?.headers;if(r==null)throw new Error("Webhook headers are required in order to verify the signature");let i=n.key===void 0?this._client.webhookKey:n.key;if(!i)throw new Error("Webhook key must not be null or empty in order to unwrap");return new $7.Webhook(i).verify(t,r),JSON.parse(t)}}});var cp,PL=O(()=>{X();ie();Ee();me();cp=class extends P{list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(x`/v1/agents/${t}/versions?beta=true`,G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}}});var cS,CL=O(()=>{X();PL();PL();ie();Ee();me();cS=(()=>{class e extends P{constructor(){super(...arguments),this.versions=new cp(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/agents?beta=true",{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}retrieve(n,r={},i){let{betas:o,workspace_id:s,...a}=r??{};return this._client.get(x`/v1/agents/${n}?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(x`/v1/agents/${n}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/agents?beta=true",G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(x`/v1/agents/${n}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}return e.Versions=cp,e})()});function Da(e,t){if(!e)return()=>{};if(e.aborted)return t.abort(),()=>{};let n=()=>t.abort();return e.addEventListener("abort",n),()=>e.removeEventListener("abort",n)}var lS=O(()=>{});function jn(e,t){return e instanceof Mt&&e.status===t}function wOe(e){return e instanceof Mt&&typeof e.status=="number"&&e.status>=400&&e.status<500}function gl(e){return wOe(e)&&!jn(e,408)&&!jn(e,409)&&!jn(e,429)}function uS(e,t,n){return Math.min(t*2**e,n)}function S7(e,t){return e+Math.random()*(t-e)}function dS(e){return e*(1-Math.random()*.25)}var sy=O(()=>{_t()});function pS(e,{authToken:t,helper:n}){if(!t)throw new Y(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(t)}`);let r=e,i=r._options.defaultHeaders,o=r._authState?.extraHeaders,s=o?Object.fromEntries(Object.entries(o).filter(([c])=>{let l=c.toLowerCase();return l!=="authorization"&&l!=="x-api-key"})):void 0,a=I([s,i,{[Oo]:n}]);return e.withOptions({apiKey:null,authToken:t,baseURL:e.baseURL,credentials:void 0,defaultHeaders:a})}var NL=O(()=>{_t();Ee();Ii()});function xOe(e){return uS(e,_Oe,$Oe)}function TOe(){let t=globalThis.process?.env?.HOSTNAME;return t?`${t}-${K$()}`:K$()}var lp,fS,Ai,mS,gS,hS,ay,cy,up,dp,yS,pp,ly,kOe,_Oe,$Oe,SOe,uy,EOe,DL=O(()=>{er();_t();xi();Vd();iL();lS();Ee();sy();NL();kOe=999,_Oe=1e3,$Oe=6e4,SOe=3e5,uy=(()=>{class e{constructor(n){lp.set(this,void 0),fS.set(this,!1),Ai.set(this,void 0),mS.set(this,void 0),gS.set(this,void 0),hS.set(this,void 0),ay.set(this,void 0),cy.set(this,void 0),up.set(this,void 0),this.client=n.client,this.environmentId=n.environmentId,this.environmentKey=n.environmentKey,this.workerId=n.workerId??TOe(),D(this,lp,pS(n.client,{authToken:n.environmentKey,helper:"environments-work-poller"}),"f"),D(this,gS,n.autoStop??!0,"f"),D(this,hS,n.drain??!1,"f"),D(this,ay,n.blockMs===void 0?kOe:n.blockMs,"f"),D(this,cy,n.reclaimOlderThanMs??null,"f"),D(this,up,n.requestOptions,"f"),D(this,Ai,new AbortController,"f"),D(this,mS,Da(n.signal,y(this,Ai,"f")),"f")}get signal(){return y(this,Ai,"f").signal}abort(){y(this,Ai,"f").abort()}async*[(lp=new WeakMap,fS=new WeakMap,Ai=new WeakMap,mS=new WeakMap,gS=new WeakMap,hS=new WeakMap,ay=new WeakMap,cy=new WeakMap,up=new WeakMap,Symbol.asyncIterator)](){if(y(this,fS,"f"))throw new Y("Cannot iterate over a consumed WorkPoller");D(this,fS,!0,"f");let n=ze(this.client);n.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let r=new EOe(n,this.environmentId);try{let i=0;for(;!y(this,Ai,"f").signal.aborted;){let o;try{o=await y(this,lp,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...y(this,ay,"f")!==null?{block_ms:y(this,ay,"f")}:{},...y(this,cy,"f")!==null?{reclaim_older_than_ms:y(this,cy,"f")}:{}},{headers:I([y(this,up,"f")?.headers]),signal:y(this,Ai,"f").signal})}catch(s){if(y(this,Ai,"f").signal.aborted)return;if(gl(s))throw n.error("poll failed permanently, stopping poller",{error:String(s)}),s;let a=dS(xOe(i));n.warn("poll failed, backing off",{error:String(s),backoff_ms:a}),i++,await Xi(a,y(this,Ai,"f").signal);continue}if(i=0,o==null){if(y(this,hS,"f"))return;r.onEmptyPoll(),await Xi(S7(1e3,3e3),y(this,Ai,"f").signal);continue}r.onClaim(),n.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:o.id,work_type:o.data.type});try{await y(this,lp,"f").beta.environments.work.ack(o.id,{environment_id:o.environment_id},{headers:I([y(this,up,"f")?.headers]),signal:y(this,Ai,"f").signal})}catch(s){n.error("ack failed",{work_id:o.id,error:String(s)});continue}try{yield o}finally{if(y(this,gS,"f"))try{await y(this,lp,"f").beta.environments.work.stop(o.id,{environment_id:o.environment_id},{headers:I([y(this,up,"f")?.headers])})}catch(s){jn(s,409)||n.warn("stop failed",{work_id:o.id,error:String(s)})}}}}finally{y(this,mS,"f").call(this)}}}return e})();EOe=(()=>{class e{constructor(n,r){dp.set(this,void 0),yS.set(this,void 0),pp.set(this,void 0),ly.set(this,0),D(this,dp,n,"f"),D(this,yS,r,"f")}onEmptyPoll(){let n=Date.now(),r={component:"work-poller",environment_id:y(this,yS,"f")};y(this,pp,"f")===void 0?(D(this,pp,D(this,ly,n,"f"),"f"),y(this,dp,"f").info("idle; polling for work",r)):n-y(this,ly,"f")>=SOe?(D(this,ly,n,"f"),y(this,dp,"f").info(`still polling; idle for ${Math.round((n-y(this,pp,"f"))/1e3)}s`,r)):y(this,dp,"f").debug("poll returned no work",r)}onClaim(){D(this,pp,void 0,"f")}}return dp=new WeakMap,yS=new WeakMap,pp=new WeakMap,ly=new WeakMap,e})()});var fp,Oa,mp,x7,E7=O(()=>{er();x7=(()=>{class e{constructor(){fp.set(this,[]),Oa.set(this,[]),mp.set(this,!1)}push(n){if(y(this,mp,"f"))return!1;let r=y(this,Oa,"f").shift();return r?r({done:!1,value:n}):y(this,fp,"f").push(n),!0}close(){if(!y(this,mp,"f"))for(D(this,mp,!0,"f");y(this,Oa,"f").length>0;)y(this,Oa,"f").shift()({done:!0,value:void 0})}next(n){return y(this,fp,"f").length>0?Promise.resolve({done:!1,value:y(this,fp,"f").shift()}):y(this,mp,"f")||n?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(r=>{let i=s=>{n?.removeEventListener("abort",o),r(s)},o=()=>{let s=y(this,Oa,"f").indexOf(i);s>=0&&y(this,Oa,"f").splice(s,1),r({done:!0,value:void 0})};y(this,Oa,"f").push(i),n?.addEventListener("abort",o,{once:!0})})}tryShift(){return y(this,fp,"f").shift()}}return fp=new WeakMap,Oa=new WeakMap,mp=new WeakMap,e})()});var Me,gp=O(()=>{Me=(()=>{class e extends Error{constructor(n){let r=typeof n=="string"?n:n.map(i=>i.type==="text"?i.text:`[${i.type}]`).join(" ");super(r),this.name="ToolError",this.content=n}}return e})()});function OL(e){return"name"in e?e.name:"mcp_server_name"in e?e.mcp_server_name:e.type}function IOe(e){return e instanceof Me?e.content:`Error: ${e instanceof Error?e.message:String(e)}`}async function T7(e,t,n){try{let r=e.parse?e.parse(t):t;return{content:await e.run(r,n),isError:!1}}catch(r){return{content:IOe(r),isError:!0}}}var I7=O(()=>{gp()});function L7(e){return e.type!=="session.status_idle"?!1:e.stop_reason?.type!=="requires_action"}function LOe(e,t,n){return e.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:e.id,is_error:t,content:n}:{type:"user.tool_result",tool_use_id:e.id,is_error:t,content:n}}function FOe(e){if(typeof e=="string")return[{type:"text",text:e||"(no output)"}];let t=e.map(n=>n.type==="text"?{type:"text",text:n.text||"(no output)"}:n.type==="image"||n.type==="document"?n:n.type==="search_result"?{type:"search_result",source:n.source,title:n.title,content:n.content.map(r=>({type:"text",text:r.text})),citations:{enabled:n.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(n)});return t.length>0?t:[{type:"text",text:"(no output)"}]}var dy,bS,hp,hl,to,Jt,vS,Un,wS,py,kS,fn,yp,Xr,bp,Ma,vp,hs,_S,fy,ei,$S,A7,R7,P7,C7,ML,N7,SS,xS,LL,D7,O7,M7,AOe,ROe,POe,COe,NOe,DOe,OOe,MOe,my,FL=O(()=>{er();_t();xi();Vd();sy();lS();E7();Ee();Ii();I7();M7=500,AOe=1e4,ROe=12e4,POe=3e4,COe=1e3,NOe=3e4,DOe=5*6e4,OOe=6e4;MOe=(()=>{class e{constructor(n,r){dy.set(this,void 0),bS.set(this,void 0),hp.set(this,new Set),hl.set(this,!1),to.set(this,void 0),D(this,dy,n,"f"),D(this,bS,r,"f")}noteEvent(n){n.type!=="user.tool_confirmation"&&(L7(n)?this.arm():this.disarm())}block(n){y(this,hp,"f").add(n),y(this,to,"f")!==void 0&&(D(this,hl,!0,"f"),clearTimeout(y(this,to,"f")),D(this,to,void 0,"f"))}unblock(n){y(this,hp,"f").delete(n),y(this,hp,"f").size===0&&y(this,hl,"f")&&this.arm()}arm(){if(!(y(this,dy,"f")<=0)){if(y(this,hp,"f").size>0){D(this,hl,!0,"f");return}D(this,hl,!1,"f"),y(this,to,"f")!==void 0&&clearTimeout(y(this,to,"f")),D(this,to,setTimeout(y(this,bS,"f"),y(this,dy,"f")),"f")}}disarm(){D(this,hl,!1,"f"),y(this,to,"f")!==void 0&&(clearTimeout(y(this,to,"f")),D(this,to,void 0,"f"))}}return dy=new WeakMap,bS=new WeakMap,hp=new WeakMap,hl=new WeakMap,to=new WeakMap,e})(),my=(()=>{class e{constructor(n,r){Jt.add(this),vS.set(this,!1),Un.set(this,void 0),wS.set(this,void 0),py.set(this,void 0),kS.set(this,void 0),fn.set(this,void 0),yp.set(this,new Set),Xr.set(this,new Set),bp.set(this,new Map),Ma.set(this,new Map),vp.set(this,new x7),hs.set(this,0),_S.set(this,DOe),fy.set(this,null),ei.set(this,void 0),this.client=r.client,this.sessionId=n,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??OOe,D(this,fn,ze(r.client),"f"),D(this,kS,new Map(r.tools.map(i=>[OL(i),i])),"f"),D(this,Un,new AbortController,"f"),D(this,wS,Da(r.signal,y(this,Un,"f")),"f"),D(this,py,r.requestOptions,"f"),D(this,ei,new MOe(this.maxIdleMs,()=>{y(this,fn,"f").info("session idle after its turn ended; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),y(this,Un,"f").abort()}),"f")}get signal(){return y(this,Un,"f").signal}abort(){y(this,Un,"f").abort()}_setSendRetryWindow(n){D(this,_S,n,"f")}async*[(vS=new WeakMap,Un=new WeakMap,wS=new WeakMap,py=new WeakMap,kS=new WeakMap,fn=new WeakMap,yp=new WeakMap,Xr=new WeakMap,bp=new WeakMap,Ma=new WeakMap,vp=new WeakMap,hs=new WeakMap,_S=new WeakMap,fy=new WeakMap,ei=new WeakMap,Jt=new WeakSet,Symbol.asyncIterator)](){if(y(this,vS,"f"))throw new Y("Cannot iterate over a consumed SessionToolRunner");D(this,vS,!0,"f"),y(this,fn,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let n=y(this,Jt,"m",A7).call(this).catch(r=>{y(this,Un,"f").signal.aborted||y(this,fn,"f").error("stream loop failed",{error:String(r)}),y(this,Un,"f").abort()});try{for(;;){let i=await y(this,vp,"f").next(y(this,Un,"f").signal);if(i.done)break;yield i.value}await n;let r;for(;(r=y(this,vp,"f").tryShift())!==void 0;)yield r}finally{y(this,Un,"f").abort(),y(this,ei,"f").disarm(),await n;try{await y(this,Jt,"m",O7).call(this)}catch(r){y(this,fn,"f").warn("drain failed",{error:String(r)})}y(this,vp,"f").close();for(let r of this.tools)try{await r.close?.()}catch(i){y(this,fn,"f").warn("tool.close failed",{tool:OL(r),error:String(i)})}y(this,wS,"f").call(this)}}}return $S=function(){return{...y(this,py,"f"),headers:I([rS("session-tool-runner"),y(this,py,"f")?.headers]),signal:y(this,Un,"f").signal}},A7=async function(){let n=y(this,Un,"f"),r=M7;for(;!n.signal.aborted;){try{let i=await this.client.beta.sessions.events.stream(this.sessionId,{},y(this,Jt,"m",$S).call(this));await y(this,Jt,"m",R7).call(this);for await(let o of i)if(r=M7,await y(this,Jt,"m",C7).call(this,o))return}catch(i){if(n.signal.throwIfAborted(),gl(i))throw y(this,fn,"f").error("permanent stream failure, shutting down",{error:String(i)}),n.abort(),i;y(this,fn,"f").warn("stream disconnected, reconnecting",{error:String(i),backoff_ms:r})}n.signal.throwIfAborted(),await Xi(r,n.signal),r=Math.min(r*2,AOe)}},R7=async function(){let n=y(this,Un,"f"),r=[],i=!1;try{for await(let a of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},y(this,Jt,"m",$S).call(this)))y(this,Jt,"m",P7).call(this,a,r),a.type!=="user.tool_confirmation"&&(i=L7(a))}catch(a){n.signal.throwIfAborted(),y(this,fn,"f").warn("reconcile list failed",{error:String(a)});for(let c of r)y(this,yp,"f").delete(c.id);return}let o=r.filter(a=>!y(this,Xr,"f").has(a.id));y(this,ei,"f").disarm();for(let a of o)await y(this,Jt,"m",ML).call(this,a);for(let a of[...y(this,Ma,"f").values()]){let c=y(this,bp,"f").get(a.id);c!==void 0&&await y(this,Jt,"m",SS).call(this,a,c)}let s=o.filter(a=>!y(this,Xr,"f").has(a.id)&&!y(this,Ma,"f").has(a.id));i&&s.length===0?y(this,ei,"f").arm():y(this,ei,"f").disarm()},P7=function(n,r){n.type==="agent.tool_use"||n.type==="agent.custom_tool_use"?(y(this,yp,"f").add(n.id),y(this,Xr,"f").has(n.id)||r.push(n)):n.type==="user.tool_result"?y(this,Xr,"f").add(n.tool_use_id):n.type==="user.custom_tool_result"?y(this,Xr,"f").add(n.custom_tool_use_id):n.type==="user.tool_confirmation"&&(y(this,Xr,"f").has(n.tool_use_id)||y(this,bp,"f").set(n.tool_use_id,n.result))},C7=async function(n){switch(y(this,ei,"f").noteEvent(n),n.type){case"agent.tool_use":case"agent.custom_tool_use":return y(this,yp,"f").has(n.id)||(y(this,yp,"f").add(n.id),await y(this,Jt,"m",ML).call(this,n)),!1;case"user.tool_confirmation":return await y(this,Jt,"m",N7).call(this,n),!1;case"user.tool_result":return y(this,Xr,"f").add(n.tool_use_id),!1;case"user.custom_tool_result":return y(this,Xr,"f").add(n.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return y(this,fn,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),y(this,Un,"f").abort(),!0;default:return!1}},ML=async function(n){let r=n.evaluated_permission,i=r==="deny"?"deny":y(this,bp,"f").get(n.id);if(i===void 0){r===void 0||r==="allow"?await y(this,Jt,"m",LL).call(this,n,void 0):y(this,Ma,"f").has(n.id)||(y(this,fn,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:n.name,tool_use_id:n.id}),y(this,Ma,"f").set(n.id,n),y(this,ei,"f").block(n.id));return}await y(this,Jt,"m",SS).call(this,n,i)},N7=async function(n){y(this,bp,"f").set(n.tool_use_id,n.result);let r=y(this,Ma,"f").get(n.tool_use_id);r!==void 0&&await y(this,Jt,"m",SS).call(this,r,n.result)},SS=async function(n,r){let i=y(this,Ma,"f").delete(n.id);if(r==="allow"){y(this,fn,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:n.name,tool_use_id:n.id}),i||y(this,ei,"f").block(n.id);try{await y(this,Jt,"m",LL).call(this,n,"allow")}finally{y(this,ei,"f").unblock(n.id)}return}i&&y(this,ei,"f").unblock(n.id),y(this,Xr,"f").add(n.id),y(this,fn,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:n.name,tool_use_id:n.id}),y(this,Jt,"m",xS).call(this,{event:n,toolUseId:n.id,name:n.name,isError:!1,posted:!1,confirmation:"deny"})},xS=function(n){y(this,vp,"f").push(n)},LL=async function(n,r){var i,o;if(!y(this,Xr,"f").has(n.id)){y(this,fn,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:n.name,tool_use_id:n.id}),D(this,hs,(i=y(this,hs,"f"),i++,i),"f");try{let s=y(this,kS,"f").get(n.name);if(!s){y(this,fn,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:n.name,tool_use_id:n.id}),r==="allow"&&y(this,ei,"f").disarm(),y(this,Jt,"m",xS).call(this,{event:n,toolUseId:n.id,name:n.name,isError:!1,posted:!1,confirmation:r});return}let a,c,l=new AbortController,u=Da(y(this,Un,"f").signal,l),d=setTimeout(()=>l.abort(),ROe);try{let m=await T7(s,n.input,{toolUse:n,toolUseBlock:n,signal:l.signal});a=m.content,c=m.isError}finally{clearTimeout(d),u()}let p=LOe(n,c,FOe(a)),f=await y(this,Jt,"m",D7).call(this,p,n.id);y(this,Jt,"m",xS).call(this,{event:n,result:p,toolUseId:n.id,name:n.name,isError:c,posted:f,confirmation:r})}finally{D(this,hs,(o=y(this,hs,"f"),o--,o),"f"),y(this,hs,"f")===0&&y(this,fy,"f")?.call(this)}}},D7=async function(n,r){let i=y(this,Un,"f"),o=Date.now(),s,a=0;for(;;){a++,i.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[n]},y(this,Jt,"m",$S).call(this)),y(this,Xr,"f").add(r),!0}catch(c){if(s=c,gl(c))break;let l=y(this,_S,"f")-(Date.now()-o);if(l<=0)break;let u=Math.min(dS(uS(a-1,COe,NOe)),l);y(this,fn,"f").warn("tool result send failed; retrying",{tool_use_id:r,attempt:a,backoff_ms:u,error:String(c)}),await Xi(u,i.signal)}}return y(this,fn,"f").error("failed to send tool result",{tool_use_id:r,attempts:a,error:String(s)}),!1},O7=async function(){y(this,hs,"f")!==0&&(await Promise.race([new Promise(n=>D(this,fy,n,"f")),Xi(POe)]),D(this,fy,null,"f"),y(this,hs,"f")>0&&y(this,fn,"f").warn("drain timeout exceeded"))},e})()});function ES(e,t){if(!(e>=gy))throw new Y(`${t} must be at least ${gy}ms (got ${e}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`)}var hy,gy,TS=O(()=>{_t();hy=15e3,gy=5e3});function yl(e){if(e.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${e.name}" must be an object, but got ${e.inputSchema.type}`);return{type:"custom",name:e.name,input_schema:e.inputSchema,description:e.description,run:e.run,parse:t=>t,...e.close?{close:e.close}:{}}}var F7=O(()=>{});function wp(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}var jL=O(()=>{});function IS(e,t){let n=Ie.relative(e,t);return n===""||!n.startsWith(".."+Ie.sep)&&n!==".."&&!Ie.isAbsolute(n)}async function UL(e,t){for(let n of e)if(IS(await yy(Ie.resolve(n)),t))return n}function vy(e){let t=e?.code;return typeof t=="string"?t:void 0}async function yy(e){let t=[],n=e,r=0;for(;;){let i;try{i=await bl.realpath(n)}catch(o){let s;try{s=(await bl.lstat(n)).isSymbolicLink()}catch(a){let c=vy(a);if(c!=="ENOENT"&&c!=="ENOTDIR")throw a;let l=Ie.dirname(n);if(l===n)throw a;t.push(Ie.basename(n)),n=l;continue}if(!s)throw o;if(++r>UOe)throw Object.assign(new Error("too many levels of symbolic links"),{code:"ELOOP"});n=Ie.resolve(Ie.dirname(n),await bl.readlink(n));continue}return t.length?Ie.join(i,...t.reverse()):i}}async function j7(e,t,n){let r=n?.allowedRoots??[],i=await yy(Ie.resolve(e)),o;try{o=await yy(Ie.resolve(i,t))}catch(a){throw new Me(kp(a,`path ${JSON.stringify(t)}`))}if(IS(i,o)||await UL(r,o)!==void 0)return o;let s=r.length?"the session's working directory and its other permitted directories":"the session's working directory";throw new Me(`path ${JSON.stringify(t)} is outside ${s}`)}async function zL(e,t){let n=Ie.dirname(e),r=Ie.join(n,`.tmp-${process.pid}-${Ca.randomUUID()}`),i=await bl.stat(e).then(s=>s.mode&511,()=>{}),o;try{o=await bl.open(r,"wx",jOe),i!==void 0&&await o.chmod(i),await o.writeFile(t,"utf-8"),await o.sync(),await o.close(),o=void 0,await bl.rename(r,e)}catch(s){throw o&&await o.close().catch(()=>{}),await bl.unlink(r).catch(()=>{}),s}}function kp(e,t){let n=vy(e);switch(n){case"ENOENT":return`${t}: no such file or directory`;case"EACCES":case"EPERM":return`${t}: permission denied`;case"ENOTDIR":return`${t}: not a directory`;case"EISDIR":return`${t}: is a directory`;case"ELOOP":return`${t}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${t}: file name too long`;case"ENOSPC":return`${t}: no space left on device`;case"EMFILE":case"ENFILE":return`${t}: too many open files`;default:return`${t}: ${n!==void 0?`i/o error (${n})`:"i/o error"}`}}var bl,by,jOe,UOe,GL=O(()=>{Dr();gp();bl=ms.promises,by=448,jOe=384;UOe=40});async function z7(e){let{client:t,sessionId:n}=e;if(!t)return async()=>{};let r=ze(t),i=e.session;if(!i){if(n===void 0)return async()=>{};r.warn("AgentToolContext.sessionId is deprecated and costs an extra session fetch; fetch the session once and set `session` instead",{component:"agent-tool-context"}),i=await t.beta.sessions.retrieve(n)}let o=Ie.resolve(e.workdir,"skills"),s=[];for(let a of i.agent.skills)try{let c=await t.beta.skills.versions.retrieve(a.version,{skill_id:a.skill_id}),l=Ie.basename(c.name.trim());(l===""||l==="."||l==="..")&&(l=a.skill_id);let u=Ie.resolve(o,l);if(u!==o&&!u.startsWith(o+Ie.sep)){r.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:c.name});continue}let d=await t.beta.skills.versions.download(c.id,{skill_id:a.skill_id});await Ri.rm(u,{recursive:!0,force:!0}),await Ri.mkdir(u,{recursive:!0,mode:by}),s.push(u),await qL(d,u),r.info("downloaded skill",{component:"agent-tool-context",skill_id:a.skill_id,version:c.id,dest:u})}catch(c){r.warn("failed to download skill",{component:"agent-tool-context",skill_id:a.skill_id,error:String(c)})}return async()=>{for(let a of s)await Ri.rm(a,{recursive:!0,force:!0}).catch(c=>{r.warn("failed to clean up skill",{component:"agent-tool-context",dest:a,error:String(c)})})}}function GOe(e){for(let t of e){let n=t.trim();if(n&&(Ie.isAbsolute(n)||n.split(/[\\/]/).includes("..")))throw new Y(`refusing to extract unsafe archive member: ${n}`)}}function U7(e){let t=e.split(` +`);return t[t.length-1]===""&&t.pop(),t}function VOe(e,t){return/^[\x20-\x7E]+$/.test(t)&&!/[\\^#]/.test(t)&&!(e==="unzip"&&t.startsWith("-"))}function qOe(e,t,n){let r=U7(t),i=U7(n);if(r.length!==i.length)throw new Y(VL);let o=[],s=[];return r.forEach((a,c)=>{if(BOe[e].has(i[c].charAt(0))){o.push(a);return}if(!VOe(e,a))throw new Y(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(a)}`);s.push(a)}),{plain:o,special:s}}async function G7(e){for(let t of await Ri.readdir(e,{withFileTypes:!0}))if(t.isDirectory())await G7(Ie.join(e,t.name));else if(!t.isFile())throw new Y(VL)}async function BL(e,t){try{let{stdout:n}=await zOe(e,t);return n}catch(n){throw vy(n)==="ENOENT"?new Y(`skill extraction requires the \`${e}\` command, but it was not found on PATH`):n}}function WOe(e){let t,n=!1;for(let r of e){let i=r.trim().split("/").filter(s=>s!==""&&s!==".");if(i.length===0)continue;let o=i[0];if(t===void 0)t=o;else if(o!==t)return"";i.length>1&&(n=!0)}return t!==void 0&&n?t:""}async function qL(e,t){let n=Ie.join(t,`.skill-archive-${process.pid}-${Date.now()}`);if(!e.body)throw new Y("skill download response had no body");await F$.promises.pipeline(F$.Readable.fromWeb(e.body),ms.createWriteStream(n));let r=Ie.join(Ie.dirname(t),`.skill-stage-${process.pid}-${Date.now()}`),i=Ie.join(Ie.dirname(t),`.skill-exclude-${process.pid}-${Date.now()}`);try{let o=await KOe(n,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,a=s?"unzip":"tar",c=await BL(a,s?["-Z1",n]:["-tf",n]),l=await BL(a,s?["-Z","--h","--t",n]:["-tvf",n]),{plain:u,special:d}=qOe(a,c,l);GOe([...u,...d]);let p=WOe(u);await Ri.mkdir(r,{recursive:!0,mode:by}),u.length>0&&await BL(a,await HOe(a,n,r,d,i)),await G7(r);let f=p?Ie.join(r,p):r,m=await Ri.readdir(f).catch(g=>{throw vy(g)==="ENOENT"?new Y(VL):g});for(let g of m)await Ri.rename(Ie.join(f,g),Ie.join(t,g))}finally{await Ri.rm(n,{force:!0}),await Ri.rm(i,{force:!0}),await Ri.rm(r,{recursive:!0,force:!0})}}async function HOe(e,t,n,r,i){let o=r.map(s=>s.replace(/[*?[\\]/g,"\\$&"));return e==="unzip"?["-oq",t,"-d",n,...o.length>0?["-x",...o]:[]]:o.length===0?["-xf",t,"-C",n]:(await Ri.writeFile(i,o.join(` `)+` -`,{flag:"wx",mode:384}),["-xf",t,"-C",n,"-X",r])}async function FPe(e,t){let n=await Ii.open(e,"r");try{let i=Buffer.alloc(t),{bytesRead:r}=await n.read(i,0,t,0);return i.subarray(0,r)}finally{await n.close()}}var Ii,NPe,JM,PPe,YQ=j(()=>{Mr();kt();Xi();HM();Ii=fs.promises,NPe=nM.promisify(tM.execFile);JM="skill archive listing is inconsistent; refusing to extract",PPe={unzip:new Set(["-","d","?"]),tar:new Set(["-","d","C"])}});function QM(e){return e.startsWith("/")&&!e.split("/").includes("..")}function GPe(){return YM!==0}async function VPe(e){let t=[],n=e;for(;;){try{await $n.stat(n);break}catch(r){let o=r.code;if(o!=="ENOENT"&&o!=="ENOTDIR"&&o!=="ELOOP")throw r}t.push(n);let i=xe.dirname(n);if(i===n)break;n=i}for(let i of t.reverse())try{await $n.mkdir(i,{mode:tX})}catch(r){if(r.code!=="EEXIST")throw r}}async function QQ(e,t){let n=xe.relative(e,t);if(n==="")return;let i=e;for(let r of n.split(xe.sep)){i=xe.join(i,r);try{await $n.mkdir(i,{mode:tX})}catch(o){if(o.code!=="EEXIST")throw o}}}async function BPe(e,t,n){let i=n?jPe:UPe,r=xe.join(xe.dirname(e),`.fs-${Oa.randomBytes(8).toString("hex")}.tmp`),o;try{o=await $n.open(r,Mp.O_WRONLY|Mp.O_CREAT|Mp.O_EXCL|YM,i),await o.writeFile(t),await o.close(),o=void 0,await $n.rename(r,e)}catch(s){throw o&&await o.close().catch(()=>{}),await $n.unlink(r).catch(()=>{}),s}}async function nX(e,t){let n;try{n=await $n.open(t,Mp.O_RDONLY|YM|zPe)}catch(i){let r=i.code;throw r==="ELOOP"||r==="EMLINK"?new Je(Je.IS_A_SYMLINK,e):i}try{if(!(await n.stat()).isFile())throw new Je(Je.NOT_A_FILE,e)}catch(i){throw await n.close().catch(()=>{}),i}return n}async function qPe(e){let t=Oa.createHash("sha256"),n=await nX(xe.basename(e),e),i=new Uint8Array(1024*1024);try{for(;;){let{bytesRead:r}=await n.read(i,0,i.length);if(r===0)break;t.update(i.subarray(0,r))}}finally{await n.close()}return t.digest("hex")}async function XQ(e,t,n){if(!await HPe(t,n))return[];let i=[];return await rX(n,(r,o)=>{o.isFile()&&i.push([xe.relative(e,r).split(xe.sep).join("/"),r])}),i.sort(),i}async function WPe(e,t,n){let i=s=>xe.relative(e,s).split(xe.sep).join("/"),r;try{r=await $n.lstat(n,{bigint:!0})}catch(s){let a=s.code;if(a==="ENOENT"||a==="ENOTDIR")return new Set;throw s}if(r.isSymbolicLink())return new Set([i(n)]);if(!r.isDirectory())throw new Je(Je.NOT_A_DIRECTORY,t);let o=new Set;return await rX(n,(s,a)=>{a.isSymbolicLink()&&o.add(i(s))}),o}async function HPe(e,t){let n;try{n=await $n.lstat(t,{bigint:!0})}catch(i){let r=i.code;if(r==="ENOENT"||r==="ENOTDIR")return!1;throw i}if(!n.isDirectory())throw new Je(Je.NOT_A_DIRECTORY,e);return!0}async function rX(e,t){let n=[e];for(;n.length;){let i=n.pop(),r;try{r=await $n.readdir(i,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")continue;throw o}for(let o of r){let s=xe.join(i,o.name);t(s,o),o.isDirectory()&&!o.isSymbolicLink()&&n.push(s)}}}function KPe(e,t){return t.mtimeNs===e.mtimeNs&&t.ctimeNs===e.ctimeNs&&t.size===e.size}function JPe(e,t){return(e.mtimeNs>e.ctimeNs?e.mtimeNs:e.ctimeNs){Mr();xl();$n=fs.promises,Mp=fs.constants,tX=448,UPe=384,jPe=448,YM=Mp.O_NOFOLLOW??0,zPe=Mp.O_NONBLOCK??0,Je=class extends Error{constructor(t,n){super(`path ${JSON.stringify(n)} ${t}`),this.name="FileStoreError",this.reason=t,this.relPath=n}};Je.ESCAPES_ROOT="escapes the store root";Je.IS_A_SYMLINK="is a symlink";Je.NOT_A_FILE="is not a regular file";Je.NOT_A_DIRECTORY="is not a directory";Je.NOT_UTF8="is not valid utf-8";Je.MOVE_DESTINATION_EXISTS="already exists";Lp=class e{constructor(t,n,i=!1){this.hashes=new Map,this.rootPath=t,this.removedOnDispose=n,this.decoder=i?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(t,n){if(!GPe())throw new Error("FileStore requires O_NOFOLLOW support on this platform");let i=!1;try{await $n.lstat(t)}catch(r){if(r.code!=="ENOENT")throw r;i=!0}return new e(xe.resolve(t),i,n?.utf8??!1)}async createRoot(){await VPe(this.rootPath)}root(){return{path:this.rootPath,removedOnDispose:this.removedOnDispose}}async dispose(){this.removedOnDispose&&await $n.rm(this.rootPath,{recursive:!0,force:!0})}async put(t,n,i){let r=t.replace(/\\/g,"/");if(r.endsWith("/")||r.endsWith("/.")||r===""||r===".")throw new Je(Je.NOT_A_FILE,t);let o=this.resolveUnderRoot(t),s=typeof n=="string"?Ma(n):n;this.requireUtf8(t,s),await QQ(this.rootPath,xe.dirname(o)),await BPe(o,s,i?.executable??!1)}async get(t){let n=this.resolveUnderRoot(t),i;try{i=await nX(t,n)}catch(o){if(o.code==="ENOENT")return null;throw o}let r;try{let o=await i.readFile();r=new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}finally{await i.close()}return this.requireUtf8(t,r),r}async ls(t="/"){let n=this.resolveUnderRoot(t);return new Set((await XQ(this.rootPath,t,n)).map(([i])=>i))}async findSymlinks(t="/"){let n=this.resolveUnderRoot(t);return WPe(this.rootPath,t,n)}async hashtree(t="/"){let n=this.resolveUnderRoot(t),i=uS.nowNs(),r=Object.create(null);for(let[o,s]of await XQ(this.rootPath,t,n)){let a=await this.hashViaCache(o,s,i);a!==null&&(r[o]=a)}return r}async hashFile(t){let n=this.resolveUnderRoot(t),i;try{i=await $n.lstat(n,{bigint:!0})}catch(o){if(o.code==="ENOENT")return null;throw o}if(i.isSymbolicLink())throw new Je(Je.IS_A_SYMLINK,t);if(!i.isFile())throw new Je(Je.NOT_A_FILE,t);let r=xe.relative(this.rootPath,n).split(xe.sep).join("/");return this.hashViaCache(r,n,uS.nowNs())}async move(t,n){let i=this.resolveUnderRoot(t),r=this.resolveUnderRoot(n);if(i===this.rootPath||r===this.rootPath)return;if(await $n.stat(r).then(()=>!0,()=>!1))throw new Je(Je.MOVE_DESTINATION_EXISTS,n);await QQ(this.rootPath,xe.dirname(r)),await $n.rename(i,r)}async remove(t){let n=this.resolveUnderRoot(t);if(n===this.rootPath)return;let i;try{i=await $n.lstat(n,{bigint:!0})}catch(r){if(r.code==="ENOENT")return;throw r}if(i.isDirectory())await $n.rm(n,{recursive:!0,force:!0});else try{await $n.unlink(n)}catch(r){if(r.code!=="ENOENT")throw r}}resolveUnderRoot(t){let n=t.replace(/\\/g,"/").replace(/^\/+/,""),i=n.split("/").filter(r=>r!==""&&r!==".");if(xe.posix.isAbsolute(n)||i.includes(".."))throw new Je(Je.ESCAPES_ROOT,t);return i.length===0?this.rootPath:xe.join(this.rootPath,...i)}requireUtf8(t,n){if(this.decoder)try{this.decoder.decode(n)}catch{throw new Je(Je.NOT_UTF8,t)}}async hashViaCache(t,n,i){let r;try{r=await $n.lstat(n,{bigint:!0})}catch(a){if(a.code==="ENOENT")return null;throw a}if(!r.isFile())return null;let o=this.hashes.get(t),s;if(o!==void 0&&KPe(o,r))s=o.sha;else try{s=await uS.hashFile(n)}catch(a){let c=a.code;if(c==="ENOENT"||a instanceof Je||c==="ELOOP"||c==="EMLINK")return null;throw a}return JPe(r,i)&&this.hashes.set(t,{mtimeNs:r.mtimeNs,ctimeNs:r.ctimeNs,size:r.size,sha:s}),s}};Lp.isPathLegal=QM;ZPe=2000000000n,uS={hashFile:qPe,timestampTrustMarginNs:ZPe,nowNs:()=>BigInt(Date.now())*1000000n},iX=Lp,eX=Symbol.asyncDispose;eX&&Object.defineProperty(Lp.prototype,eX,{value:Lp.prototype.dispose,configurable:!0,writable:!0})});function pX(e){return Oa.createHash("sha256").update(`version ${yX} -${e}`,"utf-8").digest("hex")}function Up(e){return typeof e=="object"&&e!==null&&typeof e.code=="string"}async function iDe(e,t){if(!t){await e;return}let n,i=new Promise(r=>{n=r,t.aborted&&r()});t.addEventListener("abort",n,{once:!0});try{await Promise.race([e,i])}finally{t.removeEventListener("abort",n)}}var $t,Wa,gS,ry,hS,ct,Fp,fS,qa,fX,mS,mX,gX,XM,tL,sX,aX,eL,cX,lX,dS,pS,uX,dX,hX,Cl,yX,YPe,QPe,XPe,eDe,tDe,nDe,rDe,ys,nL,yS,bX=j(()=>{gr();Mr();kt();Xi();xl();_p();oX();cS();cS();hX=3e4,Cl=".anthropic-memory-store",yX=1;YPe=3e4,QPe=100,XPe=20,eDe=16,tDe=32,nDe=8,rDe=50,ys=class extends J{constructor(t,n){super(t),this.name="SessionMemoryError",n!==void 0&&(this.cause=n)}},nL=class{constructor(t,n,i){this.mode=t,this.cap=n,this.waiveWindow=i,this.attempted=0,this.capped=0,this.suppressed=0}takeSlot(){return this.attempted>=this.cap?(this.capped++,!1):(this.attempted++,!0)}},yS=class{constructor(t,n){$t.add(this),Wa.set(this,void 0),gS.set(this,void 0),ry.set(this,void 0),hS.set(this,void 0),ct.set(this,void 0),Fp.set(this,void 0),fS.set(this,!1),qa.set(this,[]),M(this,Wa,t,"f"),M(this,gS,n.workdir,"f"),M(this,ry,n.syncIntervalMs??Xh,"f"),aS(v(this,ry,"f"),"syncIntervalMs"),M(this,hS,n.syncDeletions??"enabled","f"),M(this,ct,qe(t),"f"),M(this,Fp,Date.now(),"f")}get roots(){return v(this,qa,"f").map(t=>t.files.root().path)}get readOnlyRoots(){return v(this,qa,"f").filter(t=>t.readOnly).map(t=>t.files.root().path)}async download(t){for(let n of t.resources){if(n.type!=="memory_store")continue;let i=v(this,$t,"m",fX).call(this,n),r;try{if(r={memoryStoreId:n.memory_store_id,files:await iX.open(i,{utf8:!0}),readOnly:n.access==="read_only",baseline:new Map,refusedShas:new Map,pendingDeletes:new Map},!r.files.root().removedOnDispose)throw new ys(`something already exists at the memory store's path: ${i} (memory_store_id=${n.memory_store_id}); it must not exist when the session starts`);try{await r.files.createRoot()}catch(o){throw Up(o)?new ys(`cannot create the memory store's folder: ${i} (memory_store_id=${n.memory_store_id}): ${o}; the worker host must make this mount path writable`,o):o}await v(this,$t,"m",tL).call(this,r),v(this,ct,"f").info("downloaded memories",{count:r.baseline.size,memory_store_id:r.memoryStoreId,dest:r.files.root().path}),v(this,qa,"f").push(r)}catch(o){throw r&&await r.files.dispose().catch(()=>{}),o instanceof ys?o:new ys(`failed to download memory store memory_store_id=${n.memory_store_id}: ${o}`,o)}}M(this,Fp,Date.now(),"f")}async finish(){if(v(this,fS,"f"))throw new J("finish() was already called: it is the session's last sync and runs once");M(this,fS,!0,"f"),await this.syncAll(!0)}async syncAll(t){await Promise.all(v(this,qa,"f").map(n=>v(this,$t,"m",mX).call(this,n,t))),M(this,Fp,Date.now(),"f")}async syncIfDue(){Date.now()-v(this,Fp,"f")v(this,$t,"m",gX).call(this,n,t)))}async dispose(){for(let t of v(this,qa,"f")){let n=t.files.root();try{let i=await v(this,$t,"m",mS).call(this,t);if(!i.markerOk&&Object.keys(i.files).length>0){v(this,ct,"f").warn(`${i.distrustReason}; leaving the memory store folder on disk`,{root:n.path,memory_store_id:t.memoryStoreId});continue}await t.files.dispose()}catch(i){if(!(i instanceof Je)&&!Up(i))throw i;v(this,ct,"f").warn("failed to remove the memory store folder",{root:t.files.root().path,memory_store_id:t.memoryStoreId,error:String(i)});continue}n.removedOnDispose&&v(this,ct,"f").info("removed memory store dir",{dest:n.path,memory_store_id:t.memoryStoreId})}}};Wa=new WeakMap,gS=new WeakMap,ry=new WeakMap,hS=new WeakMap,ct=new WeakMap,Fp=new WeakMap,fS=new WeakMap,qa=new WeakMap,$t=new WeakSet,fX=function(t){if(t.mount_path){if(!QM(t.mount_path))throw new ys(`memory store mount_path is not a clean absolute path: ${JSON.stringify(t.mount_path)} (memory_store_id=${t.memory_store_id})`);return t.mount_path}return xe.join(v(this,gS,"f"),"memory",t.name||t.memory_store_id)},mS=async function(t){let n=await t.files.hashtree(),i=n[Cl];return delete n[Cl],i===pX(t.memoryStoreId)?{files:n,markerOk:!0,distrustReason:null}:{files:n,markerOk:!1,distrustReason:i!==void 0?"the marker file does not match this store":"the marker file is gone"}},mX=async function(t,n){try{let i=await v(this,$t,"m",mS).call(this,t),r=i.files;if(!i.markerOk){if(Object.keys(r).length>0){v(this,ct,"f").warn(`${i.distrustReason}; leaving the memory store folder as found and not syncing`,{root:t.files.root().path,memory_store_id:t.memoryStoreId});return}await v(this,$t,"m",XM).call(this,t,"the folder or its marker is gone");return}if(Object.keys(r).length===0&&t.baseline.size>1){await v(this,$t,"m",XM).call(this,t,"every memory file is gone at once");return}let o=new Map;for await(let[u,d]of v(this,$t,"m",dS).call(this,t.memoryStoreId))o.set(u,d);let s=new nL(v(this,hS,"f"),Math.max(nDe,Math.min(rDe,Math.floor(t.baseline.size/4))),n),a=[],c=new Map,l=[...new Set([...o.keys(),...Object.keys(r),...t.baseline.keys()])].sort();for(let u of l){let d=o.get(u),p=r[u],f=t.baseline.get(u),m;p===void 0&&f!==void 0&&d!==void 0&&d.content_sha256===f&&!t.readOnly?m=await v(this,$t,"m",uX).call(this,t,u,d,f,s):m=await v(this,$t,"m",sX).call(this,t,u,d,p,a),m!==void 0&&c.set(u,m)}t.baseline=c,await v(this,$t,"m",cX).call(this,t,a),s.suppressed>0&&v(this,ct,"f").debug("remote deletes are disabled; locally deleted memories stay on the server",{count:s.suppressed,memory_store_id:t.memoryStoreId}),s.capped>0&&v(this,ct,"f").warn(`delete cap reached: ${s.mode==="log_only"?"would send":"sent"} ${s.attempted} deletes, held ${s.capped} for later syncs`,{memory_store_id:t.memoryStoreId})}catch(i){v(this,ct,"f").warn("memory sync failed",{memory_store_id:t.memoryStoreId,error:String(i)})}},gX=async function(t,n){let i=new Map,r=new Set,o=async()=>{if(t.readOnly)return;let s=await v(this,$t,"m",mS).call(this,t);if(!s.markerOk){v(this,ct,"f").warn(`${s.distrustReason}; not uploading anything from the memory store folder`,{root:t.files.root().path,memory_store_id:t.memoryStoreId});return}for(let[l,u]of Object.entries(s.files))u!==t.baseline.get(l)&&t.refusedShas.get(l)!==u&&(i.set(l,u),r.add(l));if(i.size===0||n?.aborted)return;let a=new Map;for await(let[l,u]of v(this,$t,"m",dS).call(this,t.memoryStoreId)){if(n?.aborted)return;a.set(l,u)}let c=[];for(let l of[...i.keys()].sort()){let u=i.get(l),d=t.baseline.get(l),p=a.get(l);if(p!==void 0&&p.content_sha256===u){t.baseline.set(l,p.content_sha256),r.delete(l);continue}if(p!==void 0&&p.content_sha256!==d){v(this,ct,"f").warn("memory changed both locally and remotely; the flush leaves the remote version",{path:l,memory_store_id:t.memoryStoreId}),r.delete(l);continue}c.push([l,u,p])}await v(this,$t,"m",lX).call(this,t,c,r,n)};try{await iDe(o(),n),n?.aborted&&r.size>0&&v(this,ct,"f").warn(`memory flush cut off part-way; ${r.size} of ${i.size} changed files had not finished uploading`,{memory_store_id:t.memoryStoreId})}catch(s){v(this,ct,"f").warn("memory flush failed",{memory_store_id:t.memoryStoreId,error:String(s)})}},XM=async function(t,n){v(this,ct,"f").warn(`${n}; re-downloading the memory store folder instead of syncing`,{root:t.files.root().path,memory_store_id:t.memoryStoreId}),await t.files.createRoot(),await v(this,$t,"m",tL).call(this,t)},tL=async function(t){t.baseline=new Map,t.pendingDeletes.clear(),await t.files.put(Cl,`version ${yX} -${t.memoryStoreId}`);for await(let[n,i]of v(this,$t,"m",dS).call(this,t.memoryStoreId,"full"))await v(this,$t,"m",eL).call(this,t,n,i.content??"")&&t.baseline.set(n,i.content_sha256)},sX=async function(t,n,i,r,o){let s=t.baseline.get(n);if(r!==void 0&&t.pendingDeletes.delete(n),!i){if(r===void 0){t.pendingDeletes.delete(n);return}if(s!==void 0){if(r===s){let d=await v(this,$t,"m",aX).call(this,t,n,s);if(d===void 0)return;if(d===s)return s;r=d}t.readOnly?v(this,ct,"f").warn("memory deleted remotely but edited locally; keeping the file, which a read-only store cannot push",{path:n,memory_store_id:t.memoryStoreId}):t.refusedShas.get(n)!==r&&v(this,ct,"f").info("memory deleted remotely but edited locally; re-creating it from the file",{path:n,memory_store_id:t.memoryStoreId})}return t.readOnly||t.refusedShas.get(n)===r?void 0:await v(this,$t,"m",pS).call(this,t,n,r,void 0)}let a=i.content_sha256,c=a!==s,l=r!==void 0&&r!==s&&r!==a,u=!t.readOnly&&l;return r===void 0&&s!==void 0?(c&&(v(this,ct,"f").warn("memory deleted locally but changed remotely; restoring the remote version",{path:n,memory_store_id:t.memoryStoreId}),t.pendingDeletes.delete(n),o.push([n,i])),s):c?r===a?a:(l&&v(this,ct,"f").warn("memory changed both locally and remotely; keeping the remote version",{path:n,memory_store_id:t.memoryStoreId}),o.push([n,i]),s):u?t.refusedShas.get(n)===r?a:await v(this,$t,"m",pS).call(this,t,n,r,i)??a:a},aX=async function(t,n,i){let r;try{r=await t.files.hashFile(n)}catch(o){if(!(o instanceof Je)&&!Up(o))throw o;return i}if(r!==null){if(r!==i)return r;try{await t.files.remove(n)}catch(o){if(!(o instanceof Je)&&!Up(o))throw o;return v(this,ct,"f").warn("failed to remove memory deleted remotely",{path:n,memory_store_id:t.memoryStoreId,error:String(o)}),i}}},eL=async function(t,n,i){try{await t.files.put(n,i)}catch(r){if(!(r instanceof Je)&&!Up(r))throw r;return v(this,ct,"f").warn("failed to write memory",{path:n,memory_store_id:t.memoryStoreId,error:String(r)}),!1}return!0},cX=async function(t,n){if(n.length===0)return;let i=async(s,a)=>{let c;try{c=await v(this,Wa,"f").beta.memoryStores.memories.retrieve(a.id,{memory_store_id:t.memoryStoreId,view:"full"})}catch(l){if(An(l,404))return;v(this,ct,"f").warn("failed to fetch memory content",{path:s,memory_store_id:t.memoryStoreId,error:String(l)});return}await v(this,$t,"m",eL).call(this,t,s,c.content??"")&&t.baseline.set(s,c.content_sha256)},r=n[Symbol.iterator](),o=async()=>{for(let[s,a]of r)await i(s,a)};await Promise.all(Array.from({length:Math.min(eDe,n.length)},o))},lX=async function(t,n,i,r){let o=n[Symbol.iterator](),s=async()=>{for(let[a,c,l]of o){if(r?.aborted)return;let u=await v(this,$t,"m",pS).call(this,t,a,c,l);i.delete(a),u!==void 0&&t.baseline.set(a,u)}};await Promise.all(Array.from({length:Math.min(tDe,n.length)},s))},dS=async function*(t,n="basic"){let i=n==="basic"?QPe:XPe;for await(let r of v(this,Wa,"f").beta.memoryStores.memories.list(t,{view:n,limit:i})){if(r.type!=="memory")continue;let o=r.path.replace(/^\/+/,"");if(o===Cl){v(this,ct,"f").warn("the server listed the reserved marker path; skipping",{path:r.path,memory_store_id:t});continue}yield[o,r]}},pS=async function e(t,n,i,r){try{let o=await t.files.get(n);if(o===null)return;let s=Sl(o),a=r?await v(this,Wa,"f").beta.memoryStores.memories.update(r.id,{memory_store_id:t.memoryStoreId,content:s,precondition:{type:"content_sha256",content_sha256:r.content_sha256}}):await v(this,Wa,"f").beta.memoryStores.memories.create(t.memoryStoreId,{path:"/"+n,content:s});return t.refusedShas.delete(n),a.content_sha256}catch(o){if(r&&An(o,404))return await v(this,$t,"m",e).call(this,t,n,i,void 0);let s=o instanceof Je||An(o,400)||An(o,413);r&&An(o,409)?v(this,ct,"f").warn("memory changed both locally and remotely; the upload was refused and the local edit loses",{path:n,memory_store_id:t.memoryStoreId}):s&&i!==void 0?(t.refusedShas.set(n,i),v(this,ct,"f").warn("the server rejected this memory file, so it stays un-synced until its content changes",{path:n,memory_store_id:t.memoryStoreId,rejection:String(o)})):v(this,ct,"f").warn("failed to upload memory",{path:n,memory_store_id:t.memoryStoreId,error:String(o)});return}},uX=async function(t,n,i,r,o){if(o.mode==="disabled")return o.suppressed++,r;let s=t.pendingDeletes.get(n);if(s===void 0&&(s=Date.now(),t.pendingDeletes.set(n,s)),!o.waiveWindow&&Date.now()-s_S,BashTimeoutError:()=>$S,DEFAULT_MEMORY_SYNC_INTERVAL_MS:()=>Xh,MARKER_PATH:()=>Cl,MEMORY_FLUSH_TIMEOUT_MS:()=>hX,MIN_MEMORY_SYNC_INTERVAL_MS:()=>Qh,SessionMemoryError:()=>ys,SessionMemoryStores:()=>yS,betaAgentToolset20260401:()=>dDe,betaBashTool:()=>AX,betaEditTool:()=>CX,betaGlobTool:()=>PX,betaGrepTool:()=>DX,betaReadTool:()=>RX,betaWriteTool:()=>NX,extractSkillArchive:()=>ZM,resolvePath:()=>zp,setupSkills:()=>JQ});function TX(e){return e===void 0?oDe:e}function Ll(e){if(e!==void 0)throw new J("The `unrestrictedPaths` option you passed to the agent toolset (AgentToolContext) is no longer supported. The toolset's file tools (read, write, edit, glob, grep) are now always confined to the working directory plus the directories listed in `allowedRoots`. Remove `unrestrictedPaths` from your context; to let the file tools reach any other directory, add it to `allowedRoots`.")}function dDe(e){return[AX(e),RX(e),NX(e),CX(e),PX(e),DX(e)]}async function zp(e,t){return Ll(e.unrestrictedPaths),HQ(e.workdir,t,{allowedRoots:e.allowedRoots??[]})}function IX(e,t){return qM(e.readOnlyRoots??[],t)}function pDe(){let e={};for(let[t,n]of Object.entries(process.env))t.startsWith("ANTHROPIC_")||(e[t]=n);return e}function AX(e){Ll(e.unrestrictedPaths);let t,n=Promise.resolve();return Rl({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:i,restart:r,timeout_ms:o},s)=>{let a=n,c=Dp();n=c.promise;try{await a}catch{}try{if(r&&(t?.close(),t=void 0),!i){if(r)return"bash session restarted";throw new Ae("bash: command is required")}t??(t=new _S(e.workdir,e.env));try{let{output:l,exitCode:u}=await t.exec(i,{timeoutMs:o??EX,signal:s?.signal});if(u!==0)throw new Ae(l||`exit ${u}`);return l}catch(l){throw l instanceof Ae?l:(t.close(),t=void 0,new Ae(`bash: ${l instanceof Error?l.message:String(l)}`))}}finally{c.resolve()}},close:()=>{t?.close(),t=void 0}})}function RX(e){return Ll(e.unrestrictedPaths),Rl({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:t,view_range:n})=>{if(!t)throw new Ae("read: file_path is required");let i=await zp(e,t);if(n?.length&&n.length!==2)throw new Ae("read: view_range must be [start_line, end_line]");let r;try{let u=await Rn.stat(i);if(!u.isFile())throw new Ae(`read: ${t} is not a regular file`);let d=TX(e.maxFileBytes);if(d!==null&&u.size>d){if(!n?.length)throw new Ae(`read: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. Use the view_range parameter to read specific line ranges, e.g. view_range: [1, 500].`);let[p,f]=n;return await fDe(i,t,p,f,d)}r=await Rn.readFile(i,"utf8")}catch(u){throw u instanceof Ae?u:new Ae(`read: ${Op(u,t)}`)}if(!n?.length)return r;let[o,s]=n,a=r.split(` +`,{flag:"wx",mode:384}),["-xf",t,"-C",n,"-X",i])}async function KOe(e,t){let n=await Ri.open(e,"r");try{let r=Buffer.alloc(t),{bytesRead:i}=await n.read(r,0,t,0);return r.subarray(0,i)}finally{await n.close()}}var Ri,zOe,VL,BOe,B7=O(()=>{Dr();_t();xi();GL();Ri=ms.promises,zOe=XM.promisify(QM.execFile);VL="skill archive listing is inconsistent; refusing to extract",BOe={unzip:new Set(["-","d","?"]),tar:new Set(["-","d","C"])}});function KL(e){return e.startsWith("/")&&!e.split("/").includes("..")}function QOe(){return HL!==0}async function XOe(e){let t=[],n=e;for(;;){try{await kn.stat(n);break}catch(i){let o=i.code;if(o!=="ENOENT"&&o!=="ENOTDIR"&&o!=="ELOOP")throw i}t.push(n);let r=Ie.dirname(n);if(r===n)break;n=r}for(let r of t.reverse())try{await kn.mkdir(r,{mode:H7})}catch(i){if(i.code!=="EEXIST")throw i}}async function V7(e,t){let n=Ie.relative(e,t);if(n==="")return;let r=e;for(let i of n.split(Ie.sep)){r=Ie.join(r,i);try{await kn.mkdir(r,{mode:H7})}catch(o){if(o.code!=="EEXIST")throw o}}}async function eMe(e,t,n){let r=n?ZOe:JOe,i=Ie.join(Ie.dirname(e),`.fs-${Ca.randomBytes(8).toString("hex")}.tmp`),o;try{o=await kn.open(i,_p.O_WRONLY|_p.O_CREAT|_p.O_EXCL|HL,r),await o.writeFile(t),await o.close(),o=void 0,await kn.rename(i,e)}catch(s){throw o&&await o.close().catch(()=>{}),await kn.unlink(i).catch(()=>{}),s}}async function K7(e,t){let n;try{n=await kn.open(t,_p.O_RDONLY|HL|YOe)}catch(r){let i=r.code;throw i==="ELOOP"||i==="EMLINK"?new bt(bt.IS_A_SYMLINK,e):r}try{if(!(await n.stat()).isFile())throw new bt(bt.NOT_A_FILE,e)}catch(r){throw await n.close().catch(()=>{}),r}return n}async function tMe(e){let t=Ca.createHash("sha256"),n=await K7(Ie.basename(e),e),r=new Uint8Array(1024*1024);try{for(;;){let{bytesRead:i}=await n.read(r,0,r.length);if(i===0)break;t.update(r.subarray(0,i))}}finally{await n.close()}return t.digest("hex")}async function q7(e,t,n){if(!await rMe(t,n))return[];let r=[];return await J7(n,(i,o)=>{o.isFile()&&r.push([Ie.relative(e,i).split(Ie.sep).join("/"),i])}),r.sort(),r}async function nMe(e,t,n){let r=s=>Ie.relative(e,s).split(Ie.sep).join("/"),i;try{i=await kn.lstat(n,{bigint:!0})}catch(s){let a=s.code;if(a==="ENOENT"||a==="ENOTDIR")return new Set;throw s}if(i.isSymbolicLink())return new Set([r(n)]);if(!i.isDirectory())throw new bt(bt.NOT_A_DIRECTORY,t);let o=new Set;return await J7(n,(s,a)=>{a.isSymbolicLink()&&o.add(r(s))}),o}async function rMe(e,t){let n;try{n=await kn.lstat(t,{bigint:!0})}catch(r){let i=r.code;if(i==="ENOENT"||i==="ENOTDIR")return!1;throw r}if(!n.isDirectory())throw new bt(bt.NOT_A_DIRECTORY,e);return!0}async function J7(e,t){let n=[e];for(;n.length;){let r=n.pop(),i;try{i=await kn.readdir(r,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")continue;throw o}for(let o of i){let s=Ie.join(r,o.name);t(s,o),o.isDirectory()&&!o.isSymbolicLink()&&n.push(s)}}}function iMe(e,t){return t.mtimeNs===e.mtimeNs&&t.ctimeNs===e.ctimeNs&&t.size===e.size}function oMe(e,t){return(e.mtimeNs>e.ctimeNs?e.mtimeNs:e.ctimeNs){Dr();Zd();kn=ms.promises,_p=ms.constants,H7=448,JOe=384,ZOe=448,HL=_p.O_NOFOLLOW??0,YOe=_p.O_NONBLOCK??0,bt=(()=>{class e extends Error{constructor(n,r){super(`path ${JSON.stringify(r)} ${n}`),this.name="FileStoreError",this.reason=n,this.relPath=r}}return e.ESCAPES_ROOT="escapes the store root",e.IS_A_SYMLINK="is a symlink",e.NOT_A_FILE="is not a regular file",e.NOT_A_DIRECTORY="is not a directory",e.NOT_UTF8="is not valid utf-8",e.MOVE_DESTINATION_EXISTS="already exists",e})();WL=(()=>{class e{constructor(n,r,i=!1){this.hashes=new Map,this.rootPath=n,this.removedOnDispose=r,this.decoder=i?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(n,r){if(!QOe())throw new Error("FileStore requires O_NOFOLLOW support on this platform");let i=!1;try{await kn.lstat(n)}catch(o){if(o.code!=="ENOENT")throw o;i=!0}return new e(Ie.resolve(n),i,r?.utf8??!1)}async createRoot(){await XOe(this.rootPath)}root(){return{path:this.rootPath,removedOnDispose:this.removedOnDispose}}async dispose(){this.removedOnDispose&&await kn.rm(this.rootPath,{recursive:!0,force:!0})}async put(n,r,i){let o=n.replace(/\\/g,"/");if(o.endsWith("/")||o.endsWith("/.")||o===""||o===".")throw new bt(bt.NOT_A_FILE,n);let s=this.resolveUnderRoot(n),a=typeof r=="string"?Jd(r):r;this.requireUtf8(n,a),await V7(this.rootPath,Ie.dirname(s)),await eMe(s,a,i?.executable??!1)}async get(n){let r=this.resolveUnderRoot(n),i;try{i=await K7(n,r)}catch(s){if(s.code==="ENOENT")return null;throw s}let o;try{let s=await i.readFile();o=new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}finally{await i.close()}return this.requireUtf8(n,o),o}async ls(n="/"){let r=this.resolveUnderRoot(n);return new Set((await q7(this.rootPath,n,r)).map(([i])=>i))}async findSymlinks(n="/"){let r=this.resolveUnderRoot(n);return nMe(this.rootPath,n,r)}async hashtree(n="/"){let r=this.resolveUnderRoot(n),i=AS.nowNs(),o=Object.create(null);for(let[s,a]of await q7(this.rootPath,n,r)){let c=await this.hashViaCache(s,a,i);c!==null&&(o[s]=c)}return o}async hashFile(n){let r=this.resolveUnderRoot(n),i;try{i=await kn.lstat(r,{bigint:!0})}catch(s){if(s.code==="ENOENT")return null;throw s}if(i.isSymbolicLink())throw new bt(bt.IS_A_SYMLINK,n);if(!i.isFile())throw new bt(bt.NOT_A_FILE,n);let o=Ie.relative(this.rootPath,r).split(Ie.sep).join("/");return this.hashViaCache(o,r,AS.nowNs())}async move(n,r){let i=this.resolveUnderRoot(n),o=this.resolveUnderRoot(r);if(i===this.rootPath||o===this.rootPath)return;if(await kn.stat(o).then(()=>!0,()=>!1))throw new bt(bt.MOVE_DESTINATION_EXISTS,r);await V7(this.rootPath,Ie.dirname(o)),await kn.rename(i,o)}async remove(n){let r=this.resolveUnderRoot(n);if(r===this.rootPath)return;let i;try{i=await kn.lstat(r,{bigint:!0})}catch(o){if(o.code==="ENOENT")return;throw o}if(i.isDirectory())await kn.rm(r,{recursive:!0,force:!0});else try{await kn.unlink(r)}catch(o){if(o.code!=="ENOENT")throw o}}resolveUnderRoot(n){let r=n.replace(/\\/g,"/").replace(/^\/+/,""),i=r.split("/").filter(o=>o!==""&&o!==".");if(Ie.posix.isAbsolute(r)||i.includes(".."))throw new bt(bt.ESCAPES_ROOT,n);return i.length===0?this.rootPath:Ie.join(this.rootPath,...i)}requireUtf8(n,r){if(this.decoder)try{this.decoder.decode(r)}catch{throw new bt(bt.NOT_UTF8,n)}}async hashViaCache(n,r,i){let o;try{o=await kn.lstat(r,{bigint:!0})}catch(c){if(c.code==="ENOENT")return null;throw c}if(!o.isFile())return null;let s=this.hashes.get(n),a;if(s!==void 0&&iMe(s,o))a=s.sha;else try{a=await AS.hashFile(r)}catch(c){let l=c.code;if(l==="ENOENT"||c instanceof bt||l==="ELOOP"||l==="EMLINK")return null;throw c}return oMe(o,i)&&this.hashes.set(n,{mtimeNs:o.mtimeNs,ctimeNs:o.ctimeNs,size:o.size,sha:a}),a}}return e.isPathLegal=KL,e})();sMe=2000000000n,AS={hashFile:tMe,timestampTrustMarginNs:sMe,nowNs:()=>BigInt(Date.now())*1000000n},Z7=WL,W7=Symbol.asyncDispose;W7&&Object.defineProperty(WL.prototype,W7,{value:WL.prototype.dispose,configurable:!0,writable:!0})});function aee(e){return Ca.createHash("sha256").update(`version ${lee} +${e}`,"utf-8").digest("hex")}function Sp(e){return typeof e=="object"&&e!==null&&typeof e.code=="string"}async function mMe(e,t){if(!t){await e;return}let n,r=new Promise(i=>{n=i,t.aborted&&i()});t.addEventListener("abort",n,{once:!0});try{await Promise.race([e,r])}finally{t.removeEventListener("abort",n)}}var $t,La,RS,wy,PS,at,$p,CS,Fa,Q7,NS,X7,eee,JL,ZL,tee,nee,YL,ree,iee,DS,OS,oee,see,cee,vl,lee,aMe,cMe,lMe,uMe,dMe,pMe,fMe,ys,QL,uee,dee=O(()=>{er();Dr();_t();xi();Zd();sy();Y7();TS();TS();cee=3e4,vl=".anthropic-memory-store",lee=1;aMe=3e4,cMe=100,lMe=20,uMe=16,dMe=32,pMe=8,fMe=50,ys=class extends Y{constructor(t,n){super(t),this.name="SessionMemoryError",n!==void 0&&(this.cause=n)}},QL=class{constructor(t,n,r){this.mode=t,this.cap=n,this.waiveWindow=r,this.attempted=0,this.capped=0,this.suppressed=0}takeSlot(){return this.attempted>=this.cap?(this.capped++,!1):(this.attempted++,!0)}},uee=(()=>{class e{constructor(n,r){$t.add(this),La.set(this,void 0),RS.set(this,void 0),wy.set(this,void 0),PS.set(this,void 0),at.set(this,void 0),$p.set(this,void 0),CS.set(this,!1),Fa.set(this,[]),D(this,La,n,"f"),D(this,RS,r.workdir,"f"),D(this,wy,r.syncIntervalMs??hy,"f"),ES(y(this,wy,"f"),"syncIntervalMs"),D(this,PS,r.syncDeletions??"enabled","f"),D(this,at,ze(n),"f"),D(this,$p,Date.now(),"f")}get roots(){return y(this,Fa,"f").map(n=>n.files.root().path)}get readOnlyRoots(){return y(this,Fa,"f").filter(n=>n.readOnly).map(n=>n.files.root().path)}async download(n){for(let r of n.resources){if(r.type!=="memory_store")continue;let i=y(this,$t,"m",Q7).call(this,r),o;try{if(o={memoryStoreId:r.memory_store_id,files:await Z7.open(i,{utf8:!0}),readOnly:r.access==="read_only",baseline:new Map,refusedShas:new Map,pendingDeletes:new Map},!o.files.root().removedOnDispose)throw new ys(`something already exists at the memory store's path: ${i} (memory_store_id=${r.memory_store_id}); it must not exist when the session starts`);try{await o.files.createRoot()}catch(s){throw Sp(s)?new ys(`cannot create the memory store's folder: ${i} (memory_store_id=${r.memory_store_id}): ${s}; the worker host must make this mount path writable`,s):s}await y(this,$t,"m",ZL).call(this,o),y(this,at,"f").info("downloaded memories",{count:o.baseline.size,memory_store_id:o.memoryStoreId,dest:o.files.root().path}),y(this,Fa,"f").push(o)}catch(s){throw o&&await o.files.dispose().catch(()=>{}),s instanceof ys?s:new ys(`failed to download memory store memory_store_id=${r.memory_store_id}: ${s}`,s)}}D(this,$p,Date.now(),"f")}async finish(){if(y(this,CS,"f"))throw new Y("finish() was already called: it is the session's last sync and runs once");D(this,CS,!0,"f"),await this.syncAll(!0)}async syncAll(n){await Promise.all(y(this,Fa,"f").map(r=>y(this,$t,"m",X7).call(this,r,n))),D(this,$p,Date.now(),"f")}async syncIfDue(){Date.now()-y(this,$p,"f")y(this,$t,"m",eee).call(this,r,n)))}async dispose(){for(let n of y(this,Fa,"f")){let r=n.files.root();try{let i=await y(this,$t,"m",NS).call(this,n);if(!i.markerOk&&Object.keys(i.files).length>0){y(this,at,"f").warn(`${i.distrustReason}; leaving the memory store folder on disk`,{root:r.path,memory_store_id:n.memoryStoreId});continue}await n.files.dispose()}catch(i){if(!(i instanceof bt)&&!Sp(i))throw i;y(this,at,"f").warn("failed to remove the memory store folder",{root:n.files.root().path,memory_store_id:n.memoryStoreId,error:String(i)});continue}r.removedOnDispose&&y(this,at,"f").info("removed memory store dir",{dest:r.path,memory_store_id:n.memoryStoreId})}}}return La=new WeakMap,RS=new WeakMap,wy=new WeakMap,PS=new WeakMap,at=new WeakMap,$p=new WeakMap,CS=new WeakMap,Fa=new WeakMap,$t=new WeakSet,Q7=function(n){if(n.mount_path){if(!KL(n.mount_path))throw new ys(`memory store mount_path is not a clean absolute path: ${JSON.stringify(n.mount_path)} (memory_store_id=${n.memory_store_id})`);return n.mount_path}return Ie.join(y(this,RS,"f"),"memory",n.name||n.memory_store_id)},NS=async function(n){let r=await n.files.hashtree(),i=r[vl];return delete r[vl],i===aee(n.memoryStoreId)?{files:r,markerOk:!0,distrustReason:null}:{files:r,markerOk:!1,distrustReason:i!==void 0?"the marker file does not match this store":"the marker file is gone"}},X7=async function(n,r){try{let i=await y(this,$t,"m",NS).call(this,n),o=i.files;if(!i.markerOk){if(Object.keys(o).length>0){y(this,at,"f").warn(`${i.distrustReason}; leaving the memory store folder as found and not syncing`,{root:n.files.root().path,memory_store_id:n.memoryStoreId});return}await y(this,$t,"m",JL).call(this,n,"the folder or its marker is gone");return}if(Object.keys(o).length===0&&n.baseline.size>1){await y(this,$t,"m",JL).call(this,n,"every memory file is gone at once");return}let s=new Map;for await(let[d,p]of y(this,$t,"m",DS).call(this,n.memoryStoreId))s.set(d,p);let a=new QL(y(this,PS,"f"),Math.max(pMe,Math.min(fMe,Math.floor(n.baseline.size/4))),r),c=[],l=new Map,u=[...new Set([...s.keys(),...Object.keys(o),...n.baseline.keys()])].sort();for(let d of u){let p=s.get(d),f=o[d],m=n.baseline.get(d),g;f===void 0&&m!==void 0&&p!==void 0&&p.content_sha256===m&&!n.readOnly?g=await y(this,$t,"m",oee).call(this,n,d,p,m,a):g=await y(this,$t,"m",tee).call(this,n,d,p,f,c),g!==void 0&&l.set(d,g)}n.baseline=l,await y(this,$t,"m",ree).call(this,n,c),a.suppressed>0&&y(this,at,"f").debug("remote deletes are disabled; locally deleted memories stay on the server",{count:a.suppressed,memory_store_id:n.memoryStoreId}),a.capped>0&&y(this,at,"f").warn(`delete cap reached: ${a.mode==="log_only"?"would send":"sent"} ${a.attempted} deletes, held ${a.capped} for later syncs`,{memory_store_id:n.memoryStoreId})}catch(i){y(this,at,"f").warn("memory sync failed",{memory_store_id:n.memoryStoreId,error:String(i)})}},eee=async function(n,r){let i=new Map,o=new Set,s=async()=>{if(n.readOnly)return;let a=await y(this,$t,"m",NS).call(this,n);if(!a.markerOk){y(this,at,"f").warn(`${a.distrustReason}; not uploading anything from the memory store folder`,{root:n.files.root().path,memory_store_id:n.memoryStoreId});return}for(let[u,d]of Object.entries(a.files))d!==n.baseline.get(u)&&n.refusedShas.get(u)!==d&&(i.set(u,d),o.add(u));if(i.size===0||r?.aborted)return;let c=new Map;for await(let[u,d]of y(this,$t,"m",DS).call(this,n.memoryStoreId)){if(r?.aborted)return;c.set(u,d)}let l=[];for(let u of[...i.keys()].sort()){let d=i.get(u),p=n.baseline.get(u),f=c.get(u);if(f!==void 0&&f.content_sha256===d){n.baseline.set(u,f.content_sha256),o.delete(u);continue}if(f!==void 0&&f.content_sha256!==p){y(this,at,"f").warn("memory changed both locally and remotely; the flush leaves the remote version",{path:u,memory_store_id:n.memoryStoreId}),o.delete(u);continue}l.push([u,d,f])}await y(this,$t,"m",iee).call(this,n,l,o,r)};try{await mMe(s(),r),r?.aborted&&o.size>0&&y(this,at,"f").warn(`memory flush cut off part-way; ${o.size} of ${i.size} changed files had not finished uploading`,{memory_store_id:n.memoryStoreId})}catch(a){y(this,at,"f").warn("memory flush failed",{memory_store_id:n.memoryStoreId,error:String(a)})}},JL=async function(n,r){y(this,at,"f").warn(`${r}; re-downloading the memory store folder instead of syncing`,{root:n.files.root().path,memory_store_id:n.memoryStoreId}),await n.files.createRoot(),await y(this,$t,"m",ZL).call(this,n)},ZL=async function(n){n.baseline=new Map,n.pendingDeletes.clear(),await n.files.put(vl,`version ${lee} +${n.memoryStoreId}`);for await(let[r,i]of y(this,$t,"m",DS).call(this,n.memoryStoreId,"full"))await y(this,$t,"m",YL).call(this,n,r,i.content??"")&&n.baseline.set(r,i.content_sha256)},tee=async function(n,r,i,o,s){let a=n.baseline.get(r);if(o!==void 0&&n.pendingDeletes.delete(r),!i){if(o===void 0){n.pendingDeletes.delete(r);return}if(a!==void 0){if(o===a){let p=await y(this,$t,"m",nee).call(this,n,r,a);if(p===void 0)return;if(p===a)return a;o=p}n.readOnly?y(this,at,"f").warn("memory deleted remotely but edited locally; keeping the file, which a read-only store cannot push",{path:r,memory_store_id:n.memoryStoreId}):n.refusedShas.get(r)!==o&&y(this,at,"f").info("memory deleted remotely but edited locally; re-creating it from the file",{path:r,memory_store_id:n.memoryStoreId})}return n.readOnly||n.refusedShas.get(r)===o?void 0:await y(this,$t,"m",OS).call(this,n,r,o,void 0)}let c=i.content_sha256,l=c!==a,u=o!==void 0&&o!==a&&o!==c,d=!n.readOnly&&u;return o===void 0&&a!==void 0?(l&&(y(this,at,"f").warn("memory deleted locally but changed remotely; restoring the remote version",{path:r,memory_store_id:n.memoryStoreId}),n.pendingDeletes.delete(r),s.push([r,i])),a):l?o===c?c:(u&&y(this,at,"f").warn("memory changed both locally and remotely; keeping the remote version",{path:r,memory_store_id:n.memoryStoreId}),s.push([r,i]),a):d?n.refusedShas.get(r)===o?c:await y(this,$t,"m",OS).call(this,n,r,o,i)??c:c},nee=async function(n,r,i){let o;try{o=await n.files.hashFile(r)}catch(s){if(!(s instanceof bt)&&!Sp(s))throw s;return i}if(o!==null){if(o!==i)return o;try{await n.files.remove(r)}catch(s){if(!(s instanceof bt)&&!Sp(s))throw s;return y(this,at,"f").warn("failed to remove memory deleted remotely",{path:r,memory_store_id:n.memoryStoreId,error:String(s)}),i}}},YL=async function(n,r,i){try{await n.files.put(r,i)}catch(o){if(!(o instanceof bt)&&!Sp(o))throw o;return y(this,at,"f").warn("failed to write memory",{path:r,memory_store_id:n.memoryStoreId,error:String(o)}),!1}return!0},ree=async function(n,r){if(r.length===0)return;let i=async(a,c)=>{let l;try{l=await y(this,La,"f").beta.memoryStores.memories.retrieve(c.id,{memory_store_id:n.memoryStoreId,view:"full"})}catch(u){if(jn(u,404))return;y(this,at,"f").warn("failed to fetch memory content",{path:a,memory_store_id:n.memoryStoreId,error:String(u)});return}await y(this,$t,"m",YL).call(this,n,a,l.content??"")&&n.baseline.set(a,l.content_sha256)},o=r[Symbol.iterator](),s=async()=>{for(let[a,c]of o)await i(a,c)};await Promise.all(Array.from({length:Math.min(uMe,r.length)},s))},iee=async function(n,r,i,o){let s=r[Symbol.iterator](),a=async()=>{for(let[c,l,u]of s){if(o?.aborted)return;let d=await y(this,$t,"m",OS).call(this,n,c,l,u);i.delete(c),d!==void 0&&n.baseline.set(c,d)}};await Promise.all(Array.from({length:Math.min(dMe,r.length)},a))},DS=async function*(n,r="basic"){let i=r==="basic"?cMe:lMe;for await(let o of y(this,La,"f").beta.memoryStores.memories.list(n,{view:r,limit:i})){if(o.type!=="memory")continue;let s=o.path.replace(/^\/+/,"");if(s===vl){y(this,at,"f").warn("the server listed the reserved marker path; skipping",{path:o.path,memory_store_id:n});continue}yield[s,o]}},OS=async function t(n,r,i,o){try{let s=await n.files.get(r);if(s===null)return;let a=pl(s),c=o?await y(this,La,"f").beta.memoryStores.memories.update(o.id,{memory_store_id:n.memoryStoreId,content:a,precondition:{type:"content_sha256",content_sha256:o.content_sha256}}):await y(this,La,"f").beta.memoryStores.memories.create(n.memoryStoreId,{path:"/"+r,content:a});return n.refusedShas.delete(r),c.content_sha256}catch(s){if(o&&jn(s,404))return await y(this,$t,"m",t).call(this,n,r,i,void 0);let a=s instanceof bt||jn(s,400)||jn(s,413);o&&jn(s,409)?y(this,at,"f").warn("memory changed both locally and remotely; the upload was refused and the local edit loses",{path:r,memory_store_id:n.memoryStoreId}):a&&i!==void 0?(n.refusedShas.set(r,i),y(this,at,"f").warn("the server rejected this memory file, so it stays un-synced until its content changes",{path:r,memory_store_id:n.memoryStoreId,rejection:String(s)})):y(this,at,"f").warn("failed to upload memory",{path:r,memory_store_id:n.memoryStoreId,error:String(s)});return}},oee=async function(n,r,i,o,s){if(s.mode==="disabled")return s.suppressed++,o;let a=n.pendingDeletes.get(r);if(a===void 0&&(a=Date.now(),n.pendingDeletes.set(r,a)),!s.waiveWindow&&Date.now()-a_ee,BashTimeoutError:()=>US,DEFAULT_MEMORY_SYNC_INTERVAL_MS:()=>hy,MARKER_PATH:()=>vl,MEMORY_FLUSH_TIMEOUT_MS:()=>cee,MIN_MEMORY_SYNC_INTERVAL_MS:()=>gy,SessionMemoryError:()=>ys,SessionMemoryStores:()=>uee,betaAgentToolset20260401:()=>kMe,betaBashTool:()=>$ee,betaEditTool:()=>Eee,betaGlobTool:()=>Tee,betaGrepTool:()=>Iee,betaReadTool:()=>See,betaWriteTool:()=>xee,extractSkillArchive:()=>qL,resolvePath:()=>Ep,setupSkills:()=>z7});function wee(e){return e===void 0?gMe:e}function Sl(e){if(e!==void 0)throw new Y("The `unrestrictedPaths` option you passed to the agent toolset (AgentToolContext) is no longer supported. The toolset's file tools (read, write, edit, glob, grep) are now always confined to the working directory plus the directories listed in `allowedRoots`. Remove `unrestrictedPaths` from your context; to let the file tools reach any other directory, add it to `allowedRoots`.")}function kMe(e){return[$ee(e),See(e),xee(e),Eee(e),Tee(e),Iee(e)]}async function Ep(e,t){return Sl(e.unrestrictedPaths),j7(e.workdir,t,{allowedRoots:e.allowedRoots??[]})}function kee(e,t){return UL(e.readOnlyRoots??[],t)}function _Me(){let e={};for(let[t,n]of Object.entries(process.env))t.startsWith("ANTHROPIC_")||(e[t]=n);return e}function $ee(e){Sl(e.unrestrictedPaths);let t,n=Promise.resolve();return yl({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:r,restart:i,timeout_ms:o},s)=>{let a=n,c=wp();n=c.promise;try{await a}catch{}try{if(i&&(t?.close(),t=void 0),!r){if(i)return"bash session restarted";throw new Me("bash: command is required")}t??(t=new _ee(e.workdir,e.env));try{let{output:l,exitCode:u}=await t.exec(r,{timeoutMs:o??vee,signal:s?.signal});if(u!==0)throw new Me(l||`exit ${u}`);return l}catch(l){throw l instanceof Me?l:(t.close(),t=void 0,new Me(`bash: ${l instanceof Error?l.message:String(l)}`))}}finally{c.resolve()}},close:()=>{t?.close(),t=void 0}})}function See(e){return Sl(e.unrestrictedPaths),yl({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:t,view_range:n})=>{if(!t)throw new Me("read: file_path is required");let r=await Ep(e,t);if(n?.length&&n.length!==2)throw new Me("read: view_range must be [start_line, end_line]");let i;try{let u=await An.stat(r);if(!u.isFile())throw new Me(`read: ${t} is not a regular file`);let d=wee(e.maxFileBytes);if(d!==null&&u.size>d){if(!n?.length)throw new Me(`read: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. Use the view_range parameter to read specific line ranges, e.g. view_range: [1, 500].`);let[p,f]=n;return await $Me(r,t,p,f,d)}i=await An.readFile(r,"utf8")}catch(u){throw u instanceof Me?u:new Me(`read: ${kp(u,t)}`)}if(!n?.length)return i;let[o,s]=n,a=i.split(` `),c=Math.max(0,o-1),l=s>0?s:a.length;return a.slice(c,l).join(` -`)}})}async function fDe(e,t,n,i,r){let o=new iL(t,n,i,r);if(o.rangeIsEmpty())return"";let s=cy.createReadStream(e,{highWaterMark:sDe});try{for await(let a of s)if(o.collectFrom(a),o.rangeIsCollected())break}finally{s.destroy()}return o.text()}function NX(e){return Ll(e.unrestrictedPaths),Rl({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:t,content:n})=>{if(!t)throw new Ae("write: file_path is required");let i=await zp(e,t),r=await IX(e,i);if(r!==void 0)throw new Ae(`write: ${t} is inside read-only directory ${r}`);try{await Rn.mkdir(br.dirname(i),{recursive:!0,mode:ty}),await WM(i,n??"")}catch(o){throw new Ae(`write: ${Op(o,t)}`)}return`wrote ${Buffer.byteLength(n??"")} bytes to ${t}`}})}function CX(e){return Ll(e.unrestrictedPaths),Rl({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:t,old_string:n,new_string:i,replace_all:r})=>{if(!t)throw new Ae("edit: file_path is required");if(!n)throw new Ae("edit: old_string is required");let o=await zp(e,t),s=await IX(e,o);if(s!==void 0)throw new Ae(`edit: ${t} is inside read-only directory ${s}`);let a;try{let u=await Rn.stat(o);if(!u.isFile())throw new Ae(`edit: ${t} is not a regular file`);let d=TX(e.maxFileBytes);if(d!==null&&u.size>d)throw new Ae(`edit: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. The edit tool loads the whole file and cannot modify a file this large.`);a=await Rn.readFile(o,"utf8")}catch(u){throw u instanceof Ae?u:new Ae(`edit: ${Op(u,t)}`)}let c=a.split(n).length-1;if(c===0)throw new Ae(`edit: old_string not found in ${t}`);let l;if(r)l=a.split(n).join(i);else{if(c>1)throw new Ae(`edit: old_string appears ${c} times in ${t} (must be unique)`);l=a.replace(n,()=>i)}try{await WM(o,l)}catch(u){throw new Ae(`edit: write: ${Op(u,t)}`)}return`edited ${t} (${r?c:1} replacement(s))`}})}function mDe(e){return e.split(/[\\/{},]/).includes("..")}function PX(e){return Ll(e.unrestrictedPaths),Rl({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:t,path:n})=>{if(!t)throw new Ae("glob: pattern is required");if(br.isAbsolute(t))throw new Ae("glob: absolute pattern not permitted; pass a relative pattern (and optionally path)");if(mDe(t))throw new Ae('glob: ".." is not permitted in the pattern');let i=n?await zp(e,n):br.resolve(e.workdir),r=n?i:await ey(i),o=[],s=OX;try{for await(let a of uDe(t,{cwd:i,withFileTypes:!0,exclude:c=>c.name===".git"||c.name==="node_modules"})){if(s--<=0)break;if(!a.isFile())continue;let c=br.join(a.parentPath,a.name),l;try{l=await Rn.realpath(c)}catch{continue}if(!lS(r,l))continue;let u=0;try{u=(await Rn.stat(c)).mtimeMs}catch{}o.push({path:c,mtime:u})}}catch(a){throw new Ae(`glob: ${a instanceof Error?a.message:String(a)}`)}return o.length===0?"no matches":(o.sort((a,c)=>c.mtime-a.mtime),o.slice(0,cDe).map(a=>a.path).join(` -`))}})}function DX(e){return Ll(e.unrestrictedPaths),Rl({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:t,path:n},i)=>{if(!t)throw new Ae("grep: pattern is required");let r=br.resolve(e.workdir);n&&(r=await zp(e,n));let o=await vDe();return o?gDe(o,t,r,i?.signal):hDe(t,r,i?.signal)}})}function gDe(e,t,n,i){return new Promise((r,o)=>{let s=oL.spawn(e,["-n","--no-heading","-e",t,"--",n],{...i?{signal:i}:{}}),a="",c="",l=!1;s.stdout.on("data",u=>{l||(a+=u,a.length>ay&&(l=!0,a=a.slice(0,ay),s.kill("SIGKILL")))}),s.stderr.on("data",u=>c+=u),s.on("close",u=>{if(i?.aborted)return o(new Ae("grep: aborted"));if(l)return r(a+` -[output truncated at ${ay} bytes]`);if(u===0)return r(a);if(u===1)return r("no matches");o(new Ae(`grep: rg failed: ${c||`exit ${u}`}`))}),s.on("error",u=>{if(i?.aborted)return o(new Ae("grep: aborted"));o(new Ae(`grep: rg failed: ${u.message}`))})})}async function hDe(e,t,n){let i;try{i=new RegExp(e)}catch(c){throw new Ae(`grep: invalid regex: ${c instanceof Error?c.message:String(c)}`)}let r=[],o=ay,s=c=>(o-=c.length+1,o<0?(r.push(`[output truncated at ${ay} bytes]`),!1):(r.push(c),!0));if((await Rn.stat(t).catch(()=>null))?.isFile()?await $X(t,i,s):await bDe(t,"",c=>$X(br.join(t,c),i,s),n),n?.aborted)throw new Ae("grep: aborted");return r.length===0?"no matches":r.join(` -`)}async function $X(e,t,n){let i=cy.createReadStream(e,{encoding:"utf8"}),r=xX.createInterface({input:i,crlfDelay:1/0}),o=0;try{for await(let s of r)if(o++,!(s.length>aDe)&&t.test(s)&&!n(`${e}:${o}:${s}`))return!1}catch{}finally{i.destroy()}return!0}async function bDe(e,t,n,i){let r=OX;async function o(s,a){if(a>yDe)return!0;if(i?.aborted)return!1;let c;try{c=await Rn.readdir(br.join(e,s),{withFileTypes:!0})}catch{return!0}for(let l of c){if(l.name===".git"||l.name==="node_modules")continue;if(r--<=0||i?.aborted)return!1;let u=s?br.join(s,l.name):l.name;if(l.isDirectory()){if(!await o(u,a+1))return!1}else if(l.isFile()&&await n(u)===!1)return!1}return!0}await o(t,0)}async function vDe(){let e=(process.env.PATH??"").split(br.delimiter);for(let t of e){let n=br.join(t,"rg");try{return await Rn.access(n,cy.constants.X_OK),n}catch{}}return null}var Rn,cy,br,oL,SX,xX,bS,yr,Ur,iy,Pl,Ai,rL,vS,oy,wS,kS,Ol,Ml,jp,Dl,sy,Ha,_X,vX,wX,EX,oDe,sDe,kX,ay,aDe,cDe,$S,lDe,uDe,_S,iL,yDe,OX,LX=j(()=>{gr();Rn=gt(require("node:fs/promises"),1),cy=gt(require("node:fs"),1),br=gt(require("node:path"),1),oL=gt(require("node:child_process"),1),SX=gt(require("node:crypto"),1),xX=gt(require("node:readline"),1);kt();Il();WQ();BM();HM();YQ();bX();wX=100*1024,EX=12e4,oDe=256*1024,sDe=64*1024,kX=Buffer.from(` -`),ay=100*1024,aDe=2e3,cDe=200,$S=class extends J{constructor(t){super(`bash command timed out after ${t}ms`),this.name="BashTimeoutError",this.timeoutMs=t}},lDe=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,uDe=Rn.glob;_S=class{constructor(t,n=pDe()){bS.add(this),yr.set(this,void 0),Ur.set(this,""),iy.set(this,!1),Pl.set(this,!1),Ai.set(this,null),M(this,yr,oL.spawn("/bin/bash",["--noprofile","--norc"],{cwd:t,env:{...n,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),v(this,yr,"f").stdout.setEncoding("utf8"),v(this,yr,"f").stderr.setEncoding("utf8"),v(this,yr,"f").stdout.on("data",i=>v(this,bS,"m",rL).call(this,i)),v(this,yr,"f").stderr.on("data",i=>v(this,bS,"m",rL).call(this,i)),v(this,yr,"f").once("close",()=>{M(this,Pl,!0,"f");let i=v(this,Ai,"f");M(this,Ai,null,"f"),i?.resolve()})}get closed(){return v(this,Pl,"f")}async exec(t,n={}){if(v(this,Pl,"f"))throw new J("bash session terminated");let i=n.timeoutMs??EX,r=n.signal;r?.throwIfAborted(),M(this,Ur,"","f"),M(this,iy,!1,"f");let o=`__ANT_CMD_${SX.randomUUID()}_DONE__`,s=`${o.slice(0,8)}''${o.slice(8)}`,a=`{ ${t} -} &1; printf '\\n${s}%d\\n' $? -`;if(v(this,yr,"f").stdin.write(a),v(this,Ur,"f").indexOf(o)<0){let{promise:f,resolve:m}=Dp();M(this,Ai,{sentinel:o,resolve:m},"f");let g,h;try{await Promise.race([f,new Promise((b,y)=>{g=setTimeout(()=>y(new $S(i)),i)}),new Promise((b,y)=>{r&&(h=()=>y(r.reason),r.addEventListener("abort",h,{once:!0}))})])}finally{g&&clearTimeout(g),h&&r&&r.removeEventListener("abort",h),M(this,Ai,null,"f")}}let c=v(this,Ur,"f").indexOf(o);if(c<0)throw new J("bash session terminated");let u=v(this,Ur,"f").slice(c+o.length).match(/^(-?\d+)/),d=u?parseInt(u[1],10):-1,p=v(this,Ur,"f").slice(0,c).replace(lDe,"").replace(/\n+$/,"");return v(this,iy,"f")&&(p=`[output truncated] -${p}`),{output:p,exitCode:d}}close(){if(v(this,Pl,"f"))return;M(this,Pl,!0,"f");let t=v(this,Ai,"f");M(this,Ai,null,"f"),t?.resolve(),v(this,yr,"f").stdout.destroy(),v(this,yr,"f").stderr.destroy(),v(this,yr,"f").stdin.destroy();try{process.kill(-v(this,yr,"f").pid,"SIGKILL")}catch{v(this,yr,"f").kill("SIGKILL")}v(this,yr,"f").unref()}};yr=new WeakMap,Ur=new WeakMap,iy=new WeakMap,Pl=new WeakMap,Ai=new WeakMap,bS=new WeakSet,rL=function(t){if(M(this,Ur,v(this,Ur,"f")+t,"f"),v(this,Ur,"f").length>wX&&(M(this,Ur,v(this,Ur,"f").slice(v(this,Ur,"f").length-wX),"f"),M(this,iy,!0,"f")),v(this,Ai,"f")&&v(this,Ur,"f").indexOf(v(this,Ai,"f").sentinel)>=0){let n=v(this,Ai,"f");M(this,Ai,null,"f"),n.resolve()}};iL=class{constructor(t,n,i,r){vS.add(this),oy.set(this,void 0),wS.set(this,void 0),kS.set(this,void 0),Ol.set(this,void 0),Ml.set(this,void 0),jp.set(this,void 0),Dl.set(this,0),sy.set(this,[]),Ha.set(this,0),M(this,oy,t,"f"),M(this,wS,n,"f"),M(this,kS,i,"f"),M(this,Ol,Math.max(0,n-1),"f"),M(this,Ml,i>0?i:1/0,"f"),M(this,jp,r,"f")}rangeIsEmpty(){return v(this,Ml,"f")<=v(this,Ol,"f")}rangeIsCollected(){return v(this,Dl,"f")>=v(this,Ml,"f")}collectFrom(t){var n;let i=0;for(;i=v(this,Ol,"f")&&v(this,vS,"m",_X).call(this,t.subarray(i,o),r>=0),r<0)break;M(this,Dl,(n=v(this,Dl,"f"),n++,n),"f"),i=r+1}}text(){return Buffer.concat(v(this,sy,"f"),v(this,Ha,"f")).toString("utf8")}};oy=new WeakMap,wS=new WeakMap,kS=new WeakMap,Ol=new WeakMap,Ml=new WeakMap,jp=new WeakMap,Dl=new WeakMap,sy=new WeakMap,Ha=new WeakMap,vS=new WeakSet,_X=function(t,n){if(v(this,sy,"f").push(t),M(this,Ha,v(this,Ha,"f")+t.length,"f"),n&&v(this,Dl,"f")+1v(this,jp,"f"))throw v(this,vS,"m",vX).call(this)},vX=function(){return v(this,Ml,"f")-v(this,Ol,"f")===1?new Ae(`read: line ${v(this,Ol,"f")+1} of ${v(this,oy,"f")} alone exceeds ${v(this,jp,"f")}-byte limit. The read tool cannot return part of a line, so view_range cannot narrow this further.`):new Ae(`read: view_range [${v(this,wS,"f")}, ${v(this,kS,"f")}] of ${v(this,oy,"f")} exceeds ${v(this,jp,"f")}-byte limit. Narrow the view_range to read a smaller portion.`)};yDe=40,OX=5e4});function $De(e){return e.resources.some(t=>t.type==="memory_store")}function _De(e){if(!e)return null;let t;try{let i=e.replace(/-/g,"+").replace(/_/g,"/"),r=i.padEnd(Math.ceil(i.length/4)*4,"=");t=JSON.parse(Sl(W5(r)))}catch{return null}if(t===null||typeof t!="object"||Array.isArray(t))return null;let n=t.sessions_token;return typeof n=="string"&&n!==""?n:null}async function UX(e,t){let n;try{return await Promise.race([e.then(()=>!1,()=>!1),new Promise(i=>{n=setTimeout(()=>i(!0),t)})])}finally{n!==void 0&&clearTimeout(n)}}async function SDe(e,t,n,i){try{await e.beta.environments.work.stop(t.id,{environment_id:t.environment_id,force:!0},{...i,headers:I([i?.headers])})}catch(r){An(r,409)||n.error("force-stop on exit failed",{work_id:t.id,error:String(r)})}}function xDe(e){let t=e instanceof Dt?e.error:void 0;for(let n of["error","details","current_state"]){if(!BO(t))return{};t=t[n]}return BO(t)?t:{}}async function EDe(e,t,n,i,r,o){let s=FX,a=wDe,c=Date.now(),l=kDe,u=async()=>{let d=new AbortController,p=Ua(n.signal,d),f=setTimeout(()=>d.abort(),s);try{let m=await e.beta.environments.work.heartbeat(t.id,{environment_id:t.environment_id,expected_last_heartbeat:l},{...r,headers:I([r?.headers]),signal:d.signal});c=Date.now(),l=m.last_heartbeat,m.ttl_seconds>0&&(a=m.ttl_seconds*1e3,s=Math.max(1e3,Math.min(a/2,FX)),o?.(a)),(m.state==="stopping"||m.state==="stopped")&&(i.info("heartbeat signals shutdown",{work_id:t.id,state:m.state}),n.finish("control_plane_stop")),m.lease_extended||(i.warn("lease not extended, shutting down",{work_id:t.id}),n.finish("control_plane_stop"))}catch(m){if(n.signal.throwIfAborted(),An(m,412)){let g=xDe(m);i.error("lease lost: heartbeat precondition failed",{work_id:t.id,server_state:g.state,server_ttl_seconds:g.ttl_seconds,server_last_heartbeat:g.last_heartbeat}),n.finish("lease_lost");return}if(ja(m))throw i.error("permanent heartbeat failure",{work_id:t.id,error:String(m)}),n.finish("heartbeat_rejected"),m;if(Date.now()-c>a){i.error("lease assumed lost: no successful heartbeat in ttl",{work_id:t.id,ttl_ms:a,error:String(m)}),n.finish("assumed_lost");return}i.warn("transient heartbeat failure",{work_id:t.id,error:String(m)})}finally{clearTimeout(f),p()}};for(await u();!n.signal.aborted;)await Yi(s,n.signal),n.signal.throwIfAborted(),await u()}var SS,ly,sL,uy,Gp,FX,wDe,kDe,Vp,aL,cL=j(()=>{gr();kt();Xi();iM();xl();pp();cp();_p();z_();hr();Ne();sS();Z_();LM();cS();FX=3e4,wDe=9e4,kDe="NO_HEARTBEAT";Vp=class{constructor(t){if(SS.add(this),ly.set(this,void 0),t.unrestrictedPaths!==void 0)throw new J("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory.");this.client=t.client,this.environmentId=t.environmentId,this.environmentKey=t.environmentKey,this.tools=t.tools,this.workdir=t.workdir??process.cwd(),this.maxFileBytes=t.maxFileBytes,this.maxIdleMs=t.maxIdleMs,t.memorySyncIntervalMs!=null&&aS(t.memorySyncIntervalMs,"memorySyncIntervalMs"),this.memorySyncIntervalMs=t.memorySyncIntervalMs,this.memorySyncDeletions=t.memorySyncDeletions??"enabled",this.workerId=t.workerId,this.requestOptions=t.requestOptions,M(this,ly,t.signal,"f")}async run(t){let{environmentId:n,environmentKey:i}=this;if(n===void 0||i===void 0)throw new J("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let r=t??v(this,ly,"f"),o=new za({client:this.client,environmentId:n,environmentKey:i,...this.workerId!==void 0?{workerId:this.workerId}:{},...r?{signal:r}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let s of o)try{await v(this,SS,"m",sL).call(this,s,i,o.signal)}catch(a){if(o.signal?.aborted)throw a;qe(this.client).error("work item failed",{work_id:s.id,error:String(a)})}}async handleItem(t){let n=t?.workId??ze("ANTHROPIC_WORK_ID"),i=t?.environmentId??ze("ANTHROPIC_ENVIRONMENT_ID"),r=t?.sessionId??ze("ANTHROPIC_SESSION_ID"),o=(t?.environmentKey??this.environmentKey??ze("ANTHROPIC_ENVIRONMENT_KEY"))||void 0,s=t?.workSecret||ze("ANTHROPIC_WORK_SECRET")||null;if(!n)throw new J("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!i)throw new J("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!r)throw new J("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!o&&!s)throw new J("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let a={id:n,environment_id:i,secret:s,data:{type:"session",id:r}};await v(this,SS,"m",sL).call(this,a,o,t?.signal??v(this,ly,"f"))}};ly=new WeakMap,SS=new WeakSet,sL=async function(t,n,i){let r=qe(this.client),o=_De(t.secret),s=o??n;if(s===void 0)throw new J("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)");t.secret&&o===null&&r.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key",{work_id:t.id});let a=B_(this.client,{authToken:s,helper:"environments-worker"}),c=t.data.id,l=new AbortController,u=Ua(i,l),d=new aL(l),p=await Promise.resolve().then(()=>(LX(),MX)),f,m,g=EDe(a,t,d,r,this.requestOptions,w=>{f=w,m?._setSendRetryWindow(w)}).catch(w=>{l.signal.aborted||r.error("heartbeat loop failed",{work_id:t.id,error:String(w)}),l.abort()}),h=async()=>{},b,y=!1;try{if(t.data.type!=="session"){r.debug("skipping non-session work item",{work_id:t.id,type:t.data.type});return}let w=await a.beta.sessions.retrieve(c);if(o===null&&this.memorySyncIntervalMs!==null&&$De(w))throw new p.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${t.id}, session_id=${c}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`);let k={workdir:this.workdir,client:a,session:w,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{h=await p.setupSkills(k)}catch(S){r.warn("skill setup failed",{session_id:c,work_id:t.id,error:String(S)})}o!==null&&this.memorySyncIntervalMs!==null?(b=new p.SessionMemoryStores(a,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await b.download(w),k.allowedRoots=b.roots,k.readOnlyRoots=b.readOnlyRoots):r.debug("memory stores disabled for this item",{work_id:t.id});let _=typeof this.tools=="function"?this.tools(k):this.tools??p.betaAgentToolset20260401(k);m=new Ba(c,{client:a,tools:_,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:l.signal}),f!==void 0&&m._setSendRetryWindow(f);for await(let S of m)b&&await b.syncIfDue();y=!l.signal.aborted}finally{try{await h().catch(w=>{r.warn("skill cleanup failed",{session_id:c,work_id:t.id,error:String(w)})})}finally{if(b){let w=p.MEMORY_FLUSH_TIMEOUT_MS;y&&await UX(b.finish(),w)&&r.warn(`final memory sync cut off after ${w}ms; the flush that follows still uploads changed files`,{session_id:c,work_id:t.id});let k=new AbortController;await UX(b.flushWrites(k.signal),w)&&(k.abort(),r.warn(`memory flush cut off after ${w}ms; changed files it had not uploaded yet are not saved`,{session_id:c,work_id:t.id})),await b.dispose().catch(S=>{r.warn("memory store cleanup failed",{session_id:c,work_id:t.id,error:String(S)})})}}d.finish("runner_done"),u(),await g,d.lost?r.info("lease lost; released without stopping it",{session_id:c,work_id:t.id}):await SDe(a,t,r,this.requestOptions)}};aL=class{constructor(t){uy.set(this,void 0),Gp.set(this,void 0),M(this,uy,t,"f")}get signal(){return v(this,uy,"f").signal}finish(t){M(this,Gp,v(this,Gp,"f")??t,"f"),v(this,uy,"f").abort()}get lost(){return v(this,Gp,"f")==="lease_lost"||v(this,Gp,"f")==="assumed_lost"}};uy=new WeakMap,Gp=new WeakMap});var Ka,lL=j(()=>{Se();De();Ne();Me();Z_();cL();Z_();cL();Ka=class extends Z{retrieve(t,n,i){let{environment_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/environments/${r}/work/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{environment_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/environments/${r}/work/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/environments/${t}/work?beta=true`,le,{query:o,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}ack(t,n,i){let{environment_id:r,betas:o}=n;return this._client.post(N`/v1/environments/${r}/work/${t}/ack?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}heartbeat(t,n,i){let{environment_id:r,desired_ttl_seconds:o,expected_last_heartbeat:s,betas:a}=n;return this._client.post(N`/v1/environments/${r}/work/${t}/heartbeat?beta=true`,{query:{desired_ttl_seconds:o,expected_last_heartbeat:s},...i,headers:I([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}poll(t,n={},i){let{betas:r,"Anthropic-Worker-ID":o,...s}=n??{};return this._client.get(N`/v1/environments/${t}/work/poll?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"Anthropic-Worker-ID":o}:void 0},i?.headers])})}stats(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/environments/${t}/work/stats?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}stop(t,n,i){let{environment_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/environments/${r}/work/${t}/stop?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}poller(t){return new za({...t,client:this._client})}worker(t){return new Vp({...t,client:this._client})}};Ka.WorkPoller=za;Ka.EnvironmentWorker=Vp});var Fl,uL=j(()=>{Se();lL();lL();De();Ne();Me();Fl=class extends Z{constructor(){super(...arguments),this.work=new Ka(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/environments?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/environments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/environments/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/environments?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/environments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/environments/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Fl.Work=Ka});var Bp,dL=j(()=>{Se();De();Ne();Me();Bp=class extends Z{create(t,n,i){let{view:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/memory_stores/${t}/memories?beta=true`,{query:{view:r},body:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}retrieve(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(N`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{memory_store_id:r,view:o,betas:s,workspace_id:a,...c}=n;return this._client.post(N`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:{view:o},body:c,...i,headers:I([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/memory_stores/${t}/memories?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{memory_store_id:r,expected_content_sha256:o,betas:s,workspace_id:a}=n;return this._client.delete(N`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:{expected_content_sha256:o},...i,headers:I([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}}});var qp,pL=j(()=>{Se();De();Ne();Me();qp=class extends Z{retrieve(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(N`/v1/memory_stores/${r}/memory_versions/${t}?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/memory_stores/${t}/memory_versions?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}redact(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/memory_stores/${r}/memory_versions/${t}/redact?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Ja,fL=j(()=>{Se();dL();dL();pL();pL();De();Ne();Me();Ja=class extends Z{constructor(){super(...arguments),this.memories=new Bp(this._client),this.memoryVersions=new qp(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/memory_stores?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/memory_stores/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/memory_stores/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/memory_stores?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/memory_stores/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/memory_stores/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Ja.Memories=Bp;Ja.MemoryVersions=qp});var Wp=j(()=>{kt()});var Hp,mL=j(()=>{kt();lp();fM();Hp=class e{constructor(t,n){this.iterator=t,this.controller=n}async*decoder(){let t=new ms;for await(let n of this.iterator)for(let i of t.decode(n))yield JSON.parse(i);for(let n of t.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,n){if(!t.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new J("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 J("Attempted to iterate over a response with no body");return new e(Nh(t.body),n)}}});var Kp,gL=j(()=>{Se();De();Ne();mL();Wp();Me();Kp=class extends Z{create(t,n){let{betas:i,user_profile_id:r,workspace_id:o,...s}=t;return this._client.post("/v1/messages/batches?beta=true",{body:s,...n,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...r!=null?{"anthropic-user-profile-id":r}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/messages/batches/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",pn,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/messages/batches/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}cancel(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/messages/batches/${t}/cancel?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}async results(t,n={},i){let r=await this.retrieve(t,n,i);if(!r.results_url)throw new J(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:o,workspace_id:s}=n??{};return this._client.get(r.results_url,{...i,headers:I([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((a,c)=>Hp.fromResponse(c.response,c.controller))}}});var xS,hL=j(()=>{xS={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function jX(e){return e?.output_format??e?.output_config?.format}function yL(e,t,n){let i=jX(t);return!t||!("parse"in(i??{}))?{...e,content:e.content.map(r=>{if(r.type==="text"){let o=Object.defineProperty({...r},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return r}),parsed_output:null}:bL(e,t,n)}function bL(e,t,n){let i=null,r=e.content.map(o=>{if(o.type==="text"){let s=PDe(t,o.text);i===null&&(i=s);let a=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...e,content:r,parsed_output:i}}function PDe(e,t){let n=jX(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(i){throw new J(`Failed to parse structured output: ${i}`)}}var vL=j(()=>{kt()});var wL=j(()=>{Lh()});var DDe,Jp,ODe,MDe,zX,GX=j(()=>{DDe=e=>{let t=0,n=[];for(;t{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),Jp(e);break;case"number":let n=t.value[t.value.length-1];if(n==="."||n==="-"||n==="+"||n==="e"||n==="E")return e=e.slice(0,e.length-1),Jp(e);case"string":let i=e[e.length-2];if(i?.type==="delimiter")return e=e.slice(0,e.length-1),Jp(e);if(i?.type==="brace"&&i.value==="{")return e=e.slice(0,e.length-1),Jp(e);break;case"delimiter":return e=e.slice(0,e.length-1),Jp(e);break}return e},ODe=e=>{let t=[];return e.map(n=>{n.type==="brace"&&(n.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(n=>{n==="}"?e.push({type:"brace",value:"}"}):n==="]"&&e.push({type:"paren",value:"]"})}),e},MDe=e=>{let t="";return e.map(n=>{n.type==="string"?t+='"'+n.value+'"':t+=n.value}),t},zX=e=>JSON.parse(MDe(ODe(Jp(DDe(e)))))});function ES(e,t){let n={};for(let o of Object.keys(e))o!=="input"&&(n[o]=e[o]);Object.defineProperty(n,Za,{value:t,enumerable:!1,writable:!0});let i,r=!1;return Object.defineProperty(n,"input",{enumerable:!0,configurable:!0,get(){return r||(i=t?zX(t):{},r=!0),i}}),n}var Za,kL=j(()=>{GX();Za="__json_buf"});function TL(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}var jr,Ya,Zp,dy,TS,py,fy,IS,my,Lo,gy,AS,RS,Ul,NS,CS,PS,hy,$L,VX,yy,_L,SL,xL,BX,EL,DS,WX=j(()=>{gr();eo();Wp();Da();hr();wL();vL();kL();DS=class e{constructor(t,n){jr.add(this),this.messages=[],this.receivedMessages=[],Ya.set(this,void 0),Zp.set(this,null),this.controller=new AbortController,dy.set(this,void 0),TS.set(this,()=>{}),py.set(this,()=>{}),fy.set(this,void 0),IS.set(this,()=>{}),my.set(this,()=>{}),Lo.set(this,{}),gy.set(this,!1),AS.set(this,!1),RS.set(this,!1),Ul.set(this,!1),NS.set(this,void 0),CS.set(this,void 0),PS.set(this,void 0),hy.set(this,void 0),yy.set(this,i=>{if(M(this,AS,!0,"f"),Yr(i)&&(i=new In),i instanceof In)return M(this,RS,!0,"f"),this._emit("abort",i);if(i instanceof J)return this._emit("error",i);if(i instanceof Error){let r=new J(i.message);return r.cause=i,this._emit("error",r)}return this._emit("error",new J(String(i)))}),M(this,dy,new Promise((i,r)=>{M(this,TS,i,"f"),M(this,py,r,"f")}),"f"),M(this,fy,new Promise((i,r)=>{M(this,IS,i,"f"),M(this,my,r,"f")}),"f"),v(this,dy,"f").catch(()=>{}),v(this,fy,"f").catch(()=>{}),M(this,Zp,t,"f"),M(this,hy,n?.logger??console,"f")}get response(){return v(this,NS,"f")}get request_id(){return v(this,CS,"f")}get workspace_id(){return v(this,PS,"f")}async withResponse(){M(this,Ul,!0,"f");let t=await v(this,dy,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id"),workspace_id:t.headers.get("anthropic-workspace-id")}}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,i,{logger:r}={}){let o=new e(n,{logger:r});for(let s of n.messages)o._addMessageParam(s);return M(o,Zp,{...n,stream:!0},"f"),o._run(()=>o._createMessage(t,{...n,stream:!0},{...i,headers:{...i?.headers,[M_]:"stream"}})),o}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},v(this,yy,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,i){let r=i?.signal,o;r&&(r.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o));try{v(this,jr,"m",_L).call(this);let{response:s,data:a}=await t.create({...n,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)v(this,jr,"m",SL).call(this,c);if(a.controller.signal?.aborted)throw new In;v(this,jr,"m",xL).call(this)}finally{r&&o&&r.removeEventListener("abort",o)}}_connected(t){this.ended||(M(this,NS,t,"f"),M(this,CS,t?.headers.get("request-id"),"f"),M(this,PS,t?.headers.get("anthropic-workspace-id"),"f"),v(this,TS,"f").call(this,t),this._emit("connect"))}get ended(){return v(this,gy,"f")}get errored(){return v(this,AS,"f")}get aborted(){return v(this,RS,"f")}abort(){this.controller.abort()}on(t,n){return(v(this,Lo,"f")[t]||(v(this,Lo,"f")[t]=[])).push({listener:n}),this}off(t,n){let i=v(this,Lo,"f")[t];if(!i)return this;let r=i.findIndex(o=>o.listener===n);return r>=0&&i.splice(r,1),this}once(t,n){return(v(this,Lo,"f")[t]||(v(this,Lo,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,i)=>{M(this,Ul,!0,"f"),t!=="error"&&this.once("error",i),this.once(t,n)})}async done(){M(this,Ul,!0,"f"),await v(this,fy,"f")}get currentMessage(){return v(this,Ya,"f")}async finalMessage(){return await this.done(),v(this,jr,"m",$L).call(this)}async finalText(){return await this.done(),v(this,jr,"m",VX).call(this)}_emit(t,...n){if(v(this,gy,"f"))return;t==="end"&&(M(this,gy,!0,"f"),v(this,IS,"f").call(this));let i=v(this,Lo,"f")[t];if(i&&(v(this,Lo,"f")[t]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),t==="abort"){let r=n[0];!v(this,Ul,"f")&&!i?.length&&Promise.reject(r),v(this,py,"f").call(this,r),v(this,my,"f").call(this,r),this._emit("end");return}if(t==="error"){let r=n[0];!v(this,Ul,"f")&&!i?.length&&Promise.reject(r),v(this,py,"f").call(this,r),v(this,my,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",v(this,jr,"m",$L).call(this))}async _fromReadableStream(t,n){let i=n?.signal,r;i&&(i.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),i.addEventListener("abort",r));try{v(this,jr,"m",_L).call(this),this._connected(null);let o=Fr.fromReadableStream(t,this.controller);for await(let s of o)v(this,jr,"m",SL).call(this,s);if(o.controller.signal?.aborted)throw new In;v(this,jr,"m",xL).call(this)}finally{i&&r&&i.removeEventListener("abort",r)}}[(Ya=new WeakMap,Zp=new WeakMap,dy=new WeakMap,TS=new WeakMap,py=new WeakMap,fy=new WeakMap,IS=new WeakMap,my=new WeakMap,Lo=new WeakMap,gy=new WeakMap,AS=new WeakMap,RS=new WeakMap,Ul=new WeakMap,NS=new WeakMap,CS=new WeakMap,PS=new WeakMap,hy=new WeakMap,yy=new WeakMap,jr=new WeakSet,$L=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},VX=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(n.length===0)throw new J("stream ended without producing a content block with type=text");return n.join(" ")},_L=function(){this.ended||M(this,Ya,void 0,"f")},SL=function(n){if(this.ended)return;let i=v(this,jr,"m",BX).call(this,n);switch(this._emit("streamEvent",n,i),n.type){case"content_block_delta":{let r=i.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{if(TL(r)&&v(this,Lo,"f").inputJson?.length){let o;try{o=r.input}catch(s){v(this,yy,"f").call(this,v(this,jr,"m",EL).call(this,r,s));break}this._emit("inputJson",n.delta.partial_json,o)}break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}case"compaction_delta":{r.type==="compaction"&&r.content&&this._emit("compaction",r.content);break}default:n.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(yL(i,v(this,Zp,"f"),{logger:v(this,hy,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{M(this,Ya,i,"f");break}case"content_block_start":case"message_delta":break}},xL=function(){if(this.ended)throw new J("stream has ended, this shouldn't happen");let n=v(this,Ya,"f");if(!n)throw new J("request ended without sending any chunks");return M(this,Ya,void 0,"f"),yL(n,v(this,Zp,"f"),{logger:v(this,hy,"f")})},BX=function(n){let i=v(this,Ya,"f");if(n.type==="message_start"){if(i)throw new J(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!i)throw new J(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return i;case"message_delta":return i.stop_reason=n.delta.stop_reason,i.stop_sequence=n.delta.stop_sequence,i.stop_details=n.delta.stop_details,i.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(i.container=n.delta.container),n.context_management!=null&&(i.context_management=n.context_management),n.input_transformations!=null&&(i.input_transformations=n.input_transformations),n.usage.input_tokens!=null&&(i.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(i.usage.server_tool_use=n.usage.server_tool_use),n.usage.iterations!=null&&(i.usage.iterations=n.usage.iterations),n.usage.fallback_credit!=null&&(i.usage.fallback_credit=n.usage.fallback_credit),n.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=n.usage.output_tokens_details),i;case"content_block_start":return i.content.push(n.content_block),n.content_block.type==="fallback"&&(i.model=n.content_block.to.model),i;case"content_block_delta":{let r=i.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(i.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(i.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&TL(r)){let o=(r[Za]||"")+n.delta.partial_json;i.content[n.index]=ES(r,o)}break}case"thinking_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,signature:n.delta.signature});break}case"compaction_delta":{r?.type==="compaction"&&(i.content[n.index]={...r,content:(r.content||"")+n.delta.content,encrypted_content:n.delta.encrypted_content});break}default:n.delta}return i}case"content_block_stop":{let r=i.content.at(n.index);if(r&&TL(r)&&Za in r){let o;try{o=r.input}catch(s){o={},v(this,yy,"f").call(this,v(this,jr,"m",EL).call(this,r,s))}Object.defineProperty(r,"input",{value:o,enumerable:!0,configurable:!0,writable:!0})}return i}}},EL=function(n,i){let r=n[Za];return new J(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${i}. JSON: ${r}`)},Symbol.asyncIterator)](){let t=[],n=[],i=!1;return this.on("streamEvent",r=>{let o=n.shift();o?o.resolve(r):t.push(r)}),this.on("end",()=>{i=!0;for(let r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((o,s)=>n.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 Fr(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var HX,KX=j(()=>{HX=`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 -2. Current State -What has been completed so far -Files created, modified, or analyzed (with paths if relevant) -Key outputs or artifacts produced -3. Important Discoveries -Technical constraints or requirements uncovered -Decisions made and their rationale -Errors encountered and how they were resolved -What approaches were tried that didn't work (and why) -4. Next Steps -Specific actions needed to complete the task -Any blockers or open questions to resolve -Priority order if multiple steps remain -5. Context to Preserve -User preferences or style requirements -Domain-specific details that aren't obvious -Any promises made to the user -Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags.`});async function FDe(e,t=e.messages.at(-1),n){if(!t||t.role!=="assistant"||!t.content||typeof t.content=="string")return null;let i=t.content.filter(s=>s.type==="tool_use");if(i.length===0)return null;let r=jDe(e);return{role:"user",content:await Promise.all(i.map(async s=>{let a=e.tools.find(c=>("name"in c?c.name:"mcp_server_name"in c?c.mcp_server_name:c.type)===s.name);if(!a||!("run"in a)||!r.has(s.name))return UDe(s);try{let c=s.input;"parse"in a&&a.parse&&(c=a.parse(c));let l=await a.run(c,{toolUse:s,toolUseBlock:s,signal:n?.signal});return{type:"tool_result",tool_use_id:s.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:s.id,content:c instanceof Ae?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function UDe(e){return{type:"tool_result",tool_use_id:e.id,content:`Error: Tool '${e.name}' not found`,is_error:!0}}function jDe(e){let t=new Set;for(let n of e.tools)"run"in n&&t.add(n.name);for(let n of e.messages)if(!(n.role!=="system"||typeof n.content=="string"))for(let i of n.content)zDe(i,t);return t}function zDe(e,t){switch(e.type){case"tool_removal":case"tool_addition":GDe(e,t);break}}function GDe(e,t){let n=VDe(e.tool);n!==void 0&&(e.type==="tool_removal"?t.delete(n):t.add(n))}function VDe(e){if(e.type==="tool_reference")return e.name}function BDe(e){if(e===null)return"stop";switch(e){case"tool_use":return"run_tools";case"pause_turn":case"compaction":return"resume";case"end_turn":case"stop_sequence":case"max_tokens":case"model_context_window_exceeded":case"refusal":return"stop";default:return"stop"}}var by,Yp,jl,Jt,zr,ni,bs,Qa,vy,JX,IL,Qp,AL=j(()=>{gr();Il();kt();Ne();BM();hr();KX();eo();Qp=class{constructor(t,n,i){by.add(this),this.client=t,Yp.set(this,!1),jl.set(this,!1),Jt.set(this,void 0),zr.set(this,void 0),ni.set(this,void 0),bs.set(this,void 0),Qa.set(this,void 0),vy.set(this,0),M(this,Jt,{params:{...n,messages:structuredClone(n.messages)}},"f");let r=EM(n.tools,n.messages);M(this,zr,{...i,headers:I([Bh("BetaToolRunner"),r.length?{[Mo]:r.join(", ")}:void 0,i?.headers])},"f"),M(this,Qa,Dp(),"f"),n.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Yp=new WeakMap,jl=new WeakMap,Jt=new WeakMap,zr=new WeakMap,ni=new WeakMap,bs=new WeakMap,Qa=new WeakMap,vy=new WeakMap,by=new WeakSet,JX=async function(){let n=v(this,Jt,"f").params.compactionControl;if(!n||!n.enabled)return!1;let i=0;if(v(this,ni,"f")!==void 0)try{let l=await v(this,ni,"f");i=l.usage.input_tokens+(l.usage.cache_creation_input_tokens??0)+(l.usage.cache_read_input_tokens??0)+l.usage.output_tokens}catch{return!1}let r=n.contextTokenThreshold??1e5;if(id.type!=="tool_use");u.length===0?a.pop():l.content=u}}let c=await this.client.beta.messages.create({model:o,messages:[...a,{role:"user",content:[{type:"text",text:s}]}],max_tokens:v(this,Jt,"f").params.max_tokens},{signal:v(this,zr,"f").signal,headers:I([v(this,zr,"f").headers,Bh("compaction")])});if(c.content[0]?.type!=="text")throw new J("Expected text response for compaction");return v(this,Jt,"f").params.messages=[{role:"user",content:c.content}],!0},Symbol.asyncIterator)](){var t;if(v(this,Yp,"f"))throw new J("Cannot iterate over a consumed stream");M(this,Yp,!0,"f"),M(this,jl,!0,"f"),M(this,bs,void 0,"f");try{for(;;){let n;try{if(v(this,Jt,"f").params.max_iterations&&v(this,vy,"f")>=v(this,Jt,"f").params.max_iterations)break;M(this,jl,!1,"f"),M(this,bs,void 0,"f"),M(this,vy,(t=v(this,vy,"f"),t++,t),"f"),M(this,ni,void 0,"f");let{max_iterations:i,compactionControl:r,...o}=v(this,Jt,"f").params;if(o.stream?(n=this.client.beta.messages.stream({...o},v(this,zr,"f")),M(this,ni,n.finalMessage(),"f"),v(this,ni,"f").catch(()=>{}),yield n):(M(this,ni,this.client.beta.messages.create({...o,stream:!1},v(this,zr,"f")),"f"),yield v(this,ni,"f")),!await v(this,by,"m",JX).call(this)){if(!v(this,jl,"f")){let c=await v(this,ni,"f"),l=BDe(c.stop_reason);v(this,Jt,"f").params.messages.push({role:c.role,content:c.content});let{container:u}=v(this,Jt,"f").params;if(c.container&&(u==null?v(this,Jt,"f").params.container=c.container.id:typeof u=="object"&&u.id==null&&(v(this,Jt,"f").params.container={...u,id:c.container.id})),l==="stop")break;if(l==="resume")continue}let a=await v(this,by,"m",IL).call(this,v(this,Jt,"f").params.messages.at(-1));if(a)v(this,Jt,"f").params.messages.push(a);else if(!v(this,jl,"f"))break}}finally{n&&n.abort()}}if(!v(this,ni,"f"))throw new J("ToolRunner concluded without a message from the server");v(this,Qa,"f").resolve(await v(this,ni,"f"))}catch(n){throw M(this,Yp,!1,"f"),v(this,Qa,"f").promise.catch(()=>{}),v(this,Qa,"f").reject(n),M(this,Qa,Dp(),"f"),n}}setMessagesParams(t){typeof t=="function"?v(this,Jt,"f").params=t(v(this,Jt,"f").params):v(this,Jt,"f").params=t,M(this,jl,!0,"f"),M(this,bs,void 0,"f")}setRequestOptions(t){typeof t=="function"?M(this,zr,t(v(this,zr,"f")),"f"):M(this,zr,{...v(this,zr,"f"),...t},"f")}async generateToolResponse(t=v(this,zr,"f").signal){let n=await v(this,ni,"f")??this.params.messages.at(-1);return n?v(this,by,"m",IL).call(this,n,t):null}done(){return v(this,Qa,"f").promise}async runUntilDone(){if(!v(this,Yp,"f"))for await(let t of this);return this.done()}get params(){return v(this,Jt,"f").params}pushMessages(...t){this.setMessagesParams(n=>({...n,messages:[...n.messages,...t]}))}then(t,n){return this.runUntilDone().then(t,n)}};IL=async function(t,n=v(this,zr,"f").signal){return v(this,bs,"f")!==void 0?v(this,bs,"f"):(M(this,bs,FDe(v(this,Jt,"f").params,t,{...v(this,zr,"f"),signal:n}),"f"),v(this,bs,"f"))}});function YX(e){if(!e.output_format)return e;if(e.output_config?.format)throw new J("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...n}=e;return{...n,output_config:{...e.output_config,format:t}}}var ZX,qDe,vs,RL=j(()=>{Wp();gL();Se();hL();Ne();eo();vL();WX();AL();Il();gL();AL();Il();ZX={},qDe=["claude-mythos-preview","claude-opus-4-6"],vs=class extends Z{constructor(){super(...arguments),this.batches=new Kp(this._client)}create(t,n){let i=YX(t),{betas:r,user_profile_id:o,workspace_id:s,...a}=i;a.model in ZX&&console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${ZX[a.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),qDe.includes(a.model)&&a.thinking&&a.thinking.type==="enabled"&&console.warn(`Using Claude with ${a.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=n?.timeout??this._client._options.timeout;if(!a.stream&&c==null){let u=xS[a.model]??void 0;c=this._client.calculateNonstreamingTimeout(a.max_tokens,u)}let l=L_(a.tools,a.messages);return this._client.post("/v1/messages?beta=true",{body:a,timeout:c??6e5,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-user-profile-id":o}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},l,n?.headers]),stream:i.stream??!1})}parse(t,n){return n={...n,headers:I([{"anthropic-beta":[...t.betas??[],"structured-outputs-2025-12-15"].toString()},n?.headers])},this.create(t,n).then(i=>bL(i,t,{logger:this._client.logger??console}))}stream(t,n){return DS.createMessage(this,t,n)}countTokens(t,n){let i=YX(t),{betas:r,user_profile_id:o,workspace_id:s,...a}=i;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...n,headers:I([{"anthropic-beta":[...r??[],"token-counting-2024-11-01"].toString(),...o!=null?{"anthropic-user-profile-id":o}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},n?.headers])})}toolRunner(t,n){return new Qp(this._client,t,n)}};vs.Batches=Kp;vs.BetaToolRunner=Qp;vs.ToolError=Ae});var Xp,NL=j(()=>{Se();De();Me();Xp=class extends Z{retrieve(t,n){return this._client.get(N`/v1/organizations/api_keys/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/api_keys/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",pn,{query:t,...n})}}});var ef,CL=j(()=>{Se();ef=class extends Z{retrieve(t){return this._client.get("/v1/organizations/compliance_settings?beta=true",t)}update(t,n){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:t,...n})}}});var tf,PL=j(()=>{Se();De();Me();tf=class extends Z{create(t,n){return this._client.post("/v1/organizations/external_keys?beta=true",{body:t,...n})}retrieve(t,n){return this._client.get(N`/v1/organizations/external_keys/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/external_keys/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",le,{query:t,...n})}delete(t,n){return this._client.delete(N`/v1/organizations/external_keys/${t}?beta=true`,n)}validate(t,n){return this._client.post(N`/v1/organizations/external_keys/${t}/validate?beta=true`,n)}}});var nf,DL=j(()=>{Se();De();Me();nf=class extends Z{create(t,n){return this._client.post("/v1/organizations/invites?beta=true",{body:t,...n})}retrieve(t,n){return this._client.get(N`/v1/organizations/invites/${t}?beta=true`,n)}list(t={},n){return this._client.getAPIList("/v1/organizations/invites?beta=true",pn,{query:t,...n})}delete(t,n){return this._client.delete(N`/v1/organizations/invites/${t}?beta=true`,n)}}});var rf,OL=j(()=>{Se();De();rf=class extends Z{list(t={},n){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",le,{query:t,...n})}}});var of,ML=j(()=>{Se();De();Me();of=class extends Z{retrieve(t,n){return this._client.get(N`/v1/organizations/users/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/users/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/users?beta=true",pn,{query:t,...n})}remove(t,n){return this._client.delete(N`/v1/organizations/users/${t}?beta=true`,n)}}});var sf,LL=j(()=>{Se();De();Ne();Me();sf=class extends Z{create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/organizations/federation_issuers/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/federation_issuers/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/organizations/federation_issuers/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}}});var af,FL=j(()=>{Se();De();Ne();Me();af=class extends Z{list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{federation_rule_id:r,betas:o}=n;return this._client.delete(N`/v1/organizations/federation_rules/${r}/workspaces/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var zl,UL=j(()=>{Se();FL();FL();De();Ne();Me();zl=class extends Z{constructor(){super(...arguments),this.workspaces=new af(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/organizations/federation_rules/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/federation_rules/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/organizations/federation_rules/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}};zl.Workspaces=af});var Xa,jL=j(()=>{Se();LL();LL();UL();UL();Xa=class extends Z{constructor(){super(...arguments),this.issuers=new sf(this._client),this.rules=new zl(this._client)}};Xa.Issuers=sf;Xa.Rules=zl});var cf,zL=j(()=>{Se();De();Ne();Me();cf=class extends Z{list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{service_account_id:r,betas:o}=n;return this._client.delete(N`/v1/organizations/service_accounts/${r}/workspaces/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var Gl,GL=j(()=>{Se();zL();zL();De();Ne();Me();Gl=class extends Z{constructor(){super(...arguments),this.workspaces=new cf(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/organizations/service_accounts/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/service_accounts/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/organizations/service_accounts/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}};Gl.Workspaces=cf});var lf,VL=j(()=>{Se();De();Me();lf=class extends Z{retrieve(t,n,i){let{workspace_id:r}=n;return this._client.get(N`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,i)}update(t,n,i){let{workspace_id:r,...o}=n;return this._client.post(N`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,{body:o,...i})}list(t,n={},i){return this._client.getAPIList(N`/v1/organizations/workspaces/${t}/members?beta=true`,pn,{query:n,...i})}add(t,n,i){return this._client.post(N`/v1/organizations/workspaces/${t}/members?beta=true`,{body:n,...i})}remove(t,n,i){let{workspace_id:r}=n;return this._client.delete(N`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,i)}}});var uf,BL=j(()=>{Se();De();Me();uf=class extends Z{list(t,n={},i){return this._client.getAPIList(N`/v1/organizations/workspaces/${t}/rate_limits?beta=true`,le,{query:n,...i})}}});var df,qL=j(()=>{Se();De();Ne();Me();df=class extends Z{retrieve(t,n,i){let{workspace_id:r,betas:o}=n;return this._client.get(N`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}update(t,n,i){let{workspace_id:r,betas:o,...s}=n;return this._client.post(N`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{body:s,...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{workspace_id:r,betas:o}=n;return this._client.delete(N`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var ws,WL=j(()=>{Se();VL();VL();BL();BL();qL();qL();De();Ne();Me();ws=class extends Z{constructor(){super(...arguments),this.rateLimits=new uf(this._client),this.members=new lf(this._client),this.serviceAccounts=new df(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/workspaces?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n){return this._client.get(N`/v1/organizations/workspaces/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/workspaces/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",pn,{query:t,...n})}archive(t,n){return this._client.post(N`/v1/organizations/workspaces/${t}/archive?beta=true`,n)}};ws.RateLimits=uf;ws.Members=lf;ws.ServiceAccounts=df});var vr,HL=j(()=>{Se();NL();NL();CL();CL();PL();PL();DL();DL();OL();OL();ML();ML();jL();jL();GL();GL();WL();WL();vr=class extends Z{constructor(){super(...arguments),this.apiKeys=new Xp(this._client),this.externalKeys=new tf(this._client),this.federation=new Xa(this._client),this.invites=new nf(this._client),this.serviceAccounts=new Gl(this._client),this.users=new of(this._client),this.workspaces=new ws(this._client),this.rateLimits=new rf(this._client),this.complianceSettings=new ef(this._client)}retrieve(t){return this._client.get("/v1/organizations/me?beta=true",t)}};vr.APIKeys=Xp;vr.ExternalKeys=tf;vr.Federation=Xa;vr.Invites=nf;vr.ServiceAccounts=Gl;vr.Users=of;vr.Workspaces=ws;vr.RateLimits=rf;vr.ComplianceSettings=ef});var Vl,KL=j(()=>{Se();De();Ne();Me();sS();sS();Vl=class extends Z{list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/sessions/${t}/events?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}send(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/sessions/${t}/events?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}stream(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.get(N`/v1/sessions/${t}/events/stream?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),stream:!0})}toolRunner(t,n){return new Ba(t,{...n,client:this._client})}};Vl.SessionToolRunner=Ba});var pf,JL=j(()=>{Se();De();Ne();Me();pf=class extends Z{retrieve(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/sessions/${r}/resources/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/sessions/${r}/resources/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/sessions/${t}/resources?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.delete(N`/v1/sessions/${r}/resources/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}add(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/sessions/${t}/resources?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var ff,ZL=j(()=>{Se();De();Ne();Me();ff=class extends Z{list(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.getAPIList(N`/v1/sessions/${r}/threads/${t}/events?beta=true`,le,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}stream(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(N`/v1/sessions/${r}/threads/${t}/stream?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),stream:!0})}}});var Bl,YL=j(()=>{Se();ZL();ZL();De();Ne();Me();Bl=class extends Z{constructor(){super(...arguments),this.events=new ff(this._client)}retrieve(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/sessions/${r}/threads/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/sessions/${t}/threads?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/sessions/${r}/threads/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}};Bl.Events=ff});var ks,QL=j(()=>{Se();KL();KL();JL();JL();YL();YL();De();Ne();Me();ks=class extends Z{constructor(){super(...arguments),this.events=new Vl(this._client),this.resources=new pf(this._client),this.threads=new Bl(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/sessions?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/sessions/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/sessions/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/sessions?beta=true",P_,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/sessions/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/sessions/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};ks.Events=Vl;ks.Resources=pf;ks.Threads=Bl});var mf,XL=j(()=>{Se();De();Ne();gs();Me();mf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/skills/${t}/versions?beta=true`,xi({body:s,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])},this._client,!1))}retrieve(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/skills/${r}/versions/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/skills/${t}/versions?beta=true`,le,{query:s,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.delete(N`/v1/skills/${r}/versions/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}download(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/skills/${r}/versions/${t}/content?beta=true`,{...i,headers:I([{Accept:"application/binary",...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__binaryResponse:!0})}}});var ql,eF=j(()=>{Se();XL();XL();De();Ne();gs();Me();ql=class extends Z{constructor(){super(...arguments),this.versions=new mf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/skills?beta=true",xi({body:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])},this._client,!1))}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/skills/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/skills?beta=true",le,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/skills/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};ql.Versions=mf});var gf,tF=j(()=>{Se();De();Ne();Me();gf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/tunnels/${t}/certificates?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}retrieve(t,n,i){let{tunnel_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/tunnels/${r}/certificates/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/tunnels/${t}/certificates?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n,i){let{tunnel_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/tunnels/${r}/certificates/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Wl,nF=j(()=>{Se();tF();tF();De();Ne();Me();Wl=class extends Z{constructor(){super(...arguments),this.certificates=new gf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/tunnels?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/tunnels/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/tunnels?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/tunnels/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}revealToken(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/tunnels/${t}/reveal_token?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}rotateToken(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/tunnels/${t}/rotate_token?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Wl.Certificates=gf});var hf,rF=j(()=>{Se();De();Ne();Me();hf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/vaults/${t}/credentials?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}retrieve(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/vaults/${r}/credentials/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{vault_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/vaults/${r}/credentials/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/vaults/${t}/credentials?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.delete(N`/v1/vaults/${r}/credentials/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}archive(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/vaults/${r}/credentials/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}mcpOAuthValidate(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/vaults/${r}/credentials/${t}/mcp_oauth_validate?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Hl,iF=j(()=>{Se();rF();rF();De();Ne();Me();Hl=class extends Z{constructor(){super(...arguments),this.credentials=new hf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/vaults?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/vaults/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/vaults/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/vaults?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/vaults/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/vaults/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Hl.Credentials=hf});var jt,oF=j(()=>{Se();_M();_M();SM();SM();xM();xM();TM();TM();IM();IM();AM();AM();PM();PM();OM();OM();uL();uL();fL();fL();RL();RL();HL();HL();QL();QL();eF();eF();nF();nF();iF();iF();jt=class extends Z{constructor(){super(...arguments),this.models=new bp(this._client),this.messages=new vs(this._client),this.agents=new Tl(this._client),this.environments=new Fl(this._client),this.sessions=new ks(this._client),this.deployments=new gp(this._client),this.deploymentRuns=new mp(this._client),this.vaults=new Hl(this._client),this.memoryStores=new Ja(this._client),this.files=new yp(this._client),this.skills=new ql(this._client),this.webhooks=new kp(this._client),this.userProfiles=new vp(this._client),this.dreams=new hp(this._client),this.tunnels=new Wl(this._client),this.organization=new vr(this._client)}};jt.Models=bp;jt.Messages=vs;jt.Agents=Tl;jt.Environments=Fl;jt.Sessions=ks;jt.Deployments=gp;jt.DeploymentRuns=mp;jt.Vaults=Hl;jt.MemoryStores=Ja;jt.Files=yp;jt.Skills=ql;jt.Webhooks=kp;jt.UserProfiles=vp;jt.Dreams=hp;jt.Tunnels=Wl;jt.Organization=vr});var Kl,sF=j(()=>{Se();Ne();Kl=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers]),stream:t.stream??!1})}}});var Jl,aF=j(()=>{Se();De();Ne();eo();gs();Me();Jl=class extends Z{list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/files",le,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(N`/v1/files/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}download(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/files/${t}/content`,{...i,headers:I([{Accept:"application/binary",...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/files/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}upload(t,n){let{workspace_id:i,...r}=t;return this._client.post("/v1/files",xi({body:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},F_(r.file),n?.headers])},this._client))}}});function QX(e){return e?.output_config?.format}function cF(e,t,n){let i=QX(t);return!t||!("parse"in(i??{}))?{...e,content:e.content.map(r=>r.type==="text"?Object.defineProperty({...r},"parsed_output",{value:null,enumerable:!1}):r),parsed_output:null}:lF(e,t,n)}function lF(e,t,n){let i=null,r=e.content.map(o=>{if(o.type==="text"){let s=kOe(t,o.text);return i===null&&(i=s),Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1})}return o});return{...e,content:r,parsed_output:i}}function kOe(e,t){let n=QX(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(i){throw new J(`Failed to parse structured output: ${i}`)}}var uF=j(()=>{kt()});function hF(e){return e.type==="tool_use"||e.type==="server_tool_use"}var Ri,ec,yf,wy,OS,ky,$y,MS,_y,Fo,Sy,LS,FS,Zl,US,jS,zS,xy,dF,XX,pF,fF,mF,gF,e7,GS,t7=j(()=>{gr();eo();Da();hr();Wp();wL();uF();kL();GS=class e{constructor(t,n){Ri.add(this),this.messages=[],this.receivedMessages=[],ec.set(this,void 0),yf.set(this,null),this.controller=new AbortController,wy.set(this,void 0),OS.set(this,()=>{}),ky.set(this,()=>{}),$y.set(this,void 0),MS.set(this,()=>{}),_y.set(this,()=>{}),Fo.set(this,{}),Sy.set(this,!1),LS.set(this,!1),FS.set(this,!1),Zl.set(this,!1),US.set(this,void 0),jS.set(this,void 0),zS.set(this,void 0),xy.set(this,void 0),pF.set(this,i=>{if(M(this,LS,!0,"f"),Yr(i)&&(i=new In),i instanceof In)return M(this,FS,!0,"f"),this._emit("abort",i);if(i instanceof J)return this._emit("error",i);if(i instanceof Error){let r=new J(i.message);return r.cause=i,this._emit("error",r)}return this._emit("error",new J(String(i)))}),M(this,wy,new Promise((i,r)=>{M(this,OS,i,"f"),M(this,ky,r,"f")}),"f"),M(this,$y,new Promise((i,r)=>{M(this,MS,i,"f"),M(this,_y,r,"f")}),"f"),v(this,wy,"f").catch(()=>{}),v(this,$y,"f").catch(()=>{}),M(this,yf,t,"f"),M(this,xy,n?.logger??console,"f")}get response(){return v(this,US,"f")}get request_id(){return v(this,jS,"f")}get workspace_id(){return v(this,zS,"f")}async withResponse(){M(this,Zl,!0,"f");let t=await v(this,wy,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id"),workspace_id:t.headers.get("anthropic-workspace-id")}}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,i,{logger:r}={}){let o=new e(n,{logger:r});for(let s of n.messages)o._addMessageParam(s);return M(o,yf,{...n,stream:!0},"f"),o._run(()=>o._createMessage(t,{...n,stream:!0},{...i,headers:{...i?.headers,[M_]:"stream"}})),o}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},v(this,pF,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,i){let r=i?.signal,o;r&&(r.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o));try{v(this,Ri,"m",fF).call(this);let{response:s,data:a}=await t.create({...n,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)v(this,Ri,"m",mF).call(this,c);if(a.controller.signal?.aborted)throw new In;v(this,Ri,"m",gF).call(this)}finally{r&&o&&r.removeEventListener("abort",o)}}_connected(t){this.ended||(M(this,US,t,"f"),M(this,jS,t?.headers.get("request-id"),"f"),M(this,zS,t?.headers.get("anthropic-workspace-id"),"f"),v(this,OS,"f").call(this,t),this._emit("connect"))}get ended(){return v(this,Sy,"f")}get errored(){return v(this,LS,"f")}get aborted(){return v(this,FS,"f")}abort(){this.controller.abort()}on(t,n){return(v(this,Fo,"f")[t]||(v(this,Fo,"f")[t]=[])).push({listener:n}),this}off(t,n){let i=v(this,Fo,"f")[t];if(!i)return this;let r=i.findIndex(o=>o.listener===n);return r>=0&&i.splice(r,1),this}once(t,n){return(v(this,Fo,"f")[t]||(v(this,Fo,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,i)=>{M(this,Zl,!0,"f"),t!=="error"&&this.once("error",i),this.once(t,n)})}async done(){M(this,Zl,!0,"f"),await v(this,$y,"f")}get currentMessage(){return v(this,ec,"f")}async finalMessage(){return await this.done(),v(this,Ri,"m",dF).call(this)}async finalText(){return await this.done(),v(this,Ri,"m",XX).call(this)}_emit(t,...n){if(v(this,Sy,"f"))return;t==="end"&&(M(this,Sy,!0,"f"),v(this,MS,"f").call(this));let i=v(this,Fo,"f")[t];if(i&&(v(this,Fo,"f")[t]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),t==="abort"){let r=n[0];!v(this,Zl,"f")&&!i?.length&&Promise.reject(r),v(this,ky,"f").call(this,r),v(this,_y,"f").call(this,r),this._emit("end");return}if(t==="error"){let r=n[0];!v(this,Zl,"f")&&!i?.length&&Promise.reject(r),v(this,ky,"f").call(this,r),v(this,_y,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",v(this,Ri,"m",dF).call(this))}async _fromReadableStream(t,n){let i=n?.signal,r;i&&(i.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),i.addEventListener("abort",r));try{v(this,Ri,"m",fF).call(this),this._connected(null);let o=Fr.fromReadableStream(t,this.controller);for await(let s of o)v(this,Ri,"m",mF).call(this,s);if(o.controller.signal?.aborted)throw new In;v(this,Ri,"m",gF).call(this)}finally{i&&r&&i.removeEventListener("abort",r)}}[(ec=new WeakMap,yf=new WeakMap,wy=new WeakMap,OS=new WeakMap,ky=new WeakMap,$y=new WeakMap,MS=new WeakMap,_y=new WeakMap,Fo=new WeakMap,Sy=new WeakMap,LS=new WeakMap,FS=new WeakMap,Zl=new WeakMap,US=new WeakMap,jS=new WeakMap,zS=new WeakMap,xy=new WeakMap,pF=new WeakMap,Ri=new WeakSet,dF=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},XX=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(n.length===0)throw new J("stream ended without producing a content block with type=text");return n.join(" ")},fF=function(){this.ended||M(this,ec,void 0,"f")},mF=function(n){if(this.ended)return;let i=v(this,Ri,"m",e7).call(this,n);switch(this._emit("streamEvent",n,i),n.type){case"content_block_delta":{let r=i.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{hF(r)&&v(this,Fo,"f").inputJson?.length&&this._emit("inputJson",n.delta.partial_json,r.input);break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(cF(i,v(this,yf,"f"),{logger:v(this,xy,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{M(this,ec,i,"f");break}case"content_block_start":case"message_delta":break}},gF=function(){if(this.ended)throw new J("stream has ended, this shouldn't happen");let n=v(this,ec,"f");if(!n)throw new J("request ended without sending any chunks");return M(this,ec,void 0,"f"),cF(n,v(this,yf,"f"),{logger:v(this,xy,"f")})},e7=function(n){let i=v(this,ec,"f");if(n.type==="message_start"){if(i)throw new J(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!i)throw new J(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return i;case"message_delta":return i.stop_reason=n.delta.stop_reason,i.stop_sequence=n.delta.stop_sequence,i.stop_details=n.delta.stop_details,i.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(i.container=n.delta.container),n.usage.input_tokens!=null&&(i.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(i.usage.server_tool_use=n.usage.server_tool_use),n.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=n.usage.output_tokens_details),i;case"content_block_start":return i.content.push({...n.content_block}),i;case"content_block_delta":{let r=i.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(i.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(i.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&hF(r)){let o=(r[Za]||"")+n.delta.partial_json;i.content[n.index]=ES(r,o)}break}case"thinking_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,signature:n.delta.signature});break}default:n.delta}return i}case"content_block_stop":{let r=i.content.at(n.index);return r&&hF(r)&&Za in r&&Object.defineProperty(r,"input",{value:r.input,enumerable:!0,configurable:!0,writable:!0}),i}}},Symbol.asyncIterator)](){let t=[],n=[],i=!1;return this.on("streamEvent",r=>{let o=n.shift();o?o.resolve(r):t.push(r)}),this.on("end",()=>{i=!0;for(let r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((o,s)=>n.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 Fr(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var bf,yF=j(()=>{Se();De();Ne();mL();Wp();Me();bf=class extends Z{create(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;return this._client.post("/v1/messages/batches",{body:o,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/messages/batches/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/messages/batches",pn,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(N`/v1/messages/batches/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}cancel(t,n={},i){let{workspace_id:r}=n??{};return this._client.post(N`/v1/messages/batches/${t}/cancel`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}async results(t,n={},i){let r=await this.retrieve(t,n,i);if(!r.results_url)throw new J(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{workspace_id:o}=n??{};return this._client.get(r.results_url,{...i,headers:I([{Accept:"application/binary",...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,a)=>Hp.fromResponse(a.response,a.controller))}}});var tc,n7,_Oe,bF=j(()=>{Se();Ne();eo();t7();uF();yF();yF();hL();tc=class extends Z{constructor(){super(...arguments),this.batches=new bf(this._client)}create(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;o.model in n7&&console.warn(`The model '${o.model}' is deprecated and will reach end-of-life on ${n7[o.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),_Oe.includes(o.model)&&o.thinking&&o.thinking.type==="enabled"&&console.warn(`Using Claude with ${o.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let s=n?.timeout??this._client._options.timeout;if(!o.stream&&s==null){let c=xS[o.model]??void 0;s=this._client.calculateNonstreamingTimeout(o.max_tokens,c)}let a=L_(o.tools,o.messages);return this._client.post("/v1/messages",{body:o,timeout:s??6e5,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},a,n?.headers]),stream:t.stream??!1})}parse(t,n){return this.create(t,n).then(i=>lF(i,t,{logger:this._client.logger??console}))}stream(t,n){return GS.createMessage(this,t,n,{logger:this._client.logger??console})}countTokens(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;return this._client.post("/v1/messages/count_tokens",{body:o,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}},n7={},_Oe=["claude-mythos-preview","claude-opus-4-6"];tc.Batches=bf});var Yl,vF=j(()=>{Se();De();Ne();Me();Yl=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/models/${t}`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/models",pn,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var vf,wF=j(()=>{Se();De();Ne();gs();Me();vf=class extends Z{create(t,n,i){let{workspace_id:r,...o}=n;return this._client.post(N`/v1/skills/${t}/versions`,xi({body:o,...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])},this._client,!1))}retrieve(t,n,i){let{skill_id:r,workspace_id:o}=n;return this._client.get(N`/v1/skills/${r}/versions/${t}`,{...i,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t,n={},i){let{workspace_id:r,...o}=n??{};return this._client.getAPIList(N`/v1/skills/${t}/versions`,le,{query:o,...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}delete(t,n,i){let{skill_id:r,workspace_id:o}=n;return this._client.delete(N`/v1/skills/${r}/versions/${t}`,{...i,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var nc,kF=j(()=>{Se();wF();wF();De();Ne();gs();Me();nc=class extends Z{constructor(){super(...arguments),this.versions=new vf(this._client)}create(t,n){let{workspace_id:i,...r}=t;return this._client.post("/v1/skills",xi({body:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])},this._client,!1))}retrieve(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/skills/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/skills",le,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(N`/v1/skills/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}};nc.Versions=vf});var r7=j(()=>{yQ();oF();sF();aF();bF();vF();kF()});var $F,_F,VS,i7,SF,xF,Ot,no,EF=j(()=>{gr();hr();cp();Da();p_();m_();lp();WO();eM();Ah();kt();dp();G5();aQ();fQ();De();kM();r7();N_();sF();aF();vF();oF();bF();kF();p_();Ne();pp();Xi();hr();SF="\\n\\nHuman:",xF="\\n\\nAssistant:",Ot=class{get credentials(){return this._authState.provider}constructor({baseURL:t=ze("ANTHROPIC_BASE_URL"),apiKey:n,authToken:i,webhookKey:r=ze("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...o}={}){if($F.add(this),this._requestAuthFlags=new WeakMap,VS.set(this,void 0),n===void 0&&(n=o.profile!=null?null:ze("ANTHROPIC_API_KEY")??null),i===void 0&&(i=o.profile!=null?null:ze("ANTHROPIC_AUTH_TOKEN")??null),o.profile!=null&&(o.credentials!=null||o.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:n,authToken:i,webhookKey:r,...o,baseURL:t||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&b5())throw new J(`It looks like you're running in a browser-like environment. +`)}})}async function $Me(e,t,n,r,i){let o=new SMe(t,n,r,i);if(o.rangeIsEmpty())return"";let s=xy.createReadStream(e,{highWaterMark:hMe});try{for await(let a of s)if(o.collectFrom(a),o.rangeIsCollected())break}finally{s.destroy()}return o.text()}function xee(e){return Sl(e.unrestrictedPaths),yl({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:t,content:n})=>{if(!t)throw new Me("write: file_path is required");let r=await Ep(e,t),i=await kee(e,r);if(i!==void 0)throw new Me(`write: ${t} is inside read-only directory ${i}`);try{await An.mkdir(yr.dirname(r),{recursive:!0,mode:by}),await zL(r,n??"")}catch(o){throw new Me(`write: ${kp(o,t)}`)}return`wrote ${Buffer.byteLength(n??"")} bytes to ${t}`}})}function Eee(e){return Sl(e.unrestrictedPaths),yl({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:t,old_string:n,new_string:r,replace_all:i})=>{if(!t)throw new Me("edit: file_path is required");if(!n)throw new Me("edit: old_string is required");let o=await Ep(e,t),s=await kee(e,o);if(s!==void 0)throw new Me(`edit: ${t} is inside read-only directory ${s}`);let a;try{let u=await An.stat(o);if(!u.isFile())throw new Me(`edit: ${t} is not a regular file`);let d=wee(e.maxFileBytes);if(d!==null&&u.size>d)throw new Me(`edit: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. The edit tool loads the whole file and cannot modify a file this large.`);a=await An.readFile(o,"utf8")}catch(u){throw u instanceof Me?u:new Me(`edit: ${kp(u,t)}`)}let c=a.split(n).length-1;if(c===0)throw new Me(`edit: old_string not found in ${t}`);let l;if(i)l=a.split(n).join(r);else{if(c>1)throw new Me(`edit: old_string appears ${c} times in ${t} (must be unique)`);l=a.replace(n,()=>r)}try{await zL(o,l)}catch(u){throw new Me(`edit: write: ${kp(u,t)}`)}return`edited ${t} (${i?c:1} replacement(s))`}})}function xMe(e){return e.split(/[\\/{},]/).includes("..")}function Tee(e){return Sl(e.unrestrictedPaths),yl({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:t,path:n})=>{if(!t)throw new Me("glob: pattern is required");if(yr.isAbsolute(t))throw new Me("glob: absolute pattern not permitted; pass a relative pattern (and optionally path)");if(xMe(t))throw new Me('glob: ".." is not permitted in the pattern');let r=n?await Ep(e,n):yr.resolve(e.workdir),i=n?r:await yy(r),o=[],s=Aee;try{for await(let a of wMe(t,{cwd:r,withFileTypes:!0,exclude:c=>c.name===".git"||c.name==="node_modules"})){if(s--<=0)break;if(!a.isFile())continue;let c=yr.join(a.parentPath,a.name),l;try{l=await An.realpath(c)}catch{continue}if(!IS(i,l))continue;let u=0;try{u=(await An.stat(c)).mtimeMs}catch{}o.push({path:c,mtime:u})}}catch(a){throw new Me(`glob: ${a instanceof Error?a.message:String(a)}`)}return o.length===0?"no matches":(o.sort((a,c)=>c.mtime-a.mtime),o.slice(0,bMe).map(a=>a.path).join(` +`))}})}function Iee(e){return Sl(e.unrestrictedPaths),yl({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:t,path:n},r)=>{if(!t)throw new Me("grep: pattern is required");let i=yr.resolve(e.workdir);n&&(i=await Ep(e,n));let o=await RMe();return o?EMe(o,t,i,r?.signal):TMe(t,i,r?.signal)}})}function EMe(e,t,n,r){return new Promise((i,o)=>{let s=eF.spawn(e,["-n","--no-heading","-e",t,"--",n],{...r?{signal:r}:{}}),a="",c="",l=!1;s.stdout.on("data",u=>{l||(a+=u,a.length>Sy&&(l=!0,a=a.slice(0,Sy),s.kill("SIGKILL")))}),s.stderr.on("data",u=>c+=u),s.on("close",u=>{if(r?.aborted)return o(new Me("grep: aborted"));if(l)return i(a+` +[output truncated at ${Sy} bytes]`);if(u===0)return i(a);if(u===1)return i("no matches");o(new Me(`grep: rg failed: ${c||`exit ${u}`}`))}),s.on("error",u=>{if(r?.aborted)return o(new Me("grep: aborted"));o(new Me(`grep: rg failed: ${u.message}`))})})}async function TMe(e,t,n){let r;try{r=new RegExp(e)}catch(c){throw new Me(`grep: invalid regex: ${c instanceof Error?c.message:String(c)}`)}let i=[],o=Sy,s=c=>(o-=c.length+1,o<0?(i.push(`[output truncated at ${Sy} bytes]`),!1):(i.push(c),!0));if((await An.stat(t).catch(()=>null))?.isFile()?await hee(t,r,s):await AMe(t,"",c=>hee(yr.join(t,c),r,s),n),n?.aborted)throw new Me("grep: aborted");return i.length===0?"no matches":i.join(` +`)}async function hee(e,t,n){let r=xy.createReadStream(e,{encoding:"utf8"}),i=bee.createInterface({input:r,crlfDelay:1/0}),o=0;try{for await(let s of i)if(o++,!(s.length>yMe)&&t.test(s)&&!n(`${e}:${o}:${s}`))return!1}catch{}finally{r.destroy()}return!0}async function AMe(e,t,n,r){let i=Aee;async function o(s,a){if(a>IMe)return!0;if(r?.aborted)return!1;let c;try{c=await An.readdir(yr.join(e,s),{withFileTypes:!0})}catch{return!0}for(let l of c){if(l.name===".git"||l.name==="node_modules")continue;if(i--<=0||r?.aborted)return!1;let u=s?yr.join(s,l.name):l.name;if(l.isDirectory()){if(!await o(u,a+1))return!1}else if(l.isFile()&&await n(u)===!1)return!1}return!0}await o(t,0)}async function RMe(){let e=(process.env.PATH??"").split(yr.delimiter);for(let t of e){let n=yr.join(t,"rg");try{return await An.access(n,xy.constants.X_OK),n}catch{}}return null}var An,xy,yr,eF,yee,bee,MS,hr,Mr,ky,wl,Pi,XL,LS,_y,FS,jS,kl,_l,xp,$l,$y,ja,pee,fee,mee,vee,gMe,hMe,gee,Sy,yMe,bMe,US,vMe,wMe,_ee,SMe,IMe,Aee,Pee=O(()=>{er();An=gt(require("node:fs/promises"),1),xy=gt(require("node:fs"),1),yr=gt(require("node:path"),1),eF=gt(require("node:child_process"),1),yee=gt(require("node:crypto"),1),bee=gt(require("node:readline"),1);_t();gp();F7();jL();GL();B7();dee();mee=100*1024,vee=12e4,gMe=256*1024,hMe=64*1024,gee=Buffer.from(` +`),Sy=100*1024,yMe=2e3,bMe=200,US=class extends Y{constructor(t){super(`bash command timed out after ${t}ms`),this.name="BashTimeoutError",this.timeoutMs=t}},vMe=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,wMe=An.glob;_ee=(()=>{class e{constructor(n,r=_Me()){MS.add(this),hr.set(this,void 0),Mr.set(this,""),ky.set(this,!1),wl.set(this,!1),Pi.set(this,null),D(this,hr,eF.spawn("/bin/bash",["--noprofile","--norc"],{cwd:n,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),y(this,hr,"f").stdout.setEncoding("utf8"),y(this,hr,"f").stderr.setEncoding("utf8"),y(this,hr,"f").stdout.on("data",i=>y(this,MS,"m",XL).call(this,i)),y(this,hr,"f").stderr.on("data",i=>y(this,MS,"m",XL).call(this,i)),y(this,hr,"f").once("close",()=>{D(this,wl,!0,"f");let i=y(this,Pi,"f");D(this,Pi,null,"f"),i?.resolve()})}get closed(){return y(this,wl,"f")}async exec(n,r={}){if(y(this,wl,"f"))throw new Y("bash session terminated");let i=r.timeoutMs??vee,o=r.signal;o?.throwIfAborted(),D(this,Mr,"","f"),D(this,ky,!1,"f");let s=`__ANT_CMD_${yee.randomUUID()}_DONE__`,a=`${s.slice(0,8)}''${s.slice(8)}`,c=`{ ${n} +} &1; printf '\\n${a}%d\\n' $? +`;if(y(this,hr,"f").stdin.write(c),y(this,Mr,"f").indexOf(s)<0){let{promise:m,resolve:g}=wp();D(this,Pi,{sentinel:s,resolve:g},"f");let h,v;try{await Promise.race([m,new Promise((b,w)=>{h=setTimeout(()=>w(new US(i)),i)}),new Promise((b,w)=>{o&&(v=()=>w(o.reason),o.addEventListener("abort",v,{once:!0}))})])}finally{h&&clearTimeout(h),v&&o&&o.removeEventListener("abort",v),D(this,Pi,null,"f")}}let l=y(this,Mr,"f").indexOf(s);if(l<0)throw new Y("bash session terminated");let d=y(this,Mr,"f").slice(l+s.length).match(/^(-?\d+)/),p=d?parseInt(d[1],10):-1,f=y(this,Mr,"f").slice(0,l).replace(vMe,"").replace(/\n+$/,"");return y(this,ky,"f")&&(f=`[output truncated] +${f}`),{output:f,exitCode:p}}close(){if(y(this,wl,"f"))return;D(this,wl,!0,"f");let n=y(this,Pi,"f");D(this,Pi,null,"f"),n?.resolve(),y(this,hr,"f").stdout.destroy(),y(this,hr,"f").stderr.destroy(),y(this,hr,"f").stdin.destroy();try{process.kill(-y(this,hr,"f").pid,"SIGKILL")}catch{y(this,hr,"f").kill("SIGKILL")}y(this,hr,"f").unref()}}return hr=new WeakMap,Mr=new WeakMap,ky=new WeakMap,wl=new WeakMap,Pi=new WeakMap,MS=new WeakSet,XL=function(n){if(D(this,Mr,y(this,Mr,"f")+n,"f"),y(this,Mr,"f").length>mee&&(D(this,Mr,y(this,Mr,"f").slice(y(this,Mr,"f").length-mee),"f"),D(this,ky,!0,"f")),y(this,Pi,"f")&&y(this,Mr,"f").indexOf(y(this,Pi,"f").sentinel)>=0){let r=y(this,Pi,"f");D(this,Pi,null,"f"),r.resolve()}},e})();SMe=(()=>{class e{constructor(n,r,i,o){LS.add(this),_y.set(this,void 0),FS.set(this,void 0),jS.set(this,void 0),kl.set(this,void 0),_l.set(this,void 0),xp.set(this,void 0),$l.set(this,0),$y.set(this,[]),ja.set(this,0),D(this,_y,n,"f"),D(this,FS,r,"f"),D(this,jS,i,"f"),D(this,kl,Math.max(0,r-1),"f"),D(this,_l,i>0?i:1/0,"f"),D(this,xp,o,"f")}rangeIsEmpty(){return y(this,_l,"f")<=y(this,kl,"f")}rangeIsCollected(){return y(this,$l,"f")>=y(this,_l,"f")}collectFrom(n){var r;let i=0;for(;i=y(this,kl,"f")&&y(this,LS,"m",pee).call(this,n.subarray(i,s),o>=0),o<0)break;D(this,$l,(r=y(this,$l,"f"),r++,r),"f"),i=o+1}}text(){return Buffer.concat(y(this,$y,"f"),y(this,ja,"f")).toString("utf8")}}return _y=new WeakMap,FS=new WeakMap,jS=new WeakMap,kl=new WeakMap,_l=new WeakMap,xp=new WeakMap,$l=new WeakMap,$y=new WeakMap,ja=new WeakMap,LS=new WeakSet,pee=function(n,r){if(y(this,$y,"f").push(n),D(this,ja,y(this,ja,"f")+n.length,"f"),r&&y(this,$l,"f")+1y(this,xp,"f"))throw y(this,LS,"m",fee).call(this)},fee=function(){return y(this,_l,"f")-y(this,kl,"f")===1?new Me(`read: line ${y(this,kl,"f")+1} of ${y(this,_y,"f")} alone exceeds ${y(this,xp,"f")}-byte limit. The read tool cannot return part of a line, so view_range cannot narrow this further.`):new Me(`read: view_range [${y(this,FS,"f")}, ${y(this,jS,"f")}] of ${y(this,_y,"f")} exceeds ${y(this,xp,"f")}-byte limit. Narrow the view_range to read a smaller portion.`)},e})();IMe=40,Aee=5e4});function NMe(e){return e.resources.some(t=>t.type==="memory_store")}function DMe(e){if(!e)return null;let t;try{let r=e.replace(/-/g,"+").replace(/_/g,"/"),i=r.padEnd(Math.ceil(r.length/4)*4,"=");t=JSON.parse(pl(FX(i)))}catch{return null}if(t===null||typeof t!="object"||Array.isArray(t))return null;let n=t.sessions_token;return typeof n=="string"&&n!==""?n:null}async function Nee(e,t){let n;try{return await Promise.race([e.then(()=>!1,()=>!1),new Promise(r=>{n=setTimeout(()=>r(!0),t)})])}finally{n!==void 0&&clearTimeout(n)}}async function OMe(e,t,n,r){try{await e.beta.environments.work.stop(t.id,{environment_id:t.environment_id,force:!0},{...r,headers:I([r?.headers])})}catch(i){jn(i,409)||n.error("force-stop on exit failed",{work_id:t.id,error:String(i)})}}function LMe(e){let t=e instanceof Mt?e.error:void 0;for(let n of["error","details","current_state"]){if(!zM(t))return{};t=t[n]}return zM(t)?t:{}}async function FMe(e,t,n,r,i,o){let s=Cee,a=PMe,c=Date.now(),l=CMe,u=async()=>{let d=new AbortController,p=Da(n.signal,d),f=setTimeout(()=>d.abort(),s);try{let m=await e.beta.environments.work.heartbeat(t.id,{environment_id:t.environment_id,expected_last_heartbeat:l},{...i,headers:I([i?.headers]),signal:d.signal});c=Date.now(),l=m.last_heartbeat,m.ttl_seconds>0&&(a=m.ttl_seconds*1e3,s=Math.max(1e3,Math.min(a/2,Cee)),o?.(a)),(m.state==="stopping"||m.state==="stopped")&&(r.info("heartbeat signals shutdown",{work_id:t.id,state:m.state}),n.finish("control_plane_stop")),m.lease_extended||(r.warn("lease not extended, shutting down",{work_id:t.id}),n.finish("control_plane_stop"))}catch(m){if(n.signal.throwIfAborted(),jn(m,412)){let g=LMe(m);r.error("lease lost: heartbeat precondition failed",{work_id:t.id,server_state:g.state,server_ttl_seconds:g.ttl_seconds,server_last_heartbeat:g.last_heartbeat}),n.finish("lease_lost");return}if(gl(m))throw r.error("permanent heartbeat failure",{work_id:t.id,error:String(m)}),n.finish("heartbeat_rejected"),m;if(Date.now()-c>a){r.error("lease assumed lost: no successful heartbeat in ttl",{work_id:t.id,ttl_ms:a,error:String(m)}),n.finish("assumed_lost");return}r.warn("transient heartbeat failure",{work_id:t.id,error:String(m)})}finally{clearTimeout(f),p()}};for(await u();!n.signal.aborted;)await Xi(s,n.signal),n.signal.throwIfAborted(),await u()}var zS,Ey,tF,Ty,Tp,Cee,PMe,CMe,nF,MMe,Dee=O(()=>{er();_t();xi();tL();Zd();Kd();Vd();sy();lS();$i();Ee();FL();DL();NL();TS();Cee=3e4,PMe=9e4,CMe="NO_HEARTBEAT";nF=(()=>{class e{constructor(n){if(zS.add(this),Ey.set(this,void 0),n.unrestrictedPaths!==void 0)throw new Y("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory.");this.client=n.client,this.environmentId=n.environmentId,this.environmentKey=n.environmentKey,this.tools=n.tools,this.workdir=n.workdir??process.cwd(),this.maxFileBytes=n.maxFileBytes,this.maxIdleMs=n.maxIdleMs,n.memorySyncIntervalMs!=null&&ES(n.memorySyncIntervalMs,"memorySyncIntervalMs"),this.memorySyncIntervalMs=n.memorySyncIntervalMs,this.memorySyncDeletions=n.memorySyncDeletions??"enabled",this.workerId=n.workerId,this.requestOptions=n.requestOptions,D(this,Ey,n.signal,"f")}async run(n){let{environmentId:r,environmentKey:i}=this;if(r===void 0||i===void 0)throw new Y("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=n??y(this,Ey,"f"),s=new uy({client:this.client,environmentId:r,environmentKey:i,...this.workerId!==void 0?{workerId:this.workerId}:{},...o?{signal:o}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let a of s)try{await y(this,zS,"m",tF).call(this,a,i,s.signal)}catch(c){if(s.signal?.aborted)throw c;ze(this.client).error("work item failed",{work_id:a.id,error:String(c)})}}async handleItem(n){let r=n?.workId??Ge("ANTHROPIC_WORK_ID"),i=n?.environmentId??Ge("ANTHROPIC_ENVIRONMENT_ID"),o=n?.sessionId??Ge("ANTHROPIC_SESSION_ID"),s=(n?.environmentKey??this.environmentKey??Ge("ANTHROPIC_ENVIRONMENT_KEY"))||void 0,a=n?.workSecret||Ge("ANTHROPIC_WORK_SECRET")||null;if(!r)throw new Y("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!i)throw new Y("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new Y("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s&&!a)throw new Y("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let c={id:r,environment_id:i,secret:a,data:{type:"session",id:o}};await y(this,zS,"m",tF).call(this,c,s,n?.signal??y(this,Ey,"f"))}}return Ey=new WeakMap,zS=new WeakSet,tF=async function(n,r,i){let o=ze(this.client),s=DMe(n.secret),a=s??r;if(a===void 0)throw new Y("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)");n.secret&&s===null&&o.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key",{work_id:n.id});let c=pS(this.client,{authToken:a,helper:"environments-worker"}),l=n.data.id,u=new AbortController,d=Da(i,u),p=new MMe(u),f=await Promise.resolve().then(()=>(Pee(),Ree)),m,g,h=FMe(c,n,p,o,this.requestOptions,k=>{m=k,g?._setSendRetryWindow(k)}).catch(k=>{u.signal.aborted||o.error("heartbeat loop failed",{work_id:n.id,error:String(k)}),u.abort()}),v=async()=>{},b,w=!1;try{if(n.data.type!=="session"){o.debug("skipping non-session work item",{work_id:n.id,type:n.data.type});return}let k=await c.beta.sessions.retrieve(l);if(s===null&&this.memorySyncIntervalMs!==null&&NMe(k))throw new f.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${n.id}, session_id=${l}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`);let $={workdir:this.workdir,client:c,session:k,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{v=await f.setupSkills($)}catch(E){o.warn("skill setup failed",{session_id:l,work_id:n.id,error:String(E)})}s!==null&&this.memorySyncIntervalMs!==null?(b=new f.SessionMemoryStores(c,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await b.download(k),$.allowedRoots=b.roots,$.readOnlyRoots=b.readOnlyRoots):o.debug("memory stores disabled for this item",{work_id:n.id});let S=typeof this.tools=="function"?this.tools($):this.tools??f.betaAgentToolset20260401($);g=new my(l,{client:c,tools:S,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:u.signal}),m!==void 0&&g._setSendRetryWindow(m);for await(let E of g)b&&await b.syncIfDue();w=!u.signal.aborted}finally{try{await v().catch(k=>{o.warn("skill cleanup failed",{session_id:l,work_id:n.id,error:String(k)})})}finally{if(b){let k=f.MEMORY_FLUSH_TIMEOUT_MS;w&&await Nee(b.finish(),k)&&o.warn(`final memory sync cut off after ${k}ms; the flush that follows still uploads changed files`,{session_id:l,work_id:n.id});let $=new AbortController;await Nee(b.flushWrites($.signal),k)&&($.abort(),o.warn(`memory flush cut off after ${k}ms; changed files it had not uploaded yet are not saved`,{session_id:l,work_id:n.id})),await b.dispose().catch(E=>{o.warn("memory store cleanup failed",{session_id:l,work_id:n.id,error:String(E)})})}}p.finish("runner_done"),d(),await h,p.lost?o.info("lease lost; released without stopping it",{session_id:l,work_id:n.id}):await OMe(c,n,o,this.requestOptions)}},e})();MMe=(()=>{class e{constructor(n){Ty.set(this,void 0),Tp.set(this,void 0),D(this,Ty,n,"f")}get signal(){return y(this,Ty,"f").signal}finish(n){D(this,Tp,y(this,Tp,"f")??n,"f"),y(this,Ty,"f").abort()}get lost(){return y(this,Tp,"f")==="lease_lost"||y(this,Tp,"f")==="assumed_lost"}}return Ty=new WeakMap,Tp=new WeakMap,e})()});var GS,rF=O(()=>{X();ie();Ee();me();DL();Dee();GS=(()=>{class e extends P{retrieve(n,r,i){let{environment_id:o,betas:s,workspace_id:a}=r;return this._client.get(x`/v1/environments/${o}/work/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}update(n,r,i){let{environment_id:o,betas:s,workspace_id:a,...c}=r;return this._client.post(x`/v1/environments/${o}/work/${n}?beta=true`,{body:c,...i,headers:I([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}list(n,r={},i){let{betas:o,...s}=r??{};return this._client.getAPIList(x`/v1/environments/${n}/work?beta=true`,G,{query:s,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}ack(n,r,i){let{environment_id:o,betas:s}=r;return this._client.post(x`/v1/environments/${o}/work/${n}/ack?beta=true`,{...i,headers:I([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}heartbeat(n,r,i){let{environment_id:o,desired_ttl_seconds:s,expected_last_heartbeat:a,betas:c}=r;return this._client.post(x`/v1/environments/${o}/work/${n}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:a},...i,headers:I([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}poll(n,r={},i){let{betas:o,"Anthropic-Worker-ID":s,...a}=r??{};return this._client.get(x`/v1/environments/${n}/work/poll?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"Anthropic-Worker-ID":s}:void 0},i?.headers])})}stats(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(x`/v1/environments/${n}/work/stats?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}stop(n,r,i){let{environment_id:o,betas:s,workspace_id:a,...c}=r;return this._client.post(x`/v1/environments/${o}/work/${n}/stop?beta=true`,{body:c,...i,headers:I([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}poller(n){return new uy({...n,client:this._client})}worker(n){return new nF({...n,client:this._client})}}return e.WorkPoller=uy,e.EnvironmentWorker=nF,e})()});var BS,iF=O(()=>{X();rF();rF();ie();Ee();me();BS=(()=>{class e extends P{constructor(){super(...arguments),this.work=new GS(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/environments?beta=true",{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(x`/v1/environments/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(x`/v1/environments/${n}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/environments?beta=true",G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}delete(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.delete(x`/v1/environments/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(x`/v1/environments/${n}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}return e.Work=GS,e})()});var Ip,oF=O(()=>{X();ie();Ee();me();Ip=class extends P{create(t,n,r){let{view:i,betas:o,workspace_id:s,...a}=n;return this._client.post(x`/v1/memory_stores/${t}/memories?beta=true`,{query:{view:i},body:a,...r,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}retrieve(t,n,r){let{memory_store_id:i,betas:o,workspace_id:s,...a}=n;return this._client.get(x`/v1/memory_stores/${i}/memories/${t}?beta=true`,{query:a,...r,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}update(t,n,r){let{memory_store_id:i,view:o,betas:s,workspace_id:a,...c}=n;return this._client.post(x`/v1/memory_stores/${i}/memories/${t}?beta=true`,{query:{view:o},body:c,...r,headers:I([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},r?.headers])})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(x`/v1/memory_stores/${t}/memories?beta=true`,G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}delete(t,n,r){let{memory_store_id:i,expected_content_sha256:o,betas:s,workspace_id:a}=n;return this._client.delete(x`/v1/memory_stores/${i}/memories/${t}?beta=true`,{query:{expected_content_sha256:o},...r,headers:I([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},r?.headers])})}}});var Ap,sF=O(()=>{X();ie();Ee();me();Ap=class extends P{retrieve(t,n,r){let{memory_store_id:i,betas:o,workspace_id:s,...a}=n;return this._client.get(x`/v1/memory_stores/${i}/memory_versions/${t}?beta=true`,{query:a,...r,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(x`/v1/memory_stores/${t}/memory_versions?beta=true`,G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}redact(t,n,r){let{memory_store_id:i,betas:o,workspace_id:s}=n;return this._client.post(x`/v1/memory_stores/${i}/memory_versions/${t}/redact?beta=true`,{...r,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}}});var VS,aF=O(()=>{X();oF();oF();sF();sF();ie();Ee();me();VS=(()=>{class e extends P{constructor(){super(...arguments),this.memories=new Ip(this._client),this.memoryVersions=new Ap(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/memory_stores?beta=true",{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(x`/v1/memory_stores/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(x`/v1/memory_stores/${n}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/memory_stores?beta=true",G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}delete(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.delete(x`/v1/memory_stores/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(x`/v1/memory_stores/${n}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}return e.Memories=Ip,e.MemoryVersions=Ap,e})()});var Rp=O(()=>{_t()});var qS,cF=O(()=>{_t();qd();lL();qS=(()=>{class e{constructor(n,r){this.iterator=n,this.controller=r}async*decoder(){let n=new Qh;for await(let r of this.iterator)for(let i of n.decode(r))yield JSON.parse(i);for(let r of n.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(n,r){if(!n.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Y("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 Y("Attempted to iterate over a response with no body");return new e(Kh(n.body),r)}}return e})()});var Pp,lF=O(()=>{X();ie();Ee();cF();Rp();me();Pp=class extends P{create(t,n){let{betas:r,user_profile_id:i,workspace_id:o,...s}=t;return this._client.post("/v1/messages/batches?beta=true",{body:s,...n,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...i!=null?{"anthropic-user-profile-id":i}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},n?.headers])})}retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(x`/v1/messages/batches/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",dt,{query:o,...n,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.delete(x`/v1/messages/batches/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}cancel(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.post(x`/v1/messages/batches/${t}/cancel?beta=true`,{...r,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}async results(t,n={},r){let i=await this.retrieve(t,n,r);if(!i.results_url)throw new Y(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:o,workspace_id:s}=n??{};return this._client.get(i.results_url,{...r,headers:I([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((a,c)=>qS.fromResponse(c.response,c.controller))}}});var WS,uF=O(()=>{WS={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function Oee(e){return e?.output_format??e?.output_config?.format}function dF(e,t,n){let r=Oee(t);return!t||!("parse"in(r??{}))?{...e,content:e.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 n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return i}),parsed_output:null}:pF(e,t,n)}function pF(e,t,n){let r=null,i=e.content.map(o=>{if(o.type==="text"){let s=qMe(t,o.text);r===null&&(r=s);let a=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...e,content:i,parsed_output:r}}function qMe(e,t){let n=Oee(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(r){throw new Y(`Failed to parse structured output: ${r}`)}}var fF=O(()=>{_t()});var mF=O(()=>{ey()});var WMe,HMe,KMe,JMe,Mee,Lee=O(()=>{WMe=e=>{let t=0,n=[];for(;t=a&&e[d]==="\\";)u++,d--;if(u%2===0)break;c++}l?t=e.length:(n.push({type:"string",value:e.slice(a,c)}),t=c+1);continue}if(r&&/\s/.test(r)){t++;continue}let o=/[0-9]/;if(r&&o.test(r)||r==="-"||r==="."){let a="";for(r==="-"&&(a+=r,r=e[++t]);r&&(o.test(r)||r==="."||r==="e"||r==="E"||(r==="-"||r==="+")&&(a[a.length-1]==="e"||a[a.length-1]==="E"));)a+=r,r=e[++t];n.push({type:"number",value:a,unterminated:t===e.length});continue}let s=/[a-z]/i;if(r&&s.test(r)){let a="";for(;r&&s.test(r)&&t!==e.length;)a+=r,r=e[++t];if(a=="true"||a=="false"||a==="null")n.push({type:"name",value:a});else{t++;continue}continue}t++}return n},HMe=e=>{let t=[];for(let o of e)(o.type==="brace"||o.type==="paren")&&(o.value==="{"||o.value==="["?t.push(o.value):t.pop());let n=t[t.length-1],r=e.length,i=/^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?$/;for(;r>0;){let o=e[r-1];switch(o.type){case"separator":r--;continue;case"number":if(o.unterminated||!i.test(o.value)){r--;continue}break;case"string":let s=e[r-2];if(n==="{"&&(s?.type==="delimiter"||s?.type==="brace"&&s.value==="{")){r--;continue}break;case"delimiter":r--;break}break}return e.slice(0,r)},KMe=e=>{let t=[];return e.map(n=>{n.type==="brace"&&(n.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(n=>{n==="}"?e.push({type:"brace",value:"}"}):n==="]"&&e.push({type:"paren",value:"]"})}),e},JMe=e=>{let t="";return e.map(n=>{n.type==="string"?t+='"'+n.value+'"':t+=n.value}),t},Mee=e=>JSON.parse(JMe(KMe(HMe(WMe(e)))))});function HS(e,t){let n={};for(let o of Object.keys(e))o!=="input"&&(n[o]=e[o]);Object.defineProperty(n,Ua,{value:t,enumerable:!1,writable:!0});let r,i=!1;return Object.defineProperty(n,"input",{enumerable:!0,configurable:!0,get(){return i||(r=t?Mee(t):{},i=!0),r}}),n}var Ua,gF=O(()=>{Lee();Ua="__json_buf"});function kF(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}var Lr,za,Cp,Iy,KS,Ay,Ry,JS,Py,Mo,Cy,ZS,YS,xl,QS,XS,ex,Ny,hF,Fee,Dy,yF,bF,vF,jee,wF,tx,_F=O(()=>{er();Ii();Rp();Pa();mF();fF();gF();tx=(()=>{class e{constructor(n,r){Lr.add(this),this.messages=[],this.receivedMessages=[],za.set(this,void 0),Cp.set(this,null),this.controller=new AbortController,Iy.set(this,void 0),KS.set(this,()=>{}),Ay.set(this,()=>{}),Ry.set(this,void 0),JS.set(this,()=>{}),Py.set(this,()=>{}),Mo.set(this,{}),Cy.set(this,!1),ZS.set(this,!1),YS.set(this,!1),xl.set(this,!1),QS.set(this,void 0),XS.set(this,void 0),ex.set(this,void 0),Ny.set(this,void 0),Dy.set(this,i=>{if(D(this,ZS,!0,"f"),Jr(i)&&(i=new Tn),i instanceof Tn)return D(this,YS,!0,"f"),this._emit("abort",i);if(i instanceof Y)return this._emit("error",i);if(i instanceof Error){let o=new Y(i.message);return o.cause=i,this._emit("error",o)}return this._emit("error",new Y(String(i)))}),D(this,Iy,new Promise((i,o)=>{D(this,KS,i,"f"),D(this,Ay,o,"f")}),"f"),D(this,Ry,new Promise((i,o)=>{D(this,JS,i,"f"),D(this,Py,o,"f")}),"f"),y(this,Iy,"f").catch(()=>{}),y(this,Ry,"f").catch(()=>{}),D(this,Cp,n,"f"),D(this,Ny,r?.logger??console,"f")}get response(){return y(this,QS,"f")}get request_id(){return y(this,XS,"f")}get workspace_id(){return y(this,ex,"f")}async withResponse(){D(this,xl,!0,"f");let n=await y(this,Iy,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}static fromReadableStream(n){let r=new e(null);return r._run(()=>r._fromReadableStream(n)),r}static createMessage(n,r,i,{logger:o}={}){let s=new e(r,{logger:o});for(let a of r.messages)s._addMessageParam(a);return D(s,Cp,{...r,stream:!0},"f"),s._run(()=>s._createMessage(n,{...r,stream:!0},{...i,headers:{...i?.headers,[np]:"stream"}})),s}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},y(this,Dy,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,r=!0){this.receivedMessages.push(n),r&&this._emit("message",n)}async _createMessage(n,r,i){let o=i?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{y(this,Lr,"m",yF).call(this);let{response:a,data:c}=await n.create({...r,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(a);for await(let l of c)y(this,Lr,"m",bF).call(this,l);if(c.controller.signal?.aborted)throw new Tn;y(this,Lr,"m",vF).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(n){this.ended||(D(this,QS,n,"f"),D(this,XS,n?.headers.get("request-id"),"f"),D(this,ex,n?.headers.get("anthropic-workspace-id"),"f"),y(this,KS,"f").call(this,n),this._emit("connect"))}get ended(){return y(this,Cy,"f")}get errored(){return y(this,ZS,"f")}get aborted(){return y(this,YS,"f")}abort(){this.controller.abort()}on(n,r){return(y(this,Mo,"f")[n]||(y(this,Mo,"f")[n]=[])).push({listener:r}),this}off(n,r){let i=y(this,Mo,"f")[n];if(!i)return this;let o=i.findIndex(s=>s.listener===r);return o>=0&&i.splice(o,1),this}once(n,r){return(y(this,Mo,"f")[n]||(y(this,Mo,"f")[n]=[])).push({listener:r,once:!0}),this}emitted(n){return new Promise((r,i)=>{D(this,xl,!0,"f"),n!=="error"&&this.once("error",i),this.once(n,r)})}async done(){D(this,xl,!0,"f"),await y(this,Ry,"f")}get currentMessage(){return y(this,za,"f")}async finalMessage(){return await this.done(),y(this,Lr,"m",hF).call(this)}async finalText(){return await this.done(),y(this,Lr,"m",Fee).call(this)}_emit(n,...r){if(y(this,Cy,"f"))return;n==="end"&&(D(this,Cy,!0,"f"),y(this,JS,"f").call(this));let i=y(this,Mo,"f")[n];if(i&&(y(this,Mo,"f")[n]=i.filter(o=>!o.once),i.forEach(({listener:o})=>o(...r))),n==="abort"){let o=r[0];!y(this,xl,"f")&&!i?.length&&Promise.reject(o),y(this,Ay,"f").call(this,o),y(this,Py,"f").call(this,o),this._emit("end");return}if(n==="error"){let o=r[0];!y(this,xl,"f")&&!i?.length&&Promise.reject(o),y(this,Ay,"f").call(this,o),y(this,Py,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",y(this,Lr,"m",hF).call(this))}async _fromReadableStream(n,r){let i=r?.signal,o;i&&(i.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),i.addEventListener("abort",o));try{y(this,Lr,"m",yF).call(this),this._connected(null);let s=Ei.fromReadableStream(n,this.controller);for await(let a of s)y(this,Lr,"m",bF).call(this,a);if(s.controller.signal?.aborted)throw new Tn;y(this,Lr,"m",vF).call(this)}finally{i&&o&&i.removeEventListener("abort",o)}}[(za=new WeakMap,Cp=new WeakMap,Iy=new WeakMap,KS=new WeakMap,Ay=new WeakMap,Ry=new WeakMap,JS=new WeakMap,Py=new WeakMap,Mo=new WeakMap,Cy=new WeakMap,ZS=new WeakMap,YS=new WeakMap,xl=new WeakMap,QS=new WeakMap,XS=new WeakMap,ex=new WeakMap,Ny=new WeakMap,Dy=new WeakMap,Lr=new WeakSet,hF=function(){if(this.receivedMessages.length===0)throw new Y("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Fee=function(){if(this.receivedMessages.length===0)throw new Y("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(r.length===0)throw new Y("stream ended without producing a content block with type=text");return r.join(" ")},yF=function(){this.ended||D(this,za,void 0,"f")},bF=function(r){if(this.ended)return;let i=y(this,Lr,"m",jee).call(this,r);switch(this._emit("streamEvent",r,i),r.type){case"content_block_delta":{let o=i.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{if(kF(o)&&y(this,Mo,"f").inputJson?.length){let s;try{s=o.input}catch(a){y(this,Dy,"f").call(this,y(this,Lr,"m",wF).call(this,o,a));break}this._emit("inputJson",r.delta.partial_json,s)}break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}case"compaction_delta":{o.type==="compaction"&&o.content&&this._emit("compaction",o.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(dF(i,y(this,Cp,"f"),{logger:y(this,Ny,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{D(this,za,i,"f");break}case"content_block_start":case"message_delta":break}},vF=function(){if(this.ended)throw new Y("stream has ended, this shouldn't happen");let r=y(this,za,"f");if(!r)throw new Y("request ended without sending any chunks");return D(this,za,void 0,"f"),dF(r,y(this,Cp,"f"),{logger:y(this,Ny,"f")})},jee=function(r){let i=y(this,za,"f");if(r.type==="message_start"){if(i)throw new Y(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!i)throw new Y(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return i;case"message_delta":return i.stop_reason=r.delta.stop_reason,i.stop_sequence=r.delta.stop_sequence,i.stop_details=r.delta.stop_details,i.usage.output_tokens=r.usage.output_tokens,r.delta.container!=null&&(i.container=r.delta.container),r.context_management!=null&&(i.context_management=r.context_management),r.input_transformations!=null&&(i.input_transformations=r.input_transformations),r.usage.input_tokens!=null&&(i.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(i.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(i.usage.iterations=r.usage.iterations),r.usage.fallback_credit!=null&&(i.usage.fallback_credit=r.usage.fallback_credit),r.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=r.usage.output_tokens_details),i;case"content_block_start":return i.content.push(r.content_block),r.content_block.type==="fallback"&&(i.model=r.content_block.to.model),i;case"content_block_delta":{let o=i.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(i.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(i.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&kF(o)){let s=(o[Ua]||"")+r.delta.partial_json;i.content[r.index]=HS(o,s)}break}case"thinking_delta":{o?.type==="thinking"&&(i.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(i.content[r.index]={...o,signature:r.delta.signature});break}case"compaction_delta":{if(o?.type==="compaction"){let s={...o,content:r.delta.content};"encrypted_content"in r.delta&&(s.encrypted_content=r.delta.encrypted_content),i.content[r.index]=s}break}default:r.delta}return i}case"content_block_stop":{let o=i.content.at(r.index);if(o&&kF(o)&&Ua in o){let s;try{s=o.input}catch(a){s={},y(this,Dy,"f").call(this,y(this,Lr,"m",wF).call(this,o,a))}Object.defineProperty(o,"input",{value:s,enumerable:!0,configurable:!0,writable:!0})}return i}}},wF=function(r,i){let o=r[Ua];return new Y(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${i}. JSON: ${o}`)},Symbol.asyncIterator)](){let n=[],r=[],i=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):n.push(o)}),this.on("end",()=>{i=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{i=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{i=!0;for(let s of r)s.reject(o);r.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,a)=>r.push({resolve:s,reject:a})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Ei(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}return e})()});var Uee=O(()=>{rx()});var Dp,$F=O(()=>{X();ie();me();Dp=class extends P{retrieve(t,n){return this._client.get(x`/v1/organizations/api_keys/${t}?beta=true`,n)}update(t,n,r){return this._client.post(x`/v1/organizations/api_keys/${t}?beta=true`,{body:n,...r})}list(t={},n){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",dt,{query:t,...n})}}});var Op,SF=O(()=>{X();ie();Op=class extends P{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/artifacts?beta=true",G,{query:t,...n})}}});var Mp,xF=O(()=>{X();ie();Mp=class extends P{list(t={},n){return this._client.getAPIList("/v1/organizations/analytics/connectors?beta=true",G,{query:t,...n})}}});var Lp,EF=O(()=>{X();ie();Lp=class extends P{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/cost_report?beta=true",G,{query:t,...n})}}});var Fp,TF=O(()=>{X();ie();Fp=class extends P{list(t={},n){return this._client.getAPIList("/v1/organizations/analytics/plugins?beta=true",G,{query:t,...n})}}});var jp,IF=O(()=>{X();ie();jp=class extends P{list(t={},n){return this._client.getAPIList("/v1/organizations/analytics/skills?beta=true",G,{query:t,...n})}}});var Up,AF=O(()=>{X();ie();Up=class extends P{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/summaries?beta=true",G,{query:t,...n})}}});var zp,RF=O(()=>{X();ie();zp=class extends P{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/usage_report?beta=true",G,{query:t,...n})}}});var Gp,PF=O(()=>{X();ie();Gp=class extends P{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/user_cost_report?beta=true",G,{query:t,...n})}}});var Bp,CF=O(()=>{X();ie();Bp=class extends P{list(t,n){return this._client.getAPIList("/v1/organizations/analytics/user_usage_report?beta=true",G,{query:t,...n})}}});var Vp,NF=O(()=>{X();ie();Vp=class extends P{list(t={},n){return this._client.getAPIList("/v1/organizations/analytics/users?beta=true",G,{query:t,...n})}}});var qp,DF=O(()=>{X();ie();qp=class extends P{list(t={},n){return this._client.getAPIList("/v1/organizations/analytics/apps/chat/projects?beta=true",G,{query:t,...n})}}});var ix,OF=O(()=>{X();DF();DF();ix=(()=>{class e extends P{constructor(){super(...arguments),this.projects=new qp(this._client)}}return e.Projects=qp,e})()});var ox,MF=O(()=>{X();OF();OF();ox=(()=>{class e extends P{constructor(){super(...arguments),this.chat=new ix(this._client)}}return e.Chat=ix,e})()});var sx,LF=O(()=>{X();SF();SF();xF();xF();EF();EF();TF();TF();IF();IF();AF();AF();RF();RF();PF();PF();CF();CF();NF();NF();MF();MF();sx=(()=>{class e extends P{constructor(){super(...arguments),this.summaries=new Up(this._client),this.users=new Vp(this._client),this.apps=new ox(this._client),this.connectors=new Mp(this._client),this.plugins=new Fp(this._client),this.skills=new jp(this._client),this.artifacts=new Op(this._client),this.usageReport=new zp(this._client),this.userUsageReport=new Bp(this._client),this.costReport=new Lp(this._client),this.userCostReport=new Gp(this._client)}}return e.Summaries=Up,e.Users=Vp,e.Apps=ox,e.Connectors=Mp,e.Plugins=Fp,e.Skills=jp,e.Artifacts=Op,e.UsageReport=zp,e.UserUsageReport=Bp,e.CostReport=Lp,e.UserCostReport=Gp,e})()});var Wp,FF=O(()=>{X();Wp=class extends P{retrieve(t){return this._client.get("/v1/organizations/compliance_settings?beta=true",t)}update(t,n){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:t,...n})}}});var Hp,jF=O(()=>{X();ie();me();Hp=class extends P{create(t,n){return this._client.post("/v1/organizations/external_keys?beta=true",{body:t,...n})}retrieve(t,n){return this._client.get(x`/v1/organizations/external_keys/${t}?beta=true`,n)}update(t,n,r){return this._client.post(x`/v1/organizations/external_keys/${t}?beta=true`,{body:n,...r})}list(t={},n){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",G,{query:t,...n})}delete(t,n){return this._client.delete(x`/v1/organizations/external_keys/${t}?beta=true`,n)}validate(t,n){return this._client.post(x`/v1/organizations/external_keys/${t}/validate?beta=true`,n)}}});var Kp,UF=O(()=>{X();ie();Ee();me();Kp=class extends P{create(t,n){let{betas:r,...i}=t;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:i,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}retrieve(t,n={},r){let{betas:i}=n??{};return this._client.get(x`/v1/organizations/federation_issuers/${t}?beta=true`,{...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}update(t,n,r){let{betas:i,...o}=n;return this._client.post(x`/v1/organizations/federation_issuers/${t}?beta=true`,{body:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}list(t={},n){let{betas:r,...i}=t??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",G,{query:i,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}archive(t,n={},r){let{betas:i}=n??{};return this._client.post(x`/v1/organizations/federation_issuers/${t}/archive?beta=true`,{...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}}});var Jp,zF=O(()=>{X();ie();Ee();me();Jp=class extends P{list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(x`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,G,{query:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}add(t,n,r){let{betas:i,...o}=n;return this._client.post(x`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,{body:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}remove(t,n,r){let{federation_rule_id:i,betas:o}=n;return this._client.delete(x`/v1/organizations/federation_rules/${i}/workspaces/${t}?beta=true`,{...r,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},r?.headers])})}}});var ax,GF=O(()=>{X();zF();zF();ie();Ee();me();ax=(()=>{class e extends P{constructor(){super(...arguments),this.workspaces=new Jp(this._client)}create(n,r){let{betas:i,...o}=n;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}retrieve(n,r={},i){let{betas:o}=r??{};return this._client.get(x`/v1/organizations/federation_rules/${n}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}update(n,r,i){let{betas:o,...s}=r;return this._client.post(x`/v1/organizations/federation_rules/${n}?beta=true`,{body:s,...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}list(n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",G,{query:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}archive(n,r={},i){let{betas:o}=r??{};return this._client.post(x`/v1/organizations/federation_rules/${n}/archive?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}return e.Workspaces=Jp,e})()});var cx,BF=O(()=>{X();UF();UF();GF();GF();cx=(()=>{class e extends P{constructor(){super(...arguments),this.issuers=new Kp(this._client),this.rules=new ax(this._client)}}return e.Issuers=Kp,e.Rules=ax,e})()});var Zp,VF=O(()=>{X();ie();me();Zp=class extends P{create(t,n){return this._client.post("/v1/organizations/invites?beta=true",{body:t,...n})}retrieve(t,n){return this._client.get(x`/v1/organizations/invites/${t}?beta=true`,n)}list(t={},n){return this._client.getAPIList("/v1/organizations/invites?beta=true",dt,{query:t,...n})}delete(t,n){return this._client.delete(x`/v1/organizations/invites/${t}?beta=true`,n)}}});var Yp,qF=O(()=>{X();ie();Ee();Ti();me();Yp=class extends P{retrieve(t,n={},r){let{betas:i,...o}=n??{};return this._client.get(x`/v1/organizations/plugin_marketplaces/${t}?beta=true`,{query:o,...r,headers:I([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers])})}update(t,n,r){let{betas:i,...o}=n;return this._client.post(x`/v1/organizations/plugin_marketplaces/${t}?beta=true`,{body:o,...r,headers:I([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers])})}list(t={},n){let{betas:r,...i}=t??{};return this._client.getAPIList("/v1/organizations/plugin_marketplaces?beta=true",G,{query:i,...n,headers:I([{"anthropic-beta":[...r??[],"ce-plugins-2026-09-01"].toString()},n?.headers])})}validateArchive(t,n){let{betas:r,...i}=t;return this._client.post("/v1/organizations/plugin_marketplaces/validate_archive?beta=true",In({body:i,...n,headers:I([{"anthropic-beta":[...r??[],"ce-plugins-2026-09-01"].toString()},n?.headers])},this._client))}validateRepository(t,n){let{betas:r,...i}=t;return this._client.post("/v1/organizations/plugin_marketplaces/validate_repository?beta=true",{body:i,...n,headers:I([{"anthropic-beta":[...r??[],"ce-plugins-2026-09-01"].toString()},n?.headers])})}}});var Qp,WF=O(()=>{X();ie();Qp=class extends P{list(t={},n){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",G,{query:t,...n})}}});var Xp,HF=O(()=>{X();ie();me();Xp=class extends P{retrieve(t,n){return this._client.get(x`/v1/organizations/users/${t}?beta=true`,n)}update(t,n,r){return this._client.post(x`/v1/organizations/users/${t}?beta=true`,{body:n,...r})}list(t={},n){return this._client.getAPIList("/v1/organizations/users?beta=true",dt,{query:t,...n})}remove(t,n){return this._client.delete(x`/v1/organizations/users/${t}?beta=true`,n)}}});var ef,KF=O(()=>{X();ie();Ee();me();ef=class extends P{list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(x`/v1/organizations/plugins/${t}/installation_settings?beta=true`,G,{query:o,...r,headers:I([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers])})}remove(t,n,r){let{plugin_id:i,betas:o}=n;return this._client.delete(x`/v1/organizations/plugins/${i}/installation_settings/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},r?.headers])})}set(t,n,r){let{plugin_id:i,betas:o,...s}=n;return this._client.post(x`/v1/organizations/plugins/${i}/installation_settings/${t}?beta=true`,{body:s,...r,headers:I([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},r?.headers])})}}});var tf,JF=O(()=>{X();ie();Ee();me();tf=class extends P{list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(x`/v1/organizations/plugins/${t}/shares?beta=true`,G,{query:o,...r,headers:I([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers])})}}});var nf,ZF=O(()=>{X();ie();Ee();Ti();me();nf=class extends P{create(t,n,r){let{betas:i,...o}=n;return this._client.post(x`/v1/organizations/plugins/${t}/versions?beta=true`,In({body:o,...r,headers:I([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers])},this._client))}retrieve(t,n,r){let{plugin_id:i,betas:o,...s}=n;return this._client.get(x`/v1/organizations/plugins/${i}/versions/${t}?beta=true`,{query:s,...r,headers:I([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},r?.headers])})}list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(x`/v1/organizations/plugins/${t}/versions?beta=true`,G,{query:o,...r,headers:I([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers])})}download(t,n,r){let{plugin_id:i,betas:o,...s}=n;return this._client.get(x`/v1/organizations/plugins/${i}/versions/${t}/content?beta=true`,{query:s,...r,headers:I([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString(),Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}}});var lx,YF=O(()=>{X();KF();KF();JF();JF();ZF();ZF();ie();Ee();Ti();me();lx=(()=>{class e extends P{constructor(){super(...arguments),this.versions=new nf(this._client),this.installationSettings=new ef(this._client),this.shares=new tf(this._client)}create(n,r){let{betas:i,...o}=n;return this._client.post("/v1/organizations/plugins?beta=true",In({body:o,...r,headers:I([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers])},this._client))}retrieve(n,r={},i){let{betas:o,...s}=r??{};return this._client.get(x`/v1/organizations/plugins/${n}?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},i?.headers])})}update(n,r,i){let{betas:o,...s}=r;return this._client.post(x`/v1/organizations/plugins/${n}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},i?.headers])})}list(n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList("/v1/organizations/plugins?beta=true",G,{query:o,...r,headers:I([{"anthropic-beta":[...i??[],"ce-plugins-2026-09-01"].toString()},r?.headers])})}delete(n,r={},i){let{betas:o}=r??{};return this._client.delete(x`/v1/organizations/plugins/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"ce-plugins-2026-09-01"].toString()},i?.headers])})}}return e.Versions=nf,e.InstallationSettings=ef,e.Shares=tf,e})()});var rf,QF=O(()=>{X();ie();me();rf=class extends P{list(t,n={},r){return this._client.getAPIList(x`/v1/organizations/rbac_groups/${t}/members?beta=true`,G,{query:n,...r})}add(t,n,r){return this._client.post(x`/v1/organizations/rbac_groups/${t}/members?beta=true`,{body:n,...r})}remove(t,n,r){let{rbac_group_id:i}=n;return this._client.delete(x`/v1/organizations/rbac_groups/${i}/members/${t}?beta=true`,r)}}});var ux,XF=O(()=>{X();QF();QF();ie();me();ux=(()=>{class e extends P{constructor(){super(...arguments),this.members=new rf(this._client)}create(n,r){return this._client.post("/v1/organizations/rbac_groups?beta=true",{body:n,...r})}retrieve(n,r){return this._client.get(x`/v1/organizations/rbac_groups/${n}?beta=true`,r)}update(n,r,i){return this._client.post(x`/v1/organizations/rbac_groups/${n}?beta=true`,{body:r,...i})}list(n={},r){return this._client.getAPIList("/v1/organizations/rbac_groups?beta=true",G,{query:n,...r})}delete(n,r){return this._client.delete(x`/v1/organizations/rbac_groups/${n}?beta=true`,r)}}return e.Members=rf,e})()});var of,e1=O(()=>{X();ie();me();of=class extends P{list(t,n={},r){return this._client.getAPIList(x`/v1/organizations/rbac_roles/${t}/permissions?beta=true`,G,{query:n,...r})}}});var dx,t1=O(()=>{X();e1();e1();ie();me();dx=(()=>{class e extends P{constructor(){super(...arguments),this.permissions=new of(this._client)}retrieve(n,r){return this._client.get(x`/v1/organizations/rbac_roles/${n}?beta=true`,r)}list(n={},r){return this._client.getAPIList("/v1/organizations/rbac_roles?beta=true",G,{query:n,...r})}}return e.Permissions=of,e})()});var sf,n1=O(()=>{X();ie();Ee();me();sf=class extends P{list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(x`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,G,{query:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}add(t,n,r){let{betas:i,...o}=n;return this._client.post(x`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,{body:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}remove(t,n,r){let{service_account_id:i,betas:o}=n;return this._client.delete(x`/v1/organizations/service_accounts/${i}/workspaces/${t}?beta=true`,{...r,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},r?.headers])})}}});var px,r1=O(()=>{X();n1();n1();ie();Ee();me();px=(()=>{class e extends P{constructor(){super(...arguments),this.workspaces=new sf(this._client)}create(n,r){let{betas:i,...o}=n;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}retrieve(n,r={},i){let{betas:o}=r??{};return this._client.get(x`/v1/organizations/service_accounts/${n}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}update(n,r,i){let{betas:o,...s}=r;return this._client.post(x`/v1/organizations/service_accounts/${n}?beta=true`,{body:s,...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}list(n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",G,{query:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}archive(n,r={},i){let{betas:o}=r??{};return this._client.post(x`/v1/organizations/service_accounts/${n}/archive?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}return e.Workspaces=sf,e})()});var af,i1=O(()=>{X();ie();af=class extends P{list(t={},n){return this._client.getAPIList("/v1/organizations/spend_limits/effective?beta=true",G,{query:t,...n})}}});var cf,o1=O(()=>{X();ie();me();cf=class extends P{retrieve(t,n){return this._client.get(x`/v1/organizations/spend_limit_increase_requests/${t}?beta=true`,n)}list(t={},n){return this._client.getAPIList("/v1/organizations/spend_limit_increase_requests?beta=true",G,{query:t,...n})}approve(t,n,r){return this._client.post(x`/v1/organizations/spend_limit_increase_requests/${t}/approve?beta=true`,{body:n,...r})}deny(t,n,r){return this._client.post(x`/v1/organizations/spend_limit_increase_requests/${t}/deny?beta=true`,{body:n,...r})}}});var fx,s1=O(()=>{X();i1();i1();o1();o1();ie();Ee();me();fx=(()=>{class e extends P{constructor(){super(...arguments),this.effective=new af(this._client),this.increaseRequests=new cf(this._client)}retrieve(n,r){return this._client.get(x`/v1/organizations/spend_limits/${n}?beta=true`,r)}list(n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList("/v1/organizations/spend_limits?beta=true",G,{query:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}delete(n,r){return this._client.delete(x`/v1/organizations/spend_limits/${n}?beta=true`,r)}set(n,r){return this._client.post("/v1/organizations/spend_limits?beta=true",{body:n,...r})}}return e.Effective=af,e.IncreaseRequests=cf,e})()});var lf,a1=O(()=>{X();ie();me();lf=class extends P{retrieve(t,n,r){let{workspace_id:i}=n;return this._client.get(x`/v1/organizations/workspaces/${i}/members/${t}?beta=true`,r)}update(t,n,r){let{workspace_id:i,...o}=n;return this._client.post(x`/v1/organizations/workspaces/${i}/members/${t}?beta=true`,{body:o,...r})}list(t,n={},r){return this._client.getAPIList(x`/v1/organizations/workspaces/${t}/members?beta=true`,dt,{query:n,...r})}add(t,n,r){return this._client.post(x`/v1/organizations/workspaces/${t}/members?beta=true`,{body:n,...r})}remove(t,n,r){let{workspace_id:i}=n;return this._client.delete(x`/v1/organizations/workspaces/${i}/members/${t}?beta=true`,r)}}});var uf,c1=O(()=>{X();ie();me();uf=class extends P{list(t,n={},r){return this._client.getAPIList(x`/v1/organizations/workspaces/${t}/rate_limits?beta=true`,G,{query:n,...r})}}});var df,l1=O(()=>{X();ie();Ee();me();df=class extends P{retrieve(t,n,r){let{workspace_id:i,betas:o}=n;return this._client.get(x`/v1/organizations/workspaces/${i}/service_accounts/${t}?beta=true`,{...r,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},r?.headers])})}update(t,n,r){let{workspace_id:i,betas:o,...s}=n;return this._client.post(x`/v1/organizations/workspaces/${i}/service_accounts/${t}?beta=true`,{body:s,...r,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},r?.headers])})}list(t,n={},r){let{betas:i,...o}=n??{};return this._client.getAPIList(x`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,G,{query:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}add(t,n,r){let{betas:i,...o}=n;return this._client.post(x`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,{body:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}remove(t,n,r){let{workspace_id:i,betas:o}=n;return this._client.delete(x`/v1/organizations/workspaces/${i}/service_accounts/${t}?beta=true`,{...r,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},r?.headers])})}}});var mx,u1=O(()=>{X();a1();a1();c1();c1();l1();l1();ie();Ee();me();mx=(()=>{class e extends P{constructor(){super(...arguments),this.rateLimits=new uf(this._client),this.members=new lf(this._client),this.serviceAccounts=new df(this._client)}create(n,r){let{betas:i,...o}=n;return this._client.post("/v1/organizations/workspaces?beta=true",{body:o,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}retrieve(n,r){return this._client.get(x`/v1/organizations/workspaces/${n}?beta=true`,r)}update(n,r,i){return this._client.post(x`/v1/organizations/workspaces/${n}?beta=true`,{body:r,...i})}list(n={},r){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",dt,{query:n,...r})}archive(n,r){return this._client.post(x`/v1/organizations/workspaces/${n}/archive?beta=true`,r)}}return e.RateLimits=uf,e.Members=lf,e.ServiceAccounts=df,e})()});var gx,d1=O(()=>{X();$F();$F();FF();FF();jF();jF();VF();VF();qF();qF();WF();WF();HF();HF();LF();LF();BF();BF();YF();YF();XF();XF();t1();t1();r1();r1();s1();s1();u1();u1();gx=(()=>{class e extends P{constructor(){super(...arguments),this.apiKeys=new Dp(this._client),this.externalKeys=new Hp(this._client),this.federation=new cx(this._client),this.invites=new Zp(this._client),this.serviceAccounts=new px(this._client),this.users=new Xp(this._client),this.workspaces=new mx(this._client),this.rateLimits=new Qp(this._client),this.complianceSettings=new Wp(this._client),this.analytics=new sx(this._client),this.spendLimits=new fx(this._client),this.rbacGroups=new ux(this._client),this.rbacRoles=new dx(this._client),this.plugins=new lx(this._client),this.pluginMarketplaces=new Yp(this._client)}retrieve(n){return this._client.get("/v1/organizations/me?beta=true",n)}}return e.APIKeys=Dp,e.ExternalKeys=Hp,e.Federation=cx,e.Invites=Zp,e.ServiceAccounts=px,e.Users=Xp,e.Workspaces=mx,e.RateLimits=Qp,e.ComplianceSettings=Wp,e.Analytics=sx,e.SpendLimits=fx,e.RBACGroups=ux,e.RBACRoles=dx,e.Plugins=lx,e.PluginMarketplaces=Yp,e})()});var hx,p1=O(()=>{X();ie();Ee();me();FL();hx=(()=>{class e extends P{list(n,r={},i){let{betas:o,workspace_id:s,...a}=r??{};return this._client.getAPIList(x`/v1/sessions/${n}/events?beta=true`,G,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}send(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(x`/v1/sessions/${n}/events?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}stream(n,r={},i){let{betas:o,workspace_id:s,...a}=r??{};return this._client.get(x`/v1/sessions/${n}/events/stream?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),stream:!0})}toolRunner(n,r){return new my(n,{...r,client:this._client})}}return e.SessionToolRunner=my,e})()});var pf,f1=O(()=>{X();ie();Ee();me();pf=class extends P{retrieve(t,n,r){let{session_id:i,betas:o,workspace_id:s}=n;return this._client.get(x`/v1/sessions/${i}/resources/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}update(t,n,r){let{session_id:i,betas:o,workspace_id:s,...a}=n;return this._client.post(x`/v1/sessions/${i}/resources/${t}?beta=true`,{body:a,...r,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(x`/v1/sessions/${t}/resources?beta=true`,G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}delete(t,n,r){let{session_id:i,betas:o,workspace_id:s}=n;return this._client.delete(x`/v1/sessions/${i}/resources/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}add(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(x`/v1/sessions/${t}/resources?beta=true`,{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}}});var ff,m1=O(()=>{X();ie();Ee();me();ff=class extends P{list(t,n,r){let{session_id:i,betas:o,workspace_id:s,...a}=n;return this._client.getAPIList(x`/v1/sessions/${i}/threads/${t}/events?beta=true`,G,{query:a,...r,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}stream(t,n,r){let{session_id:i,betas:o,workspace_id:s,...a}=n;return this._client.get(x`/v1/sessions/${i}/threads/${t}/stream?beta=true`,{query:a,...r,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),stream:!0})}}});var yx,g1=O(()=>{X();m1();m1();ie();Ee();me();yx=(()=>{class e extends P{constructor(){super(...arguments),this.events=new ff(this._client)}retrieve(n,r,i){let{session_id:o,betas:s,workspace_id:a}=r;return this._client.get(x`/v1/sessions/${o}/threads/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}list(n,r={},i){let{betas:o,workspace_id:s,...a}=r??{};return this._client.getAPIList(x`/v1/sessions/${n}/threads?beta=true`,G,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}archive(n,r,i){let{session_id:o,betas:s,workspace_id:a}=r;return this._client.post(x`/v1/sessions/${o}/threads/${n}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}}return e.Events=ff,e})()});var bx,h1=O(()=>{X();p1();p1();f1();f1();g1();g1();ie();Ee();me();bx=(()=>{class e extends P{constructor(){super(...arguments),this.events=new hx(this._client),this.resources=new pf(this._client),this.threads=new yx(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/sessions?beta=true",{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(x`/v1/sessions/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(x`/v1/sessions/${n}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/sessions?beta=true",eS,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}delete(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.delete(x`/v1/sessions/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(x`/v1/sessions/${n}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}return e.Events=hx,e.Resources=pf,e.Threads=yx,e})()});var mf,y1=O(()=>{X();ie();Ee();Ti();me();mf=class extends P{create(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(x`/v1/skills/${t}/versions?beta=true`,In({body:s,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])},this._client,!1))}retrieve(t,n,r){let{skill_id:i,betas:o,workspace_id:s}=n;return this._client.get(x`/v1/skills/${i}/versions/${t}?beta=true`,{...r,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(x`/v1/skills/${t}/versions?beta=true`,G,{query:s,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}delete(t,n,r){let{skill_id:i,betas:o,workspace_id:s}=n;return this._client.delete(x`/v1/skills/${i}/versions/${t}?beta=true`,{...r,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}download(t,n,r){let{skill_id:i,betas:o,workspace_id:s}=n;return this._client.get(x`/v1/skills/${i}/versions/${t}/content?beta=true`,{...r,headers:I([{Accept:"application/binary",...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers]),__binaryResponse:!0})}}});var vx,b1=O(()=>{X();y1();y1();ie();Ee();Ti();me();vx=(()=>{class e extends P{constructor(){super(...arguments),this.versions=new mf(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/skills?beta=true",In({body:s,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])},this._client,!1))}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(x`/v1/skills/${n}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/skills?beta=true",G,{query:s,...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}delete(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.delete(x`/v1/skills/${n}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}return e.Versions=mf,e})()});var gf,v1=O(()=>{X();ie();Ee();me();gf=class extends P{create(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(x`/v1/tunnels/${t}/certificates?beta=true`,{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}retrieve(t,n,r){let{tunnel_id:i,betas:o,workspace_id:s}=n;return this._client.get(x`/v1/tunnels/${i}/certificates/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(x`/v1/tunnels/${t}/certificates?beta=true`,G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}archive(t,n,r){let{tunnel_id:i,betas:o,workspace_id:s}=n;return this._client.post(x`/v1/tunnels/${i}/certificates/${t}/archive?beta=true`,{...r,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}}});var wx,w1=O(()=>{X();v1();v1();ie();Ee();me();wx=(()=>{class e extends P{constructor(){super(...arguments),this.certificates=new gf(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/tunnels?beta=true",{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(x`/v1/tunnels/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/tunnels?beta=true",G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(x`/v1/tunnels/${n}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}revealToken(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(x`/v1/tunnels/${n}/reveal_token?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}rotateToken(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(x`/v1/tunnels/${n}/rotate_token?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}return e.Certificates=gf,e})()});var hf,k1=O(()=>{X();ie();Ee();me();hf=class extends P{create(t,n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post(x`/v1/vaults/${t}/credentials?beta=true`,{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}retrieve(t,n,r){let{vault_id:i,betas:o,workspace_id:s}=n;return this._client.get(x`/v1/vaults/${i}/credentials/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}update(t,n,r){let{vault_id:i,betas:o,workspace_id:s,...a}=n;return this._client.post(x`/v1/vaults/${i}/credentials/${t}?beta=true`,{body:a,...r,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}list(t,n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList(x`/v1/vaults/${t}/credentials?beta=true`,G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}delete(t,n,r){let{vault_id:i,betas:o,workspace_id:s}=n;return this._client.delete(x`/v1/vaults/${i}/credentials/${t}?beta=true`,{...r,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}archive(t,n,r){let{vault_id:i,betas:o,workspace_id:s}=n;return this._client.post(x`/v1/vaults/${i}/credentials/${t}/archive?beta=true`,{...r,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}mcpOAuthValidate(t,n,r){let{vault_id:i,betas:o,workspace_id:s}=n;return this._client.post(x`/v1/vaults/${i}/credentials/${t}/mcp_oauth_validate?beta=true`,{...r,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},r?.headers])})}}});var kx,_1=O(()=>{X();k1();k1();ie();Ee();me();kx=(()=>{class e extends P{constructor(){super(...arguments),this.credentials=new hf(this._client)}create(n,r){let{betas:i,workspace_id:o,...s}=n;return this._client.post("/v1/vaults?beta=true",{body:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}retrieve(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.get(x`/v1/vaults/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(n,r,i){let{betas:o,workspace_id:s,...a}=r;return this._client.post(x`/v1/vaults/${n}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(n={},r){let{betas:i,workspace_id:o,...s}=n??{};return this._client.getAPIList("/v1/vaults?beta=true",G,{query:s,...r,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}delete(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.delete(x`/v1/vaults/${n}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}archive(n,r={},i){let{betas:o,workspace_id:s}=r??{};return this._client.post(x`/v1/vaults/${n}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}return e.Credentials=hf,e})()});var zee=O(()=>{Uee()});var Gee=O(()=>{zee()});var bs,_x,El,yf,$x,Tl,bf,Sx,Bee,xx,Ex,$1,Vee=O(()=>{er();Ii();_F();$1=(()=>{class e extends tx{constructor(n,r){super(n),bs.add(this),_x.set(this,void 0),El.set(this,0),yf.set(this,[]),$x.set(this,[]),Tl.set(this,void 0),bf.set(this,[]),Sx.set(this,!1),D(this,_x,r,"f")}get toolCalls(){return y(this,$x,"f")}static start(n,r,i,o){let s=new e({...r,stream:!0},o);for(let a of r.messages)s._addMessageParam(a);return s._run(()=>s._createMessage(n,{...r,stream:!0},{...i,headers:{...i?.headers,[np]:"stream"}})),s}_emit(n,...r){var i;if(n!=="streamEvent"||this.ended){super._emit(n,...r);return}D(this,El,(i=y(this,El,"f"),i++,i),"f");let[o,s]=r,a=o.type==="content_block_stop"?s.content[o.index]:void 0,c=a?.type==="tool_use"?a:void 0;c&&y(this,$x,"f").push(c),super._emit(n,...r),y(this,bs,"m",Bee).call(this,o,c),y(this,bs,"m",xx).call(this)}[(_x=new WeakMap,El=new WeakMap,yf=new WeakMap,$x=new WeakMap,Tl=new WeakMap,bf=new WeakMap,Sx=new WeakMap,bs=new WeakSet,Symbol.asyncIterator)](){let n=super[Symbol.asyncIterator](),r={handled:y(this,El,"f")};y(this,yf,"f").push(r);let i=!1;return{next:async()=>{i&&(i=!1,r.handled++,y(this,bs,"m",xx).call(this));try{let o=await n.next();return i=!o.done,o.done&&y(this,bs,"m",Ex).call(this,r),o}catch(o){throw y(this,bs,"m",Ex).call(this,r),o}},return:async()=>{let o=n.return?.();return y(this,bs,"m",Ex).call(this,r),await o??{value:void 0,done:!0}}}}}return Bee=function(n,r){if(y(this,Sx,"f"))return;if(n.type==="content_block_start"&&n.content_block.type==="fallback"){D(this,Sx,!0,"f"),D(this,Tl,void 0,"f");return}let i=n.type==="content_block_start"||n.type==="message_delta"&&n.delta.stop_reason==="tool_use";y(this,Tl,"f")&&i&&(y(this,bf,"f").push({toolUse:y(this,Tl,"f"),event:y(this,El,"f")}),D(this,Tl,void 0,"f")),r&&D(this,Tl,r,"f")},xx=function(){if(this.errored||this.controller.signal.aborted)return;let n=Math.min(y(this,El,"f"),...y(this,yf,"f").map(r=>r.handled));for(;y(this,bf,"f")[0]&&y(this,bf,"f")[0].event<=n;)y(this,_x,"f").call(this,y(this,bf,"f").shift().toolUse)},Ex=function(n){let r=y(this,yf,"f").indexOf(n);r>=0&&(y(this,yf,"f").splice(r,1),y(this,bs,"m",xx).call(this))},e})()});function Kee(e){if("compaction"in e&&e.compaction!=null)throw new Y("`compaction` cannot be set on a tool runner: every request in the loop would compact again. Call `runner.compactBeforeNextTurn()` when the conversation should be compacted instead.")}function ZLe(e){if("compactionControl"in e&&e.compactionControl!=null)throw new Y("`compactionControl` has been removed from the tool runner. Use server-side compaction instead: call `runner.compactBeforeNextTurn()` when the conversation should be compacted.")}function Jee(e){if(e.runToolsEagerly&&!e.stream)throw new TypeError("`runToolsEagerly: true` needs `stream: true` in the tool runner's params, because a reply that isn't streamed arrives whole.")}function R1(e){if(e.context_management?.edits?.some(t=>t.type.startsWith("compact_")))throw new Y("`compactBeforeNextTurn()` can't be used while `context_management` has a compaction edit, because the API doesn't accept a compaction block together with one. Remove the edit first.")}function YLe(e){let{context_management:t,stop_sequences:n,output_format:r,...i}=e,o=({format:s,...a})=>a;return(i.tool_choice?.type==="any"||i.tool_choice?.type==="tool")&&delete i.tool_choice,i.output_config&&(i.output_config=o(i.output_config)),Array.isArray(i.fallbacks)&&(i.fallbacks=i.fallbacks.map(s=>s.output_config?{...s,output_config:o(s.output_config)}:s)),i}function P1(e){if(!("run"in e))return e;let t=nx;return{...Object.fromEntries(Object.entries(e).filter(([n])=>t.includes(n))),...ml(e)&&{[gs]:e[gs]}}}function Zee(e){return e.map(t=>{if(t.role!=="system"||typeof t.content=="string")return t;let n=t.content.map(r=>r.type==="tool_addition"&&r.tool.type==="tool_definition"?{...r,tool:{...r.tool,definition:P1(r.tool.definition)}}:r);return{...t,content:n}})}async function QLe(e,t,n,r,i){if(!n||n.role!=="assistant"||!n.content||typeof n.content=="string")return null;let o=n.content.filter(a=>a.type==="tool_use");return o.length===0?null:{role:"user",content:await Promise.all(o.map(a=>{let c=i?.get(a.id);if(c?.status==="started")return c.result;let l=Xee(e,t,a,r);return i?.set(a.id,{status:"started",result:l}),l}))}}async function Xee(e,t,n,r){let i=t.has(n.name)?e.get(n.name):void 0;if(!i)return XLe(n);try{let o=n.input;"parse"in i&&i.parse&&(o=i.parse(o));let s=await i.run(o,{toolUse:n,toolUseBlock:n,signal:r?.signal});return{type:"tool_result",tool_use_id:n.id,content:s}}catch(o){return{type:"tool_result",tool_use_id:n.id,content:o instanceof Me?o.content:`Error: ${o instanceof Error?o.message:String(o)}`,is_error:!0}}}function XLe(e){return{type:"tool_result",tool_use_id:e.id,content:`Error: Tool '${e.name}' not found`,is_error:!0}}function Yee(e,t){switch(e.type){case"tool_removal":case"tool_addition":eFe(e,t);break}}function eFe(e,t){let n=tFe(e.tool);n!==void 0&&(e.type==="tool_removal"?t.delete(n):t.add(n))}function tFe(e){switch(e.type){case"tool_reference":return e.name;case"tool_definition":return"name"in e.definition?e.definition.name:void 0;default:return}}function Qee(e){if(e===null)return"stop";switch(e){case"tool_use":return"run_tools";case"pause_turn":case"compaction":return"resume";case"end_turn":case"stop_sequence":case"max_tokens":case"model_context_window_exceeded":case"refusal":return"stop";default:return"stop"}}var Lt,vf,Il,Pt,Fr,jr,Ga,Lo,Ba,Oy,ti,Fo,wf,kf,Al,S1,qee,x1,E1,My,Tx,Wee,T1,I1,Hee,A1,C1,ete=O(()=>{er();gp();_t();Gee();Vee();Ee();jL();xi();Ii();C1=(()=>{class e{constructor(n,r,i){Lt.add(this),this.client=n,vf.set(this,!1),Il.set(this,!1),Pt.set(this,void 0),Fr.set(this,void 0),jr.set(this,void 0),Ga.set(this,void 0),Lo.set(this,void 0),Ba.set(this,void 0),Oy.set(this,0),ti.set(this,{status:"idle"}),Fo.set(this,void 0),wf.set(this,null),kf.set(this,new Map),Al.set(this,[]),Kee(r),ZLe(r),Jee(r),D(this,Pt,{params:{...r,messages:JSON.parse(JSON.stringify(Zee(r.messages)))}},"f");let o=$L(r.tools,r.messages);D(this,Fr,{...i,headers:I([rS("BetaToolRunner"),o.length?{[Oo]:o.join(", ")}:void 0,i?.headers])},"f"),D(this,Ba,wp(),"f")}async*[(vf=new WeakMap,Il=new WeakMap,Pt=new WeakMap,Fr=new WeakMap,jr=new WeakMap,Ga=new WeakMap,Lo=new WeakMap,Ba=new WeakMap,Oy=new WeakMap,ti=new WeakMap,Fo=new WeakMap,wf=new WeakMap,kf=new WeakMap,Al=new WeakMap,Lt=new WeakSet,Symbol.asyncIterator)](){var n;if(y(this,vf,"f"))throw new Y("Cannot iterate over a consumed stream");D(this,vf,!0,"f"),D(this,Il,!0,"f"),D(this,Lo,void 0,"f");try{for(;;)try{if(y(this,Pt,"f").params.max_iterations&&y(this,Oy,"f")>=y(this,Pt,"f").params.max_iterations)break;if(y(this,Lt,"m",Hee).call(this),y(this,ti,"f").status==="scheduled"&&Qee(y(this,wf,"f"))!=="resume"){yield*y(this,Lt,"m",E1).call(this,y(this,ti,"f").config);continue}D(this,Il,!1,"f"),D(this,Lo,void 0,"f"),D(this,Oy,(n=y(this,Oy,"f"),n++,n),"f"),D(this,jr,void 0,"f");let{max_iterations:r,runToolsEagerly:i,...o}=y(this,Pt,"f").params;if(yield*y(this,Lt,"m",S1).call(this,o),y(this,Il,"f"))D(this,wf,null,"f");else{let a=await y(this,jr,"f"),c=Qee(a.stop_reason);D(this,wf,a.stop_reason,"f"),y(this,Pt,"f").params.messages.push({role:a.role,content:a.content});let{container:l}=y(this,Pt,"f").params;if(a.container&&(l==null?y(this,Pt,"f").params.container=a.container.id:typeof l=="object"&&l.id==null&&(y(this,Pt,"f").params.container={...l,id:a.container.id})),c==="stop"){yield*y(this,Lt,"m",T1).call(this);break}if(c==="resume")continue}let s=await y(this,Lt,"m",I1).call(this,y(this,Pt,"f").params.messages.at(-1));if(s)y(this,Pt,"f").params.messages.push(s);else if(!y(this,Il,"f")){yield*y(this,Lt,"m",T1).call(this);break}}finally{y(this,Ga,"f")?.abort(),D(this,Ga,void 0,"f")}if(await y(this,Lt,"m",x1).call(this),!y(this,jr,"f"))throw new Y("ToolRunner concluded without a message from the server");y(this,Ba,"f").resolve(await y(this,jr,"f"))}catch(r){throw D(this,vf,!1,"f"),y(this,Ba,"f").promise.catch(()=>{}),y(this,Ba,"f").reject(r),D(this,Ba,wp(),"f"),r}}setMessagesParams(n){let r=typeof n=="function"?n(y(this,Pt,"f").params):n;if(Kee(r),Jee(r),y(this,ti,"f").status!=="idle"&&R1(r),y(this,ti,"f").status==="in_flight"&&r.messages!==y(this,Pt,"f").params.messages)throw new Y("Message params can't be changed while the conversation is being compacted, because the compaction response is about to replace them. Change them after this iteration instead.");y(this,Pt,"f").params=r,D(this,Il,!0,"f"),D(this,Lo,void 0,"f")}setRequestOptions(n){typeof n=="function"?D(this,Fr,n(y(this,Fr,"f")),"f"):D(this,Fr,{...y(this,Fr,"f"),...n},"f")}async generateToolResponse(n=y(this,Fr,"f").signal){let r=await y(this,jr,"f")??this.params.messages.at(-1);return r?y(this,Lt,"m",I1).call(this,r,n):null}deferToolCall(n){let r=typeof n=="string"?n:n.id;y(this,Fo,"f")&&!y(this,Fo,"f").has(r)&&y(this,Fo,"f").set(r,{status:"held"})}get deferredToolCalls(){let n=y(this,Ga,"f"),r=y(this,Fo,"f");return!(n instanceof $1)||!r?[]:n.toolCalls.filter(i=>r.get(i.id)?.status==="held")}done(){return y(this,Ba,"f").promise}async runUntilDone(){if(!y(this,vf,"f"))for await(let n of this);return this.done()}get params(){return y(this,Pt,"f").params}pushMessages(...n){this.setMessagesParams(r=>({...r,messages:[...r.messages,...n]}))}compactBeforeNextTurn(n){y(this,ti,"f").status!=="in_flight"&&(R1(y(this,Pt,"f").params),D(this,ti,{status:"scheduled",config:n??{type:"summarize"}},"f"))}addTools(...n){for(let r of n)"name"in r&&y(this,kf,"f").set(r.name,"run"in r?r:null),y(this,Al,"f").push({type:"addition",tool:r})}removeTools(...n){for(let r of n){let i=typeof r=="string"?r:r.name;y(this,kf,"f").set(i,null),y(this,Al,"f").push({type:"removal",name:i})}}then(n,r){return this.runUntilDone().then(n,r)}}return S1=async function*(n){await y(this,Lt,"m",x1).call(this),D(this,Fo,void 0,"f"),n={...n,...n.tools&&{tools:n.tools.map(P1)},messages:Zee(n.messages)},n.stream?(D(this,Ga,y(this,Pt,"f").params.runToolsEagerly?y(this,Lt,"m",qee).call(this,n):this.client.beta.messages.stream({...n},y(this,Fr,"f")),"f"),D(this,jr,y(this,Ga,"f").finalMessage(),"f"),y(this,jr,"f").catch(()=>{}),yield y(this,Ga,"f")):(D(this,jr,this.client.beta.messages.create({...n,stream:!1},y(this,Fr,"f")),"f"),yield y(this,jr,"f"))},qee=function(n){let r=new Map;return D(this,Fo,r,"f"),$1.start(this.client.beta.messages,n,y(this,Fr,"f"),i=>{if(r.has(i.id))return;let o=Xee(y(this,Lt,"m",My).call(this),y(this,Lt,"m",Tx).call(this),i,y(this,Fr,"f"));o.catch(()=>{}),r.set(i.id,{status:"started",result:o})})},x1=async function(){let n=[...y(this,Fo,"f")?.values()??[]].filter(r=>r.status==="started");await Promise.allSettled(n.map(r=>r.result))},E1=async function*(n){R1(y(this,Pt,"f").params);let{max_iterations:r,runToolsEagerly:i,...o}=y(this,Pt,"f").params,s=YLe(o);D(this,ti,{status:"in_flight"},"f"),D(this,Lo,void 0,"f");let a=y(this,jr,"f");try{yield*y(this,Lt,"m",S1).call(this,{...s,compaction:n});let c=await y(this,jr,"f");c.content.some(l=>l.type==="compaction"&&l.content)?(y(this,Lt,"m",Wee).call(this),y(this,Pt,"f").params.messages=[{role:c.role,content:c.content}]):(ze(this.client).warn("Compaction produced no summary; keeping the conversation as it is."),D(this,jr,a,"f"))}finally{D(this,ti,{status:"idle"},"f")}},My=function(){let n=new Map;for(let r of y(this,Pt,"f").params.tools)"run"in r&&n.set(r.name,r);for(let[r,i]of y(this,kf,"f"))i?n.set(r,i):n.delete(r);return n},Tx=function(){let n=new Set(y(this,Lt,"m",My).call(this).keys());for(let r of[...y(this,Pt,"f").params.messages,y(this,Lt,"m",A1).call(this)])if(typeof r.content!="string"){for(let i of r.content)if(r.role==="system")Yee(i,n);else if(r.role==="assistant"&&i.type==="compaction")for(let o of i.tool_changes??[])Yee(o,n)}return n},Wee=function(){let n=y(this,Lt,"m",Tx).call(this);for(let r of y(this,Lt,"m",My).call(this).keys())n.has(r)||y(this,kf,"f").set(r,null)},T1=async function*(){if(y(this,ti,"f").status!=="scheduled")return;let n=y(this,Pt,"f").params.messages.at(-1)?.content;if(Array.isArray(n)&&n.some(r=>r.type==="tool_use")){ze(this.client).warn("The pending compaction was skipped because the last turn ended with tool calls that were not run. Call `compactBeforeNextTurn()` again if you continue the conversation."),D(this,ti,{status:"idle"},"f");return}yield*y(this,Lt,"m",E1).call(this,y(this,ti,"f").config)},I1=async function(n,r=y(this,Fr,"f").signal){return y(this,Lo,"f")!==void 0?y(this,Lo,"f"):(D(this,Lo,QLe(y(this,Lt,"m",My).call(this),y(this,Lt,"m",Tx).call(this),n,{...y(this,Fr,"f"),signal:r},y(this,Fo,"f")),"f"),y(this,Lo,"f"))},Hee=function(){y(this,wf,"f")==="pause_turn"||y(this,Al,"f").length===0||(y(this,Pt,"f").params.messages.push(y(this,Lt,"m",A1).call(this)),D(this,Al,[],"f"))},A1=function(){let n=[];for(let r of y(this,Al,"f")){if(r.type==="removal"){n.push({type:"tool_removal",tool:{type:"tool_reference",name:r.name}});continue}let i=P1(r.tool);n.push({type:"tool_addition",tool:{type:"tool_definition",definition:i}})}return{role:"system",content:n}},e})()});function nte(e){if(!e.output_format)return e;if(e.output_config?.format)throw new Y("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...n}=e;return{...n,output_config:{...e.output_config,format:t}}}var tte,nFe,Np,nx,rx=O(()=>{Rp();lF();X();uF();Ee();Ii();fF();_F();ete();gp();lF();tte={"claude-sonnet-4-5":"November 30th, 2026","claude-sonnet-4-5-20250929":"November 30th, 2026"},nFe=["claude-mythos-preview","claude-opus-4-6"],Np=(()=>{class e extends P{constructor(){super(...arguments),this.batches=new Pp(this._client)}create(n,r){let i=nte(n),{betas:o,user_profile_id:s,workspace_id:a,...c}=i;c.model in tte&&console.warn(`The model '${c.model}' is deprecated and will reach end-of-life on ${tte[c.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),nFe.includes(c.model)&&c.thinking&&c.thinking.type==="enabled"&&console.warn(`Using Claude with ${c.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let l=r?.timeout??this._client._options.timeout;if(!c.stream&&l==null){let d=WS[c.model]??void 0;l=this._client.calculateNonstreamingTimeout(c.max_tokens,d)}let u=iS(c.tools,c.messages);return this._client.post("/v1/messages?beta=true",{body:c,timeout:l??6e5,...r,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-user-profile-id":s}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},u,r?.headers]),stream:i.stream??!1})}parse(n,r){return r={...r,headers:I([{"anthropic-beta":[...n.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(n,r).then(i=>pF(i,n,{logger:this._client.logger??console}))}stream(n,r){return tx.createMessage(this,n,r)}countTokens(n,r){let i=nte(n),{betas:o,user_profile_id:s,workspace_id:a,...c}=i;return this._client.post("/v1/messages/count_tokens?beta=true",{body:c,...r,headers:I([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString(),...s!=null?{"anthropic-user-profile-id":s}:void 0,...a!=null?{"anthropic-workspace-id":a}:void 0},r?.headers])})}toolRunner(n,r){return new C1(this._client,n,r)}}return e.Batches=Pp,e.BetaToolRunner=C1,e.ToolError=Me,e})();nx=["input_schema","name","allowed_callers","cache_control","defer_loading","description","eager_input_streaming","input_examples","strict","type","configs","display_height_px","display_width_px","display_number","enable_zoom","max_characters"]});var Ly,N1=O(()=>{X();wL();wL();kL();kL();_L();_L();SL();SL();xL();xL();EL();EL();RL();RL();CL();CL();iF();iF();aF();aF();rx();rx();d1();d1();h1();h1();b1();b1();w1();w1();_1();_1();Ly=(()=>{class e extends P{constructor(){super(...arguments),this.models=new ip(this._client),this.messages=new Np(this._client),this.agents=new cS(this._client),this.environments=new BS(this._client),this.sessions=new bx(this._client),this.deployments=new ep(this._client),this.deploymentRuns=new Xd(this._client),this.vaults=new kx(this._client),this.memoryStores=new VS(this._client),this.files=new rp(this._client),this.skills=new vx(this._client),this.webhooks=new ap(this._client),this.userProfiles=new op(this._client),this.dreams=new tp(this._client),this.tunnels=new wx(this._client),this.organization=new gx(this._client)}}return e.Models=ip,e.Messages=Np,e.Agents=cS,e.Environments=BS,e.Sessions=bx,e.Deployments=ep,e.DeploymentRuns=Xd,e.Vaults=kx,e.MemoryStores=VS,e.Files=rp,e.Skills=vx,e.Webhooks=ap,e.UserProfiles=op,e.Dreams=tp,e.Tunnels=wx,e.Organization=gx,e})()});var Rl,D1=O(()=>{X();Ee();Rl=class extends P{create(t,n){let{betas:r,workspace_id:i,...o}=t;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers]),stream:t.stream??!1})}}});var Pl,O1=O(()=>{X();ie();Ee();Ii();Ti();me();Pl=class extends P{list(t={},n){let{workspace_id:r,...i}=t??{};return this._client.getAPIList("/v1/files",G,{query:i,...n,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},r){let{workspace_id:i}=n??{};return this._client.delete(x`/v1/files/${t}`,{...r,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}download(t,n={},r){let{workspace_id:i}=n??{};return this._client.get(x`/v1/files/${t}/content`,{...r,headers:I([{Accept:"application/binary",...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},r){let{workspace_id:i}=n??{};return this._client.get(x`/v1/files/${t}`,{...r,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}upload(t,n){let{workspace_id:r,...i}=t;return this._client.post("/v1/files",In({body:i,...n,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},oS(i.file),n?.headers])},this._client))}}});function rte(e){return e?.output_config?.format}function M1(e,t,n){let r=rte(t);return!t||!("parse"in(r??{}))?{...e,content:e.content.map(i=>i.type==="text"?Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1}):i),parsed_output:null}:L1(e,t,n)}function L1(e,t,n){let r=null,i=e.content.map(o=>{if(o.type==="text"){let s=iFe(t,o.text);return r===null&&(r=s),Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1})}return o});return{...e,content:i,parsed_output:r}}function iFe(e,t){let n=rte(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(r){throw new Y(`Failed to parse structured output: ${r}`)}}var F1=O(()=>{_t()});function V1(e){return e.type==="tool_use"||e.type==="server_tool_use"}var Ci,Va,_f,Fy,Ix,jy,Uy,Ax,zy,jo,Gy,Rx,Px,Cl,Cx,Nx,Dx,By,j1,ite,U1,z1,G1,B1,ote,ste,ate=O(()=>{er();Ii();Pa();Rp();mF();F1();gF();ste=(()=>{class e{constructor(n,r){Ci.add(this),this.messages=[],this.receivedMessages=[],Va.set(this,void 0),_f.set(this,null),this.controller=new AbortController,Fy.set(this,void 0),Ix.set(this,()=>{}),jy.set(this,()=>{}),Uy.set(this,void 0),Ax.set(this,()=>{}),zy.set(this,()=>{}),jo.set(this,{}),Gy.set(this,!1),Rx.set(this,!1),Px.set(this,!1),Cl.set(this,!1),Cx.set(this,void 0),Nx.set(this,void 0),Dx.set(this,void 0),By.set(this,void 0),U1.set(this,i=>{if(D(this,Rx,!0,"f"),Jr(i)&&(i=new Tn),i instanceof Tn)return D(this,Px,!0,"f"),this._emit("abort",i);if(i instanceof Y)return this._emit("error",i);if(i instanceof Error){let o=new Y(i.message);return o.cause=i,this._emit("error",o)}return this._emit("error",new Y(String(i)))}),D(this,Fy,new Promise((i,o)=>{D(this,Ix,i,"f"),D(this,jy,o,"f")}),"f"),D(this,Uy,new Promise((i,o)=>{D(this,Ax,i,"f"),D(this,zy,o,"f")}),"f"),y(this,Fy,"f").catch(()=>{}),y(this,Uy,"f").catch(()=>{}),D(this,_f,n,"f"),D(this,By,r?.logger??console,"f")}get response(){return y(this,Cx,"f")}get request_id(){return y(this,Nx,"f")}get workspace_id(){return y(this,Dx,"f")}async withResponse(){D(this,Cl,!0,"f");let n=await y(this,Fy,"f");if(!n)throw new Error("Could not resolve a `Response` object");return{data:this,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}static fromReadableStream(n){let r=new e(null);return r._run(()=>r._fromReadableStream(n)),r}static createMessage(n,r,i,{logger:o}={}){let s=new e(r,{logger:o});for(let a of r.messages)s._addMessageParam(a);return D(s,_f,{...r,stream:!0},"f"),s._run(()=>s._createMessage(n,{...r,stream:!0},{...i,headers:{...i?.headers,[np]:"stream"}})),s}_run(n){n().then(()=>{this._emitFinal(),this._emit("end")},y(this,U1,"f"))}_addMessageParam(n){this.messages.push(n)}_addMessage(n,r=!0){this.receivedMessages.push(n),r&&this._emit("message",n)}async _createMessage(n,r,i){let o=i?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{y(this,Ci,"m",z1).call(this);let{response:a,data:c}=await n.create({...r,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(a);for await(let l of c)y(this,Ci,"m",G1).call(this,l);if(c.controller.signal?.aborted)throw new Tn;y(this,Ci,"m",B1).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(n){this.ended||(D(this,Cx,n,"f"),D(this,Nx,n?.headers.get("request-id"),"f"),D(this,Dx,n?.headers.get("anthropic-workspace-id"),"f"),y(this,Ix,"f").call(this,n),this._emit("connect"))}get ended(){return y(this,Gy,"f")}get errored(){return y(this,Rx,"f")}get aborted(){return y(this,Px,"f")}abort(){this.controller.abort()}on(n,r){return(y(this,jo,"f")[n]||(y(this,jo,"f")[n]=[])).push({listener:r}),this}off(n,r){let i=y(this,jo,"f")[n];if(!i)return this;let o=i.findIndex(s=>s.listener===r);return o>=0&&i.splice(o,1),this}once(n,r){return(y(this,jo,"f")[n]||(y(this,jo,"f")[n]=[])).push({listener:r,once:!0}),this}emitted(n){return new Promise((r,i)=>{D(this,Cl,!0,"f"),n!=="error"&&this.once("error",i),this.once(n,r)})}async done(){D(this,Cl,!0,"f"),await y(this,Uy,"f")}get currentMessage(){return y(this,Va,"f")}async finalMessage(){return await this.done(),y(this,Ci,"m",j1).call(this)}async finalText(){return await this.done(),y(this,Ci,"m",ite).call(this)}_emit(n,...r){if(y(this,Gy,"f"))return;n==="end"&&(D(this,Gy,!0,"f"),y(this,Ax,"f").call(this));let i=y(this,jo,"f")[n];if(i&&(y(this,jo,"f")[n]=i.filter(o=>!o.once),i.forEach(({listener:o})=>o(...r))),n==="abort"){let o=r[0];!y(this,Cl,"f")&&!i?.length&&Promise.reject(o),y(this,jy,"f").call(this,o),y(this,zy,"f").call(this,o),this._emit("end");return}if(n==="error"){let o=r[0];!y(this,Cl,"f")&&!i?.length&&Promise.reject(o),y(this,jy,"f").call(this,o),y(this,zy,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",y(this,Ci,"m",j1).call(this))}async _fromReadableStream(n,r){let i=r?.signal,o;i&&(i.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),i.addEventListener("abort",o));try{y(this,Ci,"m",z1).call(this),this._connected(null);let s=Ei.fromReadableStream(n,this.controller);for await(let a of s)y(this,Ci,"m",G1).call(this,a);if(s.controller.signal?.aborted)throw new Tn;y(this,Ci,"m",B1).call(this)}finally{i&&o&&i.removeEventListener("abort",o)}}[(Va=new WeakMap,_f=new WeakMap,Fy=new WeakMap,Ix=new WeakMap,jy=new WeakMap,Uy=new WeakMap,Ax=new WeakMap,zy=new WeakMap,jo=new WeakMap,Gy=new WeakMap,Rx=new WeakMap,Px=new WeakMap,Cl=new WeakMap,Cx=new WeakMap,Nx=new WeakMap,Dx=new WeakMap,By=new WeakMap,U1=new WeakMap,Ci=new WeakSet,j1=function(){if(this.receivedMessages.length===0)throw new Y("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},ite=function(){if(this.receivedMessages.length===0)throw new Y("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(r.length===0)throw new Y("stream ended without producing a content block with type=text");return r.join(" ")},z1=function(){this.ended||D(this,Va,void 0,"f")},G1=function(r){if(this.ended)return;let i=y(this,Ci,"m",ote).call(this,r);switch(this._emit("streamEvent",r,i),r.type){case"content_block_delta":{let o=i.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{V1(o)&&y(this,jo,"f").inputJson?.length&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:r.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(M1(i,y(this,_f,"f"),{logger:y(this,By,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{D(this,Va,i,"f");break}case"content_block_start":case"message_delta":break}},B1=function(){if(this.ended)throw new Y("stream has ended, this shouldn't happen");let r=y(this,Va,"f");if(!r)throw new Y("request ended without sending any chunks");return D(this,Va,void 0,"f"),M1(r,y(this,_f,"f"),{logger:y(this,By,"f")})},ote=function(r){let i=y(this,Va,"f");if(r.type==="message_start"){if(i)throw new Y(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!i)throw new Y(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return i;case"message_delta":return i.stop_reason=r.delta.stop_reason,i.stop_sequence=r.delta.stop_sequence,i.stop_details=r.delta.stop_details,i.usage.output_tokens=r.usage.output_tokens,r.delta.container!=null&&(i.container=r.delta.container),r.usage.input_tokens!=null&&(i.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(i.usage.server_tool_use=r.usage.server_tool_use),r.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=r.usage.output_tokens_details),i;case"content_block_start":return i.content.push({...r.content_block}),i;case"content_block_delta":{let o=i.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(i.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(i.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&V1(o)){let s=(o[Ua]||"")+r.delta.partial_json;i.content[r.index]=HS(o,s)}break}case"thinking_delta":{o?.type==="thinking"&&(i.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(i.content[r.index]={...o,signature:r.delta.signature});break}default:r.delta}return i}case"content_block_stop":{let o=i.content.at(r.index);return o&&V1(o)&&Ua in o&&Object.defineProperty(o,"input",{value:o.input,enumerable:!0,configurable:!0,writable:!0}),i}}},Symbol.asyncIterator)](){let n=[],r=[],i=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):n.push(o)}),this.on("end",()=>{i=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{i=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{i=!0;for(let s of r)s.reject(o);r.length=0}),{next:async()=>n.length?{value:n.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,a)=>r.push({resolve:s,reject:a})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Ei(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}return e})()});var $f,q1=O(()=>{X();ie();Ee();cF();Rp();me();$f=class extends P{create(t,n){let{user_profile_id:r,workspace_id:i,...o}=t;return this._client.post("/v1/messages/batches",{body:o,...n,headers:I([{...r!=null?{"anthropic-user-profile-id":r}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}retrieve(t,n={},r){let{workspace_id:i}=n??{};return this._client.get(x`/v1/messages/batches/${t}`,{...r,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}list(t={},n){let{workspace_id:r,...i}=t??{};return this._client.getAPIList("/v1/messages/batches",dt,{query:i,...n,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},r){let{workspace_id:i}=n??{};return this._client.delete(x`/v1/messages/batches/${t}`,{...r,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}cancel(t,n={},r){let{workspace_id:i}=n??{};return this._client.post(x`/v1/messages/batches/${t}/cancel`,{...r,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}async results(t,n={},r){let i=await this.retrieve(t,n,r);if(!i.results_url)throw new Y(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{workspace_id:o}=n??{};return this._client.get(i.results_url,{...r,headers:I([{Accept:"application/binary",...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,a)=>qS.fromResponse(a.response,a.controller))}}});var Vy,cte,sFe,W1=O(()=>{X();Ee();Ii();ate();F1();q1();q1();uF();Vy=(()=>{class e extends P{constructor(){super(...arguments),this.batches=new $f(this._client)}create(n,r){let{user_profile_id:i,workspace_id:o,...s}=n;s.model in cte&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${cte[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),sFe.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let a=r?.timeout??this._client._options.timeout;if(!s.stream&&a==null){let l=WS[s.model]??void 0;a=this._client.calculateNonstreamingTimeout(s.max_tokens,l)}let c=iS(s.tools,s.messages);return this._client.post("/v1/messages",{body:s,timeout:a??6e5,...r,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},c,r?.headers]),stream:n.stream??!1})}parse(n,r){return this.create(n,r).then(i=>L1(i,n,{logger:this._client.logger??console}))}stream(n,r){return ste.createMessage(this,n,r,{logger:this._client.logger??console})}countTokens(n,r){let{user_profile_id:i,workspace_id:o,...s}=n;return this._client.post("/v1/messages/count_tokens",{body:s,...r,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}}return e.Batches=$f,e})(),cte={"claude-sonnet-4-5":"November 30th, 2026","claude-sonnet-4-5-20250929":"November 30th, 2026"},sFe=["claude-mythos-preview","claude-opus-4-6"]});var Nl,H1=O(()=>{X();ie();Ee();me();Nl=class extends P{retrieve(t,n={},r){let{betas:i,workspace_id:o}=n??{};return this._client.get(x`/v1/models/${t}`,{...r,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(t={},n){let{betas:r,workspace_id:i,...o}=t??{};return this._client.getAPIList("/v1/models",dt,{query:o,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}}});var Sf,K1=O(()=>{X();ie();me();Sf=class extends P{retrieve(t,n){return this._client.get(x`/v1/organizations/api_keys/${t}`,n)}update(t,n,r){return this._client.post(x`/v1/organizations/api_keys/${t}`,{body:n,...r})}list(t={},n){return this._client.getAPIList("/v1/organizations/api_keys",dt,{query:t,...n})}}});var xf,J1=O(()=>{X();xf=class extends P{retrieve(t){return this._client.get("/v1/organizations/compliance_settings",t)}update(t,n){return this._client.post("/v1/organizations/compliance_settings",{body:t,...n})}}});var Ef,Z1=O(()=>{X();ie();me();Ef=class extends P{create(t,n){return this._client.post("/v1/organizations/external_keys",{body:t,...n})}retrieve(t,n){return this._client.get(x`/v1/organizations/external_keys/${t}`,n)}update(t,n,r){return this._client.post(x`/v1/organizations/external_keys/${t}`,{body:n,...r})}list(t={},n){return this._client.getAPIList("/v1/organizations/external_keys",G,{query:t,...n})}delete(t,n){return this._client.delete(x`/v1/organizations/external_keys/${t}`,n)}validate(t,n){return this._client.post(x`/v1/organizations/external_keys/${t}/validate`,n)}}});var Tf,Y1=O(()=>{X();ie();me();Tf=class extends P{create(t,n){return this._client.post("/v1/organizations/invites",{body:t,...n})}retrieve(t,n){return this._client.get(x`/v1/organizations/invites/${t}`,n)}list(t={},n){return this._client.getAPIList("/v1/organizations/invites",dt,{query:t,...n})}delete(t,n){return this._client.delete(x`/v1/organizations/invites/${t}`,n)}}});var If,Q1=O(()=>{X();ie();If=class extends P{list(t={},n){return this._client.getAPIList("/v1/organizations/rate_limits",G,{query:t,...n})}}});var Af,X1=O(()=>{X();ie();me();Af=class extends P{retrieve(t,n){return this._client.get(x`/v1/organizations/users/${t}`,n)}update(t,n,r){return this._client.post(x`/v1/organizations/users/${t}`,{body:n,...r})}list(t={},n){return this._client.getAPIList("/v1/organizations/users",dt,{query:t,...n})}remove(t,n){return this._client.delete(x`/v1/organizations/users/${t}`,n)}}});var Rf,ej=O(()=>{X();ie();me();Rf=class extends P{create(t,n){return this._client.post("/v1/organizations/federation_issuers",{body:t,...n})}retrieve(t,n){return this._client.get(x`/v1/organizations/federation_issuers/${t}`,n)}update(t,n,r){return this._client.post(x`/v1/organizations/federation_issuers/${t}`,{body:n,...r})}list(t={},n){return this._client.getAPIList("/v1/organizations/federation_issuers",G,{query:t,...n})}archive(t,n){return this._client.post(x`/v1/organizations/federation_issuers/${t}/archive`,n)}}});var Pf,tj=O(()=>{X();ie();me();Pf=class extends P{list(t,n={},r){return this._client.getAPIList(x`/v1/organizations/federation_rules/${t}/workspaces`,G,{query:n,...r})}add(t,n,r){return this._client.post(x`/v1/organizations/federation_rules/${t}/workspaces`,{body:n,...r})}remove(t,n,r){let{federation_rule_id:i}=n;return this._client.delete(x`/v1/organizations/federation_rules/${i}/workspaces/${t}`,r)}}});var Ox,nj=O(()=>{X();tj();tj();ie();me();Ox=(()=>{class e extends P{constructor(){super(...arguments),this.workspaces=new Pf(this._client)}create(n,r){return this._client.post("/v1/organizations/federation_rules",{body:n,...r})}retrieve(n,r){return this._client.get(x`/v1/organizations/federation_rules/${n}`,r)}update(n,r,i){return this._client.post(x`/v1/organizations/federation_rules/${n}`,{body:r,...i})}list(n={},r){return this._client.getAPIList("/v1/organizations/federation_rules",G,{query:n,...r})}archive(n,r){return this._client.post(x`/v1/organizations/federation_rules/${n}/archive`,r)}}return e.Workspaces=Pf,e})()});var Mx,rj=O(()=>{X();ej();ej();nj();nj();Mx=(()=>{class e extends P{constructor(){super(...arguments),this.issuers=new Rf(this._client),this.rules=new Ox(this._client)}}return e.Issuers=Rf,e.Rules=Ox,e})()});var Cf,ij=O(()=>{X();ie();me();Cf=class extends P{list(t,n={},r){return this._client.getAPIList(x`/v1/organizations/service_accounts/${t}/workspaces`,G,{query:n,...r})}add(t,n,r){return this._client.post(x`/v1/organizations/service_accounts/${t}/workspaces`,{body:n,...r})}remove(t,n,r){let{service_account_id:i}=n;return this._client.delete(x`/v1/organizations/service_accounts/${i}/workspaces/${t}`,r)}}});var Lx,oj=O(()=>{X();ij();ij();ie();me();Lx=(()=>{class e extends P{constructor(){super(...arguments),this.workspaces=new Cf(this._client)}create(n,r){return this._client.post("/v1/organizations/service_accounts",{body:n,...r})}retrieve(n,r){return this._client.get(x`/v1/organizations/service_accounts/${n}`,r)}update(n,r,i){return this._client.post(x`/v1/organizations/service_accounts/${n}`,{body:r,...i})}list(n={},r){return this._client.getAPIList("/v1/organizations/service_accounts",G,{query:n,...r})}archive(n,r){return this._client.post(x`/v1/organizations/service_accounts/${n}/archive`,r)}}return e.Workspaces=Cf,e})()});var Nf,sj=O(()=>{X();ie();me();Nf=class extends P{retrieve(t,n,r){let{workspace_id:i}=n;return this._client.get(x`/v1/organizations/workspaces/${i}/members/${t}`,r)}update(t,n,r){let{workspace_id:i,...o}=n;return this._client.post(x`/v1/organizations/workspaces/${i}/members/${t}`,{body:o,...r})}list(t,n={},r){return this._client.getAPIList(x`/v1/organizations/workspaces/${t}/members`,dt,{query:n,...r})}add(t,n,r){return this._client.post(x`/v1/organizations/workspaces/${t}/members`,{body:n,...r})}remove(t,n,r){let{workspace_id:i}=n;return this._client.delete(x`/v1/organizations/workspaces/${i}/members/${t}`,r)}}});var Df,aj=O(()=>{X();ie();me();Df=class extends P{list(t,n={},r){return this._client.getAPIList(x`/v1/organizations/workspaces/${t}/rate_limits`,G,{query:n,...r})}}});var Of,cj=O(()=>{X();ie();me();Of=class extends P{retrieve(t,n,r){let{workspace_id:i}=n;return this._client.get(x`/v1/organizations/workspaces/${i}/service_accounts/${t}`,r)}update(t,n,r){let{workspace_id:i,...o}=n;return this._client.post(x`/v1/organizations/workspaces/${i}/service_accounts/${t}`,{body:o,...r})}list(t,n={},r){return this._client.getAPIList(x`/v1/organizations/workspaces/${t}/service_accounts`,G,{query:n,...r})}add(t,n,r){return this._client.post(x`/v1/organizations/workspaces/${t}/service_accounts`,{body:n,...r})}remove(t,n,r){let{workspace_id:i}=n;return this._client.delete(x`/v1/organizations/workspaces/${i}/service_accounts/${t}`,r)}}});var Fx,lj=O(()=>{X();sj();sj();aj();aj();cj();cj();ie();me();Fx=(()=>{class e extends P{constructor(){super(...arguments),this.rateLimits=new Df(this._client),this.members=new Nf(this._client),this.serviceAccounts=new Of(this._client)}create(n,r){return this._client.post("/v1/organizations/workspaces",{body:n,...r})}retrieve(n,r){return this._client.get(x`/v1/organizations/workspaces/${n}`,r)}update(n,r,i){return this._client.post(x`/v1/organizations/workspaces/${n}`,{body:r,...i})}list(n={},r){return this._client.getAPIList("/v1/organizations/workspaces",dt,{query:n,...r})}archive(n,r){return this._client.post(x`/v1/organizations/workspaces/${n}/archive`,r)}}return e.RateLimits=Df,e.Members=Nf,e.ServiceAccounts=Of,e})()});var qy,uj=O(()=>{X();K1();K1();J1();J1();Z1();Z1();Y1();Y1();Q1();Q1();X1();X1();rj();rj();oj();oj();lj();lj();qy=(()=>{class e extends P{constructor(){super(...arguments),this.apiKeys=new Sf(this._client),this.externalKeys=new Ef(this._client),this.federation=new Mx(this._client),this.invites=new Tf(this._client),this.serviceAccounts=new Lx(this._client),this.users=new Af(this._client),this.workspaces=new Fx(this._client),this.rateLimits=new If(this._client),this.complianceSettings=new xf(this._client)}retrieve(n){return this._client.get("/v1/organizations/me",n)}}return e.APIKeys=Sf,e.ExternalKeys=Ef,e.Federation=Mx,e.Invites=Tf,e.ServiceAccounts=Lx,e.Users=Af,e.Workspaces=Fx,e.RateLimits=If,e.ComplianceSettings=xf,e})()});var Mf,dj=O(()=>{X();ie();Ee();Ti();me();Mf=class extends P{create(t,n,r){let{workspace_id:i,...o}=n;return this._client.post(x`/v1/skills/${t}/versions`,In({body:o,...r,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])},this._client,!1))}retrieve(t,n,r){let{skill_id:i,workspace_id:o}=n;return this._client.get(x`/v1/skills/${i}/versions/${t}`,{...r,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}list(t,n={},r){let{workspace_id:i,...o}=n??{};return this._client.getAPIList(x`/v1/skills/${t}/versions`,G,{query:o,...r,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}delete(t,n,r){let{skill_id:i,workspace_id:o}=n;return this._client.delete(x`/v1/skills/${i}/versions/${t}`,{...r,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},r?.headers])})}}});var Wy,pj=O(()=>{X();dj();dj();ie();Ee();Ti();me();Wy=(()=>{class e extends P{constructor(){super(...arguments),this.versions=new Mf(this._client)}create(n,r){let{workspace_id:i,...o}=n;return this._client.post("/v1/skills",In({body:o,...r,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])},this._client,!1))}retrieve(n,r={},i){let{workspace_id:o}=r??{};return this._client.get(x`/v1/skills/${n}`,{...i,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(n={},r){let{workspace_id:i,...o}=n??{};return this._client.getAPIList("/v1/skills",G,{query:o,...r,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},r?.headers])})}delete(n,r={},i){let{workspace_id:o}=r??{};return this._client.delete(x`/v1/skills/${n}`,{...i,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}return e.Versions=Mf,e})()});var lte=O(()=>{l7();N1();D1();O1();W1();H1();uj();pj()});var fj,mj,jx,ute,gj,hj,yj,bj,Ux=O(()=>{er();$i();Vd();Pa();N$();O$();qd();BM();YM();Wh();_t();Hd();DX();e7();o7();ie();bL();lte();Q$();D1();O1();H1();N1();W1();uj();pj();N$();Ee();Kd();xi();$i();gj="\\n\\nHuman:",hj="\\n\\nAssistant:",yj=(()=>{class e{get credentials(){return this._authState.provider}constructor({baseURL:n=Ge("ANTHROPIC_BASE_URL"),apiKey:r,authToken:i,webhookKey:o=Ge("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(fj.add(this),this._requestAuthFlags=new WeakMap,jx.set(this,void 0),r===void 0&&(r=s.profile!=null?null:Ge("ANTHROPIC_API_KEY")??null),i===void 0&&(i=s.profile!=null?null:Ge("ANTHROPIC_AUTH_TOKEN")??null),s.profile!=null&&(s.credentials!=null||s.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let a={apiKey:r,authToken:i,webhookKey:o,...s,baseURL:n||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&uX())throw new Y(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!t,this.timeout=s.timeout??_F.DEFAULT_TIMEOUT,this.logger=s.logger??console,this.logLevel=Oh,this.logLevel=E_(s.logLevel,"ClientOptions.logLevel",qe(this))??E_(ze("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",qe(this))??Oh,this.fetchOptions=s.fetchOptions,this.maxRetries=d_("maxRetries",s.maxRetries??2),this.fetch=s.fetch??$5(),M(this,VS,S5,"f"),this.middleware=[...s.middleware??[]];let a=ze("ANTHROPIC_CUSTOM_HEADERS");if(a){let l={};for(let u of a.split(` -`)){let d=u.indexOf(":");d>=0&&(l[u.substring(0,d).trim()]=u.substring(d+1).trim())}s.defaultHeaders={...l,...s.defaultHeaders}}let c=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof n=="string"?n:null,this.authToken=i,this.webhookKey=r,c)this._authState=c,!this._baseURLIsExplicit&&c.baseURL&&(this.baseURL=c.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let l=s.credentials??null;if(l)this._authState.provider=l,this._authState.tokenCache=this._makeTokenCache(l);else if(s.config!=null){let u=pM(s.config,this._credentialResolverOptions());this._authState.provider=u.provider,this._authState.tokenCache=this._makeTokenCache(u.provider),this._authState.extraHeaders=u.extraHeaders,this._applyCredentialBaseURL(u.baseURL)}else s.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(s.profile):this._shouldResolveDefaultCredentials()&&(this._authState.resolution=this._resolveDefaultCredentials())}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(t){if(!t)return;let n=t.replace(/\/+$/,"");this._authState.baseURL=n,this._baseURLIsExplicit||(this.baseURL=n)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:t=>{qe(this).debug("credential cache write failed (best-effort)",t)},onSafetyWarning:t=>{qe(this).warn(t)}}}_credentialsFetch(){return hM(this.fetch,this.middleware,void 0,this)}_makeTokenCache(t){return new __(t,n=>{qe(this).debug("advisory token refresh failed; serving cached token",n)})}withOptions(t){let n="credentials"in t||"config"in t||"profile"in t,i="apiKey"in t||"authToken"in t||n,r={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...n?{credentials:void 0,config:void 0,profile:void 0}:{},...t,__auth:i?void 0:this._authState,__baseURLIsExplicit:"baseURL"in t?!0:this._baseURLIsExplicit};return new this.constructor(r)}async _resolveDefaultCredentials(t){try{let n=await sQ(this._credentialResolverOptions(),t);if(n)this._authState.provider=n.provider,this._authState.tokenCache=this._makeTokenCache(n.provider),this._authState.extraHeaders=n.extraHeaders,this._applyCredentialBaseURL(n.baseURL);else if(t!=null)throw new J(`Profile "${t}" could not be resolved (no /configs/${t}.json found).`)}catch(n){this._authState.error=n}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:n}){if(!(t.get("x-api-key")||t.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&t.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&t.get("authorization"))&&!n.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(t){let n=this._requestAuthFlags.get(t);return n||(n={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(t,n)),n}async authHeaders(t){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let n=await this._authState.tokenCache.getToken();return this._authFlags(t).usedTokenCache=!0,I([{Authorization:`Bearer ${n}`}])}return I([await this.apiKeyAuth(t),await this.bearerAuth(t)])}}async apiKeyAuth(t){if(this.apiKey!=null)return I([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken!=null)return I([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return O5(t)}getUserAgent(){return`Anthropic/JS ${Si}`}makeStatusError(t,n,i,r){return Dt.generate(t,n,i,r)}buildURL(t,n,i){let r=!v(this,$F,"m",i7).call(this)&&i||this.baseURL,o=f5(t)?new URL(t):new URL(r+(r.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),s=this.defaultQuery(),a=Object.fromEntries(o.searchParams);return(!VO(s)||!VO(a))&&(n={...a,...s,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(o.search=this.stringifyQuery(n)),o.toString()}_calculateNonstreamingTimeout(t){if(3600*t/128e3>600)throw new J("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(t){}async prepareRequest(t,{url:n,options:i}){if(this._authState.tokenCache&&this.apiKey==null){let r=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(let[s,a]of Object.entries(this._authState.extraHeaders))r.has(s)||r.set(s,a);r.get("anthropic-beta")?.split(",").map(s=>s.trim())?.includes(_l)||r.append("anthropic-beta",_l),t.headers=r}}backendMiddleware(){return[]}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,i){return this.request(Promise.resolve(i).then(r=>({method:t,path:n,...r})))}request(t,n=null){return new La(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,i){let r=await t,o=d_("maxRetries",r.maxRetries??this.maxRetries);n==null&&(n=o,this._requestAuthFlags.delete(r)),await this.prepareOptions(r);let{req:s,url:a,timeout:c}=await this.buildRequest(r,{retryCount:o-n}),l="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),u=i===void 0?"":`, retryOf: ${i}`,d=Date.now();if(r.signal?.aborted)throw new In;let p=new AbortController,f=await this.fetchWithTimeout(a,s,c,p,r,{requestLogID:l,retryOfRequestLogID:i}).catch(pl),m=Date.now();if(f instanceof globalThis.Error){Co(p);let b=`retrying, ${n} attempts remaining`;if(r.signal?.aborted)throw new In;let y=Yr(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):"")),w=this.middleware.length>0||!!r.middleware?.length||this.backendMiddleware().length>0;if(w&&!y&&!pQ(f))throw qe(this).info(`[${l}] middleware error (not retryable)`),qe(this).debug(`[${l}] middleware error (not retryable)`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),f;if(n)return qe(this).info(`[${l}] connection ${y?"timed out":"failed"} - ${b}`),qe(this).debug(`[${l}] connection ${y?"timed out":"failed"} (${b})`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),this.retryRequest(r,n,i??l);throw qe(this).info(`[${l}] connection ${y?"timed out":"failed"} - error; no more retries left`),qe(this).debug(`[${l}] connection ${y?"timed out":"failed"} (error; no more retries left)`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),y?new fl:w&&!gM(f)?f:new Zi({cause:f})}let g=[...f.headers.entries()].filter(([b])=>b==="request-id"||b==="anthropic-workspace-id").map(([b,y])=>", "+b+": "+JSON.stringify(y)).join(""),h=`[${l}${u}${g}] ${s.method} ${a} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${m-d}ms`;if(!f.ok){let b=await this.shouldRetry(f,r);if(n&&b){let x=`retrying, ${n} attempts remaining`;return await _5(f.body),Co(p),qe(this).info(`${h} - ${x}`),qe(this).debug(`[${l}] response error (${x})`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,durationMs:m-d})),this.retryRequest(r,n,i??l,f.headers)}let y=b?"error; no more retries left":"error; not retryable";qe(this).info(`${h} - ${y}`);let w=await f.text().catch(x=>pl(x).message),k=$l(w),_=k?void 0:w;throw qe(this).debug(`[${l}] response error (${y})`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,message:_,durationMs:Date.now()-d})),Co(p),this.makeStatusError(f.status,k,_,f.headers)}return qe(this).info(h),qe(this).debug(`[${l}] response start`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,durationMs:m-d})),k5(f.body??f,p),{response:f,options:r,controller:p,requestLogID:l,retryOfRequestLogID:i,startTime:d}}getAPIList(t,n,i){return this.requestAPIList(n,i&&"then"in i?i.then(r=>({method:"get",path:t,...r})):{method:"get",path:t,...i})}requestAPIList(t,n){let i=this.makeRequest(n,null,void 0);return new fp(this,i,t)}async fetchWithTimeout(t,n,i,r,o,s){let{signal:a,method:c,...l}=n||{},u=this._makeAbort(r);a&&(a.addEventListener("abort",u,{once:!0}),w5(r,a,u));let d=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,p={signal:r.signal,...d?{duplex:"half"}:{},method:"GET",...l};c&&(p.method=c.toUpperCase());let f=this.fetch,m=async(w,k)=>{let _=setTimeout(u,i);try{return await f.call(void 0,w,k)}finally{clearTimeout(_)}},g=o===void 0?m:(async(w,k={})=>{let _=typeof w=="string"?w:w instanceof URL?w.href:w.url;return k.headers=k.headers instanceof Headers?k.headers:new Headers(k.headers),await this.prepareRequest(k,{url:_,options:o}),s&&qe(this).debug(`[${s.requestLogID}] sending request`,Oo({retryOfRequestLogID:s.retryOfRequestLogID,method:k.method,url:_,options:o,headers:k.headers})),m(w,k)}),h=o?.middleware,b=this.backendMiddleware(),y=h?.length||b.length?[...this.middleware,...h??[],...b]:this.middleware;return await hM(g,y,o,this)(t,p)}async shouldRetry(t,n){let i=this._authFlags(n);if(t.status===401&&this._authState.tokenCache&&i.usedTokenCache&&!i.didRefreshFor401)return i.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let r=t.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,i,r){let o,s=r?.get("retry-after-ms");if(s){let c=parseFloat(s);Number.isNaN(c)||(o=c)}let a=r?.get("retry-after");if(a&&!o){let c=parseFloat(a);Number.isNaN(c)?o=Date.parse(a)-Date.now():o=c*1e3}if(o===void 0||!(o>0&&o<=2**31-1)){let c=t.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(n,c)}return await Yi(o),this.makeRequest(t,n-1,i)}calculateDefaultRetryTimeoutMillis(t,n){let o=n-t,s=Math.min(.5*Math.pow(2,o),8),a=1-Math.random()*.25;return s*a*1e3}calculateNonstreamingTimeout(t,n){if(36e5*t/128e3>6e5||n!=null&&t>n)throw new J("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(t,{retryCount:n=0}={}){let i={...t},{method:r,path:o,query:s,defaultBaseURL:a}=i;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let c=this.buildURL(o,s,a);"timeout"in i&&d_("timeout",i.timeout),i.timeout=i.timeout??this.timeout;let{bodyHeaders:l,body:u}=this.buildBody({options:i}),d=await this.buildHeaders({options:t,method:r,bodyHeaders:l,retryCount:n});return{req:{method:r,headers:d,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...i.fetchOptions??{}},url:c,timeout:i.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:i,retryCount:r}){let o=I([{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...Rh(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(t),this._options.defaultHeaders,i,t.headers]);return this.validateHeaders(o),o.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};let i=I([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&i.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:g_(t)}:typeof t=="object"&&i.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)}:v(this,VS,"f").call(this,{body:t,headers:i})}};_F=Ot,VS=new WeakMap,$F=new WeakSet,i7=function(){return this.baseURL!=="https://api.anthropic.com"};Ot.Anthropic=_F;Ot.HUMAN_PROMPT=SF;Ot.AI_PROMPT=xF;Ot.DEFAULT_TIMEOUT=6e5;Ot.AnthropicError=J;Ot.APIError=Dt;Ot.APIConnectionError=Zi;Ot.APIConnectionTimeoutError=fl;Ot.APIUserAbortError=In;Ot.NotFoundError=yl;Ot.ConflictError=bl;Ot.RateLimitError=wl;Ot.BadRequestError=ml;Ot.AuthenticationError=gl;Ot.InternalServerError=kl;Ot.PermissionDeniedError=hl;Ot.UnprocessableEntityError=vl;Ot.toFile=Gh;no=class extends Ot{constructor(){super(...arguments),this.completions=new Kl(this),this.messages=new tc(this),this.models=new Yl(this),this.files=new Jl(this),this.skills=new nc(this),this.beta=new jt(this)}};no.Completions=Kl;no.Messages=tc;no.Models=Yl;no.Files=Jl;no.Skills=nc;no.Beta=jt});function TOe(e){let t=e.messages.flatMap(n=>{if(!Array.isArray(n.content))return[n];let i=n.content.filter(r=>r.type!=="fallback");return i.length===n.content.length?[n]:i.length>0?[{...n,content:i}]:[]});return{...e,messages:t}}function o7(e,t){let n={...e};for(let[i,r]of Object.entries(t))if(i==="output_config"&&r!=null){let o={...n[i]??{}};for(let[s,a]of Object.entries(r))TF(o,s,a);TF(n,i,Object.keys(o).length?o:null)}else TF(n,i,r);return n}function TF(e,t,n){n!==void 0&&(n===null?delete e[t]:e[t]=n)}function u7(e,t={}){let n=!1;return async(i,r,o)=>{let[s,a]=(o.options?.path??"").split("?");if(e.length===0||o.options?.method!=="post"||s!=="/v1/messages"||new URLSearchParams(a).get("beta")!=="true"||typeof o.options.body!="object"||o.options.body==null)return r(i);if(o.options.body.fallbacks!=null)throw new J("Sending the `fallbacks:` request param is not supported when using the `betaRefusalFallbackMiddleware`. You should either remove the middleware and send `fallbacks:` with the `server-side-fallback-2026-07-01` beta header to let the API handle refusal fallbacks, or omit the `fallbacks:` param if you'd like `betaRefusalFallbackMiddleware` to handle fallbacks on the client side.");let c=t.onError??(S=>o.logger.error(`anthropic-sdk: betaRefusalFallbackMiddleware: ${S.message}`));i=COe(i,t.betas??EOe);let l=TOe(o.options.body),u=o.options.fallbackState,d=u?.index??-1;if(!Number.isInteger(d)||d<-1||d>=e.length)throw new J(`fallbackState.index ${d} is out of bounds for a chain of ${e.length} fallback(s); was the state shared with a different middleware?`);let p=S=>{u?u.index=S:n||(n=!0,o.logger.warn("anthropic-sdk: betaRefusalFallbackMiddleware fell back without a `fallbackState` request option; follow-up requests will retry models that already refused. Pass a shared `{ fallbackState: new BetaFallbackState() }` to pin them to the accepted model."))},f=d===-1?l:o7(l,e[d]),m=typeof i.body!="string"?i:{...i,body:JSON.stringify(f)},g=await r(m);if(!g.ok)return g;if(o.options.stream===!0){let S=d+1;return S>=e.length||typeof m.body!="string"?g:IOe({request:m,response:g,next:r,ctx:o,fallbacks:e,firstHop:S,onError:c,pin:p})}let h=d,b=g,y=f.model,w=[];for(;hnull);if(L===0&&E.status===400&&f.length){i.logger.warn(`anthropic-sdk: betaRefusalFallbackMiddleware: fallback request with the partial output appended was rejected (HTTP 400: ${JSON.stringify(K)}); retrying without it`),x=p,E=null;continue}T={kind:"request_failed",message:`fallback request failed: HTTP ${E.status}: ${JSON.stringify(K)}`,model:k,status:E.status,detail:K};break}if(T){if(s(T),_)continue;let L={...h,recommended_model:k};yield $s("message_delta",{type:"message_delta",context_management:null,delta:{stop_reason:"refusal",stop_sequence:null,container:null,stop_details:L},usage:g??{},...b!==void 0&&{input_transformations:b}}),yield $s("message_stop",{type:"message_stop"});return}let A=yield*s7({response:E,controller:c,indexBase:u,hasNext:_,onError:s,splice:{iterations:y,model:k}});if(!A.refused)return;d=A.refused.token,h=A.refused.stopDetails,b=A.refused.inputTransformations,p=x,f=A.refused.hasPrefillClaim?a7(A.blocks):[],y.push(AF("message",k,A.refused.usage)),g=A.refused.usage,m=k,u=A.nextIndex}}async function*s7(e){let{response:t,controller:n,indexBase:i,hasNext:r,onError:o,splice:s}=e,a=new IF(i),c,l=null,u;for await(let d of Fr.rawEvents(t,n)){let p=$l(d.data);switch(p?.type){case"message_start":{if(c=p.message.model,l=p.message.usage,"input_transformations"in p.message&&(u=p.message.input_transformations),s)continue;break}case"content_block_start":{if(a.start(p),s){yield $s(p.type,p);continue}break}case"content_block_delta":{if(a.delta(p),s){yield $s(p.type,p);continue}break}case"content_block_stop":{if(a.stop(p),s){yield $s(p.type,p);continue}break}case"message_delta":{if(p.delta.stop_reason==="refusal"){let f=p.delta.stop_details?.type==="refusal"?p.delta.stop_details:null;if(f?.fallback_credit_token&&r){let m=c7(p.usage,l);return yield*a.closeOpenBlocks(),{refused:{token:f.fallback_credit_token,hasPrefillClaim:f.fallback_has_prefill_claim===!0,usage:m,stopDetails:f,inputTransformations:s?u:void 0},model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}f?.fallback_credit_token?o({kind:"chain_exhausted",message:"refusal but no fallback entries remain",event:p}):o({kind:"no_credit_token",message:"refusal stop_details has no fallback_credit_token",event:p})}if(s){let f=c7(p.usage,l);f.iterations=[...s.iterations,AF("fallback_message",s.model,f)],p.usage=f,!("input_transformations"in p)&&u!==void 0&&(p.input_transformations=u),yield $s("message_delta",p);continue}break}}yield POe(d)}return{refused:null,model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}function d7(e){return{token:e,mode:"best_effort"}}function ROe(e,{model:t,creditToken:n,continuation:i}){let r=JSON.parse(e.body);return r.model=t,r.fallback_credit_token=d7(n),i.length&&(r.messages=[...r.messages,{role:"assistant",content:i}]),{...e,headers:new Headers(e.headers),body:JSON.stringify(r)}}function NOe(e,t,n){let i=e.find(r=>r.index===t)?.block;if(i)switch(n.type){case"text_delta":{i.text=(i.text??"")+n.text;break}case"input_json_delta":{i._partial_json=(i._partial_json??"")+n.partial_json;break}case"citations_delta":(i.citations??(i.citations=[])).push(n.citation);break;case"thinking_delta":{i.thinking=(i.thinking??"")+n.thinking;break}case"signature_delta":{i.signature=n.signature;break}case"compaction_delta":break;default:}}function a7(e){return e.map(t=>{if(typeof t?._partial_json!="string")return t;let{_partial_json:n,...i}=t;return{...i,input:$l(n)??i.input}})}function COe(e,t){let n=new Headers(e.headers),i=new Set(n.get("anthropic-beta")?.split(",").map(r=>r.trim()));for(let r of t)i.has(r)||(n.append("anthropic-beta",r),i.add(r));return n.set(Mo,$M(n.get(Mo),"fallback-refusal-middleware")),{...e,headers:n}}function $s(e,t){let n={event:e,data:JSON.stringify(t),raw:[]};return l7.encode(p7(n))}function POe(e){return l7.encode(e.raw.length?e.raw.join(` +`);this.baseURL=a.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!n,this.timeout=a.timeout??mj.DEFAULT_TIMEOUT,this.logger=a.logger??console,this.logLevel=Yh,this.logLevel=H$(a.logLevel,"ClientOptions.logLevel",ze(this))??H$(Ge("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",ze(this))??Yh,this.fetchOptions=a.fetchOptions,this.maxRetries=C$("maxRetries",a.maxRetries??2),this.fetch=a.fetch??mX(),D(this,jx,hX,"f"),this.middleware=[...a.middleware??[]];let c=Ge("ANTHROPIC_CUSTOM_HEADERS");if(c){let u={};for(let d of c.split(` +`)){let p=d.indexOf(":");p>=0&&(u[d.substring(0,p).trim()]=d.substring(p+1).trim())}a.defaultHeaders={...u,...a.defaultHeaders}}let l=s.__auth;if(delete a.__auth,delete a.__baseURLIsExplicit,this._options=a,this.apiKey=typeof r=="string"?r:null,this.authToken=i,this.webhookKey=o,l)this._authState=l,!this._baseURLIsExplicit&&l.baseURL&&(this.baseURL=l.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let u=a.credentials??null;if(u)this._authState.provider=u,this._authState.tokenCache=this._makeTokenCache(u);else if(a.config!=null){let d=cL(a.config,this._credentialResolverOptions());this._authState.provider=d.provider,this._authState.tokenCache=this._makeTokenCache(d.provider),this._authState.extraHeaders=d.extraHeaders,this._applyCredentialBaseURL(d.baseURL)}else a.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(a.profile):this._shouldResolveDefaultCredentials()&&(this._authState.resolution=this._resolveDefaultCredentials())}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(n){if(!n)return;let r=n.replace(/\/+$/,"");this._authState.baseURL=r,this._baseURLIsExplicit||(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:n=>{ze(this).debug("credential cache write failed (best-effort)",n)},onSafetyWarning:n=>{ze(this).warn(n)}}}_credentialsFetch(){return pL(this.fetch,this.middleware,void 0,this)}_makeTokenCache(n){return new V$(n,r=>{ze(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(n){let r="credentials"in n||"config"in n||"profile"in n,i="apiKey"in n||"authToken"in n||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...n,__auth:i?void 0:this._authState,__baseURLIsExplicit:"baseURL"in n?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(n){try{let r=await XX(this._credentialResolverOptions(),n);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(n!=null)throw new Y(`Profile "${n}" could not be resolved (no /configs/${n}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:n,nulls:r}){if(!(n.get("x-api-key")||n.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&n.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&n.get("authorization"))&&!r.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(n){let r=this._requestAuthFlags.get(n);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(n,r)),r}async authHeaders(n){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(n).usedTokenCache=!0,I([{Authorization:`Bearer ${r}`}])}return I([await this.apiKeyAuth(n),await this.bearerAuth(n)])}}async apiKeyAuth(n){if(this.apiKey!=null)return I([{"X-Api-Key":this.apiKey}])}async bearerAuth(n){if(this.authToken!=null)return I([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(n){return TX(n)}getUserAgent(){return`Anthropic/JS ${Si}`}makeStatusError(n,r,i,o){return Mt.generate(n,r,i,o)}buildURL(n,r,i){let o=!y(this,fj,"m",ute).call(this)&&i||this.baseURL,s=oX(n)?new URL(n):new URL(o+(o.endsWith("/")&&n.startsWith("/")?n.slice(1):n)),a=this.defaultQuery(),c=Object.fromEntries(s.searchParams);return(!UM(a)||!UM(c))&&(r={...c,...a,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(n){if(3600*n/128e3>600)throw new Y("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(n){}async prepareRequest(n,{url:r,options:i}){if(this._authState.tokenCache&&this.apiKey==null){let o=n.headers instanceof Headers?n.headers:new Headers(n.headers);for(let[a,c]of Object.entries(this._authState.extraHeaders))o.has(a)||o.set(a,c);let s=o.get("anthropic-beta")?.split(",").map(a=>a.trim());s?.includes(dl)||o.set("anthropic-beta",[...s??[],dl].join(",")),n.headers=o}}backendMiddleware(){return[]}get(n,r){return this.methodRequest("get",n,r)}post(n,r){return this.methodRequest("post",n,r)}patch(n,r){return this.methodRequest("patch",n,r)}put(n,r){return this.methodRequest("put",n,r)}delete(n,r){return this.methodRequest("delete",n,r)}methodRequest(n,r,i){return this.request(Promise.resolve(i).then(o=>({method:n,path:r,...o})))}request(n,r=null){return new Qd(this,this.makeRequest(n,r,void 0))}async makeRequest(n,r,i){let o=await n,s=C$("maxRetries",o.maxRetries??this.maxRetries);this.isStreamBody(o.body)&&(s=0),r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:a,url:c,timeout:l}=await this.buildRequest(o,{retryCount:s-r}),u="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),d=i===void 0?"":`, retryOf: ${i}`,p=Date.now();if(o.signal?.aborted)throw new Tn;let f=new AbortController,m=await this.fetchWithTimeout(c,a,l,f,o,{requestLogID:u,retryOfRequestLogID:i}).catch(el),g=Date.now();if(m instanceof globalThis.Error){Po(f);let b=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new Tn;let w=Jr(m)||/timed? ?out/i.test(String(m)+("cause"in m?String(m.cause):"")),k=this.middleware.length>0||!!o.middleware?.length||this.backendMiddleware().length>0;if(k&&!w&&!i7(m))throw ze(this).info(`[${u}] middleware error (not retryable)`),Do(ze(this),`[${u}] middleware error (not retryable)`,{retryOfRequestLogID:i,url:c,durationMs:g-p,message:m.message}),m;if(r)return ze(this).info(`[${u}] connection ${w?"timed out":"failed"} - ${b}`),Do(ze(this),`[${u}] connection ${w?"timed out":"failed"} (${b})`,{retryOfRequestLogID:i,url:c,durationMs:g-p,message:m.message}),this.retryRequest(o,r,i??u);throw ze(this).info(`[${u}] connection ${w?"timed out":"failed"} - error; no more retries left`),Do(ze(this),`[${u}] connection ${w?"timed out":"failed"} (error; no more retries left)`,{retryOfRequestLogID:i,url:c,durationMs:g-p,message:m.message}),w?new tl:k&&!dL(m)?m:new Qi({cause:m})}let h=[...m.headers.entries()].filter(([b])=>b==="request-id"||b==="anthropic-workspace-id").map(([b,w])=>", "+b+": "+JSON.stringify(w)).join(""),v=`[${u}${d}${h}] ${a.method} ${c} ${m.ok?"succeeded":"failed"} with status ${m.status} in ${g-p}ms`;if(!m.ok){let b=await this.shouldRetry(m,o);if(r&&b){let T=`retrying, ${r} attempts remaining`;return await gX(m.body),Po(f),ze(this).info(`${v} - ${T}`),Do(ze(this),`[${u}] response error (${T})`,{retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,durationMs:g-p}),this.retryRequest(o,r,i??u,m.headers)}let w=b?"error; no more retries left":"error; not retryable";ze(this).info(`${v} - ${w}`);let k=await m.text().catch(T=>el(T).message),$=ul(k),S=$?void 0:k;throw Do(ze(this),`[${u}] response error (${w})`,{retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,message:S,durationMs:Date.now()-p}),Po(f),this.makeStatusError(m.status,$,S,m.headers)}return ze(this).info(v),Do(ze(this),`[${u}] response start`,{retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,durationMs:g-p}),fX(m.body??m,f),{response:m,options:o,controller:f,requestLogID:u,retryOfRequestLogID:i,startTime:p}}getAPIList(n,r,i){return this.requestAPIList(r,i&&"then"in i?i.then(o=>({method:"get",path:n,...o})):{method:"get",path:n,...i})}requestAPIList(n,r){let i=this.makeRequest(r,null,void 0);return new tS(this,i,n)}async fetchWithTimeout(n,r,i,o,s,a){let{signal:c,method:l,...u}=r||{},d=this._makeAbort(o);c&&(c.addEventListener("abort",d,{once:!0}),pX(o,c,d));let p=globalThis.ReadableStream&&u.body instanceof globalThis.ReadableStream||typeof u.body=="object"&&u.body!==null&&Symbol.asyncIterator in u.body,f={signal:o.signal,...p?{duplex:"half"}:{},method:"GET",...u};l&&(f.method=l.toUpperCase());let m=this.fetch,g=async(k,$)=>{let S=setTimeout(d,i);try{return await m.call(void 0,k,$)}finally{clearTimeout(S)}},h=s===void 0?g:(async(k,$={})=>{let S=typeof k=="string"?k:k instanceof URL?k.href:k.url;return $.headers=$.headers instanceof Headers?$.headers:new Headers($.headers),await this.prepareRequest($,{url:S,options:s}),a&&Do(ze(this),`[${a.requestLogID}] sending request`,{retryOfRequestLogID:a.retryOfRequestLogID,method:$.method,url:S,options:s,headers:$.headers}),g(k,$)}),v=s?.middleware,b=this.backendMiddleware(),w=v?.length||b.length?[...this.middleware,...v??[],...b]:this.middleware;return await pL(h,w,s,this)(n,f)}async shouldRetry(n,r){let i=this._authFlags(r);if(n.status===401&&this._authState.tokenCache&&i.usedTokenCache&&!i.didRefreshFor401)return i.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=n.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:n.status===408||n.status===409||n.status===429||n.status>=500}async retryRequest(n,r,i,o){let s,a=o?.get("retry-after-ms");if(a){let l=parseFloat(a);Number.isNaN(l)||(s=l)}let c=o?.get("retry-after");if(c&&!s){let l=parseFloat(c);Number.isNaN(l)?s=Date.parse(c)-Date.now():s=l*1e3}if(s===void 0||!(s>0&&s<=2**31-1)){let l=n.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,l)}return await Xi(s,n.signal??void 0),this.makeRequest(n,r-1,i)}calculateDefaultRetryTimeoutMillis(n,r){let s=r-n,a=Math.min(.5*Math.pow(2,s),8),c=1-Math.random()*.25;return a*c*1e3}calculateNonstreamingTimeout(n,r){if(36e5*n/128e3>6e5||r!=null&&n>r)throw new Y("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(n,{retryCount:r=0}={}){let i={...n},{method:o,path:s,query:a,defaultBaseURL:c}=i;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let l=this.buildURL(s,a,c);"timeout"in i&&C$("timeout",i.timeout),i.timeout=i.timeout??this.timeout;let{bodyHeaders:u,body:d}=this.buildBody({options:i}),p=await this.buildHeaders({options:n,method:o,bodyHeaders:u,retryCount:r,timeout:i.timeout});return{req:{method:o,headers:p,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&d instanceof globalThis.ReadableStream&&{duplex:"half"},...d&&{body:d},...this.fetchOptions??{},...i.fetchOptions??{}},url:l,timeout:i.timeout}}async buildHeaders({options:n,method:r,bodyHeaders:i,retryCount:o,timeout:s}){let a=I([{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),"X-Stainless-Timeout":String(Math.trunc(s/1e3)),...Hh(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(n),this._options.defaultHeaders,i,n.headers]);return this.validateHeaders(a),a.values}_makeAbort(n){return()=>n.abort()}buildBody({options:{body:n,headers:r}}){if(!n)return{bodyHeaders:void 0,body:void 0};let i=I([r]);return ArrayBuffer.isView(n)||n instanceof ArrayBuffer||n instanceof DataView||typeof n=="string"&&i.values.has("content-type")||globalThis.Blob&&n instanceof globalThis.Blob||n instanceof FormData||n instanceof URLSearchParams||globalThis.ReadableStream&&n instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:n}:this.isStreamBody(n)?{bodyHeaders:void 0,body:M$(n)}:typeof n=="object"&&i.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(n)}:y(this,jx,"f").call(this,{body:n,headers:i})}isStreamBody(n){return globalThis.ReadableStream&&n instanceof globalThis.ReadableStream?!0:typeof n=="object"&&n!==null&&(Symbol.asyncIterator in n||Symbol.iterator in n&&"next"in n&&typeof n.next=="function")}}return mj=e,jx=new WeakMap,fj=new WeakSet,ute=function(){return this.baseURL!=="https://api.anthropic.com"},e.Anthropic=mj,e.DEFAULT_TIMEOUT=6e5,e.AnthropicError=Y,e.APIError=Mt,e.APIConnectionError=Qi,e.APIConnectionTimeoutError=tl,e.APIUserAbortError=Tn,e.NotFoundError=ol,e.ConflictError=sl,e.RateLimitError=cl,e.BadRequestError=nl,e.AuthenticationError=rl,e.InternalServerError=ll,e.PermissionDeniedError=il,e.UnprocessableEntityError=al,e.toFile=iy,e.HUMAN_PROMPT=gj,e.AI_PROMPT=hj,e})(),bj=(()=>{class e extends yj{constructor(){super(...arguments),this.completions=new Rl(this),this.messages=new Vy(this),this.models=new Nl(this),this.files=new Pl(this),this.skills=new Wy(this),this.organization=new qy(this),this.beta=new Ly(this)}}return e.Completions=Rl,e.Messages=Vy,e.Models=Nl,e.Files=Pl,e.Skills=Wy,e.Organization=qy,e.Beta=Ly,e})()});function EFe(e){let t=e.messages.flatMap(n=>{if(!Array.isArray(n.content))return[n];let r=n.content.filter(i=>i.type!=="fallback");return r.length===n.content.length?[n]:r.length>0?[{...n,content:r}]:[]});return{...e,messages:t}}function dte(e,t){let n={...e};for(let[r,i]of Object.entries(t))if(r==="output_config"&&i!=null){let o={...n[r]??{}};for(let[s,a]of Object.entries(i))vj(o,s,a);vj(n,r,Object.keys(o).length?o:null)}else vj(n,r,i);return t.thinking===void 0&&e.thinking?.type==="between_tools"&&(n.thinking={type:"disabled"}),n}function vj(e,t,n){n!==void 0&&(n===null?delete e[t]:e[t]=n)}function hte(e,t={}){let n=!1;return async(r,i,o)=>{let[s,a]=(o.options?.path??"").split("?");if(e.length===0||o.options?.method!=="post"||s!=="/v1/messages"||new URLSearchParams(a).get("beta")!=="true"||typeof o.options.body!="object"||o.options.body==null)return i(r);if(o.options.body.fallbacks!=null)throw new Y("Sending the `fallbacks:` request param is not supported when using the `betaRefusalFallbackMiddleware`. You should either remove the middleware and send `fallbacks:` with the `server-side-fallback-2026-07-01` beta header to let the API handle refusal fallbacks, or omit the `fallbacks:` param if you'd like `betaRefusalFallbackMiddleware` to handle fallbacks on the client side.");let c=t.onError??(S=>o.logger.error(`anthropic-sdk: betaRefusalFallbackMiddleware: ${S.message}`));r=PFe(r,t.betas??xFe);let l=EFe(o.options.body),u=o.options.fallbackState,d=u?.index??-1;if(!Number.isInteger(d)||d<-1||d>=e.length)throw new Y(`fallbackState.index ${d} is out of bounds for a chain of ${e.length} fallback(s); was the state shared with a different middleware?`);let p=S=>{u?u.index=S:n||(n=!0,o.logger.warn("anthropic-sdk: betaRefusalFallbackMiddleware fell back without a `fallbackState` request option; follow-up requests will retry models that already refused. Pass a shared `{ fallbackState: new BetaFallbackState() }` to pin them to the accepted model."))},f=d===-1?l:dte(l,e[d]),m=typeof r.body!="string"?r:{...r,body:JSON.stringify(f)},g=await i(m);if(!g.ok)return g;if(o.options.stream===!0){let S=d+1;return S>=e.length||typeof m.body!="string"?g:TFe({request:m,response:g,next:i,ctx:o,fallbacks:e,firstHop:S,onError:c,pin:p})}let h=d,v=g,b=f.model,w=[];for(;hnull);if(j===0&&T.status===400&&f.length){r.logger.warn(`anthropic-sdk: betaRefusalFallbackMiddleware: fallback request with the partial output appended was rejected (HTTP 400: ${JSON.stringify(Z)}); retrying without it`),E=p,T=null;continue}A={kind:"request_failed",message:`fallback request failed: HTTP ${T.status}: ${JSON.stringify(Z)}`,model:k,status:T.status,detail:Z};break}if(A){if(s(A),$)continue;let j={...h,recommended_model:k};yield vs("message_delta",{type:"message_delta",context_management:null,delta:{stop_reason:"refusal",stop_sequence:null,container:null,stop_details:j},usage:g??{},...v!==void 0&&{input_transformations:v}}),yield vs("message_stop",{type:"message_stop"});return}let R=yield*pte({response:T,controller:c,indexBase:u,hasNext:$,onError:s,splice:{iterations:b,model:k}});if(!R.refused)return;d=R.refused.token,h=R.refused.stopDetails,v=R.refused.inputTransformations,p=E,f=R.refused.hasPrefillClaim?fte(R.blocks):[],b.push(kj("message",k,R.refused.usage)),g=R.refused.usage,m=k,u=R.nextIndex}}async function*pte(e){let{response:t,controller:n,indexBase:r,hasNext:i,onError:o,splice:s}=e,a=new wj(r),c,l=null,u;for await(let d of Ei.rawEvents(t,n)){let p=ul(d.data);switch(p?.type){case"message_start":{if(c=p.message.model,l=p.message.usage,"input_transformations"in p.message&&(u=p.message.input_transformations),s)continue;break}case"content_block_start":{if(a.start(p),s){yield vs(p.type,p);continue}break}case"content_block_delta":{if(a.delta(p),s){yield vs(p.type,p);continue}break}case"content_block_stop":{if(a.stop(p),s){yield vs(p.type,p);continue}break}case"message_delta":{if(p.delta.stop_reason==="refusal"){let f=p.delta.stop_details?.type==="refusal"?p.delta.stop_details:null;if(f?.fallback_credit_token&&i){let m=mte(p.usage,l);return yield*a.closeOpenBlocks(),{refused:{token:f.fallback_credit_token,hasPrefillClaim:f.fallback_has_prefill_claim===!0,usage:m,stopDetails:f,inputTransformations:s?u:void 0},model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}f?.fallback_credit_token?o({kind:"chain_exhausted",message:"refusal but no fallback entries remain",event:p}):o({kind:"no_credit_token",message:"refusal stop_details has no fallback_credit_token",event:p})}if(s){let f=mte(p.usage,l);f.iterations=[...s.iterations,kj("fallback_message",s.model,f)],p.usage=f,!("input_transformations"in p)&&u!==void 0&&(p.input_transformations=u),yield vs("message_delta",p);continue}break}}yield CFe(d)}return{refused:null,model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}function yte(e){return{token:e,mode:"best_effort"}}function AFe(e,{model:t,creditToken:n,continuation:r}){let i=JSON.parse(e.body);return i.model=t,i.fallback_credit_token=yte(n),i.thinking?.type==="between_tools"&&(i.thinking={type:"disabled"}),r.length&&(i.messages=[...i.messages,{role:"assistant",content:r}]),{...e,headers:new Headers(e.headers),body:JSON.stringify(i)}}function RFe(e,t,n){let r=e.find(i=>i.index===t)?.block;if(r)switch(n.type){case"text_delta":{r.text=(r.text??"")+n.text;break}case"input_json_delta":{r._partial_json=(r._partial_json??"")+n.partial_json;break}case"citations_delta":(r.citations??(r.citations=[])).push(n.citation);break;case"thinking_delta":{r.thinking=(r.thinking??"")+n.thinking;break}case"signature_delta":{r.signature=n.signature;break}case"compaction_delta":{r.content=n.content,"encrypted_content"in n&&(r.encrypted_content=n.encrypted_content);break}default:}}function fte(e){return e.map(t=>{if(typeof t?._partial_json!="string")return t;let{_partial_json:n,...r}=t;return{...r,input:ul(n)??r.input}})}function PFe(e,t){let n=new Headers(e.headers),r=new Set(n.get("anthropic-beta")?.split(",").map(i=>i.trim()));for(let i of t)r.has(i)||(r.add(i),n.set("anthropic-beta",[...r].join(",")));return n.set(Oo,vL(n.get(Oo),"fallback-refusal-middleware")),{...e,headers:n}}function vs(e,t){let n={event:e,data:JSON.stringify(t),raw:[]};return gte.encode(bte(n))}function CFe(e){return gte.encode(e.raw.length?e.raw.join(` `)+` -`:p7(e))}function AF(e,t,n){return{type:e,model:t,input_tokens:n?.input_tokens??0,output_tokens:n?.output_tokens??0,cache_read_input_tokens:n?.cache_read_input_tokens??0,cache_creation_input_tokens:n?.cache_creation_input_tokens??0,cache_creation:n?.cache_creation??null}}function c7(e,t){let n={...t??{},...e??{}};for(let i of Object.keys(n))n[i]==null&&t?.[i]!=null&&(n[i]=t[i]);return n}function p7(e){let t="";e.event!==null&&(t+=`event: ${e.event} +`:bte(e))}function kj(e,t,n){return{type:e,model:t,input_tokens:n?.input_tokens??0,output_tokens:n?.output_tokens??0,cache_read_input_tokens:n?.cache_read_input_tokens??0,cache_creation_input_tokens:n?.cache_creation_input_tokens??0,cache_creation:n?.cache_creation??null}}function mte(e,t){let n={...t??{},...e??{}};for(let r of Object.keys(n))n[r]==null&&t?.[r]!=null&&(n[r]=t[r]);return n}function bte(e){let t="";e.event!==null&&(t+=`event: ${e.event} `);for(let n of e.data.split(` `))t+=`data: ${n} `;return t+` -`}function DOe(e,t){return()=>e.abort(t.reason)}var l7,EOe,IF,f7=j(()=>{kt();Lh();Da();Ne();eo();hr();WO();l7=new TextEncoder,EOe=["fallback-credit-2026-07-01"];IF=class{constructor(t=0){this.indexBase=t,this.blocks=[],this.open=[],this.nextIndex=t}contentBlocks(){return this.blocks.map(t=>t.block)}start(t){this.blocks.push({index:t.index,block:{...t.content_block}}),t.index+=this.indexBase,this.open.push(t.index),this.nextIndex=Math.max(this.nextIndex,t.index+1)}delta(t){NOe(this.blocks,t.index,t.delta),t.index+=this.indexBase}stop(t){t.index+=this.indexBase;let n=this.open.indexOf(t.index);n!==-1&&this.open.splice(n,1),this.nextIndex=Math.max(this.nextIndex,t.index+1)}*closeOpenBlocks(){for(let t of this.open)yield $s("content_block_stop",{type:"content_block_stop",index:t});this.open.length=0}}});var m7={};_r(m7,{AI_PROMPT:()=>xF,APIConnectionError:()=>Zi,APIConnectionTimeoutError:()=>fl,APIError:()=>Dt,APIPromise:()=>La,APIUserAbortError:()=>In,Anthropic:()=>no,AnthropicError:()=>J,AuthenticationError:()=>gl,BadRequestError:()=>ml,BaseAnthropic:()=>Ot,BetaFallbackState:()=>Ch,ConflictError:()=>bl,HUMAN_PROMPT:()=>SF,InternalServerError:()=>kl,NotFoundError:()=>yl,PagePromise:()=>fp,PermissionDeniedError:()=>hl,RateLimitError:()=>wl,RetryableError:()=>ap,UnprocessableEntityError:()=>vl,betaRefusalFallbackMiddleware:()=>u7,default:()=>no,toFile:()=>Gh});var VM=j(()=>{EF();kM();N_();f7();EF();De();kt()});var OU=require("node:fs/promises"),MU=require("node:fs/promises");var C2=gt(gc(),1);var U={};_r(U,{$brand:()=>nI,$input:()=>SA,$output:()=>_A,INVALID:()=>sr,NEVER:()=>tI,TimePrecision:()=>OA,ZodAny:()=>_N,ZodArray:()=>TN,ZodBase64:()=>Yw,ZodBase64URL:()=>Qw,ZodBigInt:()=>ud,ZodBigIntFormat:()=>tk,ZodBoolean:()=>ld,ZodCIDRv4:()=>Jw,ZodCIDRv6:()=>Zw,ZodCUID:()=>Gw,ZodCUID2:()=>Vw,ZodCatch:()=>KN,ZodCodec:()=>pg,ZodCompileAsyncError:()=>Ui,ZodCompileUnsupportedError:()=>Ve,ZodCreditCard:()=>gN,ZodCustom:()=>fg,ZodCustomStringFormat:()=>ad,ZodDate:()=>sg,ZodDefault:()=>GN,ZodDiscriminatedUnion:()=>AN,ZodE164:()=>Xw,ZodEmail:()=>Fw,ZodEmoji:()=>jw,ZodEnum:()=>od,ZodError:()=>Cfe,ZodExactOptional:()=>ok,ZodFile:()=>FN,ZodFirstPartyTypeKind:()=>uC,ZodFunction:()=>iC,ZodGUID:()=>Uw,ZodIBAN:()=>hN,ZodIPv4:()=>Hw,ZodIPv6:()=>Kw,ZodISODate:()=>Ks,ZodISODateTime:()=>Hs,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,ZodInstanceOf:()=>lC,ZodIntersection:()=>RN,ZodIssueCode:()=>Ofe,ZodJWT:()=>ek,ZodKSUID:()=>Ww,ZodLazy:()=>tC,ZodLiteral:()=>LN,ZodMAC:()=>mN,ZodMap:()=>ON,ZodNaN:()=>ZN,ZodNanoID:()=>zw,ZodNever:()=>xN,ZodNonOptional:()=>sk,ZodNull:()=>kN,ZodNullable:()=>zN,ZodNumber:()=>cd,ZodNumberFormat:()=>Nc,ZodObject:()=>cg,ZodOptional:()=>ug,ZodPipe:()=>dg,ZodPrefault:()=>BN,ZodPreprocess:()=>YN,ZodPromise:()=>rC,ZodProperties:()=>oC,ZodReadonly:()=>QN,ZodRealError:()=>Ar,ZodRecord:()=>id,ZodSet:()=>MN,ZodString:()=>sd,ZodStringFormat:()=>mt,ZodSuccess:()=>HN,ZodSymbol:()=>vN,ZodTemplateLiteral:()=>eC,ZodTransform:()=>UN,ZodTuple:()=>CN,ZodType:()=>Le,ZodULID:()=>Bw,ZodURL:()=>og,ZodUUID:()=>go,ZodUndefined:()=>wN,ZodUnion:()=>lg,ZodUnknown:()=>SN,ZodVoid:()=>EN,ZodXID:()=>qw,ZodXor:()=>IN,_ZodString:()=>Lw,_default:()=>VN,_function:()=>u2,any:()=>zq,array:()=>ag,base64:()=>$q,base64url:()=>_q,bigint:()=>Mq,boolean:()=>bN,catch:()=>JN,check:()=>d2,cidrv4:()=>wq,cidrv6:()=>kq,clone:()=>ot,codec:()=>s2,coerce:()=>pC,compile:()=>IA,config:()=>zt,core:()=>Zo,creditCard:()=>xq,cuid:()=>pq,cuid2:()=>fq,custom:()=>p2,date:()=>Vq,decode:()=>aN,decodeAsync:()=>lN,deepPartial:()=>x2,describe:()=>f2,discriminatedUnion:()=>Jq,e164:()=>Sq,email:()=>nq,emoji:()=>uq,encode:()=>sN,encodeAsync:()=>cN,endsWith:()=>Wu,enum:()=>rk,exactOptional:()=>jN,file:()=>n2,flattenError:()=>Cm,float32:()=>Cq,float64:()=>Pq,formatError:()=>Pm,fromJSONSchema:()=>_2,function:()=>u2,getDiscriminatedOption:()=>Z0,getErrorMap:()=>Lfe,globalRegistry:()=>Dn,gt:()=>fo,gte:()=>Vr,guid:()=>rq,hash:()=>Nq,hex:()=>Rq,hostname:()=>Aq,httpUrl:()=>lq,iban:()=>Eq,includes:()=>Bu,input:()=>T2,instanceof:()=>g2,int:()=>Ow,int32:()=>Dq,int64:()=>Lq,intersection:()=>NN,invertCodec:()=>a2,ipv4:()=>yq,ipv6:()=>vq,iso:()=>mg,json:()=>y2,jwt:()=>Tq,keyof:()=>Bq,ksuid:()=>hq,lazy:()=>nC,length:()=>Ic,literal:()=>t2,locales:()=>Zm,looseObject:()=>Hq,looseRecord:()=>Yq,lowercase:()=>Gu,lt:()=>po,lte:()=>Gr,mac:()=>bq,map:()=>Qq,maxLength:()=>Tc,maxSize:()=>Gs,memoizer:()=>Km,meta:()=>m2,mime:()=>Hu,minLength:()=>Jo,minSize:()=>mo,multipleOf:()=>zs,nan:()=>o2,nanoid:()=>dq,nativeEnum:()=>e2,negative:()=>Sw,never:()=>nk,nonnegative:()=>Ew,nonoptional:()=>WN,nonpositive:()=>xw,normalize:()=>Ku,null:()=>$N,nullable:()=>ig,nullish:()=>r2,number:()=>yN,object:()=>qq,optional:()=>Rc,output:()=>I2,overwrite:()=>ji,parse:()=>nN,parseAsync:()=>rN,partialRecord:()=>Zq,pipe:()=>Mw,positive:()=>_w,prefault:()=>qN,preprocess:()=>b2,prettifyError:()=>aI,promise:()=>l2,properties:()=>sC,property:()=>Tw,readonly:()=>XN,record:()=>DN,refine:()=>aC,regex:()=>zu,regexes:()=>or,registry:()=>Xv,safeDecode:()=>dN,safeDecodeAsync:()=>fN,safeEncode:()=>uN,safeEncodeAsync:()=>pN,safeParse:()=>iN,safeParseAsync:()=>oN,set:()=>Xq,setErrorMap:()=>Mfe,size:()=>Ec,slugify:()=>Qu,startsWith:()=>qu,strictObject:()=>Wq,string:()=>rg,stringFormat:()=>Iq,stringbool:()=>h2,success:()=>i2,superRefine:()=>cC,symbol:()=>Uq,templateLiteral:()=>c2,toJSONSchema:()=>Nw,toLowerCase:()=>Zu,toUpperCase:()=>Yu,toZod:()=>Sm,transform:()=>ik,treeifyError:()=>sI,trim:()=>Ju,tuple:()=>PN,uint32:()=>Oq,uint64:()=>Fq,ulid:()=>mq,undefined:()=>jq,union:()=>dd,unknown:()=>Ac,uppercase:()=>Vu,url:()=>cq,util:()=>G,uuid:()=>iq,uuidv4:()=>oq,uuidv6:()=>sq,uuidv7:()=>aq,validate:()=>Dm,validateAsync:()=>Om,void:()=>Gq,withParser:()=>ew,xid:()=>gq,xor:()=>Kq});var Zo={};_r(Zo,{$ZodAny:()=>G0,$ZodArray:()=>H0,$ZodAsyncError:()=>Tr,$ZodBase64:()=>R0,$ZodBase64URL:()=>N0,$ZodBigInt:()=>Uv,$ZodBigIntFormat:()=>F0,$ZodBoolean:()=>Gm,$ZodCIDRv4:()=>I0,$ZodCIDRv6:()=>A0,$ZodCUID:()=>h0,$ZodCUID2:()=>y0,$ZodCatch:()=>pA,$ZodCheck:()=>ht,$ZodCheckBigIntFormat:()=>BI,$ZodCheckEndsWith:()=>n0,$ZodCheckGreaterThan:()=>$v,$ZodCheckIncludes:()=>e0,$ZodCheckLengthEquals:()=>ZI,$ZodCheckLessThan:()=>kv,$ZodCheckLowerCase:()=>QI,$ZodCheckMaxLength:()=>KI,$ZodCheckMaxSize:()=>qI,$ZodCheckMimeType:()=>i0,$ZodCheckMinLength:()=>JI,$ZodCheckMinSize:()=>WI,$ZodCheckMultipleOf:()=>GI,$ZodCheckNumberFormat:()=>VI,$ZodCheckOverwrite:()=>o0,$ZodCheckProperty:()=>r0,$ZodCheckRegex:()=>YI,$ZodCheckSizeEquals:()=>HI,$ZodCheckStartsWith:()=>t0,$ZodCheckStringFormat:()=>Mu,$ZodCheckUpperCase:()=>XI,$ZodCodec:()=>Bm,$ZodCreditCard:()=>P0,$ZodCustom:()=>vA,$ZodCustomStringFormat:()=>M0,$ZodCyclicError:()=>Wv,$ZodDate:()=>W0,$ZodDefault:()=>cA,$ZodDiscriminatedUnion:()=>Y0,$ZodE164:()=>C0,$ZodEmail:()=>u0,$ZodEmoji:()=>m0,$ZodEncodeError:()=>js,$ZodEnum:()=>nA,$ZodError:()=>oI,$ZodExactOptional:()=>sA,$ZodFile:()=>iA,$ZodFunction:()=>yA,$ZodGUID:()=>c0,$ZodIBAN:()=>D0,$ZodIPv4:()=>x0,$ZodIPv6:()=>E0,$ZodISODate:()=>$0,$ZodISODateTime:()=>k0,$ZodISODuration:()=>S0,$ZodISOTime:()=>_0,$ZodIntersection:()=>Q0,$ZodJWT:()=>O0,$ZodKSUID:()=>w0,$ZodLazy:()=>qm,$ZodLiteral:()=>rA,$ZodMAC:()=>T0,$ZodMap:()=>eA,$ZodNaN:()=>fA,$ZodNanoID:()=>g0,$ZodNever:()=>B0,$ZodNonOptional:()=>uA,$ZodNull:()=>z0,$ZodNullable:()=>aA,$ZodNumber:()=>Fv,$ZodNumberFormat:()=>L0,$ZodObject:()=>dV,$ZodObjectJIT:()=>K0,$ZodOptional:()=>zv,$ZodPipe:()=>Gv,$ZodPrefault:()=>lA,$ZodPreprocess:()=>mA,$ZodPromise:()=>bA,$ZodProperties:()=>wA,$ZodReadonly:()=>gA,$ZodRealError:()=>Ir,$ZodRecord:()=>X0,$ZodRegistry:()=>Qv,$ZodSet:()=>tA,$ZodString:()=>kc,$ZodStringFormat:()=>ut,$ZodSuccess:()=>dA,$ZodSymbol:()=>U0,$ZodTemplateLiteral:()=>hA,$ZodTransform:()=>oA,$ZodTuple:()=>jv,$ZodType:()=>Ce,$ZodULID:()=>b0,$ZodURL:()=>f0,$ZodUUID:()=>l0,$ZodUndefined:()=>j0,$ZodUnion:()=>Vm,$ZodUnknown:()=>V0,$ZodVoid:()=>q0,$ZodXID:()=>v0,$ZodXor:()=>J0,$brand:()=>nI,$constructor:()=>R,$input:()=>SA,$output:()=>_A,Doc:()=>wc,INVALID:()=>sr,JSONSchema:()=>XB,JSONSchemaGenerator:()=>Cw,NEVER:()=>tI,TimePrecision:()=>OA,URL_BAD_FORMAT:()=>d0,URL_UNPARSEABLE:()=>p0,ZodCompileAsyncError:()=>Ui,ZodCompileUnsupportedError:()=>Ve,_any:()=>QA,_array:()=>sR,_base64:()=>vw,_base64url:()=>ww,_bigint:()=>qA,_boolean:()=>VA,_catch:()=>vfe,_check:()=>LB,_cidrv4:()=>yw,_cidrv6:()=>bw,_coercedBigint:()=>WA,_coercedBoolean:()=>BA,_coercedDate:()=>rR,_coercedNumber:()=>LA,_coercedString:()=>NA,_creditCard:()=>PA,_cuid:()=>uw,_cuid2:()=>dw,_custom:()=>cR,_date:()=>nR,_decode:()=>dv,_decodeAsync:()=>fv,_default:()=>hfe,_discriminatedUnion:()=>ife,_e164:()=>kw,_email:()=>nw,_emoji:()=>cw,_encode:()=>uv,_encodeAsync:()=>pv,_endsWith:()=>Wu,_enum:()=>ufe,_file:()=>aR,_float32:()=>UA,_float64:()=>jA,_gt:()=>fo,_gte:()=>Vr,_guid:()=>rw,_iban:()=>DA,_includes:()=>Bu,_int:()=>FA,_int32:()=>zA,_int64:()=>HA,_intersection:()=>ofe,_ipv4:()=>gw,_ipv6:()=>hw,_isoDate:()=>Xm,_isoDateTime:()=>Qm,_isoDuration:()=>tg,_isoTime:()=>eg,_jwt:()=>$w,_ksuid:()=>mw,_lazy:()=>_fe,_length:()=>Ic,_literal:()=>pfe,_lowercase:()=>Gu,_lt:()=>po,_lte:()=>Gr,_mac:()=>CA,_map:()=>cfe,_max:()=>Gr,_maxLength:()=>Tc,_maxSize:()=>Gs,_mime:()=>Hu,_min:()=>Vr,_minLength:()=>Jo,_minSize:()=>mo,_multipleOf:()=>zs,_nan:()=>iR,_nanoid:()=>lw,_nativeEnum:()=>dfe,_negative:()=>Sw,_never:()=>eR,_nonnegative:()=>Ew,_nonoptional:()=>yfe,_nonpositive:()=>xw,_normalize:()=>Ku,_null:()=>YA,_nullable:()=>gfe,_number:()=>MA,_optional:()=>mfe,_overwrite:()=>ji,_parse:()=>Cu,_parseAsync:()=>Pu,_pipe:()=>wfe,_positive:()=>_w,_promise:()=>Sfe,_properties:()=>oR,_property:()=>Tw,_readonly:()=>kfe,_record:()=>afe,_refine:()=>lR,_regex:()=>zu,_safeDecode:()=>gv,_safeDecodeAsync:()=>yv,_safeEncode:()=>mv,_safeEncodeAsync:()=>hv,_safeParse:()=>Du,_safeParseAsync:()=>Ou,_set:()=>lfe,_size:()=>Ec,_slugify:()=>Qu,_startsWith:()=>qu,_string:()=>RA,_stringFormat:()=>Xu,_stringbool:()=>fR,_success:()=>bfe,_superRefine:()=>uR,_symbol:()=>JA,_templateLiteral:()=>$fe,_toLowerCase:()=>Zu,_toUpperCase:()=>Yu,_transform:()=>ffe,_trim:()=>Ju,_tuple:()=>sfe,_uint32:()=>GA,_uint64:()=>KA,_ulid:()=>pw,_undefined:()=>ZA,_union:()=>nfe,_unknown:()=>XA,_uppercase:()=>Vu,_url:()=>Ym,_uuid:()=>iw,_uuidv4:()=>ow,_uuidv6:()=>sw,_uuidv7:()=>aw,_void:()=>tR,_xid:()=>fw,_xor:()=>rfe,base64Charset:()=>Pv,base64urlCharset:()=>zm,clone:()=>ot,compile:()=>IA,compileFn:()=>tw,config:()=>zt,createStandardJSONSchemaMethod:()=>ed,createToJSONSchemaMethod:()=>gR,decode:()=>iue,decodeAsync:()=>sue,describe:()=>dR,encode:()=>rue,encodeAsync:()=>oue,extractDefs:()=>Bs,finalize:()=>qs,flattenError:()=>Cm,formatError:()=>Pm,getDiscriminatedOption:()=>Z0,globalConfig:()=>hn,globalRegistry:()=>Dn,handleUnrepresentable:()=>Zt,initializeContext:()=>Vs,isBackEdge:()=>Kv,isRecursiveSchema:()=>Hv,isTransforming:()=>xn,isValidBase64:()=>jm,isValidBase64URL:()=>Dv,isValidCIDRv6:()=>Cv,isValidCreditCard:()=>Ov,isValidIBAN:()=>Mv,isValidIPv6:()=>Um,isValidJWT:()=>Lv,locales:()=>Zm,memoizer:()=>Km,mergeValues:()=>Lu,meta:()=>pR,parse:()=>cv,parseAsync:()=>lv,parseURLObject:()=>Iv,prettifyError:()=>aI,process:()=>st,processSchema:()=>st,regexes:()=>or,registry:()=>Xv,safeDecode:()=>cue,safeDecodeAsync:()=>uue,safeEncode:()=>aue,safeEncodeAsync:()=>lue,safeParse:()=>Qle,safeParseAsync:()=>Xle,standardProps:()=>Tv,stripTabAndNewline:()=>Av,toDotPath:()=>jG,toJSONSchema:()=>Nw,toZod:()=>Sm,treeifyError:()=>sI,urlHostnameOk:()=>Rv,urlProtocolOk:()=>Nv,util:()=>G,validate:()=>Dm,validateAsync:()=>Om,version:()=>s0,withParser:()=>ew});var G={};_r(G,{BIGINT_FORMAT_RANGES:()=>Am,CONSTANT_CATCH:()=>sv,Class:()=>BT,NUMBER_FORMAT_RANGES:()=>Im,aborted:()=>rr,allowsEval:()=>HT,assert:()=>vle,assertEqual:()=>gle,assertIs:()=>yle,assertNever:()=>ble,assertNotEqual:()=>hle,assignProp:()=>Sn,attachSchema:()=>ov,base64ToUint8Array:()=>DG,base64urlToUint8Array:()=>Fle,cached:()=>Au,captureStackTrace:()=>rv,cleanEnum:()=>Lle,cleanRegex:()=>Ho,clone:()=>ot,cloneDef:()=>$le,codePointLength:()=>bc,constantCatch:()=>XT,createTransparentProxy:()=>Ile,defineLazy:()=>qT,defineLazyInternal:()=>Ue,derived:()=>Gle,esc:()=>nr,escapeRegex:()=>li,explicitlyAborted:()=>ZT,extend:()=>Nle,finalizeIssue:()=>Er,floatSafeRemainder:()=>xm,getElementAtPath:()=>_le,getEnumValues:()=>Tu,getLengthableOrigin:()=>Nm,getParsedType:()=>Tle,getSizableOrigin:()=>Rm,hexToUint8Array:()=>jle,hide:()=>QT,installLazyProp:()=>qle,isObject:()=>yc,isPlainObject:()=>ci,issue:()=>Nu,joinValues:()=>C,jsonStringifyReplacer:()=>Iu,members:()=>YT,merge:()=>Ple,mergeDefs:()=>Fi,normalizeParams:()=>Q,nullish:()=>nv,numKeys:()=>Ele,objectClone:()=>wle,omit:()=>Rle,optionalKeys:()=>JT,own:()=>Us,parsedType:()=>H,partial:()=>Dle,pick:()=>Ale,prefixIssues:()=>ir,primitiveTypes:()=>KT,promiseAllObject:()=>Sle,propertyKeyTypes:()=>Tm,randomString:()=>xle,rawShape:()=>Ru,required:()=>Ole,safeExtend:()=>Cle,shallowClone:()=>Em,slugify:()=>WT,stringifyPrimitive:()=>V,toZod:()=>Sm,uint8ArrayToBase64:()=>OG,uint8ArrayToBase64url:()=>Ule,uint8ArrayToHex:()=>zle,unwrapMessage:()=>Eu});function gle(e){return e}function hle(e){return e}function Sm(){return e=>e}function yle(e){}function ble(e){throw new Error("Unexpected value in exhaustive check")}function vle(e){}function Tu(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function C(e,t="|"){return e.map(n=>V(n)).join(t)}function Iu(e,t){return typeof t=="bigint"?t.toString():t}var VT=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Au(e){return new VT(e)}function nv(e){return e==null}function Ho(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function xm(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i){let a=t._zod.def.shape[o];return i?i(a,o):a}):CG(e,o,i?i(s.value,o):s.value))}}function kle(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?NG(e,n,()=>t[n]):CG(e,n,i.value))}}function Fi(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function $le(e){return Fi(e._zod.def)}function _le(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function Sle(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o{};function yc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var HT=Au(()=>{if(hn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ci(e){if(yc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(yc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Em(e){return ci(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Ele(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Tle=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Tm=new Set(["string","number","symbol"]),KT=new Set(["string","number","bigint","boolean","symbol","undefined"]);function li(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ot(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ile(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function V(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function JT(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Im={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Am={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ale(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return hc(o,e,iv(e,t)),ot(e,Fi(n,{shape:o,checks:[]}))}function iv(e,t){let n=Wo(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function Rle(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(iv(e,t)),s={};return hc(s,e,Reflect.ownKeys(Wo(e)).filter(a=>!o.has(a))),ot(e,Fi(n,{shape:s,checks:[]}))}function Nle(e,t){if(!ci(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=Wo(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ot(e,Fi(e._zod.def,{shape:PG(e,t)}))}function PG(e,t){let n={};return hc(n,e,Reflect.ownKeys(Wo(e))),kle(n,t),n}function Cle(e,t){if(!ci(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ot(e,Fi(e._zod.def,{shape:PG(e,t)}))}function Ple(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};hc(n,e,Reflect.ownKeys(Wo(e))),hc(n,t,Reflect.ownKeys(Wo(t)));let i=Fi(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ot(e,i)}function Dle(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let a=n?new Set(iv(t,n)):void 0,c={};return hc(c,t,Reflect.ownKeys(Wo(t)),e&&((l,u)=>a&&!a.has(u)?l:new e({type:"optional",innerType:l}))),ot(t,Fi(t._zod.def,{shape:c,checks:[]}))}function Ole(e,t,n){let i=n?new Set(iv(t,n)):void 0,r={};return hc(r,t,Reflect.ownKeys(Wo(t)),(o,s)=>i&&!i.has(s)?o:new e({type:"nonoptional",innerType:o})),ot(t,Fi(t._zod.def,{shape:r}))}function rr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Eu(e){return typeof e=="string"?e:e?.message}function ov(e,t,n){var i;for(let r=t;rNumber.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function DG(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;it.toString(16).padStart(2,"0")).join("")}var BT=class{constructor(...t){}};function YT(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):RG(e,n,i.value)}for(let n of Object.getOwnPropertySymbols(t))RG(e,n,t[n])}function Us(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function QT(e,t,n){return Us(e,t,n,!1)}function Gle(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Us(this,n,i(this))},set(r){Us(this,n,r)}})}return t}function RG(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Us(this,t,n.bind(this))},set(i){Us(this,t,i)}})}function Vle(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var GT,Fs=!1,Ble={configurable:!0,get(){Fs=!0}};function Ue(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&>!==e._zod){GT=void 0;return}GT=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,Ble);let r=Fs;Fs=!1;try{let o=n(this);return Fs?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),Fs=Fs||r,o}catch(o){throw delete this[t],Fs=Fs||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function qle(e,t,n,i){let r=Vle(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var sv="~constantCatch";function XT(e){let t=()=>e;return t[sv]=!0,t}var MG,tI=Object.freeze({status:"aborted"}),eI={value:void 0,enumerable:!1},LG="captureStackTrace"in Error?Error:null;function Wle(e){let t=LG;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return LG=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function R(e,t,n,i){let r={};function o(p){this.def=p,this.constr=d,this.traits=new Set}o.prototype=r;let s=n,a=s&&new WeakSet;function c(p,f){if(!p._zod){eI.value=new o(f);try{Object.defineProperty(p,"_zod",eI)}finally{eI.value=void 0}}if(p._zod.traits.has(e))return;if(p._zod.traits.add(e),t(p,f),a){let g=Object.getPrototypeOf(p),h=p._zod.constr.prototype,b=g;for(;b&&b!==h;)b=Object.getPrototypeOf(b);let y=b??g;a.has(y)||(a.add(y),YT(y,s))}let m=d.prototype;for(let g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in p||(p[g]=m[g].bind(p)))}let l=i?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(p){let f=i?.Parent?Wle(u):this;c(f,p);let m=f._zod.deferred;if(m){for(let h of m)h();f._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(f),f}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>i?.Parent&&p instanceof i.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var nI=Symbol("zod_brand"),Tr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},js=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(MG=globalThis).__zod_globalConfig??(MG.__zod_globalConfig={});var hn=globalThis.__zod_globalConfig;function zt(e){return e&&Object.assign(hn,e),hn}function Hle(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Iu,2)),e.message}function Kle(e){this._zod.message=e}var Jle={get:Hle,set:Kle,enumerable:!0,configurable:!0},iI={value:void 0,enumerable:!1},FG=new WeakSet([Object.prototype,Error.prototype]),UG=(e,t)=>{e.name="$ZodError",iI.value=t,Object.defineProperty(e,"issues",iI),iI.value=void 0,Object.defineProperty(e,"message",Jle);let n=Object.getPrototypeOf(e);FG.has(n)||(FG.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},oI=R("$ZodError",UG),Ir=R("$ZodError",UG,void 0,{Parent:Error});function Zle(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Cm(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?Zle(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Pm(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,l=0;for(;ln.message){let n={errors:[]},i=(r,o=[])=>{var s;for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0){n.errors.push(t(a));continue}let l=n,u=0;for(;utypeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function aI(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${jG(i.path)}`);return t.join(` -`)}function av(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Cu=e=>{let t=(n,i,r,o)=>{let s=r?{...r,async:!1}:{async:!1},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise)throw new Tr;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>Er(l,s,zt())));throw rv(c,o?.callee??t),c}return a.value};return t},cv=Cu(Ir),Pu=e=>{let t=async(n,i,r,o)=>{let s=r?{...r,async:!0}:{async:!0},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>Er(l,s,zt())));throw rv(c,o?.callee??t),c}return a.value};return t},lv=Pu(Ir),Du=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new Tr;return o.issues.length?zG(e,o.issues,r):{success:!0,data:o.value}},Qle=Du(Ir);function zG(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>Er(r,n,zt()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}var Ou=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?zG(e,o.issues,r):{success:!0,data:o.value}},Xle=Ou(Ir),eue=Symbol.for("zod.compile.invalid"),tue=Symbol.for("zod.compile.fallback"),Dm=((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==eue)return!0;if(i.definite===!0&&n===void 0)return!1}return nue(e,t,n)});function nue(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,o;if(r?(i[tue]=!0,o=r({value:t,issues:[]},i)):o=e._zod.run({value:t,issues:[]},i),o instanceof Promise)throw new Tr;return o.issues.length===0}var Om=async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},uv=e=>{let t=Cu(e),n=(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return t(i,r,a,av(n,s))};return n},rue=uv(Ir),dv=e=>{let t=Cu(e),n=(i,r,o,s)=>t(i,r,o,av(n,s));return n},iue=dv(Ir),pv=e=>{let t=Pu(e),n=async(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await t(i,r,a,av(n,s))};return n},oue=pv(Ir),fv=e=>{let t=Pu(e),n=async(i,r,o,s)=>await t(i,r,o,av(n,s));return n},sue=fv(Ir),mv=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Du(e)(t,n,r)},aue=mv(Ir),gv=e=>(t,n,i)=>Du(e)(t,n,i),cue=gv(Ir),hv=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Ou(e)(t,n,r)},lue=hv(Ir),yv=e=>async(t,n,i)=>Ou(e)(t,n,i),uue=yv(Ir);var or={};_r(or,{anyString:()=>CI,base64:()=>xI,base64url:()=>EI,bigint:()=>DI,boolean:()=>OI,browserEmail:()=>bue,cidrv4:()=>_I,cidrv6:()=>SI,creditCard:()=>bv,cuid:()=>lI,cuid2:()=>uI,date:()=>AI,datetime:()=>NI,domain:()=>kue,duration:()=>hI,e164:()=>II,email:()=>bI,emoji:()=>vI,extendedDuration:()=>due,guid:()=>yI,hex:()=>_ue,hostname:()=>wue,html5Email:()=>gue,httpProtocol:()=>TI,iban:()=>vv,idnEmail:()=>yue,integer:()=>Mm,ipv4:()=>wI,ipv6:()=>kI,ksuid:()=>fI,lowercase:()=>FI,mac:()=>$I,md5_base64:()=>xue,md5_base64url:()=>Eue,md5_hex:()=>Sue,nanoid:()=>mI,nanoidOfLength:()=>gI,null:()=>MI,number:()=>Ko,rfc5322Email:()=>hue,sha1_base64:()=>Iue,sha1_base64url:()=>Aue,sha1_hex:()=>Tue,sha256_base64:()=>Nue,sha256_base64url:()=>Cue,sha256_hex:()=>Rue,sha384_base64:()=>Due,sha384_base64url:()=>Oue,sha384_hex:()=>Pue,sha512_base64:()=>Lue,sha512_base64url:()=>Fue,sha512_hex:()=>Mue,string:()=>PI,time:()=>RI,ulid:()=>dI,undefined:()=>LI,unicodeEmail:()=>GG,uppercase:()=>UI,uuid:()=>vc,uuid4:()=>pue,uuid6:()=>fue,uuid7:()=>mue,xid:()=>pI});var lI=/^[cC][0-9a-z]{6,}$/,uI=/^[0-9a-z]+$/,dI=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,pI=/^[0-9a-vA-V]{20}$/,fI=/^[A-Za-z0-9]{27}$/,mI=/^[a-zA-Z0-9_-]{21}$/;function gI(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var hI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,due=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,yI=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,pue=vc(4),fue=vc(6),mue=vc(7),bI=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,gue=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[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])?)*$/,hue=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,GG=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,yue=GG,bue=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[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])?)*$/,vue="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function vI(){return new RegExp(vue,"u")}var wI=/^(?:(?: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])$/,kI=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,$I=e=>{let t=li(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},_I=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,SI=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,EI=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,wue=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,kue=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,TI=/^https?$/,II=/^\+[1-9]\d{6,14}$/,bv=/^\d(?:[ -]?\d){11,18}$/,vv=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,VG="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function $ue(e){return new RegExp(`^${e}$`)}var AI=$ue(VG);function cI(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function RI(e){return new RegExp(`^${cI(e)}$`)}function NI(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${cI({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${cI({precision:e.precision})}`:n;return new RegExp(`^${VG}T(?:${i})$`)}var CI=/^[\s\S]{0,}$/,PI=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},DI=/^-?\d+n?$/,Mm=/^-?\d+$/,Ko=/^-?\d+(?:\.\d+)?$/,OI=/^(?:true|false)$/i,MI=/^null$/i;var LI=/^undefined$/i;var FI=/^[^A-Z]*$/,UI=/^[^a-z]*$/,_ue=/^[0-9a-fA-F]*$/;function Lm(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Fm(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Sue=/^[0-9a-fA-F]{32}$/,xue=Lm(22,"=="),Eue=Fm(22),Tue=/^[0-9a-fA-F]{40}$/,Iue=Lm(27,"="),Aue=Fm(27),Rue=/^[0-9a-fA-F]{64}$/,Nue=Lm(43,"="),Cue=Fm(43),Pue=/^[0-9a-fA-F]{96}$/,Due=Lm(64,""),Oue=Fm(64),Mue=/^[0-9a-fA-F]{128}$/,Lue=Lm(86,"=="),Fue=Fm(86);var ht=R("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),jI=e=>{let t=e.value;return!nv(t)&&t.size!==void 0},zI=e=>{let t=e.value;return!nv(t)&&t.length!==void 0},wv={number:"number",bigint:"bigint",object:"date"},kv=R("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);let n=wv[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value{ht.init(e,t);let n=wv[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:wv[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),GI=R("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):xm(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),VI=R("$ZodCheckNumberFormat",(e,t)=>{ht.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Im[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ao&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),BI=R("$ZodCheckBigIntFormat",(e,t)=>{ht.init(e,t);let[n,i]=Am[t.format];e._zod.check=r=>{let o=r.value;oi&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),qI=R("$ZodCheckMaxSize",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=jI),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Rm(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),WI=R("$ZodCheckMinSize",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=jI),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Rm(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),HI=R("$ZodCheckSizeEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=jI),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let s=o>t.size;i.issues.push({origin:Rm(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),KI=R("$ZodCheckMaxLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=zI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>t.maximum?bc(r):o)<=t.maximum)return;let a=Nm(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),JI=R("$ZodCheckMinLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=zI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=t.minimum&&o=t.minimum)return;let a=Nm(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ZI=R("$ZodCheckLengthEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=zI),e._zod.check=i=>{let r=i.value,o=r.length,s=typeof r=="string"&&o>=t.length&&o<=t.length*2?bc(r):o;if(s===t.length)return;let a=Nm(r),c=s>t.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Mu=R("$ZodCheckStringFormat",(e,t)=>{var n,i;ht.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),YI=R("$ZodCheckRegex",(e,t)=>{Mu.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),QI=R("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=FI),Mu.init(e,t)}),XI=R("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=UI),Mu.init(e,t)}),e0=R("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);let n=li(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),t0=R("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);let n=new RegExp(`^${li(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),n0=R("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);let n=new RegExp(`.*${li(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function BG(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues))}var r0=R("$ZodCheckProperty",(e,t)=>{ht.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>BG(r,n,t.property));BG(i,n,t.property)}}),i0=R("$ZodCheckMimeType",(e,t)=>{ht.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),o0=R("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var wc=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(` -`).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { +`}function NFe(e,t){return()=>e.abort(t.reason)}var gte,xFe,wj,vte=O(()=>{_t();ey();Pa();Ee();Ii();$i();BM();gte=new TextEncoder,xFe=["fallback-credit-2026-07-01"];wj=class{constructor(t=0){this.indexBase=t,this.blocks=[],this.open=[],this.nextIndex=t}contentBlocks(){return this.blocks.map(t=>t.block)}start(t){this.blocks.push({index:t.index,block:{...t.content_block}}),t.index+=this.indexBase,this.open.push(t.index),this.nextIndex=Math.max(this.nextIndex,t.index+1)}delta(t){RFe(this.blocks,t.index,t.delta),t.index+=this.indexBase}stop(t){t.index+=this.indexBase;let n=this.open.indexOf(t.index);n!==-1&&this.open.splice(n,1),this.nextIndex=Math.max(this.nextIndex,t.index+1)}*closeOpenBlocks(){for(let t of this.open)yield vs("content_block_stop",{type:"content_block_stop",index:t});this.open.length=0}}});var wte={};kr(wte,{AI_PROMPT:()=>hj,APIConnectionError:()=>Qi,APIConnectionTimeoutError:()=>tl,APIError:()=>Mt,APIPromise:()=>Qd,APIUserAbortError:()=>Tn,Anthropic:()=>bj,AnthropicError:()=>Y,AuthenticationError:()=>rl,BadRequestError:()=>nl,BaseAnthropic:()=>yj,BetaFallbackState:()=>Jh,ConflictError:()=>sl,HUMAN_PROMPT:()=>gj,InternalServerError:()=>ll,NotFoundError:()=>ol,PagePromise:()=>tS,PermissionDeniedError:()=>il,RateLimitError:()=>cl,RetryableError:()=>Bd,UnprocessableEntityError:()=>al,betaRefusalFallbackMiddleware:()=>hte,default:()=>bj,toFile:()=>iy});var kte=O(()=>{Ux();bL();Q$();Ux();ie();_t();Ux();vte()});var Tz=require("node:fs/promises"),Iz=require("node:fs/promises");var S6=gt(rc(),1);var z={};kr(z,{$brand:()=>XI,$input:()=>kR,$output:()=>wR,INVALID:()=>ar,NEVER:()=>QI,TimePrecision:()=>CR,ZodAny:()=>wC,ZodArray:()=>SC,ZodBase64:()=>bk,ZodBase64URL:()=>vk,ZodBigInt:()=>Wu,ZodBigIntFormat:()=>_k,ZodBoolean:()=>qu,ZodCIDRv4:()=>hk,ZodCIDRv6:()=>yk,ZodCUID:()=>lk,ZodCUID2:()=>uk,ZodCatch:()=>qC,ZodCodec:()=>Ag,ZodCompileAsyncError:()=>zi,ZodCompileUnsupportedError:()=>Ve,ZodCreditCard:()=>pC,ZodCustom:()=>Rg,ZodCustomStringFormat:()=>Bu,ZodDate:()=>$g,ZodDefault:()=>jC,ZodDiscriminatedUnion:()=>EC,ZodE164:()=>wk,ZodEmail:()=>ok,ZodEmoji:()=>ak,ZodEnum:()=>zu,ZodError:()=>jge,ZodExactOptional:()=>Ek,ZodFile:()=>OC,ZodFirstPartyTypeKind:()=>aN,ZodFunction:()=>tN,ZodGUID:()=>sk,ZodIBAN:()=>fC,ZodIPv4:()=>mk,ZodIPv6:()=>gk,ZodISODate:()=>qs,ZodISODateTime:()=>Vs,ZodISODuration:()=>Hs,ZodISOTime:()=>Ws,ZodInstanceOf:()=>sN,ZodIntersection:()=>TC,ZodIssueCode:()=>Gge,ZodJWT:()=>kk,ZodKSUID:()=>fk,ZodLazy:()=>QC,ZodLiteral:()=>DC,ZodMAC:()=>dC,ZodMap:()=>CC,ZodNaN:()=>HC,ZodNanoID:()=>ck,ZodNever:()=>_C,ZodNonOptional:()=>Tk,ZodNull:()=>bC,ZodNullable:()=>FC,ZodNumber:()=>Vu,ZodNumberFormat:()=>vc,ZodObject:()=>xg,ZodOptional:()=>Tg,ZodPipe:()=>Ig,ZodPrefault:()=>zC,ZodPreprocess:()=>KC,ZodPromise:()=>eN,ZodProperties:()=>nN,ZodReadonly:()=>JC,ZodRealError:()=>Tr,ZodRecord:()=>Uu,ZodSet:()=>NC,ZodString:()=>Gu,ZodStringFormat:()=>mt,ZodSuccess:()=>VC,ZodSymbol:()=>hC,ZodTemplateLiteral:()=>YC,ZodTransform:()=>MC,ZodTuple:()=>AC,ZodType:()=>Le,ZodULID:()=>dk,ZodURL:()=>_g,ZodUUID:()=>mo,ZodUndefined:()=>yC,ZodUnion:()=>Eg,ZodUnknown:()=>kC,ZodVoid:()=>$C,ZodXID:()=>pk,ZodXor:()=>xC,_ZodString:()=>ik,_default:()=>UC,_function:()=>n6,any:()=>N4,array:()=>Sg,base64:()=>m4,base64url:()=>g4,bigint:()=>I4,boolean:()=>gC,catch:()=>WC,check:()=>r6,cidrv4:()=>p4,cidrv6:()=>f4,clone:()=>it,codec:()=>Q4,coerce:()=>lN,compile:()=>xR,config:()=>Gt,core:()=>Yo,creditCard:()=>y4,cuid:()=>i4,cuid2:()=>o4,custom:()=>i6,date:()=>O4,decode:()=>iC,decodeAsync:()=>sC,deepPartial:()=>y6,describe:()=>o6,discriminatedUnion:()=>z4,e164:()=>h4,email:()=>K2,emoji:()=>n4,encode:()=>rC,encodeAsync:()=>oC,endsWith:()=>Iu,enum:()=>Sk,exactOptional:()=>LC,file:()=>K4,flattenError:()=>Jm,float32:()=>S4,float64:()=>x4,formatError:()=>Zm,fromJSONSchema:()=>g6,function:()=>n6,getDiscriminatedOption:()=>H0,getErrorMap:()=>Vge,globalRegistry:()=>Nn,gt:()=>po,gte:()=>zr,guid:()=>J2,hash:()=>$4,hex:()=>_4,hostname:()=>k4,httpUrl:()=>t4,iban:()=>b4,includes:()=>Eu,input:()=>v6,instanceof:()=>a6,int:()=>nk,int32:()=>E4,int64:()=>A4,intersection:()=>IC,invertCodec:()=>X4,ipv4:()=>l4,ipv6:()=>d4,iso:()=>Pg,json:()=>l6,jwt:()=>v4,keyof:()=>M4,ksuid:()=>c4,lazy:()=>XC,length:()=>hc,literal:()=>H4,locales:()=>fg,looseObject:()=>j4,looseRecord:()=>B4,lowercase:()=>Su,lt:()=>uo,lte:()=>Ur,mac:()=>u4,map:()=>V4,maxLength:()=>gc,maxSize:()=>js,memoizer:()=>dg,meta:()=>s6,mime:()=>Au,minLength:()=>Zo,minSize:()=>fo,multipleOf:()=>Fs,nan:()=>Y4,nanoid:()=>r4,nativeEnum:()=>W4,negative:()=>qw,never:()=>$k,nonnegative:()=>Hw,nonoptional:()=>BC,nonpositive:()=>Ww,normalize:()=>Ru,null:()=>vC,nullable:()=>kg,nullish:()=>J4,number:()=>mC,object:()=>L4,optional:()=>bc,output:()=>w6,overwrite:()=>Gi,parse:()=>XP,parseAsync:()=>eC,partialRecord:()=>G4,pipe:()=>rk,positive:()=>Vw,prefault:()=>GC,preprocess:()=>u6,prettifyError:()=>iA,promise:()=>t6,properties:()=>rN,property:()=>Kw,readonly:()=>ZC,record:()=>PC,refine:()=>iN,regex:()=>$u,regexes:()=>sr,registry:()=>ww,safeDecode:()=>cC,safeDecodeAsync:()=>uC,safeEncode:()=>aC,safeEncodeAsync:()=>lC,safeParse:()=>tC,safeParseAsync:()=>nC,set:()=>q4,setErrorMap:()=>Bge,size:()=>mc,slugify:()=>Du,startsWith:()=>Tu,strictObject:()=>F4,string:()=>wg,stringFormat:()=>w4,stringbool:()=>c6,success:()=>Z4,superRefine:()=>oN,symbol:()=>P4,templateLiteral:()=>e6,toJSONSchema:()=>Qw,toLowerCase:()=>Cu,toUpperCase:()=>Nu,toZod:()=>zm,transform:()=>xk,treeifyError:()=>rA,trim:()=>Pu,tuple:()=>RC,uint32:()=>T4,uint64:()=>R4,ulid:()=>s4,undefined:()=>C4,union:()=>Hu,unknown:()=>yc,uppercase:()=>xu,url:()=>e4,util:()=>V,uuid:()=>Z2,uuidv4:()=>Y2,uuidv6:()=>Q2,uuidv7:()=>X2,validate:()=>Ym,validateAsync:()=>Qm,void:()=>D4,withParser:()=>kw,xid:()=>a4,xor:()=>U4});var Yo={};kr(Yo,{$ZodAny:()=>j0,$ZodArray:()=>V0,$ZodAsyncError:()=>xr,$ZodBase64:()=>T0,$ZodBase64URL:()=>I0,$ZodBigInt:()=>sw,$ZodBigIntFormat:()=>O0,$ZodBoolean:()=>og,$ZodCIDRv4:()=>x0,$ZodCIDRv6:()=>E0,$ZodCUID:()=>f0,$ZodCUID2:()=>m0,$ZodCatch:()=>lR,$ZodCheck:()=>ht,$ZodCheckBigIntFormat:()=>zA,$ZodCheckEndsWith:()=>XA,$ZodCheckGreaterThan:()=>Bv,$ZodCheckIncludes:()=>YA,$ZodCheckLengthEquals:()=>HA,$ZodCheckLessThan:()=>Gv,$ZodCheckLowerCase:()=>JA,$ZodCheckMaxLength:()=>qA,$ZodCheckMaxSize:()=>GA,$ZodCheckMimeType:()=>t0,$ZodCheckMinLength:()=>WA,$ZodCheckMinSize:()=>BA,$ZodCheckMultipleOf:()=>jA,$ZodCheckNumberFormat:()=>UA,$ZodCheckOverwrite:()=>n0,$ZodCheckProperty:()=>e0,$ZodCheckRegex:()=>KA,$ZodCheckSizeEquals:()=>VA,$ZodCheckStartsWith:()=>QA,$ZodCheckStringFormat:()=>bu,$ZodCheckUpperCase:()=>ZA,$ZodCodec:()=>ag,$ZodCreditCard:()=>R0,$ZodCustom:()=>hR,$ZodCustomStringFormat:()=>N0,$ZodCyclicError:()=>fw,$ZodDate:()=>B0,$ZodDefault:()=>oR,$ZodDiscriminatedUnion:()=>K0,$ZodE164:()=>A0,$ZodEmail:()=>a0,$ZodEmoji:()=>d0,$ZodEncodeError:()=>Ls,$ZodEnum:()=>X0,$ZodError:()=>nA,$ZodExactOptional:()=>rR,$ZodFile:()=>tR,$ZodFunction:()=>mR,$ZodGUID:()=>o0,$ZodIBAN:()=>P0,$ZodIPv4:()=>_0,$ZodIPv6:()=>$0,$ZodISODate:()=>v0,$ZodISODateTime:()=>b0,$ZodISODuration:()=>k0,$ZodISOTime:()=>w0,$ZodIntersection:()=>J0,$ZodJWT:()=>C0,$ZodKSUID:()=>y0,$ZodLazy:()=>cg,$ZodLiteral:()=>eR,$ZodMAC:()=>S0,$ZodMap:()=>Y0,$ZodNaN:()=>uR,$ZodNanoID:()=>p0,$ZodNever:()=>z0,$ZodNonOptional:()=>aR,$ZodNull:()=>F0,$ZodNullable:()=>iR,$ZodNumber:()=>ow,$ZodNumberFormat:()=>D0,$ZodObject:()=>rq,$ZodObjectJIT:()=>q0,$ZodOptional:()=>cw,$ZodPipe:()=>lw,$ZodPrefault:()=>sR,$ZodPreprocess:()=>dR,$ZodPromise:()=>gR,$ZodProperties:()=>yR,$ZodReadonly:()=>pR,$ZodRealError:()=>Er,$ZodRecord:()=>Z0,$ZodRegistry:()=>vw,$ZodSet:()=>Q0,$ZodString:()=>lc,$ZodStringFormat:()=>lt,$ZodSuccess:()=>cR,$ZodSymbol:()=>M0,$ZodTemplateLiteral:()=>fR,$ZodTransform:()=>nR,$ZodTuple:()=>aw,$ZodType:()=>Ne,$ZodULID:()=>g0,$ZodURL:()=>u0,$ZodUUID:()=>s0,$ZodUndefined:()=>L0,$ZodUnion:()=>sg,$ZodUnknown:()=>U0,$ZodVoid:()=>G0,$ZodXID:()=>h0,$ZodXor:()=>W0,$brand:()=>XI,$constructor:()=>C,$input:()=>kR,$output:()=>wR,Doc:()=>cc,INVALID:()=>ar,JSONSchema:()=>q2,JSONSchemaGenerator:()=>Xw,NEVER:()=>QI,TimePrecision:()=>CR,URL_BAD_FORMAT:()=>c0,URL_UNPARSEABLE:()=>l0,ZodCompileAsyncError:()=>zi,ZodCompileUnsupportedError:()=>Ve,_any:()=>JR,_array:()=>rP,_base64:()=>Uw,_base64url:()=>zw,_bigint:()=>GR,_boolean:()=>UR,_catch:()=>Ege,_check:()=>A2,_cidrv4:()=>Fw,_cidrv6:()=>jw,_coercedBigint:()=>BR,_coercedBoolean:()=>zR,_coercedDate:()=>eP,_coercedNumber:()=>DR,_coercedString:()=>IR,_creditCard:()=>RR,_cuid:()=>Pw,_cuid2:()=>Cw,_custom:()=>oP,_date:()=>XR,_decode:()=>Cv,_decodeAsync:()=>Dv,_default:()=>$ge,_discriminatedUnion:()=>dge,_e164:()=>Gw,_email:()=>$w,_emoji:()=>Aw,_encode:()=>Pv,_encodeAsync:()=>Nv,_endsWith:()=>Iu,_enum:()=>yge,_file:()=>iP,_float32:()=>MR,_float64:()=>LR,_gt:()=>po,_gte:()=>zr,_guid:()=>Sw,_iban:()=>PR,_includes:()=>Eu,_int:()=>OR,_int32:()=>FR,_int64:()=>VR,_intersection:()=>pge,_ipv4:()=>Mw,_ipv6:()=>Lw,_isoDate:()=>hg,_isoDateTime:()=>gg,_isoDuration:()=>bg,_isoTime:()=>yg,_jwt:()=>Bw,_ksuid:()=>Ow,_lazy:()=>Rge,_length:()=>hc,_literal:()=>vge,_lowercase:()=>Su,_lt:()=>uo,_lte:()=>Ur,_mac:()=>AR,_map:()=>gge,_max:()=>Ur,_maxLength:()=>gc,_maxSize:()=>js,_mime:()=>Au,_min:()=>zr,_minLength:()=>Zo,_minSize:()=>fo,_multipleOf:()=>Fs,_nan:()=>tP,_nanoid:()=>Rw,_nativeEnum:()=>bge,_negative:()=>qw,_never:()=>YR,_nonnegative:()=>Hw,_nonoptional:()=>Sge,_nonpositive:()=>Ww,_normalize:()=>Ru,_null:()=>KR,_nullable:()=>_ge,_number:()=>NR,_optional:()=>kge,_overwrite:()=>Gi,_parse:()=>mu,_parseAsync:()=>gu,_pipe:()=>Tge,_positive:()=>Vw,_promise:()=>Pge,_properties:()=>nP,_property:()=>Kw,_readonly:()=>Ige,_record:()=>mge,_refine:()=>sP,_regex:()=>$u,_safeDecode:()=>Mv,_safeDecodeAsync:()=>Fv,_safeEncode:()=>Ov,_safeEncodeAsync:()=>Lv,_safeParse:()=>hu,_safeParseAsync:()=>yu,_set:()=>hge,_size:()=>mc,_slugify:()=>Du,_startsWith:()=>Tu,_string:()=>TR,_stringFormat:()=>Ou,_stringbool:()=>uP,_success:()=>xge,_superRefine:()=>aP,_symbol:()=>WR,_templateLiteral:()=>Age,_toLowerCase:()=>Cu,_toUpperCase:()=>Nu,_transform:()=>wge,_trim:()=>Pu,_tuple:()=>fge,_uint32:()=>jR,_uint64:()=>qR,_ulid:()=>Nw,_undefined:()=>HR,_union:()=>lge,_unknown:()=>ZR,_uppercase:()=>xu,_url:()=>mg,_uuid:()=>xw,_uuidv4:()=>Ew,_uuidv6:()=>Tw,_uuidv7:()=>Iw,_void:()=>QR,_xid:()=>Dw,_xor:()=>uge,base64Charset:()=>ew,base64urlCharset:()=>ig,clone:()=>it,compile:()=>xR,compileFn:()=>_w,config:()=>Gt,createStandardJSONSchemaMethod:()=>Mu,createToJSONSchemaMethod:()=>pP,decode:()=>dpe,decodeAsync:()=>fpe,describe:()=>cP,encode:()=>upe,encodeAsync:()=>ppe,extractDefs:()=>zs,finalize:()=>Gs,flattenError:()=>Jm,formatError:()=>Zm,getDiscriminatedOption:()=>H0,globalConfig:()=>gn,globalRegistry:()=>Nn,handleUnrepresentable:()=>Zt,initializeContext:()=>Us,isBackEdge:()=>gw,isRecursiveSchema:()=>mw,isTransforming:()=>Sn,isValidBase64:()=>rg,isValidBase64URL:()=>tw,isValidCIDRv6:()=>Xv,isValidCreditCard:()=>nw,isValidIBAN:()=>rw,isValidIPv6:()=>ng,isValidJWT:()=>iw,locales:()=>fg,memoizer:()=>dg,mergeValues:()=>vu,meta:()=>lP,parse:()=>Av,parseAsync:()=>Rv,parseURLObject:()=>Jv,prettifyError:()=>iA,process:()=>ot,processSchema:()=>ot,regexes:()=>sr,registry:()=>ww,safeDecode:()=>gpe,safeDecodeAsync:()=>ype,safeEncode:()=>mpe,safeEncodeAsync:()=>hpe,safeParse:()=>ope,safeParseAsync:()=>spe,standardProps:()=>Kv,stripTabAndNewline:()=>Zv,toDotPath:()=>CV,toJSONSchema:()=>Qw,toZod:()=>zm,treeifyError:()=>rA,urlHostnameOk:()=>Yv,urlProtocolOk:()=>Qv,util:()=>V,validate:()=>Ym,validateAsync:()=>Qm,version:()=>r0,withParser:()=>kw});var V={};kr(V,{BIGINT_FORMAT_RANGES:()=>Wm,CONSTANT_CATCH:()=>Tv,Class:()=>zI,NUMBER_FORMAT_RANGES:()=>qm,aborted:()=>ir,allowsEval:()=>VI,assert:()=>Ede,assertEqual:()=>_de,assertIs:()=>Sde,assertNever:()=>xde,assertNotEqual:()=>$de,assignProp:()=>$n,attachSchema:()=>Ev,base64ToUint8Array:()=>EV,base64urlToUint8Array:()=>qde,cached:()=>du,captureStackTrace:()=>Sv,cleanEnum:()=>Vde,cleanRegex:()=>Ko,clone:()=>it,cloneDef:()=>Ade,codePointLength:()=>sc,constantCatch:()=>ZI,createTransparentProxy:()=>Ode,defineLazy:()=>GI,defineLazyInternal:()=>je,derived:()=>Jde,esc:()=>rr,escapeRegex:()=>ci,explicitlyAborted:()=>HI,extend:()=>Fde,finalizeIssue:()=>Sr,floatSafeRemainder:()=>Gm,getElementAtPath:()=>Rde,getEnumValues:()=>lu,getLengthableOrigin:()=>Km,getParsedType:()=>Dde,getSizableOrigin:()=>Hm,hexToUint8Array:()=>Hde,hide:()=>JI,installLazyProp:()=>Qde,isObject:()=>oc,isPlainObject:()=>ai,issue:()=>fu,joinValues:()=>N,jsonStringifyReplacer:()=>uu,members:()=>KI,merge:()=>Ude,mergeDefs:()=>Ui,normalizeParams:()=>ee,nullish:()=>$v,numKeys:()=>Nde,objectClone:()=>Tde,omit:()=>Lde,optionalKeys:()=>WI,own:()=>Ms,parsedType:()=>J,partial:()=>zde,pick:()=>Mde,prefixIssues:()=>or,primitiveTypes:()=>qI,promiseAllObject:()=>Pde,propertyKeyTypes:()=>Vm,randomString:()=>Cde,rawShape:()=>pu,required:()=>Gde,safeExtend:()=>jde,shallowClone:()=>Bm,slugify:()=>BI,stringifyPrimitive:()=>q,toZod:()=>zm,uint8ArrayToBase64:()=>TV,uint8ArrayToBase64url:()=>Wde,uint8ArrayToHex:()=>Kde,unwrapMessage:()=>cu});function _de(e){return e}function $de(e){return e}function zm(){return e=>e}function Sde(e){}function xde(e){throw new Error("Unexpected value in exhaustive check")}function Ede(e){}function lu(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function N(e,t="|"){return e.map(n=>q(n)).join(t)}function uu(e,t){return typeof t=="bigint"?t.toString():t}var UI=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function du(e){return new UI(e)}function $v(e){return e==null}function Ko(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Gm(e,t){let n=e/t,r=Math.round(n),i=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r){let a=t._zod.def.shape[o];return r?r(a,o):a}):SV(e,o,r?r(s.value,o):s.value))}}function Ide(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?$V(e,n,()=>t[n]):SV(e,n,r.value))}}function Ui(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Ade(e){return Ui(e._zod.def)}function Rde(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function Pde(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let i={};for(let o=0;o{};function oc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var VI=du(()=>{if(gn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ai(e){if(oc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(oc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Bm(e){return ai(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Nde(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Dde=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Vm=new Set(["string","number","symbol"]),qI=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ci(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ee(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ode(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,o){return t??(t=e()),Reflect.set(t,r,i,o)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function q(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function WI(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var qm={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Wm={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Mde(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return ic(o,e,xv(e,t)),it(e,Ui(n,{shape:o,checks:[]}))}function xv(e,t){let n=Ho(e),r=[];for(let i of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,i)?.enumerable)throw new Error(`Unrecognized key: "${String(i)}"`);t[i]&&r.push(i)}return r}function Lde(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(xv(e,t)),s={};return ic(s,e,Reflect.ownKeys(Ho(e)).filter(a=>!o.has(a))),it(e,Ui(n,{shape:s,checks:[]}))}function Fde(e,t){if(!ai(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=Ho(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(i,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return it(e,Ui(e._zod.def,{shape:xV(e,t)}))}function xV(e,t){let n={};return ic(n,e,Reflect.ownKeys(Ho(e))),Ide(n,t),n}function jde(e,t){if(!ai(t))throw new Error("Invalid input to safeExtend: expected a plain object");return it(e,Ui(e._zod.def,{shape:xV(e,t)}))}function Ude(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};ic(n,e,Reflect.ownKeys(Ho(e))),ic(n,t,Reflect.ownKeys(Ho(t)));let r=Ui(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return it(e,r)}function zde(e,t,n,r="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(xv(t,n)):void 0,c={};return ic(c,t,Reflect.ownKeys(Ho(t)),e&&((l,u)=>a&&!a.has(u)?l:new e({type:"optional",innerType:l}))),it(t,Ui(t._zod.def,{shape:c,checks:[]}))}function Gde(e,t,n){let r=n?new Set(xv(t,n)):void 0,i={};return ic(i,t,Reflect.ownKeys(Ho(t)),(o,s)=>r&&!r.has(s)?o:new e({type:"nonoptional",innerType:o})),it(t,Ui(t._zod.def,{shape:i}))}function ir(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function cu(e){return typeof e=="string"?e:e?.message}function Ev(e,t,n){var r;for(let i=t;iNumber.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function EV(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;rt.toString(16).padStart(2,"0")).join("")}var zI=class{constructor(...t){}};function KI(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):_V(e,n,r.value)}for(let n of Object.getOwnPropertySymbols(t))_V(e,n,t[n])}function Ms(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function JI(e,t,n){return Ms(e,t,n,!1)}function Jde(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ms(this,n,r(this))},set(i){Ms(this,n,i)}})}return t}function _V(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ms(this,t,n.bind(this))},set(r){Ms(this,t,r)}})}function Zde(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var jI,Os=!1,Yde={configurable:!0,get(){Os=!0}};function je(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&jI!==e._zod){jI=void 0;return}jI=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Yde);let i=Os;Os=!1;try{let o=n(this);return Os?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),Os=Os||i,o}catch(o){throw delete this[t],Os=Os||i,o}},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i})}})}function Qde(e,t,n,r){let i=Zde(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:o})}})}var Tv="~constantCatch";function ZI(e){let t=()=>e;return t[Tv]=!0,t}var IV,QI=Object.freeze({status:"aborted"}),YI={value:void 0,enumerable:!1},AV="captureStackTrace"in Error?Error:null;function Xde(e){let t=AV;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return AV=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function C(e,t,n,r){let i={};function o(p){this.def=p,this.constr=d,this.traits=new Set}o.prototype=i;let s=n,a=s&&new WeakSet;function c(p,f){if(!p._zod){YI.value=new o(f);try{Object.defineProperty(p,"_zod",YI)}finally{YI.value=void 0}}if(p._zod.traits.has(e))return;if(p._zod.traits.add(e),t(p,f),a){let g=Object.getPrototypeOf(p),h=p._zod.constr.prototype,v=g;for(;v&&v!==h;)v=Object.getPrototypeOf(v);let b=v??g;a.has(b)||(a.add(b),KI(b,s))}let m=d.prototype;for(let g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in p||(p[g]=m[g].bind(p)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(p){let f=r?.Parent?Xde(u):this;c(f,p);let m=f._zod.deferred;if(m){for(let h of m)h();f._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(f),f}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var XI=Symbol("zod_brand"),xr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ls=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(IV=globalThis).__zod_globalConfig??(IV.__zod_globalConfig={});var gn=globalThis.__zod_globalConfig;function Gt(e){return e&&Object.assign(gn,e),gn}function epe(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,uu,2)),e.message}function tpe(e){this._zod.message=e}var npe={get:epe,set:tpe,enumerable:!0,configurable:!0},tA={value:void 0,enumerable:!1},RV=new WeakSet([Object.prototype,Error.prototype]),PV=(e,t)=>{e.name="$ZodError",tA.value=t,Object.defineProperty(e,"issues",tA),tA.value=void 0,Object.defineProperty(e,"message",npe);let n=Object.getPrototypeOf(e);RV.has(n)||(RV.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},nA=C("$ZodError",PV),Er=C("$ZodError",PV,void 0,{Parent:Error});function rpe(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Jm(e,t=n=>n.message){let n={},r=[];for(let i of e.issues)i.path.length>0?rpe(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Zm(e,t=n=>n.message){let n={_errors:[]},r=(i,o=[])=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,l=0;for(;ln.message){let n={errors:[]},r=(i,o=[])=>{var s;for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>r({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0){n.errors.push(t(a));continue}let l=n,u=0;for(;utypeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function iA(e){let t=[],n=[...e.issues].sort((r,i)=>(r.path??[]).length-(i.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${CV(r.path)}`);return t.join(` +`)}function Iv(e,t){return{callee:t?.callee??e,Err:t?.Err}}var mu=e=>{let t=(n,r,i,o)=>{let s=i?{...i,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new xr;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>Sr(l,s,Gt())));throw Sv(c,o?.callee??t),c}return a.value};return t},Av=mu(Er),gu=e=>{let t=async(n,r,i,o)=>{let s=i?{...i,async:!0}:{async:!0},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>Sr(l,s,Gt())));throw Sv(c,o?.callee??t),c}return a.value};return t},Rv=gu(Er),hu=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new xr;return o.issues.length?NV(e,o.issues,i):{success:!0,data:o.value}},ope=hu(Er);function NV(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(i=>Sr(i,n,Gt()))),t=void 0,n=void 0),r},set error(i){r=i,t=void 0,n=void 0}}}var yu=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?NV(e,o.issues,i):{success:!0,data:o.value}},spe=yu(Er),ape=Symbol.for("zod.compile.invalid"),cpe=Symbol.for("zod.compile.fallback"),Ym=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==ape)return!0;if(r.definite===!0&&n===void 0)return!1}return lpe(e,t,n)});function lpe(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,o;if(i?(r[cpe]=!0,o=i({value:t,issues:[]},r)):o=e._zod.run({value:t,issues:[]},r),o instanceof Promise)throw new xr;return o.issues.length===0}var Qm=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Pv=e=>{let t=mu(e),n=(r,i,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return t(r,i,a,Iv(n,s))};return n},upe=Pv(Er),Cv=e=>{let t=mu(e),n=(r,i,o,s)=>t(r,i,o,Iv(n,s));return n},dpe=Cv(Er),Nv=e=>{let t=gu(e),n=async(r,i,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await t(r,i,a,Iv(n,s))};return n},ppe=Nv(Er),Dv=e=>{let t=gu(e),n=async(r,i,o,s)=>await t(r,i,o,Iv(n,s));return n},fpe=Dv(Er),Ov=e=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return hu(e)(t,n,i)},mpe=Ov(Er),Mv=e=>(t,n,r)=>hu(e)(t,n,r),gpe=Mv(Er),Lv=e=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return yu(e)(t,n,i)},hpe=Lv(Er),Fv=e=>async(t,n,r)=>yu(e)(t,n,r),ype=Fv(Er);var sr={};kr(sr,{anyString:()=>AA,base64:()=>_A,base64url:()=>$A,bigint:()=>PA,boolean:()=>CA,browserEmail:()=>xpe,cidrv4:()=>wA,cidrv6:()=>kA,creditCard:()=>jv,cuid:()=>sA,cuid2:()=>aA,date:()=>EA,datetime:()=>IA,domain:()=>Ipe,duration:()=>fA,e164:()=>xA,email:()=>gA,emoji:()=>hA,extendedDuration:()=>bpe,guid:()=>mA,hex:()=>Rpe,hostname:()=>Tpe,html5Email:()=>_pe,httpProtocol:()=>SA,iban:()=>Uv,idnEmail:()=>Spe,integer:()=>Xm,ipv4:()=>yA,ipv6:()=>bA,ksuid:()=>uA,lowercase:()=>OA,mac:()=>vA,md5_base64:()=>Cpe,md5_base64url:()=>Npe,md5_hex:()=>Ppe,nanoid:()=>dA,nanoidOfLength:()=>pA,null:()=>NA,number:()=>Jo,rfc5322Email:()=>$pe,sha1_base64:()=>Ope,sha1_base64url:()=>Mpe,sha1_hex:()=>Dpe,sha256_base64:()=>Fpe,sha256_base64url:()=>jpe,sha256_hex:()=>Lpe,sha384_base64:()=>zpe,sha384_base64url:()=>Gpe,sha384_hex:()=>Upe,sha512_base64:()=>Vpe,sha512_base64url:()=>qpe,sha512_hex:()=>Bpe,string:()=>RA,time:()=>TA,ulid:()=>cA,undefined:()=>DA,unicodeEmail:()=>DV,uppercase:()=>MA,uuid:()=>ac,uuid4:()=>vpe,uuid6:()=>wpe,uuid7:()=>kpe,xid:()=>lA});var sA=/^[cC][0-9a-z]{6,}$/,aA=/^[0-9a-z]+$/,cA=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,lA=/^[0-9a-vA-V]{20}$/,uA=/^[A-Za-z0-9]{27}$/,dA=/^[a-zA-Z0-9_-]{21}$/;function pA(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var fA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bpe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,mA=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ac=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,vpe=ac(4),wpe=ac(6),kpe=ac(7),gA=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_pe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[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])?)*$/,$pe=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,DV=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Spe=DV,xpe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[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])?)*$/,Epe="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function hA(){return new RegExp(Epe,"u")}var yA=/^(?:(?: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])$/,bA=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,vA=e=>{let t=ci(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},wA=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,kA=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_A=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$A=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Tpe=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Ipe=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,SA=/^https?$/,xA=/^\+[1-9]\d{6,14}$/,jv=/^\d(?:[ -]?\d){11,18}$/,Uv=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,OV="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Ape(e){return new RegExp(`^${e}$`)}var EA=Ape(OV);function oA(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function TA(e){return new RegExp(`^${oA(e)}$`)}function IA(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${oA({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${oA({precision:e.precision})}`:n;return new RegExp(`^${OV}T(?:${r})$`)}var AA=/^[\s\S]{0,}$/,RA=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},PA=/^-?\d+n?$/,Xm=/^-?\d+$/,Jo=/^-?\d+(?:\.\d+)?$/,CA=/^(?:true|false)$/i,NA=/^null$/i;var DA=/^undefined$/i;var OA=/^[^A-Z]*$/,MA=/^[^a-z]*$/,Rpe=/^[0-9a-fA-F]*$/;function eg(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function tg(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Ppe=/^[0-9a-fA-F]{32}$/,Cpe=eg(22,"=="),Npe=tg(22),Dpe=/^[0-9a-fA-F]{40}$/,Ope=eg(27,"="),Mpe=tg(27),Lpe=/^[0-9a-fA-F]{64}$/,Fpe=eg(43,"="),jpe=tg(43),Upe=/^[0-9a-fA-F]{96}$/,zpe=eg(64,""),Gpe=tg(64),Bpe=/^[0-9a-fA-F]{128}$/,Vpe=eg(86,"=="),qpe=tg(86);var ht=C("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),LA=e=>{let t=e.value;return!$v(t)&&t.size!==void 0},FA=e=>{let t=e.value;return!$v(t)&&t.length!==void 0},zv={number:"number",bigint:"bigint",object:"date"},Gv=C("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);let n=zv[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{ht.init(e,t);let n=zv[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:zv[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),jA=C("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Gm(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),UA=C("$ZodCheckNumberFormat",(e,t)=>{ht.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,o]=qm[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}ao&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),zA=C("$ZodCheckBigIntFormat",(e,t)=>{ht.init(e,t);let[n,r]=Wm[t.format];e._zod.check=i=>{let o=i.value;or&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),GA=C("$ZodCheckMaxSize",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=LA),e._zod.check=r=>{let i=r.value;i.size<=t.maximum||r.issues.push({origin:Hm(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),BA=C("$ZodCheckMinSize",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=LA),e._zod.check=r=>{let i=r.value;i.size>=t.minimum||r.issues.push({origin:Hm(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),VA=C("$ZodCheckSizeEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=LA),e._zod.check=r=>{let i=r.value,o=i.size;if(o===t.size)return;let s=o>t.size;r.issues.push({origin:Hm(i),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),qA=C("$ZodCheckMaxLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=FA),e._zod.check=r=>{let i=r.value,o=i.length;if((typeof i=="string"&&o>t.maximum?sc(i):o)<=t.maximum)return;let a=Km(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),WA=C("$ZodCheckMinLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=FA),e._zod.check=r=>{let i=r.value,o=i.length;if((typeof i=="string"&&o>=t.minimum&&o=t.minimum)return;let a=Km(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),HA=C("$ZodCheckLengthEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=FA),e._zod.check=r=>{let i=r.value,o=i.length,s=typeof i=="string"&&o>=t.length&&o<=t.length*2?sc(i):o;if(s===t.length)return;let a=Km(i),c=s>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),bu=C("$ZodCheckStringFormat",(e,t)=>{var n,r;ht.init(e,t),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),KA=C("$ZodCheckRegex",(e,t)=>{bu.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),JA=C("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=OA),bu.init(e,t)}),ZA=C("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=MA),bu.init(e,t)}),YA=C("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);let n=ci(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),QA=C("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);let n=new RegExp(`^${ci(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),XA=C("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);let n=new RegExp(`.*${ci(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function MV(e,t,n){e.issues.length&&t.issues.push(...or(n,e.issues))}var e0=C("$ZodCheckProperty",(e,t)=>{ht.init(e,t),e._zod.check=n=>{let r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(i=>MV(i,n,t.property));MV(r,n,t.property)}}),t0=C("$ZodCheckMimeType",(e,t)=>{ht.init(e,t);let n=new Set(t.mime);e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),n0=C("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var cc=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(` +`).filter(s=>s),i=Math.min(...r.map(s=>s.length-s.trimStart().length)),o=r.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { ${n.join(` `)} -};`)(...Object.values(this.closed))}};var s0={major:4,minor:6,patch:2};var Ce=R("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=s0;let i=e._zod.def.checks,r=e._zod.traits.has("$ZodCheck")?[e,...i??[]]:i?.length?[...i]:[];for(let o of r)for(let s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(a,c,l)=>{if(a.memo)return a;let u=rr(a),d;for(let p of c){if(p._zod.def.when){if(ZT(a)||!p._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,m=p._zod.check(a);if(m instanceof Promise&&l?.async===!1)throw new Tr;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==f&&(ov(a.issues,f,e),u||(u=rr(a,f)))});else{if(a.issues.length===f)continue;ov(a.issues,f,e),u||(u=rr(a,f))}}return d?d.then(()=>a):a},s=(a,c,l)=>{if(rr(a))return a.aborted=!0,a;let u=o(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new Tr;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,a,c)):s(u,a,c)}let l=e._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new Tr;return l.then(u=>o(u,r,c))}return o(l,r,c)}}},{get"~standard"(){return QT(this,"~standard",Tv(this))},set"~standard"(e){Us(this,"~standard",e)}}),cV=(e,t)=>e.issues.length?{issues:e.issues.map(n=>Er(n,t,zt()))}:{value:e.value};async function Uue(e,t){let n={async:!0};return cV(await e._zod.run({value:t,issues:[]},n),n)}function Tv(e){return{validate:t=>{let n={async:!1};try{let i=e._zod.run({value:t,issues:[]},n);if(!(i instanceof Promise))return cV(i,n)}catch{}return Uue(e,t)},vendor:"zod",version:1}}var kc=R("$ZodString",(e,t)=>{Ce.init(e,t),e._zod.pattern=t.pattern??CI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ut=R("$ZodStringFormat",(e,t)=>{Mu.init(e,t),kc.init(e,t)}),c0=R("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=yI),ut.init(e,t)}),l0=R("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vc(i))}else t.pattern??(t.pattern=vc());ut.init(e,t)}),u0=R("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=bI),ut.init(e,t)}),d0=1,p0=2;function Iv(e,t){if(!t.normalize&&t.protocol?.source===TI.source&&!/^https?:\/\//i.test(e))return d0;try{return new URL(e)}catch{return p0}}var jue=/[\t\n\r]/g;function Av(e){return e.replace(jue,"")}function Rv(e,t){return t.lastIndex=0,t.test(e.hostname)}function Nv(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var f0=R("$ZodURL",(e,t)=>{ut.init(e,t),e._zod.check=n=>{try{let i=n.value.trim(),r=Iv(i,t);if(r===d0){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(r===p0){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Rv(r,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Nv(r,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?r.href:Av(i);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),m0=R("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vI()),ut.init(e,t)}),g0=R("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?mI:gI(t.length)),ut.init(e,t)}),h0=R("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lI),ut.init(e,t)}),y0=R("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=uI),ut.init(e,t)}),b0=R("$ZodULID",(e,t)=>{t.pattern??(t.pattern=dI),ut.init(e,t)}),v0=R("$ZodXID",(e,t)=>{t.pattern??(t.pattern=pI),ut.init(e,t)}),w0=R("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fI),ut.init(e,t)}),k0=R("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=NI(t)),ut.init(e,t)}),$0=R("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=AI),ut.init(e,t)}),_0=R("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RI(t)),ut.init(e,t)}),S0=R("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=hI),ut.init(e,t)}),x0=R("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wI),ut.init(e,t)}),zue=/^[0-9a-fA-F:.]+$/;function Um(e){if(!zue.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var E0=R("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=kI),ut.init(e,t),e._zod.check=n=>{Um(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),T0=R("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=$I(t.delimiter)),ut.init(e,t)}),I0=R("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_I),ut.init(e,t)});function Cv(e){let t=e.split("/");if(t.length!==2)return!1;let[n,i]=t;if(!i)return!1;let r=Number(i);return`${r}`!==i||r<0||r>128?!1:Um(n)}var A0=R("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=SI),ut.init(e,t),e._zod.check=n=>{Cv(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function jm(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Pv=/^[0-9a-zA-Z+/]*={0,2}$/,R0=R("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Pv),ut.init(e,t),e._zod.check=n=>{jm(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),zm=/^[A-Za-z0-9_-]*$/;function Dv(e){if(!zm.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return jm(n)}var N0=R("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=zm),ut.init(e,t),e._zod.check=n=>{Dv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),C0=R("$ZodE164",(e,t)=>{t.pattern??(t.pattern=II),ut.init(e,t)}),Gue=/[- ]/g;function Vue(e){let t=e.length,n=1,i=0;for(;t;){let r=e.charCodeAt(--t)-48;n^=1,i+=n?[0,2,4,6,8,1,3,5,7,9][r]:r}return i%10===0}function Ov(e){return bv.test(e)?Vue(e.replace(Gue,"")):!1}var P0=R("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=bv),ut.init(e,t),e._zod.check=n=>{Ov(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}});function Bue(e){let t=0,n=e.length;for(let i=4;i=65?t*100+(r-55):t*10+(r-48))%97}for(let i=0;i<4;i++){let r=e.charCodeAt(i);t=(r>=65?t*100+(r-55):t*10+(r-48))%97}return t===1}function Mv(e){return vv.test(e)?Bue(e):!1}var D0=R("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=vv),ut.init(e,t),e._zod.check=n=>{Mv(n.value)||n.issues.push({code:"invalid_format",format:"iban",input:n.value,inst:e,continue:!t.abort})}});function Lv(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var O0=R("$ZodJWT",(e,t)=>{ut.init(e,t),e._zod.check=n=>{Lv(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),M0=R("$ZodCustomStringFormat",(e,t)=>{ut.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Fv=R("$ZodNumber",(e,t)=>{Ce.init(e,t),e._zod.pattern=Ko,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:String(r):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),n}}),L0=R("$ZodNumberFormat",(e,t)=>{VI.init(e,t),Fv.init(e,t)}),Gm=R("$ZodBoolean",(e,t)=>{Ce.init(e,t),e._zod.pattern=OI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),Uv=R("$ZodBigInt",(e,t)=>{Ce.init(e,t),e._zod.pattern=DI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),F0=R("$ZodBigIntFormat",(e,t)=>{BI.init(e,t),Uv.init(e,t)}),U0=R("$ZodSymbol",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),j0=R("$ZodUndefined",(e,t)=>{Ce.init(e,t),e._zod.pattern=LI,e._zod.values=new Set([void 0]),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),z0=R("$ZodNull",(e,t)=>{Ce.init(e,t),e._zod.pattern=MI,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),G0=R("$ZodAny",(e,t)=>{Ce.init(e,t),e._zod.parse=n=>n}),V0=R("$ZodUnknown",(e,t)=>{Ce.init(e,t),e._zod.parse=n=>n}),B0=R("$ZodNever",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),q0=R("$ZodVoid",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),W0=R("$ZodDate",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:e}),n}});function WG(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues)),t.value[n]=e.value}var H0=R("$ZodArray",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),i;i.value=n?n.alloc(e,i,Array(o.length),r):Array(o.length);let s=[],a=r?.abortEarly;for(let c=0;cWG(d,i,c)));else if(WG(u,i,c),a&&u.issues.length!==0&&rr(u))break}return s.length?Promise.all(s).then(()=>i):i}});function Ev(e,t,n,i,r,o){let s=n in i,a=o==="optional";if(!(!s&&a&&r==="optional")){if(e.issues.length){if(r!==void 0&&a&&!s)return;t.issues.push(...ir(n,e.issues))}if(!s&&r===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(s||r==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}var que=[];function lV(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),i=n.length?n:que,r=i.length?[...t,...i]:t;for(let s of r)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let o=JT(e.shape);return{...e,allKeys:r,symbolKeys:i,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function uV(e,t,n,i,r,o,s){let a=[],c=r.keySet,l=r.catchall._zod,u=l.def.type,d=l.optin,p=l.optout,f=0;for(let m in t){if(s&&n.issues.length!==f){if(rr(n,f))break;f=n.issues.length}if(c.has(m))continue;if(m==="__proto__"){u==="never"&&a.push(m);continue}if(u==="never"){a.push(m);continue}let g=l.run({value:t[m],issues:[]},i);g instanceof Promise?e.push(g.then(h=>Ev(h,n,m,t,d,p))):Ev(g,n,m,t,d,p)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var dV=R("$ZodObject",(e,t)=>{Ce.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),i=n?.get?n.get.raw:t.shape??{};if(i){let l=()=>{let u={...i};return Object.defineProperty(t,"shape",{value:u}),l.raw=u,u};l.raw=i,Object.defineProperty(t,"shape",{get:l})}let r=Au(()=>lV(t));Ue(e,"propValues",l=>{let u=l.def.shape,d={};for(let p in u){let f=u[p]._zod;if(f.values){Object.prototype.hasOwnProperty.call(d,p)||Sn(d,p,new Set);for(let m of f.values)d[p].add(m);f.optin!==void 0&&d[p].add(void 0)}}return d});let o=yc,s=t.catchall,a,c=hn.memoizer;c?.attach(e),e._zod.parse=(l,u)=>{a??(a=r.value);let d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value=c?c.alloc(e,l,{},u):{};let p=[],f=a.shape,m=u?.abortEarly,g=l.issues.length;for(let h of a.allKeys){if(m&&l.issues.length!==g){if(rr(l,g))break;g=l.issues.length}if(h==="__proto__")continue;let b=f[h],y=b._zod.optin,w=b._zod.optout,k=b._zod.run({value:d[h],issues:[]},u);k instanceof Promise?p.push(k.then(_=>Ev(_,l,h,d,y,w))):Ev(k,l,h,d,y,w)}return s?uV(p,d,l,u,r.value,e,m===!0):p.length?Promise.all(p).then(()=>l):l}}),K0=R("$ZodObjectJIT",(e,t)=>{dV.init(e,t);let n=e._zod.parse,i=Au(()=>lV(t)),r=hn.memoizer,o=f=>{let m=i.value,g=m.symbolKeys,h=new wc(["payload","ctx"],{shape:f,inst:e,memo:r,syms:g}),b=_=>`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`,y=(_,S)=>` - let ${_}_ab = false; - for (let i = 0; i < ${_}.issues.length; i++) { - const iss = ${_}.issues[i]; +};`)(...Object.values(this.closed))}};var r0={major:4,minor:6,patch:2};var Ne=C("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=r0;let r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let o of i)for(let s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(a,c,l)=>{if(a.memo)return a;let u=ir(a),d;for(let p of c){if(p._zod.def.when){if(HI(a)||!p._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,m=p._zod.check(a);if(m instanceof Promise&&l?.async===!1)throw new xr;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==f&&(Ev(a.issues,f,e),u||(u=ir(a,f)))});else{if(a.issues.length===f)continue;Ev(a.issues,f,e),u||(u=ir(a,f))}}return d?d.then(()=>a):a},s=(a,c,l)=>{if(ir(a))return a.aborted=!0,a;let u=o(c,i,l);if(u instanceof Promise){if(l.async===!1)throw new xr;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,a,c)):s(u,a,c)}let l=e._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new xr;return l.then(u=>o(u,i,c))}return o(l,i,c)}}},{get"~standard"(){return JI(this,"~standard",Kv(this))},set"~standard"(e){Ms(this,"~standard",e)}}),eq=(e,t)=>e.issues.length?{issues:e.issues.map(n=>Sr(n,t,Gt()))}:{value:e.value};async function Wpe(e,t){let n={async:!0};return eq(await e._zod.run({value:t,issues:[]},n),n)}function Kv(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return eq(r,n)}catch{}return Wpe(e,t)},vendor:"zod",version:1}}var lc=C("$ZodString",(e,t)=>{Ne.init(e,t),e._zod.pattern=t.pattern??AA,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),lt=C("$ZodStringFormat",(e,t)=>{bu.init(e,t),lc.init(e,t)}),o0=C("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=mA),lt.init(e,t)}),s0=C("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ac(r))}else t.pattern??(t.pattern=ac());lt.init(e,t)}),a0=C("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=gA),lt.init(e,t)}),c0=1,l0=2;function Jv(e,t){if(!t.normalize&&t.protocol?.source===SA.source&&!/^https?:\/\//i.test(e))return c0;try{return new URL(e)}catch{return l0}}var Hpe=/[\t\n\r]/g;function Zv(e){return e.replace(Hpe,"")}function Yv(e,t){return t.lastIndex=0,t.test(e.hostname)}function Qv(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var u0=C("$ZodURL",(e,t)=>{lt.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Jv(r,t);if(i===c0){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(i===l0){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Yv(i,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Qv(i,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Zv(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),d0=C("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=hA()),lt.init(e,t)}),p0=C("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?dA:pA(t.length)),lt.init(e,t)}),f0=C("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=sA),lt.init(e,t)}),m0=C("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=aA),lt.init(e,t)}),g0=C("$ZodULID",(e,t)=>{t.pattern??(t.pattern=cA),lt.init(e,t)}),h0=C("$ZodXID",(e,t)=>{t.pattern??(t.pattern=lA),lt.init(e,t)}),y0=C("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=uA),lt.init(e,t)}),b0=C("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=IA(t)),lt.init(e,t)}),v0=C("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=EA),lt.init(e,t)}),w0=C("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=TA(t)),lt.init(e,t)}),k0=C("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=fA),lt.init(e,t)}),_0=C("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=yA),lt.init(e,t)}),Kpe=/^[0-9a-fA-F:.]+$/;function ng(e){if(!Kpe.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var $0=C("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=bA),lt.init(e,t),e._zod.check=n=>{ng(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),S0=C("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=vA(t.delimiter)),lt.init(e,t)}),x0=C("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=wA),lt.init(e,t)});function Xv(e){let t=e.split("/");if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:ng(n)}var E0=C("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=kA),lt.init(e,t),e._zod.check=n=>{Xv(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function rg(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var ew=/^[0-9a-zA-Z+/]*={0,2}$/,T0=C("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ew),lt.init(e,t),e._zod.check=n=>{rg(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),ig=/^[A-Za-z0-9_-]*$/;function tw(e){if(!ig.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return rg(n)}var I0=C("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ig),lt.init(e,t),e._zod.check=n=>{tw(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),A0=C("$ZodE164",(e,t)=>{t.pattern??(t.pattern=xA),lt.init(e,t)}),Jpe=/[- ]/g;function Zpe(e){let t=e.length,n=1,r=0;for(;t;){let i=e.charCodeAt(--t)-48;n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][i]:i}return r%10===0}function nw(e){return jv.test(e)?Zpe(e.replace(Jpe,"")):!1}var R0=C("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=jv),lt.init(e,t),e._zod.check=n=>{nw(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}});function Ype(e){let t=0,n=e.length;for(let r=4;r=65?t*100+(i-55):t*10+(i-48))%97}for(let r=0;r<4;r++){let i=e.charCodeAt(r);t=(i>=65?t*100+(i-55):t*10+(i-48))%97}return t===1}function rw(e){return Uv.test(e)?Ype(e):!1}var P0=C("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=Uv),lt.init(e,t),e._zod.check=n=>{rw(n.value)||n.issues.push({code:"invalid_format",format:"iban",input:n.value,inst:e,continue:!t.abort})}});function iw(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}var C0=C("$ZodJWT",(e,t)=>{lt.init(e,t),e._zod.check=n=>{iw(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),N0=C("$ZodCustomStringFormat",(e,t)=>{lt.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),ow=C("$ZodNumber",(e,t)=>{Ne.init(e,t),e._zod.pattern=Jo,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),D0=C("$ZodNumberFormat",(e,t)=>{UA.init(e,t),ow.init(e,t)}),og=C("$ZodBoolean",(e,t)=>{Ne.init(e,t),e._zod.pattern=CA,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),sw=C("$ZodBigInt",(e,t)=>{Ne.init(e,t),e._zod.pattern=PA,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),O0=C("$ZodBigIntFormat",(e,t)=>{zA.init(e,t),sw.init(e,t)}),M0=C("$ZodSymbol",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;return typeof i=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),n}}),L0=C("$ZodUndefined",(e,t)=>{Ne.init(e,t),e._zod.pattern=DA,e._zod.values=new Set([void 0]),e._zod.parse=(n,r)=>{let i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),F0=C("$ZodNull",(e,t)=>{Ne.init(e,t),e._zod.pattern=NA,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{let i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),j0=C("$ZodAny",(e,t)=>{Ne.init(e,t),e._zod.parse=n=>n}),U0=C("$ZodUnknown",(e,t)=>{Ne.init(e,t),e._zod.parse=n=>n}),z0=C("$ZodNever",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),G0=C("$ZodVoid",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;return typeof i>"u"||n.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),n}}),B0=C("$ZodDate",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),n}});function FV(e,t,n){e.issues.length&&t.issues.push(...or(n,e.issues)),t.value[n]=e.value}var V0=C("$ZodArray",(e,t)=>{Ne.init(e,t);let n=gn.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=n?n.alloc(e,r,Array(o.length),i):Array(o.length);let s=[],a=i?.abortEarly;for(let c=0;cFV(d,r,c)));else if(FV(u,r,c),a&&u.issues.length!==0&&ir(u))break}return s.length?Promise.all(s).then(()=>r):r}});function Hv(e,t,n,r,i,o){let s=n in r,a=o==="optional";if(!(!s&&a&&i==="optional")){if(e.issues.length){if(i!==void 0&&a&&!s)return;t.issues.push(...or(n,e.issues))}if(!s&&i===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(s||i==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}var Qpe=[];function tq(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Qpe,i=r.length?[...t,...r]:t;for(let s of i)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let o=WI(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function nq(e,t,n,r,i,o,s){let a=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,p=l.optout,f=0;for(let m in t){if(s&&n.issues.length!==f){if(ir(n,f))break;f=n.issues.length}if(c.has(m))continue;if(m==="__proto__"){u==="never"&&a.push(m);continue}if(u==="never"){a.push(m);continue}let g=l.run({value:t[m],issues:[]},r);g instanceof Promise?e.push(g.then(h=>Hv(h,n,m,t,d,p))):Hv(g,n,m,t,d,p)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var rq=C("$ZodObject",(e,t)=>{Ne.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){let l=()=>{let u={...r};return Object.defineProperty(t,"shape",{value:u}),l.raw=u,u};l.raw=r,Object.defineProperty(t,"shape",{get:l})}let i=du(()=>tq(t));je(e,"propValues",l=>{let u=l.def.shape,d={};for(let p in u){let f=u[p]._zod;if(f.values){Object.prototype.hasOwnProperty.call(d,p)||$n(d,p,new Set);for(let m of f.values)d[p].add(m);f.optin!==void 0&&d[p].add(void 0)}}return d});let o=oc,s=t.catchall,a,c=gn.memoizer;c?.attach(e),e._zod.parse=(l,u)=>{a??(a=i.value);let d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value=c?c.alloc(e,l,{},u):{};let p=[],f=a.shape,m=u?.abortEarly,g=l.issues.length;for(let h of a.allKeys){if(m&&l.issues.length!==g){if(ir(l,g))break;g=l.issues.length}if(h==="__proto__")continue;let v=f[h],b=v._zod.optin,w=v._zod.optout,k=v._zod.run({value:d[h],issues:[]},u);k instanceof Promise?p.push(k.then($=>Hv($,l,h,d,b,w))):Hv(k,l,h,d,b,w)}return s?nq(p,d,l,u,i.value,e,m===!0):p.length?Promise.all(p).then(()=>l):l}}),q0=C("$ZodObjectJIT",(e,t)=>{rq.init(e,t);let n=e._zod.parse,r=du(()=>tq(t)),i=gn.memoizer,o=f=>{let m=r.value,g=m.symbolKeys,h=new cc(["payload","ctx"],{shape:f,inst:e,memo:i,syms:g}),v=$=>`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`,b=($,S)=>` + let ${$}_ab = false; + for (let i = 0; i < ${$}.issues.length; i++) { + const iss = ${$}.issues[i]; iss.path = iss.path ? [${S}, ...iss.path] : [${S}]; payload.issues.push(iss); - if (iss.continue !== true) ${_}_ab = true; + if (iss.continue !== true) ${$}_ab = true; } - if (${_}_ab && ctx && ctx.abortEarly) { + if (${$}_ab && ctx && ctx.abortEarly) { payload.value = newResult; return payload; - }`;h.write("const input = payload.value;");let w=Object.create(null),k=0;for(let _ of m.allKeys)w[_]=`key_${k++}`;h.write(r?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let _ of m.allKeys){if(_==="__proto__")continue;let S=w[_],x=typeof _=="symbol"?`syms[${g.indexOf(_)}]`:nr(_),E=`${x} in input`,T=f[_],A=T?._zod?.optin,L=A!==void 0,F=T?._zod?.optout==="optional";if(h.write(`const ${S} = ${b(x)};`),L&&F){let K=A==="optional"?`${S}_present`:`${S}.value !== undefined || ${S}_present`;h.write(` - const ${S}_present = ${E}; + }`;h.write("const input = payload.value;");let w=Object.create(null),k=0;for(let $ of m.allKeys)w[$]=`key_${k++}`;h.write(i?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let $ of m.allKeys){if($==="__proto__")continue;let S=w[$],E=typeof $=="symbol"?`syms[${g.indexOf($)}]`:rr($),T=`${E} in input`,A=f[$],R=A?._zod?.optin,j=R!==void 0,U=A?._zod?.optout==="optional";if(h.write(`const ${S} = ${v(E)};`),j&&U){let Z=R==="optional"?`${S}_present`:`${S}.value !== undefined || ${S}_present`;h.write(` + const ${S}_present = ${T}; if (!${S}.issues.length || ${S}_present) { - if (${S}.issues.length) {${y(S,x)} + if (${S}.issues.length) {${b(S,E)} } - if (${K}) { - newResult[${x}] = ${S}.value; + if (${Z}) { + newResult[${E}] = ${S}.value; } } - `)}else L?(h.write(` - if (${S}.issues.length) {${y(S,x)} + `)}else j?(h.write(` + if (${S}.issues.length) {${b(S,E)} } - `),A==="defaulted"?h.write(`newResult[${x}] = ${S}.value;`):h.write(` - if (${S}.value !== undefined || ${E}) { - newResult[${x}] = ${S}.value; + `),R==="defaulted"?h.write(`newResult[${E}] = ${S}.value;`):h.write(` + if (${S}.value !== undefined || ${T}) { + newResult[${E}] = ${S}.value; } `)):h.write(` - const ${S}_present = ${E}; - if (${S}.issues.length) {${y(S,x)} + const ${S}_present = ${T}; + if (${S}.issues.length) {${b(S,E)} } if (!${S}_present && !${S}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: undefined, - path: [${x}] + path: [${E}] }); if (ctx && ctx.abortEarly) { payload.value = newResult; @@ -250,126 +228,126 @@ ${n.join(` } if (${S}_present) { - newResult[${x}] = ${S}.value; + newResult[${E}] = ${S}.value; } - `)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},s,a=yc,c=!hn.jitless,u=c&&HT.value,d=t.catchall,p;e._zod.parse=(f,m)=>{p??(p=i.value);let g=f.value;return a(g)?c&&u&&m?.async===!1&&m.jitless!==!0?(s||(s=o(t.shape)),f=s(f,m),d?uV([],g,f,m,p,e,m?.abortEarly===!0):f):n(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f)}});function HG(e,t,n,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let r=e.filter(o=>!rr(o));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(s=>Er(s,i,zt())))}),t)}var Vm=R("$ZodUnion",(e,t)=>{Ce.init(e,t),Ue(e,"optin",i=>i.def.options.some(r=>r._zod.optin==="defaulted")?"defaulted":i.def.options.some(r=>r._zod.optin!==void 0)?"optional":void 0),Ue(e,"optout",i=>i.def.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Ue(e,"values",i=>{if(i.def.options.every(r=>r._zod.values))return new Set(i.def.options.flatMap(r=>Array.from(r._zod.values)))}),Ue(e,"pattern",i=>{if(i.def.options.every(r=>r._zod.pattern)){let r=i.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Ho(o.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:i.value,issues:[]},r);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=>HG(a,i,e,r)):HG(s,i,e,r)}});function KG(e,t,n,i){let r=[];for(let o=0;oo.issues.map(s=>Er(s,i,zt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:r}),t)}var J0=R("$ZodXor",(e,t)=>{Vm.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:i.value,issues:[]},r);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>KG(a,i,e,r)):KG(s,i,e,r)}});function Z0(e,t){let n=e._zod,i=n.bag.optionsMap;i||(i=pV(n.def),n.bag.optionsMap=i);let r=i.get(t);if(r===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return r}function pV(e){let t=new Map;for(let n of e.options){let i=n._zod.propValues?.[e.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let r of i)if(t.has(r)){if(r!==void 0)throw new Error(`Duplicate discriminator value "${String(r)}"`);t.set(r,null)}else t.set(r,n)}return t}var Y0=R("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Vm.init(e,t);let n=e._zod.parse;Ue(e,"propValues",r=>{let o={},s=0;for(let a of r.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${r.def.options.indexOf(a)}"`);c[r.def.discriminator]?.has(void 0)&&s++;for(let[l,u]of Object.entries(c)){Object.prototype.hasOwnProperty.call(o,l)||Sn(o,l,new Set);for(let d of u)o[l].add(d)}}return!r.def.unionFallback&&s>1&&o[r.def.discriminator]?.delete(void 0),o}),t.options.forEach((r,o)=>{let s=Ru(r._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let i=Au(()=>pV(t));e._zod.parse=(r,o)=>{let s=r.value;if(!yc(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let a=s?.[t.discriminator],c=i.value.get(a);return c&&(a!==void 0||o.direction!=="backward")?c._zod.run(r,o):t.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()).filter(l=>i.value.get(l)!==null),input:s,path:[t.discriminator],inst:e}),r)}}),Q0=R("$ZodIntersection",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value,o=t.left._zod.run({value:r,issues:[]},i),s=t.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>JG(n,c,l)):JG(n,o,s)}});function Lu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ci(e)&&ci(t)){let n=Object.keys(t),i=Object.keys(e).filter(o=>n.indexOf(o)!==-1),r={...e,...t};Object.prototype.hasOwnProperty.call(r,"__proto__")&&delete r.__proto__;for(let o of i){if(o==="__proto__")continue;let s=Lu(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r[o]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i{let d;if(l.code==="unrecognized_keys"&&!l.path?.length)r??(r=l),d=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let p=String(l.path[0]);o.has(p)||o.set(p,l),d=[p]}else return!1;for(let p of d)i.has(p)||i.set(p,{}),i.get(p)[u]=!0;return!0};for(let l of t.issues)s(l,"l")||e.issues.push(l);for(let l of n.issues)s(l,"r")||e.issues.push(l);let a=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(a.length){let l=r?a.filter(u=>r.keys.includes(u)):[];l.length&&e.issues.push({...r,keys:l});for(let u of a)!l.includes(u)&&o.has(u)&&e.issues.push(o.get(u))}let c=Lu(t.value,n.value);if(!c.valid){if(rr(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var jv=R("$ZodTuple",(e,t)=>{Ce.init(e,t);let n=t.items,i=hn.memoizer;i?.attach(e),e._zod.parse=(r,o)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=i?i.alloc(e,r,[],o):[];let a=[],c=ZG(n,"optin"),l=ZG(n,"optout");if(!t.rest){if(s.lengthn.length&&r.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:s,inst:e,origin:"array"})}let u=new Array(n.length),d=t.rest?o?.abortEarly:void 0,p=!1;for(let f=0;f{u[f]=g})):(u[f]=m,d&&!p&&m.issues.length&&(p=rr(m)))}if(t.rest&&!p){let f=n.length-1,m=s.slice(n.length),g=r.issues.length;for(let h of m){if(d&&r.issues.length!==g){if(rr(r,g))break;g=r.issues.length}f++;let b=t.rest._zod.run({value:h,issues:[]},o);b instanceof Promise?a.push(b.then(y=>YG(y,r,f))):YG(b,r,f)}}return a.length?Promise.all(a).then(()=>QG(u,r,n,s,l)):QG(u,r,n,s,l)}});function ZG(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function YG(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues)),t.value[n]=e.value}function QG(e,t,n,i,r){for(let o=0;o=r&&n[o]._zod.optin==="optional"){t.value.length=o;break}if(s.issues.length){if(!a&&o>=r){t.value.length=o;break}t.issues.push(...ir(o,s.issues))}t.value[o]=s.value}for(let o=t.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&t.value[o]===void 0);o--)t.value.length=o;return t}var X0=R("$ZodRecord",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!ci(o))return i.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),i;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){i.value=n?n.alloc(e,i,{},r):{};let c=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(c.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Er(m,r,zt())),input:u,path:[u],inst:e});continue}let p=d.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[u],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&i.issues.push(...ir(u,m.issues)),i.value[p]=m.value})):(f.issues.length&&i.issues.push(...ir(u,f.issues)),i.value[p]=f.value)}let l;for(let u in o)if(!c.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;i.value[u]=o[u]}else l=l??[],l.push(u);l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{i.value=n?n.alloc(e,i,{},r):{};let c;for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let u=t.keyType._zod.run({value:l,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Ko.test(l)&&u.issues.length){let m=t.keyType._zod.run({value:Number(l),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(u=m)}if(u.issues.length){t.mode==="loose"?i.value[l]=o[l]:a?(c=c??[],c.push(l)):i.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>Er(m,r,zt())),input:l,path:[l],inst:e});continue}let p=u.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[l],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&i.issues.push(...ir(l,m.issues)),i.value[p]=m.value})):(f.issues.length&&i.issues.push(...ir(l,f.issues)),i.value[p]=f.value)}c&&c.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c,continue:!0})}return s.length?Promise.all(s).then(()=>i):i}}),eA=R("$ZodMap",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),i;let s=[];i.value=n?n.alloc(e,i,new Map,r):new Map;let a=r?.abortEarly,c=i.issues.length;for(let[l,u]of o){if(a&&i.issues.length!==c){if(rr(i,c))break;c=i.issues.length}let d=t.keyType._zod.run({value:l,issues:[]},r),p=t.valueType._zod.run({value:u,issues:[]},r);d instanceof Promise||p instanceof Promise?s.push(Promise.all([d,p]).then(([f,m])=>{XG(f,m,i,l,o,e,r)})):XG(d,p,i,l,o,e,r)}return s.length?Promise.all(s).then(()=>i):i}});function XG(e,t,n,i,r,o,s){e.issues.length&&(Tm.has(typeof i)?n.issues.push(...ir(i,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:e.issues.map(a=>Er(a,s,zt()))})),t.issues.length&&(Tm.has(typeof i)?n.issues.push(...ir(i,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:t.issues.map(a=>Er(a,s,zt()))})),n.value.set(e.value,t.value)}var tA=R("$ZodSet",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Set))return i.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),i;let s=[];i.value=n?n.alloc(e,i,new Set,r):new Set;let a=r?.abortEarly,c=i.issues.length;for(let l of o){if(a&&i.issues.length!==c){if(rr(i,c))break;c=i.issues.length}let u=t.valueType._zod.run({value:l,issues:[]},r);u instanceof Promise?s.push(u.then(d=>eV(d,i))):eV(u,i)}return s.length?Promise.all(s).then(()=>i):i}});function eV(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var nA=R("$ZodEnum",(e,t)=>{Ce.init(e,t);let n=Tu(t.entries),i=new Set(n);e._zod.values=i,Ue(e,"pattern",r=>{let o=Tu(r.def.entries).filter(s=>Tm.has(typeof s));return new RegExp(o.length?`^(${o.map(s=>li(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),rA=R("$ZodLiteral",(e,t)=>{Ce.init(e,t);let n=new Set(t.values);e._zod.values=n,Ue(e,"pattern",i=>{let r=i.def.values;return new RegExp(r.length?`^(${r.map(o=>typeof o=="string"?li(o):o?li(o.toString()):String(o)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),iA=R("$ZodFile",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),oA=R("$ZodTransform",(e,t)=>{Ce.init(e,t),e._zod.optin="optional",hn.memoizer?.guard(e),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js(e.constructor.name);let r=t.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n));if(r instanceof Promise)throw new Tr;return n.value=r,n}});function tV(e,t){return e.value=t.issues.length?void 0:t.value,e}var zv=R("$ZodOptional",(e,t)=>{Ce.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Ue(e,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),Ue(e,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Ho(i.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let r=t.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>tV(n,o)):tV(n,r)}return t.innerType._zod.run(n,i)}}),sA=R("$ZodExactOptional",(e,t)=>{zv.init(e,t),Ue(e,"values",n=>n.def.innerType._zod.values),Ue(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),aA=R("$ZodNullable",(e,t)=>{Ce.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin),Ue(e,"optout",n=>n.def.innerType._zod.optout),Ue(e,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Ho(i.source)}|null)$`):void 0}),Ue(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),cA=R("$ZodDefault",(e,t)=>{Ce.init(e,t),e._zod.optin="defaulted",Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>nV(o,t)):nV(r,t)}});function nV(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var lA=R("$ZodPrefault",(e,t)=>{Ce.init(e,t),e._zod.optin="defaulted",Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),uA=R("$ZodNonOptional",(e,t)=>{Ce.init(e,t),Ue(e,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,i)=>{let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>rV(o,e)):rV(r,e)}});function rV(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var dA=R("$ZodSuccess",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js("ZodSuccess");let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}});function iV(e,t,n,i){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(r=>Er(r,i,zt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var pA=R("$ZodCatch",(e,t)=>{Ce.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Ue(e,"optout",n=>n.def.innerType._zod.optout),Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>iV(n,o,t,i)):iV(n,r,t,i)}}),fA=R("$ZodNaN",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),Gv=R("$ZodPipe",(e,t)=>{Ce.init(e,t),Ue(e,"values",n=>n.def.in._zod.values),Ue(e,"optin",n=>n.def.in._zod.optin),Ue(e,"optout",n=>n.def.out._zod.optout),Ue(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(s=>_v(s,t.in,i)):_v(o,t.in,i)}let r=t.in._zod.run(n,i);return r instanceof Promise?r.then(o=>_v(o,t.out,i)):_v(r,t.out,i)}});function _v(e,t,n){return e.issues.some(i=>i.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Bm=R("$ZodCodec",(e,t)=>{Ce.init(e,t),Ue(e,"values",n=>n.def.in._zod.values),Ue(e,"optin",n=>n.def.in._zod.optin),Ue(e,"optout",n=>n.def.out._zod.optout),Ue(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Sv(s,t,i)):Sv(o,t,i)}else{let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Sv(s,t,i)):Sv(o,t,i)}}});function Sv(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(o=>xv(e,o,t.out,n)):xv(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(o=>xv(e,o,t.in,n)):xv(e,r,t.in,n)}}function xv(e,t,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},i)}var mA=R("$ZodPreprocess",(e,t)=>{Gv.init(e,t)}),gA=R("$ZodReadonly",(e,t)=>{Ce.init(e,t),Ue(e,"propValues",n=>n.def.innerType._zod.propValues),Ue(e,"values",n=>n.def.innerType._zod.values),Ue(e,"optin",n=>n.def.innerType?._zod?.optin),Ue(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(oV):oV(r)}});function oV(e){return e.memo||(e.value=Object.freeze(e.value)),e}function Wue(e){let t=e._zod.def,n=t.pattern,i=!!t.format?.includes("int"),r,o;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(n=c.pattern),i||(i=!!c.format?.includes("int"));let l=c.minimum??c.length,u=c.maximum??c.length;l!==void 0&&(r===void 0||l>r)&&(r=l),u!==void 0&&(o===void 0||uo)return"(?!)";if(r!==void 0||o!==void 0)return PI({minimum:r,maximum:o}).source;let s=e._zod.pattern;return(i&&s===Ko?Mm:s)?.source}function a0(e){let t=e._zod.def,n=e._zod.pattern?.source,i=t.innerType??e._zod.innerType;if(i){let r=i._zod.pattern?.source,o=a0(i);return n&&r&&o&&o!==r?n.replace(Ho(r),()=>Ho(o)):n}if(t.options){let r=t.options.map(a0);if(r.every(Boolean))return`^(${r.map(o=>Ho(o)).join("|")})$`}return Wue(e)}var hA=R("$ZodTemplateLiteral",(e,t)=>{Ce.init(e,t);let n=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){let r=a0(i);if(!r)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);n.push(Ho(r))}else if(i===null||KT.has(typeof i))n.push(li(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),yA=R("$ZodFunction",(e,t)=>(Ce.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...i){let r=e._def.input?cv(e._def.input,i):i,o=Reflect.apply(n,this,r);return e._def.output?cv(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...i){let r=e._def.input?await lv(e._def.input,i):i,o=await Reflect.apply(n,this,r);return e._def.output?await lv(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let i=e.constructor;return Array.isArray(n[0])?new i({type:"function",input:new jv({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new i({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:n})},e)),bA=R("$ZodPromise",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},i))}),qm=R("$ZodLazy",(e,t)=>{Ce.init(e,t),qT(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),Ue(e,"pattern",n=>n.innerType?._zod?.pattern),Ue(e,"propValues",n=>n.innerType?._zod?.propValues),Ue(e,"optin",n=>n.innerType?._zod?.optin??void 0),Ue(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,i)=>e._zod.innerType._zod.run(n,i)}),vA=R("$ZodCustom",(e,t)=>{ht.init(e,t),Ce.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{let i=n.value,r=t.fn(i);if(r instanceof Promise)return r.then(o=>sV(o,n,i,e));sV(r,n,i,e)}});function sV(e,t,n,i){if(!e){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),t.issues.push(Nu(r))}}function aV(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues))}var wA=R("$ZodProperties",(e,t)=>{Ce.init(e,t),ht.init(e,t);let n=hn.memoizer;n?.attach(e);let i,r=(o,s)=>{i??(i=Reflect.ownKeys(t.shape).map(l=>[l,t.shape[l]]));let a=o.value,c;for(let[l,u]of i){let d=u._zod.run({value:a[l],issues:[]},s);d instanceof Promise?(c??(c=[]),c.push(d.then(p=>aV(p,o,l)))):aV(d,o,l)}if(c)return Promise.all(c).then(()=>{})};e._zod.parse=(o,s)=>{let a=o.value;if(a===null||typeof a!="object"&&typeof a!="function")return o.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),o;s.direction==="backward"&&(s={...s,direction:"forward"}),n&&n.alloc(e,o,a,s);let c=r(o,s);return c instanceof Promise?c.then(()=>o):o},e._zod.check=o=>{if(o.value==null){o.issues.push({expected:"object",code:"invalid_type",input:o.value,inst:e});return}return r(o,{})}},{*[Symbol.iterator](){yield this}});var Wv=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},$A="~memo",mV=[];function gV(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function kA(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var hV=new WeakMap,Fu=0,qv=1,Wm=2;function Hm(e,t,n){let i=hV.get(e);if(i!==void 0)return i?Wm:Fu;if(t.has(e))return Wm;t.add(e);let r=Fu,o=u=>{if(r!==Wm&&u?._zod){let d=Hm(u,t,n);d>r&&(r=d)}},s=(u,d)=>{let p=Fu;for(let f of Reflect.ownKeys(u)){let m=Object.getOwnPropertyDescriptor(u,f);if(d&&!m.enumerable)continue;let g=m.get?qv:m.value?._zod?Hm(m.value,t,n):Fu;g>p&&(p=g)}return p},a=u=>{u>r&&(r=u)},c=e._zod.def,l=c.type;switch(l){case"object":{let u=Ru(c);a(u?s(u,!0):qv),o(c.catchall);break}case"properties":a(s(c.shape,!1));break;case"array":o(c.element);break;case"tuple":for(let u of c.items)o(u);o(c.rest);break;case"record":case"map":o(c.keyType),o(c.valueType);break;case"set":o(c.valueType);break;case"union":for(let u of c.options)o(u);break;case"intersection":o(c.left),o(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(c.innerType);break;case"pipe":o(c.in),o(c.out);break;case"function":o(c.input),o(c.output);break;case"lazy":{let u=c._cachedInner??(n?e._zod.innerType:void 0);a(u?Hm(u,t,!1):qv);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in c){let d=Object.getOwnPropertyDescriptor(c,u);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)o(p);else if(Array.isArray(p))for(let f of p)o(f)}}}return t.delete(e),Hue(e,r)}function Hue(e,t){return t!==qv&&hV.set(e,t===Wm),t}function Hv(e){return Hm(e,new Set,!0)!==Fu}function Kue(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Vv,Bv=[],Jue={alloc(e,t,n){let i=Vv;if(!i)return n;Vv=void 0;let r={value:n,issues:null};return i.set(t.value,r),Bv.push(r),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,i=(r,o)=>{if(o.direction!=="backward"&&Kv(o,r.value))throw new Wv;return n(r,o)};e._zod.parse=i,e._zod.run===n&&(e._zod.run=i)})},attach(e){var t;let n,i=!1,r,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,l)=>{if(n===void 0){let b=Hm(e,new Set,!1);if(b===Fu)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,l);b===Wm||i?n=!0:i=!0}let u=c.value;if(!gV(u))return s(c,l);let d=l[$A];d||(d={buckets:new WeakMap,backEdges:void 0},l[$A]=d);let p;r===l?p=o:(p=Kue(d,e),r=l,o=p);let f=p.get(u);if(f)return c.value=f.value,f.issues?f.issues.length&&c.issues.push(...kA(f.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),c;Vv=p;let m=Bv.length,g=s(c,l);Vv=void 0;let h=Bv.length>m?Bv.pop():void 0;return g instanceof Promise?g.then(b=>(h&&(h.issues=b.issues.length?kA(b.issues):mV),b)):(h&&(h.issues=g.issues.length?kA(g.issues):mV),g)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a)})}};function Km(){return Jue}function Kv(e,t){let n=e[$A]?.backEdges;return n!==void 0&&gV(t)&&n.has(t)}var Zm={};_r(Zm,{ar:()=>yV,az:()=>bV,be:()=>wV,bg:()=>kV,bn:()=>$V,ca:()=>_V,ckb:()=>SV,cs:()=>xV,da:()=>EV,de:()=>TV,el:()=>IV,en:()=>Jv,eo:()=>AV,es:()=>RV,fa:()=>NV,fi:()=>CV,fr:()=>PV,frCA:()=>DV,gu:()=>OV,he:()=>MV,hi:()=>LV,hr:()=>FV,hu:()=>UV,hy:()=>zV,id:()=>GV,is:()=>VV,it:()=>BV,ja:()=>qV,ka:()=>WV,kh:()=>HV,km:()=>Zv,kn:()=>KV,ko:()=>JV,lt:()=>YV,mk:()=>QV,ms:()=>XV,ne:()=>eB,nl:()=>tB,nn:()=>nB,no:()=>rB,ota:()=>iB,pl:()=>sB,ps:()=>oB,pt:()=>aB,ptBR:()=>cB,ro:()=>lB,ru:()=>dB,sk:()=>pB,sl:()=>fB,sv:()=>mB,ta:()=>gB,tg:()=>hB,th:()=>yB,tk:()=>bB,tr:()=>vB,ua:()=>wB,uk:()=>Yv,ur:()=>kB,uz:()=>$B,vi:()=>_B,yo:()=>EB,zhCN:()=>SB,zhTW:()=>xB});var Zue=()=>{let e={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"},map:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n={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",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",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",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",iban:"IBAN",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 r.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 ${V(r.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: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.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 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.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 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;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 "${r.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}`:`${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${C(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.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 ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function yV(){return{localeError:Zue()}}var Yue=()=>{let e={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"},map:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={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",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${V(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function bV(){return{localeError:Yue()}}function vV(e,t,n,i){let r=Math.abs(e),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?n:i}var Que=()=>{let e={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"},map:{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 t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.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 r.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 ${V(r.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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=vV(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 ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.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 ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=vV(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 ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.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 ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.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 ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function wV(){return{localeError:Que()}}var Xue=()=>{let e={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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.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 r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${V(r.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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.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 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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} ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.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 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function kV(){return{localeError:Xue()}}var ede=()=>{let e={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function t(r){return e[r]??null}let n={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",iban:"IBAN",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${o}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${a}`}case"invalid_value":return r.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${V(r.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${C(r.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} ${s.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${o.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${r.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${r.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}};function $V(){return{localeError:ede()}}var tde=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n={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",mac:"adre\xE7a MAC",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",credit_card:"n\xFAmero de targeta de cr\xE8dit",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${V(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${C(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",s=t(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function _V(){return{localeError:tde()}}var nde=()=>{let e={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function t(r){return e[r]??null}let n={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",iban:"IBAN",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},i={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s,c=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(u=>a.endsWith(u))?"\u06CC\u06D5":"\u06D5",l=/^[a-zA-Z]+$/.test(a);return s==="null"||s==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${o} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${a}${l?"":c}`}case"invalid_value":return r.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${V(r.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${C(r.values,"|")}`;case"too_big":{let o=t(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let o=t(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${o.prefix}"`:o.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${o.suffix}"`:o.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${o.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:o.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${o.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${n[o.format]??r.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${r.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${C(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${r.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}};function SV(){return{localeError:nde()}}var rde=()=>{let e={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"},map:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"\u010D\xEDslo kreditn\xED karty",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${V(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${C(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function xV(){return{localeError:rde()}}var ide=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let n={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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${V(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}};function EV(){return{localeError:ide()}}var ode=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n={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",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${V(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;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: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function TV(){return{localeError:ode()}}var sde=()=>{let e={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 t(r){return e[r]??null}let n={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",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",iban:"IBAN",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return typeof r.expected=="string"&&/^[A-Z]/.test(r.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 ${r.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 r.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 ${V(r.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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.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 ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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: ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.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 ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function IV(){return{localeError:sde()}}var ade=()=>{let e={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 t(o){return e[o]??null}let n={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",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};function r(o,s){return o==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):i[o]??o}return o=>{switch(o.code){case"invalid_type":{let s=r(o.expected),a=H(o.input),c=r(a,o.input);return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${V(o.values[0])}`:`Invalid option: expected one of ${C(o.values,"|")}`;case"too_big":{let s=o.exact?"exactly ":o.inclusive?"<=":"<",a=t(o.origin);return a?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.exact?"exactly ":o.inclusive?">=":">",a=t(o.origin);return a?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${a.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${C(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(a=>`'${a}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Jv(){return{localeError:ade()}}var cde=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let n={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",mac:"MAC-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",credit_card:"kreditkarta numero",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${V(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function AV(){return{localeError:cde()}}var lde=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n={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",mac:"direcci\xF3n MAC",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",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${V(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}};function RV(){return{localeError:lde()}}var ude=()=>{let e={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"},map:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.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 r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${V(r.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 ${C(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;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`:`${n[o.format]??r.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 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${C(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.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 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function NV(){return{localeError:ude()}}var dde=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n={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",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${V(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${C(r.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 CV(){return{localeError:dde()}}var pde=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"expression r\xE9guli\xE8re",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",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne de caract\xE8res",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:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instance de ${r.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${V(r.values[0])} attendu`:`Option invalide : une valeur parmi ${C(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Trop grand : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Trop petit : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne de caract\xE8res invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne de caract\xE8res invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${C(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function PV(){return{localeError:pde()}}var fde=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"},map:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={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",mac:"adresse MAC",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",credit_card:"num\xE9ro de carte de cr\xE9dit",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${V(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",s=t(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",s=t(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${C(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function DV(){return{localeError:fde()}}var mde=()=>{let e={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function t(r){return e[r]??null}let n={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",iban:"IBAN",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${o}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${a}`}case"invalid_value":return r.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${V(r.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${C(r.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} ${s.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${o.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${r.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${r.keys.length>1?"\u0A93":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}};function OV(){return{localeError:mde()}}var gde=()=>{let e={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"}},t={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"}},n=l=>l?e[l]:void 0,i=l=>{let u=n(l);return u?u.label:l??e.unknown.label},r=l=>`\u05D4${i(l)}`,o=l=>(n(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?t[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"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",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"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",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"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",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??""]??i(u),p=H(l.input),f=c[p]??e[p]?.label??p;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 ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}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 ${V(l.values[0])}`;let u=l.values.map(f=>V(f));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=r(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",g=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 ${g}`.trim()}let p=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=r(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 h=(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 ${h}`}let g=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 ${g}`.trim()}let p=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${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],p=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \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"}: ${C(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${r(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function MV(){return{localeError:gde()}}var hde=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function t(r){return e[r]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${V(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${o}${r.maximum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum} \u0939\u094B`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} \u092E\u0947\u0902 ${o}${r.minimum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} ${o}${r.minimum} \u0939\u094B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${o.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${o.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${r.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${r.keys.length>1?"\u092F\u093E\u0901":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${r.origin} \u092E\u0947\u0902`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function LV(){return{localeError:hde()}}var yde=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(r){return e[r]??null}let n={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",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",iban:"IBAN",jwt:"JWT",template_literal:"unos"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${V(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${r.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${r.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${C(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function FV(){return{localeError:yde()}}var bde=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"hitelk\xE1rtyasz\xE1m",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${V(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function UV(){return{localeError:bde()}}function jV(e,t,n){return Math.abs(e)===1?t:n}function Uu(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}var vde=()=>{let e={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"},map:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",iban:"IBAN",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 r.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 ${V(r.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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=jV(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 ${Uu(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.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 ${Uu(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=jV(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 ${Uu(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.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 ${Uu(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.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 ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${C(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Uu(r.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 ${Uu(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function zV(){return{localeError:vde()}}var wde=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n={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",mac:"alamat MAC",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",credit_card:"nomor kartu kredit",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${V(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function GV(){return{localeError:wde()}}var kde=()=>{let e={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"},map:{unit:"hluti",verb:"a\xF0 hafa"}};function t(r){return e[r]??null}let n={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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${V(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${C(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}};function VV(){return{localeError:kde()}}var $de=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n={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",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${V(r.values[0])}`:`Opzione non valida: atteso uno tra ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${C(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function BV(){return{localeError:$de()}}var _de=()=>{let e={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"},map:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n={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",mac:"MAC\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",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",iban:"IBAN",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.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 r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${V(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${C(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;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${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.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${r.keys.length>1?"\u7FA4":""}: ${C(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function qV(){return{localeError:_de()}}var Sde=()=>{let e={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"},map:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",iban:"IBAN",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 r.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 ${V(r.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 ${C(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.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 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${r.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 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.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 ${r.origin} ${s.verb} ${o}${r.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 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.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 ${r.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${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.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 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function WV(){return{localeError:Sde()}}var xde=()=>{let e={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"},map:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n={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",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",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",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",iban:"IBAN",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 r.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 ${V(r.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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${C(r.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 ${r.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 ${r.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 Zv(){return{localeError:xde()}}function HV(){return Zv()}var Ede=()=>{let e={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function t(r){return e[r]??null}let n={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",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 \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",iban:"IBAN",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${o}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${a}`}case"invalid_value":return r.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${V(r.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.maximum.toString()} ${s.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.minimum.toString()} ${s.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${o.prefix}"`:o.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${o.suffix}"`:o.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${o.includes}"`:o.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${o.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${r.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${r.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}};function KV(){return{localeError:Ede()}}var Tde=()=>{let e={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"},map:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",iban:"IBAN",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.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 r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${V(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${C(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${c} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${s}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${c} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${C(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function JV(){return{localeError:Tde()}}var Jm=e=>e.charAt(0).toUpperCase()+e.slice(1);function ZV(e){let t=Math.abs(e),n=t%10,i=t%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}var Ide=()=>{let e={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 t(r,o,s,a){let c=e[r]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let n={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",mac:"MAC 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",credit_card:"kredito kortel\u0117s numeris",iban:"IBAN",jwt:"JWT",template_literal:"\u012Fvestis"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${V(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${C(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=t(r.origin,ZV(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${Jm(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Jm(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,s=t(r.origin,ZV(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${Jm(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Jm(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${C(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${Jm(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function YV(){return{localeError:Ide()}}var Ade=()=>{let e={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"},map:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.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 r.values.length===1?`Invalid input: expected ${V(r.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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.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 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.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 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`${r.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"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.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 ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function QV(){return{localeError:Ade()}}var Rde=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n={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",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${V(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${C(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function XV(){return{localeError:Rde()}}var Nde=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function t(r){return e[r]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${V(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} \u092E\u093E ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} \u092E\u093E ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} ${o}${r.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${o.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${r.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${r.keys.length>1?"\u0939\u0930\u0942":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${r.origin} \u092E\u093E`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function eB(){return{localeError:Nde()}}var Cde=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let n={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",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${V(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;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: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function tB(){return{localeError:Cde()}}var Pde=()=>{let e={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};function t(r){return e[r]??null}let n={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-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tal",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventa instanceof ${r.expected}, fekk ${a}`:`Ugyldig input: forventa ${o}, fekk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventa ${V(r.values[0])}`:`Ugyldig val: forventa eitt av ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 slutte med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tal: m\xE5 vere eit multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function nB(){return{localeError:Pde()}}var Dde=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"},map:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n={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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${V(r.values[0])}`:`Ugyldig valg: forventet en av ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function rB(){return{localeError:Dde()}}var Ode=()=>{let e={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"},map:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",iban:"IBAN",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${V(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function iB(){return{localeError:Ode()}}var Mde=()=>{let e={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"},map:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n={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",mac:"\u062F MAC \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",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.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 r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${V(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${C(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;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`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.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 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function oB(){return{localeError:Mde()}}var Lde=()=>{let e={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"},map:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n={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",mac:"adres MAC",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",credit_card:"numer karty kredytowej",iban:"IBAN",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${V(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function sB(){return{localeError:Lde()}}var Fde=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tuplo",articles:i.masculine},record:{name:"registo",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"ficheiro",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,a){let c=r[s]??{name:`valor "${s}"`,articles:i.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=H(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${V(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${C(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Demasiado grande: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Demasiado pequeno: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${C(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function aB(){return{localeError:Fde()}}var Ude=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tupla",articles:i.feminine},record:{name:"registro",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"arquivo",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,a){let c=r[s]??{name:`valor "${s}"`,articles:i.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=H(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${V(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${C(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Grande demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Pequeno demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${C(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function cB(){return{localeError:Ude()}}var jde=()=>{let e={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 t(r){return e[r]??null}let n={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",credit_card:"num\u0103r de card de credit",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${V(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Prea mic: a\u0219teptat ca ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${C(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}};function lB(){return{localeError:jde()}}function uB(e,t,n,i){let r=Math.abs(e),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?n:i}var zde=()=>{let e={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"},map:{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 t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.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 r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${V(r.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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=uB(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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=uB(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 ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.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 ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.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 ${r.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 dB(){return{localeError:zde()}}var Gde=()=>{let e={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function t(r){return e[r]??null}let n={regex:"regul\xE1rny 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:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${r.expected}, obdr\u017Ean\xE9 ${a}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${o}, obdr\u017Ean\xE9 ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${V(r.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.maximum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.minimum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${o.includes}"`:o.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${C(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function pB(){return{localeError:Gde()}}var Vde=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n={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",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${V(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${C(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function fB(){return{localeError:Vde()}}var Bde=()=>{let e={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"},map:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n={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-adress",ipv6:"IPv6-adress",mac:"MAC-adress",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",credit_card:"kreditkortsnummer",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${V(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function mB(){return{localeError:Bde()}}var qde=()=>{let e={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"},map:{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 t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 r.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 ${V(r.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 ${C(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.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 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.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 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.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 ${r.origin} ${o}${r.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 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.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${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.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`${r.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 gB(){return{localeError:qde()}}var Wde=()=>{let e={string:{unit:"\u0430\u043B\u043E\u043C\u0430\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},file:{unit:"\u0431\u0430\u0439\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},array:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},set:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},map:{unit:"\u0441\u0430\u0431\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0443\u0440\u0443\u0434",email:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",url:"URL",emoji:"\u044D\u043C\u043E\u04B7\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",date:"\u0441\u0430\u043D\u0430\u0438 ISO",time:"\u0432\u0430\u049B\u0442\u0438 ISO",duration:"\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",ipv4:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",ipv6:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",mac:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",cidrv4:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",cidrv6:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",base64:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",base64url:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",json_string:"\u0441\u0430\u0442\u0440\u0438 JSON",e164:"\u0440\u0430\u049B\u0430\u043C\u0438 E.164",credit_card:"\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0443\u0440\u0443\u0434"},i={nan:"NaN",number:"\u0440\u0430\u049B\u0430\u043C",string:"\u0441\u0430\u0442\u0440",array:"\u043C\u0430\u0441\u0441\u0438\u0432",object:"\u043E\u0431\u044A\u0435\u043A\u0442",date:"\u0441\u0430\u043D\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${o} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${a} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`}case"invalid_value":return r.values.length===1?`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${V(r.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:`\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${C(r.values,"|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${r.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${r.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${r.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${r.origin} \u0431\u043E\u044F\u0434 ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${r.origin} \u0431\u043E\u044F\u0434 ${o}${r.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`:o.format==="ends_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`:o.format==="includes"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${o.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`:o.format==="regex"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${o.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`:`${n[o.format]??r.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`}case"not_multiple_of":return`\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${r.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;case"unrecognized_keys":return`\u041A\u0430\u043B\u0438\u0434${r.keys.length>1?"\u04B3\u043E\u0438":"\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${C(r.keys,", ")}`;case"invalid_key":return`\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${r.options.map(s=>`'${s}'`).join(" | ")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";case"invalid_element":return`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${r.origin}`;default:return"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442"}}};function hB(){return{localeError:Wde()}}var Hde=()=>{let e={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"},map:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n={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",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",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)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",iban:"IBAN",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${V(r.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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;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: ${n[o.format]??r.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 ${r.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: ${C(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.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 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function yB(){return{localeError:Hde()}}var Kde=()=>{let e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function t(r){return e[r]??null}let n={regex:"giri\u015F",email:"e-po\xE7ta salgysy",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 sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",iban:"IBAN",jwt:"JWT",template_literal:"\u015Fablon"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`N\xE4dogry baha: gara\u015Fylan ${o} \xFDerine ${a} alyndy`}case"invalid_value":return r.values.length===1?`N\xE4dogry baha: ${V(r.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()} ${s.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`N\xE4dogry setir: "${o.prefix}" bilen ba\u015Flamaly`:o.format==="ends_with"?`N\xE4dogry setir: "${o.suffix}" bilen gutarmaly`:o.format==="includes"?`N\xE4dogry setir: "${o.includes}" saklamaly`:o.format==="regex"?`N\xE4dogry setir: ${o.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xE4dogry san: ${r.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${r.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}};function bB(){return{localeError:Kde()}}var Jde=()=>{let e={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"},map:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"kredi kart\u0131 numaras\u0131",iban:"IBAN",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${V(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function vB(){return{localeError:Jde()}}var Zde=()=>{let e={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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n={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",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 r.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 ${V(r.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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${r.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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.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 ${r.origin} ${s.verb} ${o}${r.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 ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.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 ${r.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 Yv(){return{localeError:Zde()}}function wB(){return Yv()}var Yde=()=>{let e={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"},map:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n={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",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \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",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",iban:"IBAN",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.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 r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${V(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${C(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.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: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.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${r.keys.length>1?"\u0632":""}: ${C(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function kB(){return{localeError:Yde()}}var Qde=()=>{let e={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 t(r){return e[r]??null}let n={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",credit_card:"kredit karta raqami",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${V(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function $B(){return{localeError:Qde()}}var Xde=()=>{let e={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"},map:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n={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",mac:"\u0111\u1ECBa ch\u1EC9 MAC",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",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",iban:"IBAN",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.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 r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${V(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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}`:`${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${C(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.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 ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function _B(){return{localeError:Xde()}}var epe=()=>{let e={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"},map:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n={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",mac:"MAC\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",credit_card:"\u4FE1\u7528\u5361\u53F7",iban:"IBAN",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.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 r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${V(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function SB(){return{localeError:epe()}}var tpe=()=>{let e={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"},map:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u4FE1\u7528\u5361\u865F",iban:"IBAN",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.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 r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${V(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;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 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${C(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function xB(){return{localeError:tpe()}}var npe=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"},map:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}let n={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",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",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",credit_card:"n\u1ECDmba kaadi gbese",iban:"IBAN",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.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 r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${V(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${o}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${o}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;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: ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${C(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.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 ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function EB(){return{localeError:npe()}}var TB,_A=Symbol("ZodOutput"),SA=Symbol("ZodInput"),Qv=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Xv(){return new Qv}(TB=globalThis).__zod_globalRegistry??(TB.__zod_globalRegistry=Xv());var Dn=globalThis.__zod_globalRegistry;var sr=Symbol.for("zod.compile.invalid"),IB=Symbol.for("zod.compile.fallback"),Ui=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},Ve=class extends Error{constructor(t,n=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n}};function ipe(e,t){try{return tw(e,{assertOnly:!0})}catch{return t}}function IA(e,t){try{let n=tw(e),i=ew(e,n);return i._zod.bag.validator=ipe(e,n),i}catch(n){if(t?.strict)throw n;return e}}function ew(e,t){if(Hv(e))throw new Ve("a schema whose subtree contains a reference cycle");let n=ot(e),i=e._zod.run,r=i.__originalRun??i,o=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[IB]||a&&Kv(a,s.value))return r(s,a);let c=t(s.value);return c!==sr?(s.value=c,s):(a&&(a[IB]=!0),r(s,a))};return o.__originalRun=r,n._zod.bag.fallbackRun=r,n._zod.bag.validator=t,n._zod.run=o,i.__originalRun||ope(n,e,t),n}function ope(e,t,n){let i=e,r=t;if(typeof r.safeParse=="function"){let o=r.safeParse;i.safeParse=(s,a)=>{let c=n(s);return c!==sr?{success:!0,data:c}:o(s,a)}}if(typeof r.parse=="function"){let o=r.parse;i.parse=(s,a)=>{let c=n(s);return c!==sr?c:o(s,a)}}}function tw(e,t){let n=!0;try{n=Hv(e)}catch{}if(n)throw new Ve("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0,definite:!0},r=new wc(["input"]),o=Rt(r,i,e,"input",!t?.assertOnly);r.write(o===null?"return true;":`return ${o};`);let s=["INVALID",...i.constants.keys()],a=[sr,...i.constants.values()],c=r.content.join(` + `)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},s,a=oc,c=!gn.jitless,u=c&&VI.value,d=t.catchall,p;e._zod.parse=(f,m)=>{p??(p=r.value);let g=f.value;return a(g)?c&&u&&m?.async===!1&&m.jitless!==!0?(s||(s=o(t.shape)),f=s(f,m),d?nq([],g,f,m,p,e,m?.abortEarly===!0):f):n(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f)}});function jV(e,t,n,r){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let i=e.filter(o=>!ir(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(s=>Sr(s,r,Gt())))}),t)}var sg=C("$ZodUnion",(e,t)=>{Ne.init(e,t),je(e,"optin",r=>r.def.options.some(i=>i._zod.optin==="defaulted")?"defaulted":r.def.options.some(i=>i._zod.optin!==void 0)?"optional":void 0),je(e,"optout",r=>r.def.options.some(i=>i._zod.optout==="optional")?"optional":void 0),je(e,"values",r=>{if(r.def.options.every(i=>i._zod.values))return new Set(r.def.options.flatMap(i=>Array.from(i._zod.values)))}),je(e,"pattern",r=>{if(r.def.options.every(i=>i._zod.pattern)){let i=r.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Ko(o.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:r.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=>jV(a,r,e,i)):jV(s,r,e,i)}});function UV(e,t,n,r){let i=[];for(let o=0;oo.issues.map(s=>Sr(s,r,Gt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:i}),t)}var W0=C("$ZodXor",(e,t)=>{sg.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:r.value,issues:[]},i);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>UV(a,r,e,i)):UV(s,r,e,i)}});function H0(e,t){let n=e._zod,r=n.bag.optionsMap;r||(r=iq(n.def),n.bag.optionsMap=r);let i=r.get(t);if(i===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return i}function iq(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let i of r)if(t.has(i)){if(i!==void 0)throw new Error(`Duplicate discriminator value "${String(i)}"`);t.set(i,null)}else t.set(i,n)}return t}var K0=C("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,sg.init(e,t);let n=e._zod.parse;je(e,"propValues",i=>{let o={},s=0;for(let a of i.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${i.def.options.indexOf(a)}"`);c[i.def.discriminator]?.has(void 0)&&s++;for(let[l,u]of Object.entries(c)){Object.prototype.hasOwnProperty.call(o,l)||$n(o,l,new Set);for(let d of u)o[l].add(d)}}return!i.def.unionFallback&&s>1&&o[i.def.discriminator]?.delete(void 0),o}),t.options.forEach((i,o)=>{let s=pu(i._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let r=du(()=>iq(t));e._zod.parse=(i,o)=>{let s=i.value;if(!oc(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let a=s?.[t.discriminator],c=r.value.get(a);return c&&(a!==void 0||o.direction!=="backward")?c._zod.run(i,o):t.unionFallback||o.direction==="backward"?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(l=>r.value.get(l)!==null),input:s,path:[t.discriminator],inst:e}),i)}}),J0=C("$ZodIntersection",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{let i=n.value,o=t.left._zod.run({value:i,issues:[]},r),s=t.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>zV(n,c,l)):zV(n,o,s)}});function vu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ai(e)&&ai(t)){let n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__;for(let o of r){if(o==="__proto__")continue;let s=vu(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};i[o]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{let d;if(l.code==="unrecognized_keys"&&!l.path?.length)i??(i=l),d=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let p=String(l.path[0]);o.has(p)||o.set(p,l),d=[p]}else return!1;for(let p of d)r.has(p)||r.set(p,{}),r.get(p)[u]=!0;return!0};for(let l of t.issues)s(l,"l")||e.issues.push(l);for(let l of n.issues)s(l,"r")||e.issues.push(l);let a=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(a.length){let l=i?a.filter(u=>i.keys.includes(u)):[];l.length&&e.issues.push({...i,keys:l});for(let u of a)!l.includes(u)&&o.has(u)&&e.issues.push(o.get(u))}let c=vu(t.value,n.value);if(!c.valid){if(ir(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var aw=C("$ZodTuple",(e,t)=>{Ne.init(e,t);let n=t.items,r=gn.memoizer;r?.attach(e),e._zod.parse=(i,o)=>{let s=i.value;if(!Array.isArray(s))return i.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=r?r.alloc(e,i,[],o):[];let a=[],c=GV(n,"optin"),l=GV(n,"optout");if(!t.rest){if(s.lengthn.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:s,inst:e,origin:"array"})}let u=new Array(n.length),d=t.rest?o?.abortEarly:void 0,p=!1;for(let f=0;f{u[f]=g})):(u[f]=m,d&&!p&&m.issues.length&&(p=ir(m)))}if(t.rest&&!p){let f=n.length-1,m=s.slice(n.length),g=i.issues.length;for(let h of m){if(d&&i.issues.length!==g){if(ir(i,g))break;g=i.issues.length}f++;let v=t.rest._zod.run({value:h,issues:[]},o);v instanceof Promise?a.push(v.then(b=>BV(b,i,f))):BV(v,i,f)}}return a.length?Promise.all(a).then(()=>VV(u,i,n,s,l)):VV(u,i,n,s,l)}});function GV(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function BV(e,t,n){e.issues.length&&t.issues.push(...or(n,e.issues)),t.value[n]=e.value}function VV(e,t,n,r,i){for(let o=0;o=i&&n[o]._zod.optin==="optional"){t.value.length=o;break}if(s.issues.length){if(!a&&o>=i){t.value.length=o;break}t.issues.push(...or(o,s.issues))}t.value[o]=s.value}for(let o=t.value.length-1;o>=r.length&&(n[o]._zod.optout==="optional"&&t.value[o]===void 0);o--)t.value.length=o;return t}var Z0=C("$ZodRecord",(e,t)=>{Ne.init(e,t);let n=gn.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!ai(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(c.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Sr(m,i,Gt())),input:u,path:[u],inst:e});continue}let p=d.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[u],issues:[]},i);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&r.issues.push(...or(u,m.issues)),r.value[p]=m.value})):(f.issues.length&&r.issues.push(...or(u,f.issues)),r.value[p]=f.value)}let l;for(let u in o)if(!c.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;r.value[u]=o[u]}else l=l??[],l.push(u);l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let u=t.keyType._zod.run({value:l,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Jo.test(l)&&u.issues.length){let m=t.keyType._zod.run({value:Number(l),issues:[]},i);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(u=m)}if(u.issues.length){t.mode==="loose"?r.value[l]=o[l]:a?(c=c??[],c.push(l)):r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>Sr(m,i,Gt())),input:l,path:[l],inst:e});continue}let p=u.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[l],issues:[]},i);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&r.issues.push(...or(l,m.issues)),r.value[p]=m.value})):(f.issues.length&&r.issues.push(...or(l,f.issues)),r.value[p]=f.value)}c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c,continue:!0})}return s.length?Promise.all(s).then(()=>r):r}}),Y0=C("$ZodMap",(e,t)=>{Ne.init(e,t);let n=gn.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),r;let s=[];r.value=n?n.alloc(e,r,new Map,i):new Map;let a=i?.abortEarly,c=r.issues.length;for(let[l,u]of o){if(a&&r.issues.length!==c){if(ir(r,c))break;c=r.issues.length}let d=t.keyType._zod.run({value:l,issues:[]},i),p=t.valueType._zod.run({value:u,issues:[]},i);d instanceof Promise||p instanceof Promise?s.push(Promise.all([d,p]).then(([f,m])=>{qV(f,m,r,l,o,e,i)})):qV(d,p,r,l,o,e,i)}return s.length?Promise.all(s).then(()=>r):r}});function qV(e,t,n,r,i,o,s){e.issues.length&&(Vm.has(typeof r)?n.issues.push(...or(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(a=>Sr(a,s,Gt()))})),t.issues.length&&(Vm.has(typeof r)?n.issues.push(...or(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(a=>Sr(a,s,Gt()))})),n.value.set(e.value,t.value)}var Q0=C("$ZodSet",(e,t)=>{Ne.init(e,t);let n=gn.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),r;let s=[];r.value=n?n.alloc(e,r,new Set,i):new Set;let a=i?.abortEarly,c=r.issues.length;for(let l of o){if(a&&r.issues.length!==c){if(ir(r,c))break;c=r.issues.length}let u=t.valueType._zod.run({value:l,issues:[]},i);u instanceof Promise?s.push(u.then(d=>WV(d,r))):WV(u,r)}return s.length?Promise.all(s).then(()=>r):r}});function WV(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var X0=C("$ZodEnum",(e,t)=>{Ne.init(e,t);let n=lu(t.entries),r=new Set(n);e._zod.values=r,je(e,"pattern",i=>{let o=lu(i.def.entries).filter(s=>Vm.has(typeof s));return new RegExp(o.length?`^(${o.map(s=>ci(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(i,o)=>{let s=i.value;return r.has(s)||i.issues.push({code:"invalid_value",values:n,input:s,inst:e}),i}}),eR=C("$ZodLiteral",(e,t)=>{Ne.init(e,t);let n=new Set(t.values);e._zod.values=n,je(e,"pattern",r=>{let i=r.def.values;return new RegExp(i.length?`^(${i.map(o=>typeof o=="string"?ci(o):o?ci(o.toString()):String(o)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,i)=>{let o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),tR=C("$ZodFile",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;return i instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),n}}),nR=C("$ZodTransform",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",gn.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ls(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(n.value=s,n));if(i instanceof Promise)throw new xr;return n.value=i,n}});function HV(e,t){return e.value=t.issues.length?void 0:t.value,e}var cw=C("$ZodOptional",(e,t)=>{Ne.init(e,t),je(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",je(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),je(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Ko(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let i=t.innerType._zod.run({value:n.value,issues:[]},r);return i instanceof Promise?i.then(o=>HV(n,o)):HV(n,i)}return t.innerType._zod.run(n,r)}}),rR=C("$ZodExactOptional",(e,t)=>{cw.init(e,t),je(e,"values",n=>n.def.innerType._zod.values),je(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),iR=C("$ZodNullable",(e,t)=>{Ne.init(e,t),je(e,"optin",n=>n.def.innerType._zod.optin),je(e,"optout",n=>n.def.innerType._zod.optout),je(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Ko(r.source)}|null)$`):void 0}),je(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),oR=C("$ZodDefault",(e,t)=>{Ne.init(e,t),e._zod.optin="defaulted",je(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>KV(o,t)):KV(i,t)}});function KV(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var sR=C("$ZodPrefault",(e,t)=>{Ne.init(e,t),e._zod.optin="defaulted",je(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),aR=C("$ZodNonOptional",(e,t)=>{Ne.init(e,t),je(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>JV(o,e)):JV(i,e)}});function JV(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var cR=C("$ZodSuccess",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ls("ZodSuccess");let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>(n.value=o.issues.length===0,n)):(n.value=i.issues.length===0,n)}});function ZV(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(i=>Sr(i,r,Gt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var lR=C("$ZodCatch",(e,t)=>{Ne.init(e,t),je(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),je(e,"optout",n=>n.def.innerType._zod.optout),je(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let i=t.innerType._zod.run({value:n.value,issues:[]},r);return i instanceof Promise?i.then(o=>ZV(n,o,t,r)):ZV(n,i,t,r)}}),uR=C("$ZodNaN",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),lw=C("$ZodPipe",(e,t)=>{Ne.init(e,t),je(e,"values",n=>n.def.in._zod.values),je(e,"optin",n=>n.def.in._zod.optin),je(e,"optout",n=>n.def.out._zod.optout),je(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){let o=t.out._zod.run(n,r);return o instanceof Promise?o.then(s=>Vv(s,t.in,r)):Vv(o,t.in,r)}let i=t.in._zod.run(n,r);return i instanceof Promise?i.then(o=>Vv(o,t.out,r)):Vv(i,t.out,r)}});function Vv(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var ag=C("$ZodCodec",(e,t)=>{Ne.init(e,t),je(e,"values",n=>n.def.in._zod.values),je(e,"optin",n=>n.def.in._zod.optin),je(e,"optout",n=>n.def.out._zod.optout),je(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){let o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>qv(s,t,r)):qv(o,t,r)}else{let o=t.out._zod.run(n,r);return o instanceof Promise?o.then(s=>qv(s,t,r)):qv(o,t,r)}}});function qv(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let i=t.transform(e.value,e);return i instanceof Promise?i.then(o=>Wv(e,o,t.out,n)):Wv(e,i,t.out,n)}else{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(o=>Wv(e,o,t.in,n)):Wv(e,i,t.in,n)}}function Wv(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var dR=C("$ZodPreprocess",(e,t)=>{lw.init(e,t)}),pR=C("$ZodReadonly",(e,t)=>{Ne.init(e,t),je(e,"propValues",n=>n.def.innerType._zod.propValues),je(e,"values",n=>n.def.innerType._zod.values),je(e,"optin",n=>n.def.innerType?._zod?.optin),je(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(YV):YV(i)}});function YV(e){return e.memo||(e.value=Object.freeze(e.value)),e}function Xpe(e){let t=e._zod.def,n=t.pattern,r=!!t.format?.includes("int"),i,o;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(n=c.pattern),r||(r=!!c.format?.includes("int"));let l=c.minimum??c.length,u=c.maximum??c.length;l!==void 0&&(i===void 0||l>i)&&(i=l),u!==void 0&&(o===void 0||uo)return"(?!)";if(i!==void 0||o!==void 0)return RA({minimum:i,maximum:o}).source;let s=e._zod.pattern;return(r&&s===Jo?Xm:s)?.source}function i0(e){let t=e._zod.def,n=e._zod.pattern?.source,r=t.innerType??e._zod.innerType;if(r){let i=r._zod.pattern?.source,o=i0(r);return n&&i&&o&&o!==i?n.replace(Ko(i),()=>Ko(o)):n}if(t.options){let i=t.options.map(i0);if(i.every(Boolean))return`^(${i.map(o=>Ko(o)).join("|")})$`}return Xpe(e)}var fR=C("$ZodTemplateLiteral",(e,t)=>{Ne.init(e,t);let n=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){let i=i0(r);if(!i)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);n.push(Ko(i))}else if(r===null||qI.has(typeof r))n.push(ci(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,i)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),mR=C("$ZodFunction",(e,t)=>(Ne.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...r){let i=e._def.input?Av(e._def.input,r):r,o=Reflect.apply(n,this,i);return e._def.output?Av(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...r){let i=e._def.input?await Rv(e._def.input,r):r,o=await Reflect.apply(n,this,i);return e._def.output?await Rv(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,r)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let r=e.constructor;return Array.isArray(n[0])?new r({type:"function",input:new aw({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new r({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let r=e.constructor;return new r({type:"function",input:e._def.input,output:n})},e)),gR=C("$ZodPromise",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(i=>t.innerType._zod.run({value:i,issues:[]},r))}),cg=C("$ZodLazy",(e,t)=>{Ne.init(e,t),GI(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),je(e,"pattern",n=>n.innerType?._zod?.pattern),je(e,"propValues",n=>n.innerType?._zod?.propValues),je(e,"optin",n=>n.innerType?._zod?.optin??void 0),je(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),hR=C("$ZodCustom",(e,t)=>{ht.init(e,t),Ne.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(o=>QV(o,n,r,e));QV(i,n,r,e)}});function QV(e,t,n,r){if(!e){let i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(fu(i))}}function XV(e,t,n){e.issues.length&&t.issues.push(...or(n,e.issues))}var yR=C("$ZodProperties",(e,t)=>{Ne.init(e,t),ht.init(e,t);let n=gn.memoizer;n?.attach(e);let r,i=(o,s)=>{r??(r=Reflect.ownKeys(t.shape).map(l=>[l,t.shape[l]]));let a=o.value,c;for(let[l,u]of r){let d=u._zod.run({value:a[l],issues:[]},s);d instanceof Promise?(c??(c=[]),c.push(d.then(p=>XV(p,o,l)))):XV(d,o,l)}if(c)return Promise.all(c).then(()=>{})};e._zod.parse=(o,s)=>{let a=o.value;if(a===null||typeof a!="object"&&typeof a!="function")return o.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),o;s.direction==="backward"&&(s={...s,direction:"forward"}),n&&n.alloc(e,o,a,s);let c=i(o,s);return c instanceof Promise?c.then(()=>o):o},e._zod.check=o=>{if(o.value==null){o.issues.push({expected:"object",code:"invalid_type",input:o.value,inst:e});return}return i(o,{})}},{*[Symbol.iterator](){yield this}});var fw=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},vR="~memo",sq=[];function aq(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function bR(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var cq=new WeakMap,wu=0,pw=1,lg=2;function ug(e,t,n){let r=cq.get(e);if(r!==void 0)return r?lg:wu;if(t.has(e))return lg;t.add(e);let i=wu,o=u=>{if(i!==lg&&u?._zod){let d=ug(u,t,n);d>i&&(i=d)}},s=(u,d)=>{let p=wu;for(let f of Reflect.ownKeys(u)){let m=Object.getOwnPropertyDescriptor(u,f);if(d&&!m.enumerable)continue;let g=m.get?pw:m.value?._zod?ug(m.value,t,n):wu;g>p&&(p=g)}return p},a=u=>{u>i&&(i=u)},c=e._zod.def,l=c.type;switch(l){case"object":{let u=pu(c);a(u?s(u,!0):pw),o(c.catchall);break}case"properties":a(s(c.shape,!1));break;case"array":o(c.element);break;case"tuple":for(let u of c.items)o(u);o(c.rest);break;case"record":case"map":o(c.keyType),o(c.valueType);break;case"set":o(c.valueType);break;case"union":for(let u of c.options)o(u);break;case"intersection":o(c.left),o(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(c.innerType);break;case"pipe":o(c.in),o(c.out);break;case"function":o(c.input),o(c.output);break;case"lazy":{let u=c._cachedInner??(n?e._zod.innerType:void 0);a(u?ug(u,t,!1):pw);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in c){let d=Object.getOwnPropertyDescriptor(c,u);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)o(p);else if(Array.isArray(p))for(let f of p)o(f)}}}return t.delete(e),efe(e,i)}function efe(e,t){return t!==pw&&cq.set(e,t===lg),t}function mw(e){return ug(e,new Set,!0)!==wu}function tfe(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var uw,dw=[],nfe={alloc(e,t,n){let r=uw;if(!r)return n;uw=void 0;let i={value:n,issues:null};return r.set(t.value,i),dw.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,r=(i,o)=>{if(o.direction!=="backward"&&gw(o,i.value))throw new fw;return n(i,o)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,i,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,l)=>{if(n===void 0){let v=ug(e,new Set,!1);if(v===wu)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,l);v===lg||r?n=!0:r=!0}let u=c.value;if(!aq(u))return s(c,l);let d=l[vR];d||(d={buckets:new WeakMap,backEdges:void 0},l[vR]=d);let p;i===l?p=o:(p=tfe(d,e),i=l,o=p);let f=p.get(u);if(f)return c.value=f.value,f.issues?f.issues.length&&c.issues.push(...bR(f.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),c;uw=p;let m=dw.length,g=s(c,l);uw=void 0;let h=dw.length>m?dw.pop():void 0;return g instanceof Promise?g.then(v=>(h&&(h.issues=v.issues.length?bR(v.issues):sq),v)):(h&&(h.issues=g.issues.length?bR(g.issues):sq),g)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a)})}};function dg(){return nfe}function gw(e,t){let n=e[vR]?.backEdges;return n!==void 0&&aq(t)&&n.has(t)}var fg={};kr(fg,{ar:()=>lq,az:()=>uq,be:()=>pq,bg:()=>fq,bn:()=>mq,ca:()=>gq,ckb:()=>hq,cs:()=>yq,da:()=>bq,de:()=>vq,el:()=>wq,en:()=>hw,eo:()=>kq,es:()=>_q,fa:()=>$q,fi:()=>Sq,fr:()=>xq,frCA:()=>Eq,gu:()=>Tq,he:()=>Iq,hi:()=>Aq,hr:()=>Rq,hu:()=>Pq,hy:()=>Nq,id:()=>Dq,is:()=>Oq,it:()=>Mq,ja:()=>Lq,ka:()=>Fq,kh:()=>jq,km:()=>yw,kn:()=>Uq,ko:()=>zq,lt:()=>Bq,mk:()=>Vq,ms:()=>qq,ne:()=>Wq,nl:()=>Hq,nn:()=>Kq,no:()=>Jq,ota:()=>Zq,pl:()=>Qq,ps:()=>Yq,pt:()=>Xq,ptBR:()=>e2,ro:()=>t2,ru:()=>r2,sk:()=>i2,sl:()=>o2,sv:()=>s2,ta:()=>a2,tg:()=>c2,th:()=>l2,tk:()=>u2,tr:()=>d2,ua:()=>p2,uk:()=>bw,ur:()=>f2,uz:()=>m2,vi:()=>g2,yo:()=>b2,zhCN:()=>h2,zhTW:()=>y2});var rfe=()=>{let e={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"},map:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(i){return e[i]??null}let n={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",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",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",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",iban:"IBAN",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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: ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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}`:`${n[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":""}: ${N(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 lq(){return{localeError:rfe()}}var ife=()=>{let e={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"},map:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(i){return e[i]??null}let n={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",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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":""}: ${N(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 uq(){return{localeError:ife()}}function dq(e,t,n,r){let i=Math.abs(e),o=i%10,s=i%100;return s>=11&&s<=19?r:o===1?t:o>=2&&o<=4?n:r}var ofe=()=>{let e={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"},map:{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 t(i){return e[i]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},r={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);if(s){let a=Number(i.maximum),c=dq(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=t(i.origin);if(s){let a=Number(i.minimum),c=dq(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 ${n[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"}: ${N(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 pq(){return{localeError:ofe()}}var sfe=()=>{let e={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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(i){return e[i]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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} ${n[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":""}: ${N(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 fq(){return{localeError:sfe()}}var afe=()=>{let e={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function t(i){return e[i]??null}let n={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",iban:"IBAN",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${o}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${a}`}case"invalid_value":return i.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${q(i.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${N(i.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${i.origin??"\u09AE\u09BE\u09A8"} ${o}${i.maximum.toString()} ${s.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${i.origin??"\u09AE\u09BE\u09A8"} ${o}${i.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${i.origin} ${o}${i.minimum.toString()} ${s.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${i.origin} ${o}${i.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${o.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${i.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${i.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${i.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}};function mq(){return{localeError:afe()}}var cfe=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function t(i){return e[i]??null}let n={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",mac:"adre\xE7a MAC",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",credit_card:"n\xFAmero de targeta de cr\xE8dit",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${N(i.values," o ")}`;case"too_big":{let o=i.inclusive?"com a m\xE0xim":"menys de",s=t(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=t(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 ${n[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":""}: ${N(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 gq(){return{localeError:cfe()}}var lfe=()=>{let e={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function t(i){return e[i]??null}let n={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",iban:"IBAN",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},r={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s,c=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(u=>a.endsWith(u))?"\u06CC\u06D5":"\u06D5",l=/^[a-zA-Z]+$/.test(a);return s==="null"||s==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${o} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${a}${l?"":c}`}case"invalid_value":return i.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${q(i.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${N(i.values,"|")}`;case"too_big":{let o=t(i.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${i.maximum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${i.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let o=t(i.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${i.minimum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${i.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${o.prefix}"`:o.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${o.suffix}"`:o.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${o.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:o.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${o.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${n[o.format]??i.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${i.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${N(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${i.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}};function hq(){return{localeError:lfe()}}var ufe=()=>{let e={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"},map:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(i){return e[i]??null}let n={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",mac:"MAC 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",credit_card:"\u010D\xEDslo kreditn\xED karty",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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: ${N(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 yq(){return{localeError:ufe()}}var dfe=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function t(i){return e[i]??null}let n={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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={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=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin),a=r[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=t(i.origin),a=r[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 ${n[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"}: ${N(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 bq(){return{localeError:dfe()}}var pfe=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function t(i){return e[i]??null}let n={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",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},r={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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: ${n[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"}: ${N(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 vq(){return{localeError:pfe()}}var ffe=()=>{let e={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 t(i){return e[i]??null}let n={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",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",iban:"IBAN",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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: ${n[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"}: ${N(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 wq(){return{localeError:ffe()}}var mfe=()=>{let e={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 t(o){return e[o]??null}let n={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",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function i(o,s){return o==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):r[o]??o}return o=>{switch(o.code){case"invalid_type":{let s=i(o.expected),a=J(o.input),c=i(a,o.input);return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${q(o.values[0])}`:`Invalid option: expected one of ${N(o.values,"|")}`;case"too_big":{let s=o.exact?"exactly ":o.inclusive?"<=":"<",a=t(o.origin);return a?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.exact?"exactly ":o.inclusive?">=":">",a=t(o.origin);return a?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${a.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${N(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(a=>`'${a}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function hw(){return{localeError:mfe()}}var gfe=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function t(i){return e[i]??null}let n={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",mac:"MAC-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",credit_card:"kreditkarta numero",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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":""}: ${N(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 kq(){return{localeError:gfe()}}var hfe=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(i){return e[i]??null}let n={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",mac:"direcci\xF3n MAC",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",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},r={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=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin),a=r[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=t(i.origin),a=r[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 ${n[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":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${r[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${r[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}};function _q(){return{localeError:hfe()}}var yfe=()=>{let e={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"},map:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(i){return e[i]??null}let n={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",mac:"MAC \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",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},r={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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`:`${n[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: ${N(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 $q(){return{localeError:yfe()}}var bfe=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(i){return e[i]??null}let n={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",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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"}: ${N(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 Sq(){return{localeError:bfe()}}var vfe=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(i){return e[i]??null}let n={regex:"expression r\xE9guli\xE8re",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",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},r={string:"cha\xEEne de caract\xE8res",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:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instance de ${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 : ${q(i.values[0])} attendu`:`Option invalide : une valeur parmi ${N(i.values,"|")} attendue`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Trop grand : ${r[i.origin]??"valeur"} doit ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r[i.origin]??"valeur"} doit \xEAtre ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Trop petit : ${r[i.origin]??"valeur"} doit ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${r[i.origin]??"valeur"} doit \xEAtre ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cha\xEEne de caract\xE8res invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne de caract\xE8res invalide : doit correspondre au motif ${o.pattern}`:`${n[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":""} : ${N(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 xq(){return{localeError:vfe()}}var wfe=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"},map:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(i){return e[i]??null}let n={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",mac:"adresse MAC",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",credit_card:"num\xE9ro de carte de cr\xE9dit",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u2264":"<",s=t(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=t(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}`:`${n[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":""} : ${N(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 Eq(){return{localeError:wfe()}}var kfe=()=>{let e={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function t(i){return e[i]??null}let n={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",iban:"IBAN",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${o}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${a}`}case"invalid_value":return i.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${q(i.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${N(i.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${i.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${i.maximum.toString()} ${s.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${i.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${i.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${i.origin} ${o}${i.minimum.toString()} ${s.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${i.origin} ${o}${i.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${o.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${i.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${i.keys.length>1?"\u0A93":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${i.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}};function Tq(){return{localeError:kfe()}}var _fe=()=>{let e={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"}},t={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"}},n=l=>l?e[l]:void 0,r=l=>{let u=n(l);return u?u.label:l??e.unknown.label},i=l=>`\u05D4${r(l)}`,o=l=>(n(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?t[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"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",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"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",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"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",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??""]??r(u),p=J(l.input),f=c[p]??e[p]?.label??p;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 ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}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 ${q(l.values[0])}`;let u=l.values.map(f=>q(f));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",g=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 ${g}`.trim()}let p=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${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 h=(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 ${h}`}let g=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 ${g}`.trim()}let p=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${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],p=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \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"}: ${N(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 Iq(){return{localeError:_fe()}}var $fe=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function t(i){return e[i]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return i.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${q(i.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${i.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${o}${i.maximum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${i.origin??"\u092E\u093E\u0928"} ${o}${i.maximum} \u0939\u094B`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${i.origin} \u092E\u0947\u0902 ${o}${i.minimum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${i.origin} ${o}${i.minimum} \u0939\u094B`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${o.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${o.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${i.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${i.keys.length>1?"\u092F\u093E\u0901":""}: ${N(i.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${i.origin} \u092E\u0947\u0902`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${i.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function Aq(){return{localeError:$fe()}}var Sfe=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(i){return e[i]??null}let n={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",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",iban:"IBAN",jwt:"JWT",template_literal:"unos"},r={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=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin),a=r[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=t(i.origin),a=r[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 ${n[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"}: ${N(i.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${r[i.origin]??i.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${r[i.origin]??i.origin}`;default:return"Neispravan unos"}}};function Rq(){return{localeError:Sfe()}}var xfe=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function t(i){return e[i]??null}let n={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",mac:"MAC 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",credit_card:"hitelk\xE1rtyasz\xE1m",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},r={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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":""}: ${N(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 Pq(){return{localeError:xfe()}}function Cq(e,t,n){return Math.abs(e)===1?t:n}function ku(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}var Efe=()=>{let e={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"},map:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(i){return e[i]??null}let n={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",mac:"MAC \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",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",iban:"IBAN",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},r={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);if(s){let a=Number(i.maximum),c=Cq(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 ${ku(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 ${ku(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);if(s){let a=Number(i.minimum),c=Cq(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 ${ku(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 ${ku(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 ${n[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":""}. ${N(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${ku(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 ${ku(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Nq(){return{localeError:Efe()}}var Tfe=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function t(i){return e[i]??null}let n={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",mac:"alamat MAC",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",credit_card:"nomor kartu kredit",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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}`:`${n[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":""}: ${N(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 Dq(){return{localeError:Tfe()}}var Ife=()=>{let e={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"},map:{unit:"hluti",verb:"a\xF0 hafa"}};function t(i){return e[i]??null}let n={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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},r={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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"}: ${N(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 Oq(){return{localeError:Ife()}}var Afe=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function t(i){return e[i]??null}let n={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",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Opzione non valida: atteso uno tra ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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: ${n[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"}: ${N(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 Mq(){return{localeError:Afe()}}var Rfe=()=>{let e={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"},map:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(i){return e[i]??null}let n={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",mac:"MAC\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",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",iban:"IBAN",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},r={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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: ${q(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${N(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=t(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=t(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${n[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":""}: ${N(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 Lq(){return{localeError:Rfe()}}var Pfe=()=>{let e={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"},map:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(i){return e[i]??null}let n={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",mac:"MAC \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",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",iban:"IBAN",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},r={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=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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"}: ${N(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 Fq(){return{localeError:Pfe()}}var Cfe=()=>{let e={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"},map:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(i){return e[i]??null}let n={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",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",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",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",iban:"IBAN",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},r={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=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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 ${N(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 yw(){return{localeError:Cfe()}}function jq(){return yw()}var Nfe=()=>{let e={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function t(i){return e[i]??null}let n={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",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 \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",iban:"IBAN",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${o}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${a}`}case"invalid_value":return i.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${q(i.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${i.maximum.toString()} ${s.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${i.minimum.toString()} ${s.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${o.prefix}"`:o.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${o.suffix}"`:o.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${o.includes}"`:o.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${o.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${i.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${i.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}};function Uq(){return{localeError:Nfe()}}var Dfe=()=>{let e={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"},map:{unit:"\uAC1C",verb:"to have"}};function t(i){return e[i]??null}let n={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",mac:"MAC \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",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",iban:"IBAN",jwt:"JWT",template_literal:"\uC785\uB825"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${N(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=t(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=t(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 ${n[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: ${N(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 zq(){return{localeError:Dfe()}}var pg=e=>e.charAt(0).toUpperCase()+e.slice(1);function Gq(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?"many":n===1?"one":"few"}var Ofe=()=>{let e={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 t(i,o,s,a){let c=e[i]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let n={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",mac:"MAC 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",credit_card:"kredito kortel\u0117s numeris",iban:"IBAN",jwt:"JWT",template_literal:"\u012Fvestis"},r={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=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${N(i.values,"|")} pasirinkim\u0173`;case"too_big":{let o=r[i.origin]??i.origin,s=t(i.origin,Gq(Number(i.maximum)),i.inclusive??!1,"smaller");if(s?.verb)return`${pg(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`${pg(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.maximum.toString()} ${s?.unit}`}case"too_small":{let o=r[i.origin]??i.origin,s=t(i.origin,Gq(Number(i.minimum)),i.inclusive??!1,"bigger");if(s?.verb)return`${pg(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`${pg(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 ${n[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"}: ${N(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=r[i.origin]??i.origin;return`${pg(o??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Bq(){return{localeError:Ofe()}}var Mfe=()=>{let e={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"},map:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(i){return e[i]??null}let n={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",mac:"MAC \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",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},r={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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"}: ${N(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 Vq(){return{localeError:Mfe()}}var Lfe=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function t(i){return e[i]??null}let n={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",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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}`:`${n[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: ${N(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 qq(){return{localeError:Lfe()}}var Ffe=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function t(i){return e[i]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return i.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${q(i.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${i.origin??"\u092E\u093E\u0928"} \u092E\u093E ${o}${i.maximum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${i.origin??"\u092E\u093E\u0928"} ${o}${i.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${i.origin} \u092E\u093E ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${i.origin} ${o}${i.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${o.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??i.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${i.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${i.keys.length>1?"\u0939\u0930\u0942":""}: ${N(i.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${i.origin} \u092E\u093E`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${i.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${i.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function Wq(){return{localeError:Ffe()}}var jfe=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function t(i){return e[i]??null}let n={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",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},r={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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: ${n[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":""}: ${N(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 Hq(){return{localeError:jfe()}}var Ufe=()=>{let e={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};function t(i){return e[i]??null}let n={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-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tal",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventa instanceof ${i.expected}, fekk ${a}`:`Ugyldig input: forventa ${o}, fekk ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventa ${q(i.values[0])}`:`Ugyldig val: forventa eitt av ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`For stor(t): forventa ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()} ${s.unit??"element"}`:`For stor(t): forventa ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`For lite(n): forventa ${i.origin} til \xE5 ha ${o}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventa ${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 slutte med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??i.format}`}case"not_multiple_of":return`Ugyldig tal: m\xE5 vere eit multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${N(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 Kq(){return{localeError:Ufe()}}var zfe=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"},map:{unit:"elementer",verb:"\xE5 inneholde"}};function t(i){return e[i]??null}let n={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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Ugyldig valg: forventet en av ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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"}: ${N(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 Jq(){return{localeError:zfe()}}var Gfe=()=>{let e={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"},map:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(i){return e[i]??null}let n={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",mac:"MAC 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",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",iban:"IBAN",jwt:"JWT",template_literal:"giren"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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":""}: ${N(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 Zq(){return{localeError:Gfe()}}var Bfe=()=>{let e={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"},map:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(i){return e[i]??null}let n={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",mac:"\u062F MAC \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",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},r={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${N(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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`:`${n[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"}: ${N(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 Yq(){return{localeError:Bfe()}}var Vfe=()=>{let e={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"},map:{unit:"element\xF3w",verb:"mie\u0107"}};function t(i){return e[i]??null}let n={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",mac:"adres MAC",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",credit_card:"numer karty kredytowej",iban:"IBAN",jwt:"JWT",template_literal:"wej\u015Bcie"},r={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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) ${n[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":""}: ${N(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 Qq(){return{localeError:Vfe()}}var qfe=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},r={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},i={string:{name:"texto",articles:r.masculine},number:{name:"n\xFAmero",articles:r.masculine},int:{name:"n\xFAmero inteiro",articles:r.masculine},boolean:{name:"valor booleano",articles:r.masculine},bigint:{name:"n\xFAmero bigint",articles:r.masculine},symbol:{name:"s\xEDmbolo",articles:r.masculine},undefined:{name:'valor "undefined"',articles:r.masculine},null:{name:'valor "nulo"',articles:r.masculine},never:{name:'valor "never"',articles:r.masculine},void:{name:'valor "void"',articles:r.masculine},date:{name:"data",articles:r.feminine},array:{name:"vetor",articles:r.masculine},object:{name:"objeto",articles:r.masculine},tuple:{name:"tuplo",articles:r.masculine},record:{name:"registo",articles:r.masculine},map:{name:"mapa",articles:r.masculine},set:{name:"conjunto",articles:r.masculine},file:{name:"ficheiro",articles:r.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:r.masculine},nan:{name:'valor "NaN"',articles:r.masculine},function:{name:"fun\xE7\xE3o",articles:r.feminine}};function o(s,a){let c=i[s]??{name:`valor "${s}"`,articles:r.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=J(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${q(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${N(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Demasiado grande: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Demasiado pequeno: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${N(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function Xq(){return{localeError:qfe()}}var Wfe=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},r={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},i={string:{name:"texto",articles:r.masculine},number:{name:"n\xFAmero",articles:r.masculine},int:{name:"n\xFAmero inteiro",articles:r.masculine},boolean:{name:"valor booleano",articles:r.masculine},bigint:{name:"n\xFAmero bigint",articles:r.masculine},symbol:{name:"s\xEDmbolo",articles:r.masculine},undefined:{name:'valor "undefined"',articles:r.masculine},null:{name:'valor "nulo"',articles:r.masculine},never:{name:'valor "never"',articles:r.masculine},void:{name:'valor "void"',articles:r.masculine},date:{name:"data",articles:r.feminine},array:{name:"vetor",articles:r.masculine},object:{name:"objeto",articles:r.masculine},tuple:{name:"tupla",articles:r.feminine},record:{name:"registro",articles:r.masculine},map:{name:"mapa",articles:r.masculine},set:{name:"conjunto",articles:r.masculine},file:{name:"arquivo",articles:r.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:r.masculine},nan:{name:'valor "NaN"',articles:r.masculine},function:{name:"fun\xE7\xE3o",articles:r.feminine}};function o(s,a){let c=i[s]??{name:`valor "${s}"`,articles:r.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=J(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${q(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${N(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Grande demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Pequeno demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${N(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function e2(){return{localeError:Wfe()}}var Hfe=()=>{let e={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 t(i){return e[i]??null}let n={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",credit_card:"num\u0103r de card de credit",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},r={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=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return i.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${q(i.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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: ${n[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: ${N(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 t2(){return{localeError:Hfe()}}function n2(e,t,n,r){let i=Math.abs(e),o=i%10,s=i%100;return s>=11&&s<=19?r:o===1?t:o>=2&&o<=4?n:r}var Kfe=()=>{let e={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"},map:{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 t(i){return e[i]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},r={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=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);if(s){let a=Number(i.maximum),c=n2(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=t(i.origin);if(s){let a=Number(i.minimum),c=n2(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 ${n[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":""}: ${N(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 r2(){return{localeError:Kfe()}}var Jfe=()=>{let e={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function t(i){return e[i]??null}let n={regex:"regul\xE1rny 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:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${i.expected}, obdr\u017Ean\xE9 ${a}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${o}, obdr\u017Ean\xE9 ${a}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${q(i.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${i.origin??"hodnota"} mus\xED ma\u0165 ${o}${i.maximum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${i.origin??"hodnota"} mus\xED by\u0165 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Hodnota je pr\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED ma\u0165 ${o}${i.minimum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED by\u0165 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${o.includes}"`:o.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${N(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\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 i2(){return{localeError:Jfe()}}var Zfe=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function t(i){return e[i]??null}let n={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",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},r={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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"}: ${N(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 o2(){return{localeError:Zfe()}}var Yfe=()=>{let e={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"},map:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(i){return e[i]??null}let n={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-adress",ipv6:"IPv6-adress",mac:"MAC-adress",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",credit_card:"kreditkortsnummer",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},r={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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) ${n[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"}: ${N(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 s2(){return{localeError:Yfe()}}var Qfe=()=>{let e={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"},map:{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 t(i){return e[i]??null}let n={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",mac:"MAC \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",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={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=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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":""}: ${N(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 a2(){return{localeError:Qfe()}}var Xfe=()=>{let e={string:{unit:"\u0430\u043B\u043E\u043C\u0430\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},file:{unit:"\u0431\u0430\u0439\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},array:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},set:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},map:{unit:"\u0441\u0430\u0431\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"}};function t(i){return e[i]??null}let n={regex:"\u0432\u0443\u0440\u0443\u0434",email:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",url:"URL",emoji:"\u044D\u043C\u043E\u04B7\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",date:"\u0441\u0430\u043D\u0430\u0438 ISO",time:"\u0432\u0430\u049B\u0442\u0438 ISO",duration:"\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",ipv4:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",ipv6:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",mac:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",cidrv4:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",cidrv6:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",base64:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",base64url:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",json_string:"\u0441\u0430\u0442\u0440\u0438 JSON",e164:"\u0440\u0430\u049B\u0430\u043C\u0438 E.164",credit_card:"\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0443\u0440\u0443\u0434"},r={nan:"NaN",number:"\u0440\u0430\u049B\u0430\u043C",string:"\u0441\u0430\u0442\u0440",array:"\u043C\u0430\u0441\u0441\u0438\u0432",object:"\u043E\u0431\u044A\u0435\u043A\u0442",date:"\u0441\u0430\u043D\u0430"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${o} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${a} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`}case"invalid_value":return i.values.length===1?`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${q(i.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:`\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${N(i.values,"|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${i.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${i.maximum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${i.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${i.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${i.origin} \u0431\u043E\u044F\u0434 ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${i.origin} \u0431\u043E\u044F\u0434 ${o}${i.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`:o.format==="ends_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`:o.format==="includes"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${o.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`:o.format==="regex"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${o.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`:`${n[o.format]??i.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`}case"not_multiple_of":return`\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${i.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;case"unrecognized_keys":return`\u041A\u0430\u043B\u0438\u0434${i.keys.length>1?"\u04B3\u043E\u0438":"\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${N(i.keys,", ")}`;case"invalid_key":return`\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${i.options.map(s=>`'${s}'`).join(" | ")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";case"invalid_element":return`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${i.origin}`;default:return"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442"}}};function c2(){return{localeError:Xfe()}}var eme=()=>{let e={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"},map:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(i){return e[i]??null}let n={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",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",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)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",iban:"IBAN",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},r={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=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(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=t(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=t(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: ${n[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: ${N(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 l2(){return{localeError:eme()}}var tme=()=>{let e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function t(i){return e[i]??null}let n={regex:"giri\u015F",email:"e-po\xE7ta salgysy",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 sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",iban:"IBAN",jwt:"JWT",template_literal:"\u015Fablon"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[s]??s;return`N\xE4dogry baha: gara\u015Fylan ${o} \xFDerine ${a} alyndy`}case"invalid_value":return i.values.length===1?`N\xE4dogry baha: ${q(i.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Has uly: gara\u015Fyl\xFDan ${i.origin??"baha"} ${o} ${i.maximum.toString()} ${s.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${i.origin??"baha"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Has ki\xE7i: gara\u015Fyl\xFDan ${i.origin} ${o} ${i.minimum.toString()} ${s.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`N\xE4dogry setir: "${o.prefix}" bilen ba\u015Flamaly`:o.format==="ends_with"?`N\xE4dogry setir: "${o.suffix}" bilen gutarmaly`:o.format==="includes"?`N\xE4dogry setir: "${o.includes}" saklamaly`:o.format==="regex"?`N\xE4dogry setir: ${o.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${n[o.format]??i.format}`}case"not_multiple_of":return`N\xE4dogry san: ${i.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${i.keys.length>1?"lar":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${i.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}};function u2(){return{localeError:tme()}}var nme=()=>{let e={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"},map:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(i){return e[i]??null}let n={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",mac:"MAC 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",credit_card:"kredi kart\u0131 numaras\u0131",iban:"IBAN",jwt:"JWT",template_literal:"\u015Eablon dizesi"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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":""}: ${N(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 d2(){return{localeError:nme()}}var rme=()=>{let e={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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(i){return e[i]??null}let n={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",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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":""}: ${N(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 bw(){return{localeError:rme()}}function p2(){return bw()}var ime=()=>{let e={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"},map:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(i){return e[i]??null}let n={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",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \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",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",iban:"IBAN",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},r={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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: ${q(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${N(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=t(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=t(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 ${n[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":""}: ${N(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 f2(){return{localeError:ime()}}var ome=()=>{let e={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 t(i){return e[i]??null}let n={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",credit_card:"kredit karta raqami",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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":""}: ${N(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 m2(){return{localeError:ome()}}var sme=()=>{let e={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"},map:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(i){return e[i]??null}let n={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",mac:"\u0111\u1ECBa ch\u1EC9 MAC",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",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",iban:"IBAN",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},r={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(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 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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}`:`${n[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: ${N(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 g2(){return{localeError:sme()}}var ame=()=>{let e={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"},map:{unit:"\u9879",verb:"\u5305\u542B"}};function t(i){return e[i]??null}let n={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",mac:"MAC\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",credit_card:"\u4FE1\u7528\u5361\u53F7",iban:"IBAN",jwt:"JWT",template_literal:"\u8F93\u5165"},r={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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${n[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): ${N(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 h2(){return{localeError:ame()}}var cme=()=>{let e={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"},map:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(i){return e[i]??null}let n={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",mac:"MAC \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",credit_card:"\u4FE1\u7528\u5361\u865F",iban:"IBAN",jwt:"JWT",template_literal:"\u8F38\u5165"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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 ${n[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${N(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 y2(){return{localeError:cme()}}var lme=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"},map:{unit:"nkan",verb:"n\xED"}};function t(i){return e[i]??null}let n={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",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",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",credit_card:"n\u1ECDmba kaadi gbese",iban:"IBAN",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},r={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let o=r[i.expected]??i.expected,s=J(i.input),a=r[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 ${q(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(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=t(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: ${n[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: ${N(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"}}};function b2(){return{localeError:lme()}}var v2,wR=Symbol("ZodOutput"),kR=Symbol("ZodInput"),vw=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let r={...this.get(n)??{}};delete r.id;let i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ww(){return new vw}(v2=globalThis).__zod_globalRegistry??(v2.__zod_globalRegistry=ww());var Nn=globalThis.__zod_globalRegistry;var ar=Symbol.for("zod.compile.invalid"),w2=Symbol.for("zod.compile.fallback"),zi=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},Ve=class extends Error{constructor(t,n=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n}};function dme(e,t){try{return _w(e,{assertOnly:!0})}catch{return t}}function xR(e,t){try{let n=_w(e),r=kw(e,n);return r._zod.bag.validator=dme(e,n),r}catch(n){if(t?.strict)throw n;return e}}function kw(e,t){if(mw(e))throw new Ve("a schema whose subtree contains a reference cycle");let n=it(e),r=e._zod.run,i=r.__originalRun??r,o=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[w2]||a&&gw(a,s.value))return i(s,a);let c=t(s.value);return c!==ar?(s.value=c,s):(a&&(a[w2]=!0),i(s,a))};return o.__originalRun=i,n._zod.bag.fallbackRun=i,n._zod.bag.validator=t,n._zod.run=o,r.__originalRun||pme(n,e,t),n}function pme(e,t,n){let r=e,i=t;if(typeof i.safeParse=="function"){let o=i.safeParse;r.safeParse=(s,a)=>{let c=n(s);return c!==ar?{success:!0,data:c}:o(s,a)}}if(typeof i.parse=="function"){let o=i.parse;r.parse=(s,a)=>{let c=n(s);return c!==ar?c:o(s,a)}}}function _w(e,t){let n=!0;try{n=mw(e)}catch{}if(n)throw new Ve("a schema whose subtree contains a reference cycle");let r={constants:new Map,constantCounter:0,varCounter:0,definite:!0},i=new cc(["input"]),o=Ct(i,r,e,"input",!t?.assertOnly);i.write(o===null?"return true;":`return ${o};`);let s=["INVALID",...r.constants.keys()],a=[ar,...r.constants.values()],c=i.content.join(` `),l=t?.debug?s.length>0?`// Constants: ${s.join(", ")} ${c}`:c:"",u=Function,d=`return (input) => { ${c} -}`,p;try{p=new u(...s,d)(...a)}catch(f){throw new Ve(`this schema (generated code failed to evaluate: ${f.message})`)}return t?.debug&&(p.code=l),p.definite=i.definite,p}function Ie(e,t){for(let[i,r]of e.constants)if(r===t)return i;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function Sc(e,t){return e.definite=!1,Ie(e,t)}function we(e){return`v${e.varCounter++}`}function spe(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return sr;let i=n;return i.issues.length===0?i.value:sr}function Bn(e,t,n,i,r=!0){let o=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return Rt(e,t,n,i,r)}catch(l){if(!(l instanceof Ve)||!l.islandable)throw l;if(e.content.length=o,t.constants.size>s){let u=Array.from(t.constants.keys()).slice(s);for(let d of u)t.constants.delete(d)}return t.constantCounter=a,t.varCounter=c,ape(e,t,n,i)}}function ape(e,t,n,i){t.definite=!1;let r=Ie(t,n),o=Ie(t,spe),s=we(t);return e.write(`const ${s} = ${o}(${r}, ${i});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var cpe=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function lpe(e,t,n,i){let r=n._zod.def.checks;if(!r||r.length===0)return i;let o=i;for(let s of r){let a=s._zod.def;if(a.when&&!cpe.has(a.check))throw new Ve('check with a custom "when" condition');switch(a.check){case"greater_than":upe(e,t,a,o);break;case"less_than":dpe(e,t,a,o);break;case"multiple_of":ppe(e,t,a,o);break;case"number_format":DB(e,a,o);break;case"min_length":{let c=$c(a.minimum,"min_length"),l=xA(e,t,o,`${o}.length >= ${c} && ${o}.length < ${a.minimum*2}`);e.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=$c(a.maximum,"max_length"),l=xA(e,t,o,`${o}.length > ${c}`);e.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=$c(a.length,"length_equals"),l=xA(e,t,o,`${o}.length >= ${c} && ${o}.length <= ${a.length*2}`);e.write(`if (${l} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${$c(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${$c(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${$c(a.size,"size_equals")}) return INVALID;`);break;case"string_format":o=MB(e,t,a,o);break;case"custom":o=ype(e,t,s,o);break;case"bigint_format":fpe(e,a,o);break;case"mime_type":mpe(e,t,a,o);break;case"property":gpe(e,t,a,o);break;case"properties":OB(e,t,a,o,!1);break;case"overwrite":{let c=we(t);hpe(e,t,s,o,c),o=c;break}default:throw new Ve(`check type ${a.check}`)}}return o}function xA(e,t,n,i){let r=Ie(t,bc),o=we(t);return e.write(`const ${o} = typeof ${n} === "string" && ${i} ? ${r}(${n}) : ${n}.length;`),o}function $c(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Ve(`${t} bound of type ${typeof e}`);return`${e}`}function PB(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Ve("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Ve("comparison check with Invalid Date bound");return Ie(e,t)}throw new Ve(`comparison check bound of type ${typeof t}`)}function upe(e,t,n,i){let r=n.inclusive?"<":"<=";e.write(`if (${i} ${r} ${PB(t,n.value)}) return INVALID;`)}function dpe(e,t,n,i){let r=n.inclusive?">":">=";e.write(`if (${i} ${r} ${PB(t,n.value)}) return INVALID;`)}function ppe(e,t,n,i){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new Ve("multiple_of check with a zero divisor");e.write(`if (${i} % ${n.value}n !== 0n) return INVALID;`)}else{let r=Ie(t,xm);e.write(`if (${r}(${i}, ${$c(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function DB(e,t,n){let i=t.format;switch(i){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new Ve(`number format ${i}`)}}function fpe(e,t,n){let i=t.format;if(i)switch(i){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new Ve(`bigint format ${i}`)}}function mpe(e,t,n,i){let r=n.mime;if(r&&r.length>0){let o=Ie(t,new Set(r));e.write(`if (!${o}.has(${i}.type)) return INVALID;`)}}function OB(e,t,n,i,r){if(n.when)throw new Ve('check with a custom "when" condition');e.write(r?`if (${i} === null || (typeof ${i} !== "object" && typeof ${i} !== "function")) return INVALID;`:`if (${i} == null) return INVALID;`);let o=n.shape;for(let s of Reflect.ownKeys(o)){let a=typeof s=="symbol"?Ie(t,s):nr(s),c=we(t);e.write(`const ${c} = ${i}[${a}];`),Bn(e,t,o[s],c,!1)}}function gpe(e,t,n,i){let r=`${i}[${JSON.stringify(n.property)}]`;Rt(e,t,n.schema,r)}function hpe(e,t,n,i,r){let o=n._zod.def.tx;if(!o)throw new Ve("overwrite check without a transform function");if(xc(o))throw new Ui("z.compile: async overwrite transforms are not supported");let s=Ie(t,o);e.write(`const ${r} = ${s}(${i});`)}function EA(){throw new Tr}function AA(e){this.issues.push(e)}function ype(e,t,n,i){let r=n._zod.def;if(r.fn){if(xc(r.fn))throw new Ui("z.compile: async .refine() predicates are not supported");let o=Sc(t,r.fn),s=Ie(t,EA),a=we(t);return e.write(`const ${a} = ${o}(${i});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),i}if(n._zod.check){if(xc(n._zod.check))throw new Ui("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,a=Sc(t,l=>{let u={value:l,issues:[],addIssue:AA};return o(u)instanceof Promise&&EA(),u.issues.length===0?u.value:sr}),c=we(t);return e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new Ve("custom check without a predicate or check function")}var bpe=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function MB(e,t,n,i){let r=n.format;if(r==="base64"){let c=Ie(t,jm);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="base64url"){let c=Ie(t,Dv);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="jwt"){let c=Ie(t,Lv),l=Ie(t,n.alg??null);return e.write(`if (!${c}(${i}, ${l})) return INVALID;`),i}if(r==="ipv6"){let c=Ie(t,Um);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="cidrv6"){let c=Ie(t,Cv);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="credit_card"){let c=Ie(t,Ov);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="iban"){let c=Ie(t,Mv);return e.write(`if (!${c}(${i})) return INVALID;`),i}let o=n;if(r==="url"||r==="httpurl"||o.normalize||o.hostname!==void 0||o.protocol!==void 0){let c=Ie(t,Iv),l=Ie(t,n),u=we(t),d=we(t);if(e.write(`const ${u} = ${i}.trim();`),e.write(`const ${d} = ${c}(${u}, ${l});`),e.write(`if (typeof ${d} === "number") return INVALID;`),o.hostname!==void 0){let m=Ie(t,Rv);e.write(`if (!${m}(${d}, ${l}.hostname)) return INVALID;`)}if(o.protocol!==void 0){let m=Ie(t,Nv);e.write(`if (!${m}(${d}, ${l}.protocol)) return INVALID;`)}let p=we(t),f=o.normalize?`${d}.href`:`${Ie(t,Av)}(${u})`;return e.write(`const ${p} = ${f};`),p}let s=n.fn;if(s){if(xc(s))throw new Ve(`async string format ${r}`);let c=Ie(t,s);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(bpe.has(r)&&n.pattern){let c=Ie(t,n.pattern);return e.write(`${c}.lastIndex = 0;`),e.write(`if (!${c}.test(${i})) return INVALID;`),i}let a=n.format;switch(a){case"regex":throw new Ve("regex format without a pattern");case"lowercase":e.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${i}.includes(${nr(n.includes)})) return INVALID;`);break;case"starts_with":{let c=n.prefix;e.write(`if (${i}.slice(0, ${c.length}) !== ${nr(c)}) return INVALID;`);break}case"ends_with":{let c=n.suffix;e.write(`if (${i}.slice(-${c.length}) !== ${nr(c)}) return INVALID;`);break}default:throw new Ve(`string format ${a}`)}return i}function Rt(e,t,n,i,r=!0){let o=n._zod.def,s=o.type;if(o.coerce)throw new Ve(`coercion (z.coerce.${s}())`);let a=r||!!o.checks?.length,c;switch(s){case"string":c=vpe(e,t,n,i);break;case"number":c=wpe(e,n,i);break;case"boolean":c=kpe(e,i);break;case"bigint":c=$pe(e,n,i);break;case"symbol":c=_pe(e,i);break;case"undefined":c=Spe(e,i);break;case"null":c=xpe(e,i);break;case"any":case"unknown":c=i;break;case"never":e.write("return INVALID;"),c=i;break;case"void":c=Epe(e,i);break;case"nan":c=Tpe(e,i);break;case"date":c=Ipe(e,i);break;case"object":c=Ape(e,t,n,i,a);break;case"optional":c=Rpe(e,t,n,i,a);break;case"nullable":c=Ppe(e,t,n,i,a);break;case"array":c=Dpe(e,t,n,i,a);break;case"literal":c=Ope(e,t,n,i);break;case"enum":c=Mpe(e,t,n,i);break;case"readonly":{let l=RB(e,t,n,i),u=we(t);e.write(`const ${u} = Object.freeze(${l});`),c=u;break}case"success":RB(e,t,n,i),c="true";break;case"default":case"prefault":c=Lpe(e,t,n,i);break;case"nonoptional":c=Fpe(e,t,n,i);break;case"tuple":c=Upe(e,t,n,i);break;case"union":c=jpe(e,t,n,i);break;case"intersection":c=Vpe(e,t,n,i);break;case"record":c=Bpe(e,t,n,i);break;case"map":c=Wpe(e,t,n,i);break;case"set":c=Hpe(e,t,n,i);break;case"file":c=Kpe(e,i);break;case"template_literal":c=Jpe(e,t,n,i);break;case"lazy":c=Zpe(e,t,n,i);break;case"pipe":c=Ype(e,t,n,i);break;case"custom":c=Qpe(e,t,n,i);break;case"properties":OB(e,t,n._zod.def,i,!0),c=i;break;case"transform":c=tfe(e,t,n,i);break;case"catch":c=efe(e,t,n,i);break;default:throw new Ve(`schema type ${s}`)}return c===null?null:lpe(e,t,n,c)}function vpe(e,t,n,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.def;return r.format===void 0?i:MB(e,t,r,i)}function wpe(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let i=t._zod.def;return i.check==="number_format"&&i.format&&DB(e,{format:i.format},n),n}function kpe(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function $pe(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let i=t._zod.def;if(i.format)switch(i.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function _pe(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Spe(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function xpe(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function Epe(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Tpe(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function Ipe(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function Ape(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let s=o.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),l=c.length?[...a,...c]:a,u=y=>typeof y=="symbol"?Ie(t,y):nr(y),d=y=>typeof y=="symbol"?`[${u(y)}]`:nr(y),p=s;if(a.includes("__proto__"))throw new Ve('object shape key "__proto__"');let f=new Map;for(let y of l){let w=p[y],k=u(y),_=we(t);if(e.write(`const ${_} = ${i}[${k}];`),w._zod.optin!==void 0){let S=we(t);e.write(`let ${S} = (() => {`),e.indented(x=>{let E=Bn(x,t,w,_);x.write(`return ${E};`)}),e.write("})();"),w._zod.optout==="optional"?(e.write(`if (${S} === INVALID) {`),e.indented(x=>{x.write(`if (${k} in ${i}) return INVALID;`),x.write(`${S} = undefined;`)}),e.write("}")):e.write(`if (${S} === INVALID) return INVALID;`),f.set(y,S)}else{Cpe(w)&&e.write(`if (!(${k} in ${i})) return INVALID;`);let S=Bn(e,t,w,_,r);S!==null&&f.set(y,S)}}let m=o.catchall,g="none";if(m){let y=m._zod.def.type;if(y==="never"){let w=a.map(k=>`k !== ${nr(k)}`).join(" && ")||"true";e.write(`for (const k in ${i}) {`),e.indented(k=>{k.write(`if (${w}) return INVALID;`)}),e.write("}")}else(y==="unknown"||y==="any")&&!m._zod.def.checks?.length?g="passthrough":g="schema"}let h=we(t),b=l.some(y=>AB(p[y])||TA(p[y]));if(!r){if(g==="schema"){let y=a.length>0?Ie(t,new Set(a)):null;e.write(`for (const k in ${i}) {`),e.indented(w=>{w.write('if (k === "__proto__") continue;'),y&&w.write(`if (${y}.has(k)) continue;`);let k=we(t);w.write(`const ${k} = ${i}[k];`),Bn(w,t,m,k,!1)}),e.write("}")}return null}if(b){e.write(`const ${h} = {};`);for(let y of l){let w=u(y),k=f.get(y);TA(p[y])?e.write(`if (${w} in ${i}) ${h}[${w}] = ${k};`):AB(p[y])?e.write(`if (${k} !== undefined || ${w} in ${i}) ${h}[${w}] = ${k};`):e.write(`${h}[${w}] = ${k};`)}}else{let y=l.map(w=>`${d(w)}: ${f.get(w)}`).join(", ");e.write(`const ${h} = { ${y} };`)}if(g!=="none"){let y=a.length>0?Ie(t,new Set(a)):null;e.write(`for (const k in ${i}) {`),e.indented(w=>{if(w.write('if (k === "__proto__") continue;'),y&&w.write(`if (${y}.has(k)) continue;`),g==="passthrough")w.write(`${h}[k] = ${i}[k];`);else{let k=we(t);w.write(`const ${k} = ${i}[k];`);let _=Bn(w,t,m,k);w.write(`${h}[k] = ${_};`)}}),e.write("}")}return h}function Rpe(e,t,n,i,r=!0){let o=n._zod.def;if(Npe(n))return Rt(e,t,o.innerType,i,r);if(o.innerType._zod.optin==="defaulted"){let a=we(t),c=we(t);return e.write(`let ${a};`),e.write(`if (${i} === undefined) {`),e.indented(l=>{l.write(`const ${c} = (() => {`),l.indented(u=>{let d=Rt(u,t,o.innerType,i);u.write(`return ${d};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${a} = ${c};`)}),e.write("} else {"),e.indented(l=>{let u=Rt(l,t,o.innerType,i);l.write(`${a} = ${u};`)}),e.write("}"),a}let s=r?we(t):null;return s&&e.write(`let ${s};`),e.write(`if (${i} !== undefined) {`),e.indented(a=>{let c=Rt(a,t,o.innerType,i,r);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function Npe(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function Cpe(e){return e._zod.optin===void 0&&_c(e)}function _c(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?_c(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?_c(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(_c):!0;case"intersection":return!t.left||!t.right?!0:_c(t.left)&&_c(t.right);case"pipe":return t.in?_c(t.in):!0;default:return!0}}function TA(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function AB(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&ju(e)}function ju(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?ju(t.innerType):!0;case"union":return t.options?t.options.some(ju):!0;case"intersection":return!t.left||!t.right||ju(t.left)||ju(t.right);case"pipe":return t.out?ju(t.out):!0;default:return!0}}function Ppe(e,t,n,i,r=!0){let o=n._zod.def,s=r?we(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${i} !== null) {`),e.indented(a=>{let c=Rt(a,t,o.innerType,i,r);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function Dpe(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (!Array.isArray(${i})) return INVALID;`);let s=r?we(t):null,a=we(t),c=we(t);return s&&e.write(`const ${s} = new Array(${i}.length);`),e.write(`for (let ${a} = 0; ${a} < ${i}.length; ${a}++) {`),e.indented(l=>{l.write(`const ${c} = ${i}[${a}];`);let u=Bn(l,t,o.element,c,r);s&&u!==null&&l.write(`${s}[${a}] = ${u};`)}),e.write("}"),s}function Ope(e,t,n,i){let o=n._zod.def.values;if(o.length!==1){let a=Ie(t,new Set(o));return e.write(`if (!${a}.has(${i})) return INVALID;`),i}let s=o[0];if(typeof s=="number"&&Number.isNaN(s)){let a=Ie(t,new Set(o));return e.write(`if (!${a}.has(${i})) return INVALID;`),i}if(typeof s=="string")e.write(`if (${i} !== ${nr(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${i} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${i} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${i} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${i} !== ${s}n) return INVALID;`);else throw new Ve(`literal type ${typeof s}`);return i}function Mpe(e,t,n,i){let r=n._zod.values;if(!r)throw new Ve("enum schema without enumerated values");let o=Ie(t,r);return e.write(`if (!${o}.has(${i})) return INVALID;`),i}function RB(e,t,n,i){let r=n._zod.def;return Rt(e,t,r.innerType,i)}function Lpe(e,t,n,i){let r=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return Rt(e,t,r.innerType,i);let c=Ie(t,s),l=we(t);return e.write(`let ${l} = ${i};`),e.write(`if (${i} === undefined) ${l} = ${c}();`),Rt(e,t,r.innerType,l)}let a=we(t);if(s){let c=Ie(t,s),l=Ie(t,Em);e.write(`let ${a};`),e.write(`if (${i} === undefined) {`),e.indented(u=>{u.write(`${a} = ${l}(${c}());`)}),e.write("} else {"),e.indented(u=>{let d=Rt(u,t,r.innerType,i);u.write(`${a} = ${d} === undefined ? ${l}(${c}()) : ${d};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${i} !== undefined) {`),e.indented(c=>{let l=Rt(c,t,r.innerType,i);c.write(`${a} = ${l};`)}),e.write("}");return a}function Fpe(e,t,n,i){let r=n._zod.def,o=Rt(e,t,r.innerType,i),s=we(t);return e.write(`const ${s} = ${o};`),e.write(`if (${s} === undefined) return INVALID;`),s}function Upe(e,t,n,i){let r=n._zod.def,o=r.items,s=r.rest;e.write(`if (!Array.isArray(${i})) return INVALID;`);let a=NB(o,"optin"),c=NB(o,"optout");s?e.write(`if (${i}.length < ${a}) return INVALID;`):e.write(`if (${i}.length < ${a} || ${i}.length > ${o.length}) return INVALID;`);let l=we(t);e.write(`const ${l} = [];`);for(let u=0;u=c)e.write(`if (${l}.length === ${u}) {`),e.indented(p=>{p.write(`if (${u} < ${i}.length) {`),p.indented(f=>{let m=we(t);f.write(`const ${m} = ${i}[${u}];`);let g=Bn(f,t,d,m);f.write(`${l}[${u}] = ${g};`)}),p.write("} else {"),p.indented(f=>{if(TA(d)){f.write(`${l}.length = ${u};`);return}let m=we(t),g=we(t);f.write(`const ${m} = undefined;`),f.write(`const ${g} = (() => {`),f.indented(h=>{let b=Bn(h,t,d,m);h.write(`return ${b};`)}),f.write("})();"),f.write(`if (${g} === INVALID || ${g} === undefined) ${l}.length = ${u};`),f.write(`else ${l}[${u}] = ${g};`)}),p.write("}")}),e.write("}");else{let p=we(t);e.write(`const ${p} = ${i}[${u}];`);let f=Bn(e,t,d,p);e.write(`${l}[${u}] = ${f};`)}}if(s){let u=we(t),d=we(t);e.write(`for (let ${u} = ${o.length}; ${u} < ${i}.length; ${u}++) {`),e.indented(p=>{p.write(`const ${d} = ${i}[${u}];`);let f=Bn(p,t,s,d);p.write(`${l}[${u}] = ${f};`)}),e.write("}")}return l}function NB(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function jpe(e,t,n,i){let r=n._zod.def,o=r.options;if(r.discriminator)return zpe(e,t,r,i);if(r.inclusive===!1)throw new Ve("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),i;if(o.length===1)return Rt(e,t,o[0],i);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(u=>u._zod.def.values)),l=Ie(t,c);return e.write(`if (!${l}.has(${i})) return INVALID;`),i}let a=we(t);e.write(`let ${a};`);for(let c=0;c {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(u=>{let d=Rt(u,t,l,i);u.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function zpe(e,t,n,i){if(n.unionFallback)throw new Ve("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),i;let r=we(t),o=we(t);e.write(`const ${r} = ${i}?.[${nr(n.discriminator)}];`),e.write(`let ${o};`);let s=!0,a=new Set;for(let c of n.options){let l=c._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new Ve("discriminated union option without static discriminator values");for(let p of l){if(a.has(p))throw new Ve(`duplicate discriminator value ${String(p)}`);a.add(p)}let u=Array.from(l,p=>Gpe(t,r,p)),d=s?"if":"else if";e.write(`${d} (${u.join(" || ")}) {`),e.indented(p=>{let f=Rt(p,t,c,i);p.write(`${o} = ${f};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),o}function Gpe(e,t,n){if(typeof n=="string")return`${t} === ${nr(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let i=Ie(e,n);return`${t} === ${i}`}throw new Ve(`literal discriminator value ${String(n)}`)}function Vpe(e,t,n,i){let r=n._zod.def;t.definite=!1;let o=Bn(e,t,r.left,i),s=Bn(e,t,r.right,i),a=Ie(t,Lu),c=we(t);return e.write(`const ${c} = ${a}(${o}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function Bpe(e,t,n,i){let r=n._zod.def,o=Ie(t,ci);e.write(`if (!${o}(${i})) return INVALID;`);let s=we(t),a=we(t),c=we(t);e.write(`const ${s} = {};`);let l=r,u=l.partial?void 0:r.keyType._zod.values;if(u){let f=[];for(let g of u){if(!(typeof g=="string"||typeof g=="number"||typeof g=="symbol"))throw new Ve(`record key value ${String(g)}`);let h=typeof g=="number"?g.toString():g;if(h==="__proto__")throw new Ve('record key "__proto__"');f.push(h);let b=Ie(t,g),y=Rt(e,t,r.keyType,b),w=we(t);e.write(`const ${w} = ${i}[${qpe(t,h)}];`);let k=Bn(e,t,r.valueType,w);e.write(`${s}[${y}] = ${k};`)}let m=Ie(t,new Set(f));return e.write(`for (const ${a} in ${i}) {`),e.indented(g=>{g.write(`if (${m}.has(${a})) continue;`),l.mode==="loose"?g.write(`if (${a} !== "__proto__") ${s}[${a}] = ${i}[${a}];`):g.write("return INVALID;")}),e.write("}"),s}let d=r.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let f=r.mode==="loose",m=tw(r.keyType);m.definite===!1&&(t.definite=!1);let g=Ie(t,m),h=Ie(t,Ko),b=we(t);return CB(e,t,i,a,y=>{y.write(`let ${b} = ${g}(${a});`),y.write(`if (${b} === INVALID && typeof ${a} === "string" && ${h}.test(${a})) ${b} = ${g}(Number(${a}));`),f?y.write(`if (${b} === INVALID) { ${s}[${a}] = ${i}[${a}]; continue; }`):y.write(`if (${b} === INVALID) return INVALID;`),y.write(`if (${b} === "__proto__") continue;`);let w=we(t);y.write(`const ${w} = ${i}[${a}];`);let k=Bn(y,t,r.valueType,w);y.write(`${s}[${b}] = ${k};`)}),s}return CB(e,t,i,a,f=>{f.write(`const ${c} = ${i}[${a}];`);let m=Bn(f,t,r.valueType,c);f.write(`${s}[${a}] = ${m};`)},"return INVALID;"),s}function CB(e,t,n,i,r,o){let s=Ie(t,Object.prototype.propertyIsEnumerable),a=we(t),c=we(t),l=we(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${c} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${i} = ${c}[${l}];`),u.write(`if (${i} === "__proto__" || !${s}.call(${n}, ${i})) continue;`),r(u)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${a}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${i} = ${a}[${l}];`),u.write(`if (!${s}.call(${n}, ${i})) continue;`),o?u.write(o):r(u)}),e.write("}")}function qpe(e,t){return typeof t=="string"?nr(t):Ie(e,t)}function Wpe(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Map)) return INVALID;`);let o=we(t),s=we(t),a=we(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${s}, ${a}] of ${i}) {`),e.indented(c=>{let l=Rt(c,t,r.keyType,s),u=Rt(c,t,r.valueType,a);c.write(`${o}.set(${l}, ${u});`)}),e.write("}"),o}function Hpe(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Set)) return INVALID;`);let o=we(t),s=we(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${s} of ${i}) {`),e.indented(a=>{let c=Rt(a,t,r.valueType,s);a.write(`${o}.add(${c});`)}),e.write("}"),o}function Kpe(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Jpe(e,t,n,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.pattern;if(r){let o=Ie(t,r);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${i})) return INVALID;`)}return i}function Zpe(e,t,n,i){let r=n._zod.def,o=Sc(t,r.getter),s=Ie(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${s}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let a=we(t);return e.write(`const ${a} = ${s}.parser(${i});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function Ype(e,t,n,i){let r=n._zod.def,o=Rt(e,t,r.in,i);if(r.transform){if(xc(r.transform))throw new Ui("z.compile: async transforms in pipes are not supported");let s=r.transform,c=Sc(t,u=>{let d={value:u,issues:[],addIssue:AA},p=s(u,d);return p instanceof Promise?sr:d.issues.length===0?p:sr}),l=we(t);return e.write(`const ${l} = ${c}(${o});`),e.write(`if (${l} === INVALID) return INVALID;`),Rt(e,t,r.out,l)}else return Rt(e,t,r.out,o)}function xc(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Qpe(e,t,n,i){let r=n._zod.def;if(r.fn){if(xc(r.fn))throw new Ui("z.compile: async custom predicates are not supported");let o=Sc(t,r.fn),s=Ie(t,EA),a=we(t);e.write(`const ${a} = ${o}(${i});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`)}else throw new Ve("custom schema without a predicate function");return i}function Xpe(e,t,n){let i=e._zod.run({value:n,issues:[]},{});if(i&&typeof i.then=="function")return sr;let r=i;return r.issues.length===0?r.value:t()}function efe(e,t,n,i){let r=n._zod.def;if(!r.catchValue[sv])throw new Ve("catch with a callback (only a constant catch value compiles)",!1);let o=we(t);e.write(`let ${o} = (() => {`),e.indented(l=>{let u=Bn(l,t,r.innerType,i);l.write(`return ${u};`)}),e.write("})();");let s=Ie(t,r.innerType),a=Sc(t,r.catchValue),c=Ie(t,Xpe);return e.write(`if (${o} === INVALID) {`),e.indented(l=>{l.write(`${o} = ${c}(${s}, ${a}, ${i});`),l.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function tfe(e,t,n,i){let r=n._zod.def;if(r.transform){if(xc(r.transform))throw new Ui("z.compile: async transforms are not supported");let o=r.transform,a=Sc(t,l=>{let u={value:l,issues:[],addIssue:AA},d=o(l,u);return d instanceof Promise?sr:u.issues.length===0?d:sr}),c=we(t);return e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return i}function RA(e,t){return new e({type:"string",...Q(t)})}function NA(e,t){return new e({type:"string",coerce:!0,...Q(t)})}function nw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Q(t)})}function rw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Q(t)})}function iw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Q(t)})}function ow(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Q(t)})}function sw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Q(t)})}function aw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Q(t)})}function Ym(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Q(t)})}function cw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Q(t)})}function lw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Q(t)})}function uw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Q(t)})}function dw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Q(t)})}function pw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Q(t)})}function fw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Q(t)})}function mw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Q(t)})}function gw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Q(t)})}function hw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Q(t)})}function CA(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Q(t)})}function yw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Q(t)})}function bw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Q(t)})}function vw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Q(t)})}function ww(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Q(t)})}function kw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Q(t)})}function PA(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...Q(t)})}function DA(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...Q(t)})}function $w(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Q(t)})}var OA={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Qm(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Q(t)})}function Xm(e,t){return new e({type:"string",format:"date",check:"string_format",...Q(t)})}function eg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Q(t)})}function tg(e,t){return new e({type:"string",format:"duration",check:"string_format",...Q(t)})}function MA(e,t){return new e({type:"number",checks:[],...Q(t)})}function LA(e,t){return new e({type:"number",coerce:!0,checks:[],...Q(t)})}function FA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Q(t)})}function UA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Q(t)})}function jA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Q(t)})}function zA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Q(t)})}function GA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Q(t)})}function VA(e,t){return new e({type:"boolean",...Q(t)})}function BA(e,t){return new e({type:"boolean",coerce:!0,...Q(t)})}function qA(e,t){return new e({type:"bigint",...Q(t)})}function WA(e,t){return new e({type:"bigint",coerce:!0,...Q(t)})}function HA(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Q(t)})}function KA(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Q(t)})}function JA(e,t){return new e({type:"symbol",...Q(t)})}function ZA(e,t){return new e({type:"undefined",...Q(t)})}function YA(e,t){return new e({type:"null",...Q(t)})}function QA(e){return new e({type:"any"})}function XA(e){return new e({type:"unknown"})}function eR(e,t){return new e({type:"never",...Q(t)})}function tR(e,t){return new e({type:"void",...Q(t)})}function nR(e,t){return new e({type:"date",...Q(t)})}function rR(e,t){return new e({type:"date",coerce:!0,...Q(t)})}function iR(e,t){return new e({type:"nan",...Q(t)})}function po(e,t){return new kv({check:"less_than",...Q(t),value:e,inclusive:!1})}function Gr(e,t){return new kv({check:"less_than",...Q(t),value:e,inclusive:!0})}function fo(e,t){return new $v({check:"greater_than",...Q(t),value:e,inclusive:!1})}function Vr(e,t){return new $v({check:"greater_than",...Q(t),value:e,inclusive:!0})}function _w(e){return fo(0,e)}function Sw(e){return po(0,e)}function xw(e){return Gr(0,e)}function Ew(e){return Vr(0,e)}function zs(e,t){return new GI({check:"multiple_of",...Q(t),value:e})}function Gs(e,t){return new qI({check:"max_size",...Q(t),maximum:e})}function mo(e,t){return new WI({check:"min_size",...Q(t),minimum:e})}function Ec(e,t){return new HI({check:"size_equals",...Q(t),size:e})}function Tc(e,t){return new KI({check:"max_length",...Q(t),maximum:e})}function Jo(e,t){return new JI({check:"min_length",...Q(t),minimum:e})}function Ic(e,t){return new ZI({check:"length_equals",...Q(t),length:e})}function zu(e,t){return new YI({check:"string_format",format:"regex",...Q(t),pattern:e})}function Gu(e){return new QI({check:"string_format",format:"lowercase",...Q(e)})}function Vu(e){return new XI({check:"string_format",format:"uppercase",...Q(e)})}function Bu(e,t){return new e0({check:"string_format",format:"includes",...Q(t),includes:e})}function qu(e,t){return new t0({check:"string_format",format:"starts_with",...Q(t),prefix:e})}function Wu(e,t){return new n0({check:"string_format",format:"ends_with",...Q(t),suffix:e})}function Tw(e,t,n){return new r0({check:"property",property:e,schema:t,...Q(n)})}function oR(e,t,n){return new e({type:"properties",check:"properties",shape:t,...Q(n)})}function Hu(e,t){return new i0({check:"mime_type",mime:e,...Q(t)})}function ji(e){return new o0({check:"overwrite",tx:e})}function Ku(e){return ji(t=>t.normalize(e))}function Ju(){return ji(e=>e.trim())}function Zu(){return ji(e=>e.toLowerCase())}function Yu(){return ji(e=>e.toUpperCase())}function Qu(){return ji(e=>WT(e))}function sR(e,t,n){return new e({type:"array",element:t,...Q(n)})}function nfe(e,t,n){return new e({type:"union",options:t,...Q(n)})}function rfe(e,t,n){return new e({type:"union",options:t,inclusive:!1,...Q(n)})}function ife(e,t,n,i){return new e({type:"union",options:n,discriminator:t,...Q(i)})}function ofe(e,t,n){return new e({type:"intersection",left:t,right:n})}function sfe(e,t,n,i){let r=n instanceof Ce,o=r?i:n,s=r?n:null;return new e({type:"tuple",items:t,rest:s,...Q(o)})}function afe(e,t,n,i){return new e({type:"record",keyType:t,valueType:n,...Q(i)})}function cfe(e,t,n,i){return new e({type:"map",keyType:t,valueType:n,...Q(i)})}function lfe(e,t,n){return new e({type:"set",valueType:t,...Q(n)})}function ufe(e,t,n){let i=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:i,...Q(n)})}function dfe(e,t,n){return new e({type:"enum",entries:t,...Q(n)})}function pfe(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Q(n)})}function aR(e,t){return new e({type:"file",...Q(t)})}function ffe(e,t){return new e({type:"transform",transform:t})}function mfe(e,t){return new e({type:"optional",innerType:t})}function gfe(e,t){return new e({type:"nullable",innerType:t})}function hfe(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Em(n)}})}function yfe(e,t,n){return new e({type:"nonoptional",innerType:t,...Q(n)})}function bfe(e,t){return new e({type:"success",innerType:t})}function vfe(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:XT(n)})}function wfe(e,t,n){return new e({type:"pipe",in:t,out:n})}function kfe(e,t){return new e({type:"readonly",innerType:t})}function $fe(e,t,n){return new e({type:"template_literal",parts:t,...Q(n)})}function _fe(e,t){return new e({type:"lazy",getter:t})}function Sfe(e,t){return new e({type:"promise",innerType:t})}function cR(e,t,n){let i=Q(n);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function lR(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Q(n)})}function uR(e,t){let n=LB(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Nu(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(Nu(o))}},e(i.value,i)),t);return n}function LB(e,t){let n=new ht({check:"custom",...Q(t)});return n._zod.check=e,n}function dR(e){let t=new ht({check:"describe"});return t._zod.onattach=[n=>{let i=Dn.get(n)??{};Dn.add(n,{...i,description:e})}],t._zod.check=()=>{},t}function pR(e){let t=new ht({check:"meta"});return t._zod.onattach=[n=>{let i=Dn.get(n)??{};Dn.add(n,{...i,...e})}],t._zod.check=()=>{},t}function fR(e,t){let n=Q(t),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),r=r.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(r),a=e.Codec??Bm,c=e.Boolean??Gm,l=e.String??kc,u=new l({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),p=new a({type:"pipe",in:u,out:d,transform:((f,m)=>{let g=f;return n.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:s.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:p,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?i[0]||"true":r[0]||"false"),error:n.error});return p._zod.bag.truthy=i,p._zod.bag.falsy=r,p._zod.bag.case=n.case??"insensitive",p}function Xu(e,t,n,i={}){let r=Q(i),o={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...r};return n instanceof RegExp&&(o.pattern=n),new e(o)}function ng(e,...t){for(let n of t)for(let i of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Sn(e,i,n[i]);return e}function Vs(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Dn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Zt(e,t,n,i,r){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:i.path,message:r}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(r);return Object.assign(n,o),!0}function st(e,t,n={path:[],schemaPath:[]}){var i;let r=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{let p=s.schema,f=t.processors[r.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);f(e,t,p,u)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),st(d,t,u),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&ng(s.schema,c),t.io==="input"&&xn(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function FB(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Bs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let i=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=i.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.`);i.set(a,s[0])}}let r=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,p=e.external.uri??(m=>m);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${FB(f)}`}}let c="#",l=`${c}/${a}/`;if(s[1]===n&&!s[1].schema.id)return{ref:c};let u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+FB(u)}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=r(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(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/ +}`,p;try{p=new u(...s,d)(...a)}catch(f){throw new Ve(`this schema (generated code failed to evaluate: ${f.message})`)}return t?.debug&&(p.code=l),p.definite=r.definite,p}function Pe(e,t){for(let[r,i]of e.constants)if(i===t)return r;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function pc(e,t){return e.definite=!1,Pe(e,t)}function $e(e){return`v${e.varCounter++}`}function fme(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return ar;let r=n;return r.issues.length===0?r.value:ar}function Vn(e,t,n,r,i=!0){let o=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return Ct(e,t,n,r,i)}catch(l){if(!(l instanceof Ve)||!l.islandable)throw l;if(e.content.length=o,t.constants.size>s){let u=Array.from(t.constants.keys()).slice(s);for(let d of u)t.constants.delete(d)}return t.constantCounter=a,t.varCounter=c,mme(e,t,n,r)}}function mme(e,t,n,r){t.definite=!1;let i=Pe(t,n),o=Pe(t,fme),s=$e(t);return e.write(`const ${s} = ${o}(${i}, ${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var gme=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function hme(e,t,n,r){let i=n._zod.def.checks;if(!i||i.length===0)return r;let o=r;for(let s of i){let a=s._zod.def;if(a.when&&!gme.has(a.check))throw new Ve('check with a custom "when" condition');switch(a.check){case"greater_than":yme(e,t,a,o);break;case"less_than":bme(e,t,a,o);break;case"multiple_of":vme(e,t,a,o);break;case"number_format":E2(e,a,o);break;case"min_length":{let c=uc(a.minimum,"min_length"),l=_R(e,t,o,`${o}.length >= ${c} && ${o}.length < ${a.minimum*2}`);e.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=uc(a.maximum,"max_length"),l=_R(e,t,o,`${o}.length > ${c}`);e.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=uc(a.length,"length_equals"),l=_R(e,t,o,`${o}.length >= ${c} && ${o}.length <= ${a.length*2}`);e.write(`if (${l} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${uc(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${uc(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${uc(a.size,"size_equals")}) return INVALID;`);break;case"string_format":o=I2(e,t,a,o);break;case"custom":o=Sme(e,t,s,o);break;case"bigint_format":wme(e,a,o);break;case"mime_type":kme(e,t,a,o);break;case"property":_me(e,t,a,o);break;case"properties":T2(e,t,a,o,!1);break;case"overwrite":{let c=$e(t);$me(e,t,s,o,c),o=c;break}default:throw new Ve(`check type ${a.check}`)}}return o}function _R(e,t,n,r){let i=Pe(t,sc),o=$e(t);return e.write(`const ${o} = typeof ${n} === "string" && ${r} ? ${i}(${n}) : ${n}.length;`),o}function uc(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Ve(`${t} bound of type ${typeof e}`);return`${e}`}function x2(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Ve("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Ve("comparison check with Invalid Date bound");return Pe(e,t)}throw new Ve(`comparison check bound of type ${typeof t}`)}function yme(e,t,n,r){let i=n.inclusive?"<":"<=";e.write(`if (${r} ${i} ${x2(t,n.value)}) return INVALID;`)}function bme(e,t,n,r){let i=n.inclusive?">":">=";e.write(`if (${r} ${i} ${x2(t,n.value)}) return INVALID;`)}function vme(e,t,n,r){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new Ve("multiple_of check with a zero divisor");e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`)}else{let i=Pe(t,Gm);e.write(`if (${i}(${r}, ${uc(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function E2(e,t,n){let r=t.format;switch(r){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new Ve(`number format ${r}`)}}function wme(e,t,n){let r=t.format;if(r)switch(r){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new Ve(`bigint format ${r}`)}}function kme(e,t,n,r){let i=n.mime;if(i&&i.length>0){let o=Pe(t,new Set(i));e.write(`if (!${o}.has(${r}.type)) return INVALID;`)}}function T2(e,t,n,r,i){if(n.when)throw new Ve('check with a custom "when" condition');e.write(i?`if (${r} === null || (typeof ${r} !== "object" && typeof ${r} !== "function")) return INVALID;`:`if (${r} == null) return INVALID;`);let o=n.shape;for(let s of Reflect.ownKeys(o)){let a=typeof s=="symbol"?Pe(t,s):rr(s),c=$e(t);e.write(`const ${c} = ${r}[${a}];`),Vn(e,t,o[s],c,!1)}}function _me(e,t,n,r){let i=`${r}[${JSON.stringify(n.property)}]`;Ct(e,t,n.schema,i)}function $me(e,t,n,r,i){let o=n._zod.def.tx;if(!o)throw new Ve("overwrite check without a transform function");if(fc(o))throw new zi("z.compile: async overwrite transforms are not supported");let s=Pe(t,o);e.write(`const ${i} = ${s}(${r});`)}function $R(){throw new xr}function ER(e){this.issues.push(e)}function Sme(e,t,n,r){let i=n._zod.def;if(i.fn){if(fc(i.fn))throw new zi("z.compile: async .refine() predicates are not supported");let o=pc(t,i.fn),s=Pe(t,$R),a=$e(t);return e.write(`const ${a} = ${o}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),r}if(n._zod.check){if(fc(n._zod.check))throw new zi("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,a=pc(t,l=>{let u={value:l,issues:[],addIssue:ER};return o(u)instanceof Promise&&$R(),u.issues.length===0?u.value:ar}),c=$e(t);return e.write(`const ${c} = ${a}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new Ve("custom check without a predicate or check function")}var xme=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function I2(e,t,n,r){let i=n.format;if(i==="base64"){let c=Pe(t,rg);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="base64url"){let c=Pe(t,tw);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="jwt"){let c=Pe(t,iw),l=Pe(t,n.alg??null);return e.write(`if (!${c}(${r}, ${l})) return INVALID;`),r}if(i==="ipv6"){let c=Pe(t,ng);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="cidrv6"){let c=Pe(t,Xv);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="credit_card"){let c=Pe(t,nw);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="iban"){let c=Pe(t,rw);return e.write(`if (!${c}(${r})) return INVALID;`),r}let o=n;if(i==="url"||i==="httpurl"||o.normalize||o.hostname!==void 0||o.protocol!==void 0){let c=Pe(t,Jv),l=Pe(t,n),u=$e(t),d=$e(t);if(e.write(`const ${u} = ${r}.trim();`),e.write(`const ${d} = ${c}(${u}, ${l});`),e.write(`if (typeof ${d} === "number") return INVALID;`),o.hostname!==void 0){let m=Pe(t,Yv);e.write(`if (!${m}(${d}, ${l}.hostname)) return INVALID;`)}if(o.protocol!==void 0){let m=Pe(t,Qv);e.write(`if (!${m}(${d}, ${l}.protocol)) return INVALID;`)}let p=$e(t),f=o.normalize?`${d}.href`:`${Pe(t,Zv)}(${u})`;return e.write(`const ${p} = ${f};`),p}let s=n.fn;if(s){if(fc(s))throw new Ve(`async string format ${i}`);let c=Pe(t,s);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(xme.has(i)&&n.pattern){let c=Pe(t,n.pattern);return e.write(`${c}.lastIndex = 0;`),e.write(`if (!${c}.test(${r})) return INVALID;`),r}let a=n.format;switch(a){case"regex":throw new Ve("regex format without a pattern");case"lowercase":e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${r}.includes(${rr(n.includes)})) return INVALID;`);break;case"starts_with":{let c=n.prefix;e.write(`if (${r}.slice(0, ${c.length}) !== ${rr(c)}) return INVALID;`);break}case"ends_with":{let c=n.suffix;e.write(`if (${r}.slice(-${c.length}) !== ${rr(c)}) return INVALID;`);break}default:throw new Ve(`string format ${a}`)}return r}function Ct(e,t,n,r,i=!0){let o=n._zod.def,s=o.type;if(o.coerce)throw new Ve(`coercion (z.coerce.${s}())`);let a=i||!!o.checks?.length,c;switch(s){case"string":c=Eme(e,t,n,r);break;case"number":c=Tme(e,n,r);break;case"boolean":c=Ime(e,r);break;case"bigint":c=Ame(e,n,r);break;case"symbol":c=Rme(e,r);break;case"undefined":c=Pme(e,r);break;case"null":c=Cme(e,r);break;case"any":case"unknown":c=r;break;case"never":e.write("return INVALID;"),c=r;break;case"void":c=Nme(e,r);break;case"nan":c=Dme(e,r);break;case"date":c=Ome(e,r);break;case"object":c=Mme(e,t,n,r,a);break;case"optional":c=Lme(e,t,n,r,a);break;case"nullable":c=Ume(e,t,n,r,a);break;case"array":c=zme(e,t,n,r,a);break;case"literal":c=Gme(e,t,n,r);break;case"enum":c=Bme(e,t,n,r);break;case"readonly":{let l=_2(e,t,n,r),u=$e(t);e.write(`const ${u} = Object.freeze(${l});`),c=u;break}case"success":_2(e,t,n,r),c="true";break;case"default":case"prefault":c=Vme(e,t,n,r);break;case"nonoptional":c=qme(e,t,n,r);break;case"tuple":c=Wme(e,t,n,r);break;case"union":c=Hme(e,t,n,r);break;case"intersection":c=Zme(e,t,n,r);break;case"record":c=Yme(e,t,n,r);break;case"map":c=Xme(e,t,n,r);break;case"set":c=ege(e,t,n,r);break;case"file":c=tge(e,r);break;case"template_literal":c=nge(e,t,n,r);break;case"lazy":c=rge(e,t,n,r);break;case"pipe":c=ige(e,t,n,r);break;case"custom":c=oge(e,t,n,r);break;case"properties":T2(e,t,n._zod.def,r,!0),c=r;break;case"transform":c=cge(e,t,n,r);break;case"catch":c=age(e,t,n,r);break;default:throw new Ve(`schema type ${s}`)}return c===null?null:hme(e,t,n,c)}function Eme(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.def;return i.format===void 0?r:I2(e,t,i,r)}function Tme(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let r=t._zod.def;return r.check==="number_format"&&r.format&&E2(e,{format:r.format},n),n}function Ime(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function Ame(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let r=t._zod.def;if(r.format)switch(r.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function Rme(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Pme(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Cme(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function Nme(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Dme(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function Ome(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function Mme(e,t,n,r,i=!0){let o=n._zod.def;e.write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);let s=o.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),l=c.length?[...a,...c]:a,u=b=>typeof b=="symbol"?Pe(t,b):rr(b),d=b=>typeof b=="symbol"?`[${u(b)}]`:rr(b),p=s;if(a.includes("__proto__"))throw new Ve('object shape key "__proto__"');let f=new Map;for(let b of l){let w=p[b],k=u(b),$=$e(t);if(e.write(`const ${$} = ${r}[${k}];`),w._zod.optin!==void 0){let S=$e(t);e.write(`let ${S} = (() => {`),e.indented(E=>{let T=Vn(E,t,w,$);E.write(`return ${T};`)}),e.write("})();"),w._zod.optout==="optional"?(e.write(`if (${S} === INVALID) {`),e.indented(E=>{E.write(`if (${k} in ${r}) return INVALID;`),E.write(`${S} = undefined;`)}),e.write("}")):e.write(`if (${S} === INVALID) return INVALID;`),f.set(b,S)}else{jme(w)&&e.write(`if (!(${k} in ${r})) return INVALID;`);let S=Vn(e,t,w,$,i);S!==null&&f.set(b,S)}}let m=o.catchall,g="none";if(m){let b=m._zod.def.type;if(b==="never"){let w=a.map(k=>`k !== ${rr(k)}`).join(" && ")||"true";e.write(`for (const k in ${r}) {`),e.indented(k=>{k.write(`if (${w}) return INVALID;`)}),e.write("}")}else(b==="unknown"||b==="any")&&!m._zod.def.checks?.length?g="passthrough":g="schema"}let h=$e(t),v=l.some(b=>k2(p[b])||SR(p[b]));if(!i){if(g==="schema"){let b=a.length>0?Pe(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(w=>{w.write('if (k === "__proto__") continue;'),b&&w.write(`if (${b}.has(k)) continue;`);let k=$e(t);w.write(`const ${k} = ${r}[k];`),Vn(w,t,m,k,!1)}),e.write("}")}return null}if(v){e.write(`const ${h} = {};`);for(let b of l){let w=u(b),k=f.get(b);SR(p[b])?e.write(`if (${w} in ${r}) ${h}[${w}] = ${k};`):k2(p[b])?e.write(`if (${k} !== undefined || ${w} in ${r}) ${h}[${w}] = ${k};`):e.write(`${h}[${w}] = ${k};`)}}else{let b=l.map(w=>`${d(w)}: ${f.get(w)}`).join(", ");e.write(`const ${h} = { ${b} };`)}if(g!=="none"){let b=a.length>0?Pe(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(w=>{if(w.write('if (k === "__proto__") continue;'),b&&w.write(`if (${b}.has(k)) continue;`),g==="passthrough")w.write(`${h}[k] = ${r}[k];`);else{let k=$e(t);w.write(`const ${k} = ${r}[k];`);let $=Vn(w,t,m,k);w.write(`${h}[k] = ${$};`)}}),e.write("}")}return h}function Lme(e,t,n,r,i=!0){let o=n._zod.def;if(Fme(n))return Ct(e,t,o.innerType,r,i);if(o.innerType._zod.optin==="defaulted"){let a=$e(t),c=$e(t);return e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(l=>{l.write(`const ${c} = (() => {`),l.indented(u=>{let d=Ct(u,t,o.innerType,r);u.write(`return ${d};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${a} = ${c};`)}),e.write("} else {"),e.indented(l=>{let u=Ct(l,t,o.innerType,r);l.write(`${a} = ${u};`)}),e.write("}"),a}let s=i?$e(t):null;return s&&e.write(`let ${s};`),e.write(`if (${r} !== undefined) {`),e.indented(a=>{let c=Ct(a,t,o.innerType,r,i);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function Fme(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function jme(e){return e._zod.optin===void 0&&dc(e)}function dc(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?dc(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?dc(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(dc):!0;case"intersection":return!t.left||!t.right?!0:dc(t.left)&&dc(t.right);case"pipe":return t.in?dc(t.in):!0;default:return!0}}function SR(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function k2(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&_u(e)}function _u(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?_u(t.innerType):!0;case"union":return t.options?t.options.some(_u):!0;case"intersection":return!t.left||!t.right||_u(t.left)||_u(t.right);case"pipe":return t.out?_u(t.out):!0;default:return!0}}function Ume(e,t,n,r,i=!0){let o=n._zod.def,s=i?$e(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${r} !== null) {`),e.indented(a=>{let c=Ct(a,t,o.innerType,r,i);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function zme(e,t,n,r,i=!0){let o=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`);let s=i?$e(t):null,a=$e(t),c=$e(t);return s&&e.write(`const ${s} = new Array(${r}.length);`),e.write(`for (let ${a} = 0; ${a} < ${r}.length; ${a}++) {`),e.indented(l=>{l.write(`const ${c} = ${r}[${a}];`);let u=Vn(l,t,o.element,c,i);s&&u!==null&&l.write(`${s}[${a}] = ${u};`)}),e.write("}"),s}function Gme(e,t,n,r){let o=n._zod.def.values;if(o.length!==1){let a=Pe(t,new Set(o));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}let s=o[0];if(typeof s=="number"&&Number.isNaN(s)){let a=Pe(t,new Set(o));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}if(typeof s=="string")e.write(`if (${r} !== ${rr(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${r} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${r} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${r} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${r} !== ${s}n) return INVALID;`);else throw new Ve(`literal type ${typeof s}`);return r}function Bme(e,t,n,r){let i=n._zod.values;if(!i)throw new Ve("enum schema without enumerated values");let o=Pe(t,i);return e.write(`if (!${o}.has(${r})) return INVALID;`),r}function _2(e,t,n,r){let i=n._zod.def;return Ct(e,t,i.innerType,r)}function Vme(e,t,n,r){let i=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return Ct(e,t,i.innerType,r);let c=Pe(t,s),l=$e(t);return e.write(`let ${l} = ${r};`),e.write(`if (${r} === undefined) ${l} = ${c}();`),Ct(e,t,i.innerType,l)}let a=$e(t);if(s){let c=Pe(t,s),l=Pe(t,Bm);e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(u=>{u.write(`${a} = ${l}(${c}());`)}),e.write("} else {"),e.indented(u=>{let d=Ct(u,t,i.innerType,r);u.write(`${a} = ${d} === undefined ? ${l}(${c}()) : ${d};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${r} !== undefined) {`),e.indented(c=>{let l=Ct(c,t,i.innerType,r);c.write(`${a} = ${l};`)}),e.write("}");return a}function qme(e,t,n,r){let i=n._zod.def,o=Ct(e,t,i.innerType,r),s=$e(t);return e.write(`const ${s} = ${o};`),e.write(`if (${s} === undefined) return INVALID;`),s}function Wme(e,t,n,r){let i=n._zod.def,o=i.items,s=i.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);let a=$2(o,"optin"),c=$2(o,"optout");s?e.write(`if (${r}.length < ${a}) return INVALID;`):e.write(`if (${r}.length < ${a} || ${r}.length > ${o.length}) return INVALID;`);let l=$e(t);e.write(`const ${l} = [];`);for(let u=0;u=c)e.write(`if (${l}.length === ${u}) {`),e.indented(p=>{p.write(`if (${u} < ${r}.length) {`),p.indented(f=>{let m=$e(t);f.write(`const ${m} = ${r}[${u}];`);let g=Vn(f,t,d,m);f.write(`${l}[${u}] = ${g};`)}),p.write("} else {"),p.indented(f=>{if(SR(d)){f.write(`${l}.length = ${u};`);return}let m=$e(t),g=$e(t);f.write(`const ${m} = undefined;`),f.write(`const ${g} = (() => {`),f.indented(h=>{let v=Vn(h,t,d,m);h.write(`return ${v};`)}),f.write("})();"),f.write(`if (${g} === INVALID || ${g} === undefined) ${l}.length = ${u};`),f.write(`else ${l}[${u}] = ${g};`)}),p.write("}")}),e.write("}");else{let p=$e(t);e.write(`const ${p} = ${r}[${u}];`);let f=Vn(e,t,d,p);e.write(`${l}[${u}] = ${f};`)}}if(s){let u=$e(t),d=$e(t);e.write(`for (let ${u} = ${o.length}; ${u} < ${r}.length; ${u}++) {`),e.indented(p=>{p.write(`const ${d} = ${r}[${u}];`);let f=Vn(p,t,s,d);p.write(`${l}[${u}] = ${f};`)}),e.write("}")}return l}function $2(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function Hme(e,t,n,r){let i=n._zod.def,o=i.options;if(i.discriminator)return Kme(e,t,i,r);if(i.inclusive===!1)throw new Ve("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),r;if(o.length===1)return Ct(e,t,o[0],r);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(u=>u._zod.def.values)),l=Pe(t,c);return e.write(`if (!${l}.has(${r})) return INVALID;`),r}let a=$e(t);e.write(`let ${a};`);for(let c=0;c {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(u=>{let d=Ct(u,t,l,r);u.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function Kme(e,t,n,r){if(n.unionFallback)throw new Ve("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),r;let i=$e(t),o=$e(t);e.write(`const ${i} = ${r}?.[${rr(n.discriminator)}];`),e.write(`let ${o};`);let s=!0,a=new Set;for(let c of n.options){let l=c._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new Ve("discriminated union option without static discriminator values");for(let p of l){if(a.has(p))throw new Ve(`duplicate discriminator value ${String(p)}`);a.add(p)}let u=Array.from(l,p=>Jme(t,i,p)),d=s?"if":"else if";e.write(`${d} (${u.join(" || ")}) {`),e.indented(p=>{let f=Ct(p,t,c,r);p.write(`${o} = ${f};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),o}function Jme(e,t,n){if(typeof n=="string")return`${t} === ${rr(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let r=Pe(e,n);return`${t} === ${r}`}throw new Ve(`literal discriminator value ${String(n)}`)}function Zme(e,t,n,r){let i=n._zod.def;t.definite=!1;let o=Vn(e,t,i.left,r),s=Vn(e,t,i.right,r),a=Pe(t,vu),c=$e(t);return e.write(`const ${c} = ${a}(${o}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function Yme(e,t,n,r){let i=n._zod.def,o=Pe(t,ai);e.write(`if (!${o}(${r})) return INVALID;`);let s=$e(t),a=$e(t),c=$e(t);e.write(`const ${s} = {};`);let l=i,u=l.partial?void 0:i.keyType._zod.values;if(u){let f=[];for(let g of u){if(!(typeof g=="string"||typeof g=="number"||typeof g=="symbol"))throw new Ve(`record key value ${String(g)}`);let h=typeof g=="number"?g.toString():g;if(h==="__proto__")throw new Ve('record key "__proto__"');f.push(h);let v=Pe(t,g),b=Ct(e,t,i.keyType,v),w=$e(t);e.write(`const ${w} = ${r}[${Qme(t,h)}];`);let k=Vn(e,t,i.valueType,w);e.write(`${s}[${b}] = ${k};`)}let m=Pe(t,new Set(f));return e.write(`for (const ${a} in ${r}) {`),e.indented(g=>{g.write(`if (${m}.has(${a})) continue;`),l.mode==="loose"?g.write(`if (${a} !== "__proto__") ${s}[${a}] = ${r}[${a}];`):g.write("return INVALID;")}),e.write("}"),s}let d=i.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let f=i.mode==="loose",m=_w(i.keyType);m.definite===!1&&(t.definite=!1);let g=Pe(t,m),h=Pe(t,Jo),v=$e(t);return S2(e,t,r,a,b=>{b.write(`let ${v} = ${g}(${a});`),b.write(`if (${v} === INVALID && typeof ${a} === "string" && ${h}.test(${a})) ${v} = ${g}(Number(${a}));`),f?b.write(`if (${v} === INVALID) { ${s}[${a}] = ${r}[${a}]; continue; }`):b.write(`if (${v} === INVALID) return INVALID;`),b.write(`if (${v} === "__proto__") continue;`);let w=$e(t);b.write(`const ${w} = ${r}[${a}];`);let k=Vn(b,t,i.valueType,w);b.write(`${s}[${v}] = ${k};`)}),s}return S2(e,t,r,a,f=>{f.write(`const ${c} = ${r}[${a}];`);let m=Vn(f,t,i.valueType,c);f.write(`${s}[${a}] = ${m};`)},"return INVALID;"),s}function S2(e,t,n,r,i,o){let s=Pe(t,Object.prototype.propertyIsEnumerable),a=$e(t),c=$e(t),l=$e(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${c} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${r} = ${c}[${l}];`),u.write(`if (${r} === "__proto__" || !${s}.call(${n}, ${r})) continue;`),i(u)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${a}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${r} = ${a}[${l}];`),u.write(`if (!${s}.call(${n}, ${r})) continue;`),o?u.write(o):i(u)}),e.write("}")}function Qme(e,t){return typeof t=="string"?rr(t):Pe(e,t)}function Xme(e,t,n,r){let i=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`);let o=$e(t),s=$e(t),a=$e(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${s}, ${a}] of ${r}) {`),e.indented(c=>{let l=Ct(c,t,i.keyType,s),u=Ct(c,t,i.valueType,a);c.write(`${o}.set(${l}, ${u});`)}),e.write("}"),o}function ege(e,t,n,r){let i=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`);let o=$e(t),s=$e(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${s} of ${r}) {`),e.indented(a=>{let c=Ct(a,t,i.valueType,s);a.write(`${o}.add(${c});`)}),e.write("}"),o}function tge(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function nge(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.pattern;if(i){let o=Pe(t,i);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${r})) return INVALID;`)}return r}function rge(e,t,n,r){let i=n._zod.def,o=pc(t,i.getter),s=Pe(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${s}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let a=$e(t);return e.write(`const ${a} = ${s}.parser(${r});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function ige(e,t,n,r){let i=n._zod.def,o=Ct(e,t,i.in,r);if(i.transform){if(fc(i.transform))throw new zi("z.compile: async transforms in pipes are not supported");let s=i.transform,c=pc(t,u=>{let d={value:u,issues:[],addIssue:ER},p=s(u,d);return p instanceof Promise?ar:d.issues.length===0?p:ar}),l=$e(t);return e.write(`const ${l} = ${c}(${o});`),e.write(`if (${l} === INVALID) return INVALID;`),Ct(e,t,i.out,l)}else return Ct(e,t,i.out,o)}function fc(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function oge(e,t,n,r){let i=n._zod.def;if(i.fn){if(fc(i.fn))throw new zi("z.compile: async custom predicates are not supported");let o=pc(t,i.fn),s=Pe(t,$R),a=$e(t);e.write(`const ${a} = ${o}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`)}else throw new Ve("custom schema without a predicate function");return r}function sge(e,t,n){let r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then=="function")return ar;let i=r;return i.issues.length===0?i.value:t()}function age(e,t,n,r){let i=n._zod.def;if(!i.catchValue[Tv])throw new Ve("catch with a callback (only a constant catch value compiles)",!1);let o=$e(t);e.write(`let ${o} = (() => {`),e.indented(l=>{let u=Vn(l,t,i.innerType,r);l.write(`return ${u};`)}),e.write("})();");let s=Pe(t,i.innerType),a=pc(t,i.catchValue),c=Pe(t,sge);return e.write(`if (${o} === INVALID) {`),e.indented(l=>{l.write(`${o} = ${c}(${s}, ${a}, ${r});`),l.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function cge(e,t,n,r){let i=n._zod.def;if(i.transform){if(fc(i.transform))throw new zi("z.compile: async transforms are not supported");let o=i.transform,a=pc(t,l=>{let u={value:l,issues:[],addIssue:ER},d=o(l,u);return d instanceof Promise?ar:u.issues.length===0?d:ar}),c=$e(t);return e.write(`const ${c} = ${a}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return r}function TR(e,t){return new e({type:"string",...ee(t)})}function IR(e,t){return new e({type:"string",coerce:!0,...ee(t)})}function $w(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ee(t)})}function Sw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ee(t)})}function xw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ee(t)})}function Ew(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ee(t)})}function Tw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ee(t)})}function Iw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ee(t)})}function mg(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ee(t)})}function Aw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ee(t)})}function Rw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ee(t)})}function Pw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ee(t)})}function Cw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ee(t)})}function Nw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ee(t)})}function Dw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ee(t)})}function Ow(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ee(t)})}function Mw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ee(t)})}function Lw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ee(t)})}function AR(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ee(t)})}function Fw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ee(t)})}function jw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ee(t)})}function Uw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ee(t)})}function zw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ee(t)})}function Gw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ee(t)})}function RR(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...ee(t)})}function PR(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...ee(t)})}function Bw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ee(t)})}var CR={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function gg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ee(t)})}function hg(e,t){return new e({type:"string",format:"date",check:"string_format",...ee(t)})}function yg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ee(t)})}function bg(e,t){return new e({type:"string",format:"duration",check:"string_format",...ee(t)})}function NR(e,t){return new e({type:"number",checks:[],...ee(t)})}function DR(e,t){return new e({type:"number",coerce:!0,checks:[],...ee(t)})}function OR(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ee(t)})}function MR(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ee(t)})}function LR(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ee(t)})}function FR(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ee(t)})}function jR(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ee(t)})}function UR(e,t){return new e({type:"boolean",...ee(t)})}function zR(e,t){return new e({type:"boolean",coerce:!0,...ee(t)})}function GR(e,t){return new e({type:"bigint",...ee(t)})}function BR(e,t){return new e({type:"bigint",coerce:!0,...ee(t)})}function VR(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ee(t)})}function qR(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ee(t)})}function WR(e,t){return new e({type:"symbol",...ee(t)})}function HR(e,t){return new e({type:"undefined",...ee(t)})}function KR(e,t){return new e({type:"null",...ee(t)})}function JR(e){return new e({type:"any"})}function ZR(e){return new e({type:"unknown"})}function YR(e,t){return new e({type:"never",...ee(t)})}function QR(e,t){return new e({type:"void",...ee(t)})}function XR(e,t){return new e({type:"date",...ee(t)})}function eP(e,t){return new e({type:"date",coerce:!0,...ee(t)})}function tP(e,t){return new e({type:"nan",...ee(t)})}function uo(e,t){return new Gv({check:"less_than",...ee(t),value:e,inclusive:!1})}function Ur(e,t){return new Gv({check:"less_than",...ee(t),value:e,inclusive:!0})}function po(e,t){return new Bv({check:"greater_than",...ee(t),value:e,inclusive:!1})}function zr(e,t){return new Bv({check:"greater_than",...ee(t),value:e,inclusive:!0})}function Vw(e){return po(0,e)}function qw(e){return uo(0,e)}function Ww(e){return Ur(0,e)}function Hw(e){return zr(0,e)}function Fs(e,t){return new jA({check:"multiple_of",...ee(t),value:e})}function js(e,t){return new GA({check:"max_size",...ee(t),maximum:e})}function fo(e,t){return new BA({check:"min_size",...ee(t),minimum:e})}function mc(e,t){return new VA({check:"size_equals",...ee(t),size:e})}function gc(e,t){return new qA({check:"max_length",...ee(t),maximum:e})}function Zo(e,t){return new WA({check:"min_length",...ee(t),minimum:e})}function hc(e,t){return new HA({check:"length_equals",...ee(t),length:e})}function $u(e,t){return new KA({check:"string_format",format:"regex",...ee(t),pattern:e})}function Su(e){return new JA({check:"string_format",format:"lowercase",...ee(e)})}function xu(e){return new ZA({check:"string_format",format:"uppercase",...ee(e)})}function Eu(e,t){return new YA({check:"string_format",format:"includes",...ee(t),includes:e})}function Tu(e,t){return new QA({check:"string_format",format:"starts_with",...ee(t),prefix:e})}function Iu(e,t){return new XA({check:"string_format",format:"ends_with",...ee(t),suffix:e})}function Kw(e,t,n){return new e0({check:"property",property:e,schema:t,...ee(n)})}function nP(e,t,n){return new e({type:"properties",check:"properties",shape:t,...ee(n)})}function Au(e,t){return new t0({check:"mime_type",mime:e,...ee(t)})}function Gi(e){return new n0({check:"overwrite",tx:e})}function Ru(e){return Gi(t=>t.normalize(e))}function Pu(){return Gi(e=>e.trim())}function Cu(){return Gi(e=>e.toLowerCase())}function Nu(){return Gi(e=>e.toUpperCase())}function Du(){return Gi(e=>BI(e))}function rP(e,t,n){return new e({type:"array",element:t,...ee(n)})}function lge(e,t,n){return new e({type:"union",options:t,...ee(n)})}function uge(e,t,n){return new e({type:"union",options:t,inclusive:!1,...ee(n)})}function dge(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...ee(r)})}function pge(e,t,n){return new e({type:"intersection",left:t,right:n})}function fge(e,t,n,r){let i=n instanceof Ne,o=i?r:n,s=i?n:null;return new e({type:"tuple",items:t,rest:s,...ee(o)})}function mge(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...ee(r)})}function gge(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...ee(r)})}function hge(e,t,n){return new e({type:"set",valueType:t,...ee(n)})}function yge(e,t,n){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new e({type:"enum",entries:r,...ee(n)})}function bge(e,t,n){return new e({type:"enum",entries:t,...ee(n)})}function vge(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ee(n)})}function iP(e,t){return new e({type:"file",...ee(t)})}function wge(e,t){return new e({type:"transform",transform:t})}function kge(e,t){return new e({type:"optional",innerType:t})}function _ge(e,t){return new e({type:"nullable",innerType:t})}function $ge(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Bm(n)}})}function Sge(e,t,n){return new e({type:"nonoptional",innerType:t,...ee(n)})}function xge(e,t){return new e({type:"success",innerType:t})}function Ege(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:ZI(n)})}function Tge(e,t,n){return new e({type:"pipe",in:t,out:n})}function Ige(e,t){return new e({type:"readonly",innerType:t})}function Age(e,t,n){return new e({type:"template_literal",parts:t,...ee(n)})}function Rge(e,t){return new e({type:"lazy",getter:t})}function Pge(e,t){return new e({type:"promise",innerType:t})}function oP(e,t,n){let r=ee(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function sP(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ee(n)})}function aP(e,t){let n=A2(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(fu(i,r.value,n._zod.def));else{let o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=r.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),r.issues.push(fu(o))}},e(r.value,r)),t);return n}function A2(e,t){let n=new ht({check:"custom",...ee(t)});return n._zod.check=e,n}function cP(e){let t=new ht({check:"describe"});return t._zod.onattach=[n=>{let r=Nn.get(n)??{};Nn.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function lP(e){let t=new ht({check:"meta"});return t._zod.onattach=[n=>{let r=Nn.get(n)??{};Nn.add(n,{...r,...e})}],t._zod.check=()=>{},t}function uP(e,t){let n=ee(t),r=n.truthy??["true","1","yes","on","y","enabled"],i=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(f=>typeof f=="string"?f.toLowerCase():f),i=i.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(r),s=new Set(i),a=e.Codec??ag,c=e.Boolean??og,l=e.String??lc,u=new l({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),p=new a({type:"pipe",in:u,out:d,transform:((f,m)=>{let g=f;return n.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:s.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:p,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?r[0]||"true":i[0]||"false"),error:n.error});return p._zod.bag.truthy=r,p._zod.bag.falsy=i,p._zod.bag.case=n.case??"insensitive",p}function Ou(e,t,n,r={}){let i=ee(r),o={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...i};return n instanceof RegExp&&(o.pattern=n),new e(o)}function vg(e,...t){for(let n of t)for(let r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&$n(e,r,n[r]);return e}function Us(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Nn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Zt(e,t,n,r,i){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(i);return Object.assign(n,o),!0}function ot(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{let p=s.schema,f=t.processors[i.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);f(e,t,p,u)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),ot(d,t,u),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&vg(s.schema,c),t.io==="input"&&Sn(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function R2(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function zs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=r.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.`);r.set(a,s[0])}}let i=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,p=e.external.uri??(m=>m);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${R2(f)}`}}let c="#",l=`${c}/${a}/`;if(s[1]===n&&!s[1].schema.id)return{ref:c};let u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+R2(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(e.cycles==="throw")for(let s of e.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 e.seen.entries()){let a=s[1];if(t===s[0]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}a.count>1&&e.reused==="ref"&&o(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function zB(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let i of t){if(!i||typeof i!="object")return;zB(i);let r=Object.keys(i);if(r.length!==1||r[0]!=="type")return;let o=i.type;for(let s of Array.isArray(o)?o:[o]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var GB=new Set(["type","properties","required","additionalProperties"]),UB=["oneOf","anyOf"];function jB(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function mR(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let s in o)if(!GB.has(s))return null;t.push(o)}let n={},i=new Set;for(let o of t){for(let s in o.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let l of t){let u=l.properties?.[s]??jB(l);u!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(u))||a.push(u))}let c=a.length===1?a[0]:mR(a)??{allOf:a};Sn(n,s,c)}for(let s of o.required??[])i.add(s)}let r={type:"object",properties:n};if(i.size&&(r.required=[...i]),t.every(o=>o.additionalProperties===!1))r.additionalProperties=!1;else{let o=[];for(let s of t){let a=jB(s);a&&!o.some(c=>JSON.stringify(c)===JSON.stringify(a))&&o.push(a)}o.length===1?r.additionalProperties=o[0]:o.length>1&&(r.additionalProperties={allOf:o})}return r}function xfe(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let r of GB)if(r in e)return;let n=t.filter(r=>UB.some(o=>Array.isArray(r[o]))),i=null;if(!n.length)i=mR(t);else{let r=n[0],o=UB.find(c=>Array.isArray(r[c]));if(Object.keys(r).length!==1)return;let s=t.filter(c=>c!==r),a=r[o].map(c=>mR([...s,c]));if(a.some(c=>!c))return;i={[o]:a}}i&&(delete e.allOf,ng(e,i))}function qs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let c=e.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){i(d);let f=e.seen.get(d),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):ng(l,m),ng(l,u),a._zod.parent===d)for(let h in l)h==="$ref"||h==="allOf"||h in u||delete l[h];if(m.$ref&&f.def)for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}let p=a._zod.parent;if(p&&p!==d){i(p);let f=e.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let m in l)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(l[m])===JSON.stringify(f.def[m])&&delete l[m]}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())i(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())zB(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let u=l?.allOf;if(!Array.isArray(u))continue;let d=a.get(u);d?d.push(l):a.set(u,[l])}for(let c of e.intersections)for(let l of a.get(c)??[])xfe(l)}}let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(a)}ng(r,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&r.id===o&&delete r.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Sn(s,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:ed(t,"input",e.processors),output:ed(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function xn(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return xn(i.element,n);if(i.type==="set")return xn(i.valueType,n);if(i.type==="lazy")return xn(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return xn(i.innerType,n);if(i.type==="intersection")return xn(i.left,n)||xn(i.right,n);if(i.type==="record"||i.type==="map")return xn(i.keyType,n)||xn(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:xn(i.in,n)||xn(i.out,n);if(i.type==="object"){for(let r in i.shape)if(xn(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(xn(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(xn(r,n))return!0;return!!(i.rest&&xn(i.rest,n))}return!1}var gR=(e,t={})=>n=>{let i=Vs({...n,processors:t});return st(e,i),Bs(i,e),qs(i,e)},ed=(e,t,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=Vs({...r??{},target:o,io:t,processors:n});return st(e,s),Bs(s,e),qs(s,e)};var td=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},nd=(e,t,n)=>{(e[t]===void 0||n{td(e,"minimum",t),nd(e,"maximum",t)},HB=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},KB=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},JB=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},ZB=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},BB=(e,t)=>td(e,"minimum",t.minimum),qB=(e,t)=>nd(e,"maximum",t.maximum),WB=e=>(t,n)=>{ZB(t,n.format);let[i,r]=e[n.format];td(t,"minimum",i),nd(t,"maximum",r)},Efe={greater_than:(e,t)=>td(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>nd(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>HB(e,t.value),number_format:WB(Im),bigint_format:WB(Am),min_length:BB,max_length:qB,length_equals:(e,t)=>VB(e,t.length),min_size:BB,max_size:qB,size_equals:(e,t)=>VB(e,t.size),string_format:(e,t)=>{ZB(e,t.format),t.pattern&&KB(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>JB(e,t.mime)};function yn(e){let t={},n=e._zod.def,i=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let o of i)Efe[o._zod.def.check]?.(t,o._zod.def);let r=e._zod.bag;r.minimum!==void 0&&td(t,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&td(t,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&nd(t,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&nd(t,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&HB(t,r.multipleOf),r.format!==void 0&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&JB(t,r.mime);for(let o of r.patterns??[])KB(t,o);return t}var Tfe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ife=new Map([[Pv,xI],[zm,EI]]),YB=e=>Ife.get(e)??e,bR=(e,t,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l,laxFormat:u}=yn(e);if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),a&&(r.format=Tfe[a]??a,r.format===""&&delete r.format,(a==="time"||u)&&delete r.format),l&&(r.contentEncoding=l),c&&c.size>0){let d=[...c].map(YB);d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},vR=(e,t,n,i)=>{let r=n,{minimum:o,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=yn(e);r.type=u?"integer":"number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(d?f?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof o=="number"&&(r.minimum=o),p?f?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:typeof s=="number"&&(r.maximum=s),a){let m=new Set;for(let b of a)Number.isFinite(b)&&b!==0?m.add(Math.abs(b)):Zt(e,t,r,i,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[g,...h]=m;g!==void 0&&(r.multipleOf=g),h.length&&(r.allOf=[...r.allOf??[],...h.map(b=>({multipleOf:b}))])}},wR=(e,t,n,i)=>{n.type="boolean"},kR=(e,t,n,i)=>{Zt(e,t,n,i,"BigInt cannot be represented in JSON Schema")},$R=(e,t,n,i)=>{Zt(e,t,n,i,"Symbols cannot be represented in JSON Schema")},_R=(e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},SR=(e,t,n,i)=>{Zt(e,t,n,i,"Undefined cannot be represented in JSON Schema")},xR=(e,t,n,i)=>{Zt(e,t,n,i,"Void cannot be represented in JSON Schema")},ER=(e,t,n,i)=>{n.not={}},TR=(e,t,n,i)=>{},IR=(e,t,n,i)=>{},AR=(e,t,n,i)=>{Zt(e,t,n,i,"Date cannot be represented in JSON Schema")},RR=(e,t,n,i)=>{let r=e._zod.def,o=Tu(r.entries);if(o.length===0){n.not={};return}o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},NR=(e,t,n,i)=>{let r=e._zod.def;if(r.values.length===0){n.not={};return}let o=[];for(let s of r.values)if(s===void 0){if(Zt(e,t,n,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Zt(e,t,n,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},CR=(e,t,n,i)=>{Zt(e,t,n,i,"NaN cannot be represented in JSON Schema")},PR=(e,t,n,i)=>{let r=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},DR=(e,t,n,i)=>{let r=n;r.type="string",r.format="binary",r.contentEncoding="binary";let{minimum:o,maximum:s,mime:a}=yn(e);o!==void 0&&(r.minLength=o),s!==void 0&&(r.maxLength=s),a&&(a.length===0?r.not={}:a.length===1?r.contentMediaType=a[0]:r.anyOf=a.map(c=>({contentMediaType:c})))},OR=(e,t,n,i)=>{n.type="boolean"},MR=(e,t,n,i)=>{Zt(e,t,n,i,"Custom types cannot be represented in JSON Schema")},LR=(e,t,n,i)=>{Zt(e,t,n,i,"Function types cannot be represented in JSON Schema")},FR=(e,t,n,i)=>{Zt(e,t,n,i,"Transforms cannot be represented in JSON Schema")},UR=(e,t,n,i)=>{Zt(e,t,n,i,"Map cannot be represented in JSON Schema")},jR=(e,t,n,i)=>{Zt(e,t,n,i,"Set cannot be represented in JSON Schema")},zR=(e,t,n,i)=>{let r=n,o=e._zod.def,{minimum:s,maximum:a}=yn(e);typeof s=="number"&&(r.minItems=s),typeof a=="number"&&(r.maxItems=a),r.type="array",r.items=st(o.element,t,{...i,path:[...i.path,"items"]})};function rd(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?rd(t.out):t.type==="catch"?rd(t.innerType):e._zod.optin}var GR=(e,t,n,i)=>{let r=n,o=e._zod.def,s=o.shape;if(Object.getOwnPropertySymbols(s).length&&Zt(e,t,r,i,"Symbol keys cannot be represented in JSON Schema"))return;r.type="object",r.properties={};for(let u in s)Sn(r.properties,u,st(s[u],t,{...i,path:[...i.path,"properties",u]}));let c=new Set(Object.keys(s)),l=new Set([...c].filter(u=>{let d=o.shape[u];return t.io==="input"?rd(d)===void 0:d._zod.optout===void 0}));l.size>0&&(r.required=Array.from(l)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=st(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},Afe=(e,t,n,i)=>{let r=n,o=e._zod.def;if(Object.getOwnPropertySymbols(o.shape).length&&Zt(e,t,r,i,"Symbol keys cannot be represented in JSON Schema"))return;if(t.io==="output"){for(let a in o.shape)if(xn(o.shape[a])&&Zt(e,t,r,i,`z.properties() returns its input, so the output of a transforming schema at key "${a}" cannot be represented in JSON Schema`))return}r.type="object",r.properties={};for(let a in o.shape)Sn(r.properties,a,st(o.shape[a],t,{...i,path:[...i.path,"properties",a]}));let s=Object.keys(o.shape).filter(a=>rd(o.shape[a])===void 0);s.length>0&&(r.required=s)},Aw=(e,t,n,i)=>{let r=e._zod.def,o=r.inclusive===!1,s=r.options.map((a,c)=>st(a,t,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=s:n.anyOf=s},VR=(e,t,n,i)=>{let r=e._zod.def,o=st(r.left,t,{...i,path:[...i.path,"allOf",0]}),s=st(r.right,t,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=c,t.intersections.push(c)},BR=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((g,h)=>st(g,t,{...i,path:[...i.path,s,h]})),l=o.rest?st(o.rest,t,{...i,path:[...i.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,u=o.items.length;for(;u>0;){let g=o.items[u-1];if(!(t.io==="input"?rd(g)!==void 0:g._zod.optout==="optional"))break;u--}let d=o.items.length,p=!o.rest;t.target==="draft-2020-12"?(r.prefixItems=c,p?r.items=!1:l&&(r.items=l),u>0&&(r.minItems=u),p&&(r.maxItems=d)):t.target==="openapi-3.0"?(r.items={anyOf:c},l&&r.items.anyOf.push(l),u>0&&(r.minItems=u),p&&(r.maxItems=d)):(r.items=c,p?r.additionalItems=!1:l&&(r.additionalItems=l),u>0&&(r.minItems=u),p&&(r.maxItems=d));let{minimum:f,maximum:m}=yn(e);typeof f=="number"&&(r.minItems=f),typeof m=="number"&&(r.maxItems=m)};function hR(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let g=hR(e,m,n);return g===m?t:g}for(let m of["anyOf","oneOf"]){let g=t[m];if(!Array.isArray(g))continue;let h=g.map(b=>hR(e,b,n));h.some((b,y)=>b!==g[y])&&(t={...t,[m]:h})}let i=Array.isArray(t.type)?t.type:[t.type],r=!i.includes("string")&&i.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!r&&!o?.some(m=>typeof m=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:p,...f}=t;return f.enum?f.enum=f.enum.map(m=>typeof m=="number"?String(m):m):typeof f.const=="number"&&(f.const=String(f.const)),r&&(f.type="string",o||(f.pattern=(i.includes("number")?Ko:Mm).source)),f}var yR=new WeakMap;function Rfe(e){let t=new Map;for(let i of e.seen.values())i.def&&!t.has(i.schema)&&t.set(i.schema,i);let n=new Map;for(let i of yR.get(e)??[]){let r=e.seen.get(i),o=(r?.def??r?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let s=hR(t,o,new Set);s!==o&&n.set(o,s)}if(n.size)for(let i of e.seen.values())for(let r of[i.schema,i.def]){let o=r&&n.get(r.propertyNames);o&&(r.propertyNames=o)}}var qR=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="object";let s=o.keyType,a=yn(s).patterns;if(o.mode==="loose"&&a&&a.size>0){let u=st(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let d of a)Sn(r.patternProperties,YB(d).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){r.propertyNames=st(o.keyType,t,{...i,path:[...i.path,"propertyNames"]});let u=yR.get(t);u||(u=[],yR.set(t,u),t.deferred.push(()=>Rfe(t))),u.push(e)}r.additionalProperties=st(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let c=s._zod.values,l=t.io==="input"&&rd(o.valueType)!==void 0;if(c&&!o.partial&&!l){let u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(r.required=u.map(String))}},WR=(e,t,n,i)=>{let r=e._zod.def,o=st(r.innerType,t,i),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},HR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},KR=Symbol();function QB(e,t,n,i,r){let o=!1,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(Zt(t,n,i,r,"BigInt defaults cannot be represented in JSON Schema"),KR):JSON.parse(s)}var JR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let s=QB(r.defaultValue,e,t,n,i);s!==KR&&(n.default=s)},ZR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);if(o.ref=r.innerType,t.io!=="input")return;let s=QB(r.defaultValue,e,t,n,i);s!==KR&&(n._prefault=s)},YR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{Zt(e,t,n,i,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},QR=(e,t,n,i)=>{let r=e._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?o?r.out:r.in:r.out;st(s,t,i);let a=t.seen.get(e);a.ref=s},XR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType,n.readOnly=!0},eN=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},Rw=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},tN=(e,t,n,i)=>{let r=e._zod.innerType;st(r,t,i);let o=t.seen.get(e);o.ref=r},Iw={string:bR,number:vR,boolean:wR,bigint:kR,symbol:$R,null:_R,undefined:SR,void:xR,never:ER,any:TR,unknown:IR,date:AR,enum:RR,literal:NR,nan:CR,template_literal:PR,file:DR,success:OR,custom:MR,properties:Afe,function:LR,transform:FR,map:UR,set:jR,array:zR,object:GR,union:Aw,intersection:VR,tuple:BR,record:qR,nullable:WR,nonoptional:HR,default:JR,prefault:ZR,catch:YR,pipe:QR,readonly:XR,promise:eN,optional:Rw,lazy:tN};function Nw(e,t){if("_idmap"in e){let i=e,r=Vs({...t,processors:Iw}),o={};for(let c of i._idmap.entries()){let[l,u]=c;st(u,r)}let s={},a={registry:i,uri:t?.uri,defs:o};r.external=a;for(let c of i._idmap.entries()){let[l,u]=c;Bs(r,u),Sn(s,l,qs(r,u))}if(Object.keys(o).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let n=Vs({...t,processors:Iw});return st(e,n),Bs(n,e),qs(n,e)}var Cw=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(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Vs({processors:Iw,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return st(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Bs(this.ctx,t);let i=qs(this.ctx,t),{"~standard":r,...o}=i;return o}};var XB={};var pd={};_r(pd,{ZodAny:()=>_N,ZodArray:()=>TN,ZodBase64:()=>Yw,ZodBase64URL:()=>Qw,ZodBigInt:()=>ud,ZodBigIntFormat:()=>tk,ZodBoolean:()=>ld,ZodCIDRv4:()=>Jw,ZodCIDRv6:()=>Zw,ZodCUID:()=>Gw,ZodCUID2:()=>Vw,ZodCatch:()=>KN,ZodCodec:()=>pg,ZodCreditCard:()=>gN,ZodCustom:()=>fg,ZodCustomStringFormat:()=>ad,ZodDate:()=>sg,ZodDefault:()=>GN,ZodDiscriminatedUnion:()=>AN,ZodE164:()=>Xw,ZodEmail:()=>Fw,ZodEmoji:()=>jw,ZodEnum:()=>od,ZodExactOptional:()=>ok,ZodFile:()=>FN,ZodFunction:()=>iC,ZodGUID:()=>Uw,ZodIBAN:()=>hN,ZodIPv4:()=>Hw,ZodIPv6:()=>Kw,ZodISODate:()=>Ks,ZodISODateTime:()=>Hs,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,ZodInstanceOf:()=>lC,ZodIntersection:()=>RN,ZodJWT:()=>ek,ZodKSUID:()=>Ww,ZodLazy:()=>tC,ZodLiteral:()=>LN,ZodMAC:()=>mN,ZodMap:()=>ON,ZodNaN:()=>ZN,ZodNanoID:()=>zw,ZodNever:()=>xN,ZodNonOptional:()=>sk,ZodNull:()=>kN,ZodNullable:()=>zN,ZodNumber:()=>cd,ZodNumberFormat:()=>Nc,ZodObject:()=>cg,ZodOptional:()=>ug,ZodPipe:()=>dg,ZodPrefault:()=>BN,ZodPreprocess:()=>YN,ZodPromise:()=>rC,ZodProperties:()=>oC,ZodReadonly:()=>QN,ZodRecord:()=>id,ZodSet:()=>MN,ZodString:()=>sd,ZodStringFormat:()=>mt,ZodSuccess:()=>HN,ZodSymbol:()=>vN,ZodTemplateLiteral:()=>eC,ZodTransform:()=>UN,ZodTuple:()=>CN,ZodType:()=>Le,ZodULID:()=>Bw,ZodURL:()=>og,ZodUUID:()=>go,ZodUndefined:()=>wN,ZodUnion:()=>lg,ZodUnknown:()=>SN,ZodVoid:()=>EN,ZodXID:()=>qw,ZodXor:()=>IN,_ZodString:()=>Lw,_default:()=>VN,_function:()=>u2,any:()=>zq,array:()=>ag,base64:()=>$q,base64url:()=>_q,bigint:()=>Mq,boolean:()=>bN,catch:()=>JN,check:()=>d2,cidrv4:()=>wq,cidrv6:()=>kq,codec:()=>s2,creditCard:()=>xq,cuid:()=>pq,cuid2:()=>fq,custom:()=>p2,date:()=>Vq,describe:()=>f2,discriminatedUnion:()=>Jq,e164:()=>Sq,email:()=>nq,emoji:()=>uq,enum:()=>rk,exactOptional:()=>jN,file:()=>n2,float32:()=>Cq,float64:()=>Pq,function:()=>u2,guid:()=>rq,hash:()=>Nq,hex:()=>Rq,hostname:()=>Aq,httpUrl:()=>lq,iban:()=>Eq,instanceof:()=>g2,int:()=>Ow,int32:()=>Dq,int64:()=>Lq,intersection:()=>NN,invertCodec:()=>a2,ipv4:()=>yq,ipv6:()=>vq,json:()=>y2,jwt:()=>Tq,keyof:()=>Bq,ksuid:()=>hq,lazy:()=>nC,literal:()=>t2,looseObject:()=>Hq,looseRecord:()=>Yq,mac:()=>bq,map:()=>Qq,meta:()=>m2,nan:()=>o2,nanoid:()=>dq,nativeEnum:()=>e2,never:()=>nk,nonoptional:()=>WN,null:()=>$N,nullable:()=>ig,nullish:()=>r2,number:()=>yN,object:()=>qq,optional:()=>Rc,partialRecord:()=>Zq,pipe:()=>Mw,prefault:()=>qN,preprocess:()=>b2,promise:()=>l2,properties:()=>sC,readonly:()=>XN,record:()=>DN,refine:()=>aC,set:()=>Xq,strictObject:()=>Wq,string:()=>rg,stringFormat:()=>Iq,stringbool:()=>h2,success:()=>i2,superRefine:()=>cC,symbol:()=>Uq,templateLiteral:()=>c2,transform:()=>ik,tuple:()=>PN,uint32:()=>Oq,uint64:()=>Fq,ulid:()=>mq,undefined:()=>jq,union:()=>dd,unknown:()=>Ac,url:()=>cq,uuid:()=>iq,uuidv4:()=>oq,uuidv6:()=>sq,uuidv7:()=>aq,void:()=>Gq,xid:()=>gq,xor:()=>Kq});var Pw={};_r(Pw,{endsWith:()=>Wu,gt:()=>fo,gte:()=>Vr,includes:()=>Bu,length:()=>Ic,lowercase:()=>Gu,lt:()=>po,lte:()=>Gr,maxLength:()=>Tc,maxSize:()=>Gs,mime:()=>Hu,minLength:()=>Jo,minSize:()=>mo,multipleOf:()=>zs,negative:()=>Sw,nonnegative:()=>Ew,nonpositive:()=>xw,normalize:()=>Ku,overwrite:()=>ji,positive:()=>_w,property:()=>Tw,regex:()=>zu,size:()=>Ec,slugify:()=>Qu,startsWith:()=>qu,toLowerCase:()=>Zu,toUpperCase:()=>Yu,trim:()=>Ju,uppercase:()=>Vu});var eq=new WeakSet([Object.prototype,Error.prototype]);function Dw(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let i=n(this);return Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0})}})}var tq=(e,t)=>{oI.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);eq.has(n)||(eq.add(n),Dw(n,"format",i=>r=>Pm(i,r)),Dw(n,"flatten",i=>r=>Cm(i,r)),Dw(n,"addIssue",i=>r=>{i.issues.push(r),i.message=JSON.stringify(i.issues,Iu,2)}),Dw(n,"addIssues",i=>r=>{i.issues.push(...r),i.message=JSON.stringify(i.issues,Iu,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Cfe=R("ZodError",tq),Ar=R("ZodError",tq,void 0,{Parent:Error});var nN=Cu(Ar),rN=Pu(Ar),iN=Du(Ar),oN=Ou(Ar),sN=uv(Ar),aN=dv(Ar),cN=pv(Ar),lN=fv(Ar),uN=mv(Ar),dN=gv(Ar),pN=hv(Ar),fN=yv(Ar);function Dfe(){hn.localeError||zt(Jv())}function Ws(){hn.memoizer||zt({memoizer:Km()})}var Le=R("ZodType",(e,t)=>(Dfe(),Ce.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(G.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ot(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(aC(e,t))},superRefine(e,t){return this.check(cC(e,t))},overwrite(e){return this.check(ji(e))},optional(){return Rc(this)},exactOptional(){return jN(this)},nullable(){return ig(this)},nullish(){return Rc(ig(this))},nonoptional(e){return WN(this,e)},array(){return ag(this)},or(e){return dd([this,e])},and(e){return NN(this,e)},transform(e){return Mw(this,ik(e))},default(e){return VN(this,e)},prefault(e){return qN(this,e)},catch(e){return JN(this,e)},pipe(e){return Mw(this,e)},readonly(){return XN(this)},describe(e){let t=this.clone();return Dn.add(t,{description:e}),t},meta(...e){if(e.length===0)return Dn.get(this);let t=this.clone();return Dn.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return G.hide(this,"~standard",{...Tv(this),jsonSchema:{input:ed(this,"input"),output:ed(this,"output")}})},set"~standard"(e){G.own(this,"~standard",e)},parse:function e(t,n){return nN(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await rN(this,t,n,{callee:e})},safeParse(e,t){return iN(this,e,t)},async safeParseAsync(e,t){return oN(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G.own(this,"spa",e)},validate(e,t){return Dm(this,e,t)},validateAsync(e,t){return Om(this,e,t)},encode:function e(t,n){return sN(this,t,n,{callee:e})},decode:function e(t,n){return aN(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await cN(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await lN(this,t,n,{callee:e})},safeEncode(e,t){return uN(this,e,t)},safeDecode(e,t){return dN(this,e,t)},async safeEncodeAsync(e,t){return pN(this,e,t)},async safeDecodeAsync(e,t){return fN(this,e,t)},toJSONSchema(e){return gR(this,{})(e)},get description(){return Dn.get(this)?.description},get _def(){return this._zod.def}}),Lw=R("_ZodString",(e,t)=>{kc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>bR(e,n,i,r)},G.derived({format:e=>yn(e).format??null,minLength:e=>yn(e).minimum??null,maxLength:e=>yn(e).maximum??null},{regex(...e){return this.check(zu(...e))},includes(...e){return this.check(Bu(...e))},startsWith(...e){return this.check(qu(...e))},endsWith(...e){return this.check(Wu(...e))},min(...e){return this.check(Jo(...e))},max(...e){return this.check(Tc(...e))},length(...e){return this.check(Ic(...e))},nonempty(...e){return this.check(Jo(1,...e))},lowercase(e){return this.check(Gu(e))},uppercase(e){return this.check(Vu(e))},trim(){return this.check(Ju())},normalize(...e){return this.check(Ku(...e))},toLowerCase(){return this.check(Zu())},toUpperCase(){return this.check(Yu())},slugify(){return this.check(Qu())}})),sd=R("ZodString",(e,t)=>{kc.init(e,t),Lw.init(e,t)},{email(e){return this.check(nw(Fw,e))},url(e){return this.check(Ym(og,e))},jwt(e){return this.check($w(ek,e))},emoji(e){return this.check(cw(jw,e))},guid(e){return this.check(rw(Uw,e))},uuid(e){return this.check(iw(go,e))},uuidv4(e){return this.check(ow(go,e))},uuidv6(e){return this.check(sw(go,e))},uuidv7(e){return this.check(aw(go,e))},nanoid(e){return this.check(lw(zw,e))},cuid(e){return this.check(uw(Gw,e))},cuid2(e){return this.check(dw(Vw,e))},ulid(e){return this.check(pw(Bw,e))},base64(e){return this.check(vw(Yw,e))},base64url(e){return this.check(ww(Qw,e))},xid(e){return this.check(fw(qw,e))},ksuid(e){return this.check(mw(Ww,e))},ipv4(e){return this.check(gw(Hw,e))},ipv6(e){return this.check(hw(Kw,e))},cidrv4(e){return this.check(yw(Jw,e))},cidrv6(e){return this.check(bw(Zw,e))},e164(e){return this.check(kw(Xw,e))},datetime(e){return this.check(Qm(Hs,e))},date(e){return this.check(Xm(Ks,e))},time(e){return this.check(eg(Js,e))},duration(e){return this.check(tg(Zs,e))}});function rg(e){return RA(sd,e)}var mt=R("ZodStringFormat",(e,t)=>{ut.init(e,t),Lw.init(e,t)}),Hs=R("ZodISODateTime",(e,t)=>{k0.init(e,t),mt.init(e,t)}),Ks=R("ZodISODate",(e,t)=>{$0.init(e,t),mt.init(e,t)}),Js=R("ZodISOTime",(e,t)=>{_0.init(e,t),mt.init(e,t)}),Zs=R("ZodISODuration",(e,t)=>{S0.init(e,t),mt.init(e,t)}),Fw=R("ZodEmail",(e,t)=>{u0.init(e,t),mt.init(e,t)});function nq(e){return nw(Fw,e)}var Uw=R("ZodGUID",(e,t)=>{c0.init(e,t),mt.init(e,t)});function rq(e){return rw(Uw,e)}var go=R("ZodUUID",(e,t)=>{l0.init(e,t),mt.init(e,t)});function iq(e){return iw(go,e)}function oq(e){return ow(go,e)}function sq(e){return sw(go,e)}function aq(e){return aw(go,e)}var og=R("ZodURL",(e,t)=>{f0.init(e,t),mt.init(e,t)});function cq(e){return Ym(og,e)}function lq(e){return Ym(og,{protocol:or.httpProtocol,hostname:or.domain,...G.normalizeParams(e)})}var jw=R("ZodEmoji",(e,t)=>{m0.init(e,t),mt.init(e,t)});function uq(e){return cw(jw,e)}var zw=R("ZodNanoID",(e,t)=>{g0.init(e,t),mt.init(e,t)});function dq(e){return lw(zw,e)}var Gw=R("ZodCUID",(e,t)=>{h0.init(e,t),mt.init(e,t)});function pq(e){return uw(Gw,e)}var Vw=R("ZodCUID2",(e,t)=>{y0.init(e,t),mt.init(e,t)});function fq(e){return dw(Vw,e)}var Bw=R("ZodULID",(e,t)=>{b0.init(e,t),mt.init(e,t)});function mq(e){return pw(Bw,e)}var qw=R("ZodXID",(e,t)=>{v0.init(e,t),mt.init(e,t)});function gq(e){return fw(qw,e)}var Ww=R("ZodKSUID",(e,t)=>{w0.init(e,t),mt.init(e,t)});function hq(e){return mw(Ww,e)}var Hw=R("ZodIPv4",(e,t)=>{x0.init(e,t),mt.init(e,t)});function yq(e){return gw(Hw,e)}var mN=R("ZodMAC",(e,t)=>{T0.init(e,t),mt.init(e,t)});function bq(e){return CA(mN,e)}var Kw=R("ZodIPv6",(e,t)=>{E0.init(e,t),mt.init(e,t)});function vq(e){return hw(Kw,e)}var Jw=R("ZodCIDRv4",(e,t)=>{I0.init(e,t),mt.init(e,t)});function wq(e){return yw(Jw,e)}var Zw=R("ZodCIDRv6",(e,t)=>{A0.init(e,t),mt.init(e,t)});function kq(e){return bw(Zw,e)}var Yw=R("ZodBase64",(e,t)=>{R0.init(e,t),mt.init(e,t)});function $q(e){return vw(Yw,e)}var Qw=R("ZodBase64URL",(e,t)=>{N0.init(e,t),mt.init(e,t)});function _q(e){return ww(Qw,e)}var Xw=R("ZodE164",(e,t)=>{C0.init(e,t),mt.init(e,t)});function Sq(e){return kw(Xw,e)}var gN=R("ZodCreditCard",(e,t)=>{P0.init(e,t),mt.init(e,t)});function xq(e){return PA(gN,e)}var hN=R("ZodIBAN",(e,t)=>{D0.init(e,t),mt.init(e,t)});function Eq(e){return DA(hN,e)}var ek=R("ZodJWT",(e,t)=>{O0.init(e,t),mt.init(e,t)});function Tq(e){return $w(ek,e)}var ad=R("ZodCustomStringFormat",(e,t)=>{M0.init(e,t),mt.init(e,t)});function Iq(e,t,n={}){return Xu(ad,e,t,n)}function Aq(e){return Xu(ad,"hostname",or.hostname,e)}function Rq(e){return Xu(ad,"hex",or.hex,e)}function Nq(e,t){let n=t?.enc??"hex",i=`${e}_${n}`,r=or[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return Xu(ad,i,r,t)}var cd=R("ZodNumber",(e,t)=>{Fv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>vR(e,n,i,r),e.isFinite=!0},G.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=yn(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=yn(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=yn(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>yn(e).format??null},{gt(e,t){return this.check(fo(e,t))},gte(e,t){return this.check(Vr(e,t))},min(e,t){return this.check(Vr(e,t))},lt(e,t){return this.check(po(e,t))},lte(e,t){return this.check(Gr(e,t))},max(e,t){return this.check(Gr(e,t))},int(e){return this.check(Ow(e))},safe(e){return this.check(Ow(e))},positive(e){return this.check(fo(0,e))},nonnegative(e){return this.check(Vr(0,e))},negative(e){return this.check(po(0,e))},nonpositive(e){return this.check(Gr(0,e))},multipleOf(e,t){return this.check(zs(e,t))},step(e,t){return this.check(zs(e,t))},finite(){return this}}));function yN(e){return MA(cd,e)}var Nc=R("ZodNumberFormat",(e,t)=>{L0.init(e,t),cd.init(e,t)});function Ow(e){return FA(Nc,e)}function Cq(e){return UA(Nc,e)}function Pq(e){return jA(Nc,e)}function Dq(e){return zA(Nc,e)}function Oq(e){return GA(Nc,e)}var ld=R("ZodBoolean",(e,t)=>{Gm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>wR(e,n,i,r)});function bN(e){return VA(ld,e)}var ud=R("ZodBigInt",(e,t)=>{Uv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>kR(e,n,i,r)},G.derived({minValue:e=>yn(e).minimum??null,maxValue:e=>yn(e).maximum??null,format:e=>yn(e).format??null},{gte(e,t){return this.check(Vr(e,t))},min(e,t){return this.check(Vr(e,t))},gt(e,t){return this.check(fo(e,t))},lt(e,t){return this.check(po(e,t))},lte(e,t){return this.check(Gr(e,t))},max(e,t){return this.check(Gr(e,t))},positive(e){return this.check(fo(BigInt(0),e))},negative(e){return this.check(po(BigInt(0),e))},nonpositive(e){return this.check(Gr(BigInt(0),e))},nonnegative(e){return this.check(Vr(BigInt(0),e))},multipleOf(e,t){return this.check(zs(e,t))}}));function Mq(e){return qA(ud,e)}var tk=R("ZodBigIntFormat",(e,t)=>{F0.init(e,t),ud.init(e,t)});function Lq(e){return HA(tk,e)}function Fq(e){return KA(tk,e)}var vN=R("ZodSymbol",(e,t)=>{U0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>$R(e,n,i,r)});function Uq(e){return JA(vN,e)}var wN=R("ZodUndefined",(e,t)=>{j0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>SR(e,n,i,r)});function jq(e){return ZA(wN,e)}var kN=R("ZodNull",(e,t)=>{z0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_R(e,n,i,r)});function $N(e){return YA(kN,e)}var _N=R("ZodAny",(e,t)=>{G0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>TR(e,n,i,r)});function zq(){return QA(_N)}var SN=R("ZodUnknown",(e,t)=>{V0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>IR(e,n,i,r)});function Ac(){return XA(SN)}var xN=R("ZodNever",(e,t)=>{B0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ER(e,n,i,r)});function nk(e){return eR(xN,e)}var EN=R("ZodVoid",(e,t)=>{q0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>xR(e,n,i,r)});function Gq(e){return tR(EN,e)}var sg=R("ZodDate",(e,t)=>{W0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>AR(e,n,i,r),e.min=(n,i)=>e.check(Vr(n,i)),e.max=(n,i)=>e.check(Gr(n,i))},G.derived({minDate:e=>{let{minimum:t}=yn(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=yn(e);return t?new Date(t):null}},{}));function Vq(e){return nR(sg,e)}var TN=R("ZodArray",(e,t)=>{Ws(),H0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>zR(e,n,i,r),e.element=t.element},{min(e,t){return this.check(Jo(e,t))},nonempty(e){return this.check(Jo(1,e))},max(e,t){return this.check(Tc(e,t))},length(e,t){return this.check(Ic(e,t))},unwrap(){return this.element}});function ag(e,t){return sR(TN,e,t)}function Bq(e){let t=e._zod.def.shape;return rk(Object.keys(t))}var cg=R("ZodObject",(e,t)=>{Ws(),K0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>GR(e,n,i,r),G.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return rk(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(G.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(G.mergeDefs(this._zod.def,{catchall:Ac()}))},loose(){return this.clone(G.mergeDefs(this._zod.def,{catchall:Ac()}))},strict(){return this.clone(G.mergeDefs(this._zod.def,{catchall:nk()}))},strip(){return this.clone(G.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return G.extend(this,e)},safeExtend(e){return G.safeExtend(this,e)},merge(e){return G.merge(this,e)},pick(e){return G.pick(this,e)},omit(e){return G.omit(this,e)},partial(...e){return G.partial(ug,this,e[0])},exactPartial(...e){return G.partial(ok,this,e[0],"exactPartial")},required(...e){return G.required(sk,this,e[0])}});function qq(e,t){let n={type:"object",shape:e??{},...G.normalizeParams(t)};return new cg(n)}function Wq(e,t){return new cg({type:"object",shape:e,catchall:nk(),...G.normalizeParams(t)})}function Hq(e,t){return new cg({type:"object",shape:e,catchall:Ac(),...G.normalizeParams(t)})}var lg=R("ZodUnion",(e,t)=>{Vm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Aw(e,n,i,r),e.options=t.options});function dd(e,t){return new lg({type:"union",options:e,...G.normalizeParams(t)})}var IN=R("ZodXor",(e,t)=>{lg.init(e,t),J0.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Aw(e,n,i,r),e.options=t.options});function Kq(e,t){return new IN({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}var AN=R("ZodDiscriminatedUnion",(e,t)=>{lg.init(e,t),Y0.init(e,t)});function Jq(e,t,n){return new AN({type:"union",options:t,discriminator:e,...G.normalizeParams(n)})}var RN=R("ZodIntersection",(e,t)=>{Q0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>VR(e,n,i,r)});function NN(e,t){return new RN({type:"intersection",left:e,right:t})}var CN=R("ZodTuple",(e,t)=>{Ws(),jv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>BR(e,n,i,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new ug({type:"optional",innerType:t}))})}});function PN(e,t,n){let i=t instanceof Ce,r=i?n:t,o=i?t:null;return new CN({type:"tuple",items:e,rest:o,...G.normalizeParams(r)})}var id=R("ZodRecord",(e,t)=>{Ws(),X0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>qR(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType});function DN(e,t,n){return!t||!t._zod?new id({type:"record",keyType:rg(),valueType:e,...G.normalizeParams(t)}):new id({type:"record",keyType:e,valueType:t,...G.normalizeParams(n)})}function Zq(e,t,n){return new id({type:"record",keyType:e,valueType:t,...G.normalizeParams(n),partial:!0})}function Yq(e,t,n){return new id({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(n)})}var ON=R("ZodMap",(e,t)=>{Ws(),eA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>UR(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(mo(...n)),e.nonempty=n=>e.check(mo(1,n)),e.max=(...n)=>e.check(Gs(...n)),e.size=(...n)=>e.check(Ec(...n))});function Qq(e,t,n){return new ON({type:"map",keyType:e,valueType:t,...G.normalizeParams(n)})}var MN=R("ZodSet",(e,t)=>{Ws(),tA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>jR(e,n,i,r),e.min=(...n)=>e.check(mo(...n)),e.nonempty=n=>e.check(mo(1,n)),e.max=(...n)=>e.check(Gs(...n)),e.size=(...n)=>e.check(Ec(...n))});function Xq(e,t){return new MN({type:"set",valueType:e,...G.normalizeParams(t)})}var od=R("ZodEnum",(e,t)=>{nA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,r,o)=>RR(e,i,r,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(i,r)=>{let o={};for(let s of i)if(n.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new od({...t,checks:[],...G.normalizeParams(r),entries:o})},e.exclude=(i,r)=>{let o={...t.entries};for(let s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new od({...t,checks:[],...G.normalizeParams(r),entries:o})}});function rk(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new od({type:"enum",entries:n,...G.normalizeParams(t)})}function e2(e,t){return new od({type:"enum",entries:e,...G.normalizeParams(t)})}var LN=R("ZodLiteral",(e,t)=>{rA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>NR(e,n,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function t2(e,t){return new LN({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}var FN=R("ZodFile",(e,t)=>{iA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>DR(e,n,i,r),e.min=(n,i)=>e.check(mo(n,i)),e.max=(n,i)=>e.check(Gs(n,i)),e.mime=(n,i)=>e.check(Hu(Array.isArray(n)?n:[n],i))});function n2(e){return aR(FN,e)}var UN=R("ZodTransform",(e,t)=>{Ws(),oA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>FR(e,n,i,r),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(G.issue(o,n.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=e),n.issues.push(G.issue(s))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n)):(n.value=r,n)}});function ik(e){return new UN({type:"transform",transform:e})}var ug=R("ZodOptional",(e,t)=>{zv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Rw(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Rc(e){return new ug({type:"optional",innerType:e})}var ok=R("ZodExactOptional",(e,t)=>{sA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Rw(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function jN(e){return new ok({type:"optional",innerType:e})}var zN=R("ZodNullable",(e,t)=>{aA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>WR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function ig(e){return new zN({type:"nullable",innerType:e})}function r2(e){return Rc(ig(e))}var GN=R("ZodDefault",(e,t)=>{cA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>JR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VN(e,t){return new GN({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var BN=R("ZodPrefault",(e,t)=>{lA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ZR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function qN(e,t){return new BN({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var sk=R("ZodNonOptional",(e,t)=>{uA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>HR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function WN(e,t){return new sk({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}var HN=R("ZodSuccess",(e,t)=>{dA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>OR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function i2(e){return new HN({type:"success",innerType:e})}var KN=R("ZodCatch",(e,t)=>{pA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>YR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function JN(e,t){return new KN({type:"catch",innerType:e,catchValue:typeof t=="function"?t:G.constantCatch(t)})}var ZN=R("ZodNaN",(e,t)=>{fA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>CR(e,n,i,r)});function o2(e){return iR(ZN,e)}var dg=R("ZodPipe",(e,t)=>{Gv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>QR(e,n,i,r),e.in=t.in,e.out=t.out});function Mw(e,t){return new dg({type:"pipe",in:e,out:t})}var pg=R("ZodCodec",(e,t)=>{dg.init(e,t),Bm.init(e,t)});function s2(e,t,n){return new pg({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function a2(e){let t=e._zod.def;return new pg({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var YN=R("ZodPreprocess",(e,t)=>{dg.init(e,t),mA.init(e,t)}),QN=R("ZodReadonly",(e,t)=>{gA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>XR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function XN(e){return new QN({type:"readonly",innerType:e})}var eC=R("ZodTemplateLiteral",(e,t)=>{hA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>PR(e,n,i,r)});function c2(e,t){return new eC({type:"template_literal",parts:e,...G.normalizeParams(t)})}var tC=R("ZodLazy",(e,t)=>{qm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>tN(e,n,i,r),e.unwrap=()=>e._zod.def.getter()});function nC(e){return new tC({type:"lazy",getter:e})}var rC=R("ZodPromise",(e,t)=>{bA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>eN(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function l2(e){return new rC({type:"promise",innerType:e})}var iC=R("ZodFunction",(e,t)=>{yA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>LR(e,n,i,r)});function u2(e){return new iC({type:"function",input:Array.isArray(e?.input)?PN(e?.input):e?.input??ag(Ac()),output:e?.output??Ac()})}var fg=R("ZodCustom",(e,t)=>{vA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>MR(e,n,i,r)}),oC=R("ZodProperties",(e,t)=>{Ws(),wA.init(e,t),Le.init(e,t)});function sC(e,t){return oR(oC,e,t)}function d2(e){let t=new ht({check:"custom"});return t._zod.check=e,t}function p2(e,t){return cR(fg,e??(()=>!0),t)}function aC(e,t={}){return lR(fg,e,t)}function cC(e,t){return uR(e,t)}var f2=dR,m2=pR,lC=R("ZodInstanceOf",(e,t)=>{fg.init(e,t)},{properties(e,t){return this.check(sC(e,t))}});function g2(e,t={}){let n=new lC({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...G.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var h2=(...e)=>fR({Codec:pg,Boolean:ld,String:sd},...e);function y2(e){let t=nC(()=>dd([rg(e),yN(),bN(),$N(),ag(t),DN(rg(),t)]));return t}function b2(e,t){return new YN({type:"pipe",in:ik(e),out:t})}var Ofe={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"};function Mfe(e){zt({customError:e})}function Lfe(){return zt().customError}var uC;uC||(uC={});var mg={};_r(mg,{ZodISODate:()=>Ks,ZodISODateTime:()=>Hs,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,date:()=>Ufe,datetime:()=>Ffe,duration:()=>zfe,time:()=>jfe});function Ffe(e){return Qm(Hs,e)}function Ufe(e){return Xm(Ks,e)}function jfe(e){return eg(Js,e)}function zfe(e){return tg(Zs,e)}var oe={...pd,...Pw,iso:mg},Gfe=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"]);function Vfe(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function v2(e,t){return e.map((n,i)=>ii).check(i=>{let r=i.value;if(typeof r!="object"||r===null||Array.isArray(r))return;let o=Object.getOwnPropertyNames(r);if(t.minProperties!==void 0&&o.length=${t.minProperties} properties`,input:r,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:r,inst:e,continue:!0}),t.keySchema)for(let s of o){let a=t.keySchema.safeParse(s);a.success||i.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function dC(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let i=String(e);return`${n[0]}${i.length}:${i}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let s of e){let a=dC(s,t);if(a===null)return null;o.push(a)}return`a${o.length}:[${o.join(",")}]`}let i=Object.keys(e).sort(),r=[];for(let o of i){let s=dC(e[o],t);if(s===null)return null;r.push(`${o.length}:${o}=${s}`)}return`o${r.length}:{${r.join(",")}}`}finally{t.delete(e)}}var Hfe=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),Kfe=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function gg(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(gg):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>Hfe.has(t)?gg(n):!Kfe.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(gg))}function w2(e){return e===1?"element":"elements"}function Jfe(e,t){return oe.transform(i=>i).check(i=>{let r=i.value;if(Array.isArray(r)){if(t.uniqueItems===!0){let o=new Map;for(let s=0;s=s)break;at.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${w2(t.maxContains)}`,input:r,continue:!0})}}}).pipe(e)}function k2(e,t){if(e!==!1)return e===void 0||e===!0?oe.any():ar(e,t)}var Zfe=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function $2(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return oe.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return oe.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let o=qfe(r,t),s=ar(o,t);return t.refs.set(r,s),t.processing.delete(r),s}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return oe.null();if(r.length===0)return oe.never();if(r.length===1)return oe.literal(r[0]);if(r.every(s=>typeof s=="string"))return oe.enum(r);let o=r.map(s=>oe.literal(s));return o.length<2?o[0]:oe.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return oe.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...e,type:o};return $2(s,t)});return r.length===0?oe.never():r.length===1?r[0]:oe.union(r)}if(!n)return oe.any();let i;switch(n){case"string":{let r=oe.string();if(e.format){let o=e.format;o==="email"?r=r.check(oe.email()):o==="uri"||o==="uri-reference"?r=r.check(oe.url()):o==="uuid"||o==="guid"?r=r.check(oe.uuid()):o==="date-time"?r=r.check(oe.iso.datetime({offset:!0})):o==="date"?r=r.check(oe.iso.date()):o==="time"?r=r.check(oe.regex(Zfe)):o==="duration"?r=r.check(oe.iso.duration()):o==="hostname"?r=r.check(oe.hostname()):o==="ipv4"?r=r.check(oe.ipv4()):o==="ipv6"?r=r.check(oe.ipv6()):o==="mac"?r=r.check(oe.mac()):o==="cidr"?r=r.check(oe.cidrv4()):o==="cidr-v6"?r=r.check(oe.cidrv6()):o==="base64"?r=r.check(oe.base64()):o==="base64url"?r=r.check(oe.base64url()):o==="e164"?r=r.check(oe.e164()):o==="credit_card"?r=r.check(oe.creditCard()):o==="iban"?r=r.check(oe.iban()):o==="jwt"?r=r.check(oe.jwt()):o==="emoji"?r=r.check(oe.emoji()):o==="nanoid"?r=r.check(oe.nanoid()):o==="cuid"?r=r.check(oe.cuid()):o==="cuid2"?r=r.check(oe.cuid2()):o==="ulid"?r=r.check(oe.ulid()):o==="xid"?r=r.check(oe.xid()):o==="ksuid"&&(r=r.check(oe.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?oe.number().int():oe.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),i=r;break}case"boolean":{i=oe.boolean();break}case"null":{i=oe.null();break}case"object":{let r={},o=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?ar(e.additionalProperties,t):void 0;for(let[d,p]of Object.entries(o)){let f=ar(p,t);Sn(r,d,s.has(d)?f:f.optional())}if(e.patternProperties){let d=e.patternProperties,p=Object.keys(d),f=[];for(let g of p){let h=ar(d[g],t),b=oe.string().regex(new RegExp(g));f.push(oe.looseRecord(b,h))}let m=[];if(Object.keys(r).length>0&&m.push(oe.object(r).passthrough()),m.push(...f),m.length===0)i=oe.object({}).passthrough();else if(m.length===1)i=m[0];else{let g=oe.intersection(m[0],m[1]);for(let h=2;hnew RegExp(y)),b=i;i=i.check(y=>{if(!ci(y.value))return;let w=[];for(let k of Object.keys(y.value))g.includes(k)||h.some(_=>_.test(k))||w.push(k);w.length&&y.issues.push({code:"unrecognized_keys",keys:w,input:y.value,inst:b})})}}else{let d=oe.object(r);e.additionalProperties===!1?i=d.strict():a?i=d.catchall(a):i=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,u=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||l!==void 0||u!==void 0){let d;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=ar(p,t)}i=Wfe(i,{keySchema:d,minProperties:l,maxProperties:u})}break}case"array":{let r=e.prefixItems,o=e.items;if(r&&Array.isArray(r)){let s=typeof e.minItems=="number"?e.minItems:0,a=r.map(d=>ar(d,t)),c=v2(a,s),l=Array.isArray(o)?void 0:k2(o,t),u=oe.tuple(c);i=l?u.rest(l):u,typeof e.minItems=="number"&&(i=i.check(oe.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(oe.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(d=>ar(d,t)),c=v2(a,s),l=k2(e.additionalItems,t),u=oe.tuple(c);i=l?u.rest(l):u,typeof e.minItems=="number"&&(i=i.check(oe.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(oe.maxLength(e.maxItems)))}else if(o!==void 0){let s=ar(o,t),a=oe.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),i=a}else i=oe.array(oe.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=Jfe(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?ar(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return i}function ar(e,t){if(typeof e=="boolean")return e?oe.any():oe.never();let n=$2(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(l=>ar(l,t)),c=oe.union(a);n=i?oe.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(l=>ar(l,t)),c=oe.xor(a);n=i?oe.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=i?n:oe.any();else{let a=i?n:ar(e.allOf[0],t),c=i?0:1;for(let l=c;l0&&t.registry.add(n,r),e.description&&(n=n.describe(e.description)),n}function _2(e,t){if(typeof e=="boolean")return e?oe.any():oe.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=Vfe(n,t?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Dn};return ar(n,o)}var S2=Symbol("z.visit/resolving");function hg(e,t){let n=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},i=new Map;function r(s){let a=i.get(s);if(a===S2)return new qm({type:"lazy",getter:()=>i.get(s)});if(a!==void 0)return a;i.set(s,S2);let c=o(s),l=n(c,c!==s);return i.set(s,l),l}function o(s){let a=s._zod.def,c=a.type;switch(c){case"object":{let l=a.shape,u=Object.keys(l),d=!1,p={};for(let m of u){let g=r(l[m]);g!==l[m]&&(d=!0),p[m]=g}let f=a.catchall;return a.catchall&&(f=r(a.catchall),f!==a.catchall&&(d=!0)),d?ot(s,{...a,shape:p,catchall:f}):s}case"array":{let l=r(a.element);return l===a.element?s:ot(s,{...a,element:l})}case"tuple":{let l=a.items,u=!1,d=[];for(let f of l){let m=r(f);m!==f&&(u=!0),d.push(m)}let p=a.rest;return a.rest&&(p=r(a.rest),p!==a.rest&&(u=!0)),u?ot(s,{...a,items:d,rest:p}):s}case"record":case"map":{let l=r(a.keyType),u=r(a.valueType);return l===a.keyType&&u===a.valueType?s:ot(s,{...a,keyType:l,valueType:u})}case"set":{let l=r(a.valueType);return l===a.valueType?s:ot(s,{...a,valueType:l})}case"union":{let l=a.options,u=!1,d=[];for(let p of l){let f=r(p);f!==p&&(u=!0),d.push(f)}return u?ot(s,{...a,options:d}):s}case"intersection":{let l=r(a.left),u=r(a.right);return l===a.left&&u===a.right?s:ot(s,{...a,left:l,right:u})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=r(a.innerType);return l===a.innerType?s:ot(s,{...a,innerType:l})}case"pipe":{let l=r(a.in),u=r(a.out);return l===a.in&&u===a.out?s:ot(s,{...a,in:l,out:u})}case"function":{let l=r(a.input),u=r(a.output);return l===a.input&&u===a.output?s:ot(s,{...a,input:l,output:u})}case"lazy":{let l=a.getter,{_cachedInner:u,...d}=a;return ot(s,{...d,getter:()=>r(l())})}case"properties":{let l=a.shape,u=!1,d={};for(let p of Reflect.ownKeys(l)){let f=r(l[p]);f!==l[p]&&(u=!0),d[p]=f}return u?ot(s,{...a,shape:d}):s}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return r(e)}function x2(e){return hg(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:dd(n.options)}})}function Yfe(e,t){if(!t?.length)return e;let n=e._zod.def;return ot(e,Fi(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function E2(e){return Yfe(e.out,e.checks)}function Qfe(e){return e.in._zod.traits.has("$ZodTransform")?E2(e):e.in}function T2(e){return hg(e,{pipe:t=>Qfe(t._zod.def),default:(t,n)=>n?Rc(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function I2(e){return hg(e,{pipe:t=>E2(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var pC={};_r(pC,{bigint:()=>nme,boolean:()=>tme,date:()=>rme,number:()=>eme,string:()=>Xfe});function Xfe(e){return NA(sd,e)}function eme(e){return LA(cd,e)}function tme(e){return BA(ld,e)}function nme(e){return WA(ud,e)}function rme(e){return rR(sg,e)}var A2=U.enum(["npm","pypi","go","cargo","maven","rubygems","nuget","packagist","hex","pub","swift","cocoapods","opam","conan","vcpkg","arduino"]),ime=U.string().trim().min(1),ome=U.enum(["low","medium","high","xhigh"]);var fC=U.object({mode:U.enum(["auto","approve"]).default("approve"),maxAutoRisk:U.enum(["none","low","medium","high"]).default("medium"),watchBranches:U.array(U.string()).default(["main","master","develop"]),ecosystems:U.array(A2).default([...A2.options]),ignore:U.array(U.string()).default([]),alwaysApprove:U.array(U.string()).default([]),triggerOn:U.object({major:U.boolean().default(!0),minor:U.boolean().default(!0),patch:U.boolean().default(!1),transitive:U.boolean().default(!1),dev:U.boolean().default(!0)}).prefault({}),evidence:U.object({githubReleases:U.boolean().default(!0),changelog:U.boolean().default(!0),typeSurface:U.boolean().default(!0),openapi:U.boolean().default(!0),openapiSpecs:U.array(U.string()).default([]),protobuf:U.boolean().default(!0),protobufSpecs:U.array(U.string()).default([]),graphql:U.boolean().default(!0),graphqlSchemas:U.array(U.string()).default([]),maxReleases:U.number().int().min(1).max(100).default(25)}).prefault({}),rationale:U.object({security:U.boolean().default(!0),maintenance:U.boolean().default(!0),summary:U.boolean().default(!0)}).prefault({}),licenses:U.object({enabled:U.boolean().default(!1),allow:U.array(U.string()).default([]),deny:U.array(U.string()).default([]),requireDeclared:U.boolean().default(!1)}).prefault({}),guardrails:U.object({protectedPaths:U.array(U.string()).default([".github/workflows/**","**/*.lock","infra/**","terraform/**","**/secrets/**"]),maxFilesChanged:U.number().int().min(1).default(50),maxDependenciesPerRun:U.number().int().min(1).default(10),requireEvidence:U.boolean().default(!0),minConfidence:U.enum(["low","medium","high"]).default("medium"),experimentalDispatchBelowMinConfidence:U.boolean().default(!1),forbidTestWeakening:U.boolean().default(!0)}).prefault({}),remediation:U.object({commitGranularity:U.enum(["per-breaking-change","per-dependency","single"]).default("per-breaking-change"),branchPrefix:U.string().default("drift/"),draftPr:U.boolean().optional(),model:U.string().optional(),agent:U.object({provider:ime.default("auto"),model:U.string().optional(),effort:ome.optional(),fast:U.boolean().default(!1),timeoutSeconds:U.number().int().min(30).max(1440*60).default(1800)}).prefault({}),customInstructions:U.string().default(""),awaitCompletion:U.object({enabled:U.boolean().default(!1),timeoutMinutes:U.number().int().min(1).max(360).default(20),pollIntervalSeconds:U.number().int().min(5).max(300).default(30)}).prefault({}),communityRecipes:U.boolean().default(!1),fixPlans:U.object({enabled:U.boolean().default(!1),minCoverage:U.number().min(0).max(1).default(.5),autoApply:U.enum(["review","proven","verified"]).default("review"),cache:U.boolean().default(!0)}).prefault({})}).prefault({}),verification:U.object({behavioural:U.object({enabled:U.boolean().default(!1),sandbox:U.literal("required").default("required"),maxSymbols:U.number().int().min(1).max(100).default(10),maxCasesPerSymbol:U.number().int().min(1).max(100).default(20),timeoutSeconds:U.number().int().min(1).max(1800).default(120),network:U.boolean().default(!1),memoryMb:U.number().int().min(128).max(16384).default(1024),cpuLimit:U.number().min(.1).max(32).default(1),retainArtifacts:U.boolean().default(!1)}).prefault({})}).prefault({}),telemetry:U.object({enabled:U.boolean().default(!1),endpoint:U.string().url().optional(),installationId:U.string().optional(),rotationSalt:U.string().optional(),retentionDays:U.number().int().min(1).max(730).default(180)}).prefault({}),pullRequest:U.object({enabled:U.boolean().default(!0),confirm:U.enum(["ask","never"]).default("ask"),base:U.enum(["branched-from","default-branch"]).default("branched-from"),draft:U.boolean().optional(),labels:U.array(U.string()).default([]),reviewers:U.array(U.string()).default([]),branchTemplate:U.string().default("{prefix}upgrade-{summary}-{date}"),titleTemplate:U.string().default("chore(deps): upgrade {summary}"),coAuthor:U.boolean().default(!0)}).prefault({}),llm:U.object({enabled:U.boolean().default(!1),provider:U.enum(["anthropic"]).default("anthropic"),model:U.string().default("claude-opus-5"),effort:U.enum(["low","medium","high","xhigh","max"]).default("medium"),apiKeyEnv:U.string().default("ANTHROPIC_API_KEY")}).prefault({}),codeScanning:U.object({enabled:U.boolean().default(!0),includeInformational:U.boolean().default(!1),granularity:U.enum(["package","breakingChange","affectedSite"]).default("package"),createIssuesPerAlert:U.boolean().default(!1)}).prefault({}),issueCreation:U.object({default:U.enum(["issue","branch","both"]).default("issue"),granularity:U.enum(["package","change"]).default("package"),assignees:U.array(U.string()).default([])}).prefault({}),outdated:U.object({enabled:U.boolean().default(!1)}).prefault({}),check:U.object({enabled:U.boolean().default(!1)}).prefault({}),tools:U.object({autoInstall:U.boolean().default(!0)}).prefault({}),verify:U.object({enabled:U.boolean().default(!0),checks:U.array(U.enum(["typecheck","build","test"])).default(["typecheck","build","test"]),timeoutMs:U.number().int().positive().default(15*6e4),generatedSourceGlobs:U.array(U.string()).default([])}).prefault({})}),fd=fC.parse({});function R2(e){return e.pullRequest.draft??e.remediation.draftPr??!0}var ak={none:0,low:1,medium:2,high:3};function mC(e,t){return ak[e]<=ak[t]}function N2(e,t){return ak[e]-ak[t]}var sme=[".github/drift.yml",".github/drift.yaml","drift.yml","drift.yaml"];function ame(e,t=null){let n=[];if(!e.trim())return{config:fd,path:t,problems:n};let i;try{i=(0,C2.parse)(e)}catch(c){return n.push(`Could not parse ${t??"config"} as YAML: ${c.message}`),{config:fd,path:t,problems:n}}if(i==null)return{config:fd,path:t,problems:n};let r=lme(i),o=cme(i),s=fC.safeParse(i);if(!s.success){for(let c of s.error.issues){let l=c.path.length?c.path.join("."):"(root)";n.push(`${l}: ${c.message}`)}return n.push("Falling back to Drift defaults (mode: approve)."),{config:fd,path:t,problems:n}}let a=s.data;return r&&!o&&(a.remediation.agent={...a.remediation.agent,provider:"copilot-cloud",model:r},n.push("`remediation.model` is deprecated and now treated as `remediation.agent.model` for `copilot-cloud`. Use `remediation.agent` for new configuration.")),{config:a,path:t,problems:n}}function cme(e){if(!ck(e))return!1;let t=e.remediation;return ck(t)&&t.agent!==void 0}function lme(e){if(!ck(e))return null;let t=e.remediation;return ck(t)&&typeof t.model=="string"&&t.model.trim()?t.model:null}function ck(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}async function lk(e){for(let t of sme){let n;try{n=await e(t)}catch{continue}if(n!==null)return ame(n,t)}return{config:fd,path:null,problems:[]}}var $4=require("node:zlib");function Ys(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}function uk(e,t,n,i){if(typeof n!="function")throw new Error("method for before hook must be a function");return i||(i={}),Array.isArray(t)?t.reverse().reduce((r,o)=>uk.bind(null,e,o,r,i),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((r,o)=>o.hook.bind(null,r,i),n)():n(i))}function P2(e,t,n,i){let r=i;e.registry[n]||(e.registry[n]=[]),t==="before"&&(i=(o,s)=>Promise.resolve().then(r.bind(null,s)).then(o.bind(null,s))),t==="after"&&(i=(o,s)=>{let a;return Promise.resolve().then(o.bind(null,s)).then(c=>(a=c,r(a,s))).then(()=>a)}),t==="error"&&(i=(o,s)=>Promise.resolve().then(o.bind(null,s)).catch(a=>r(a,s))),e.registry[n].push({hook:i,orig:r})}function D2(e,t,n){if(!e.registry[t])return;let i=e.registry[t].map(r=>r.orig).indexOf(n);i!==-1&&e.registry[t].splice(i,1)}var O2=Function.bind,M2=O2.bind(O2);function L2(e,t,n){let i=M2(D2,null).apply(null,n?[t,n]:[t]);e.api={remove:i},e.remove=i,["before","error","after","wrap"].forEach(r=>{let o=n?[t,r,n]:[t,r];e[r]=e.api[r]=M2(P2,null).apply(null,o)})}function ume(){let e=Symbol("Singular"),t={registry:{}},n=uk.bind(null,t,e);return L2(n,t,e),n}function dme(){let e={registry:{}},t=uk.bind(null,e);return L2(t,e),t}var F2={Singular:ume,Collection:dme};var pme="0.0.0-development",fme=`octokit-endpoint.js/${pme} ${Ys()}`,mme={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":fme},mediaType:{format:""}};function gme(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function hme(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function z2(e,t){let n=Object.assign({},e);return Object.keys(t).forEach(i=>{hme(t[i])?i in e?n[i]=z2(e[i],t[i]):Object.assign(n,{[i]:t[i]}):Object.assign(n,{[i]:t[i]})}),n}function U2(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function hC(e,t,n){if(typeof t=="string"){let[r,o]=t.split(" ");n=Object.assign(o?{method:r,url:o}:{url:r},n)}else n=Object.assign({},t);n.headers=gme(n.headers),U2(n),U2(n.headers);let i=z2(e||{},n);return n.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(i.mediaType.previews=e.mediaType.previews.filter(r=>!i.mediaType.previews.includes(r)).concat(i.mediaType.previews)),i.mediaType.previews=(i.mediaType.previews||[]).map(r=>r.replace(/-preview/,""))),i}function yme(e,t){let n=/\?/.test(e)?"&":"?",i=Object.keys(t);return i.length===0?e:e+n+i.map(r=>r==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${r}=${encodeURIComponent(t[r])}`).join("&")}var bme=/\{[^{}}]+\}/g;function vme(e){return e.replace(/(?:^\W+)|(?:(?n.concat(i),[]):[]}function j2(e,t){let n={__proto__:null};for(let i of Object.keys(e))t.indexOf(i)===-1&&(n[i]=e[i]);return n}function G2(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function gd(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function yg(e,t,n){return t=e==="+"||e==="#"?G2(t):gd(t),n?gd(n)+"="+t:t}function md(e){return e!=null}function gC(e){return e===";"||e==="&"||e==="?"}function kme(e,t,n,i){var r=e[n],o=[];if(md(r)&&r!=="")if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"||typeof r=="boolean")r=r.toString(),i&&i!=="*"&&(r=r.substring(0,parseInt(i,10))),o.push(yg(t,r,gC(t)?n:""));else if(i==="*")Array.isArray(r)?r.filter(md).forEach(function(s){o.push(yg(t,s,gC(t)?n:""))}):Object.keys(r).forEach(function(s){md(r[s])&&o.push(yg(t,r[s],s))});else{let s=[];Array.isArray(r)?r.filter(md).forEach(function(a){s.push(yg(t,a))}):Object.keys(r).forEach(function(a){md(r[a])&&(s.push(gd(a)),s.push(yg(t,r[a].toString())))}),gC(t)?o.push(gd(n)+"="+s.join(",")):s.length!==0&&o.push(s.join(","))}else t===";"?md(r)&&o.push(gd(n)):r===""&&(t==="&"||t==="?")?o.push(gd(n)+"="):r===""&&o.push("");return o}function $me(e){return{expand:_me.bind(null,e)}}function _me(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(i,r,o){if(r){let a="",c=[];if(n.indexOf(r.charAt(0))!==-1&&(a=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(l){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(l);c.push(kme(t,a,u[1],u[2]||u[3]))}),a&&a!=="+"){var s=",";return a==="?"?s="&":a!=="#"&&(s=a),(c.length!==0?a:"")+c.join(s)}else return c.join(",")}else return G2(o)}),e==="/"?e:e.replace(/\/$/,"")}function V2(e){let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),i=Object.assign({},e.headers),r,o=j2(e,["method","baseUrl","url","headers","request","mediaType"]),s=wme(n);n=$me(n).expand(o),/^http/.test(n)||(n=e.baseUrl+n);let a=Object.keys(e).filter(u=>s.includes(u)).concat("baseUrl"),c=j2(o,a);if(!/application\/octet-stream/i.test(i.accept)&&(e.mediaType.format&&(i.accept=i.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&e.mediaType.previews?.length)){let u=i.accept.match(/(?{let p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=yme(n,c):"data"in c?r=c.data:Object.keys(c).length&&(r=c),!i["content-type"]&&typeof r<"u"&&(i["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof r>"u"&&(r=""),Object.assign({method:t,url:n,headers:i},typeof r<"u"?{body:r}:null,e.request?{request:e.request}:null)}function Sme(e,t,n){return V2(hC(e,t,n))}function B2(e,t){let n=hC(e,t),i=Sme.bind(null,n);return Object.assign(i,{DEFAULTS:n,defaults:B2.bind(null,n),merge:hC.bind(null,n),parse:V2})}var q2=B2(null,mme);var H2=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function K2(e,t){let n=t?.comma===!0?Tme:65536,i=e.length,r=bC(e,t?.start??0,i),o=r;r=yC(e,r,i,n);let s=vC(e,o,r),a=e.slice(o,s).toLowerCase();return t?.parameters===!1?{type:a,index:r,parameters:new H2}:Ime(e,a,r,i,n)}var J2=32,Z2=9,Y2=59,xme=61,W2=34,Eme=92,Tme=44;function Ime(e,t,n,i,r){let o=new H2;e:for(;nt;){let i=e.charCodeAt(n-1);if(i!==J2&&i!==Z2)break;n--}return n}var Ame=/^-?\d+$/,pk=/^-?\d+n+$/,Qs=JSON.stringify,wC=JSON.parse,n4=/^-?\d+n$/,Q2=/([\[:])?"(-?\d+)n"($|\s*[,\}\]])/g,X2=/([\[:])?("-?\d+n+)n("$|"\s*[,\}\]])/g,kC=e=>e===void 0||typeof e=="function"||typeof e=="symbol",$C=e=>e!==null&&typeof e=="object"&&e.constructor&&e.constructor.name==="RawJSON",Rme=(e,t,n)=>{let i="";typeof n=="number"?i=" ".repeat(Math.min(10,Math.max(0,Math.floor(n)))):typeof n=="string"&&(i=n.slice(0,10));let r=typeof t=="function",o=Array.isArray(t)?new Set(t.map(String)):null,s=(m,g,h)=>(h!==null&&typeof h=="object"&&typeof h.toJSON=="function"&&(h=h.toJSON(g)),typeof h=="string"&&pk.test(h)?h+"n":typeof h=="bigint"?"rawJSON"in JSON?JSON.rawJSON(h.toString()):h.toString()+"n":(r&&(h=t.call(m,g,h)),h!==null&&typeof h=="object"&&(h instanceof Number||h instanceof String||h instanceof Boolean)&&(h=h.valueOf()),h)),a=s({"":e},"",e);if(kC(a))return;let c=a===null||typeof a!="object",l=$C(a);if(c||l)return Qs(a);let u=[],d=0,p=[{parent:{"":a},key:"",val:a,isArray:Array.isArray(a),keys:Array.isArray(a)?null:Object.keys(a),index:0,first:!0}],f=new WeakSet([a]);for(;p.length>0;){let m=p[p.length-1];m.index===0&&(u.push(m.isArray?"[":"{"),d++);let g=!1;if(m.isArray)if(m.index=m.keys.length&&p[p.length-1]===m&&(g=!0)}g&&(d--,!m.first&&i&&u.push(` -`+i.repeat(d)),u.push(m.isArray?"]":"}"),f.delete(m.val),p.pop())}return u.join("")},r4=(e,t,n)=>{try{return"rawJSON"in JSON?Qs(e,(a,c)=>typeof c=="bigint"?JSON.rawJSON(c.toString()):typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n):e?Qs(e,(a,c)=>typeof c=="string"&&pk.test(c)||typeof c=="bigint"?c.toString()+"n":typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n).replace(Q2,"$1$2$3").replace(X2,"$1$2$3"):Qs(e,t,n)}catch(i){if(i instanceof RangeError){let r=Rme(e,t,n);return r===void 0?void 0:"rawJSON"in JSON?r:r.replace(Q2,"$1$2$3").replace(X2,"$1$2$3")}throw i}},dk=new Map,Nme=()=>{let e=JSON.parse.toString();if(dk.has(e))return dk.get(e);try{let t=JSON.parse("1",(n,i,r)=>!!r?.source&&r.source==="1");return dk.set(e,t),t}catch{return dk.set(e,!1),!1}},Cme=(e,t,n,i)=>typeof t=="string"&&n4.test(t)?BigInt(t.slice(0,-1)):typeof t=="string"&&pk.test(t)?t.slice(0,-1):typeof i=="function"?i(e,t,n):t,Pme=(e,t)=>JSON.parse(e,(n,i,r)=>{let o=typeof i=="number",s=i>Number.MAX_SAFE_INTEGER||i{let n={"":e},i=[{parent:n,key:"",visited:!1}];for(;i.length>0;){let r=i[i.length-1];if(r.visited){let{parent:o,key:s}=r,a=o[s];typeof a=="string"&&(n4.test(a)?a=BigInt(a.slice(0,-1)):pk.test(a)&&(a=a.slice(0,-1))),typeof t=="function"&&(a=t.call(o,s,a)),a===void 0?delete o[s]:o[s]=a,i.pop()}else{r.visited=!0;let o=r.parent[r.key];if(o!==null&&typeof o=="object"){let a=Object.keys(o);for(let c=a.length-1;c>=0;c--)i.push({parent:o,key:a[c],visited:!1})}}}return n[""]},t4=e=>e.replace(Dme,(t,n,i,r)=>{let o=t[0]==='"';if(o&&Ome.test(t))return t.substring(0,t.length-1)+'n"';let a=i||r,c=n&&(n.length{if(!e)return wC(e,t);try{if(Nme())return Pme(e,t);let n=t4(e);return wC(n,(i,r,o)=>Cme(i,r,o,t))}catch(n){if(n instanceof RangeError){let i=t4(e),r=wC(i);return Mme(r,t)}throw n}};var Cc=class extends Error{name;status;request;response;constructor(t,n,i){super(t,{cause:i.cause}),this.name="HttpError",this.status=Number.parseInt(n),Number.isNaN(this.status)&&(this.status=0);"response"in i&&(this.response=i.response);let r=Object.assign({},i.request);i.request.headers.authorization&&(r.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/(?"";async function a4(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let n=e.request?.log||console,i=e.request?.parseSuccessResponseBody!==!1,r=Ume(e.body)||Array.isArray(e.body)?r4(e.body):e.body,o=Object.fromEntries(Object.entries(e.headers).map(([d,p])=>[d,String(p)])),s;try{s=await t(e.url,{method:e.method,body:r,redirect:e.request?.redirect,headers:o,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(d){let p="Unknown Error";if(d instanceof Error){if(d.name==="AbortError")throw d.status=500,d;p=d.message,d.name==="TypeError"&&"cause"in d&&(d.cause instanceof Error?p=d.cause.message:typeof d.cause=="string"&&(p=d.cause))}let f=new Cc(p,500,{request:e});throw f.cause=d,f}let a=s.status,c=s.url,l={};for(let[d,p]of s.headers)l[d]=p;let u={url:c,status:a,headers:l,data:""};if("deprecation"in l){let d=l.link&&l.link.match(/<([^<>]+)>; rel="deprecation"/),p=d&&d.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${l.sunset}${p?`. See ${p}`:""}`)}if(a===204||a===205)return u;if(e.method==="HEAD"){if(a<400)return u;throw new Cc(s.statusText,a,{response:u,request:e})}if(a===304)throw u.data=await _C(s),new Cc("Not modified",a,{response:u,request:e});if(a>=400)throw u.data=await _C(s),new Cc(zme(u.data),a,{response:u,request:e});return u.data=i?await _C(s):s.body,u}async function _C(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(s4);let n=K2(t);if(jme(n)){let i="";try{return i=await e.text(),o4(i)}catch{return i}}else return n.type.startsWith("text/")||n.parameters.charset?.toLowerCase()==="utf-8"&&n.type!=="application/octet-stream"?e.text().catch(s4):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function jme(e){return e.type==="application/json"||e.type==="application/scim+json"}function zme(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if(typeof e=="object"&&e!==null&&"message"in e){let t=e,n="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(i=>JSON.stringify(i)).join(", ")}${n}`:`${t.message}${n}`}return`Unknown error: ${JSON.stringify(e)}`}function SC(e,t){let n=e.defaults(t);return Object.assign(function(r,o){let s=n.merge(r,o);if(!s.request||!s.request.hook)return a4(n.parse(s));let a=(c,l)=>a4(n.parse(n.merge(c,l)));return Object.assign(a,{endpoint:n,defaults:SC.bind(null,n)}),s.request.hook(a,s)},{endpoint:n,defaults:SC.bind(null,n)})}var bg=SC(q2,Fme);var Gme="0.0.0-development";function Vme(e){return`Request failed due to following response errors: +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}a.count>1&&e.reused==="ref"&&o(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function N2(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;N2(r);let i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;let o=r.type;for(let s of Array.isArray(o)?o:[o]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var D2=new Set(["type","properties","required","additionalProperties"]),P2=["oneOf","anyOf"];function C2(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function dP(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let s in o)if(!D2.has(s))return null;t.push(o)}let n={},r=new Set;for(let o of t){for(let s in o.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let l of t){let u=l.properties?.[s]??C2(l);u!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(u))||a.push(u))}let c=a.length===1?a[0]:dP(a)??{allOf:a};$n(n,s,c)}for(let s of o.required??[])r.add(s)}let i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(o=>o.additionalProperties===!1))i.additionalProperties=!1;else{let o=[];for(let s of t){let a=C2(s);a&&!o.some(c=>JSON.stringify(c)===JSON.stringify(a))&&o.push(a)}o.length===1?i.additionalProperties=o[0]:o.length>1&&(i.additionalProperties={allOf:o})}return i}function Cge(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let i of D2)if(i in e)return;let n=t.filter(i=>P2.some(o=>Array.isArray(i[o]))),r=null;if(!n.length)r=dP(t);else{let i=n[0],o=P2.find(c=>Array.isArray(i[c]));if(Object.keys(i).length!==1)return;let s=t.filter(c=>c!==i),a=i[o].map(c=>dP([...s,c]));if(a.some(c=>!c))return;r={[o]:a}}r&&(delete e.allOf,vg(e,r))}function Gs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=a=>{let c=e.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){r(d);let f=e.seen.get(d),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):vg(l,m),vg(l,u),a._zod.parent===d)for(let h in l)h==="$ref"||h==="allOf"||h in u||delete l[h];if(m.$ref&&f.def)for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}let p=a._zod.parent;if(p&&p!==d){r(p);let f=e.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let m in l)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(l[m])===JSON.stringify(f.def[m])&&delete l[m]}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())r(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())N2(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let u=l?.allOf;if(!Array.isArray(u))continue;let d=a.get(u);d?d.push(l):a.set(u,[l])}for(let c of e.intersections)for(let l of a.get(c)??[])Cge(l)}}let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(a)}vg(i,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&i.id===o&&delete i.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,$n(s,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Mu(t,"input",e.processors),output:Mu(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Sn(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Sn(r.element,n);if(r.type==="set")return Sn(r.valueType,n);if(r.type==="lazy")return Sn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return Sn(r.innerType,n);if(r.type==="intersection")return Sn(r.left,n)||Sn(r.right,n);if(r.type==="record"||r.type==="map")return Sn(r.keyType,n)||Sn(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Sn(r.in,n)||Sn(r.out,n);if(r.type==="object"){for(let i in r.shape)if(Sn(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(let i of r.options)if(Sn(i,n))return!0;return!1}if(r.type==="tuple"){for(let i of r.items)if(Sn(i,n))return!0;return!!(r.rest&&Sn(r.rest,n))}return!1}var pP=(e,t={})=>n=>{let r=Us({...n,processors:t});return ot(e,r),zs(r,e),Gs(r,e)},Mu=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r??{},s=Us({...i??{},target:o,io:t,processors:n});return ot(e,s),zs(s,e),Gs(s,e)};var Lu=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Fu=(e,t,n)=>{(e[t]===void 0||n{Lu(e,"minimum",t),Fu(e,"maximum",t)},j2=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},U2=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},z2=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},G2=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},M2=(e,t)=>Lu(e,"minimum",t.minimum),L2=(e,t)=>Fu(e,"maximum",t.maximum),F2=e=>(t,n)=>{G2(t,n.format);let[r,i]=e[n.format];Lu(t,"minimum",r),Fu(t,"maximum",i)},Nge={greater_than:(e,t)=>Lu(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Fu(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>j2(e,t.value),number_format:F2(qm),bigint_format:F2(Wm),min_length:M2,max_length:L2,length_equals:(e,t)=>O2(e,t.length),min_size:M2,max_size:L2,size_equals:(e,t)=>O2(e,t.size),string_format:(e,t)=>{G2(e,t.format),t.pattern&&U2(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>z2(e,t.mime)};function hn(e){let t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let o of r)Nge[o._zod.def.check]?.(t,o._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Lu(t,"minimum",i.minimum),i.exclusiveMinimum!==void 0&&Lu(t,"exclusiveMinimum",i.exclusiveMinimum),i.maximum!==void 0&&Fu(t,"maximum",i.maximum),i.exclusiveMaximum!==void 0&&Fu(t,"exclusiveMaximum",i.exclusiveMaximum),i.multipleOf!==void 0&&j2(t,i.multipleOf),i.format!==void 0&&(t.format??(t.format=i.format),i.format.includes("int")&&(t.isInt=!0)),i.mime&&z2(t,i.mime);for(let o of i.patterns??[])U2(t,o);return t}var Dge={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Oge=new Map([[ew,_A],[ig,$A]]),B2=e=>Oge.get(e)??e,gP=(e,t,n,r)=>{let i=n;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l,laxFormat:u}=hn(e);if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=Dge[a]??a,i.format===""&&delete i.format,(a==="time"||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let d=[...c].map(B2);d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},hP=(e,t,n,r)=>{let i=n,{minimum:o,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=hn(e);i.type=u?"integer":"number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(d?f?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof o=="number"&&(i.minimum=o),p?f?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof s=="number"&&(i.maximum=s),a){let m=new Set;for(let v of a)Number.isFinite(v)&&v!==0?m.add(Math.abs(v)):Zt(e,t,i,r,`A multipleOf divisor of ${v} cannot be represented in JSON Schema`);let[g,...h]=m;g!==void 0&&(i.multipleOf=g),h.length&&(i.allOf=[...i.allOf??[],...h.map(v=>({multipleOf:v}))])}},yP=(e,t,n,r)=>{n.type="boolean"},bP=(e,t,n,r)=>{Zt(e,t,n,r,"BigInt cannot be represented in JSON Schema")},vP=(e,t,n,r)=>{Zt(e,t,n,r,"Symbols cannot be represented in JSON Schema")},wP=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},kP=(e,t,n,r)=>{Zt(e,t,n,r,"Undefined cannot be represented in JSON Schema")},_P=(e,t,n,r)=>{Zt(e,t,n,r,"Void cannot be represented in JSON Schema")},$P=(e,t,n,r)=>{n.not={}},SP=(e,t,n,r)=>{},xP=(e,t,n,r)=>{},EP=(e,t,n,r)=>{Zt(e,t,n,r,"Date cannot be represented in JSON Schema")},TP=(e,t,n,r)=>{let i=e._zod.def,o=lu(i.entries);if(o.length===0){n.not={};return}o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},IP=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let o=[];for(let s of i.values)if(s===void 0){if(Zt(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Zt(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},AP=(e,t,n,r)=>{Zt(e,t,n,r,"NaN cannot be represented in JSON Schema")},RP=(e,t,n,r)=>{let i=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},PP=(e,t,n,r)=>{let i=n;i.type="string",i.format="binary",i.contentEncoding="binary";let{minimum:o,maximum:s,mime:a}=hn(e);o!==void 0&&(i.minLength=o),s!==void 0&&(i.maxLength=s),a&&(a.length===0?i.not={}:a.length===1?i.contentMediaType=a[0]:i.anyOf=a.map(c=>({contentMediaType:c})))},CP=(e,t,n,r)=>{n.type="boolean"},NP=(e,t,n,r)=>{Zt(e,t,n,r,"Custom types cannot be represented in JSON Schema")},DP=(e,t,n,r)=>{Zt(e,t,n,r,"Function types cannot be represented in JSON Schema")},OP=(e,t,n,r)=>{Zt(e,t,n,r,"Transforms cannot be represented in JSON Schema")},MP=(e,t,n,r)=>{Zt(e,t,n,r,"Map cannot be represented in JSON Schema")},LP=(e,t,n,r)=>{Zt(e,t,n,r,"Set cannot be represented in JSON Schema")},FP=(e,t,n,r)=>{let i=n,o=e._zod.def,{minimum:s,maximum:a}=hn(e);typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=ot(o.element,t,{...r,path:[...r.path,"items"]})};function ju(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?ju(t.out):t.type==="catch"?ju(t.innerType):e._zod.optin}var jP=(e,t,n,r)=>{let i=n,o=e._zod.def,s=o.shape;if(Object.getOwnPropertySymbols(s).length&&Zt(e,t,i,r,"Symbol keys cannot be represented in JSON Schema"))return;i.type="object",i.properties={};for(let u in s)$n(i.properties,u,ot(s[u],t,{...r,path:[...r.path,"properties",u]}));let c=new Set(Object.keys(s)),l=new Set([...c].filter(u=>{let d=o.shape[u];return t.io==="input"?ju(d)===void 0:d._zod.optout===void 0}));l.size>0&&(i.required=Array.from(l)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=ot(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Mge=(e,t,n,r)=>{let i=n,o=e._zod.def;if(Object.getOwnPropertySymbols(o.shape).length&&Zt(e,t,i,r,"Symbol keys cannot be represented in JSON Schema"))return;if(t.io==="output"){for(let a in o.shape)if(Sn(o.shape[a])&&Zt(e,t,i,r,`z.properties() returns its input, so the output of a transforming schema at key "${a}" cannot be represented in JSON Schema`))return}i.type="object",i.properties={};for(let a in o.shape)$n(i.properties,a,ot(o.shape[a],t,{...r,path:[...r.path,"properties",a]}));let s=Object.keys(o.shape).filter(a=>ju(o.shape[a])===void 0);s.length>0&&(i.required=s)},Zw=(e,t,n,r)=>{let i=e._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>ot(a,t,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=s:n.anyOf=s},UP=(e,t,n,r)=>{let i=e._zod.def,o=ot(i.left,t,{...r,path:[...r.path,"allOf",0]}),s=ot(i.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=c,t.intersections.push(c)},zP=(e,t,n,r)=>{let i=n,o=e._zod.def;i.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((g,h)=>ot(g,t,{...r,path:[...r.path,s,h]})),l=o.rest?ot(o.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,u=o.items.length;for(;u>0;){let g=o.items[u-1];if(!(t.io==="input"?ju(g)!==void 0:g._zod.optout==="optional"))break;u--}let d=o.items.length,p=!o.rest;t.target==="draft-2020-12"?(i.prefixItems=c,p?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),p&&(i.maxItems=d)):t.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),p&&(i.maxItems=d)):(i.items=c,p?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),p&&(i.maxItems=d));let{minimum:f,maximum:m}=hn(e);typeof f=="number"&&(i.minItems=f),typeof m=="number"&&(i.maxItems=m)};function fP(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let g=fP(e,m,n);return g===m?t:g}for(let m of["anyOf","oneOf"]){let g=t[m];if(!Array.isArray(g))continue;let h=g.map(v=>fP(e,v,n));h.some((v,b)=>v!==g[b])&&(t={...t,[m]:h})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes("string")&&r.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!i&&!o?.some(m=>typeof m=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:p,...f}=t;return f.enum?f.enum=f.enum.map(m=>typeof m=="number"?String(m):m):typeof f.const=="number"&&(f.const=String(f.const)),i&&(f.type="string",o||(f.pattern=(r.includes("number")?Jo:Xm).source)),f}var mP=new WeakMap;function Lge(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of mP.get(e)??[]){let i=e.seen.get(r),o=(i?.def??i?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let s=fP(t,o,new Set);s!==o&&n.set(o,s)}if(n.size)for(let r of e.seen.values())for(let i of[r.schema,r.def]){let o=i&&n.get(i.propertyNames);o&&(i.propertyNames=o)}}var GP=(e,t,n,r)=>{let i=n,o=e._zod.def;i.type="object";let s=o.keyType,a=hn(s).patterns;if(o.mode==="loose"&&a&&a.size>0){let u=ot(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(let d of a)$n(i.patternProperties,B2(d).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){i.propertyNames=ot(o.keyType,t,{...r,path:[...r.path,"propertyNames"]});let u=mP.get(t);u||(u=[],mP.set(t,u),t.deferred.push(()=>Lge(t))),u.push(e)}i.additionalProperties=ot(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let c=s._zod.values,l=t.io==="input"&&ju(o.valueType)!==void 0;if(c&&!o.partial&&!l){let u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u.map(String))}},BP=(e,t,n,r)=>{let i=e._zod.def,o=ot(i.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},VP=(e,t,n,r)=>{let i=e._zod.def;ot(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType},qP=Symbol();function V2(e,t,n,r,i){let o=!1,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(Zt(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),qP):JSON.parse(s)}var WP=(e,t,n,r)=>{let i=e._zod.def;ot(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType;let s=V2(i.defaultValue,e,t,n,r);s!==qP&&(n.default=s)},HP=(e,t,n,r)=>{let i=e._zod.def;ot(i.innerType,t,r);let o=t.seen.get(e);if(o.ref=i.innerType,t.io!=="input")return;let s=V2(i.defaultValue,e,t,n,r);s!==qP&&(n._prefault=s)},KP=(e,t,n,r)=>{let i=e._zod.def;ot(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{Zt(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},JP=(e,t,n,r)=>{let i=e._zod.def,o=i.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?o?i.out:i.in:i.out;ot(s,t,r);let a=t.seen.get(e);a.ref=s},ZP=(e,t,n,r)=>{let i=e._zod.def;ot(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType,n.readOnly=!0},YP=(e,t,n,r)=>{let i=e._zod.def;ot(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType},Yw=(e,t,n,r)=>{let i=e._zod.def;ot(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType},QP=(e,t,n,r)=>{let i=e._zod.innerType;ot(i,t,r);let o=t.seen.get(e);o.ref=i},Jw={string:gP,number:hP,boolean:yP,bigint:bP,symbol:vP,null:wP,undefined:kP,void:_P,never:$P,any:SP,unknown:xP,date:EP,enum:TP,literal:IP,nan:AP,template_literal:RP,file:PP,success:CP,custom:NP,properties:Mge,function:DP,transform:OP,map:MP,set:LP,array:FP,object:jP,union:Zw,intersection:UP,tuple:zP,record:GP,nullable:BP,nonoptional:VP,default:WP,prefault:HP,catch:KP,pipe:JP,readonly:ZP,promise:YP,optional:Yw,lazy:QP};function Qw(e,t){if("_idmap"in e){let r=e,i=Us({...t,processors:Jw}),o={};for(let c of r._idmap.entries()){let[l,u]=c;ot(u,i)}let s={},a={registry:r,uri:t?.uri,defs:o};i.external=a;for(let c of r._idmap.entries()){let[l,u]=c;zs(i,u),$n(s,l,Gs(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 n=Us({...t,processors:Jw});return ot(e,n),zs(n,e),Gs(n,e)}var Xw=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(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Us({processors:Jw,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return ot(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,zs(this.ctx,t);let r=Gs(this.ctx,t),{"~standard":i,...o}=r;return o}};var q2={};var Ku={};kr(Ku,{ZodAny:()=>wC,ZodArray:()=>SC,ZodBase64:()=>bk,ZodBase64URL:()=>vk,ZodBigInt:()=>Wu,ZodBigIntFormat:()=>_k,ZodBoolean:()=>qu,ZodCIDRv4:()=>hk,ZodCIDRv6:()=>yk,ZodCUID:()=>lk,ZodCUID2:()=>uk,ZodCatch:()=>qC,ZodCodec:()=>Ag,ZodCreditCard:()=>pC,ZodCustom:()=>Rg,ZodCustomStringFormat:()=>Bu,ZodDate:()=>$g,ZodDefault:()=>jC,ZodDiscriminatedUnion:()=>EC,ZodE164:()=>wk,ZodEmail:()=>ok,ZodEmoji:()=>ak,ZodEnum:()=>zu,ZodExactOptional:()=>Ek,ZodFile:()=>OC,ZodFunction:()=>tN,ZodGUID:()=>sk,ZodIBAN:()=>fC,ZodIPv4:()=>mk,ZodIPv6:()=>gk,ZodISODate:()=>qs,ZodISODateTime:()=>Vs,ZodISODuration:()=>Hs,ZodISOTime:()=>Ws,ZodInstanceOf:()=>sN,ZodIntersection:()=>TC,ZodJWT:()=>kk,ZodKSUID:()=>fk,ZodLazy:()=>QC,ZodLiteral:()=>DC,ZodMAC:()=>dC,ZodMap:()=>CC,ZodNaN:()=>HC,ZodNanoID:()=>ck,ZodNever:()=>_C,ZodNonOptional:()=>Tk,ZodNull:()=>bC,ZodNullable:()=>FC,ZodNumber:()=>Vu,ZodNumberFormat:()=>vc,ZodObject:()=>xg,ZodOptional:()=>Tg,ZodPipe:()=>Ig,ZodPrefault:()=>zC,ZodPreprocess:()=>KC,ZodPromise:()=>eN,ZodProperties:()=>nN,ZodReadonly:()=>JC,ZodRecord:()=>Uu,ZodSet:()=>NC,ZodString:()=>Gu,ZodStringFormat:()=>mt,ZodSuccess:()=>VC,ZodSymbol:()=>hC,ZodTemplateLiteral:()=>YC,ZodTransform:()=>MC,ZodTuple:()=>AC,ZodType:()=>Le,ZodULID:()=>dk,ZodURL:()=>_g,ZodUUID:()=>mo,ZodUndefined:()=>yC,ZodUnion:()=>Eg,ZodUnknown:()=>kC,ZodVoid:()=>$C,ZodXID:()=>pk,ZodXor:()=>xC,_ZodString:()=>ik,_default:()=>UC,_function:()=>n6,any:()=>N4,array:()=>Sg,base64:()=>m4,base64url:()=>g4,bigint:()=>I4,boolean:()=>gC,catch:()=>WC,check:()=>r6,cidrv4:()=>p4,cidrv6:()=>f4,codec:()=>Q4,creditCard:()=>y4,cuid:()=>i4,cuid2:()=>o4,custom:()=>i6,date:()=>O4,describe:()=>o6,discriminatedUnion:()=>z4,e164:()=>h4,email:()=>K2,emoji:()=>n4,enum:()=>Sk,exactOptional:()=>LC,file:()=>K4,float32:()=>S4,float64:()=>x4,function:()=>n6,guid:()=>J2,hash:()=>$4,hex:()=>_4,hostname:()=>k4,httpUrl:()=>t4,iban:()=>b4,instanceof:()=>a6,int:()=>nk,int32:()=>E4,int64:()=>A4,intersection:()=>IC,invertCodec:()=>X4,ipv4:()=>l4,ipv6:()=>d4,json:()=>l6,jwt:()=>v4,keyof:()=>M4,ksuid:()=>c4,lazy:()=>XC,literal:()=>H4,looseObject:()=>j4,looseRecord:()=>B4,mac:()=>u4,map:()=>V4,meta:()=>s6,nan:()=>Y4,nanoid:()=>r4,nativeEnum:()=>W4,never:()=>$k,nonoptional:()=>BC,null:()=>vC,nullable:()=>kg,nullish:()=>J4,number:()=>mC,object:()=>L4,optional:()=>bc,partialRecord:()=>G4,pipe:()=>rk,prefault:()=>GC,preprocess:()=>u6,promise:()=>t6,properties:()=>rN,readonly:()=>ZC,record:()=>PC,refine:()=>iN,set:()=>q4,strictObject:()=>F4,string:()=>wg,stringFormat:()=>w4,stringbool:()=>c6,success:()=>Z4,superRefine:()=>oN,symbol:()=>P4,templateLiteral:()=>e6,transform:()=>xk,tuple:()=>RC,uint32:()=>T4,uint64:()=>R4,ulid:()=>s4,undefined:()=>C4,union:()=>Hu,unknown:()=>yc,url:()=>e4,uuid:()=>Z2,uuidv4:()=>Y2,uuidv6:()=>Q2,uuidv7:()=>X2,void:()=>D4,xid:()=>a4,xor:()=>U4});var ek={};kr(ek,{endsWith:()=>Iu,gt:()=>po,gte:()=>zr,includes:()=>Eu,length:()=>hc,lowercase:()=>Su,lt:()=>uo,lte:()=>Ur,maxLength:()=>gc,maxSize:()=>js,mime:()=>Au,minLength:()=>Zo,minSize:()=>fo,multipleOf:()=>Fs,negative:()=>qw,nonnegative:()=>Hw,nonpositive:()=>Ww,normalize:()=>Ru,overwrite:()=>Gi,positive:()=>Vw,property:()=>Kw,regex:()=>$u,size:()=>mc,slugify:()=>Du,startsWith:()=>Tu,toLowerCase:()=>Cu,toUpperCase:()=>Nu,trim:()=>Pu,uppercase:()=>xu});var W2=new WeakSet([Object.prototype,Error.prototype]);function tk(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var H2=(e,t)=>{nA.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);W2.has(n)||(W2.add(n),tk(n,"format",r=>i=>Zm(r,i)),tk(n,"flatten",r=>i=>Jm(r,i)),tk(n,"addIssue",r=>i=>{r.issues.push(i),r.message=JSON.stringify(r.issues,uu,2)}),tk(n,"addIssues",r=>i=>{r.issues.push(...i),r.message=JSON.stringify(r.issues,uu,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},jge=C("ZodError",H2),Tr=C("ZodError",H2,void 0,{Parent:Error});var XP=mu(Tr),eC=gu(Tr),tC=hu(Tr),nC=yu(Tr),rC=Pv(Tr),iC=Cv(Tr),oC=Nv(Tr),sC=Dv(Tr),aC=Ov(Tr),cC=Mv(Tr),lC=Lv(Tr),uC=Fv(Tr);function zge(){gn.localeError||Gt(hw())}function Bs(){gn.memoizer||Gt({memoizer:dg()})}var Le=C("ZodType",(e,t)=>(zge(),Ne.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(V.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return it(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(iN(e,t))},superRefine(e,t){return this.check(oN(e,t))},overwrite(e){return this.check(Gi(e))},optional(){return bc(this)},exactOptional(){return LC(this)},nullable(){return kg(this)},nullish(){return bc(kg(this))},nonoptional(e){return BC(this,e)},array(){return Sg(this)},or(e){return Hu([this,e])},and(e){return IC(this,e)},transform(e){return rk(this,xk(e))},default(e){return UC(this,e)},prefault(e){return GC(this,e)},catch(e){return WC(this,e)},pipe(e){return rk(this,e)},readonly(){return ZC(this)},describe(e){let t=this.clone();return Nn.add(t,{description:e}),t},meta(...e){if(e.length===0)return Nn.get(this);let t=this.clone();return Nn.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return V.hide(this,"~standard",{...Kv(this),jsonSchema:{input:Mu(this,"input"),output:Mu(this,"output")}})},set"~standard"(e){V.own(this,"~standard",e)},parse:function e(t,n){return XP(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await eC(this,t,n,{callee:e})},safeParse(e,t){return tC(this,e,t)},async safeParseAsync(e,t){return nC(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){V.own(this,"spa",e)},validate(e,t){return Ym(this,e,t)},validateAsync(e,t){return Qm(this,e,t)},encode:function e(t,n){return rC(this,t,n,{callee:e})},decode:function e(t,n){return iC(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await oC(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await sC(this,t,n,{callee:e})},safeEncode(e,t){return aC(this,e,t)},safeDecode(e,t){return cC(this,e,t)},async safeEncodeAsync(e,t){return lC(this,e,t)},async safeDecodeAsync(e,t){return uC(this,e,t)},toJSONSchema(e){return pP(this,{})(e)},get description(){return Nn.get(this)?.description},get _def(){return this._zod.def}}),ik=C("_ZodString",(e,t)=>{lc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gP(e,n,r,i)},V.derived({format:e=>hn(e).format??null,minLength:e=>hn(e).minimum??null,maxLength:e=>hn(e).maximum??null},{regex(...e){return this.check($u(...e))},includes(...e){return this.check(Eu(...e))},startsWith(...e){return this.check(Tu(...e))},endsWith(...e){return this.check(Iu(...e))},min(...e){return this.check(Zo(...e))},max(...e){return this.check(gc(...e))},length(...e){return this.check(hc(...e))},nonempty(...e){return this.check(Zo(1,...e))},lowercase(e){return this.check(Su(e))},uppercase(e){return this.check(xu(e))},trim(){return this.check(Pu())},normalize(...e){return this.check(Ru(...e))},toLowerCase(){return this.check(Cu())},toUpperCase(){return this.check(Nu())},slugify(){return this.check(Du())}})),Gu=C("ZodString",(e,t)=>{lc.init(e,t),ik.init(e,t)},{email(e){return this.check($w(ok,e))},url(e){return this.check(mg(_g,e))},jwt(e){return this.check(Bw(kk,e))},emoji(e){return this.check(Aw(ak,e))},guid(e){return this.check(Sw(sk,e))},uuid(e){return this.check(xw(mo,e))},uuidv4(e){return this.check(Ew(mo,e))},uuidv6(e){return this.check(Tw(mo,e))},uuidv7(e){return this.check(Iw(mo,e))},nanoid(e){return this.check(Rw(ck,e))},cuid(e){return this.check(Pw(lk,e))},cuid2(e){return this.check(Cw(uk,e))},ulid(e){return this.check(Nw(dk,e))},base64(e){return this.check(Uw(bk,e))},base64url(e){return this.check(zw(vk,e))},xid(e){return this.check(Dw(pk,e))},ksuid(e){return this.check(Ow(fk,e))},ipv4(e){return this.check(Mw(mk,e))},ipv6(e){return this.check(Lw(gk,e))},cidrv4(e){return this.check(Fw(hk,e))},cidrv6(e){return this.check(jw(yk,e))},e164(e){return this.check(Gw(wk,e))},datetime(e){return this.check(gg(Vs,e))},date(e){return this.check(hg(qs,e))},time(e){return this.check(yg(Ws,e))},duration(e){return this.check(bg(Hs,e))}});function wg(e){return TR(Gu,e)}var mt=C("ZodStringFormat",(e,t)=>{lt.init(e,t),ik.init(e,t)}),Vs=C("ZodISODateTime",(e,t)=>{b0.init(e,t),mt.init(e,t)}),qs=C("ZodISODate",(e,t)=>{v0.init(e,t),mt.init(e,t)}),Ws=C("ZodISOTime",(e,t)=>{w0.init(e,t),mt.init(e,t)}),Hs=C("ZodISODuration",(e,t)=>{k0.init(e,t),mt.init(e,t)}),ok=C("ZodEmail",(e,t)=>{a0.init(e,t),mt.init(e,t)});function K2(e){return $w(ok,e)}var sk=C("ZodGUID",(e,t)=>{o0.init(e,t),mt.init(e,t)});function J2(e){return Sw(sk,e)}var mo=C("ZodUUID",(e,t)=>{s0.init(e,t),mt.init(e,t)});function Z2(e){return xw(mo,e)}function Y2(e){return Ew(mo,e)}function Q2(e){return Tw(mo,e)}function X2(e){return Iw(mo,e)}var _g=C("ZodURL",(e,t)=>{u0.init(e,t),mt.init(e,t)});function e4(e){return mg(_g,e)}function t4(e){return mg(_g,{protocol:sr.httpProtocol,hostname:sr.domain,...V.normalizeParams(e)})}var ak=C("ZodEmoji",(e,t)=>{d0.init(e,t),mt.init(e,t)});function n4(e){return Aw(ak,e)}var ck=C("ZodNanoID",(e,t)=>{p0.init(e,t),mt.init(e,t)});function r4(e){return Rw(ck,e)}var lk=C("ZodCUID",(e,t)=>{f0.init(e,t),mt.init(e,t)});function i4(e){return Pw(lk,e)}var uk=C("ZodCUID2",(e,t)=>{m0.init(e,t),mt.init(e,t)});function o4(e){return Cw(uk,e)}var dk=C("ZodULID",(e,t)=>{g0.init(e,t),mt.init(e,t)});function s4(e){return Nw(dk,e)}var pk=C("ZodXID",(e,t)=>{h0.init(e,t),mt.init(e,t)});function a4(e){return Dw(pk,e)}var fk=C("ZodKSUID",(e,t)=>{y0.init(e,t),mt.init(e,t)});function c4(e){return Ow(fk,e)}var mk=C("ZodIPv4",(e,t)=>{_0.init(e,t),mt.init(e,t)});function l4(e){return Mw(mk,e)}var dC=C("ZodMAC",(e,t)=>{S0.init(e,t),mt.init(e,t)});function u4(e){return AR(dC,e)}var gk=C("ZodIPv6",(e,t)=>{$0.init(e,t),mt.init(e,t)});function d4(e){return Lw(gk,e)}var hk=C("ZodCIDRv4",(e,t)=>{x0.init(e,t),mt.init(e,t)});function p4(e){return Fw(hk,e)}var yk=C("ZodCIDRv6",(e,t)=>{E0.init(e,t),mt.init(e,t)});function f4(e){return jw(yk,e)}var bk=C("ZodBase64",(e,t)=>{T0.init(e,t),mt.init(e,t)});function m4(e){return Uw(bk,e)}var vk=C("ZodBase64URL",(e,t)=>{I0.init(e,t),mt.init(e,t)});function g4(e){return zw(vk,e)}var wk=C("ZodE164",(e,t)=>{A0.init(e,t),mt.init(e,t)});function h4(e){return Gw(wk,e)}var pC=C("ZodCreditCard",(e,t)=>{R0.init(e,t),mt.init(e,t)});function y4(e){return RR(pC,e)}var fC=C("ZodIBAN",(e,t)=>{P0.init(e,t),mt.init(e,t)});function b4(e){return PR(fC,e)}var kk=C("ZodJWT",(e,t)=>{C0.init(e,t),mt.init(e,t)});function v4(e){return Bw(kk,e)}var Bu=C("ZodCustomStringFormat",(e,t)=>{N0.init(e,t),mt.init(e,t)});function w4(e,t,n={}){return Ou(Bu,e,t,n)}function k4(e){return Ou(Bu,"hostname",sr.hostname,e)}function _4(e){return Ou(Bu,"hex",sr.hex,e)}function $4(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,i=sr[r];if(!i)throw new Error(`Unrecognized hash format: ${r}`);return Ou(Bu,r,i,t)}var Vu=C("ZodNumber",(e,t)=>{ow.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hP(e,n,r,i),e.isFinite=!0},V.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=hn(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=hn(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=hn(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>hn(e).format??null},{gt(e,t){return this.check(po(e,t))},gte(e,t){return this.check(zr(e,t))},min(e,t){return this.check(zr(e,t))},lt(e,t){return this.check(uo(e,t))},lte(e,t){return this.check(Ur(e,t))},max(e,t){return this.check(Ur(e,t))},int(e){return this.check(nk(e))},safe(e){return this.check(nk(e))},positive(e){return this.check(po(0,e))},nonnegative(e){return this.check(zr(0,e))},negative(e){return this.check(uo(0,e))},nonpositive(e){return this.check(Ur(0,e))},multipleOf(e,t){return this.check(Fs(e,t))},step(e,t){return this.check(Fs(e,t))},finite(){return this}}));function mC(e){return NR(Vu,e)}var vc=C("ZodNumberFormat",(e,t)=>{D0.init(e,t),Vu.init(e,t)});function nk(e){return OR(vc,e)}function S4(e){return MR(vc,e)}function x4(e){return LR(vc,e)}function E4(e){return FR(vc,e)}function T4(e){return jR(vc,e)}var qu=C("ZodBoolean",(e,t)=>{og.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yP(e,n,r,i)});function gC(e){return UR(qu,e)}var Wu=C("ZodBigInt",(e,t)=>{sw.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bP(e,n,r,i)},V.derived({minValue:e=>hn(e).minimum??null,maxValue:e=>hn(e).maximum??null,format:e=>hn(e).format??null},{gte(e,t){return this.check(zr(e,t))},min(e,t){return this.check(zr(e,t))},gt(e,t){return this.check(po(e,t))},lt(e,t){return this.check(uo(e,t))},lte(e,t){return this.check(Ur(e,t))},max(e,t){return this.check(Ur(e,t))},positive(e){return this.check(po(BigInt(0),e))},negative(e){return this.check(uo(BigInt(0),e))},nonpositive(e){return this.check(Ur(BigInt(0),e))},nonnegative(e){return this.check(zr(BigInt(0),e))},multipleOf(e,t){return this.check(Fs(e,t))}}));function I4(e){return GR(Wu,e)}var _k=C("ZodBigIntFormat",(e,t)=>{O0.init(e,t),Wu.init(e,t)});function A4(e){return VR(_k,e)}function R4(e){return qR(_k,e)}var hC=C("ZodSymbol",(e,t)=>{M0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vP(e,n,r,i)});function P4(e){return WR(hC,e)}var yC=C("ZodUndefined",(e,t)=>{L0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kP(e,n,r,i)});function C4(e){return HR(yC,e)}var bC=C("ZodNull",(e,t)=>{F0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wP(e,n,r,i)});function vC(e){return KR(bC,e)}var wC=C("ZodAny",(e,t)=>{j0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SP(e,n,r,i)});function N4(){return JR(wC)}var kC=C("ZodUnknown",(e,t)=>{U0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xP(e,n,r,i)});function yc(){return ZR(kC)}var _C=C("ZodNever",(e,t)=>{z0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$P(e,n,r,i)});function $k(e){return YR(_C,e)}var $C=C("ZodVoid",(e,t)=>{G0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_P(e,n,r,i)});function D4(e){return QR($C,e)}var $g=C("ZodDate",(e,t)=>{B0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>EP(e,n,r,i),e.min=(n,r)=>e.check(zr(n,r)),e.max=(n,r)=>e.check(Ur(n,r))},V.derived({minDate:e=>{let{minimum:t}=hn(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=hn(e);return t?new Date(t):null}},{}));function O4(e){return XR($g,e)}var SC=C("ZodArray",(e,t)=>{Bs(),V0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FP(e,n,r,i),e.element=t.element},{min(e,t){return this.check(Zo(e,t))},nonempty(e){return this.check(Zo(1,e))},max(e,t){return this.check(gc(e,t))},length(e,t){return this.check(hc(e,t))},unwrap(){return this.element}});function Sg(e,t){return rP(SC,e,t)}function M4(e){let t=e._zod.def.shape;return Sk(Object.keys(t))}var xg=C("ZodObject",(e,t)=>{Bs(),q0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jP(e,n,r,i),V.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Sk(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(V.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(V.mergeDefs(this._zod.def,{catchall:yc()}))},loose(){return this.clone(V.mergeDefs(this._zod.def,{catchall:yc()}))},strict(){return this.clone(V.mergeDefs(this._zod.def,{catchall:$k()}))},strip(){return this.clone(V.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return V.extend(this,e)},safeExtend(e){return V.safeExtend(this,e)},merge(e){return V.merge(this,e)},pick(e){return V.pick(this,e)},omit(e){return V.omit(this,e)},partial(...e){return V.partial(Tg,this,e[0])},exactPartial(...e){return V.partial(Ek,this,e[0],"exactPartial")},required(...e){return V.required(Tk,this,e[0])}});function L4(e,t){let n={type:"object",shape:e??{},...V.normalizeParams(t)};return new xg(n)}function F4(e,t){return new xg({type:"object",shape:e,catchall:$k(),...V.normalizeParams(t)})}function j4(e,t){return new xg({type:"object",shape:e,catchall:yc(),...V.normalizeParams(t)})}var Eg=C("ZodUnion",(e,t)=>{sg.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Zw(e,n,r,i),e.options=t.options});function Hu(e,t){return new Eg({type:"union",options:e,...V.normalizeParams(t)})}var xC=C("ZodXor",(e,t)=>{Eg.init(e,t),W0.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Zw(e,n,r,i),e.options=t.options});function U4(e,t){return new xC({type:"union",options:e,inclusive:!1,...V.normalizeParams(t)})}var EC=C("ZodDiscriminatedUnion",(e,t)=>{Eg.init(e,t),K0.init(e,t)});function z4(e,t,n){return new EC({type:"union",options:t,discriminator:e,...V.normalizeParams(n)})}var TC=C("ZodIntersection",(e,t)=>{J0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>UP(e,n,r,i)});function IC(e,t){return new TC({type:"intersection",left:e,right:t})}var AC=C("ZodTuple",(e,t)=>{Bs(),aw.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zP(e,n,r,i)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Tg({type:"optional",innerType:t}))})}});function RC(e,t,n){let r=t instanceof Ne,i=r?n:t,o=r?t:null;return new AC({type:"tuple",items:e,rest:o,...V.normalizeParams(i)})}var Uu=C("ZodRecord",(e,t)=>{Bs(),Z0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GP(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function PC(e,t,n){return!t||!t._zod?new Uu({type:"record",keyType:wg(),valueType:e,...V.normalizeParams(t)}):new Uu({type:"record",keyType:e,valueType:t,...V.normalizeParams(n)})}function G4(e,t,n){return new Uu({type:"record",keyType:e,valueType:t,...V.normalizeParams(n),partial:!0})}function B4(e,t,n){return new Uu({type:"record",keyType:e,valueType:t,mode:"loose",...V.normalizeParams(n)})}var CC=C("ZodMap",(e,t)=>{Bs(),Y0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MP(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(fo(...n)),e.nonempty=n=>e.check(fo(1,n)),e.max=(...n)=>e.check(js(...n)),e.size=(...n)=>e.check(mc(...n))});function V4(e,t,n){return new CC({type:"map",keyType:e,valueType:t,...V.normalizeParams(n)})}var NC=C("ZodSet",(e,t)=>{Bs(),Q0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>LP(e,n,r,i),e.min=(...n)=>e.check(fo(...n)),e.nonempty=n=>e.check(fo(1,n)),e.max=(...n)=>e.check(js(...n)),e.size=(...n)=>e.check(mc(...n))});function q4(e,t){return new NC({type:"set",valueType:e,...V.normalizeParams(t)})}var zu=C("ZodEnum",(e,t)=>{X0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,i,o)=>TP(e,r,i,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{let o={};for(let s of r)if(n.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new zu({...t,checks:[],...V.normalizeParams(i),entries:o})},e.exclude=(r,i)=>{let o={...t.entries};for(let s of r)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new zu({...t,checks:[],...V.normalizeParams(i),entries:o})}});function Sk(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new zu({type:"enum",entries:n,...V.normalizeParams(t)})}function W4(e,t){return new zu({type:"enum",entries:e,...V.normalizeParams(t)})}var DC=C("ZodLiteral",(e,t)=>{eR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IP(e,n,r,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function H4(e,t){return new DC({type:"literal",values:Array.isArray(e)?e:[e],...V.normalizeParams(t)})}var OC=C("ZodFile",(e,t)=>{tR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PP(e,n,r,i),e.min=(n,r)=>e.check(fo(n,r)),e.max=(n,r)=>e.check(js(n,r)),e.mime=(n,r)=>e.check(Au(Array.isArray(n)?n:[n],r))});function K4(e){return iP(OC,e)}var MC=C("ZodTransform",(e,t)=>{Bs(),nR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>OP(e,n,r,i),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ls(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(V.issue(o,n.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=e),n.issues.push(V.issue(s))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function xk(e){return new MC({type:"transform",transform:e})}var Tg=C("ZodOptional",(e,t)=>{cw.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Yw(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function bc(e){return new Tg({type:"optional",innerType:e})}var Ek=C("ZodExactOptional",(e,t)=>{rR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Yw(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function LC(e){return new Ek({type:"optional",innerType:e})}var FC=C("ZodNullable",(e,t)=>{iR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BP(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function kg(e){return new FC({type:"nullable",innerType:e})}function J4(e){return bc(kg(e))}var jC=C("ZodDefault",(e,t)=>{oR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>WP(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function UC(e,t){return new jC({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():V.shallowClone(t)}})}var zC=C("ZodPrefault",(e,t)=>{sR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>HP(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function GC(e,t){return new zC({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():V.shallowClone(t)}})}var Tk=C("ZodNonOptional",(e,t)=>{aR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VP(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function BC(e,t){return new Tk({type:"nonoptional",innerType:e,...V.normalizeParams(t)})}var VC=C("ZodSuccess",(e,t)=>{cR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CP(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Z4(e){return new VC({type:"success",innerType:e})}var qC=C("ZodCatch",(e,t)=>{lR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>KP(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function WC(e,t){return new qC({type:"catch",innerType:e,catchValue:typeof t=="function"?t:V.constantCatch(t)})}var HC=C("ZodNaN",(e,t)=>{uR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AP(e,n,r,i)});function Y4(e){return tP(HC,e)}var Ig=C("ZodPipe",(e,t)=>{lw.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JP(e,n,r,i),e.in=t.in,e.out=t.out});function rk(e,t){return new Ig({type:"pipe",in:e,out:t})}var Ag=C("ZodCodec",(e,t)=>{Ig.init(e,t),ag.init(e,t)});function Q4(e,t,n){return new Ag({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function X4(e){let t=e._zod.def;return new Ag({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var KC=C("ZodPreprocess",(e,t)=>{Ig.init(e,t),dR.init(e,t)}),JC=C("ZodReadonly",(e,t)=>{pR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZP(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function ZC(e){return new JC({type:"readonly",innerType:e})}var YC=C("ZodTemplateLiteral",(e,t)=>{fR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RP(e,n,r,i)});function e6(e,t){return new YC({type:"template_literal",parts:e,...V.normalizeParams(t)})}var QC=C("ZodLazy",(e,t)=>{cg.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QP(e,n,r,i),e.unwrap=()=>e._zod.def.getter()});function XC(e){return new QC({type:"lazy",getter:e})}var eN=C("ZodPromise",(e,t)=>{gR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>YP(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function t6(e){return new eN({type:"promise",innerType:e})}var tN=C("ZodFunction",(e,t)=>{mR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DP(e,n,r,i)});function n6(e){return new tN({type:"function",input:Array.isArray(e?.input)?RC(e?.input):e?.input??Sg(yc()),output:e?.output??yc()})}var Rg=C("ZodCustom",(e,t)=>{hR.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,i)=>NP(e,n,r,i)}),nN=C("ZodProperties",(e,t)=>{Bs(),yR.init(e,t),Le.init(e,t)});function rN(e,t){return nP(nN,e,t)}function r6(e){let t=new ht({check:"custom"});return t._zod.check=e,t}function i6(e,t){return oP(Rg,e??(()=>!0),t)}function iN(e,t={}){return sP(Rg,e,t)}function oN(e,t){return aP(e,t)}var o6=cP,s6=lP,sN=C("ZodInstanceOf",(e,t)=>{Rg.init(e,t)},{properties(e,t){return this.check(rN(e,t))}});function a6(e,t={}){let n=new sN({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...V.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var c6=(...e)=>uP({Codec:Ag,Boolean:qu,String:Gu},...e);function l6(e){let t=XC(()=>Hu([wg(e),mC(),gC(),vC(),Sg(t),PC(wg(),t)]));return t}function u6(e,t){return new KC({type:"pipe",in:xk(e),out:t})}var Gge={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"};function Bge(e){Gt({customError:e})}function Vge(){return Gt().customError}var aN;aN||(aN={});var Pg={};kr(Pg,{ZodISODate:()=>qs,ZodISODateTime:()=>Vs,ZodISODuration:()=>Hs,ZodISOTime:()=>Ws,date:()=>Wge,datetime:()=>qge,duration:()=>Kge,time:()=>Hge});function qge(e){return gg(Vs,e)}function Wge(e){return hg(qs,e)}function Hge(e){return yg(Ws,e)}function Kge(e){return bg(Hs,e)}var ce={...Ku,...ek,iso:Pg},Jge=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"]);function Zge(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function d6(e,t){return e.map((n,r)=>rr).check(r=>{let i=r.value;if(typeof i!="object"||i===null||Array.isArray(i))return;let o=Object.getOwnPropertyNames(i);if(t.minProperties!==void 0&&o.length=${t.minProperties} properties`,input:i,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&r.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:i,inst:e,continue:!0}),t.keySchema)for(let s of o){let a=t.keySchema.safeParse(s);a.success||r.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function cN(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let r=String(e);return`${n[0]}${r.length}:${r}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let s of e){let a=cN(s,t);if(a===null)return null;o.push(a)}return`a${o.length}:[${o.join(",")}]`}let r=Object.keys(e).sort(),i=[];for(let o of r){let s=cN(e[o],t);if(s===null)return null;i.push(`${o.length}:${o}=${s}`)}return`o${i.length}:{${i.join(",")}}`}finally{t.delete(e)}}var ehe=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),the=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Cg(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Cg):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>ehe.has(t)?Cg(n):!the.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(Cg))}function p6(e){return e===1?"element":"elements"}function nhe(e,t){return ce.transform(r=>r).check(r=>{let i=r.value;if(Array.isArray(i)){if(t.uniqueItems===!0){let o=new Map;for(let s=0;s=s)break;at.maxContains&&r.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${p6(t.maxContains)}`,input:i,continue:!0})}}}).pipe(e)}function f6(e,t){if(e!==!1)return e===void 0||e===!0?ce.any():cr(e,t)}var rhe=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function m6(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return ce.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let i=e.$ref;if(t.refs.has(i))return t.refs.get(i);if(t.processing.has(i))return ce.lazy(()=>{if(!t.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return t.refs.get(i)});t.processing.add(i);let o=Qge(i,t),s=cr(o,t);return t.refs.set(i,s),t.processing.delete(i),s}if(e.enum!==void 0){let i=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&i.length===1&&i[0]===null)return ce.null();if(i.length===0)return ce.never();if(i.length===1)return ce.literal(i[0]);if(i.every(s=>typeof s=="string"))return ce.enum(i);let o=i.map(s=>ce.literal(s));return o.length<2?o[0]:ce.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return ce.literal(e.const);let n=e.type;if(Array.isArray(n)){let i=n.map(o=>{let s={...e,type:o};return m6(s,t)});return i.length===0?ce.never():i.length===1?i[0]:ce.union(i)}if(!n)return ce.any();let r;switch(n){case"string":{let i=ce.string();if(e.format){let o=e.format;o==="email"?i=i.check(ce.email()):o==="uri"||o==="uri-reference"?i=i.check(ce.url()):o==="uuid"||o==="guid"?i=i.check(ce.uuid()):o==="date-time"?i=i.check(ce.iso.datetime({offset:!0})):o==="date"?i=i.check(ce.iso.date()):o==="time"?i=i.check(ce.regex(rhe)):o==="duration"?i=i.check(ce.iso.duration()):o==="hostname"?i=i.check(ce.hostname()):o==="ipv4"?i=i.check(ce.ipv4()):o==="ipv6"?i=i.check(ce.ipv6()):o==="mac"?i=i.check(ce.mac()):o==="cidr"?i=i.check(ce.cidrv4()):o==="cidr-v6"?i=i.check(ce.cidrv6()):o==="base64"?i=i.check(ce.base64()):o==="base64url"?i=i.check(ce.base64url()):o==="e164"?i=i.check(ce.e164()):o==="credit_card"?i=i.check(ce.creditCard()):o==="iban"?i=i.check(ce.iban()):o==="jwt"?i=i.check(ce.jwt()):o==="emoji"?i=i.check(ce.emoji()):o==="nanoid"?i=i.check(ce.nanoid()):o==="cuid"?i=i.check(ce.cuid()):o==="cuid2"?i=i.check(ce.cuid2()):o==="ulid"?i=i.check(ce.ulid()):o==="xid"?i=i.check(ce.xid()):o==="ksuid"&&(i=i.check(ce.ksuid()))}typeof e.minLength=="number"&&(i=i.min(e.minLength)),typeof e.maxLength=="number"&&(i=i.max(e.maxLength)),e.pattern&&(i=i.regex(new RegExp(e.pattern))),r=i;break}case"number":case"integer":{let i=n==="integer"?ce.number().int():ce.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(i=i.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(i=i.max(e.maximum)),typeof e.exclusiveMinimum=="number"?i=i.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(i=i.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?i=i.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(i=i.lt(e.maximum)),typeof e.multipleOf=="number"&&(i=i.multipleOf(e.multipleOf)),r=i;break}case"boolean":{r=ce.boolean();break}case"null":{r=ce.null();break}case"object":{let i={},o=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?cr(e.additionalProperties,t):void 0;for(let[d,p]of Object.entries(o)){let f=cr(p,t);$n(i,d,s.has(d)?f:f.optional())}if(e.patternProperties){let d=e.patternProperties,p=Object.keys(d),f=[];for(let g of p){let h=cr(d[g],t),v=ce.string().regex(new RegExp(g));f.push(ce.looseRecord(v,h))}let m=[];if(Object.keys(i).length>0&&m.push(ce.object(i).passthrough()),m.push(...f),m.length===0)r=ce.object({}).passthrough();else if(m.length===1)r=m[0];else{let g=ce.intersection(m[0],m[1]);for(let h=2;hnew RegExp(b)),v=r;r=r.check(b=>{if(!ai(b.value))return;let w=[];for(let k of Object.keys(b.value))g.includes(k)||h.some($=>$.test(k))||w.push(k);w.length&&b.issues.push({code:"unrecognized_keys",keys:w,input:b.value,inst:v})})}}else{let d=ce.object(i);e.additionalProperties===!1?r=d.strict():a?r=d.catchall(a):r=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,u=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||l!==void 0||u!==void 0){let d;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=cr(p,t)}r=Xge(r,{keySchema:d,minProperties:l,maxProperties:u})}break}case"array":{let i=e.prefixItems,o=e.items;if(i&&Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(d=>cr(d,t)),c=d6(a,s),l=Array.isArray(o)?void 0:f6(o,t),u=ce.tuple(c);r=l?u.rest(l):u,typeof e.minItems=="number"&&(r=r.check(ce.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(ce.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(d=>cr(d,t)),c=d6(a,s),l=f6(e.additionalItems,t),u=ce.tuple(c);r=l?u.rest(l):u,typeof e.minItems=="number"&&(r=r.check(ce.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(ce.maxLength(e.maxItems)))}else if(o!==void 0){let s=cr(o,t),a=ce.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),r=a}else r=ce.array(ce.any());(e.uniqueItems===!0||e.contains!==void 0)&&(r=nhe(r,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?cr(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return r}function cr(e,t){if(typeof e=="boolean")return e?ce.any():ce.never();let n=m6(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(l=>cr(l,t)),c=ce.union(a);n=r?ce.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(l=>cr(l,t)),c=ce.xor(a);n=r?ce.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:ce.any();else{let a=r?n:cr(e.allOf[0],t),c=r?0:1;for(let l=c;l0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function g6(e,t){if(typeof e=="boolean")return e?ce.any():ce.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=Zge(n,t?.defaultTarget),i=n.$defs||n.definitions||{},o={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Nn};return cr(n,o)}var h6=Symbol("z.visit/resolving");function Ng(e,t){let n=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},r=new Map;function i(s){let a=r.get(s);if(a===h6)return new cg({type:"lazy",getter:()=>r.get(s)});if(a!==void 0)return a;r.set(s,h6);let c=o(s),l=n(c,c!==s);return r.set(s,l),l}function o(s){let a=s._zod.def,c=a.type;switch(c){case"object":{let l=a.shape,u=Object.keys(l),d=!1,p={};for(let m of u){let g=i(l[m]);g!==l[m]&&(d=!0),p[m]=g}let f=a.catchall;return a.catchall&&(f=i(a.catchall),f!==a.catchall&&(d=!0)),d?it(s,{...a,shape:p,catchall:f}):s}case"array":{let l=i(a.element);return l===a.element?s:it(s,{...a,element:l})}case"tuple":{let l=a.items,u=!1,d=[];for(let f of l){let m=i(f);m!==f&&(u=!0),d.push(m)}let p=a.rest;return a.rest&&(p=i(a.rest),p!==a.rest&&(u=!0)),u?it(s,{...a,items:d,rest:p}):s}case"record":case"map":{let l=i(a.keyType),u=i(a.valueType);return l===a.keyType&&u===a.valueType?s:it(s,{...a,keyType:l,valueType:u})}case"set":{let l=i(a.valueType);return l===a.valueType?s:it(s,{...a,valueType:l})}case"union":{let l=a.options,u=!1,d=[];for(let p of l){let f=i(p);f!==p&&(u=!0),d.push(f)}return u?it(s,{...a,options:d}):s}case"intersection":{let l=i(a.left),u=i(a.right);return l===a.left&&u===a.right?s:it(s,{...a,left:l,right:u})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=i(a.innerType);return l===a.innerType?s:it(s,{...a,innerType:l})}case"pipe":{let l=i(a.in),u=i(a.out);return l===a.in&&u===a.out?s:it(s,{...a,in:l,out:u})}case"function":{let l=i(a.input),u=i(a.output);return l===a.input&&u===a.output?s:it(s,{...a,input:l,output:u})}case"lazy":{let l=a.getter,{_cachedInner:u,...d}=a;return it(s,{...d,getter:()=>i(l())})}case"properties":{let l=a.shape,u=!1,d={};for(let p of Reflect.ownKeys(l)){let f=i(l[p]);f!==l[p]&&(u=!0),d[p]=f}return u?it(s,{...a,shape:d}):s}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return i(e)}function y6(e){return Ng(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:Hu(n.options)}})}function ihe(e,t){if(!t?.length)return e;let n=e._zod.def;return it(e,Ui(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function b6(e){return ihe(e.out,e.checks)}function ohe(e){return e.in._zod.traits.has("$ZodTransform")?b6(e):e.in}function v6(e){return Ng(e,{pipe:t=>ohe(t._zod.def),default:(t,n)=>n?bc(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function w6(e){return Ng(e,{pipe:t=>b6(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var lN={};kr(lN,{bigint:()=>lhe,boolean:()=>che,date:()=>uhe,number:()=>ahe,string:()=>she});function she(e){return IR(Gu,e)}function ahe(e){return DR(Vu,e)}function che(e){return zR(qu,e)}function lhe(e){return BR(Wu,e)}function uhe(e){return eP($g,e)}var k6=z.enum(["npm","pypi","go","cargo","maven","rubygems","nuget","packagist","hex","pub","swift","cocoapods","opam","conan","vcpkg","arduino"]),dhe=z.string().trim().min(1),phe=z.enum(["low","medium","high","xhigh"]);var uN=z.object({mode:z.enum(["auto","approve"]).default("approve"),maxAutoRisk:z.enum(["none","low","medium","high"]).default("medium"),watchBranches:z.array(z.string()).default(["main","master","develop"]),ecosystems:z.array(k6).default([...k6.options]),ignore:z.array(z.string()).default([]),alwaysApprove:z.array(z.string()).default([]),triggerOn:z.object({major:z.boolean().default(!0),minor:z.boolean().default(!0),patch:z.boolean().default(!1),transitive:z.boolean().default(!1),dev:z.boolean().default(!0)}).prefault({}),evidence:z.object({githubReleases:z.boolean().default(!0),changelog:z.boolean().default(!0),typeSurface:z.boolean().default(!0),openapi:z.boolean().default(!0),openapiSpecs:z.array(z.string()).default([]),protobuf:z.boolean().default(!0),protobufSpecs:z.array(z.string()).default([]),graphql:z.boolean().default(!0),graphqlSchemas:z.array(z.string()).default([]),maxReleases:z.number().int().min(1).max(100).default(25)}).prefault({}),rationale:z.object({security:z.boolean().default(!0),maintenance:z.boolean().default(!0),summary:z.boolean().default(!0)}).prefault({}),licenses:z.object({enabled:z.boolean().default(!1),allow:z.array(z.string()).default([]),deny:z.array(z.string()).default([]),requireDeclared:z.boolean().default(!1)}).prefault({}),guardrails:z.object({protectedPaths:z.array(z.string()).default([".github/workflows/**","**/*.lock","infra/**","terraform/**","**/secrets/**"]),maxFilesChanged:z.number().int().min(1).default(50),maxDependenciesPerRun:z.number().int().min(1).default(10),requireEvidence:z.boolean().default(!0),minConfidence:z.enum(["low","medium","high"]).default("medium"),experimentalDispatchBelowMinConfidence:z.boolean().default(!1),forbidTestWeakening:z.boolean().default(!0)}).prefault({}),remediation:z.object({commitGranularity:z.enum(["per-breaking-change","per-dependency","single"]).default("per-breaking-change"),branchPrefix:z.string().default("drift/"),draftPr:z.boolean().optional(),model:z.string().optional(),agent:z.object({provider:dhe.default("auto"),model:z.string().optional(),effort:phe.optional(),fast:z.boolean().default(!1),timeoutSeconds:z.number().int().min(30).max(1440*60).default(1800)}).prefault({}),customInstructions:z.string().default(""),awaitCompletion:z.object({enabled:z.boolean().default(!1),timeoutMinutes:z.number().int().min(1).max(360).default(20),pollIntervalSeconds:z.number().int().min(5).max(300).default(30)}).prefault({}),communityRecipes:z.boolean().default(!1),fixPlans:z.object({enabled:z.boolean().default(!1),minCoverage:z.number().min(0).max(1).default(.5),autoApply:z.enum(["review","proven","verified"]).default("review"),cache:z.boolean().default(!0)}).prefault({})}).prefault({}),verification:z.object({behavioural:z.object({enabled:z.boolean().default(!1),sandbox:z.literal("required").default("required"),maxSymbols:z.number().int().min(1).max(100).default(10),maxCasesPerSymbol:z.number().int().min(1).max(100).default(20),timeoutSeconds:z.number().int().min(1).max(1800).default(120),network:z.boolean().default(!1),memoryMb:z.number().int().min(128).max(16384).default(1024),cpuLimit:z.number().min(.1).max(32).default(1),retainArtifacts:z.boolean().default(!1)}).prefault({})}).prefault({}),telemetry:z.object({enabled:z.boolean().default(!1),endpoint:z.string().url().optional(),installationId:z.string().optional(),rotationSalt:z.string().optional(),retentionDays:z.number().int().min(1).max(730).default(180)}).prefault({}),pullRequest:z.object({enabled:z.boolean().default(!0),confirm:z.enum(["ask","never"]).default("ask"),base:z.enum(["branched-from","default-branch"]).default("branched-from"),draft:z.boolean().optional(),labels:z.array(z.string()).default([]),reviewers:z.array(z.string()).default([]),branchTemplate:z.string().default("{prefix}upgrade-{summary}-{date}"),titleTemplate:z.string().default("chore(deps): upgrade {summary}"),coAuthor:z.boolean().default(!0)}).prefault({}),llm:z.object({enabled:z.boolean().default(!1),provider:z.enum(["anthropic"]).default("anthropic"),model:z.string().default("claude-opus-5"),effort:z.enum(["low","medium","high","xhigh","max"]).default("medium"),apiKeyEnv:z.string().default("ANTHROPIC_API_KEY")}).prefault({}),codeScanning:z.object({enabled:z.boolean().default(!0),includeInformational:z.boolean().default(!1),granularity:z.enum(["package","breakingChange","affectedSite"]).default("package"),createIssuesPerAlert:z.boolean().default(!1)}).prefault({}),issueCreation:z.object({default:z.enum(["issue","branch","both"]).default("issue"),granularity:z.enum(["package","change"]).default("package"),assignees:z.array(z.string()).default([])}).prefault({}),outdated:z.object({enabled:z.boolean().default(!1)}).prefault({}),check:z.object({enabled:z.boolean().default(!1)}).prefault({}),tools:z.object({autoInstall:z.boolean().default(!0)}).prefault({}),verify:z.object({enabled:z.boolean().default(!0),checks:z.array(z.enum(["typecheck","build","test"])).default(["typecheck","build","test"]),timeoutMs:z.number().int().positive().default(15*6e4),generatedSourceGlobs:z.array(z.string()).default([])}).prefault({})}),Ju=uN.parse({});function _6(e){return e.pullRequest.draft??e.remediation.draftPr??!0}var Ik={none:0,low:1,medium:2,high:3};function dN(e,t){return Ik[e]<=Ik[t]}function $6(e,t){return Ik[e]-Ik[t]}var fhe=[".github/drift.yml",".github/drift.yaml","drift.yml","drift.yaml"];function mhe(e,t=null){let n=[];if(!e.trim())return{config:Ju,path:t,problems:n};let r;try{r=(0,S6.parse)(e)}catch(c){return n.push(`Could not parse ${t??"config"} as YAML: ${c.message}`),{config:Ju,path:t,problems:n}}if(r==null)return{config:Ju,path:t,problems:n};let i=hhe(r),o=ghe(r),s=uN.safeParse(r);if(!s.success){for(let c of s.error.issues){let l=c.path.length?c.path.join("."):"(root)";n.push(`${l}: ${c.message}`)}return n.push("Falling back to Drift defaults (mode: approve)."),{config:Ju,path:t,problems:n}}let a=s.data;return i&&!o&&(a.remediation.agent={...a.remediation.agent,provider:"copilot-cloud",model:i},n.push("`remediation.model` is deprecated and now treated as `remediation.agent.model` for `copilot-cloud`. Use `remediation.agent` for new configuration.")),{config:a,path:t,problems:n}}function ghe(e){if(!Ak(e))return!1;let t=e.remediation;return Ak(t)&&t.agent!==void 0}function hhe(e){if(!Ak(e))return null;let t=e.remediation;return Ak(t)&&typeof t.model=="string"&&t.model.trim()?t.model:null}function Ak(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}async function Rk(e){for(let t of fhe){let n;try{n=await e(t)}catch{continue}if(n!==null)return mhe(n,t)}return{config:Ju,path:null,problems:[]}}var mW=require("node:zlib");function Ks(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}function Pk(e,t,n,r){if(typeof n!="function")throw new Error("method for before hook must be a function");return r||(r={}),Array.isArray(t)?t.reverse().reduce((i,o)=>Pk.bind(null,e,o,i,r),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((i,o)=>o.hook.bind(null,i,r),n)():n(r))}function x6(e,t,n,r){let i=r;e.registry[n]||(e.registry[n]=[]),t==="before"&&(r=(o,s)=>Promise.resolve().then(i.bind(null,s)).then(o.bind(null,s))),t==="after"&&(r=(o,s)=>{let a;return Promise.resolve().then(o.bind(null,s)).then(c=>(a=c,i(a,s))).then(()=>a)}),t==="error"&&(r=(o,s)=>Promise.resolve().then(o.bind(null,s)).catch(a=>i(a,s))),e.registry[n].push({hook:r,orig:i})}function E6(e,t,n){if(!e.registry[t])return;let r=e.registry[t].map(i=>i.orig).indexOf(n);r!==-1&&e.registry[t].splice(r,1)}var T6=Function.bind,I6=T6.bind(T6);function A6(e,t,n){let r=I6(E6,null).apply(null,n?[t,n]:[t]);e.api={remove:r},e.remove=r,["before","error","after","wrap"].forEach(i=>{let o=n?[t,i,n]:[t,i];e[i]=e.api[i]=I6(x6,null).apply(null,o)})}function yhe(){let e=Symbol("Singular"),t={registry:{}},n=Pk.bind(null,t,e);return A6(n,t,e),n}function bhe(){let e={registry:{}},t=Pk.bind(null,e);return A6(t,e),t}var R6={Singular:yhe,Collection:bhe};var vhe="0.0.0-development",whe=`octokit-endpoint.js/${vhe} ${Ks()}`,khe={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":whe},mediaType:{format:""}};function _he(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function $he(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function N6(e,t){let n=Object.assign({},e);return Object.keys(t).forEach(r=>{$he(t[r])?r in e?n[r]=N6(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}function P6(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function fN(e,t,n){if(typeof t=="string"){let[i,o]=t.split(" ");n=Object.assign(o?{method:i,url:o}:{url:i},n)}else n=Object.assign({},t);n.headers=_he(n.headers),P6(n),P6(n.headers);let r=N6(e||{},n);return n.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(r.mediaType.previews=e.mediaType.previews.filter(i=>!r.mediaType.previews.includes(i)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(i=>i.replace(/-preview/,""))),r}function She(e,t){let n=/\?/.test(e)?"&":"?",r=Object.keys(t);return r.length===0?e:e+n+r.map(i=>i==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${i}=${encodeURIComponent(t[i])}`).join("&")}var xhe=/\{[^{}}]+\}/g;function Ehe(e){return e.replace(/(?:^\W+)|(?:(?n.concat(r),[]):[]}function C6(e,t){let n={__proto__:null};for(let r of Object.keys(e))t.indexOf(r)===-1&&(n[r]=e[r]);return n}function D6(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function Yu(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function Dg(e,t,n){return t=e==="+"||e==="#"?D6(t):Yu(t),n?Yu(n)+"="+t:t}function Zu(e){return e!=null}function pN(e){return e===";"||e==="&"||e==="?"}function Ihe(e,t,n,r){var i=e[n],o=[];if(Zu(i)&&i!=="")if(typeof i=="string"||typeof i=="number"||typeof i=="bigint"||typeof i=="boolean")i=i.toString(),r&&r!=="*"&&(i=i.substring(0,parseInt(r,10))),o.push(Dg(t,i,pN(t)?n:""));else if(r==="*")Array.isArray(i)?i.filter(Zu).forEach(function(s){o.push(Dg(t,s,pN(t)?n:""))}):Object.keys(i).forEach(function(s){Zu(i[s])&&o.push(Dg(t,i[s],s))});else{let s=[];Array.isArray(i)?i.filter(Zu).forEach(function(a){s.push(Dg(t,a))}):Object.keys(i).forEach(function(a){Zu(i[a])&&(s.push(Yu(a)),s.push(Dg(t,i[a].toString())))}),pN(t)?o.push(Yu(n)+"="+s.join(",")):s.length!==0&&o.push(s.join(","))}else t===";"?Zu(i)&&o.push(Yu(n)):i===""&&(t==="&"||t==="?")?o.push(Yu(n)+"="):i===""&&o.push("");return o}function Ahe(e){return{expand:Rhe.bind(null,e)}}function Rhe(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(r,i,o){if(i){let a="",c=[];if(n.indexOf(i.charAt(0))!==-1&&(a=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(l){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(l);c.push(Ihe(t,a,u[1],u[2]||u[3]))}),a&&a!=="+"){var s=",";return a==="?"?s="&":a!=="#"&&(s=a),(c.length!==0?a:"")+c.join(s)}else return c.join(",")}else return D6(o)}),e==="/"?e:e.replace(/\/$/,"")}function O6(e){let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),r=Object.assign({},e.headers),i,o=C6(e,["method","baseUrl","url","headers","request","mediaType"]),s=The(n);n=Ahe(n).expand(o),/^http/.test(n)||(n=e.baseUrl+n);let a=Object.keys(e).filter(u=>s.includes(u)).concat("baseUrl"),c=C6(o,a);if(!/application\/octet-stream/i.test(r.accept)&&(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&e.mediaType.previews?.length)){let u=r.accept.match(/(?{let p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=She(n,c):"data"in c?i=c.data:Object.keys(c).length&&(i=c),!r["content-type"]&&typeof i<"u"&&(r["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof i>"u"&&(i=""),Object.assign({method:t,url:n,headers:r},typeof i<"u"?{body:i}:null,e.request?{request:e.request}:null)}function Phe(e,t,n){return O6(fN(e,t,n))}function M6(e,t){let n=fN(e,t),r=Phe.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:M6.bind(null,n),merge:fN.bind(null,n),parse:O6})}var L6=M6(null,khe);var j6=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function U6(e,t){let n=t?.comma===!0?Dhe:65536,r=e.length,i=gN(e,t?.start??0,r),o=i;i=mN(e,i,r,n);let s=hN(e,o,i),a=e.slice(o,s).toLowerCase();return t?.parameters===!1?{type:a,index:i,parameters:new j6}:Ohe(e,a,i,r,n)}var z6=32,G6=9,B6=59,Che=61,F6=34,Nhe=92,Dhe=44;function Ohe(e,t,n,r,i){let o=new j6;e:for(;nt;){let r=e.charCodeAt(n-1);if(r!==z6&&r!==G6)break;n--}return n}var Mhe=/^-?\d+$/,Nk=/^-?\d+n+$/,Js=JSON.stringify,yN=JSON.parse,K6=/^-?\d+n$/,V6=/([\[:])?"(-?\d+)n"($|\s*[,\}\]])/g,q6=/([\[:])?("-?\d+n+)n("$|"\s*[,\}\]])/g,bN=e=>e===void 0||typeof e=="function"||typeof e=="symbol",vN=e=>e!==null&&typeof e=="object"&&e.constructor&&e.constructor.name==="RawJSON",Lhe=(e,t,n)=>{let r="";typeof n=="number"?r=" ".repeat(Math.min(10,Math.max(0,Math.floor(n)))):typeof n=="string"&&(r=n.slice(0,10));let i=typeof t=="function",o=Array.isArray(t)?new Set(t.map(String)):null,s=(m,g,h)=>(h!==null&&typeof h=="object"&&typeof h.toJSON=="function"&&(h=h.toJSON(g)),typeof h=="string"&&Nk.test(h)?h+"n":typeof h=="bigint"?"rawJSON"in JSON?JSON.rawJSON(h.toString()):h.toString()+"n":(i&&(h=t.call(m,g,h)),h!==null&&typeof h=="object"&&(h instanceof Number||h instanceof String||h instanceof Boolean)&&(h=h.valueOf()),h)),a=s({"":e},"",e);if(bN(a))return;let c=a===null||typeof a!="object",l=vN(a);if(c||l)return Js(a);let u=[],d=0,p=[{parent:{"":a},key:"",val:a,isArray:Array.isArray(a),keys:Array.isArray(a)?null:Object.keys(a),index:0,first:!0}],f=new WeakSet([a]);for(;p.length>0;){let m=p[p.length-1];m.index===0&&(u.push(m.isArray?"[":"{"),d++);let g=!1;if(m.isArray)if(m.index=m.keys.length&&p[p.length-1]===m&&(g=!0)}g&&(d--,!m.first&&r&&u.push(` +`+r.repeat(d)),u.push(m.isArray?"]":"}"),f.delete(m.val),p.pop())}return u.join("")},J6=(e,t,n)=>{try{return"rawJSON"in JSON?Js(e,(a,c)=>typeof c=="bigint"?JSON.rawJSON(c.toString()):typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n):e?Js(e,(a,c)=>typeof c=="string"&&Nk.test(c)||typeof c=="bigint"?c.toString()+"n":typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n).replace(V6,"$1$2$3").replace(q6,"$1$2$3"):Js(e,t,n)}catch(r){if(r instanceof RangeError){let i=Lhe(e,t,n);return i===void 0?void 0:"rawJSON"in JSON?i:i.replace(V6,"$1$2$3").replace(q6,"$1$2$3")}throw r}},Ck=new Map,Fhe=()=>{let e=JSON.parse.toString();if(Ck.has(e))return Ck.get(e);try{let t=JSON.parse("1",(n,r,i)=>!!i?.source&&i.source==="1");return Ck.set(e,t),t}catch{return Ck.set(e,!1),!1}},jhe=(e,t,n,r)=>typeof t=="string"&&K6.test(t)?BigInt(t.slice(0,-1)):typeof t=="string"&&Nk.test(t)?t.slice(0,-1):typeof r=="function"?r(e,t,n):t,Uhe=(e,t)=>JSON.parse(e,(n,r,i)=>{let o=typeof r=="number",s=r>Number.MAX_SAFE_INTEGER||r{let n={"":e},r=[{parent:n,key:"",visited:!1}];for(;r.length>0;){let i=r[r.length-1];if(i.visited){let{parent:o,key:s}=i,a=o[s];typeof a=="string"&&(K6.test(a)?a=BigInt(a.slice(0,-1)):Nk.test(a)&&(a=a.slice(0,-1))),typeof t=="function"&&(a=t.call(o,s,a)),a===void 0?delete o[s]:o[s]=a,r.pop()}else{i.visited=!0;let o=i.parent[i.key];if(o!==null&&typeof o=="object"){let a=Object.keys(o);for(let c=a.length-1;c>=0;c--)r.push({parent:o,key:a[c],visited:!1})}}}return n[""]},H6=e=>e.replace(zhe,(t,n,r,i)=>{let o=t[0]==='"';if(o&&Ghe.test(t))return t.substring(0,t.length-1)+'n"';let a=r||i,c=n&&(n.length{if(!e)return yN(e,t);try{if(Fhe())return Uhe(e,t);let n=H6(e);return yN(n,(r,i,o)=>jhe(r,i,o,t))}catch(n){if(n instanceof RangeError){let r=H6(e),i=yN(r);return Bhe(i,t)}throw n}};var wc=class extends Error{name;status;request;response;constructor(t,n,r){super(t,{cause:r.cause}),this.name="HttpError",this.status=Number.parseInt(n),Number.isNaN(this.status)&&(this.status=0);"response"in r&&(this.response=r.response);let i=Object.assign({},r.request);r.request.headers.authorization&&(i.headers=Object.assign({},r.request.headers,{authorization:r.request.headers.authorization.replace(/(?"";async function X6(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let n=e.request?.log||console,r=e.request?.parseSuccessResponseBody!==!1,i=Whe(e.body)||Array.isArray(e.body)?J6(e.body):e.body,o=Object.fromEntries(Object.entries(e.headers).map(([d,p])=>[d,String(p)])),s;try{s=await t(e.url,{method:e.method,body:i,redirect:e.request?.redirect,headers:o,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(d){let p="Unknown Error";if(d instanceof Error){if(d.name==="AbortError")throw d.status=500,d;p=d.message,d.name==="TypeError"&&"cause"in d&&(d.cause instanceof Error?p=d.cause.message:typeof d.cause=="string"&&(p=d.cause))}let f=new wc(p,500,{request:e});throw f.cause=d,f}let a=s.status,c=s.url,l={};for(let[d,p]of s.headers)l[d]=p;let u={url:c,status:a,headers:l,data:""};if("deprecation"in l){let d=l.link&&l.link.match(/<([^<>]+)>; rel="deprecation"/),p=d&&d.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${l.sunset}${p?`. See ${p}`:""}`)}if(a===204||a===205)return u;if(e.method==="HEAD"){if(a<400)return u;throw new wc(s.statusText,a,{response:u,request:e})}if(a===304)throw u.data=await wN(s),new wc("Not modified",a,{response:u,request:e});if(a>=400)throw u.data=await wN(s),new wc(Khe(u.data),a,{response:u,request:e});return u.data=r?await wN(s):s.body,u}async function wN(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(Q6);let n=U6(t);if(Hhe(n)){let r="";try{return r=await e.text(),Y6(r)}catch{return r}}else return n.type.startsWith("text/")||n.parameters.charset?.toLowerCase()==="utf-8"&&n.type!=="application/octet-stream"?e.text().catch(Q6):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function Hhe(e){return e.type==="application/json"||e.type==="application/scim+json"}function Khe(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if(typeof e=="object"&&e!==null&&"message"in e){let t=e,n="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(r=>JSON.stringify(r)).join(", ")}${n}`:`${t.message}${n}`}return`Unknown error: ${JSON.stringify(e)}`}function kN(e,t){let n=e.defaults(t);return Object.assign(function(i,o){let s=n.merge(i,o);if(!s.request||!s.request.hook)return X6(n.parse(s));let a=(c,l)=>X6(n.parse(n.merge(c,l)));return Object.assign(a,{endpoint:n,defaults:kN.bind(null,n)}),s.request.hook(a,s)},{endpoint:n,defaults:kN.bind(null,n)})}var Og=kN(L6,qhe);var Jhe="0.0.0-development";function Zhe(e){return`Request failed due to following response errors: `+e.errors.map(t=>` - ${t.message}`).join(` -`)}var Bme=class extends Error{constructor(e,t,n){super(Vme(n)),this.request=e,this.headers=t,this.response=n,this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}request;headers;response;name="GraphqlResponseError";errors;data},qme=["method","baseUrl","url","headers","request","query","mediaType","operationName"],Wme=["query","method","url"],c4=/\/api\/v3\/?$/;function Hme(e,t,n){if(n){if(typeof t=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let s in n)if(Wme.includes(s))return Promise.reject(new Error(`[@octokit/graphql] "${s}" cannot be used as variable name`))}let i=typeof t=="string"?Object.assign({query:t},n):t,r=Object.keys(i).reduce((s,a)=>qme.includes(a)?(s[a]=i[a],s):(s.variables||(s.variables={}),s.variables[a]=i[a],s),{}),o=i.baseUrl||e.endpoint.DEFAULTS.baseUrl;return c4.test(o)&&(r.url=o.replace(c4,"/api/graphql")),e(r).then(s=>{if(s.data.errors){let a={};for(let c of Object.keys(s.headers))a[c]=s.headers[c];throw new Bme(r,a,s.data)}return s.data.data})}function xC(e,t){let n=e.defaults(t);return Object.assign((r,o)=>Hme(n,r,o),{defaults:xC.bind(null,n),endpoint:n.endpoint})}var UHe=xC(bg,{headers:{"user-agent":`octokit-graphql.js/${Gme} ${Ys()}`},method:"POST",url:"/graphql"});function l4(e){return xC(e,{method:"POST",url:"/graphql"})}var EC="(?:[a-zA-Z0-9_-]+)",u4="\\.",d4=new RegExp(`^${EC}${u4}${EC}${u4}${EC}$`),Kme=d4.test.bind(d4);async function Jme(e){let t=Kme(e),n=e.startsWith("v1.")||e.startsWith("ghs_"),i=e.startsWith("ghu_");return{type:"token",token:e,tokenType:t?"app":n?"installation":i?"user-to-server":"oauth"}}function Zme(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Yme(e,t,n,i){let r=t.endpoint.merge(n,i);return r.headers.authorization=Zme(e),t(r)}var p4=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(Jme.bind(null,t),{hook:Yme.bind(null,t)})};var TC="7.0.8";var f4=()=>{},Qme=console.warn.bind(console),Xme=console.error.bind(console);function ege(e={}){return typeof e.debug!="function"&&(e.debug=f4),typeof e.info!="function"&&(e.info=f4),typeof e.warn!="function"&&(e.warn=Qme),typeof e.error!="function"&&(e.error=Xme),e}var m4=`octokit-core.js/${TC} ${Ys()}`,fk=class{static VERSION=TC;static defaults(t){return class extends this{constructor(...i){let r=i[0]||{};if(typeof t=="function"){super(t(r));return}super(Object.assign({},t,r,r.userAgent&&t.userAgent?{userAgent:`${r.userAgent} ${t.userAgent}`}:null))}}}static plugins=[];static plugin(...t){let n=this.plugins;return class extends this{static plugins=n.concat(t.filter(r=>!n.includes(r)))}}constructor(t={}){let n=new F2.Collection,i={baseUrl:bg.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(i.headers["user-agent"]=t.userAgent?`${t.userAgent} ${m4}`:m4,t.baseUrl&&(i.baseUrl=t.baseUrl),t.previews&&(i.mediaType.previews=t.previews),t.timeZone&&(i.headers["time-zone"]=t.timeZone),this.request=bg.defaults(i),this.graphql=l4(this.request).defaults(i),this.log=ege(t.log),this.hook=n,t.authStrategy){let{authStrategy:o,...s}=t,a=o(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:s},t.auth));n.wrap("request",a.hook),this.auth=a}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{let o=p4(t.auth);n.wrap("request",o.hook),this.auth=o}let r=this.constructor;for(let o=0;o{e.log.debug("request",n);let i=Date.now(),r=e.request.endpoint.parse(n),o=r.url.replace(n.baseUrl,"");return t(n).then(s=>{let a=s.headers["x-github-request-id"];return e.log.info(`${r.method} ${o} - ${s.status} with id ${a} in ${Date.now()-i}ms`),s}).catch(s=>{let a=s.response?.headers["x-github-request-id"]||"UNKNOWN";throw e.log.error(`${r.method} ${o} - ${s.status} with id ${a} in ${Date.now()-i}ms`),s})})}IC.VERSION=g4;var tge="0.0.0-development";function nge(e){if(!e.data)return{...e,data:[]};if(!(("total_count"in e.data||"total_commits"in e.data)&&!("url"in e.data)))return e;let n=e.data.incomplete_results,i=e.data.repository_selection,r=e.data.total_count,o=e.data.total_commits;delete e.data.incomplete_results,delete e.data.repository_selection,delete e.data.total_count,delete e.data.total_commits;let s=Object.keys(e.data)[0],a=e.data[s];return e.data=a,typeof n<"u"&&(e.data.incomplete_results=n),typeof i<"u"&&(e.data.repository_selection=i),e.data.total_count=r,e.data.total_commits=o,e}function AC(e,t,n){let i=typeof t=="function"?t.endpoint(n):e.request.endpoint(t,n),r=typeof t=="function"?t:e.request,o=i.method,s=i.headers,a=i.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!a)return{done:!0};try{let c=await r({method:o,url:a,headers:s}),l=nge(c);if(a=((l.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!a&&"total_commits"in l.data){let u=new URL(l.url),d=u.searchParams,p=parseInt(d.get("page")||"1",10),f=parseInt(d.get("per_page")||"250",10);p*f{if(r.done)return t;let o=!1;function s(){o=!0}return t=t.concat(i?i(r.value,s):r.value.data),o?t:y4(e,t,n,i)})}var nKe=Object.assign(h4,{iterator:AC});function RC(e){return{paginate:Object.assign(h4.bind(null,e),{iterator:AC.bind(null,e)})}}RC.VERSION=tge;var NC="17.0.0";var rge={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},b4=rge;var Pc=new Map;for(let[e,t]of Object.entries(b4))for(let[n,i]of Object.entries(t)){let[r,o,s]=i,[a,c]=r.split(/ /),l=Object.assign({method:a,url:c},o);Pc.has(e)||Pc.set(e,new Map),Pc.get(e).set(n,{scope:e,methodName:n,endpointDefaults:l,decorations:s})}var ige={has({scope:e},t){return Pc.get(e).has(t)},getOwnPropertyDescriptor(e,t){return{value:this.get(e,t),configurable:!0,writable:!0,enumerable:!0}},defineProperty(e,t,n){return Object.defineProperty(e.cache,t,n),!0},deleteProperty(e,t){return delete e.cache[t],!0},ownKeys({scope:e}){return[...Pc.get(e).keys()]},set(e,t,n){return e.cache[t]=n},get({octokit:e,scope:t,cache:n},i){if(n[i])return n[i];let r=Pc.get(t).get(i);if(!r)return;let{endpointDefaults:o,decorations:s}=r;return s?n[i]=oge(e,t,i,o,s):n[i]=e.request.defaults(o),n[i]}};function CC(e){let t={};for(let n of Pc.keys())t[n]=new Proxy({octokit:e,scope:n,cache:{}},ige);return t}function oge(e,t,n,i,r){let o=e.request.defaults(i);function s(...a){let c=o.endpoint.merge(...a);if(r.mapToData)return c=Object.assign({},c,{data:c[r.mapToData],[r.mapToData]:void 0}),o(c);if(r.renamed){let[l,u]=r.renamed;e.log.warn(`octokit.${t}.${n}() has been renamed to octokit.${l}.${u}()`)}if(r.deprecated&&e.log.warn(r.deprecated),r.renamedParameters){let l=o.endpoint.merge(...a);for(let[u,d]of Object.entries(r.renamedParameters))u in l&&(e.log.warn(`"${u}" parameter is deprecated for "octokit.${t}.${n}()". Use "${d}" instead`),d in l||(l[d]=l[u]),delete l[u]);return o(l)}return o(...a)}return Object.assign(s,o)}function sge(e){return{rest:CC(e)}}sge.VERSION=NC;function PC(e){let t=CC(e);return{...t,rest:t}}PC.VERSION=NC;var v4="22.0.1";var w4=fk.plugin(IC,PC,RC).defaults({userAgent:`octokit-rest.js/${v4}`});var age="drift",mk=class{octokit;logger;selfLogin;constructor(t){this.octokit=new w4({auth:t.repoToken,baseUrl:t.baseUrl??"https://api.github.com",userAgent:"drift-bot/0.1"}),this.logger=t.logger}async readFile(t,n,i){try{let o=(await this.octokit.repos.getContent({owner:t.owner,repo:t.repo,path:n,ref:i})).data;return Array.isArray(o)||o.type!=="file"||!("content"in o)?null:Buffer.from(o.content,"base64").toString("utf8")}catch(r){if(k4(r))return null;throw this.logger.debug(`Failed to read ${n}@${i}: ${r.message}`),r}}async listFiles(t,n){try{let i=await this.octokit.git.getTree({owner:t.owner,repo:t.repo,tree_sha:n,recursive:"true"});return i.data.truncated?(this.logger.warn(`The file tree at ${n} is too large for GitHub to return in full, so path patterns cannot be expanded against it. List the contract documents by literal path instead.`),null):i.data.tree.filter(r=>r.type==="blob"&&typeof r.path=="string").map(r=>r.path)}catch(i){return this.logger.debug(`Could not list the tree at ${n}: ${i.message}`),null}}async changedFiles(t){try{let n=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`}),i=n.data.files??[],r=n.data.commits??[];return i.length>=300||r.lengths.filename)}catch(n){throw this.logger.warn(`Could not compare ${t.beforeSha}...${t.afterSha}: ${n.message}`),n}}async changedFilesByCommit(t){let n=new Set;for await(let r of this.octokit.paginate.iterator(this.octokit.repos.compareCommitsWithBasehead,{owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`,per_page:250})){let o=r.data;for(let s of o.commits??[])n.add(s.sha)}let i=new Set;for(let r of n)for await(let o of this.octokit.paginate.iterator(this.octokit.repos.getCommit,{owner:t.owner,repo:t.repo,ref:r,per_page:300})){let s=o.data;for(let a of s.files??[])i.add(a.filename)}return[...i]}async createBranch(t,n,i){try{return await this.octokit.git.createRef({owner:t.owner,repo:t.repo,ref:`refs/heads/${n}`,sha:i}),this.logger.info(`Created branch ${n} at ${i.slice(0,7)}`),!0}catch(r){if(lge(r)){let o=await this.getBranchHead(t,n);return o===i?(this.logger.info(`Branch ${n} already exists at ${i.slice(0,7)}; reusing it`),!0):o&&await this.isAncestor(t,i,o)?await this.commitsAreAllBots(t,i,o)?(this.logger.info(`Branch ${n} already exists ahead of ${i.slice(0,7)}; reusing it`),!0):(this.logger.error(`Branch ${n} already exists ahead of ${i.slice(0,7)} with commit(s) not made by Drift; refusing to reuse a branch that may carry manual changes`),!1):(this.logger.error(`Branch ${n} already exists but is not based on ${i.slice(0,7)} (current head: ${o??"unknown"}); refusing to reuse a stale branch`),!1)}return this.logger.error(`Could not create branch ${n}: ${r.message}`),!1}}async isAncestor(t,n,i){if(n===i)return!0;try{let r=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${i}`});return r.data.status==="ahead"||r.data.status==="identical"}catch{return!1}}async commitsAreAllBots(t,n,i){try{let o=(await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${i}`})).data.commits??[];return o.length===0?!0:o.every(s=>(s.author?.login??s.committer?.login??"").endsWith("[bot]"))}catch{return!1}}async commitFiles(t,n,i,r){if(i.length===0)return null;try{let s=(await this.octokit.git.getRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`})).data.object.sha,a=await this.octokit.git.getCommit({owner:t.owner,repo:t.repo,commit_sha:s}),c=await Promise.all(i.map(async d=>{let p=await this.octokit.git.createBlob({owner:t.owner,repo:t.repo,content:Buffer.from(d.content,"utf8").toString("base64"),encoding:"base64"});return{path:d.path,mode:"100644",type:"blob",sha:p.data.sha}})),l=await this.octokit.git.createTree({owner:t.owner,repo:t.repo,base_tree:a.data.tree.sha,tree:c}),u=await this.octokit.git.createCommit({owner:t.owner,repo:t.repo,message:r,tree:l.data.sha,parents:[s]});return await this.octokit.git.updateRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`,sha:u.data.sha}),this.logger.info(`Committed ${i.length} file(s) to ${n}: ${u.data.sha.slice(0,7)}`),{sha:u.data.sha}}catch(o){return this.logger.error(`Could not commit to ${n}: ${o.message}`),null}}async createIssue(t,n){try{let i=await this.octokit.issues.create({owner:t.owner,repo:t.repo,title:n.title,body:n.body,labels:n.labels,assignees:n.assignees});return{number:i.data.number,url:i.data.html_url}}catch(i){return this.logger.error(`Could not create issue: ${i.message}`),null}}async getCollaboratorPermission(t,n){try{let i=await this.octokit.repos.getCollaboratorPermissionLevel({owner:t.owner,repo:t.repo,username:n}),r=i.data.permission,s=(i.data.role_name??r??"").toLowerCase();switch(s){case"admin":case"maintain":case"write":case"triage":case"read":case"none":return s;case"push":return"write";case"pull":return"read";default:return this.logger.warn(`Unrecognised permission \`${s}\` for ${n}; treating it as unknown and refusing.`),null}}catch(i){return k4(i)?"none":(this.logger.warn(`Could not determine ${n}'s permission on ${t.owner}/${t.repo}: ${i.message}`),null)}}async getAuthenticatedLogin(){if(this.selfLogin!==void 0)return this.selfLogin;try{let t=await this.octokit.users.getAuthenticated();this.selfLogin=t.data.login}catch{this.selfLogin=null}return this.selfLogin}async getIssue(t,n){try{let i=await this.octokit.issues.get({owner:t.owner,repo:t.repo,issue_number:n});return{number:i.data.number,body:i.data.body??null,state:i.data.state,labels:i.data.labels.map(r=>typeof r=="string"?r:r.name??"").filter(Boolean),pullRequest:!!i.data.pull_request}}catch(i){return this.logger.warn(`Could not read issue #${n}: ${i.message}`),null}}async listIssueComments(t,n){try{return(await this.octokit.issues.listComments({owner:t.owner,repo:t.repo,issue_number:n,per_page:100})).data.map(r=>({id:r.id,body:r.body??null,authorLogin:r.user?.login??null}))}catch(i){throw this.logger.warn(`Could not list comments on #${n}: ${i.message}`),i}}async commitExists(t,n){try{return await this.octokit.repos.getCommit({owner:t.owner,repo:t.repo,ref:n}),!0}catch{return!1}}async getBranchHead(t,n){try{return(await this.octokit.repos.getBranch({owner:t.owner,repo:t.repo,branch:n})).data.commit.sha}catch{return null}}async commentOnIssue(t,n,i){try{return await this.octokit.issues.createComment({owner:t.owner,repo:t.repo,issue_number:n,body:i}),!0}catch(r){return this.logger.warn(`Could not comment on #${n}: ${r.message}`),!1}}async findOpenPlanIssue(t,n){try{return(await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open in:body "${n}"`,per_page:1})).data.items[0]?.number??null}catch{return null}}async findOpenAlertIssues(t){try{let n=await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open label:${age} "drift-alert:"`,per_page:100}),i=[];for(let r of n.data.items){let o=//.exec(r.body??"");o&&i.push({number:r.number,marker:o[1]})}return i}catch{return[]}}async updateIssueBody(t,n,i){try{await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,body:i})}catch(r){this.logger.warn(`Could not update issue #${n}: ${r.message}`)}}async updateIssueComment(t,n,i){try{await this.octokit.issues.updateComment({owner:t.owner,repo:t.repo,comment_id:n,body:i})}catch(r){this.logger.warn(`Could not update comment ${n}: ${r.message}`)}}async closeIssue(t,n,i){try{i&&await this.commentOnIssue(t,n,i),await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,state:"closed"})}catch(r){this.logger.warn(`Could not close issue #${n}: ${r.message}`)}}async createCheckRun(t,n){try{await this.octokit.checks.create({owner:t.owner,repo:t.repo,name:n.name,head_sha:t.afterSha,status:"completed",conclusion:n.conclusion,output:{title:n.title,summary:n.summary,text:n.text}})}catch(i){this.logger.debug(`Could not create check run: ${i.message}`)}}async uploadSarif(t,n){let i=(0,$4.gzipSync)(Buffer.from(JSON.stringify(n.sarif),"utf8")),r=3;for(let o=1;o<=r;o++)try{return await this.octokit.codeScanning.uploadSarif({owner:t.owner,repo:t.repo,commit_sha:n.commitSha,ref:n.ref,sarif:i.toString("base64")}),this.logger.info("Uploaded SARIF results to code scanning."),!0}catch(s){let a=s?.status;if(a===403)return this.logger.warn("Could not upload code scanning results: the token is missing `security-events: write`. Add it to the workflow job's `permissions` to enable Drift's code scanning alerts."),!1;if((a===void 0||a>=500)&&os.includes("/")).map(s=>s.split("/").pop()),o=i.reviewers.filter(s=>!s.includes("/"));await this.octokit.pulls.requestReviewers({owner:t.owner,repo:t.repo,pull_number:n,reviewers:o,team_reviewers:r})}catch(r){this.logger.warn(`Could not request reviewers on #${n}: ${r.message}`)}}async updatePullRequestBody(t,n,i){try{await this.octokit.pulls.update({owner:t.owner,repo:t.repo,pull_number:n,body:i})}catch(r){this.logger.warn(`Could not update PR #${n}: ${r.message}`)}}async getDefaultBranch(t,n){try{return(await this.octokit.repos.get({owner:t,repo:n})).data.default_branch}catch{return null}}asRepoProvider(t){return{changedFiles:()=>this.changedFiles(t),readFile:(n,i)=>this.readFile(t,n,i),listFiles:n=>this.listFiles(t,n)}}get rest(){return this.octokit}};function cge(e){return new Promise(t=>setTimeout(t,e))}function k4(e){return e?.status===404}function lge(e){let t=e?.status,n=e?.message??"";return t===422&&/already exists/i.test(n)}var Cx=require("node:path"),Ff=require("node:fs/promises");function DC(e,t){return uge(e).test(t)}function Yo(e,t){return e.some(n=>DC(n,t))}var _4=new Map;function uge(e){let t=_4.get(e);if(t)return t;let n="^";for(let r=0;r{let c={kind:"list",items:[]};i.items.push(c),i=c,r.push(c)};for(let c=0;cs&&(i.items.length>0&&a(),i.items.push(vW(t.slice(s,c),!0)),s=c,a()),o=!0):(o&&c>s&&(i.items.push(Tk(!0,t.slice(s,c))),s=c,a()),o=!1)}for(t.length>s&&i.items.push(Tk(o,t.slice(s)));r.length;)$be(r.pop());return{items:n}}function hW(e,t){return Ik(e.items,t.items)}function yW(e){let t=[],n=e.items;for(;n;){let i=null;for(let r of n.items){if(r.kind==="int"){t.push(Number(r.value));continue}r.kind==="list"&&t.length>0&&(i=r);break}n=i}return t.length?t:null}function bW(e){let t=n=>n.items.some(i=>i.kind==="list"?t(i):i.kind!=="string"?!1:Sg(i.value)="0"&&e<="9"}function nP(e){return{kind:"int",value:e}}function Tk(e,t){if(e){let n=t.replace(/^0+/,"")||"0";return nP(BigInt(n))}return vW(t,!1)}function vW(e,t){let n=e;return t&&n.length===1&&(n=vbe.get(n)??n),{kind:"string",value:bbe.get(n)??n}}function Sg(e){let t=tP.indexOf(e);return t===-1?`${tP.length}-${e}`:String(t)}function kbe(e){switch(e.kind){case"int":return e.value===0n;case"string":return Sg(e.value)===rP;case"list":return e.items.length===0}}function $be(e){for(let t=e.items.length-1;t>=0;t--){let n=e.items[t];if(kbe(n))e.items.splice(t,1);else if(n.kind!=="list")break}}function mW(e,t){return et?1:0}function Ik(e,t){switch(e.kind){case"int":return _be(e,t);case"string":return Sbe(e,t);case"list":return xbe(e,t)}}function _be(e,t){if(t===null)return e.value===0n?0:1;switch(t.kind){case"int":return e.valuet.value?1:0;case"string":return 1;case"list":return 1}}function Sbe(e,t){if(t===null)return mW(Sg(e.value),rP);switch(t.kind){case"int":return-1;case"string":return mW(Sg(e.value),Sg(t.value));case"list":return-1}}function xbe(e,t){if(t===null)return e.items.length===0?0:Ik(e.items[0],null);switch(t.kind){case"int":return-1;case"string":return 1;case"list":{let n=Math.max(e.items.length,t.items.length);for(let i=0;iTe(t,e),compare:Qe,satisfies:(t,n)=>AW(t,n),sameCompatibilityLine:Ebe,classifyBump:sP,exactVersion:t=>RW(t,e)}}function Te(e,t){let n=e.trim();if(!n||/\s/.test(n))return null;if(SW.has(t)){let r=t==="go"||t==="swift"||t==="cocoapods"?n.replace(/^v(?=\d)/,""):n,o=ea.default.valid(r);if(!o){let a=/^(\d+(?:\.\d+){0,1})([-+][0-9A-Za-z.-]+)?$/.exec(r);if(a){let c=a[1].split(".");o=ea.default.valid(`${c.join(".")}${".0".repeat(3-c.length)}${a[2]??""}`)}}if(!o)return null;let s=ea.default.parse(o);return{raw:n,ecosystem:t,prerelease:s.prerelease.length>0,comparable:{kind:"semver",value:o},release:[s.major,s.minor,s.patch]}}if(t==="pypi"){let i=CW(n);return i?{raw:n,ecosystem:t,prerelease:i.pre!==null||i.dev!==null,comparable:{kind:"pep440",value:i},release:i.release}:null}if(t==="rubygems"){if(!/^\d[0-9A-Za-z._-]*$/.test(n))return null;let i=Pbe(n);return{raw:n,ecosystem:t,prerelease:i.some(r=>typeof r=="string"),comparable:{kind:"ruby",value:i},release:zbe(i)}}if(t==="maven"){if(!/^\d[0-9A-Za-z._+-]*$/.test(n))return null;let i=gW(n);return{raw:n,ecosystem:t,prerelease:bW(i),comparable:{kind:"maven",value:i},release:yW(i)}}if(t==="nuget"){let i=Mbe(n);return i?{raw:n,ecosystem:t,prerelease:i.prerelease!==null,comparable:{kind:"nuget",value:i},release:i.release}:null}if(t==="opam"){if(!/\d/.test(n))return null;let i=/^v?(\d+(?:\.\d+)*)/.exec(n)?.[1]?.split(".").map(Number)??null;return{raw:n,ecosystem:t,prerelease:/(?:^|[._+-])(?:alpha|beta|pre|preview|rc|dev)\d*/i.test(n),comparable:{kind:"opam",value:n},release:i}}return null}function Qe(e,t){if(e.ecosystem!==t.ecosystem||e.comparable.kind!==t.comparable.kind)return null;switch(e.comparable.kind){case"semver":return ea.default.compare(e.comparable.value,t.comparable.value);case"pep440":return zi(e.comparable.value,t.comparable.value);case"ruby":return Dbe(e.comparable.value,t.comparable.value);case"maven":return hW(e.comparable.value,t.comparable.value);case"nuget":return Lbe(e.comparable.value,t.comparable.value);case"opam":return Fbe(e.comparable.value,t.comparable.value)}}function Eg(e,t,n){if(NW(n)){let s=iP(e),a=iP(t);return s&&a&&s===a?0:null}let i=Gi(n),r=i.parse(e),o=i.parse(t);return r&&o?i.compare(r,o):null}function xW(e,t,n){let i=Te(e,n);return i?AW(i,t):null}function oP(e,t,n){if(e===null&&t!==null)return"added";if(e!==null&&t===null)return"removed";if(e===null||t===null)return"unknown";let i=Te(e,n),r=Te(t,n);return i&&r?sP(i,r):"unknown"}function EW(e,t,n){if(e===null||t===null)return oP(e,t,n);let i=kW(e,n),r=kW(t,n);return i&&r?sP(i,r):"unknown"}function TW(e,t,n){if(!e||!t)return null;let i=Eg(t,e,n);return i===null?null:i<0}function IW(e,t,n){if(!e||!t||!SW.has(n))return!1;let i=Te(e,n),r=Te(t,n);return!!(i?.release&&r?.release&&i.release[0]===0&&r.release[0]===0&&i.release[1]!==r.release[1])}function sP(e,t){let n=Qe(e,t);if(n===null||n===0)return"unknown";let i=e.release,r=t.release;return!i||!r?"unknown":(i[0]??0)!==(r[0]??0)?"major":(i[1]??0)!==(r[1]??0)?"minor":(i[2]??0)!==(r[2]??0)?"patch":e.prerelease||t.prerelease?"prerelease":"unknown"}function Ebe(e,t){if(e.ecosystem!==t.ecosystem||!e.release||!t.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let n=e.release[0]??0;return n===0?(t.release[0]??0)===0&&(t.release[1]??0)===(e.release[1]??0):(t.release[0]??0)===n}function AW(e,t){let n=t.trim();if(!n||n==="*")return!0;if(e.comparable.kind==="semver"){let i=n;e.ecosystem==="cargo"&&/^v?\d+(?:\.\d+){0,2}$/.test(n)&&(i=`^${n}`);let r=ea.default.validRange(i);return r?ea.default.satisfies(e.comparable.value,r):null}if(e.comparable.kind==="pep440")return Rbe(e.comparable.value,e.raw,n);if(e.comparable.kind==="ruby")return Obe(e,n);if(e.comparable.kind==="maven")return wW(e,n,/^([[(])\s*([^,]*)\s*,\s*([^\])]*?)\s*([\])])$/);if(e.comparable.kind==="nuget"){if(/^[[(]/.test(n))return wW(e,n,/^([[(])\s*([^,]*)\s*,?\s*([^\])]*?)\s*([\])])$/);let i=Te(n,"nuget"),r=i?Qe(e,i):null;return r===null?null:r>=0}return e.comparable.kind==="opam"?jbe(e,n):null}function wW(e,t,n){let i=n.exec(t);if(!i){let c=Te(t,e.ecosystem),l=c?Qe(e,c):null;return l===null?null:l===0}let[,r,o,s,a]=i;if(o){let c=Te(o,e.ecosystem),l=c?Qe(e,c):null;if(l===null)return null;if(l<0||l===0&&r==="(")return!1}if(s){let c=Te(s,e.ecosystem),l=c?Qe(e,c):null;if(l===null)return null;if(l>0||l===0&&a===")")return!1}return!0}function RW(e,t){let n=e.trim();if(NW(t))return iP(n);if(t==="npm")return ea.default.valid(n)?n:null;if(t==="cargo"){let i=/^=\s*(v?\d+(?:\.\d+){2}(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)$/.exec(n);return i&&Te(i[1],t)?i[1]:null}if(t==="pypi"){let i=/^==\s*([^,;\s]+)$/.exec(n);return i&&!i[1].includes("*")&&Te(i[1],t)?i[1]:null}if(t==="rubygems"){let i=/^(?:=|==)\s*([^,\s]+)$/.exec(n);return i&&Te(i[1],t)?i[1]:null}if(t==="nuget"){let i=/^\[\s*([^,\]]+)\s*\]$/.exec(n);return i&&Te(i[1],t)?i[1]:null}return Te(n,t)?n:null}function iP(e){let t=e.trim();return!t||/\s/.test(t)||/[\[\]<>~=^*,|&]/.test(t)?null:t}function NW(e){return e==="conan"||e==="vcpkg"}function kW(e,t){let n=RW(e,t);if(n)return Te(n,t);let i=e.trim().match(/(?:^|[<>=~^\[(,{"'\s])(v?\d+(?:!\d+)?(?:\.\d+)*(?:(?:a|b|rc)\d+|[-.](?:alpha|beta|rc)[-.]?\d*)?)/i);return i?Te(i[1],t):null}var Tbe=/^v?(?:(?:(\d+)!)?(\d+(?:\.\d+)*)(?:[-_.]?(alpha|a|beta|b|preview|pre|c|rc)[-_.]?(\d+)?)?(?:(?:-(\d+))|(?:[-_.]?(post|rev|r)[-_.]?(\d+)?))?(?:[-_.]?(dev)[-_.]?(\d+)?)?)(?:\+([a-z0-9]+(?:[-_.][a-z0-9]+)*))?$/;function CW(e){let t=Tbe.exec(e.trim().toLowerCase());if(!t)return null;let n=t[3],i=n?/^(a|alpha)$/.test(n)?0:/^(b|beta)$/.test(n)?1:2:null;return{epoch:Number(t[1]??0),release:t[2].split(".").map(Number),pre:i===null?null:[i,Number(t[4]??0)],post:t[5]!==void 0?Number(t[5]):t[6]?Number(t[7]??0):null,dev:t[8]?Number(t[9]??0):null,local:t[10]?t[10].split(/[-_.]/).map(r=>/^\d+$/.test(r)?Number(r):r):null}}function bd(e){return{epoch:e.epoch,release:e.release,pre:null,post:null,dev:null,local:null}}function xg(e){return e.local===null?e:{...e,local:null}}function $W(e){return e.pre!==null||e.dev!==null}function zi(e,t){let n=Rk(e.epoch,t.epoch)||Ak(e.release,t.release);return n||(n=Ibe(e,t),n)||(n=_W(e.post,t.post,-1),n)||(n=_W(e.dev,t.dev,1),n)?n:Abe(e.local,t.local)}function Ibe(e,t){let n=e.pre??(e.dev!==null&&e.post===null?[-1,0]:[3,0]),i=t.pre??(t.dev!==null&&t.post===null?[-1,0]:[3,0]);return Ak(n,i)}function Abe(e,t){if(!e||!t)return e?1:t?-1:0;let n=Math.max(e.length,t.length);for(let i=0;ir.trim()).filter(Boolean);if(!i.length)return!0;for(let r of i){let o=Nbe(e,t,r);if(o!==!0)return o}return!0}function Nbe(e,t,n){let i=/^(===|~=|==|!=|<=|>=|<|>)\s*(.+)$/.exec(n);if(!i)return null;let r=i[1],o=i[2].trim();if(r==="===")return t.trim().toLowerCase()===o.toLowerCase();if(o.endsWith(".*")){if(r!=="=="&&r!=="!=")return null;let a=Cbe(e,o.slice(0,-2));return a===null?null:r==="=="?a:!a}let s=CW(o);if(!s)return null;switch(r){case"==":return zi(s.local===null?xg(e):e,s)===0;case"!=":return zi(s.local===null?xg(e):e,s)!==0;case"<=":return zi(xg(e),s)<=0;case">=":return zi(xg(e),s)>=0;case"<":return!(zi(e,s)>=0||!$W(s)&&$W(e)&&zi(bd(e),bd(s))===0);case">":return!(zi(e,s)<=0||s.post===null&&e.post!==null&&zi(bd(e),bd(s))===0||e.local!==null&&zi(bd(e),bd(s))===0);case"~=":{if(s.local!==null)return null;let a=s.pre===null?s.release.length:s.release.length+1;if(a<2)return null;if(zi(xg(e),s)<0)return!1;let c=s.release.slice(0,Math.min(a-1,s.release.length));return e.epoch===s.epoch&&c.every((l,u)=>(e.release[u]??0)===l)}default:return null}}function Cbe(e,t){let n=/^v?(?:(\d+)!)?(\d+(?:\.\d+)*)$/.exec(t.trim());if(!n)return null;let i=Number(n[1]??0),r=n[2].split(".").map(Number);return e.epoch===i&&r.every((o,s)=>(e.release[s]??0)===o)}function Pbe(e){return e.replace(/-/g,".pre.").match(/[0-9]+|[A-Za-z]+/g)?.map(t=>/^\d+$/.test(t)?Number(t):t.toLowerCase())??[]}function Dbe(e,t){let n=Math.max(e.length,t.length);for(let i=0;ii.trim()).filter(Boolean);if(!n.length)return!0;for(let i of n){let r=/^(~>|>=|<=|>|<|=|==)?\s*([^\s]+)$/.exec(i);if(!r)return null;let o=r[1]??"=",s=Te(r[2],"rubygems");if(!s)return null;let a=Qe(e,s);if((o==="="||o==="==")&&a!==0||o===">="&&a<0||o===">"&&a<=0||o==="<="&&a>0||o==="<"&&a>=0)return!1;if(o==="~>"){if(a<0||!s.release)return!1;let c=r[2].match(/\d+/g)?.length??0,l=[...s.release],u=c>=3?1:0;if(l[u]=(l[u]??0)+1,l.splice(u+1),Ak(e.release??[],l)>=0)return!1}}return!0}function Mbe(e){let t=/^[vV]?(\d+(?:\.\d+){0,3})(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z.-]+)?$/.exec(e);return t?{release:t[1].split(".").map(Number),prerelease:t[2]?t[2].toLowerCase().split(".").map(n=>/^\d+$/.test(n)?Number(n):n):null}:null}function Lbe(e,t){let n=Ak(e.release,t.release);if(n)return n;if(!e.prerelease||!t.prerelease)return e.prerelease?-1:t.prerelease?1:0;let i=Math.max(e.prerelease.length,t.prerelease.length);for(let r=0;ri==="~"?-1:i===void 0?0:/[A-Za-z]/.test(i)?i.charCodeAt(0):i.charCodeAt(0)+256;return Rk(n(e),n(t))}function jbe(e,t){let i=t.trim().replace(/^\{\s*|\s*\}$/g,"").split(/\s*(?:&|&&)\s*/).filter(Boolean);if(!i.length)return null;for(let r of i){let o=/^(>=|<=|>|<|=)?\s*["']?([^"'\s]+)["']?$/.exec(r);if(!o)return null;let s=Te(o[2],"opam"),a=s?Qe(e,s):null;if(a===null)return null;let c=o[1]??"=";if(c==="="&&a!==0||c===">="&&a<0||c===">"&&a<=0||c==="<="&&a>0||c==="<"&&a>=0)return!1}return!0}function zbe(e){let t=[];for(let n of e){if(typeof n!="number")break;t.push(n)}return t.length?t:null}function Ak(e,t){let n=Math.max(e.length,t.length);for(let i=0;it?1:0}function Gbe(e){if(!e)return null;let t=e.trim();if(!t)return null;let n=/^npm:(?:@[^/]+\/)?[^@]+@(.+)$/i.exec(t);if(n)t=n[1].trim();else if(/^(git|github|file|link|workspace|npm|https?):/i.test(t))return null;return t==="*"||t==="latest"||t===""?null:(t=t.split(/\|\||,/)[0].trim(),t=t.replace(/^[\^~><=!]+\s*/,"").replace(/^[[(]\s*/,""),t=t.split(/\s+/)[0].trim(),t=t.replace(/^v/i,"").replace(/[\])]$/,""),t=t.replace(/\+incompatible$/,""),t||null)}function Ck(e){let t=Gbe(e);return t?Nk.default.valid(t)??Nk.default.valid(Nk.default.coerce(t)??"")??null:null}function ta(e,t,n="npm"){return oP(e,t,n)}function Tg(e,t,n="npm"){return TW(e,t,n)===!0}function Ig(e,t,n="npm"){return IW(e,t,n)}function me(e){let t=e.split("/");return(t[t.length-1]??"").toLowerCase()}function Gt(e){try{return JSON.parse(e)}catch{return null}}var DW={ecosystem:"arduino",name:"arduino",handles(e){let t=me(e);return t==="library.properties"||t==="platformio.ini"},isLockfile(){return!1},parse(e,t){return me(t)==="platformio.ini"?qbe(e):Vbe(e)}};function Vbe(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trim();if(i.startsWith("#"))continue;let r=/^depends\s*=\s*(.*)$/i.exec(i);if(r)for(let o of r[1].split(",")){let s=Bbe(o);s&&t.set(s.name,{version:s.version,kind:"runtime"})}}return t}function Bbe(e){let t=e.trim();if(!t)return null;let n=/^(.*?)\s*\(([^)]*)\)\s*$/.exec(t);if(n){let i=n[1].trim(),r=n[2].trim();return i?{name:i,version:r||null}:null}return{name:t,version:null}}function qbe(e){let t=new Map,n=e.split(` -`),i=!1;for(let r of n){let o=r.split(/\s+[;#]/)[0],s=o.trim();if(/^\[/.test(s)){i=!1;continue}let a=/^(lib_deps[\w.]*|lib_extra_dirs|lib_ignore)\s*=\s*(.*)$/.exec(s);if(a){i=a[1].startsWith("lib_deps"),i&&a[2]&&PW(t,a[2],"runtime");continue}if(i&&/^\s/.test(o)&&s!==""){PW(t,s,"runtime");continue}s!==""&&(i=!1)}return t}function PW(e,t,n){let i=t.trim();if(!i||/^[a-z+]+:\/\//i.test(i)||i.startsWith("file://")||i.startsWith(".")||i.includes("${")||/\.(git|zip|tar\.gz)$/i.test(i))return;let r=i.lastIndexOf("@"),o=r>0,s=o?i.slice(0,r):i,a=o?i.slice(r+1).trim():null,c=s.lastIndexOf("/"),l=(c===-1?s:s.slice(c+1)).trim();l&&e.set(l,{version:a||null,kind:n})}function pi(e){let t=[],n={header:"",entries:new Map,lines:[]};t.push(n);let i=e.split(` -`);for(let r=0;rvd(u,"]")){let d=vd(u,"[")-vd(u,"]");for(;d>0&&r+1n.header===t)}function Ag(e){let t=e.trim().replace(/^\[/,"").replace(/\]$/,""),n=[];for(let i of t.matchAll(/"((?:[^"\\]|\\.)*)"|'([^']*)'/g)){let r=i[1]??i[2];r!==void 0&&n.push(r)}return n}function wd(e){let t=e.trim();return t.startsWith("{")?/(?:^|[{,]\s*)version\s*=\s*"([^"]*)"/.exec(t)?.[1]??null:/^"([^"]*)"$/.exec(t)?.[1]??/^'([^']*)'$/.exec(t)?.[1]??null}function Pk(e){return e.replace(/^["']|["']$/g,"")}function OW(e){let t=!1,n=!1;for(let i=0;i<=!]*\s*\d[^"']*)["']/g)].map(f=>f[1].trim()).filter(f=>!/^https?:/.test(f)),d=/:(path|git|podspec|svn|hg)\s*(?:=>|:)/.test(c)||l.length===0?null:l.join(", "),p=n.some(f=>/test|spec|uitest/i.test(f))?"dev":"runtime";t.set(a,{version:d,kind:p})}return t}function rve(e){let t=new Map,n=!1;for(let i of e.split(` -`)){let r=i.replace(/\r$/,"");if(!r.trim())continue;if(/^[A-Z][A-Z ]*:\s*$/.test(r.trim())&&!/^\s/.test(r)){n=r.trim()==="PODS:";continue}if(!n)continue;let o=/^ {2}- "?([\w.+/-]+)"? \(([^)]+)\)/.exec(r);o&&t.set(o[1],{version:o[2],kind:"transitive"})}return t}function ive(e){let t=new Map,n=/\.dependency\s+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let i of e.matchAll(n))t.set(i[1],{version:i[2]??null,kind:"runtime"});return t}function ove(e){let t=!1,n=!1;for(let i=0;iu.includes("indirect")?u:"").trim(),s=r.trim();if(/^require\s*\($/.test(s)){n=!0;continue}if(/^replace\s*\($/.test(s)||/^exclude\s*\($/.test(s)){i=!0;continue}if(s===")"){n=!1,i=!1;continue}if(i||s.startsWith("replace ")||s.startsWith("exclude "))continue;let a=/^require\s+(\S+)\s+(\S+)/.exec(s);if(a){t.set(a[1],{version:a[2],kind:"runtime"});continue}if(!n)continue;let c=/^(\S+)\s+(v\S+)/.exec(o||s);if(!c)continue;let l=s.includes("// indirect");t.set(c[1],{version:c[2],kind:l?"transitive":"runtime"})}return t}function lve(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trim().split(/\s+/);if(i.length<3)continue;let[r,o]=i;o.endsWith("/go.mod")||t.set(r,{version:o,kind:"transitive"})}return t}var WW={ecosystem:"hex",name:"Mix",handles(e){let t=me(e);return t==="mix.exs"||t==="mix.lock"||t==="rebar.config"},isLockfile(e){return me(e)==="mix.lock"},parse(e,t){let n=me(t);return n==="mix.lock"?dve(e):n==="rebar.config"?pve(e):uve(e)}};function uve(e){let t=new Map;for(let n of e.matchAll(/\{\s*:([a-z_][a-zA-Z0-9_]*)\s*(,[^}]*)?\}/g)){let i=n[1],r=n[2]??"",o=/^,\s*"([^"]+)"/.exec(r)?.[1]??null,s=/\b(path|git|github|hg|svn):\s*/.test(r),a=s?null:o;if(!o&&!s&&!/\b(only|runtime|optional|app|manager):/.test(r))continue;let c=/\bonly:\s*(\[[^\]]*\]|:[a-z_]+)/.exec(r)?.[1]??"",l=/:(dev|test)\b/.test(c)?"dev":"runtime";t.set(i,{version:a,kind:l})}return t}function dve(e){let t=new Map,n=/"([a-z_][a-zA-Z0-9_]*)"\s*:\s*\{\s*:hex\s*,\s*:[a-zA-Z0-9_]+\s*,\s*"([^"]+)"/g;for(let i of e.matchAll(n))t.set(i[1],{version:i[2],kind:"transitive"});return t}function pve(e){let t=new Map,n=/\{\s*deps\s*,\s*\[/.exec(e);if(!n)return t;let i=1,r=n.index+n[0].length;for(;r0;r++)e[r]==="["?i+=1:e[r]==="]"&&(i-=1);let o=e.slice(n.index+n[0].length,r-1);for(let s of o.matchAll(/\{\s*([a-z_][a-zA-Z0-9_]*)\s*,\s*"([^"]+)"/g))t.set(s[1],{version:s[2],kind:"runtime"});for(let s of o.matchAll(/(?:^|[[,])\s*([a-z_][a-zA-Z0-9_]*)\s*(?=[,\]]|$)/g))t.has(s[1])||t.set(s[1],{version:null,kind:"runtime"});return t}var HW={ecosystem:"maven",name:"maven/gradle",handles(e){let t=me(e);return t==="pom.xml"||t==="build.gradle"||t==="build.gradle.kts"||t==="libs.versions.toml"||t==="gradle.lockfile"},isLockfile(e){return me(e)==="gradle.lockfile"},parse(e,t){let n=me(t);return n==="pom.xml"?fve(e):n==="gradle.lockfile"?bve(e):n==="libs.versions.toml"?yve(e):hve(e)}};function fve(e){let t=new Map,n=gve(e),i=mve(e,n);for(let r of e.matchAll(/([\s\S]*?)<\/dependency>/g)){let o=r[1],s=na(o,"groupId"),a=na(o,"artifactId");if(!s||!a)continue;let c=`${s}:${a}`,u=KW(na(o,"version"),n)??i.get(c)??null,d=na(o,"scope"),f=na(o,"optional")==="true"?"optional":d==="test"||d==="provided"?"dev":"runtime",m=t.get(c);t.set(c,{version:u??m?.version??null,kind:f})}return t}function mve(e,t){let n=new Map;for(let i of e.matchAll(/([\s\S]*?)<\/dependencyManagement>/g))for(let r of i[1].matchAll(/([\s\S]*?)<\/dependency>/g)){let o=r[1],s=na(o,"groupId"),a=na(o,"artifactId"),c=KW(na(o,"version"),t);s&&a&&c&&n.set(`${s}:${a}`,c)}return n}function gve(e){let t=new Map;for(let n of e.matchAll(/([\s\S]*?)<\/properties>/g))for(let i of n[1].matchAll(/<([\w.-]+)>([^<]*)<\/\1>/g))t.set(i[1],i[2].trim());return t}function KW(e,t){if(!e)return null;let n=e;for(let i=0;i<2;i++)n=n.replace(/\$\{([^}]+)\}/g,(r,o)=>t.get(o)??r);return n.includes("${")?null:n.trim()||null}function na(e,t){return new RegExp(`<${t}>([^<]*)`).exec(e)?.[1]?.trim()??null}function hve(e){let t=new Map,n="(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testCompileOnly|annotationProcessor|kapt|ksp)";for(let i of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*["']([^"']+:[^"']+)["']`,"g"))){let r=i[1].split(":");if(r.length<2)continue;let[o,s,a]=r,c=/test|androidTest/i.test(i[0]);t.set(`${o}:${s}`,{version:a??null,kind:c?"dev":"runtime"})}for(let i of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*group:\\s*["']([^"']+)["'],\\s*name:\\s*["']([^"']+)["'](?:,\\s*version:\\s*["']([^"']+)["'])?`,"g")))t.set(`${i[1]}:${i[2]}`,{version:i[3]??null,kind:/test/i.test(i[0])?"dev":"runtime"});return t}function yve(e){let t=new Map,n=new Map,i="";for(let r of e.split(` -`)){let o=r.split("#")[0].trim();if(!o)continue;let s=/^\[([^\]]+)\]$/.exec(o)?.[1];if(s){i=s;continue}if(i==="versions"){let m=/^([\w.-]+)\s*=\s*["']([^"']+)["']/.exec(o);m&&n.set(m[1],m[2]);continue}if(i!=="libraries")continue;let a=/module\s*=\s*["']([^"']+)["']/.exec(o)?.[1],c=/group\s*=\s*["']([^"']+)["']/.exec(o)?.[1],l=/name\s*=\s*["']([^"']+)["']/.exec(o)?.[1],u=a??(c&&l?`${c}:${l}`:null);if(!u)continue;let d=/version\s*=\s*["']([^"']+)["']/.exec(o)?.[1],p=/version\.ref\s*=\s*["']([^"']+)["']/.exec(o)?.[1],f=d??(p?n.get(p)??null:null);t.set(u,{version:f,kind:"runtime"})}return t}function bve(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trim();if(!i||i.startsWith("#"))continue;let o=i.split("=")[0].split(":");o.length<3||t.set(`${o[0]}:${o[1]}`,{version:o[2],kind:"transitive"})}return t}var ZW=gt(gc(),1);var vve=new Set(["package.json"]),JW=new Set(["package-lock.json","npm-shrinkwrap.json","yarn.lock","pnpm-lock.yaml","bun.lock"]),YW={ecosystem:"npm",name:"npm/yarn/pnpm",handles(e){let t=me(e);return e.includes("node_modules/")?!1:vve.has(t)||JW.has(t)},isLockfile(e){return JW.has(me(e))},parse(e,t){let n=me(t);return n==="package.json"?$ve(e):n==="yarn.lock"?Eve(e):n==="pnpm-lock.yaml"?Tve(e):n==="bun.lock"?wve(e):_ve(e)}};function wve(e){let t=new Map,n=Gt(kve(e));if(!n?.packages)return t;for(let i of Object.values(n.packages)){let r=Array.isArray(i)?i[0]:i;if(typeof r!="string")continue;let o=r.lastIndexOf("@");if(o<=0)continue;let s=r.slice(0,o),a=r.slice(o+1);/^\d/.test(a)&&t.set(s,{version:a,kind:"transitive"})}return t}function kve(e){let t="",n=!1;for(let i=0;io.split(/[.+-]/).map(s=>Number.parseInt(s,10)),i=n(e),r=n(t);for(let o=0;oa}return!1}function Eve(e){let t=new Map,n=null;for(let i of e.split(` -`)){let r=i.replace(/\r$/,"");if(!r.trim()||r.startsWith("#"))continue;if(!/^\s/.test(r)){let s=r.replace(/:\s*$/,"").split(",")[0].trim().replace(/^"|"$/g,"");n=XW(s);continue}let o=/^\s+version:?\s+"?([^"\s]+)"?/.exec(r)?.[1];if(o&&n){let s=t.get(n);(!s||QW(o,s.version??""))&&t.set(n,{version:o,kind:"transitive"}),n=null}}return t}function Tve(e){let t=new Map,n;try{n=(0,ZW.parse)(e)}catch{return t}let i=n?.packages;if(!i||typeof i!="object")return t;for(let r of Object.keys(i)){let o=r.startsWith("/")?r.slice(1):r,s=XW(o),a=Ive(o);if(!s||!a)continue;let c=t.get(s);(!c||QW(a,c.version??""))&&t.set(s,{version:a,kind:"transitive"})}return t}function XW(e){let t=e.lastIndexOf("@");return t<=0?e||null:e.slice(0,t)||null}function Ive(e){let t=e.lastIndexOf("@");return t<=0?null:e.slice(t+1).split("(")[0]||null}var tH={ecosystem:"nuget",name:"NuGet",handles(e){let t=me(e);return/\.(cs|fs|vb)proj$/.test(t)||t==="directory.packages.props"||t==="directory.build.props"||t==="packages.lock.json"||t==="packages.config"||t.endsWith(".nuspec")},isLockfile(e){return me(e)==="packages.lock.json"},parse(e,t){let n=me(t);return n==="packages.lock.json"?Rve(e):n==="packages.config"?Nve(e):n.endsWith(".nuspec")?Cve(e):Ave(e)}};function Ave(e){let t=new Map,n=/<(PackageReference|PackageVersion|GlobalPackageReference)\b([^>]*?)(\/>|>([\s\S]*?)<\/\1>)/g;for(let i of e.matchAll(n)){let r=i[2]??"",o=i[4]??"",s=yo(r,"Include")??yo(r,"Update");if(!s)continue;let a=yo(r,"Version")??yo(r,"VersionOverride")??eH(o,"Version"),c=a&&!a.includes("$(")?a:null,u=(yo(r,"PrivateAssets")??eH(o,"PrivateAssets"))?.toLowerCase()==="all"?"dev":"runtime";t.set(s,{version:c,kind:u})}return t}function Rve(e){let t=new Map,n=Gt(e);if(!n?.dependencies)return t;for(let i of Object.values(n.dependencies))if(!(!i||typeof i!="object"))for(let[r,o]of Object.entries(i)){let s=o?.resolved??null;if(!s)continue;let a=o.type==="Direct"?"runtime":"transitive";t.get(r)?.kind==="runtime"&&a==="transitive"||t.set(r,{version:s,kind:a})}return t}function Nve(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let i=n[1]??"",r=yo(i,"id");if(!r)continue;let o=yo(i,"developmentDependency");t.set(r,{version:yo(i,"version"),kind:o?.toLowerCase()==="true"?"dev":"runtime"})}return t}function Cve(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let i=n[1]??"",r=yo(i,"id");r&&t.set(r,{version:yo(i,"version"),kind:"runtime"})}return t}function yo(e,t){let n=new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i").exec(e);return(n?.[2]??n?.[3])?.trim()||null}function eH(e,t){return new RegExp(`<${t}\\s*>([^<]*)`,"i").exec(e)?.[1]?.trim()||null}var nH={ecosystem:"opam",name:"opam",handles(e){let t=me(e);return t.endsWith(".opam")||t.endsWith(".opam.locked")||t==="dune-project"},isLockfile(e){return me(e).endsWith(".opam.locked")},parse(e,t){if(me(t)==="dune-project")return Pve(e);let n=me(t).endsWith(".opam.locked");return Fve(e,n)}};function Pve(e){let t=new Map;for(let n of Ove(e,"depends"))for(let i of Mve(n)){let r=/^\(\s*([\w.+-]+)([\s\S]*)\)$/.exec(i),o=r?.[1]??(/^[\w.+-]+$/.test(i)?i:void 0);if(!o)continue;let s=r?.[2]??"",a=/:with-test|:with-doc|:dev/.test(s)?"dev":"runtime";t.set(o,{version:Dve(s),kind:a})}return t}function Dve(e){let t=[...e.matchAll(/([<>=]+)\s*([\w.~+-]+)/g)].map(n=>`${n[1]} ${n[2]}`);return t.length===0?null:t.length===1&&t[0].startsWith("= ")?t[0].slice(2):t.join(" & ")}function Ove(e,t){let n=[],i=new RegExp(`\\(\\s*${t}\\b`,"g");for(let r of e.matchAll(i)){let o=1,s=r.index+r[0].length,a=s;for(;s0;s++){let c=e[s];c==="("?o+=1:c===")"&&(o-=1)}n.push(e.slice(a,s-1))}return n}function Mve(e){let t=[],n="",i=0;for(let r of e){if(r==="("?i+=1:r===")"&&(i-=1),i===0&&/\s/.test(r)){n.trim()&&t.push(n.trim()),n="";continue}n+=r}return n.trim()&&t.push(n.trim()),t}var Lve={depends:"runtime",depopts:"optional"};function Fve(e,t){let n=new Map;for(let[i,r]of Object.entries(Lve))for(let o of jve(e,i))for(let s of zve(o)){let a=/^"([^"]+)"/.exec(s)?.[1];if(!a)continue;let c=/\{([\s\S]*)\}/.exec(s)?.[1]??"",l=/\bwith-test\b|\bwith-doc\b|\bdev\b/.test(c)?"dev":r;n.set(a,{version:Uve(c),kind:t?"transitive":l})}return n}function Uve(e){if(!e.trim())return null;let t=[...e.matchAll(/([<>=!]+)\s*"([^"]+)"/g)].map(i=>`${i[1]} ${i[2]}`);return t.length===0?null:/^=\s/.exec(t[0])&&t.length===1?t[0].slice(2):t.join(" & ")}function jve(e,t){let n=[],i=new RegExp(`(?:^|\\n)\\s*${t}\\s*:\\s*\\[`,"g");for(let r of e.matchAll(i)){let o=1,s=r.index+r[0].length,a=s;for(;s0;s++){let c=e[s];if(c==='"'){for(s+=1;si))continue;if(c")return Dk(e);for(let r=n+1;r{r&&o&&t.set(r,{version:o,kind:s}),r=null,o=null,s="transitive"};for(let c of n){let l=cP(c.replace(/\r$/,""));if(!l.trim())continue;let u=l.length-l.trimStart().length;if(u===0){a(),i=/^packages\s*:/.test(l.trim());continue}if(!i)continue;if(u===2){a(),r=/^\s*"?([A-Za-z_][\w.-]*)"?\s*:/.exec(l)?.[1]??null;continue}if(!r)continue;let d=/^\s*([A-Za-z_][\w-]*)\s*:(.*)$/.exec(l);if(d){if(d[1]==="version")o=Dk(d[2].trim())||null;else if(d[1]==="dependency"){let p=Dk(d[2].trim());s=p.startsWith("direct dev")?"dev":p.startsWith("direct")?"runtime":"transitive"}}}return a(),t}function cP(e){let t=!1,n=!1;for(let i=0;iQhe.includes(a)?(s[a]=r[a],s):(s.variables||(s.variables={}),s.variables[a]=r[a],s),{}),o=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;return eW.test(o)&&(i.url=o.replace(eW,"/api/graphql")),e(i).then(s=>{if(s.data.errors){let a={};for(let c of Object.keys(s.headers))a[c]=s.headers[c];throw new Yhe(i,a,s.data)}return s.data.data})}function _N(e,t){let n=e.defaults(t);return Object.assign((i,o)=>eye(n,i,o),{defaults:_N.bind(null,n),endpoint:n.endpoint})}var FZe=_N(Og,{headers:{"user-agent":`octokit-graphql.js/${Jhe} ${Ks()}`},method:"POST",url:"/graphql"});function tW(e){return _N(e,{method:"POST",url:"/graphql"})}var $N="(?:[a-zA-Z0-9_-]+)",nW="\\.",rW=new RegExp(`^${$N}${nW}${$N}${nW}${$N}$`),tye=rW.test.bind(rW);async function nye(e){let t=tye(e),n=e.startsWith("v1.")||e.startsWith("ghs_"),r=e.startsWith("ghu_");return{type:"token",token:e,tokenType:t?"app":n?"installation":r?"user-to-server":"oauth"}}function rye(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function iye(e,t,n,r){let i=t.endpoint.merge(n,r);return i.headers.authorization=rye(e),t(i)}var iW=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(nye.bind(null,t),{hook:iye.bind(null,t)})};var SN="7.0.8";var oW=()=>{},oye=console.warn.bind(console),sye=console.error.bind(console);function aye(e={}){return typeof e.debug!="function"&&(e.debug=oW),typeof e.info!="function"&&(e.info=oW),typeof e.warn!="function"&&(e.warn=oye),typeof e.error!="function"&&(e.error=sye),e}var sW=`octokit-core.js/${SN} ${Ks()}`,Dk=class{static VERSION=SN;static defaults(t){return class extends this{constructor(...r){let i=r[0]||{};if(typeof t=="function"){super(t(i));return}super(Object.assign({},t,i,i.userAgent&&t.userAgent?{userAgent:`${i.userAgent} ${t.userAgent}`}:null))}}}static plugins=[];static plugin(...t){let n=this.plugins;return class extends this{static plugins=n.concat(t.filter(i=>!n.includes(i)))}}constructor(t={}){let n=new R6.Collection,r={baseUrl:Og.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(r.headers["user-agent"]=t.userAgent?`${t.userAgent} ${sW}`:sW,t.baseUrl&&(r.baseUrl=t.baseUrl),t.previews&&(r.mediaType.previews=t.previews),t.timeZone&&(r.headers["time-zone"]=t.timeZone),this.request=Og.defaults(r),this.graphql=tW(this.request).defaults(r),this.log=aye(t.log),this.hook=n,t.authStrategy){let{authStrategy:o,...s}=t,a=o(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:s},t.auth));n.wrap("request",a.hook),this.auth=a}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{let o=iW(t.auth);n.wrap("request",o.hook),this.auth=o}let i=this.constructor;for(let o=0;o{e.log.debug("request",n);let r=Date.now(),i=e.request.endpoint.parse(n),o=i.url.replace(n.baseUrl,"");return t(n).then(s=>{let a=s.headers["x-github-request-id"];return e.log.info(`${i.method} ${o} - ${s.status} with id ${a} in ${Date.now()-r}ms`),s}).catch(s=>{let a=s.response?.headers["x-github-request-id"]||"UNKNOWN";throw e.log.error(`${i.method} ${o} - ${s.status} with id ${a} in ${Date.now()-r}ms`),s})})}xN.VERSION=aW;var cye="0.0.0-development";function lye(e){if(!e.data)return{...e,data:[]};if(!(("total_count"in e.data||"total_commits"in e.data)&&!("url"in e.data)))return e;let n=e.data.incomplete_results,r=e.data.repository_selection,i=e.data.total_count,o=e.data.total_commits;delete e.data.incomplete_results,delete e.data.repository_selection,delete e.data.total_count,delete e.data.total_commits;let s=Object.keys(e.data)[0],a=e.data[s];return e.data=a,typeof n<"u"&&(e.data.incomplete_results=n),typeof r<"u"&&(e.data.repository_selection=r),e.data.total_count=i,e.data.total_commits=o,e}function EN(e,t,n){let r=typeof t=="function"?t.endpoint(n):e.request.endpoint(t,n),i=typeof t=="function"?t:e.request,o=r.method,s=r.headers,a=r.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!a)return{done:!0};try{let c=await i({method:o,url:a,headers:s}),l=lye(c);if(a=((l.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!a&&"total_commits"in l.data){let u=new URL(l.url),d=u.searchParams,p=parseInt(d.get("page")||"1",10),f=parseInt(d.get("per_page")||"250",10);p*f{if(i.done)return t;let o=!1;function s(){o=!0}return t=t.concat(r?r(i.value,s):i.value.data),o?t:lW(e,t,n,r)})}var t3e=Object.assign(cW,{iterator:EN});function TN(e){return{paginate:Object.assign(cW.bind(null,e),{iterator:EN.bind(null,e)})}}TN.VERSION=cye;var IN="17.0.0";var uye={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},uW=uye;var kc=new Map;for(let[e,t]of Object.entries(uW))for(let[n,r]of Object.entries(t)){let[i,o,s]=r,[a,c]=i.split(/ /),l=Object.assign({method:a,url:c},o);kc.has(e)||kc.set(e,new Map),kc.get(e).set(n,{scope:e,methodName:n,endpointDefaults:l,decorations:s})}var dye={has({scope:e},t){return kc.get(e).has(t)},getOwnPropertyDescriptor(e,t){return{value:this.get(e,t),configurable:!0,writable:!0,enumerable:!0}},defineProperty(e,t,n){return Object.defineProperty(e.cache,t,n),!0},deleteProperty(e,t){return delete e.cache[t],!0},ownKeys({scope:e}){return[...kc.get(e).keys()]},set(e,t,n){return e.cache[t]=n},get({octokit:e,scope:t,cache:n},r){if(n[r])return n[r];let i=kc.get(t).get(r);if(!i)return;let{endpointDefaults:o,decorations:s}=i;return s?n[r]=pye(e,t,r,o,s):n[r]=e.request.defaults(o),n[r]}};function AN(e){let t={};for(let n of kc.keys())t[n]=new Proxy({octokit:e,scope:n,cache:{}},dye);return t}function pye(e,t,n,r,i){let o=e.request.defaults(r);function s(...a){let c=o.endpoint.merge(...a);if(i.mapToData)return c=Object.assign({},c,{data:c[i.mapToData],[i.mapToData]:void 0}),o(c);if(i.renamed){let[l,u]=i.renamed;e.log.warn(`octokit.${t}.${n}() has been renamed to octokit.${l}.${u}()`)}if(i.deprecated&&e.log.warn(i.deprecated),i.renamedParameters){let l=o.endpoint.merge(...a);for(let[u,d]of Object.entries(i.renamedParameters))u in l&&(e.log.warn(`"${u}" parameter is deprecated for "octokit.${t}.${n}()". Use "${d}" instead`),d in l||(l[d]=l[u]),delete l[u]);return o(l)}return o(...a)}return Object.assign(s,o)}function fye(e){return{rest:AN(e)}}fye.VERSION=IN;function RN(e){let t=AN(e);return{...t,rest:t}}RN.VERSION=IN;var dW="22.0.1";var pW=Dk.plugin(xN,RN,TN).defaults({userAgent:`octokit-rest.js/${dW}`});var mye="drift",Ok=class{octokit;logger;selfLogin;constructor(t){this.octokit=new pW({auth:t.repoToken,baseUrl:t.baseUrl??"https://api.github.com",userAgent:"drift-bot/0.1"}),this.logger=t.logger}async readFile(t,n,r){try{let o=(await this.octokit.repos.getContent({owner:t.owner,repo:t.repo,path:n,ref:r})).data;return Array.isArray(o)||o.type!=="file"||!("content"in o)?null:Buffer.from(o.content,"base64").toString("utf8")}catch(i){if(fW(i))return null;throw this.logger.debug(`Failed to read ${n}@${r}: ${i.message}`),i}}async listFiles(t,n){try{let r=await this.octokit.git.getTree({owner:t.owner,repo:t.repo,tree_sha:n,recursive:"true"});return r.data.truncated?(this.logger.warn(`The file tree at ${n} is too large for GitHub to return in full, so path patterns cannot be expanded against it. List the contract documents by literal path instead.`),null):r.data.tree.filter(i=>i.type==="blob"&&typeof i.path=="string").map(i=>i.path)}catch(r){return this.logger.debug(`Could not list the tree at ${n}: ${r.message}`),null}}async changedFiles(t){try{let n=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`}),r=n.data.files??[],i=n.data.commits??[];return r.length>=300||i.lengths.filename)}catch(n){throw this.logger.warn(`Could not compare ${t.beforeSha}...${t.afterSha}: ${n.message}`),n}}async changedFilesByCommit(t){let n=new Set;for await(let i of this.octokit.paginate.iterator(this.octokit.repos.compareCommitsWithBasehead,{owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`,per_page:250})){let o=i.data;for(let s of o.commits??[])n.add(s.sha)}let r=new Set;for(let i of n)for await(let o of this.octokit.paginate.iterator(this.octokit.repos.getCommit,{owner:t.owner,repo:t.repo,ref:i,per_page:300})){let s=o.data;for(let a of s.files??[])r.add(a.filename)}return[...r]}async createBranch(t,n,r){try{return await this.octokit.git.createRef({owner:t.owner,repo:t.repo,ref:`refs/heads/${n}`,sha:r}),this.logger.info(`Created branch ${n} at ${r.slice(0,7)}`),!0}catch(i){if(hye(i)){let o=await this.getBranchHead(t,n);return o===r?(this.logger.info(`Branch ${n} already exists at ${r.slice(0,7)}; reusing it`),!0):o&&await this.isAncestor(t,r,o)?await this.commitsAreAllBots(t,r,o)?(this.logger.info(`Branch ${n} already exists ahead of ${r.slice(0,7)}; reusing it`),!0):(this.logger.error(`Branch ${n} already exists ahead of ${r.slice(0,7)} with commit(s) not made by Drift; refusing to reuse a branch that may carry manual changes`),!1):(this.logger.error(`Branch ${n} already exists but is not based on ${r.slice(0,7)} (current head: ${o??"unknown"}); refusing to reuse a stale branch`),!1)}return this.logger.error(`Could not create branch ${n}: ${i.message}`),!1}}async isAncestor(t,n,r){if(n===r)return!0;try{let i=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${r}`});return i.data.status==="ahead"||i.data.status==="identical"}catch{return!1}}async commitsAreAllBots(t,n,r){try{let o=(await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${r}`})).data.commits??[];return o.length===0?!0:o.every(s=>(s.author?.login??s.committer?.login??"").endsWith("[bot]"))}catch{return!1}}async commitFiles(t,n,r,i){if(r.length===0)return null;try{let s=(await this.octokit.git.getRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`})).data.object.sha,a=await this.octokit.git.getCommit({owner:t.owner,repo:t.repo,commit_sha:s}),c=await Promise.all(r.map(async d=>{let p=await this.octokit.git.createBlob({owner:t.owner,repo:t.repo,content:Buffer.from(d.content,"utf8").toString("base64"),encoding:"base64"});return{path:d.path,mode:"100644",type:"blob",sha:p.data.sha}})),l=await this.octokit.git.createTree({owner:t.owner,repo:t.repo,base_tree:a.data.tree.sha,tree:c}),u=await this.octokit.git.createCommit({owner:t.owner,repo:t.repo,message:i,tree:l.data.sha,parents:[s]});return await this.octokit.git.updateRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`,sha:u.data.sha}),this.logger.info(`Committed ${r.length} file(s) to ${n}: ${u.data.sha.slice(0,7)}`),{sha:u.data.sha}}catch(o){return this.logger.error(`Could not commit to ${n}: ${o.message}`),null}}async createIssue(t,n){try{let r=await this.octokit.issues.create({owner:t.owner,repo:t.repo,title:n.title,body:n.body,labels:n.labels,assignees:n.assignees});return{number:r.data.number,url:r.data.html_url}}catch(r){return this.logger.error(`Could not create issue: ${r.message}`),null}}async getCollaboratorPermission(t,n){try{let r=await this.octokit.repos.getCollaboratorPermissionLevel({owner:t.owner,repo:t.repo,username:n}),i=r.data.permission,s=(r.data.role_name??i??"").toLowerCase();switch(s){case"admin":case"maintain":case"write":case"triage":case"read":case"none":return s;case"push":return"write";case"pull":return"read";default:return this.logger.warn(`Unrecognised permission \`${s}\` for ${n}; treating it as unknown and refusing.`),null}}catch(r){return fW(r)?"none":(this.logger.warn(`Could not determine ${n}'s permission on ${t.owner}/${t.repo}: ${r.message}`),null)}}async getAuthenticatedLogin(){if(this.selfLogin!==void 0)return this.selfLogin;try{let t=await this.octokit.users.getAuthenticated();this.selfLogin=t.data.login}catch{this.selfLogin=null}return this.selfLogin}async getIssue(t,n){try{let r=await this.octokit.issues.get({owner:t.owner,repo:t.repo,issue_number:n});return{number:r.data.number,body:r.data.body??null,state:r.data.state,labels:r.data.labels.map(i=>typeof i=="string"?i:i.name??"").filter(Boolean),pullRequest:!!r.data.pull_request}}catch(r){return this.logger.warn(`Could not read issue #${n}: ${r.message}`),null}}async listIssueComments(t,n){try{return(await this.octokit.issues.listComments({owner:t.owner,repo:t.repo,issue_number:n,per_page:100})).data.map(i=>({id:i.id,body:i.body??null,authorLogin:i.user?.login??null}))}catch(r){throw this.logger.warn(`Could not list comments on #${n}: ${r.message}`),r}}async commitExists(t,n){try{return await this.octokit.repos.getCommit({owner:t.owner,repo:t.repo,ref:n}),!0}catch{return!1}}async getBranchHead(t,n){try{return(await this.octokit.repos.getBranch({owner:t.owner,repo:t.repo,branch:n})).data.commit.sha}catch{return null}}async commentOnIssue(t,n,r){try{return await this.octokit.issues.createComment({owner:t.owner,repo:t.repo,issue_number:n,body:r}),!0}catch(i){return this.logger.warn(`Could not comment on #${n}: ${i.message}`),!1}}async findOpenPlanIssue(t,n){try{return(await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open in:body "${n}"`,per_page:1})).data.items[0]?.number??null}catch{return null}}async findOpenAlertIssues(t){try{let n=await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open label:${mye} "drift-alert:"`,per_page:100}),r=[];for(let i of n.data.items){let o=//.exec(i.body??"");o&&r.push({number:i.number,marker:o[1]})}return r}catch{return[]}}async updateIssueBody(t,n,r){try{await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,body:r})}catch(i){this.logger.warn(`Could not update issue #${n}: ${i.message}`)}}async updateIssueComment(t,n,r){try{await this.octokit.issues.updateComment({owner:t.owner,repo:t.repo,comment_id:n,body:r})}catch(i){this.logger.warn(`Could not update comment ${n}: ${i.message}`)}}async closeIssue(t,n,r){try{r&&await this.commentOnIssue(t,n,r),await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,state:"closed"})}catch(i){this.logger.warn(`Could not close issue #${n}: ${i.message}`)}}async createCheckRun(t,n){try{await this.octokit.checks.create({owner:t.owner,repo:t.repo,name:n.name,head_sha:t.afterSha,status:"completed",conclusion:n.conclusion,output:{title:n.title,summary:n.summary,text:n.text}})}catch(r){this.logger.debug(`Could not create check run: ${r.message}`)}}async uploadSarif(t,n){let r=(0,mW.gzipSync)(Buffer.from(JSON.stringify(n.sarif),"utf8")),i=3;for(let o=1;o<=i;o++)try{return await this.octokit.codeScanning.uploadSarif({owner:t.owner,repo:t.repo,commit_sha:n.commitSha,ref:n.ref,sarif:r.toString("base64")}),this.logger.info("Uploaded SARIF results to code scanning."),!0}catch(s){let a=s?.status;if(a===403)return this.logger.warn("Could not upload code scanning results: the token is missing `security-events: write`. Add it to the workflow job's `permissions` to enable Drift's code scanning alerts."),!1;if((a===void 0||a>=500)&&os.includes("/")).map(s=>s.split("/").pop()),o=r.reviewers.filter(s=>!s.includes("/"));await this.octokit.pulls.requestReviewers({owner:t.owner,repo:t.repo,pull_number:n,reviewers:o,team_reviewers:i})}catch(i){this.logger.warn(`Could not request reviewers on #${n}: ${i.message}`)}}async updatePullRequestBody(t,n,r){try{await this.octokit.pulls.update({owner:t.owner,repo:t.repo,pull_number:n,body:r})}catch(i){this.logger.warn(`Could not update PR #${n}: ${i.message}`)}}async getDefaultBranch(t,n){try{return(await this.octokit.repos.get({owner:t,repo:n})).data.default_branch}catch{return null}}asRepoProvider(t){return{changedFiles:()=>this.changedFiles(t),readFile:(n,r)=>this.readFile(t,n,r),listFiles:n=>this.listFiles(t,n)}}get rest(){return this.octokit}};function gye(e){return new Promise(t=>setTimeout(t,e))}function fW(e){return e?.status===404}function hye(e){let t=e?.status,n=e?.message??"";return t===422&&/already exists/i.test(n)}var AE=require("node:path"),tm=require("node:fs/promises");function PN(e,t){return yye(e).test(t)}function Qo(e,t){return e.some(n=>PN(n,t))}var gW=new Map;function yye(e){let t=gW.get(e);if(t)return t;let n="^";for(let i=0;i{let c={kind:"list",items:[]};r.items.push(c),r=c,i.push(c)};for(let c=0;cs&&(r.items.length>0&&a(),r.items.push(dK(t.slice(s,c),!0)),s=c,a()),o=!0):(o&&c>s&&(r.items.push(Kk(!0,t.slice(s,c))),s=c,a()),o=!1)}for(t.length>s&&r.items.push(Kk(o,t.slice(s)));i.length;)Awe(i.pop());return{items:n}}function cK(e,t){return Jk(e.items,t.items)}function lK(e){let t=[],n=e.items;for(;n;){let r=null;for(let i of n.items){if(i.kind==="int"){t.push(Number(i.value));continue}i.kind==="list"&&t.length>0&&(r=i);break}n=r}return t.length?t:null}function uK(e){let t=n=>n.items.some(r=>r.kind==="list"?t(r):r.kind!=="string"?!1:zg(r.value)="0"&&e<="9"}function XN(e){return{kind:"int",value:e}}function Kk(e,t){if(e){let n=t.replace(/^0+/,"")||"0";return XN(BigInt(n))}return dK(t,!1)}function dK(e,t){let n=e;return t&&n.length===1&&(n=Ewe.get(n)??n),{kind:"string",value:xwe.get(n)??n}}function zg(e){let t=QN.indexOf(e);return t===-1?`${QN.length}-${e}`:String(t)}function Iwe(e){switch(e.kind){case"int":return e.value===0n;case"string":return zg(e.value)===eD;case"list":return e.items.length===0}}function Awe(e){for(let t=e.items.length-1;t>=0;t--){let n=e.items[t];if(Iwe(n))e.items.splice(t,1);else if(n.kind!=="list")break}}function sK(e,t){return et?1:0}function Jk(e,t){switch(e.kind){case"int":return Rwe(e,t);case"string":return Pwe(e,t);case"list":return Cwe(e,t)}}function Rwe(e,t){if(t===null)return e.value===0n?0:1;switch(t.kind){case"int":return e.valuet.value?1:0;case"string":return 1;case"list":return 1}}function Pwe(e,t){if(t===null)return sK(zg(e.value),eD);switch(t.kind){case"int":return-1;case"string":return sK(zg(e.value),zg(t.value));case"list":return-1}}function Cwe(e,t){if(t===null)return e.items.length===0?0:Jk(e.items[0],null);switch(t.kind){case"int":return-1;case"string":return 1;case"list":{let n=Math.max(e.items.length,t.items.length);for(let r=0;rRe(t,e),compare:Ye,satisfies:(t,n)=>kK(t,n),sameCompatibilityLine:Nwe,classifyBump:rD,exactVersion:t=>_K(t,e)}}function Re(e,t){let n=e.trim();if(!n||/\s/.test(n))return null;if(hK.has(t)){let i=t==="go"||t==="swift"||t==="cocoapods"?n.replace(/^v(?=\d)/,""):n,o=Ys.default.valid(i);if(!o){let a=/^(\d+(?:\.\d+){0,1})([-+][0-9A-Za-z.-]+)?$/.exec(i);if(a){let c=a[1].split(".");o=Ys.default.valid(`${c.join(".")}${".0".repeat(3-c.length)}${a[2]??""}`)}}if(!o)return null;let s=Ys.default.parse(o);return{raw:n,ecosystem:t,prerelease:s.prerelease.length>0,comparable:{kind:"semver",value:o},release:[s.major,s.minor,s.patch]}}if(t==="pypi"){let r=SK(n);return r?{raw:n,ecosystem:t,prerelease:r.pre!==null||r.dev!==null,comparable:{kind:"pep440",value:r},release:r.release}:null}if(t==="rubygems"){if(!/^\d[0-9A-Za-z._-]*$/.test(n))return null;let r=Uwe(n);return{raw:n,ecosystem:t,prerelease:r.some(i=>typeof i=="string"),comparable:{kind:"ruby",value:r},release:Kwe(r)}}if(t==="maven"){if(!/^\d[0-9A-Za-z._+-]*$/.test(n))return null;let r=aK(n);return{raw:n,ecosystem:t,prerelease:uK(r),comparable:{kind:"maven",value:r},release:lK(r)}}if(t==="nuget"){let r=Bwe(n);return r?{raw:n,ecosystem:t,prerelease:r.prerelease!==null,comparable:{kind:"nuget",value:r},release:r.release}:null}if(t==="opam"){if(!/\d/.test(n))return null;let r=/^v?(\d+(?:\.\d+)*)/.exec(n)?.[1]?.split(".").map(Number)??null;return{raw:n,ecosystem:t,prerelease:/(?:^|[._+-])(?:alpha|beta|pre|preview|rc|dev)\d*/i.test(n),comparable:{kind:"opam",value:n},release:r}}return null}function Ye(e,t){if(e.ecosystem!==t.ecosystem||e.comparable.kind!==t.comparable.kind)return null;switch(e.comparable.kind){case"semver":return Ys.default.compare(e.comparable.value,t.comparable.value);case"pep440":return Bi(e.comparable.value,t.comparable.value);case"ruby":return zwe(e.comparable.value,t.comparable.value);case"maven":return cK(e.comparable.value,t.comparable.value);case"nuget":return Vwe(e.comparable.value,t.comparable.value);case"opam":return qwe(e.comparable.value,t.comparable.value)}}function Bg(e,t,n){if($K(n)){let s=tD(e),a=tD(t);return s&&a&&s===a?0:null}let r=Vi(n),i=r.parse(e),o=r.parse(t);return i&&o?r.compare(i,o):null}function yK(e,t,n){let r=Re(e,n);return r?kK(r,t):null}function nD(e,t,n){if(e===null&&t!==null)return"added";if(e!==null&&t===null)return"removed";if(e===null||t===null)return"unknown";let r=Re(e,n),i=Re(t,n);return r&&i?rD(r,i):"unknown"}function bK(e,t,n){if(e===null||t===null)return nD(e,t,n);let r=fK(e,n),i=fK(t,n);return r&&i?rD(r,i):"unknown"}function vK(e,t,n){if(!e||!t)return null;let r=Bg(t,e,n);return r===null?null:r<0}function wK(e,t,n){if(!e||!t||!hK.has(n))return!1;let r=Re(e,n),i=Re(t,n);return!!(r?.release&&i?.release&&r.release[0]===0&&i.release[0]===0&&r.release[1]!==i.release[1])}function rD(e,t){let n=Ye(e,t);if(n===null||n===0)return"unknown";let r=e.release,i=t.release;return!r||!i?"unknown":(r[0]??0)!==(i[0]??0)?"major":(r[1]??0)!==(i[1]??0)?"minor":(r[2]??0)!==(i[2]??0)?"patch":e.prerelease||t.prerelease?"prerelease":"unknown"}function Nwe(e,t){if(e.ecosystem!==t.ecosystem||!e.release||!t.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let n=e.release[0]??0;return n===0?(t.release[0]??0)===0&&(t.release[1]??0)===(e.release[1]??0):(t.release[0]??0)===n}function kK(e,t){let n=t.trim();if(!n||n==="*")return!0;if(e.comparable.kind==="semver"){let r=n;e.ecosystem==="cargo"&&/^v?\d+(?:\.\d+){0,2}$/.test(n)&&(r=`^${n}`);let i=Ys.default.validRange(r);return i?Ys.default.satisfies(e.comparable.value,i):null}if(e.comparable.kind==="pep440")return Lwe(e.comparable.value,e.raw,n);if(e.comparable.kind==="ruby")return Gwe(e,n);if(e.comparable.kind==="maven")return pK(e,n,/^([[(])\s*([^,]*)\s*,\s*([^\])]*?)\s*([\])])$/);if(e.comparable.kind==="nuget"){if(/^[[(]/.test(n))return pK(e,n,/^([[(])\s*([^,]*)\s*,?\s*([^\])]*?)\s*([\])])$/);let r=Re(n,"nuget"),i=r?Ye(e,r):null;return i===null?null:i>=0}return e.comparable.kind==="opam"?Hwe(e,n):null}function pK(e,t,n){let r=n.exec(t);if(!r){let c=Re(t,e.ecosystem),l=c?Ye(e,c):null;return l===null?null:l===0}let[,i,o,s,a]=r;if(o){let c=Re(o,e.ecosystem),l=c?Ye(e,c):null;if(l===null)return null;if(l<0||l===0&&i==="(")return!1}if(s){let c=Re(s,e.ecosystem),l=c?Ye(e,c):null;if(l===null)return null;if(l>0||l===0&&a===")")return!1}return!0}function _K(e,t){let n=e.trim();if($K(t))return tD(n);if(t==="npm")return Ys.default.valid(n)?n:null;if(t==="cargo"){let r=/^=\s*(v?\d+(?:\.\d+){2}(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)$/.exec(n);return r&&Re(r[1],t)?r[1]:null}if(t==="pypi"){let r=/^==\s*([^,;\s]+)$/.exec(n);return r&&!r[1].includes("*")&&Re(r[1],t)?r[1]:null}if(t==="rubygems"){let r=/^(?:=|==)\s*([^,\s]+)$/.exec(n);return r&&Re(r[1],t)?r[1]:null}if(t==="nuget"){let r=/^\[\s*([^,\]]+)\s*\]$/.exec(n);return r&&Re(r[1],t)?r[1]:null}return Re(n,t)?n:null}function tD(e){let t=e.trim();return!t||/\s/.test(t)||/[\[\]<>~=^*,|&]/.test(t)?null:t}function $K(e){return e==="conan"||e==="vcpkg"}function fK(e,t){let n=_K(e,t);if(n)return Re(n,t);let r=e.trim().match(/(?:^|[<>=~^\[(,{"'\s])(v?\d+(?:!\d+)?(?:\.\d+)*(?:(?:a|b|rc)\d+|[-.](?:alpha|beta|rc)[-.]?\d*)?)/i);return r?Re(r[1],t):null}var Dwe=/^v?(?:(?:(\d+)!)?(\d+(?:\.\d+)*)(?:[-_.]?(alpha|a|beta|b|preview|pre|c|rc)[-_.]?(\d+)?)?(?:(?:-(\d+))|(?:[-_.]?(post|rev|r)[-_.]?(\d+)?))?(?:[-_.]?(dev)[-_.]?(\d+)?)?)(?:\+([a-z0-9]+(?:[-_.][a-z0-9]+)*))?$/;function SK(e){let t=Dwe.exec(e.trim().toLowerCase());if(!t)return null;let n=t[3],r=n?/^(a|alpha)$/.test(n)?0:/^(b|beta)$/.test(n)?1:2:null;return{epoch:Number(t[1]??0),release:t[2].split(".").map(Number),pre:r===null?null:[r,Number(t[4]??0)],post:t[5]!==void 0?Number(t[5]):t[6]?Number(t[7]??0):null,dev:t[8]?Number(t[9]??0):null,local:t[10]?t[10].split(/[-_.]/).map(i=>/^\d+$/.test(i)?Number(i):i):null}}function ed(e){return{epoch:e.epoch,release:e.release,pre:null,post:null,dev:null,local:null}}function Gg(e){return e.local===null?e:{...e,local:null}}function mK(e){return e.pre!==null||e.dev!==null}function Bi(e,t){let n=Yk(e.epoch,t.epoch)||Zk(e.release,t.release);return n||(n=Owe(e,t),n)||(n=gK(e.post,t.post,-1),n)||(n=gK(e.dev,t.dev,1),n)?n:Mwe(e.local,t.local)}function Owe(e,t){let n=e.pre??(e.dev!==null&&e.post===null?[-1,0]:[3,0]),r=t.pre??(t.dev!==null&&t.post===null?[-1,0]:[3,0]);return Zk(n,r)}function Mwe(e,t){if(!e||!t)return e?1:t?-1:0;let n=Math.max(e.length,t.length);for(let r=0;ri.trim()).filter(Boolean);if(!r.length)return!0;for(let i of r){let o=Fwe(e,t,i);if(o!==!0)return o}return!0}function Fwe(e,t,n){let r=/^(===|~=|==|!=|<=|>=|<|>)\s*(.+)$/.exec(n);if(!r)return null;let i=r[1],o=r[2].trim();if(i==="===")return t.trim().toLowerCase()===o.toLowerCase();if(o.endsWith(".*")){if(i!=="=="&&i!=="!=")return null;let a=jwe(e,o.slice(0,-2));return a===null?null:i==="=="?a:!a}let s=SK(o);if(!s)return null;switch(i){case"==":return Bi(s.local===null?Gg(e):e,s)===0;case"!=":return Bi(s.local===null?Gg(e):e,s)!==0;case"<=":return Bi(Gg(e),s)<=0;case">=":return Bi(Gg(e),s)>=0;case"<":return!(Bi(e,s)>=0||!mK(s)&&mK(e)&&Bi(ed(e),ed(s))===0);case">":return!(Bi(e,s)<=0||s.post===null&&e.post!==null&&Bi(ed(e),ed(s))===0||e.local!==null&&Bi(ed(e),ed(s))===0);case"~=":{if(s.local!==null)return null;let a=s.pre===null?s.release.length:s.release.length+1;if(a<2)return null;if(Bi(Gg(e),s)<0)return!1;let c=s.release.slice(0,Math.min(a-1,s.release.length));return e.epoch===s.epoch&&c.every((l,u)=>(e.release[u]??0)===l)}default:return null}}function jwe(e,t){let n=/^v?(?:(\d+)!)?(\d+(?:\.\d+)*)$/.exec(t.trim());if(!n)return null;let r=Number(n[1]??0),i=n[2].split(".").map(Number);return e.epoch===r&&i.every((o,s)=>(e.release[s]??0)===o)}function Uwe(e){return e.replace(/-/g,".pre.").match(/[0-9]+|[A-Za-z]+/g)?.map(t=>/^\d+$/.test(t)?Number(t):t.toLowerCase())??[]}function zwe(e,t){let n=Math.max(e.length,t.length);for(let r=0;rr.trim()).filter(Boolean);if(!n.length)return!0;for(let r of n){let i=/^(~>|>=|<=|>|<|=|==)?\s*([^\s]+)$/.exec(r);if(!i)return null;let o=i[1]??"=",s=Re(i[2],"rubygems");if(!s)return null;let a=Ye(e,s);if((o==="="||o==="==")&&a!==0||o===">="&&a<0||o===">"&&a<=0||o==="<="&&a>0||o==="<"&&a>=0)return!1;if(o==="~>"){if(a<0||!s.release)return!1;let c=i[2].match(/\d+/g)?.length??0,l=[...s.release],u=c>=3?1:0;if(l[u]=(l[u]??0)+1,l.splice(u+1),Zk(e.release??[],l)>=0)return!1}}return!0}function Bwe(e){let t=/^[vV]?(\d+(?:\.\d+){0,3})(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z.-]+)?$/.exec(e);return t?{release:t[1].split(".").map(Number),prerelease:t[2]?t[2].toLowerCase().split(".").map(n=>/^\d+$/.test(n)?Number(n):n):null}:null}function Vwe(e,t){let n=Zk(e.release,t.release);if(n)return n;if(!e.prerelease||!t.prerelease)return e.prerelease?-1:t.prerelease?1:0;let r=Math.max(e.prerelease.length,t.prerelease.length);for(let i=0;ir==="~"?-1:r===void 0?0:/[A-Za-z]/.test(r)?r.charCodeAt(0):r.charCodeAt(0)+256;return Yk(n(e),n(t))}function Hwe(e,t){let r=t.trim().replace(/^\{\s*|\s*\}$/g,"").split(/\s*(?:&|&&)\s*/).filter(Boolean);if(!r.length)return null;for(let i of r){let o=/^(>=|<=|>|<|=)?\s*["']?([^"'\s]+)["']?$/.exec(i);if(!o)return null;let s=Re(o[2],"opam"),a=s?Ye(e,s):null;if(a===null)return null;let c=o[1]??"=";if(c==="="&&a!==0||c===">="&&a<0||c===">"&&a<=0||c==="<="&&a>0||c==="<"&&a>=0)return!1}return!0}function Kwe(e){let t=[];for(let n of e){if(typeof n!="number")break;t.push(n)}return t.length?t:null}function Zk(e,t){let n=Math.max(e.length,t.length);for(let r=0;rt?1:0}function Jwe(e){if(!e)return null;let t=e.trim();if(!t)return null;let n=/^npm:(?:@[^/]+\/)?[^@]+@(.+)$/i.exec(t);if(n)t=n[1].trim();else if(/^(git|github|file|link|workspace|npm|https?):/i.test(t))return null;return t==="*"||t==="latest"||t===""?null:(t=t.split(/\|\||,/)[0].trim(),t=t.replace(/^[\^~><=!]+\s*/,"").replace(/^[[(]\s*/,""),t=t.split(/\s+/)[0].trim(),t=t.replace(/^v/i,"").replace(/[\])]$/,""),t=t.replace(/\+incompatible$/,""),t||null)}function Xk(e){let t=Jwe(e);return t?Qk.default.valid(t)??Qk.default.valid(Qk.default.coerce(t)??"")??null:null}function Qs(e,t,n="npm"){return nD(e,t,n)}function Vg(e,t,n="npm"){return vK(e,t,n)===!0}function qg(e,t,n="npm"){return wK(e,t,n)}function ye(e){let t=e.split("/");return(t[t.length-1]??"").toLowerCase()}function Bt(e){try{return JSON.parse(e)}catch{return null}}var EK={ecosystem:"arduino",name:"arduino",handles(e){let t=ye(e);return t==="library.properties"||t==="platformio.ini"},isLockfile(){return!1},parse(e,t){return ye(t)==="platformio.ini"?Qwe(e):Zwe(e)}};function Zwe(e){let t=new Map;for(let n of e.split(` +`)){let r=n.trim();if(r.startsWith("#"))continue;let i=/^depends\s*=\s*(.*)$/i.exec(r);if(i)for(let o of i[1].split(",")){let s=Ywe(o);s&&t.set(s.name,{version:s.version,kind:"runtime"})}}return t}function Ywe(e){let t=e.trim();if(!t)return null;let n=/^(.*?)\s*\(([^)]*)\)\s*$/.exec(t);if(n){let r=n[1].trim(),i=n[2].trim();return r?{name:r,version:i||null}:null}return{name:t,version:null}}function Qwe(e){let t=new Map,n=e.split(` +`),r=!1;for(let i of n){let o=i.split(/\s+[;#]/)[0],s=o.trim();if(/^\[/.test(s)){r=!1;continue}let a=/^(lib_deps[\w.]*|lib_extra_dirs|lib_ignore)\s*=\s*(.*)$/.exec(s);if(a){r=a[1].startsWith("lib_deps"),r&&a[2]&&xK(t,a[2],"runtime");continue}if(r&&/^\s/.test(o)&&s!==""){xK(t,s,"runtime");continue}s!==""&&(r=!1)}return t}function xK(e,t,n){let r=t.trim();if(!r||/^[a-z+]+:\/\//i.test(r)||r.startsWith("file://")||r.startsWith(".")||r.includes("${")||/\.(git|zip|tar\.gz)$/i.test(r))return;let i=r.lastIndexOf("@"),o=i>0,s=o?r.slice(0,i):r,a=o?r.slice(i+1).trim():null,c=s.lastIndexOf("/"),l=(c===-1?s:s.slice(c+1)).trim();l&&e.set(l,{version:a||null,kind:n})}function di(e){let t=[],n={header:"",entries:new Map,lines:[]};t.push(n);let r=e.split(` +`);for(let i=0;itd(u,"]")){let d=td(u,"[")-td(u,"]");for(;d>0&&i+1n.header===t)}function Wg(e){let t=e.trim().replace(/^\[/,"").replace(/\]$/,""),n=[];for(let r of t.matchAll(/"((?:[^"\\]|\\.)*)"|'([^']*)'/g)){let i=r[1]??r[2];i!==void 0&&n.push(i)}return n}function nd(e){let t=e.trim();return t.startsWith("{")?/(?:^|[{,]\s*)version\s*=\s*"([^"]*)"/.exec(t)?.[1]??null:/^"([^"]*)"$/.exec(t)?.[1]??/^'([^']*)'$/.exec(t)?.[1]??null}function e_(e){return e.replace(/^["']|["']$/g,"")}function TK(e){let t=!1,n=!1;for(let r=0;r<=!]*\s*\d[^"']*)["']/g)].map(f=>f[1].trim()).filter(f=>!/^https?:/.test(f)),d=/:(path|git|podspec|svn|hg)\s*(?:=>|:)/.test(c)||l.length===0?null:l.join(", "),p=n.some(f=>/test|spec|uitest/i.test(f))?"dev":"runtime";t.set(a,{version:d,kind:p})}return t}function uke(e){let t=new Map,n=!1;for(let r of e.split(` +`)){let i=r.replace(/\r$/,"");if(!i.trim())continue;if(/^[A-Z][A-Z ]*:\s*$/.test(i.trim())&&!/^\s/.test(i)){n=i.trim()==="PODS:";continue}if(!n)continue;let o=/^ {2}- "?([\w.+/-]+)"? \(([^)]+)\)/.exec(i);o&&t.set(o[1],{version:o[2],kind:"transitive"})}return t}function dke(e){let t=new Map,n=/\.dependency\s+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let r of e.matchAll(n))t.set(r[1],{version:r[2]??null,kind:"runtime"});return t}function pke(e){let t=!1,n=!1;for(let r=0;ru.includes("indirect")?u:"").trim(),s=i.trim();if(/^require\s*\($/.test(s)){n=!0;continue}if(/^replace\s*\($/.test(s)||/^exclude\s*\($/.test(s)){r=!0;continue}if(s===")"){n=!1,r=!1;continue}if(r||s.startsWith("replace ")||s.startsWith("exclude "))continue;let a=/^require\s+(\S+)\s+(\S+)/.exec(s);if(a){t.set(a[1],{version:a[2],kind:"runtime"});continue}if(!n)continue;let c=/^(\S+)\s+(v\S+)/.exec(o||s);if(!c)continue;let l=s.includes("// indirect");t.set(c[1],{version:c[2],kind:l?"transitive":"runtime"})}return t}function hke(e){let t=new Map;for(let n of e.split(` +`)){let r=n.trim().split(/\s+/);if(r.length<3)continue;let[i,o]=r;o.endsWith("/go.mod")||t.set(i,{version:o,kind:"transitive"})}return t}var FK={ecosystem:"hex",name:"Mix",handles(e){let t=ye(e);return t==="mix.exs"||t==="mix.lock"||t==="rebar.config"},isLockfile(e){return ye(e)==="mix.lock"},parse(e,t){let n=ye(t);return n==="mix.lock"?bke(e):n==="rebar.config"?vke(e):yke(e)}};function yke(e){let t=new Map;for(let n of e.matchAll(/\{\s*:([a-z_][a-zA-Z0-9_]*)\s*(,[^}]*)?\}/g)){let r=n[1],i=n[2]??"",o=/^,\s*"([^"]+)"/.exec(i)?.[1]??null,s=/\b(path|git|github|hg|svn):\s*/.test(i),a=s?null:o;if(!o&&!s&&!/\b(only|runtime|optional|app|manager):/.test(i))continue;let c=/\bonly:\s*(\[[^\]]*\]|:[a-z_]+)/.exec(i)?.[1]??"",l=/:(dev|test)\b/.test(c)?"dev":"runtime";t.set(r,{version:a,kind:l})}return t}function bke(e){let t=new Map,n=/"([a-z_][a-zA-Z0-9_]*)"\s*:\s*\{\s*:hex\s*,\s*:[a-zA-Z0-9_]+\s*,\s*"([^"]+)"/g;for(let r of e.matchAll(n))t.set(r[1],{version:r[2],kind:"transitive"});return t}function vke(e){let t=new Map,n=/\{\s*deps\s*,\s*\[/.exec(e);if(!n)return t;let r=1,i=n.index+n[0].length;for(;i0;i++)e[i]==="["?r+=1:e[i]==="]"&&(r-=1);let o=e.slice(n.index+n[0].length,i-1);for(let s of o.matchAll(/\{\s*([a-z_][a-zA-Z0-9_]*)\s*,\s*"([^"]+)"/g))t.set(s[1],{version:s[2],kind:"runtime"});for(let s of o.matchAll(/(?:^|[[,])\s*([a-z_][a-zA-Z0-9_]*)\s*(?=[,\]]|$)/g))t.has(s[1])||t.set(s[1],{version:null,kind:"runtime"});return t}var jK={ecosystem:"maven",name:"maven/gradle",handles(e){let t=ye(e);return t==="pom.xml"||t==="build.gradle"||t==="build.gradle.kts"||t==="libs.versions.toml"||t==="gradle.lockfile"},isLockfile(e){return ye(e)==="gradle.lockfile"},parse(e,t){let n=ye(t);return n==="pom.xml"?wke(e):n==="gradle.lockfile"?xke(e):n==="libs.versions.toml"?Ske(e):$ke(e)}};function wke(e){let t=new Map,n=_ke(e),r=kke(e,n);for(let i of e.matchAll(/([\s\S]*?)<\/dependency>/g)){let o=i[1],s=Xs(o,"groupId"),a=Xs(o,"artifactId");if(!s||!a)continue;let c=`${s}:${a}`,u=UK(Xs(o,"version"),n)??r.get(c)??null,d=Xs(o,"scope"),f=Xs(o,"optional")==="true"?"optional":d==="test"||d==="provided"?"dev":"runtime",m=t.get(c);t.set(c,{version:u??m?.version??null,kind:f})}return t}function kke(e,t){let n=new Map;for(let r of e.matchAll(/([\s\S]*?)<\/dependencyManagement>/g))for(let i of r[1].matchAll(/([\s\S]*?)<\/dependency>/g)){let o=i[1],s=Xs(o,"groupId"),a=Xs(o,"artifactId"),c=UK(Xs(o,"version"),t);s&&a&&c&&n.set(`${s}:${a}`,c)}return n}function _ke(e){let t=new Map;for(let n of e.matchAll(/([\s\S]*?)<\/properties>/g))for(let r of n[1].matchAll(/<([\w.-]+)>([^<]*)<\/\1>/g))t.set(r[1],r[2].trim());return t}function UK(e,t){if(!e)return null;let n=e;for(let r=0;r<2;r++)n=n.replace(/\$\{([^}]+)\}/g,(i,o)=>t.get(o)??i);return n.includes("${")?null:n.trim()||null}function Xs(e,t){return new RegExp(`<${t}>([^<]*)`).exec(e)?.[1]?.trim()??null}function $ke(e){let t=new Map,n="(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testCompileOnly|annotationProcessor|kapt|ksp)";for(let r of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*["']([^"']+:[^"']+)["']`,"g"))){let i=r[1].split(":");if(i.length<2)continue;let[o,s,a]=i,c=/test|androidTest/i.test(r[0]);t.set(`${o}:${s}`,{version:a??null,kind:c?"dev":"runtime"})}for(let r of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*group:\\s*["']([^"']+)["'],\\s*name:\\s*["']([^"']+)["'](?:,\\s*version:\\s*["']([^"']+)["'])?`,"g")))t.set(`${r[1]}:${r[2]}`,{version:r[3]??null,kind:/test/i.test(r[0])?"dev":"runtime"});return t}function Ske(e){let t=new Map,n=new Map,r="";for(let i of e.split(` +`)){let o=i.split("#")[0].trim();if(!o)continue;let s=/^\[([^\]]+)\]$/.exec(o)?.[1];if(s){r=s;continue}if(r==="versions"){let m=/^([\w.-]+)\s*=\s*["']([^"']+)["']/.exec(o);m&&n.set(m[1],m[2]);continue}if(r!=="libraries")continue;let a=/module\s*=\s*["']([^"']+)["']/.exec(o)?.[1],c=/group\s*=\s*["']([^"']+)["']/.exec(o)?.[1],l=/name\s*=\s*["']([^"']+)["']/.exec(o)?.[1],u=a??(c&&l?`${c}:${l}`:null);if(!u)continue;let d=/version\s*=\s*["']([^"']+)["']/.exec(o)?.[1],p=/version\.ref\s*=\s*["']([^"']+)["']/.exec(o)?.[1],f=d??(p?n.get(p)??null:null);t.set(u,{version:f,kind:"runtime"})}return t}function xke(e){let t=new Map;for(let n of e.split(` +`)){let r=n.trim();if(!r||r.startsWith("#"))continue;let o=r.split("=")[0].split(":");o.length<3||t.set(`${o[0]}:${o[1]}`,{version:o[2],kind:"transitive"})}return t}var GK=gt(rc(),1);var Eke=new Set(["package.json"]),zK=new Set(["package-lock.json","npm-shrinkwrap.json","yarn.lock","pnpm-lock.yaml","bun.lock"]),BK={ecosystem:"npm",name:"npm/yarn/pnpm",handles(e){let t=ye(e);return e.includes("node_modules/")?!1:Eke.has(t)||zK.has(t)},isLockfile(e){return zK.has(ye(e))},parse(e,t){let n=ye(t);return n==="package.json"?Ake(e):n==="yarn.lock"?Nke(e):n==="pnpm-lock.yaml"?Dke(e):n==="bun.lock"?Tke(e):Rke(e)}};function Tke(e){let t=new Map,n=Bt(Ike(e));if(!n?.packages)return t;for(let r of Object.values(n.packages)){let i=Array.isArray(r)?r[0]:r;if(typeof i!="string")continue;let o=i.lastIndexOf("@");if(o<=0)continue;let s=i.slice(0,o),a=i.slice(o+1);/^\d/.test(a)&&t.set(s,{version:a,kind:"transitive"})}return t}function Ike(e){let t="",n=!1;for(let r=0;ro.split(/[.+-]/).map(s=>Number.parseInt(s,10)),r=n(e),i=n(t);for(let o=0;oa}return!1}function Nke(e){let t=new Map,n=null;for(let r of e.split(` +`)){let i=r.replace(/\r$/,"");if(!i.trim()||i.startsWith("#"))continue;if(!/^\s/.test(i)){let s=i.replace(/:\s*$/,"").split(",")[0].trim().replace(/^"|"$/g,"");n=qK(s);continue}let o=/^\s+version:?\s+"?([^"\s]+)"?/.exec(i)?.[1];if(o&&n){let s=t.get(n);(!s||VK(o,s.version??""))&&t.set(n,{version:o,kind:"transitive"}),n=null}}return t}function Dke(e){let t=new Map,n;try{n=(0,GK.parse)(e)}catch{return t}let r=n?.packages;if(!r||typeof r!="object")return t;for(let i of Object.keys(r)){let o=i.startsWith("/")?i.slice(1):i,s=qK(o),a=Oke(o);if(!s||!a)continue;let c=t.get(s);(!c||VK(a,c.version??""))&&t.set(s,{version:a,kind:"transitive"})}return t}function qK(e){let t=e.lastIndexOf("@");return t<=0?e||null:e.slice(0,t)||null}function Oke(e){let t=e.lastIndexOf("@");return t<=0?null:e.slice(t+1).split("(")[0]||null}var HK={ecosystem:"nuget",name:"NuGet",handles(e){let t=ye(e);return/\.(cs|fs|vb)proj$/.test(t)||t==="directory.packages.props"||t==="directory.build.props"||t==="packages.lock.json"||t==="packages.config"||t.endsWith(".nuspec")},isLockfile(e){return ye(e)==="packages.lock.json"},parse(e,t){let n=ye(t);return n==="packages.lock.json"?Lke(e):n==="packages.config"?Fke(e):n.endsWith(".nuspec")?jke(e):Mke(e)}};function Mke(e){let t=new Map,n=/<(PackageReference|PackageVersion|GlobalPackageReference)\b([^>]*?)(\/>|>([\s\S]*?)<\/\1>)/g;for(let r of e.matchAll(n)){let i=r[2]??"",o=r[4]??"",s=ho(i,"Include")??ho(i,"Update");if(!s)continue;let a=ho(i,"Version")??ho(i,"VersionOverride")??WK(o,"Version"),c=a&&!a.includes("$(")?a:null,u=(ho(i,"PrivateAssets")??WK(o,"PrivateAssets"))?.toLowerCase()==="all"?"dev":"runtime";t.set(s,{version:c,kind:u})}return t}function Lke(e){let t=new Map,n=Bt(e);if(!n?.dependencies)return t;for(let r of Object.values(n.dependencies))if(!(!r||typeof r!="object"))for(let[i,o]of Object.entries(r)){let s=o?.resolved??null;if(!s)continue;let a=o.type==="Direct"?"runtime":"transitive";t.get(i)?.kind==="runtime"&&a==="transitive"||t.set(i,{version:s,kind:a})}return t}function Fke(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let r=n[1]??"",i=ho(r,"id");if(!i)continue;let o=ho(r,"developmentDependency");t.set(i,{version:ho(r,"version"),kind:o?.toLowerCase()==="true"?"dev":"runtime"})}return t}function jke(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let r=n[1]??"",i=ho(r,"id");i&&t.set(i,{version:ho(r,"version"),kind:"runtime"})}return t}function ho(e,t){let n=new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i").exec(e);return(n?.[2]??n?.[3])?.trim()||null}function WK(e,t){return new RegExp(`<${t}\\s*>([^<]*)`,"i").exec(e)?.[1]?.trim()||null}var KK={ecosystem:"opam",name:"opam",handles(e){let t=ye(e);return t.endsWith(".opam")||t.endsWith(".opam.locked")||t==="dune-project"},isLockfile(e){return ye(e).endsWith(".opam.locked")},parse(e,t){if(ye(t)==="dune-project")return Uke(e);let n=ye(t).endsWith(".opam.locked");return qke(e,n)}};function Uke(e){let t=new Map;for(let n of Gke(e,"depends"))for(let r of Bke(n)){let i=/^\(\s*([\w.+-]+)([\s\S]*)\)$/.exec(r),o=i?.[1]??(/^[\w.+-]+$/.test(r)?r:void 0);if(!o)continue;let s=i?.[2]??"",a=/:with-test|:with-doc|:dev/.test(s)?"dev":"runtime";t.set(o,{version:zke(s),kind:a})}return t}function zke(e){let t=[...e.matchAll(/([<>=]+)\s*([\w.~+-]+)/g)].map(n=>`${n[1]} ${n[2]}`);return t.length===0?null:t.length===1&&t[0].startsWith("= ")?t[0].slice(2):t.join(" & ")}function Gke(e,t){let n=[],r=new RegExp(`\\(\\s*${t}\\b`,"g");for(let i of e.matchAll(r)){let o=1,s=i.index+i[0].length,a=s;for(;s0;s++){let c=e[s];c==="("?o+=1:c===")"&&(o-=1)}n.push(e.slice(a,s-1))}return n}function Bke(e){let t=[],n="",r=0;for(let i of e){if(i==="("?r+=1:i===")"&&(r-=1),r===0&&/\s/.test(i)){n.trim()&&t.push(n.trim()),n="";continue}n+=i}return n.trim()&&t.push(n.trim()),t}var Vke={depends:"runtime",depopts:"optional"};function qke(e,t){let n=new Map;for(let[r,i]of Object.entries(Vke))for(let o of Hke(e,r))for(let s of Kke(o)){let a=/^"([^"]+)"/.exec(s)?.[1];if(!a)continue;let c=/\{([\s\S]*)\}/.exec(s)?.[1]??"",l=/\bwith-test\b|\bwith-doc\b|\bdev\b/.test(c)?"dev":i;n.set(a,{version:Wke(c),kind:t?"transitive":l})}return n}function Wke(e){if(!e.trim())return null;let t=[...e.matchAll(/([<>=!]+)\s*"([^"]+)"/g)].map(r=>`${r[1]} ${r[2]}`);return t.length===0?null:/^=\s/.exec(t[0])&&t.length===1?t[0].slice(2):t.join(" & ")}function Hke(e,t){let n=[],r=new RegExp(`(?:^|\\n)\\s*${t}\\s*:\\s*\\[`,"g");for(let i of e.matchAll(r)){let o=1,s=i.index+i[0].length,a=s;for(;s0;s++){let c=e[s];if(c==='"'){for(s+=1;sr))continue;if(c")return t_(e);for(let i=n+1;i{i&&o&&t.set(i,{version:o,kind:s}),i=null,o=null,s="transitive"};for(let c of n){let l=oD(c.replace(/\r$/,""));if(!l.trim())continue;let u=l.length-l.trimStart().length;if(u===0){a(),r=/^packages\s*:/.test(l.trim());continue}if(!r)continue;if(u===2){a(),i=/^\s*"?([A-Za-z_][\w.-]*)"?\s*:/.exec(l)?.[1]??null;continue}if(!i)continue;let d=/^\s*([A-Za-z_][\w-]*)\s*:(.*)$/.exec(l);if(d){if(d[1]==="version")o=t_(d[2].trim())||null;else if(d[1]==="dependency"){let p=t_(d[2].trim());s=p.startsWith("direct dev")?"dev":p.startsWith("direct")?"runtime":"transitive"}}}return a(),t}function oD(e){let t=!1,n=!1;for(let r=0;r=!~,(\[@]/.test(r)?null:{name:i,version:r||null}}function Ng(e){return e.trim().toLowerCase().replace(/[-_.]+/g,"-")}function Wve(e){let t=new Map,n=e.split(` -`),i=Ok(e),r=n.filter(s=>{let a=s.trim();return a!==""&&!a.startsWith("#")&&!a.startsWith("-")}),o=r.filter(s=>Rg(s)!==null).length;if(r.length>=5&&o/r.length<.7)return t;for(let s=0;so.length&&n.endsWith(o))return{version:n.slice(0,-o.length),platform:r}}let i=n.split("-");for(let r=1;r/^[a-z0-9_.]+$/.test(i))}var uH={ecosystem:"rubygems",name:"bundler",handles(e){let t=me(e);return t==="gemfile"||t==="gemfile.lock"||t.endsWith(".gemspec")},isLockfile(e){return me(e)==="gemfile.lock"},parse(e,t){let n=me(t);return n==="gemfile.lock"?nwe(e):n.endsWith(".gemspec")?rwe(e):twe(e)}};function twe(e){let t=new Map,n=[];for(let i of e.split(` -`)){let r=i.split("#")[0].trim();if(!r)continue;let o=/^group\s+(.+?)\s+do$/.exec(r);if(o){n.push(o[1]);continue}if(r==="end"&&n.length){n.pop();continue}let s=/^gem\s+["']([^"']+)["'](.*)$/.exec(r);if(!s)continue;let a=s[1],c=s[2]??"",l=[...c.matchAll(/["']([~><=!]*\s*[\d][^"']*)["']/g)].map(m=>m[1].trim()),u=l.length?l.join(", "):null,d=/\bgroups?:\s*\[?\s*:?([\w,\s:]+)/.exec(c)?.[1]??"",p=`${n.join(" ")} ${d}`,f=/development|test/.test(p)?"dev":"runtime";t.set(a,{version:u,kind:f})}return t}function nwe(e){let t=new Map,n=cH(e),i=!1;for(let r of e.split(` -`)){let o=r.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(o)){i=!0;continue}if(o.trim()&&!/^\s/.test(o)){i=!1;continue}if(!i)continue;let s=/^ {4}([A-Za-z0-9_.-]+) \(([^)]+)\)$/.exec(o);if(!s)continue;let a=lH(s[2],n);t.set(s[1],{version:a.version,kind:"transitive",...a.platform?{platform:a.platform}:{}})}return t}function rwe(e){let t=new Map,n=/add_(development_|runtime_)?dependency[\s(]+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let i of e.matchAll(n))t.set(i[2],{version:i[3]??null,kind:i[1]==="development_"?"dev":"runtime"});return t}var dH={ecosystem:"maven",name:"sbt",handles(e){return me(e).endsWith(".sbt")?!0:/(^|\/)project\/[\w-]+\.scala$/.test(e.toLowerCase())},isLockfile(){return!1},parse(e){return owe(e)}};function iwe(e){let t=e.trim().split(".");return t[0]==="3"?"3":t.length>=2?`${t[0]}.${t[1]}`:e.trim()}function owe(e){let t=new Map,n=/\bscalaVersion\s*(?::=|\+=)\s*"([^"]+)"/.exec(e)?.[1],i=n?`_${iwe(n)}`:"",r=new Map;for(let s of e.matchAll(/\bval\s+([A-Za-z_]\w*)\s*=\s*"([^"]+)"/g))r.set(s[1],s[2]);let o=/"([\w.-]+)"\s*(%%%|%%|%)\s*"([\w.-]+)"\s*%\s*(?:"([^"]+)"|([A-Za-z_]\w*))((?:\s*%\s*"[A-Za-z]+")?)/g;for(let s of e.matchAll(o)){let a=s[1],c=s[2],l=s[3],u=s[4],d=s[5],p=s[6]??"",f=c==="%%"?`${a}:${l}${i}`:`${a}:${l}`,m=u??(d?r.get(d)??null:null),g=/"(test|it)"/i.test(p)||/"provided"/i.test(p)?"dev":/"optional"/i.test(p)?"optional":"runtime";t.set(f,{version:m,kind:g})}for(let s of e.matchAll(/addSbtPlugin\s*\(\s*"([\w.-]+)"\s*%\s*"([\w.-]+)"\s*%\s*"([^"]+)"/g))t.set(`${s[1]}:${s[2]}`,{version:s[3],kind:"dev"});return t}var pH={ecosystem:"swift",name:"Swift Package Manager",handles(e){let t=me(e);return t==="package.resolved"||/^package(@swift-[\d.]+)?\.swift$/.test(t)},isLockfile(e){return me(e)==="package.resolved"},parse(e,t){return me(t)==="package.resolved"?cwe(e):swe(e)}};function swe(e){let t=new Map;for(let n of e.matchAll(/\.package\s*\(([\s\S]*?)\)\s*[,\]]/g)){let i=n[1]??"",r=/\burl\s*:\s*"([^"]+)"/.exec(i)?.[1],o=/\bpath\s*:\s*"([^"]+)"/.exec(i)?.[1];if(!r&&o)continue;let s=/\bid\s*:\s*"([^"]+)"/.exec(i)?.[1],a=r?fH(r):s;a&&t.set(a,{version:awe(i),kind:"runtime"})}return t}function awe(e){let t=/\bexact\s*:\s*"([^"]+)"/.exec(e)?.[1];if(t)return t;let n=/\bfrom\s*:\s*"([^"]+)"/.exec(e)?.[1];if(n)return`^${n}`;let i=/\.upToNextMajor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(i)return`^${i}`;let r=/\.upToNextMinor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(r)return`~${r}`;let o=/"([^"]+)"\s*\.\.[.<]\s*"([^"]+)"/.exec(e);return o?`>=${o[1]} <${o[2]}`:null}function cwe(e){let t=new Map,n=Gt(e);if(!n)return t;for(let i of n.pins??n.object?.pins??[]){let r=i.location??i.repositoryURL,o=r?fH(r):i.identity??i.package;if(!o)continue;let s=i.state?.version??null;t.set(o,{version:s,kind:"transitive"})}return t}function fH(e){let t=e.trim().replace(/\.git$/,"").replace(/\/+$/,"");if(!t)return null;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)$/.exec(t);return n?`${n[1]}/${n[2]}`:t.split("/").pop()||null}var mH={ecosystem:"vcpkg",name:"vcpkg",handles(e){let t=me(e);return t==="vcpkg.json"||t==="vcpkg-configuration.json"},isLockfile(){return!1},parse(e){let t=new Map,n=Gt(e);if(!n)return t;for(let r of n.dependencies??[]){if(typeof r=="string"){t.set(r,{version:null,kind:"runtime"});continue}r.name&&t.set(r.name,{version:r["version>="]?`>=${r["version>="]}`:null,kind:r.host?"dev":"runtime"})}for(let r of n.overrides??[]){if(!r.name)continue;let o=r.version??r["version-string"]??r["version-semver"]??null,s=t.get(r.name);t.set(r.name,{version:o,kind:s?.kind??"runtime"})}let i=n["builtin-baseline"]??n.registries?.find(r=>r.baseline)?.baseline;return i&&t.set(lwe,{version:i,kind:"transitive"}),t}},lwe="vcpkg-baseline";var gH=[YW,aH,qW,jW,dH,HW,uH,tH,VW,WW,iH,pH,GW,nH,zW,mH,DW];function hH(e){return gH.some(t=>t.handles(e))}function Mk(e){return gH.find(t=>t.handles(e))}function yH(e){let t=new Map;for(let n of e){let i=Mk(n.path);if(!i)continue;let r=n.before?i.parse(n.before,n.path):new Map,o=n.after?i.parse(n.after,n.path):new Map,s=i.isLockfile(n.path);for(let a of new Set([...r.keys(),...o.keys()])){let c=r.get(a),l=o.get(a),u=c?.version??null,d=l?.version??null;if(u===d)continue;let p=Gi(i.ecosystem),f=u===null?null:p.exactVersion(u),m=d===null?null:p.exactVersion(d);if((f&&m?Eg(f,m,i.ecosystem):null)===0)continue;if(i.ecosystem==="npm"&&!f&&!m){let _=Ck(u),S=Ck(d);if(_&&_===S)continue}let h=l?.kind??c?.kind??"runtime",b=s&&h==="runtime"?"transitive":h,y={name:a,ecosystem:i.ecosystem,from:f,to:m,kind:b,bump:f&&m?ta(f,m,i.ecosystem):EW(u,d,i.ecosystem),manifestPath:n.path,rawFrom:u,rawTo:d,source:s?"lockfile":"manifest"},w=`${i.ecosystem}:${uwe(n.path)}:${a}`,k=t.get(w);if(k&&k.source!==y.source){let _=k.source==="manifest"?k:y,S=k.source==="lockfile"?k:y,x=S.from??_.from,E=S.to??_.to;t.set(w,{..._,from:x,to:E,bump:ta(x,E,i.ecosystem)})}else(!k||dwe(k,y,s))&&t.set(w,y)}}return[...t.values()].sort((n,i)=>n.ecosystem.localeCompare(i.ecosystem)||n.name.localeCompare(i.name))}function uwe(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function dwe(e,t,n){let i=e.source==="lockfile";return i&&!n?!0:!i&&n?!1:t.from!==null&&t.to!==null&&(e.from===null||e.to===null)}function bH(e,t){let n=[],i=[],r=new Set(t.ecosystems);for(let o of e){let s=pwe(o,t,r);s?i.push({change:o,reason:s}):n.push(o)}return{actionable:n,skipped:i}}function pwe(e,t,n){if(!n.has(e.ecosystem))return`ecosystem "${e.ecosystem}" is not enabled in drift.yml`;if(Yo(t.ignore,e.name))return"matched an `ignore` pattern in drift.yml";if(e.rawTo!==null&&e.rawTo!==void 0&&e.to===null)return"target manifest range has no exact resolved registry version";if(e.rawFrom!==null&&e.rawFrom!==void 0&&e.from===null)return"previous manifest range has no exact resolved registry version";if(e.to===null)return"dependency was removed; removals need no compatibility fix";if(e.kind==="dev"&&!t.triggerOn.dev)return"dev dependency (enable `triggerOn.dev` to analyse these)";if(e.kind==="transitive"&&!t.triggerOn.transitive)return"transitive dependency (enable `triggerOn.transitive` to analyse these)";if(e.from===null)return"newly added dependency; there is no prior version to break against";let i=Ig(e.from,e.to,e.ecosystem);return e.bump==="major"&&!t.triggerOn.major?"major bumps are disabled in drift.yml (enable `triggerOn.major` to include these)":e.bump==="minor"&&!t.triggerOn.minor&&!i?"minor bumps are disabled in drift.yml (enable `triggerOn.minor` to include these)":e.bump==="patch"&&!t.triggerOn.patch?"patch bumps are disabled in drift.yml (enable `triggerOn.patch` to include these)":e.bump==="prerelease"&&!t.triggerOn.patch?"prerelease moves are disabled in drift.yml (enable `triggerOn.patch`)":null}var Mg=gt(Dc(),1);var _d=require("node:crypto"),Vi=require("node:fs/promises"),yP=require("node:path");var xH=require("node:fs"),ra=require("node:os");var vH=require("node:async_hooks");var fwe=[/\bAuthorization\s*:\s*[^\n]+/gi,/\bBearer\s+\S+/gi,/\bgh[oprsu]_[A-Za-z0-9]{10,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{10,}\b/g,/\bsk-[A-Za-z0-9][A-Za-z0-9_-]{9,}/g];function mwe(e){let t=e;for(let n of fwe)t=t.replace(n,"[REDACTED]");return t}function gwe(e){return mwe(e instanceof Error?e.message:String(e))}var wH=new vH.AsyncLocalStorage;function Qo(){return wH.getStore()}function Vt(){return Qo()?.state.now()??0}function Cg(){let e=Qo();return e!==void 0&&!e.state.finished}function kH(e){Qo()?.state.httpRequests.push(e)}function $H(e){Qo()?.state.httpAttempts.push(e)}function uP(e){Qo()?.state.execCommands.push(e)}function hwe(){return{hits:0,misses:0,writes:0,memoryHits:0,diskHits:0,coalescedHits:0,revalidated304:0}}function Rr(e,t,n=!1){let i=Qo()?.state;if(!i)return;let r=i.caches.get(e)??hwe();if(typeof t=="boolean"){t?r.hits+=1:r.misses+=1,n&&(r.writes+=1),i.caches.set(e,r);return}t==="memory_hit"?(r.memoryHits+=1,r.hits+=1):t==="disk_hit"?(r.diskHits+=1,r.hits+=1):t==="coalesced_hit"?(r.coalescedHits+=1,r.hits+=1):t==="revalidated_304"?r.revalidated304+=1:t==="miss"?r.misses+=1:t==="write"&&(r.writes+=1),i.caches.set(e,r)}function _H(e,t=1){let n=Qo()?.state;n&&n.counters.set(e,(n.counters.get(e)??0)+t)}var ywe=Object.freeze({end(){},fail(){}});function SH(e,t,n,i){let r=t!==null?e.spans.find(s=>s.id===t):void 0,o={id:e.nextSpanId++,parentId:t,depth:r?r.depth+1:0,name:n,startMs:e.now(),endMs:null,meta:{...i},status:"ok"};return e.spans.push(o),o}function Lk(e,t,n,i,r){e.endMs===null&&(e.endMs=t.now(),n==="error"?(e.status="error",e.error=gwe(i),Object.assign(e.meta,r)):Object.assign(e.meta,i))}function Mc(e,t){let n=Qo();if(!n||n.state.finished)return ywe;let{state:i}=n,r=SH(i,n.parentId,e,t),o=!1;return{end(s){o||(o=!0,Lk(r,i,"ok",s))},fail(s,a){o||(o=!0,Lk(r,i,"error",s,a))}}}async function Br(e,t,n){let i=Qo();if(!i||i.state.finished)return n();let{state:r}=i,o=SH(r,i.parentId,e,t);try{let s=await wH.run({state:r,parentId:o.id},n);return Lk(o,r,"ok"),s}catch(s){throw Lk(o,r,"error",s),s}}var bwe=Object.freeze({end(){}}),$d=process.env.DRIFT_PROFILE,bo=!!$d&&$d!=="0"&&$d!=="false",EH=[],pP=new Map,vwe=bo?Date.now():0,wwe=bo?performance.now():0;function fP(){return performance.now()-wwe}function Pg(){return bo}function kwe(e,t,n){return{operation:t,...new Set(["surface","surface-sources","surface-deps","evidence"]).has(e)?{package:t}:{},...n}}var dP=100,$we=50;function _we(){if(!Cg())return()=>{};let e=performance.now()+dP,t=setInterval(()=>{let n=performance.now(),i=Math.max(0,n-e);if(e=n+dP,i<$we||!Cg())return;Mc("event-loop.lag",{lagMs:Math.round(i)}).end()},dP);return t.unref(),()=>clearInterval(t)}function It(e,t,n){let i=Cg();if(!bo&&!i)return bwe;let r=bo?fP():0,o=i?Mc(`work.${e}`,kwe(e,t,n)):null,s=i&&e==="scan"&&t==="total"?_we():null,a=!1;return{end(c){a||(a=!0,bo&&EH.push({cat:e,name:t,start:r,end:fP(),...n||c?{meta:{...n,...c}}:{}}),o?.end(c),s?.())}}}async function En(e,t,n,i){let r=It(e,t,i);try{return await n()}finally{r.end()}}function nt(e,t=1){bo&&pP.set(e,(pP.get(e)??0)+t),Cg()&&_H(`profile.${e}`,t)}var mP=0;bo&&setInterval(()=>{mP=Math.max(mP,Math.round(process.memoryUsage.rss()/1048576))},250).unref();function Swe(){let e=["DRIFT_CONCURRENCY","DRIFT_NETWORK_CONCURRENCY","DRIFT_LOCAL_CONCURRENCY"];return{startedAt:new Date(vwe).toISOString(),durationMs:Math.round(fP()),spans:EH,counters:Object.fromEntries([...pP].sort(([t],[n])=>t.localeCompare(n))),machine:{platform:(0,ra.platform)(),arch:(0,ra.arch)(),cpus:(0,ra.cpus)().length,totalMemMb:Math.round((0,ra.totalmem)()/(1024*1024)),node:process.version},peakRssMb:Math.max(mP,Math.round(process.memoryUsage.rss()/(1024*1024))),env:Object.fromEntries(e.filter(t=>process.env[t]).map(t=>[t,process.env[t]]))}}function xwe(e){if(!bo)return;let t=e??($d&&$d!=="1"?$d:"drift-profile.json");try{(0,xH.writeFileSync)(t,JSON.stringify(Swe()),"utf8"),process.stderr.write(` +`))}var YK=new Set(["poetry.lock","pipfile.lock","uv.lock","requirements.lock"]),XK={ecosystem:"pypi",name:"pip/poetry/uv",handles(e){let t=ye(e);return e.includes("site-packages/")||e.includes(".venv/")?!1:t==="pyproject.toml"||t==="setup.py"||t==="pipfile"||YK.has(t)||$c(t)},isLockfile(e){return YK.has(ye(e))},parse(e,t){let n=ye(t);return n==="pyproject.toml"?e_e(e):n==="poetry.lock"||n==="uv.lock"?t_e(e):n==="pipfile"?n_e(e):n==="setup.py"?r_e(e):Xke(e)}};function Hg(e){let t=e.trim();if(!t||t.startsWith("#")||t.startsWith("-")||/^[a-z+]+:\/\//i.test(t))return null;if(t=t.split(";")[0].trim(),t=t.replace(/\s+#.*$/,"").trim(),/\s@\s/.test(t)){let o=t.split("@")[0].trim();return o?{name:Kg(o),version:null}:null}let n=/^([A-Za-z0-9._-]+)\s*(\[[^\]]*\])?\s*(.*)$/.exec(t);if(!n)return null;let r=Kg(n[1]),i=(n[3]??"").trim();return i&&!/^[<>=!~,(\[@]/.test(i)?null:{name:r,version:i||null}}function Kg(e){return e.trim().toLowerCase().replace(/[-_.]+/g,"-")}function Xke(e){let t=new Map,n=e.split(` +`),r=n_(e),i=n.filter(s=>{let a=s.trim();return a!==""&&!a.startsWith("#")&&!a.startsWith("-")}),o=i.filter(s=>Hg(s)!==null).length;if(i.length>=5&&o/i.length<.7)return t;for(let s=0;so.length&&n.endsWith(o))return{version:n.slice(0,-o.length),platform:i}}let r=n.split("-");for(let i=1;i/^[a-z0-9_.]+$/.test(r))}var nJ={ecosystem:"rubygems",name:"bundler",handles(e){let t=ye(e);return t==="gemfile"||t==="gemfile.lock"||t.endsWith(".gemspec")},isLockfile(e){return ye(e)==="gemfile.lock"},parse(e,t){let n=ye(t);return n==="gemfile.lock"?l_e(e):n.endsWith(".gemspec")?u_e(e):c_e(e)}};function c_e(e){let t=new Map,n=[];for(let r of e.split(` +`)){let i=r.split("#")[0].trim();if(!i)continue;let o=/^group\s+(.+?)\s+do$/.exec(i);if(o){n.push(o[1]);continue}if(i==="end"&&n.length){n.pop();continue}let s=/^gem\s+["']([^"']+)["'](.*)$/.exec(i);if(!s)continue;let a=s[1],c=s[2]??"",l=[...c.matchAll(/["']([~><=!]*\s*[\d][^"']*)["']/g)].map(m=>m[1].trim()),u=l.length?l.join(", "):null,d=/\bgroups?:\s*\[?\s*:?([\w,\s:]+)/.exec(c)?.[1]??"",p=`${n.join(" ")} ${d}`,f=/development|test/.test(p)?"dev":"runtime";t.set(a,{version:u,kind:f})}return t}function l_e(e){let t=new Map,n=eJ(e),r=!1;for(let i of e.split(` +`)){let o=i.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(o)){r=!0;continue}if(o.trim()&&!/^\s/.test(o)){r=!1;continue}if(!r)continue;let s=/^ {4}([A-Za-z0-9_.-]+) \(([^)]+)\)$/.exec(o);if(!s)continue;let a=tJ(s[2],n);t.set(s[1],{version:a.version,kind:"transitive",...a.platform?{platform:a.platform}:{}})}return t}function u_e(e){let t=new Map,n=/add_(development_|runtime_)?dependency[\s(]+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let r of e.matchAll(n))t.set(r[2],{version:r[3]??null,kind:r[1]==="development_"?"dev":"runtime"});return t}var rJ={ecosystem:"maven",name:"sbt",handles(e){return ye(e).endsWith(".sbt")?!0:/(^|\/)project\/[\w-]+\.scala$/.test(e.toLowerCase())},isLockfile(){return!1},parse(e){return p_e(e)}};function d_e(e){let t=e.trim().split(".");return t[0]==="3"?"3":t.length>=2?`${t[0]}.${t[1]}`:e.trim()}function p_e(e){let t=new Map,n=/\bscalaVersion\s*(?::=|\+=)\s*"([^"]+)"/.exec(e)?.[1],r=n?`_${d_e(n)}`:"",i=new Map;for(let s of e.matchAll(/\bval\s+([A-Za-z_]\w*)\s*=\s*"([^"]+)"/g))i.set(s[1],s[2]);let o=/"([\w.-]+)"\s*(%%%|%%|%)\s*"([\w.-]+)"\s*%\s*(?:"([^"]+)"|([A-Za-z_]\w*))((?:\s*%\s*"[A-Za-z]+")?)/g;for(let s of e.matchAll(o)){let a=s[1],c=s[2],l=s[3],u=s[4],d=s[5],p=s[6]??"",f=c==="%%"?`${a}:${l}${r}`:`${a}:${l}`,m=u??(d?i.get(d)??null:null),g=/"(test|it)"/i.test(p)||/"provided"/i.test(p)?"dev":/"optional"/i.test(p)?"optional":"runtime";t.set(f,{version:m,kind:g})}for(let s of e.matchAll(/addSbtPlugin\s*\(\s*"([\w.-]+)"\s*%\s*"([\w.-]+)"\s*%\s*"([^"]+)"/g))t.set(`${s[1]}:${s[2]}`,{version:s[3],kind:"dev"});return t}var iJ={ecosystem:"swift",name:"Swift Package Manager",handles(e){let t=ye(e);return t==="package.resolved"||/^package(@swift-[\d.]+)?\.swift$/.test(t)},isLockfile(e){return ye(e)==="package.resolved"},parse(e,t){return ye(t)==="package.resolved"?g_e(e):f_e(e)}};function f_e(e){let t=new Map;for(let n of e.matchAll(/\.package\s*\(([\s\S]*?)\)\s*[,\]]/g)){let r=n[1]??"",i=/\burl\s*:\s*"([^"]+)"/.exec(r)?.[1],o=/\bpath\s*:\s*"([^"]+)"/.exec(r)?.[1];if(!i&&o)continue;let s=/\bid\s*:\s*"([^"]+)"/.exec(r)?.[1],a=i?oJ(i):s;a&&t.set(a,{version:m_e(r),kind:"runtime"})}return t}function m_e(e){let t=/\bexact\s*:\s*"([^"]+)"/.exec(e)?.[1];if(t)return t;let n=/\bfrom\s*:\s*"([^"]+)"/.exec(e)?.[1];if(n)return`^${n}`;let r=/\.upToNextMajor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(r)return`^${r}`;let i=/\.upToNextMinor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(i)return`~${i}`;let o=/"([^"]+)"\s*\.\.[.<]\s*"([^"]+)"/.exec(e);return o?`>=${o[1]} <${o[2]}`:null}function g_e(e){let t=new Map,n=Bt(e);if(!n)return t;for(let r of n.pins??n.object?.pins??[]){let i=r.location??r.repositoryURL,o=i?oJ(i):r.identity??r.package;if(!o)continue;let s=r.state?.version??null;t.set(o,{version:s,kind:"transitive"})}return t}function oJ(e){let t=e.trim().replace(/\.git$/,"").replace(/\/+$/,"");if(!t)return null;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)$/.exec(t);return n?`${n[1]}/${n[2]}`:t.split("/").pop()||null}var sJ={ecosystem:"vcpkg",name:"vcpkg",handles(e){let t=ye(e);return t==="vcpkg.json"||t==="vcpkg-configuration.json"},isLockfile(){return!1},parse(e){let t=new Map,n=Bt(e);if(!n)return t;for(let i of n.dependencies??[]){if(typeof i=="string"){t.set(i,{version:null,kind:"runtime"});continue}i.name&&t.set(i.name,{version:i["version>="]?`>=${i["version>="]}`:null,kind:i.host?"dev":"runtime"})}for(let i of n.overrides??[]){if(!i.name)continue;let o=i.version??i["version-string"]??i["version-semver"]??null,s=t.get(i.name);t.set(i.name,{version:o,kind:s?.kind??"runtime"})}let r=n["builtin-baseline"]??n.registries?.find(i=>i.baseline)?.baseline;return r&&t.set(h_e,{version:r,kind:"transitive"}),t}},h_e="vcpkg-baseline";var aJ=[BK,XK,LK,CK,rJ,jK,nJ,HK,OK,FK,ZK,iJ,DK,KK,NK,sJ,EK];function cJ(e){return aJ.some(t=>t.handles(e))}function r_(e){return aJ.find(t=>t.handles(e))}function lJ(e){let t=new Map;for(let n of e){let r=r_(n.path);if(!r)continue;let i=n.before?r.parse(n.before,n.path):new Map,o=n.after?r.parse(n.after,n.path):new Map,s=r.isLockfile(n.path);for(let a of new Set([...i.keys(),...o.keys()])){let c=i.get(a),l=o.get(a),u=c?.version??null,d=l?.version??null;if(u===d)continue;let p=Vi(r.ecosystem),f=u===null?null:p.exactVersion(u),m=d===null?null:p.exactVersion(d);if((f&&m?Bg(f,m,r.ecosystem):null)===0)continue;if(r.ecosystem==="npm"&&!f&&!m){let $=Xk(u),S=Xk(d);if($&&$===S)continue}let h=l?.kind??c?.kind??"runtime",v=s&&h==="runtime"?"transitive":h,b={name:a,ecosystem:r.ecosystem,from:f,to:m,kind:v,bump:f&&m?Qs(f,m,r.ecosystem):bK(u,d,r.ecosystem),manifestPath:n.path,rawFrom:u,rawTo:d,source:s?"lockfile":"manifest"},w=`${r.ecosystem}:${y_e(n.path)}:${a}`,k=t.get(w);if(k&&k.source!==b.source){let $=k.source==="manifest"?k:b,S=k.source==="lockfile"?k:b,E=S.from??$.from,T=S.to??$.to;t.set(w,{...$,from:E,to:T,bump:Qs(E,T,r.ecosystem)})}else(!k||b_e(k,b,s))&&t.set(w,b)}}return[...t.values()].sort((n,r)=>n.ecosystem.localeCompare(r.ecosystem)||n.name.localeCompare(r.name))}function y_e(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function b_e(e,t,n){let r=e.source==="lockfile";return r&&!n?!0:!r&&n?!1:t.from!==null&&t.to!==null&&(e.from===null||e.to===null)}function uJ(e,t){let n=[],r=[],i=new Set(t.ecosystems);for(let o of e){let s=v_e(o,t,i);s?r.push({change:o,reason:s}):n.push(o)}return{actionable:n,skipped:r}}function v_e(e,t,n){if(!n.has(e.ecosystem))return`ecosystem "${e.ecosystem}" is not enabled in drift.yml`;if(Qo(t.ignore,e.name))return"matched an `ignore` pattern in drift.yml";if(e.rawTo!==null&&e.rawTo!==void 0&&e.to===null)return"target manifest range has no exact resolved registry version";if(e.rawFrom!==null&&e.rawFrom!==void 0&&e.from===null)return"previous manifest range has no exact resolved registry version";if(e.to===null)return"dependency was removed; removals need no compatibility fix";if(e.kind==="dev"&&!t.triggerOn.dev)return"dev dependency (enable `triggerOn.dev` to analyse these)";if(e.kind==="transitive"&&!t.triggerOn.transitive)return"transitive dependency (enable `triggerOn.transitive` to analyse these)";if(e.from===null)return"newly added dependency; there is no prior version to break against";let r=qg(e.from,e.to,e.ecosystem);return e.bump==="major"&&!t.triggerOn.major?"major bumps are disabled in drift.yml (enable `triggerOn.major` to include these)":e.bump==="minor"&&!t.triggerOn.minor&&!r?"minor bumps are disabled in drift.yml (enable `triggerOn.minor` to include these)":e.bump==="patch"&&!t.triggerOn.patch?"patch bumps are disabled in drift.yml (enable `triggerOn.patch` to include these)":e.bump==="prerelease"&&!t.triggerOn.patch?"prerelease moves are disabled in drift.yml (enable `triggerOn.patch`)":null}var Xg=gt(_c(),1);var od=require("node:crypto"),qi=require("node:fs/promises"),mD=require("node:path");var yJ=require("node:fs"),ea=require("node:os");var dJ=require("node:async_hooks");var w_e=[/\bAuthorization\s*:\s*[^\n]+/gi,/\bBearer\s+\S+/gi,/\bgh[oprsu]_[A-Za-z0-9]{10,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{10,}\b/g,/\bsk-[A-Za-z0-9][A-Za-z0-9_-]{9,}/g];function k_e(e){let t=e;for(let n of w_e)t=t.replace(n,"[REDACTED]");return t}function __e(e){return k_e(e instanceof Error?e.message:String(e))}var pJ=new dJ.AsyncLocalStorage;function Xo(){return pJ.getStore()}function Vt(){return Xo()?.state.now()??0}function Jg(){let e=Xo();return e!==void 0&&!e.state.finished}function fJ(e){Xo()?.state.httpRequests.push(e)}function mJ(e){Xo()?.state.httpAttempts.push(e)}function aD(e){Xo()?.state.execCommands.push(e)}function $_e(){return{hits:0,misses:0,writes:0,memoryHits:0,diskHits:0,coalescedHits:0,revalidated304:0}}function Ir(e,t,n=!1){let r=Xo()?.state;if(!r)return;let i=r.caches.get(e)??$_e();if(typeof t=="boolean"){t?i.hits+=1:i.misses+=1,n&&(i.writes+=1),r.caches.set(e,i);return}t==="memory_hit"?(i.memoryHits+=1,i.hits+=1):t==="disk_hit"?(i.diskHits+=1,i.hits+=1):t==="coalesced_hit"?(i.coalescedHits+=1,i.hits+=1):t==="revalidated_304"?i.revalidated304+=1:t==="miss"?i.misses+=1:t==="write"&&(i.writes+=1),r.caches.set(e,i)}function gJ(e,t=1){let n=Xo()?.state;n&&n.counters.set(e,(n.counters.get(e)??0)+t)}var S_e=Object.freeze({end(){},fail(){}});function hJ(e,t,n,r){let i=t!==null?e.spans.find(s=>s.id===t):void 0,o={id:e.nextSpanId++,parentId:t,depth:i?i.depth+1:0,name:n,startMs:e.now(),endMs:null,meta:{...r},status:"ok"};return e.spans.push(o),o}function i_(e,t,n,r,i){e.endMs===null&&(e.endMs=t.now(),n==="error"?(e.status="error",e.error=__e(r),Object.assign(e.meta,i)):Object.assign(e.meta,r))}function Sc(e,t){let n=Xo();if(!n||n.state.finished)return S_e;let{state:r}=n,i=hJ(r,n.parentId,e,t),o=!1;return{end(s){o||(o=!0,i_(i,r,"ok",s))},fail(s,a){o||(o=!0,i_(i,r,"error",s,a))}}}async function Gr(e,t,n){let r=Xo();if(!r||r.state.finished)return n();let{state:i}=r,o=hJ(i,r.parentId,e,t);try{let s=await pJ.run({state:i,parentId:o.id},n);return i_(o,i,"ok"),s}catch(s){throw i_(o,i,"error",s),s}}var x_e=Object.freeze({end(){}}),id=process.env.DRIFT_PROFILE,yo=!!id&&id!=="0"&&id!=="false",bJ=[],lD=new Map,E_e=yo?Date.now():0,T_e=yo?performance.now():0;function uD(){return performance.now()-T_e}function Zg(){return yo}function I_e(e,t,n){return{operation:t,...new Set(["surface","surface-sources","surface-deps","evidence"]).has(e)?{package:t}:{},...n}}var cD=100,A_e=50;function R_e(){if(!Jg())return()=>{};let e=performance.now()+cD,t=setInterval(()=>{let n=performance.now(),r=Math.max(0,n-e);if(e=n+cD,rclearInterval(t)}function At(e,t,n){let r=Jg();if(!yo&&!r)return x_e;let i=yo?uD():0,o=r?Sc(`work.${e}`,I_e(e,t,n)):null,s=r&&e==="scan"&&t==="total"?R_e():null,a=!1;return{end(c){a||(a=!0,yo&&bJ.push({cat:e,name:t,start:i,end:uD(),...n||c?{meta:{...n,...c}}:{}}),o?.end(c),s?.())}}}async function xn(e,t,n,r){let i=At(e,t,r);try{return await n()}finally{i.end()}}function tt(e,t=1){yo&&lD.set(e,(lD.get(e)??0)+t),Jg()&&gJ(`profile.${e}`,t)}var dD=0;yo&&setInterval(()=>{dD=Math.max(dD,Math.round(process.memoryUsage.rss()/1048576))},250).unref();function P_e(){let e=["DRIFT_CONCURRENCY","DRIFT_NETWORK_CONCURRENCY","DRIFT_LOCAL_CONCURRENCY"];return{startedAt:new Date(E_e).toISOString(),durationMs:Math.round(uD()),spans:bJ,counters:Object.fromEntries([...lD].sort(([t],[n])=>t.localeCompare(n))),machine:{platform:(0,ea.platform)(),arch:(0,ea.arch)(),cpus:(0,ea.cpus)().length,totalMemMb:Math.round((0,ea.totalmem)()/(1024*1024)),node:process.version},peakRssMb:Math.max(dD,Math.round(process.memoryUsage.rss()/(1024*1024))),env:Object.fromEntries(e.filter(t=>process.env[t]).map(t=>[t,process.env[t]]))}}function C_e(e){if(!yo)return;let t=e??(id&&id!=="1"?id:"drift-profile.json");try{(0,yJ.writeFileSync)(t,JSON.stringify(P_e()),"utf8"),process.stderr.write(` drift: profile written to ${t} `)}catch(n){process.stderr.write(`drift: could not write profile: ${n.message} -`)}}bo&&process.on("exit",()=>xwe());var Ewe=1e4,Twe=1440*60*1e3,Iwe=6e4,Awe=360*60*1e3,Rwe="drift-bot/0.1 (+https://github.com/trydrift/drift)",hP=new Map,ia=new Map;function bP(e,t){let n=ia.get(e);if(n)return Rr("http","coalesced_hit"),n;let i=t().finally(()=>ia.delete(e));return ia.set(e,i),i}var Xo=null;function TH(e){let t=hP.get(e);return t?Date.now()>=t.expiresAt?(hP.delete(e),{hit:!1}):{hit:!0,value:t.value}:{hit:!1}}function vo(e,t){let n=t===null?Date.now()+Iwe:1/0;hP.set(e,{value:t,expiresAt:n})}function vP(e){if(!e)return"default";let t=Object.entries(e).filter(([i])=>/auth|token/i.test(i)||i.toLowerCase()==="accept").sort(([i],[r])=>i.localeCompare(r));if(t.length===0)return"default";let n=t.map(([i,r])=>`${i.toLowerCase()}=${r}`).join("&");return(0,_d.createHash)("sha256").update(n).digest("hex").slice(0,16)}function Fk(e,t){return(0,_d.createHash)("sha256").update(`${vP(t)}:${e}`).digest("hex").slice(0,10)}function IH(e,t){return(0,_d.createHash)("sha256").update(`${e}|${t.maxBytes??""}|${t.timeoutMs??""}|${t.retries??""}`).digest("hex").slice(0,10)}function oa(e){let t=e.indexOf("://");if(t<0)return"unknown";let n=e.slice(t+3),i=n.search(/[/?#]/);return(i<0?n:n.slice(0,i)).toLowerCase()}function sa(e){let t=e.indexOf("://");if(t<0)return e.split("?")[0];let n=e.slice(t+3),i=n.indexOf("/");return(i<0?"":n.slice(i)).split("?")[0]}function wP(e){return Math.max(0,Vt()-e)}function qr(e){let t={requestKey:e.requestKey,path:e.path,timeoutMs:Math.max(0,Math.round(e.timeoutMs))};return e.abortFiredAtMs!==null?(t.abortTimerFired=!0,t.abortDelayMs=Math.max(0,Math.round(e.abortFiredAtMs-e.attemptStartOffsetMs-e.timeoutMs))):t.abortTimerFired=!1,e.headersAtMs!==void 0&&e.headersAtMs!==null&&(t.headersMs=Math.max(0,Math.round(e.headersAtMs-e.attemptStartOffsetMs))),e.headersAtMs!==void 0&&e.headersAtMs!==null&&e.bodyDoneAtMs!==void 0&&e.bodyDoneAtMs!==null&&(t.bodyMs=Math.max(0,Math.round(e.bodyDoneAtMs-e.headersAtMs))),t}function Yt(e){kH({host:oa(e.url),method:e.method,path:sa(e.url),startOffsetMs:e.startOffsetMs,durationMs:Vt()-e.startOffsetMs,status:e.status,cache:e.cache,bytes:e.bytes,retries:e.retries,backoffMs:e.backoffMs,failure:e.failure})}function Wr(e){$H({host:oa(e.url),method:e.method,path:sa(e.url),startOffsetMs:e.startOffsetMs,durationMs:Vt()-e.startOffsetMs,status:e.status})}function AH(e){Xo=e}function Lc(){return Xo}function $e(e,t={}){let n=`json:${vP(t.headers)}:${e}`,i=TH(n);if(i.hit)return nt("http.cache.memory"),Rr("http","memory_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:null,cache:"memory_hit"}),Promise.resolve(i.value);Pg()&&ia.has(n)&&nt("http.cache.coalesced");let r=Vt(),o=ia.has(n),s={Accept:"application/json",...t.headers},a=Fk(e,s),c=o?It("http-coalesced-json",oa(e),{requestKey:a,path:sa(e)}):null,l=bP(n,()=>Nwe(e,n,t));return o?l.then(u=>(c?.end({waitMs:Math.round(wP(r))}),Yt({url:e,method:"GET",startOffsetMs:r,status:null,cache:"coalesced_hit"}),u)):l}async function Nwe(e,t,n){let i={Accept:"application/json",...n.headers},r=await rt(e,{...n,headers:i});if(r===null)return vo(t,null),null;let o=It("json-parse",oa(e),{requestKey:Fk(e,i),path:sa(e),bytes:r.length});try{let s=JSON.parse(r);return vo(t,s),s}catch{return vo(t,null),null}finally{o.end()}}function rt(e,t={}){let n=`text:${vP(t.headers)}:${e}`,i=TH(n);if(i.hit)return nt("http.cache.memory"),Rr("http","memory_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:null,cache:"memory_hit"}),Promise.resolve(i.value);Pg()&&ia.has(n)&&nt("http.cache.coalesced");let r=Vt(),o=ia.has(n),s=Fk(e,t.headers),a=o?It("http-coalesced-text",oa(e),{requestKey:s,path:sa(e)}):null;return bP(n,()=>Cwe(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(wP(r))}),Yt({url:e,method:"GET",startOffsetMs:r,status:null,cache:"coalesced_hit"})),c))}async function Cwe(e,t,n){let{timeoutMs:i=Ewe,headers:r={},retries:o=2}=n,s=oa(e),a=Fk(e,r),c=sa(e),l=It("disk-cache",s,{requestKey:a,path:c}),u=await Mwe(t);l.end({hit:u!==null});let d=n.cacheTtlMs??Twe,p=Date.now();if(u&&u.body!==null&&(u.immutable||n.immutable||p-u.fetchedAt{w=Vt(),y.abort()},i),_=It("http",s,{requestKey:a,path:c,timeoutMs:i,...h>0?{attempt:h}:{}});try{let S=await fetch(e,{signal:y.signal,headers:{"User-Agent":Rwe,...f,...r},redirect:"follow"}),x=Vt();if(S.status===304&&u)return _.end({status:304,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:304}),Yt({url:e,method:"GET",startOffsetMs:m,status:304,cache:"revalidated_304",retries:h,backoffMs:g}),nt("http.notModified"),Rr("http","revalidated_304"),Rr("http","write"),await gP(t,{...u,fetchedAt:p,immutable:u.immutable||n.immutable}),vo(t,u.body),u.body;if(S.ok){let A=await S.text(),L=Vt();return _.end({status:S.status,bytes:A.length,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x,bodyDoneAtMs:L})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",bytes:A.length,retries:h,backoffMs:g}),vo(t,A),Rr("http","write"),await gP(t,{key:t,body:A,etag:S.headers.get("etag")??void 0,fetchedAt:p,immutable:n.immutable}),A}if(S.status===404)return _.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g}),vo(t,null),Rr("http","write"),await gP(t,{key:t,body:null,absent:!0,fetchedAt:p,immutable:n.immutable}),null;if(S.status===403){if(!(S.headers.get("x-ratelimit-remaining")==="0"||S.headers.has("retry-after"))||h===o){_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g});break}_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),n.onRetry?.(h+1,"rate-limited");let L=Dg(h,S.headers.get("retry-after"));g+=L,await Og(L);continue}if(!(S.status===429||S.status>=500)||h===o){_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g});break}_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),n.onRetry?.(h+1,S.status===429?"rate-limited":"server-error");let T=Dg(h,S.headers.get("retry-after"));g+=T,await Og(T)}catch(S){if(_.end({status:0,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w})}),Wr({url:e,method:"GET",startOffsetMs:b,status:null}),h===o){Yt({url:e,method:"GET",startOffsetMs:m,status:null,cache:"miss",retries:h,backoffMs:g,failure:S instanceof Error?S.name:"network-error"}),nt("http.error");break}nt("http.error"),n.onRetry?.(h+1,"network-error");let x=Dg(h,null);g+=x,await Og(x)}finally{clearTimeout(k)}}return vo(t,null),u?.body!==void 0?(vo(t,u.body),u.body):null}function Bt(e,t={}){let n=`archive:${e}`,i=`${n}|maxBytes=${t.maxBytes??""}|timeoutMs=${t.timeoutMs??""}|retries=${t.retries??""}`,r=Vt(),o=ia.has(i),s=IH(e,t),a=o?It("http-coalesced-archive",oa(e),{requestKey:s,path:sa(e)}):null;return bP(i,()=>Pwe(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(wP(r))}),Yt({url:e,method:"GET",startOffsetMs:r,status:c.ok?200:c.status,cache:"coalesced_hit"})),c))}async function Pwe(e,t,n){let i=oa(e),r=sa(e),o=IH(e,n),s=Owe(t),{retries:a=2,maxBytes:c}=n;if(s)try{let m=await(0,Vi.readFile)(s);if(c===void 0||m.length<=c)return nt("http.cache.archive"),Rr("http","disk_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:200,cache:"disk_hit"}),{ok:!0,bytes:m}}catch{}Rr("http","miss");let l=n.timeoutMs??6e4,u=Date.now()+l,d=()=>u-Date.now();nt("http.archive");let p=Vt(),f=0;for(let m=0;m<=a;m++){let g=d();if(g<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:"timeout"}),{ok:!1,status:0,error:"Timed out before this attempt could start."};let h=Vt(),b=It("archive",i,{requestKey:o,path:r,timeoutMs:Math.max(0,Math.round(g)),...m>0?{attempt:m}:{}}),y=new AbortController,w=null,k=setTimeout(()=>{w=Vt(),y.abort()},g);try{let _=await fetch(e,{signal:y.signal}),S=Vt();if(!_.ok){b.end({status:_.status,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status});let A=_.status===429||_.status>=500,L=Math.min(Dg(m,_.headers.get("retry-after")),d());if(!A||m===a||L<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",retries:m,backoffMs:f}),{ok:!1,status:_.status};f+=L,await Og(L);continue}let x=Number(_.headers.get("content-length"));if(c!==void 0&&Number.isFinite(x)&&x>c)return b.end({status:_.status,bytes:x,oversized:!0,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:_.status,error:`Response of ${x} bytes exceeds the ${c}-byte limit for this archive.`};let E=await Dwe(_,c,y),T=Vt();if(E==="oversized")return b.end({status:_.status,oversized:!0,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S,bodyDoneAtMs:T})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:_.status,error:`Response exceeds the ${c}-byte limit for this archive.`};if(b.end({status:_.status,bytes:E.length,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S,bodyDoneAtMs:T})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",bytes:E.length,retries:m,backoffMs:f}),s)try{await(0,Vi.mkdir)(Xo,{recursive:!0});let A=`${s}.${process.pid}.partial`;await(0,Vi.writeFile)(A,E),await(0,Vi.rename)(A,s),Rr("http","write")}catch{}return{ok:!0,bytes:E}}catch(_){if(b.end({status:0,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w})}),Wr({url:e,method:"GET",startOffsetMs:h,status:null}),m===a)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:_ instanceof Error?_.name:"network-error"}),{ok:!1,status:0,error:_.message};let S=Math.min(Dg(m,null),d());if(S<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:_ instanceof Error?_.name:"network-error"}),{ok:!1,status:0,error:_.message};f+=S,await Og(S)}finally{clearTimeout(k)}}return{ok:!1,status:0}}async function Dwe(e,t,n){if(t===void 0||!e.body)return Buffer.from(await e.arrayBuffer());let i=e.body.getReader(),r=[],o=0;for(;;){let{done:s,value:a}=await i.read();if(s)break;if(o+=a.byteLength,o>t)return n.abort(),"oversized";r.push(a)}return Buffer.concat(r)}function Owe(e){return Xo?(0,yP.join)(Xo,`${(0,_d.createHash)("sha256").update(e).digest("hex")}.bin`):null}async function Mwe(e){if(!Xo)return null;try{let t=await(0,Vi.readFile)(RH(e),"utf8"),n=JSON.parse(t);return n.key===e?n:null}catch{return null}}async function gP(e,t){if(Xo)try{await(0,Vi.mkdir)(Xo,{recursive:!0}),await(0,Vi.writeFile)(RH(e),JSON.stringify(t),"utf8")}catch{}}function RH(e){let t=(0,_d.createHash)("sha256").update(e).digest("hex");return(0,yP.join)(Xo,`${t}.json`)}function Dg(e,t){if(t){let i=Number(t);if(Number.isFinite(i)&&i>0)return Math.min(i*1e3,3e4)}return 400*2**e+Math.random()*200}function Og(e){return new Promise(t=>setTimeout(t,e))}async function qn(e,t,n){let i=new Array(e.length),r=0,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let s=r++;if(s>=e.length)return;i[s]=await n(e[s],s)}});return await Promise.all(o),i}var PH=require("node:crypto"),DH=require("node:zlib"),Sd=require("node:fs/promises"),$P=require("node:path");var OH="https://downloads.arduino.cc/libraries/library_index.json.gz",Lwe=1440*60*1e3,Fwe=12e4,NH=null;async function Uwe(){return NH??=jwe(),NH}async function Uk(e){return(await Uwe())?.get(e.toLowerCase())??null}async function jwe(){let e=await CH();if(e)return kP(e);let t=await zwe();if(!t){let i=await CH({ignoreAge:!0});return i?kP(i):null}let n=Gwe(t);return await Bwe(n),kP(n)}async function zwe(){try{let e=await fetch(OH,{signal:AbortSignal.timeout(Fwe),headers:{"User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"}});if(!e.ok)return null;let t=Buffer.from(await e.arrayBuffer()),n=t[0]===31&&t[1]===139?(0,DH.gunzipSync)(t):t;return JSON.parse(n.toString("utf8"))}catch{return null}}function Gwe(e){let t=new Map;for(let n of e.libraries??[]){if(!n.name||!n.version)continue;let i=n.name.toLowerCase(),r=t.get(i);r||(r={name:n.name,versions:[],githubRepo:null,website:null,description:null,archives:{}},t.set(i,r)),r.versions.includes(n.version)||r.versions.push(n.version),n.url&&(r.archives[n.version]=n.url),r.githubRepo=Vwe(n.repository)??r.githubRepo,r.website=n.website??r.website,r.description=n.sentence??r.description}return[...t.values()]}function Vwe(e){if(!e)return null;let t=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/.exec(e);return t?`${t[1]}/${t[2]}`:null}function kP(e){return new Map(e.map(t=>[t.name.toLowerCase(),t]))}function MH(){let e=Lc();if(!e)return null;let t=(0,PH.createHash)("sha256").update(OH).digest("hex");return(0,$P.join)(e,`arduino-index-${t.slice(0,16)}.json`)}async function CH(e={}){let t=MH();if(!t)return null;try{let n=JSON.parse(await(0,Sd.readFile)(t,"utf8"));return!Array.isArray(n.libraries)||!e.ignoreAge&&Date.now()-n.fetchedAt>=Lwe?null:n.libraries}catch{return null}}async function Bwe(e){let t=MH();if(t)try{await(0,Sd.mkdir)((0,$P.join)(t,".."),{recursive:!0});let n={fetchedAt:Date.now(),libraries:[...e]};await(0,Sd.writeFile)(t,JSON.stringify(n),"utf8")}catch{}}var jH=require("node:crypto");var qwe=new Set(["sponsors","apps","marketplace","settings","about","pricing","features"]),LH=/^[A-Za-z0-9._-]+$/;function FH(e,t){let n=t.replace(/\.git$/i,"");return!e||!n||!LH.test(e)||!LH.test(n)||e==="."||e===".."||n==="."||n===".."||qwe.has(e.toLowerCase())?null:`${e}/${n}`}function UH(e){let t=e.toLowerCase();return t==="github.com"||t==="www.github.com"}function aa(e){if(!e)return null;let t=e.trim();if(!t)return null;t=t.replace(/^git\+/i,"");let n=/^(?:ssh:\/\/)?(?:[^@/\s]+@)?github\.com:(?[^/\s:]+)\/(?[^\s?#]+?)\/?$/i.exec(t);if(n?.groups)return UH("github.com")?FH(n.groups.owner,n.groups.repo):null;let i;try{i=new URL(t)}catch{return null}if(!["http:","https:","ssh:","git:"].includes(i.protocol)||!UH(i.hostname))return null;let r=i.pathname.split("/").filter(Boolean);return r.length<2?null:FH(r[0],r[1])}var _P=new Map;function Wwe(e,t){let n=(0,jH.createHash)("md5").update(e).digest("hex"),i=`${n[0]}/${n[1]}/${n[2]}`,r=encodeURIComponent(e);return`https://cdn.cocoapods.org/Specs/${i}/${r}/${encodeURIComponent(t)}/${r}.podspec.json`}function jk(e,t,n={}){let i=`${e}@${t}`,r=_P.get(i);if(r)return r;let o=Hwe(e,t,n).catch(()=>null);return _P.set(i,o),o.then(s=>{s||_P.delete(i)}),o}async function Hwe(e,t,n){let i=await $e(Wwe(e,t),{immutable:!0,...n.timeoutMs?{timeoutMs:n.timeoutMs}:{}});if(!i)return null;let r=i.source&&typeof i.source=="object"?Kwe(i.source):null;return{name:i.name??e,version:i.version??t,moduleName:typeof i.module_name=="string"&&i.module_name?i.module_name:null,source:r,homepage:SP(i.homepage),summary:SP(i.summary),description:SP(i.description)}}function Kwe(e){let t=n=>{let i=e[n];return typeof i=="string"&&i?i:void 0};return{git:t("git"),tag:t("tag"),http:t("http"),svn:t("svn")}}function SP(e){return typeof e=="string"&&e.trim()?e.trim():null}function zH(e){return aa(e.source?.git)??aa(e.homepage)}var Jwe=e=>`https://api.github.com/repos/ocaml/opam-repository/contents/packages/${encodeURIComponent(e)}`,Zwe="https://api.github.com/repos/ocaml/opam-repository/branches/master",GH=(e,t,n)=>`https://raw.githubusercontent.com/ocaml/opam-repository/${n}/packages/${encodeURIComponent(e)}/${encodeURIComponent(`${e}.${t}`)}/opam`;async function Ywe(e){let n=(await $e(Zwe,{...e?{headers:e}:{}}).catch(()=>null))?.commit?.sha;return typeof n=="string"&&/^[0-9a-f]{40}$/.test(n)?n:null}function BH(e){return/^[\w.+-]+$/.test(e)}async function zk(e,t={}){if(!BH(e))return null;let n=await $e(Jwe(e),{...t.headers?{headers:t.headers}:{}}).catch(()=>null);if(!Array.isArray(n))return null;let i=`${e}.`;return n.filter(r=>r.type==="dir"&&r.name?.startsWith(i)).map(r=>r.name.slice(i.length))}async function qH(e,t){if(!BH(e))return null;let n=await Ywe(),i=n?await rt(GH(e,t,n),{immutable:!0}).catch(()=>null):await rt(GH(e,t,"master")).catch(()=>null);return i?Qwe(i,e,t):null}function Qwe(e,t,n){let i=a=>{let c=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e);return c?VH(c[1]):null},r=a=>{let l=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e)?.[1]?.trim();return l||null},o=(()=>{let a=/(?:^|\n)\s*description\s*:\s*"""([\s\S]*?)"""/.exec(e);return a?a[1].trim()||null:r("description")})(),s=(()=>{let a=/(?:^|\n)\s*url\s*\{([\s\S]*?)\n[ \t]*\}/.exec(e),c=a?a[1]:e,l=/(?:^|\n)\s*src\s*:\s*"([^"\n]+)"/.exec(c)??/(?:^|\n)\s*archive\s*:\s*"([^"\n]+)"/.exec(c);return l?VH(l[1]):null})();return{name:t,version:n,devRepo:i("dev-repo"),homepage:i("homepage"),bugReports:i("bug-reports"),doc:i("doc"),synopsis:r("synopsis"),description:o,sourceUrl:s}}function VH(e){let t=e.trim();return!t||/%\{[^}]*\}%?/.test(t)?null:t}function WH(e){return aa(e.devRepo)??aa(e.sourceUrl)??aa(e.homepage)??aa(e.bugReports)}function Gk(e){let t={};return e.map(n=>{let i={...t,...n};return t=i,i})}function Vk(e,t){return e.find(n=>n.version===t)}async function Wn(e,t,n){switch(t){case"npm":return bke(e,n);case"pypi":return vke(e,n);case"cargo":return wke(e);case"go":return kke(e);case"maven":return Ske(e);case"rubygems":return xke(e);case"nuget":return eke(e);case"packagist":return tke(e,n);case"hex":return nke(e);case"pub":return rke(e);case"swift":return ike(e);case"cocoapods":return oke(e,n);case"conan":return ske(e);case"vcpkg":return lke(e);case"arduino":return uke(e);case"opam":return Xwe(e,n);default:return null}}async function Xwe(e,t){let[n,i]=await Promise.all([zk(e),t?qH(e,t):Promise.resolve(null)]);return!n&&!i?null:{name:e,ecosystem:"opam",githubRepo:i?WH(i):null,homepage:i?.homepage??i?.devRepo??null,versions:n??[],deprecated:null,description:i?.description??i?.synopsis??null}}async function eke(e){let t=e.toLowerCase(),[n,i]=await Promise.all([$e(`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(t)}/index.json`),$e(`https://api.nuget.org/v3/registration5-gz-semver2/${encodeURIComponent(t)}/index.json`)]);if(!n&&!i)return null;let r=(i?.items??[]).flatMap(s=>s.items??[]),o=r[r.length-1]?.catalogEntry;return{name:e,ecosystem:"nuget",githubRepo:Lt(o?.repository?.url??null)??Lt(o?.projectUrl??null),homepage:o?.projectUrl??`https://www.nuget.org/packages/${e}`,versions:n?.versions??[],deprecated:o?.deprecation?.message??null,description:o?.description??null}}async function tke(e,t){let i=(await $e(`https://repo.packagist.org/p2/${e}.json`))?.packages?.[e];if(!i||i.length===0)return null;let r=Gk(i),o=t?Vk(r,t):r[0];if(!o)return null;let s=o.abandoned,a=s===void 0||s===!1?null:typeof s=="string"?`This package is abandoned; the author suggests using ${s} instead.`:"This package is abandoned and is no longer maintained.";return{name:e,ecosystem:"packagist",githubRepo:Lt(o.source?.url??null)??Lt(o.homepage??null),homepage:o.homepage??`https://packagist.org/packages/${e}`,versions:r.map(c=>c.version).filter(c=>!!c),deprecated:a,description:o.description??null}}async function nke(e){let t=await $e(`https://hex.pm/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.meta?.links??{},i=Object.entries(n).map(([s,a])=>({key:s.toLowerCase(),value:a})),r=i.find(s=>s.key==="github")?.value??i.find(s=>s.key==="source")?.value,o=Object.values(t.retirements??{})[0];return{name:e,ecosystem:"hex",githubRepo:Lt(r??null)??i.map(s=>Lt(s.value)).find(Boolean)??null,homepage:t.html_url??`https://hex.pm/packages/${e}`,versions:(t.releases??[]).map(s=>s.version).filter(s=>!!s),deprecated:o?o.message??o.reason??"This release is retired.":null,description:t.meta?.description??null}}async function rke(e){let t=await $e(`https://pub.dev/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.latest?.pubspec,i=n?.repository??n?.homepage??n?.issue_tracker;return{name:e,ecosystem:"pub",githubRepo:Lt(i??null),homepage:n?.homepage??`https://pub.dev/packages/${e}`,versions:(t.versions??[]).map(r=>r.version).filter(r=>!!r),deprecated:t.latest?.retracted?"The latest version of this package has been retracted.":null,description:n?.description??null}}function ike(e){return/^[\w.-]+\/[\w.-]+$/.test(e)?{name:e,ecosystem:"swift",githubRepo:e,homepage:`https://github.com/${e}`,versions:[],deprecated:null,description:null}:null}async function oke(e,t){let[n,i]=await Promise.all([$e(`https://trunk.cocoapods.org/api/v1/pods/${encodeURIComponent(e)}`),t?jk(e,t):Promise.resolve(null)]);return n?{name:e,ecosystem:"cocoapods",githubRepo:i?zH(i):null,homepage:i?.homepage??`https://cocoapods.org/pods/${e}`,versions:(n.versions??[]).map(r=>r.name).filter(r=>!!r),deprecated:null,description:i?.description??i?.summary??null}:null}async function ske(e){let t=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,n=await rt(`${t}/config.yml`);if(!n)return null;let{versions:i,folders:r}=ake(n);if(i.length===0)return null;let o=r[i[i.length-1]]??r[i[0]]??"all",s=await rt(`${t}/${o}/conandata.yml`);return{name:e,ecosystem:"conan",githubRepo:s?cke(s):null,homepage:`https://conan.io/center/recipes/${e}`,versions:i,deprecated:null,description:null}}function ake(e){let t=[],n={},i=!1,r=null;for(let o of e.split(` -`)){let s=o.split("#")[0].replace(/\s+$/,"");if(!s.trim())continue;if(/^versions\s*:/.test(s)){i=!0;continue}if(!/^\s/.test(s)){i=!1;continue}if(!i)continue;let a=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){r=a[1].trim(),r&&!t.includes(r)&&t.push(r);continue}let c=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(s);c&&r&&(n[r]=c[1])}return{versions:t,folders:n}}function cke(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=Lt(t[0]);if(n)return n}return null}async function lke(e){let t=e[0]?.toLowerCase();if(!t||!/[a-z0-9]/.test(t))return null;let[n,i]=await Promise.all([$e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/versions/${t}-/${encodeURIComponent(e)}.json`),$e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`)]);if(!n)return null;let r=[];for(let s of n.versions??[]){let a=s.version??s["version-semver"]??s["version-string"]??s["version-date"];a&&!r.includes(a)&&r.push(a)}if(r.length===0)return null;let o=Array.isArray(i?.description)?i.description.join(" "):i?.description??null;return{name:e,ecosystem:"vcpkg",githubRepo:Lt(i?.homepage??null),homepage:i?.homepage??`https://vcpkg.io/en/package/${e}`,versions:r,deprecated:null,description:o}}async function uke(e){let t=await Uk(e);if(t)return{name:t.name,ecosystem:"arduino",githubRepo:t.githubRepo,homepage:t.website??`https://www.arduino.cc/reference/en/libraries/${pke(e)}/`,versions:t.versions,deprecated:null,description:t.description};let n=await dke(e);return n?{name:n.name??e,ecosystem:"arduino",githubRepo:Lt(n.repository_url??null),homepage:n.homepage??null,versions:n.version?.name?[n.version.name]:[],deprecated:null,description:n.description??null}:null}async function dke(e){let n=((await $e(`https://api.registry.platformio.org/v3/search?query=${encodeURIComponent(e)}`))?.items??[]).find(i=>i.name?.toLowerCase()===e.toLowerCase()&&i.owner?.username);return n?$e(`https://api.registry.platformio.org/v3/packages/${encodeURIComponent(n.owner.username)}/library/${encodeURIComponent(n.name)}`):null}function pke(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}async function ca(e,t,n){switch(t){case"npm":return fke(e,n);case"pypi":return mke(e,n);case"go":return gke(e,n);case"cargo":return yke(e,n);default:return null}}function Bk(e){return{version:e,license:null,releasedAt:null,runtime:null,dependencies:[],withdrawn:null}}async function fke(e,t){let n=await $e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`),i=n?.versions?.[t];if(!i)return null;let r=i.engines?.node;return{...Bk(t),license:typeof i.license=="string"?i.license:i.license?.type??null,releasedAt:n?.time?.[t]??null,runtime:r?{name:"Node.js",requirement:r}:null,dependencies:Object.keys(i.dependencies??{}),withdrawn:i.deprecated??null}}async function mke(e,t){let n=await $e(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{immutable:!0});if(!n?.info)return null;let i=n.info.requires_python;return{...Bk(t),license:n.info.license||null,releasedAt:n.urls?.[0]?.upload_time_iso_8601??null,runtime:i?{name:"Python",requirement:i}:null,dependencies:(n.info.requires_dist??[]).map(r=>/^\s*([A-Za-z0-9._-]+)/.exec(r)?.[1]).filter(r=>!!r),withdrawn:n.info.yanked?`Release yanked: ${n.info.yanked_reason??"no reason given"}`:null}}async function gke(e,t){let n=t.startsWith("v")?t:`v${t}`,i=`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/${encodeURIComponent(n)}`,[r,o]=await Promise.all([rt(`${i}.mod`,{immutable:!0}),$e(`${i}.info`,{immutable:!0})]);if(!r&&!o)return null;let s=r?/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(r)?.[1]:null;return{...Bk(n),releasedAt:o?.Time??null,runtime:s?{name:"Go",requirement:`>=${s}`}:null,withdrawn:r?hke(r,n):null}}function hke(e,t){let n=t.replace(/^v/,"");for(let r of e.matchAll(/^\s*retract\s+(.+)$/gm)){let o=r[1].trim(),s=/\/\/\s*(.+)$/.exec(o)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.",c=/^v?([\w.+-]+)/.exec(o.replace(/\/\/.*$/,"").trim())?.[1];if(c&&c===n)return a;let l=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(l&&HH(n,l[1],l[2]))return a}let i=/^\s*retract\s*\(([\s\S]*?)^\s*\)/m.exec(e)?.[1];if(i)for(let r of i.split(` -`)){let o=r.replace(/\/\/.*$/,"").trim();if(!o)continue;let s=/\/\/\s*(.+)$/.exec(r)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.";if(/^v?([\w.+-]+)$/.exec(o)?.[1]===n)return a;let c=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(c&&HH(n,c[1],c[2]))return a}return null}function HH(e,t,n){return KH(e,t)>=0&&KH(e,n)<=0}function KH(e,t){let n=e.split(/[.+-]/).map(r=>Number.parseInt(r,10)),i=t.split(/[.+-]/).map(r=>Number.parseInt(r,10));for(let r=0;r=${i}`}:null,withdrawn:n.version.yanked?"This release was yanked from crates.io.":null}}async function YH(e,t,n){let i={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};t&&(i.Authorization=`Bearer ${t}`);let r=await $e(`https://api.github.com/repos/${e}`,{headers:i,...n?{onRetry:n}:{}});if(!r)return null;let o=r.license?.spdx_id;return{archived:r.archived===!0,pushedAt:r.pushed_at??null,license:o&&o!=="NOASSERTION"?o:null,url:r.html_url??`https://github.com/${e}`}}async function bke(e,t){let n=await $e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`);if(!n)return null;let i=Object.keys(n.versions??{}),r=t?n.versions?.[t]:void 0;return{name:e,ecosystem:"npm",githubRepo:Lt(JH(n.repository))??Lt(JH(r?.repository))??Lt(n.homepage),homepage:n.homepage??null,versions:i,deprecated:r?.deprecated??null,description:n.description??null}}async function vke(e,t){let n=await $e(`https://pypi.org/pypi/${encodeURIComponent(e)}/json`);if(!n)return null;let o=[...Object.values(n.info?.project_urls??{}),n.info?.home_page??""].map(Lt).find(c=>c!==null)??null,a=(t?n.releases?.[t]??[]:[]).find(c=>c.yanked);return{name:e,ecosystem:"pypi",githubRepo:o,homepage:n.info?.home_page??null,versions:Object.keys(n.releases??{}),deprecated:a?`Release yanked: ${a.yanked_reason??"no reason given"}`:null,description:n.info?.summary??null}}async function wke(e){let t=await $e(`https://crates.io/api/v1/crates/${encodeURIComponent(e)}`);return t?{name:e,ecosystem:"cargo",githubRepo:Lt(t.crate?.repository)??Lt(t.crate?.homepage),homepage:t.crate?.homepage??null,versions:(t.versions??[]).map(n=>n.num),deprecated:null,description:t.crate?.description??null}:null}async function kke(e){let t=await rt(`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/list`);return{name:e,ecosystem:"go",githubRepo:_ke(e),homepage:`https://pkg.go.dev/${e}`,versions:t?t.split(` -`).map(n=>n.trim()).filter(Boolean):[],deprecated:null,description:null}}var $ke={grpc:"grpc/grpc-go",protobuf:"protocolbuffers/protobuf-go",api:"googleapis/google-api-go-client",genproto:"googleapis/go-genproto",appengine:"golang/appengine"};function _ke(e){let t=e.replace(/\/v[2-9]\d*$/,""),n=[[/^golang\.org\/x\/([\w.-]+)/,i=>`golang/${i[1]}`],[/^google\.golang\.org\/(\w+)/,i=>$ke[i[1]]??`googleapis/go-${i[1]}`],[/^go\.uber\.org\/([\w.-]+)/,i=>`uber-go/${i[1]}`],[/^sigs\.k8s\.io\/([\w.-]+)/,i=>`kubernetes-sigs/${i[1]}`],[/^k8s\.io\/([\w.-]+)/,i=>`kubernetes/${i[1]}`],[/^gopkg\.in\/([\w.-]+)\/([\w.-]+?)\.v\d+$/,i=>`${i[1]}/${i[2]}`],[/^gopkg\.in\/([\w.-]+?)\.v\d+$/,i=>`go-${i[1]}/${i[1]}`]];for(let[i,r]of n){let o=i.exec(t);if(o)return r(o)}return Lt(`https://${t}`)}async function Ske(e){let[t,n]=e.split(":");if(!t||!n)return null;let i=await $e(`https://search.maven.org/solrsearch/select?q=g:%22${encodeURIComponent(t)}%22+AND+a:%22${encodeURIComponent(n)}%22&core=gav&rows=100&wt=json`);return{name:e,ecosystem:"maven",githubRepo:null,homepage:`https://central.sonatype.com/artifact/${t}/${n}`,versions:(i?.response?.docs??[]).map(r=>r.v),deprecated:null,description:null}}async function xke(e){let t=await $e(`https://rubygems.org/api/v1/gems/${encodeURIComponent(e)}.json`);if(!t)return null;let n=await $e(`https://rubygems.org/api/v1/versions/${encodeURIComponent(e)}.json`);return{name:e,ecosystem:"rubygems",githubRepo:Lt(t.source_code_uri)??Lt(t.homepage_uri)??Lt(t.changelog_uri),homepage:t.homepage_uri??null,versions:(n??[]).map(i=>i.number),deprecated:null,description:t.info??null,changelogUrl:t.changelog_uri??null,documentationUrl:t.documentation_uri??null}}function JH(e){if(e)return typeof e=="string"?e:e.url}function Lt(e){if(!e)return null;let t=/^github:([\w.-]+)\/([\w.-]+)$/.exec(e.trim());if(t)return`${t[1]}/${ZH(t[2])}`;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)/.exec(e);if(!n)return null;let i=n[1],r=ZH(n[2]);return!i||!r||i==="sponsors"?null:`${i}/${r}`}function ZH(e){return e.replace(/\.git$/,"")}async function XH(e,t={}){let n=t.lookup??((i,r)=>Wn(i,r,null));return Promise.all(e.map(async i=>{let r=i.rawFrom!=null&&i.from===null,o=i.rawTo!=null&&i.to===null;if(!r&&!o||i.source==="lockfile"||!Eke.has(i.ecosystem))return i;let a=(await n(i.name,i.ecosystem).catch(p=>(t.logger?.debug?.(`range resolution: registry lookup for ${i.name} failed: ${String(p)}`),null)))?.versions??[];if(a.length===0)return i;let c=r?QH(a,i.rawFrom):i.from,l=o?QH(a,i.rawTo):i.to;if(r&&!c||o&&!l)return i;let u=c??i.from,d=l??i.to;return t.logger?.debug?.(`range resolution: ${i.name} ${i.rawFrom} \u2192 ${i.rawTo} resolves to ${u} \u2192 ${d}`),{...i,from:u,to:d,bump:u&&d?ta(u,d,i.ecosystem):i.bump}}))}var Eke=new Set(["npm"]);function QH(e,t){let n=t.trim().replace(/^v(?=\d)/,"");return Mg.default.valid(n)?e.includes(n)?n:Mg.default.valid(n):Mg.default.validRange(n)?Mg.default.maxSatisfying([...e],n,{includePrerelease:!1}):null}var xd=require("node:fs"),tK=gt(gc(),1);function Hn(){return{async readFile(e){try{return(0,xd.readFileSync)(e,"utf8")}catch{return null}},async readDirectory(e){try{return(0,xd.readdirSync)(e)}catch{return[]}},async isDirectory(e){try{return(0,xd.statSync)(e).isDirectory()}catch{return!1}}}}async function Ed(e,t){let i=(await Promise.all([Tke(e,t),Ike(e,t),Ake(e,t),Rke(e,t),Nke(e,t),Cke(e,t)])).filter(o=>o!==null);return i.find(o=>o.kind==="pnpm-workspace")?i.filter(o=>o.kind!=="npm-workspaces"):i}function Td(e){let t=new Set;for(let n of e)for(let i of n.members)t.add(i.dir);return t.size===0?[""]:[...t].sort()}function Fc(e,t){let n=null;for(let i of t){if(i===""){n===null&&(n="");continue}(e===i||e.startsWith(`${i}/`))&&(n===null||i.length>n.length)&&(n=i)}return n}function xP(e,t){return t===""||e===t||e.startsWith(`${t}/`)}function nK(e,t){if(t.length===0)return[...e];let n=Td(t),i=new Map;for(let r of t)for(let o of r.members)o.name&&i.set(o.dir,o.name);return e.map(r=>{let o=Fc(r.manifestPath,n);if(o===null)return r;let s=i.get(o);return{...r,workspace:o,...s?{workspaceName:s}:{}}})}function qk(e){return e.workspace===void 0?null:e.workspaceName??(e.workspace===""?"the repository root":e.workspace)}async function Tke(e,t){let n=await t.readFile(Hr(e,"package.json"));if(!n)return null;let i=Gt(n),r=Array.isArray(i?.workspaces)?i.workspaces:i?.workspaces?.packages;return!r||r.length===0?null:{kind:"npm-workspaces",ecosystem:"npm",declaredIn:"package.json",members:await Id(e,t,r,"npm","package.json",i?.name??null)}}async function Ike(e,t){let n=await t.readFile(Hr(e,"pnpm-workspace.yaml"));if(!n)return null;let i=[];try{let o=(0,tK.parse)(n);Array.isArray(o?.packages)&&(i=o.packages.filter(s=>typeof s=="string"))}catch{return null}if(i.length===0)return null;let r=Gt(await t.readFile(Hr(e,"package.json"))??"")?.name??null;return{kind:"pnpm-workspace",ecosystem:"npm",declaredIn:"pnpm-workspace.yaml",members:await Id(e,t,i,"npm","package.json",r)}}async function Ake(e,t){let n=await t.readFile(Hr(e,"Cargo.toml"));if(!n)return null;let i=pi(n),r=i.find(c=>c.header==="workspace");if(!r)return null;let o=Ag(r.entries.get("members")??""),s=i.some(c=>c.header==="package"),a=s?rK(i.find(c=>c.header==="package")?.entries.get("name")??""):null;return{kind:"cargo-workspace",ecosystem:"cargo",declaredIn:"Cargo.toml",members:await Id(e,t,o,"cargo","Cargo.toml",a,!s)}}async function Rke(e,t){let n=await t.readFile(Hr(e,"go.work"));if(!n)return null;let i=[],r=!1;for(let o of n.split(` -`)){let s=o.split("//")[0].trim();if(!s)continue;if(/^use\s*\($/.test(s)){r=!0;continue}if(r&&s===")"){r=!1;continue}let a=/^use\s+(\S+)$/.exec(s);a?i.push(a[1]):r&&i.push(s)}return{kind:"go-work",ecosystem:"go",declaredIn:"go.work",members:await Id(e,t,i,"go","go.mod",null,!0)}}async function Nke(e,t){let n=await t.readFile(Hr(e,"pom.xml"));if(!n)return null;let i=/([\s\S]*?)<\/modules>/.exec(n);if(!i)return null;let r=[...i[1].matchAll(/\s*([^<]+?)\s*<\/module>/g)].map(s=>s[1]);if(r.length===0)return null;let o=/\s*([^<]+?)\s*<\/artifactId>/.exec(n)?.[1]??null;return{kind:"maven-modules",ecosystem:"maven",declaredIn:"pom.xml",members:await Id(e,t,r,"maven","pom.xml",o)}}async function Cke(e,t){let n=await t.readFile(Hr(e,"settings.gradle.kts"))?"settings.gradle.kts":await t.readFile(Hr(e,"settings.gradle"))?"settings.gradle":null;if(!n)return null;let r=[...(await t.readFile(Hr(e,n))??"").matchAll(/include\s*\(?\s*((?:['"][^'"]+['"]\s*,?\s*)+)/g)].flatMap(o=>[...o[1].matchAll(/['"]([^'"]+)['"]/g)].map(s=>s[1])).map(o=>o.replace(/^:/,"").replace(/:/g,"/"));return r.length===0?null:{kind:"gradle-settings",ecosystem:"maven",declaredIn:n,members:await Id(e,t,r,"maven","build.gradle",null,!0)}}async function Id(e,t,n,i,r,o,s=!1){let a=new Set,c=new Set;for(let u of n){let d=u.trim();if(d.startsWith("!"))for(let p of await eK(e,t,d.slice(1),r))c.add(p);else for(let p of await eK(e,t,d,r))a.add(p)}for(let u of c)a.delete(u);let l=[];s||l.push({dir:"",name:o,ecosystem:i});for(let u of[...a].sort())u!==""&&l.push({dir:u,name:await Lg(e,t,u,r,i),ecosystem:i});return l}async function eK(e,t,n,i){let r=n.replace(/^\.\//,"").replace(/\/+$/,"");if(r.startsWith("!"))return[];if(!r.includes("*"))return[r];let o=r.split("/"),s=o.findIndex(p=>p.includes("*")),a=o.slice(0,s).join("/"),c=o[s]==="**",l=o.slice(s+1).join("/"),u=[],d=async(p,f)=>{if(!(f>4))for(let m of await t.readDirectory(Hr(e,p))){if(m.startsWith(".")||m==="node_modules"||m==="target")continue;let g=p?`${p}/${m}`:m;if(!await t.isDirectory(Hr(e,g)))continue;let h=l?`${g}/${l}`:g;(!i||await t.readFile(Hr(e,h,i))!==null)&&u.push(h),c&&await d(g,f+1)}};return await d(a,0),u}async function Lg(e,t,n,i,r){let o=await t.readFile(Hr(e,n,i));if(!o)return null;switch(r){case"npm":return Gt(o)?.name??null;case"cargo":{let s=pi(o).find(a=>a.header==="package");return rK(s?.entries.get("name")??"")||null}case"go":return/^\s*module\s+(\S+)/m.exec(o)?.[1]??null;case"maven":return/\s*([^<]+?)\s*<\/artifactId>/.exec(o)?.[1]??null;default:return null}}function rK(e){return e.trim().replace(/^["']|["']$/g,"")}function Hr(...e){return e.filter(Boolean).join("/")}var Wk=(e,t,n,i)=>e==="dev"?[t]:e==="optional"?[n]:e==="peer"&&i?[i]:[],Pke=e=>e?[...e.section==="dev-dependencies"?["--dev"]:[],...e.section==="build-dependencies"?["--build"]:[],...e.target?["--target",e.target]:[]]:[],EP=[{id:"npm",batchable:!0,ecosystem:"npm",label:"npm",manifests:["package.json"],lockfiles:["package-lock.json","npm-shrinkwrap.json"],outdated:{command:"npm",args:["outdated","--json"]},install:{command:"npm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"npm",args:["install",`${e}@${t}`,...Wk(n,"--save-dev","--save-optional","--save-peer")]})},{id:"pnpm",batchable:!0,ecosystem:"npm",label:"pnpm",manifests:["package.json"],lockfiles:["pnpm-lock.yaml"],outdated:{command:"pnpm",args:["outdated"]},install:{command:"pnpm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"pnpm",args:["add",`${e}@${t}`,...Wk(n,"--save-dev","--save-optional","--save-peer")]})},{id:"yarn-berry",batchable:!0,ecosystem:"npm",label:"Yarn (berry)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:null,install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"yarn",args:["add",`${e}@${t}`,...Wk(n,"--dev","--optional","--peer")]})},{id:"yarn",batchable:!0,ecosystem:"npm",label:"Yarn (classic)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:{command:"yarn",args:["outdated","--json"]},install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t})=>({command:"yarn",args:["upgrade",`${e}@${t}`]})},{id:"bun",batchable:!0,ecosystem:"npm",label:"Bun",manifests:["package.json"],lockfiles:["bun.lock","bun.lockb"],outdated:{command:"bun",args:["outdated"]},install:{command:"bun",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"bun",args:["add",`${e}@${t}`,...Wk(n,"--dev","--optional","--peer")]})},{id:"uv",batchable:!0,ecosystem:"pypi",label:"uv",manifests:["pyproject.toml"],lockfiles:["uv.lock"],outdated:{command:"uv",args:["pip","list","--outdated","--format","json"]},install:{command:"uv",args:["sync"]},upgrade:({name:e,version:t,kind:n})=>({command:"uv",args:["add",`${e}==${t}`,...n==="dev"?["--dev"]:[]]})},{id:"poetry",batchable:!0,ecosystem:"pypi",label:"Poetry",manifests:["pyproject.toml"],lockfiles:["poetry.lock"],outdated:{command:"poetry",args:["show","--outdated"]},install:{command:"poetry",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"poetry",args:["add",`${e}==${t}`,...n==="dev"?["--group","dev"]:[]]})},{id:"pip",batchable:!0,ecosystem:"pypi",label:"pip",manifests:["requirements.in","requirements.txt","pyproject.toml","setup.py"],manifestPattern:/^(?:requirements|constraints)[\w.-]*\.(?:in|txt)$/i,lockfiles:[],outdated:{command:"pip",args:["list","--outdated","--format=json"]},upgrade:({name:e,version:t})=>({command:"pip",args:["install","--upgrade",`${e}==${t}`]}),rewriteManifest:(e,{name:t,version:n},i)=>Oc(i)?Dke(e,t,n):Oke(e,t,n)},{id:"go",batchable:!0,ecosystem:"go",label:"Go modules",manifests:["go.mod"],lockfiles:["go.sum"],outdated:{command:"go",args:["list","-u","-m","all"]},upgrade:({name:e,version:t})=>({command:"go",args:["get",`${e}@${t.startsWith("v")?t:`v${t}`}`]})},{id:"cargo",batchable:!0,ecosystem:"cargo",label:"Cargo",manifests:["Cargo.toml"],lockfiles:["Cargo.lock"],outdated:{command:"cargo",args:["update","--dry-run"]},upgrade:({name:e,version:t,cargo:n})=>({command:"cargo",args:["add",`${e}@=${t}`,...Pke(n)]})},{id:"bundler",batchable:!0,ecosystem:"rubygems",label:"Bundler",manifests:["Gemfile"],lockfiles:["Gemfile.lock"],outdated:{command:"bundle",args:["outdated"]},install:{command:"bundle",args:["install"]},upgrade:({name:e})=>({command:"bundle",args:["update",e,"--conservative"]}),rewriteManifest:(e,{name:t,version:n})=>Mke(e,t,n)},{id:"maven",ecosystem:"maven",label:"Maven",manifests:["pom.xml"],lockfiles:[],outdated:{command:"mvn",args:["versions:display-dependency-updates"]},upgrade:({name:e,version:t})=>({command:"mvn",args:["versions:use-dep-version",`-Dincludes=${e}`,`-DdepVersion=${t}`,"-DforceVersion=true"]})},{id:"gradle",ecosystem:"maven",label:"Gradle",manifests:["gradle/libs.versions.toml","build.gradle","build.gradle.kts"],lockfiles:["gradle.lockfile"],outdated:{command:"gradle",args:["dependencyUpdates"]},upgrade:()=>null},{id:"sbt",ecosystem:"maven",label:"sbt",manifests:["build.sbt"],lockfiles:[],outdated:{command:"sbt",args:["dependencyUpdates"]},upgrade:()=>null},{id:"dotnet",ecosystem:"nuget",label:"NuGet",manifests:["Directory.Packages.props"],manifestPattern:/\.(cs|fs|vb)proj$/i,lockfiles:["packages.lock.json"],outdated:{command:"dotnet",args:["list","package","--outdated"]},install:{command:"dotnet",args:["restore"]},upgrade:({name:e,version:t})=>({command:"dotnet",args:["add","package",e,"--version",t]})},{id:"composer",batchable:!0,ecosystem:"packagist",label:"Composer",manifests:["composer.json"],lockfiles:["composer.lock"],outdated:{command:"composer",args:["outdated","--format=json"]},install:{command:"composer",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"composer",args:["require",`${e}:${t}`,...n==="dev"?["--dev"]:[]]})},{id:"mix",batchable:!0,ecosystem:"hex",label:"Mix",manifests:["mix.exs"],lockfiles:["mix.lock"],outdated:{command:"mix",args:["hex.outdated"]},install:{command:"mix",args:["deps.get"]},upgrade:({name:e})=>({command:"mix",args:["deps.update",e]}),rewriteManifest:(e,{name:t,version:n})=>Lke(e,t,n)},{id:"rebar",ecosystem:"hex",label:"Rebar3",manifests:["rebar.config"],lockfiles:["rebar.lock"],outdated:null,install:{command:"rebar3",args:["get-deps"]},upgrade:({name:e})=>({command:"rebar3",args:["upgrade",e]}),rewriteManifest:(e,{name:t,version:n})=>Fke(e,t,n)},{id:"flutter",ecosystem:"pub",label:"Flutter",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"flutter",args:["pub","outdated"]},install:{command:"flutter",args:["pub","get"]},upgrade:({name:e,version:t})=>({command:"flutter",args:["pub","add",`${e}:${t}`]})},{id:"dart",ecosystem:"pub",label:"Dart pub",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"dart",args:["pub","outdated"]},install:{command:"dart",args:["pub","get"]},upgrade:({name:e,version:t,kind:n})=>({command:"dart",args:["pub","add",...n==="dev"?["dev:"]:[],`${e}:${t}`]})},{id:"swiftpm",ecosystem:"swift",label:"Swift Package Manager",manifests:["Package.swift"],lockfiles:["Package.resolved"],outdated:null,upgrade:()=>null},{id:"cocoapods",batchable:!0,ecosystem:"cocoapods",label:"CocoaPods",manifests:["Podfile"],lockfiles:["Podfile.lock"],outdated:{command:"pod",args:["outdated"]},install:{command:"pod",args:["install"]},upgrade:({name:e})=>({command:"pod",args:["update",e]}),rewriteManifest:(e,{name:t,version:n})=>Uke(e,t,n)},{id:"opam",batchable:!0,ecosystem:"opam",label:"opam",manifests:["dune-project"],manifestPattern:/\.opam$/,lockfiles:[],outdated:null,upgrade:({name:e,version:t})=>({command:"opam",args:["install",`${e}.${t}`,"--yes"]})},{id:"conan",batchable:!0,ecosystem:"conan",label:"Conan",manifests:["conanfile.txt","conanfile.py"],lockfiles:["conan.lock"],outdated:null,upgrade:()=>({command:"conan",args:["install",".","--build=missing"]}),rewriteManifest:(e,{name:t,version:n})=>jke(e,t,n)},{id:"vcpkg",batchable:!0,ecosystem:"vcpkg",label:"vcpkg",manifests:["vcpkg.json"],lockfiles:[],outdated:null,upgrade:()=>({command:"vcpkg",args:["install"]}),rewriteManifest:(e,{name:t,version:n})=>zke(e,t,n)},{id:"arduino-cli",batchable:!0,ecosystem:"arduino",label:"Arduino CLI",manifests:["library.properties"],lockfiles:[],outdated:{command:"arduino-cli",args:["lib","upgrade","--dry-run"]},upgrade:({name:e,version:t})=>({command:"arduino-cli",args:["lib","install",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>Gke(e,t,n)},{id:"platformio",ecosystem:"arduino",label:"PlatformIO",manifests:["platformio.ini"],lockfiles:[],outdated:{command:"pio",args:["pkg","outdated"]},upgrade:({name:e,version:t})=>({command:"pio",args:["pkg","install","--library",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>Vke(e,t,n)}];function la(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dke(e,t,n){let i=la(t).replace(/[-_.]/g,"[-_.]"),r=new RegExp(`^([ \\t]*${i})(\\[[^\\]]*\\])?[ \\t]*(?:[=<>!~]=?\\s*[^\\s;#,]+(?:\\s*,\\s*[=<>!~]=?\\s*[^\\s;#,]+)*)?`,"im");return r.test(e)?e.replace(r,(o,s,a)=>`${s}${a??""}==${n}`):e}function Oke(e,t,n){let i=la(t).replace(/[-_.]/g,"[-_.]"),r=new RegExp(`(["'])${i}(\\[[^\\]]*\\])?(?:\\s*[=<>!~]=?\\s*[^"',;]+(?:\\s*,\\s*[=<>!~]=?\\s*[^"',;]+)*)?\\1`,"i");return r.test(e)?e.replace(r,(o,s,a)=>`${s}${t}${a??""}==${n}${s}`):e}function Mke(e,t,n){let i=la(t),r=new RegExp(`(gem\\s+["']${i}["'])\\s*,\\s*["'][^"']*["']`);if(r.test(e))return e.replace(r,`$1, '${n}'`);let o=new RegExp(`(gem\\s+["']${i}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function Lke(e,t,n){let i=la(t),r=new RegExp(`(\\{\\s*:${i}\\s*,\\s*)"[^"]*"`);return r.test(e)?e.replace(r,`$1"== ${n}"`):e}function Fke(e,t,n){let i=la(t),r=new RegExp(`(\\{\\s*${i}\\s*,\\s*)"[^"]*"`);return r.test(e)?e.replace(r,`$1"${n}"`):e}function Uke(e,t,n){let i=la(t),r=new RegExp(`(pod\\s+["']${i}["'])\\s*,\\s*["'][^"']*["']`);if(r.test(e))return e.replace(r,`$1, '${n}'`);let o=new RegExp(`(pod\\s+["']${i}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function jke(e,t,n){let i=la(t),r=new RegExp(`\\b${i}/[^\\s"'#@]+`,"g");return e.replace(r,`${t}/${n}`)}function zke(e,t,n){let i;try{i=JSON.parse(e)}catch{return e}let r=Array.isArray(i.overrides)?i.overrides:[],o=r.find(s=>s.name===t);return o?o.version=n:r.push({name:t,version:n}),i.overrides=r,`${JSON.stringify(i,null,2)} -`}function Gke(e,t,n){return e.split(` -`).map(i=>{let r=/^(\s*depends\s*=\s*)(.*)$/i.exec(i);if(!r)return i;let o=r[2].split(",").map(s=>s.replace(/\s*\([^)]*\)\s*$/,"").trim()!==t?s:` ${t} (${n})`);return`${r[1]}${o.join(",").replace(/^\s+/,"")}`}).join(` -`)}function Vke(e,t,n){let i=la(t),r=new RegExp(`^(\\s*)((?:[\\w.-]+/)?${i})(@[^\\s;#]*)?\\s*$`,"gm");return e.replace(r,(o,s,a)=>/^\s+/.test(s)?`${s}${a}@${n}`:o)}function Uc(e){return EP.find(t=>t.id===e)}var ua=EP;function iK(e,t){if(!e.batchable||t.length===0)return null;let n=new Map;for(let i of t){let r=e.upgrade(i);if(!r)return null;let o=Bke(e,i,r);if(o===void 0)return null;let s=o===null?r.args:r.args.filter((l,u)=>u!==o),a=`${r.command}\0${o}\0${s.join("\0")}`,c=n.get(a);if(c){o!==null&&c.specs.push(r.args[o]);continue}n.set(a,{command:r,at:o,specs:o===null?[]:[r.args[o]]})}return[...n.values()].map(({command:i,at:r,specs:o})=>r===null?i:{command:i.command,args:[...i.args.slice(0,r),...o,...i.args.slice(r+1)]})}function Bke(e,t,n){let i=e.upgrade({...t,name:qke,version:Wke});if(!i||i.command!==n.command||i.args.length!==n.args.length)return;let r=n.args.reduce((o,s,a)=>s===i.args[a]?o:[...o,a],[]);return r.length===0?null:r.length===1?r[0]:void 0}var qke="\0drift-probe",Wke="\0drift-probe-version";function da(e){let t=new Set(e.entries),n=[];for(let r of EP){let o=r.lockfiles.filter(a=>t.has(a)),s=[...r.manifests.filter(a=>t.has(a)),...r.manifestPattern?e.entries.filter(a=>r.manifestPattern.test(a)):[]];o.length===0&&s.length===0||Hke(r,e,t)&&n.push({manager:r,evidence:[...o,...s],fromLockfile:o.length>0})}let i=new Set(n.filter(r=>r.fromLockfile).map(r=>r.manager.ecosystem));return n.filter(r=>r.fromLockfile||!i.has(r.manager.ecosystem))}function Hke(e,t,n){if(e.id==="yarn"||e.id==="yarn-berry"){let i=n.has(".yarnrc.yml")||(t.read?.("yarn.lock")??"").includes("__metadata");return e.id==="yarn-berry"?i:!i}if(e.id==="dart"||e.id==="flutter"){let i=t.read?.("pubspec.yaml")??"",r=/^\s*(flutter|flutter_test)\s*:/m.test(i)||/sdk:\s*flutter/.test(i);return e.id==="flutter"?r:!r}return!0}function oK(e){let t=new Map;for(let n of e){let i=t.get(n.manager.ecosystem)??[];i.push(n),t.set(n.manager.ecosystem,i)}return[...t.entries()].filter(([,n])=>n.length>1).map(([n,i])=>({ecosystem:n,candidates:i}))}function sK(e){return[e.command,...e.args].join(" ")}var pa=require("node:fs/promises"),jc=require("node:path");var IP=new Set([".git",".hg",".svn","node_modules","vendor","bower_components",".venv","venv","env","__pycache__",".tox","site-packages","target","build","dist","out",".next",".nuxt",".svelte-kit","coverage",".pytest_cache",".mypy_cache",".gradle",".idea",".vscode",".terraform","Pods","DerivedData",".pio","third_party","thirdparty","cmake-build-debug","cmake-build-release"]),Kke=new Set(["package.json",".nvmrc",".node-version",".ruby-version",".python-version",".tool-versions","dockerfile","containerfile","go.mod","gemfile","pom.xml","build.gradle","build.gradle.kts","cargo.toml","rust-toolchain","rust-toolchain.toml","pyproject.toml","setup.py","setup.cfg","runtime.txt",".ruby-gemset"]);function AP(e){let t=(e.split("/").pop()??"").toLowerCase();return Kke.has(t)||t.startsWith("dockerfile")||t.startsWith("containerfile")||t.endsWith(".gemspec")?!0:/^\.github\/workflows\/.+\.ya?ml$/.test(e)||/^\.(gitlab-ci|circleci)/.test(e)}var Jke={".ts":"typescript",".tsx":"typescript",".mts":"typescript",".cts":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".go":"go",".rs":"rust",".c":"c",".h":"c",".cpp":"cpp",".cc":"cpp",".cxx":"cpp",".c++":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".h++":"cpp",".inl":"cpp",".tpp":"cpp",".ino":"cpp",".pde":"cpp",".java":"java",".kt":"java",".kts":"java",".scala":"java",".rb":"ruby",".rake":"ruby",".cs":"dotnet",".fs":"dotnet",".vb":"dotnet",".php":"php",".ex":"elixir",".exs":"elixir",".erl":"erlang",".dart":"dart",".swift":"swift",".ml":"ocaml",".mli":"ocaml"},aK=64*1024,Zke=2e3,Yke=["@generated","do not edit","do not modify","auto-generated","autogenerated","generated by","webpackbootstrap","sourcemappingurl"];async function Qke(e){let t;try{let r=await(0,pa.open)(e,"r");try{let o=Buffer.alloc(aK),{bytesRead:s}=await r.read(o,0,aK,0);t=o.subarray(0,s).toString("utf8")}finally{await r.close()}}catch{return!1}let n=t.slice(0,4e3).toLowerCase();if(Yke.some(r=>n.includes(r)))return!0;let i=t.split(` -`);return i.length===1?!0:i.slice(0,-1).some(r=>r.length>Zke)}function cK(e){let t=e.lastIndexOf(".");return t===-1?"other":Jke[e.slice(t).toLowerCase()]??"other"}async function Ad(e,t={}){let{maxFileBytes:n=512*1024,maxFiles:i=5e3,extraIgnores:r=[],members:o}=t,s=new Set([...IP,...r]),a=async _=>{let S;try{S=await Xke.run(()=>(0,pa.readdir)(_,{withFileTypes:!0}))}catch{return[]}let x=[];for(let E of S){let T=(0,jc.join)(_,E.name);if(E.isDirectory()){if(s.has(E.name)||E.name.startsWith(".")&&E.name!==".github"&&E.name!==".circleci")continue;x.push(a(T));continue}if(!E.isFile())continue;let A=t$e((0,jc.relative)(e,T)),L=AP(A)?"config":cK(E.name);L!=="other"&&(/\.min\.(js|ts)$/.test(E.name)||/\.d\.ts\.map$/.test(E.name)||x.push([{full:T,repoPath:A,language:L}]))}return(await Promise.all(x)).flat()},c=await a(e),l=c.filter(_=>_.language==="config"),u=c.filter(_=>_.language!=="config"),d=[],p=0,f=0,m=0,g=async _=>{let S=await qn(_,e$e,async x=>{try{return(await(0,pa.stat)(x.full)).size>n?(await Qke(x.full)?f+=1:m+=1,null):await(0,pa.readFile)(x.full,"utf8")}catch{return null}});for(let[x,E]of S.entries()){if(E===null)continue;let T=_[x];d.push({path:T.repoPath,language:T.language,content:E,lineCount:n$e(E),...o?{member:Fc(T.repoPath,o)}:{}})}};await g(l);let h=0;for(;h_.path.localeCompare(S.path)),y=h+f===u.length,w=d.filter(_=>_.language==="config").length,k={localizationRan:!0,localizationComplete:y,sourceFilesDiscovered:u.length,sourceFilesIndexed:h,sourceTruncated:!y,generatedFilesSkipped:f,oversizedSourceSkipped:m,runtimeConfigsDiscovered:l.length,runtimeConfigsIndexed:w,runtimeConfigComplete:l.length===w};return Object.defineProperty(b,"coverage",{value:k,enumerable:!1}),b}var TP=class{constructor(t){this.limit=t}limit;active=0;waiting=[];async run(t){this.active>=this.limit&&await new Promise(n=>this.waiting.push(n)),this.active+=1;try{return await t()}finally{this.active-=1,this.waiting.shift()?.()}}},Xke=new TP(64),e$e=16;function t$e(e){return jc.sep==="/"?e:e.split(jc.sep).join("/")}function n$e(e){let t=1;for(let n=0;ne.manifests)),RP=new Map;for(let e of ua)for(let t of e.manifests)RP.has(t)||RP.set(t,e.ecosystem);function lK(e){let t=RP.get(e);if(t)return t;for(let n of ua){let i=n.manifestPattern;if(i&&(i.lastIndex=0,i.test(e)))return n.ecosystem}return null}async function Kk(e,t,n=[],i=8){let r=new Set(n),o=[],s=async(a,c)=>{if(c>i)return;let l=await t.readDirectory(Hk(e,a));if(l.length===0)return;let u=!1;if(a!==""&&!r.has(a)){u=l.includes(".git");let d=l.find(f=>r$e.has(f))??l.find(f=>lK(f)),p=d?lK(d):null;d&&p&&(u||!o$e(a))&&o.push({dir:a,ecosystem:p,manifestPath:Hk(a,d),hasOwnGit:u})}if(!u)for(let d of l){if(IP.has(d)||d.startsWith(".")&&d!==".github")continue;let p=Hk(a,d);r.has(p)||await t.isDirectory(Hk(e,p))&&await s(p,c+1)}};return await s("",0),o}var i$e=new Set(["fixtures","__fixtures__","testdata","registry"]);function o$e(e){let t=e.split("/").filter(Boolean).map(i=>i.toLowerCase()),n=t.findIndex(i=>i==="test"||i==="tests");return n===-1?!1:t.slice(n+1).some(i=>i$e.has(i))}function Hk(...e){return e.filter(Boolean).join("/")}var dK=require("node:crypto");function St(e,...t){let n=(0,dK.createHash)("sha256").update(t.map(i=>String(i??"")).join(" ")).digest("hex");return`${e}_${n.slice(0,10)}`}function zc(e){return e.workspace===void 0?e.name:`${e.workspace} ${e.name}`}function cn(e){return`${e.ecosystem} ${zc(e)}`}function NP(e){return JSON.stringify([e.ecosystem,e.name,e.from??null,e.to??null])}function uK(e){let t=0,n=e.length;for(;tt&&e.charCodeAt(n-1)===45;)n--;return e.slice(t,n)}function pK(e,t=40){let n=uK(e.toLowerCase().replace(/[^a-z0-9]+/g,"-"));return uK(n.slice(0,t))||"change"}var s$e=["CHANGELOG.md","CHANGELOG.markdown","CHANGELOG","CHANGES.md","Changes.md","HISTORY.md","NEWS.md","RELEASES.md","RELEASE-NOTES.md","RELEASE_NOTES.md","CHANGELOG.rst","CHANGES.rst","CHANGELOG.txt","docs/CHANGELOG.md","docs/changelog.md","changelog.md"],a$e=["MIGRATING.md","MIGRATION.md","UPGRADING.md","UPGRADE.md","docs/migration.md","docs/migrating.md","docs/upgrading.md","docs/MIGRATION.md","docs/UPGRADE.md"];async function hK(e,t=["main","master"]){return yK(e,s$e,t)}async function c$e(e,t=["main","master"]){return yK(e,a$e,t)}var fK=1,mK=16;function*l$e(e){if(e.length!==0){yield e.slice(0,fK);for(let t=fK;tt.map(o=>({branch:r,filename:o})));for(let r of l$e(i)){let o=await Promise.all(r.map(({branch:l,filename:u})=>rt(`https://raw.githubusercontent.com/${e}/${l}/${u}`,{retries:0}))),s=o.findIndex(l=>l!==null&&l.trim()!=="");if(s<0)continue;let{branch:a,filename:c}=r[s];return{path:c,url:`https://github.com/${e}/blob/${a}/${c}`,content:o[s],branch:a}}return null}function u$e(e,t="npm"){let n=[],i=new Set;for(let r of e.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)){let o=r[1],s=r[2];if(/^[a-z]+:/i.test(s)||s.startsWith("#")||!/\.(md|markdown|rst|txt)$/i.test(s))continue;let a=CP(o,t)??CP(s.replace(/[/\\]/g," "),t);if(!a)continue;let c=s.replace(/^\.?\//,"").split("#")[0];i.has(c)||(i.add(c),n.push({path:c,version:a}))}return n}async function bK(e,t,n,i="npm",r={}){let{branches:o=["main","master"],maxDocuments:s=12}=r,a=await hK(e,o);return a?wK(a,e,t,n,i,s):[]}async function vK(e,t,n,i,r="npm",o=12){let s=/^https?:\/\/github\.com\/([^/]+\/[^/]+)\/blob\/([^/]+)\/(.+)$/i.exec(e),a=s?`https://raw.githubusercontent.com/${s[1]}/${s[2]}/${s[3]}`:e,c=await rt(a,{retries:0});if(!c||!c.trim())return[];let l=decodeURIComponent(new URL(e).pathname.split("/").pop()||"changelog"),u=s?.[2]??"main",d=s?.[1]??t;s?.[3]&&(l=s[3]);let p={path:l,url:e,content:c,branch:u};return d?wK(p,d,n,i,r,o):[p]}async function wK(e,t,n,i,r,o){if(DP(PP(e.content,r),n,i,r).length>0)return[e];let s=u$e(e.content,r).filter(l=>d$e(l.version,n,i,r));if(s.length===0)return[e];let c=(await Promise.all([...s].sort((l,u)=>$K(u.version,l.version,r)).slice(0,o).map(async l=>{let u=await rt(`https://raw.githubusercontent.com/${t}/${e.branch}/${l.path}`,{retries:0});return!u||!u.trim()?null:{path:l.path,url:`https://github.com/${t}/blob/${e.branch}/${l.path}`,content:u,branch:e.branch}}))).filter(l=>l!==null);return c.length>0?c:[e]}async function kK(e,t=["main","master"]){let[n,i]=await Promise.all([c$e(e,t),hK(e,t)]),r=n?[n]:[];if(!i)return r;let o=[...i.content.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)].filter(([,s,a])=>gK.test(s)||gK.test(a)).map(([,,s])=>s.replace(/^\.?\//,"").split("#")[0]).filter(s=>/\.(md|markdown|rst|txt)$/i.test(s)&&!/^[a-z]+:/i.test(s));for(let s of[...new Set(o)].slice(0,4)){if(r.some(c=>c.path===s))continue;let a=await rt(`https://raw.githubusercontent.com/${e}/${i.branch}/${s}`,{retries:0});!a||!a.trim()||r.push({path:s,url:`https://github.com/${e}/blob/${i.branch}/${s}`,content:a,branch:i.branch})}return r}var gK=/migrat|upgrad/i;function d$e(e,t,n,i){let r=Te(t,i),o=Te(n,i),s=Te(e,i);if(!r||!o||!s)return!1;let a=Qe(o,r);if(a===null)return!1;let[c,l]=a>0?[r,o]:[o,r],u=Qe(s,c),d=Qe(s,l);return u!==null&&d!==null&&u>0&&d<=0}function PP(e,t="npm"){let n=[],i=e.split(` -`),r=null;for(let o=0;o0?[r,o]:[o,r];return e.filter(l=>{let u=Te(l.version,i);if(!u)return!1;let d=Qe(u,a),p=Qe(u,c);return d!==null&&p!==null&&d>0&&p<=0}).sort((l,u)=>$K(u.version,l.version,i))}function $K(e,t,n){let i=Te(e,n),r=Te(t,n);return i&&r?Qe(i,r)??0:0}function Fg(e){let t=[],n=e.split(` -`),i=!1,r=0;for(let o of n){let s=/^(#{1,6})\s(.*)$/.exec(o);if(s){let c=s[1].length,l=s[2].trimStart();if(f$e.test(l)){i=!0,r=c,t.push(o.trim());continue}i&&c<=r&&(i=!1)}let a=o.trim();if(a){if(i){t.push(a);continue}g$e(a)&&t.push(a)}}return h$e(t)}var p$e=/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b|\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,f$e=/breaking|incompatib|removed|migration|upgrade\s+guide|deprecat|commonjs/i,m$e=/\b(BREAKING(\s+CHANGE)?|breaking change|no longer|has been removed|have been removed|was removed|were removed|is removed|renamed to|renamed from|replaced by|replaced with|now requires?|required\s+node|must now|dropped support|drop support|removed support|is now required|are now required|moved to|deprecated in favou?r of|minimum\s+(?:supported\s+)?(?:node|python|go|ruby|java|rust))\b/i;function g$e(e){return m$e.test(e)||p$e.test(e)}function h$e(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}async function _K(e,t,n,i,r={}){let{token:o,maxReleases:s=25}=r,a={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};o&&(a.Authorization=`Bearer ${o}`);let c=Te(t,i),l=Te(n,i);if(!c||!l)return[];let u=Qe(l,c);if(u===null)return[];let[d,p]=u>0?[c,l]:[l,c],f=[],m=100,g=5;for(let h=1;h<=g;h++){let b=await $e(`https://api.github.com/repos/${e}/releases?per_page=${m}&page=${h}`,{headers:a});if(!b||b.length===0)break;let y=!1;for(let w of b){if(w.draft)continue;let k=b$e(w.tag_name,i);if(!k)continue;let _=Qe(k,d),S=Qe(k,p);if(!(_===null||S===null)){if(_<=0){y=!0;continue}S>0||f.push({tag:w.tag_name,version:k.raw,name:w.name,body:w.body??"",url:w.html_url,publishedAt:w.published_at})}}if(y||b.lengthTe(a.version,n),r=[...e].sort((a,c)=>{let l=i(a),u=i(c);return l&&u?-(Qe(l,u)??0):0});if(r.length<=t)return r;let o=r.filter(a=>{let c=i(a);return!!(c?.release&&(c.release[2]??0)===0&&!c.prerelease)}).sort((a,c)=>{let l=i(a),u=i(c);return l&&u?Qe(l,u)??0:0}),s=new Map;for(let a of o){if(s.size>=t)break;s.set(a.version,a)}for(let a of r){if(s.size>=t)break;s.set(a.version,a)}return[...s.values()].sort((a,c)=>{let l=i(a),u=i(c);return l&&u?-(Qe(l,u)??0):0})}function b$e(e,t){let n=Te(e,t);if(n)return n;let i=e.match(/v?\d[0-9A-Za-z.!+_-]*(?:\.[0-9A-Za-z!+_-]+)*/g)??[];for(let r of i){let o=Te(r,t)??(r.startsWith("v")?Te(r.slice(1),t):null);if(o)return o}return null}var z$=require("node:fs/promises"),c8=require("node:os"),l8=require("node:path");var SK=require("node:child_process");var v$e=18e4,w$e=32*1024*1024;function k$e(e,t){let n=e.slice(e.lastIndexOf("/")+1),i=t[0];return i&&!i.startsWith("-")?`${n} ${i}`:n}var Xe=(e,t,n={})=>new Promise(i=>{let r=k$e(e,t),o=Pg()?It("exec",r):null;o&&nt("exec.spawned");let s=Date.now(),a=(0,SK.execFile)(e,[...t],{cwd:n.cwd,timeout:n.timeoutMs??v$e,maxBuffer:n.maxBuffer??w$e,env:n.env??process.env,windowsHide:!0,encoding:"utf8",...n.signal?{signal:n.signal}:{}},(c,l,u)=>{if(o?.end({code:c?1:0}),!c){uP({label:r,durationMs:Date.now()-s,exitCode:0,stdoutBytes:l.length,stderrBytes:u.length}),i({code:0,stdout:l,stderr:u});return}let d=c,p=d.code==="ENOENT"?"not-found":d.killed||d.name==="AbortError"||d.code==="ABORT_ERR"?"timeout":"error";uP({label:r,durationMs:Date.now()-s,exitCode:typeof d.code=="number"?d.code:null,failure:p,stdoutBytes:(l??"").length,stderrBytes:(u??"").length}),i({code:typeof d.code=="number"?d.code:1,stdout:l??"",stderr:u??String(c.message??""),failure:p})});if(n.onOutput){let c=l=>{try{n.onOutput(String(l))}catch{}};a.stdout?.on("data",c),a.stderr?.on("data",c)}a.stdin?.end()});async function Jk(e,t,n=["--version"]){let i=await e(t,n,{timeoutMs:2e4});return i.failure!=="not-found"&&i.code===0}var AK=gt(gc(),1),OP="openapi-diff",LP={id:"openapi",source:"openapi-diff",tool:OP,weight:1,originClass:"computed-artifact",config:{enabled:"openapi",paths:"openapiSpecs"},handles(e,t){return Rd(t)!==null},async compute(e){return!Rd(e.before)||!Rd(e.after)?{available:!1,reason:"parse-failed",detail:`${e.path} is not a document Drift could read as an OpenAPI or Swagger spec on both sides of this change.`,tool:OP}:{available:!0,changes:RK(e.before,e.after).map(t=>({code:t.kind,location:t.location,pointer:t.pointer,detail:t.detail})),tool:OP,weight:1,locator:e.path}},codes:{"path-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"operation-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"response-status-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this success status. Update response handling so the removed status is no longer treated as a success path.`},"parameter-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`A required parameter was removed from \`${e}\`. Remove it from client calls; sending it may now be rejected as an unexpected parameter.`},"parameter-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"parameter-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-now-required":{kind:"required-field-added",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"request-enum-narrowed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer accepts some previously-valid values. Find code that sends the removed values and map them onto still-supported ones.`},"response-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this field. Update every reader of that field. If the value is genuinely no longer available, propagate the absence properly rather than substituting a placeholder that could be mistaken for real data.`},"response-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The response type for \`${e}\` changed. Update parsing and any downstream type declarations.`},"response-enum-widened":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` can now return values this code has never seen. Add explicit handling; make sure exhaustive switches and mapping tables have a safe default rather than falling through silently.`},"security-added":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires authentication. Ensure the client attaches credentials for this call, reusing the repo's existing auth mechanism \u2014 never introduce a new credential source or hard-code a token.`}}},$$e=["get","put","post","delete","options","head","patch","trace"];function Rd(e){let t;try{t=e.trim().startsWith("{")?JSON.parse(e):(0,AK.parse)(e)}catch{return null}if(!t||typeof t!="object")return null;let n=t;return!n.openapi&&!n.swagger?null:n}function RK(e,t){let n=Rd(e),i=Rd(t);if(!n||!i)return[];let r=[],o=n.paths??{},s=i.paths??{};for(let[a,c]of Object.entries(o)){let l=s[a];if(!l){r.push({kind:"path-removed",location:a,pointer:`#/paths/${IK(a)}`,detail:`Path \`${a}\` no longer exists. Every request to it will 404.`});continue}for(let u of $$e){let d=c[u];if(!d)continue;let p=l[u],f=`${u.toUpperCase()} ${a}`,m=`#/paths/${IK(a)}/${u}`;if(!p){r.push({kind:"operation-removed",location:f,pointer:m,detail:`Operation \`${f}\` was removed.`});continue}_$e(d,p,n,i,f,m,r),S$e(d,p,n,i,f,m,r),x$e(d,p,n,i,f,m,r),E$e(d,p,f,m,r)}}return r}function _$e(e,t,n,i,r,o,s){let a=xK(e.parameters,n),c=xK(t.parameters,i);for(let[l,u]of a){let d=c.get(l);if(!d){u.required&&s.push({kind:"parameter-removed",location:r,pointer:`${o}/parameters/${l}`,detail:`Required parameter \`${u.name}\` (in: ${u.in}) was removed.`});continue}!u.required&&d.required&&s.push({kind:"parameter-now-required",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` (in: ${d.in}) is now required. Calls omitting it will be rejected.`});let p=Yk(u.schema??{type:u.type}),f=Yk(d.schema??{type:d.type});p&&f&&p!==f&&s.push({kind:"parameter-type-changed",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` changed type from \`${p}\` to \`${f}\`.`});let m=Qk(u.schema),g=Qk(d.schema),h=m.filter(b=>!g.includes(b));m.length&&g.length&&h.length&&s.push({kind:"request-enum-narrowed",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` no longer accepts: ${h.map(b=>`\`${b}\``).join(", ")}.`})}}function S$e(e,t,n,i,r,o,s){let a=fa(EK(e),n),c=fa(EK(t),i);if(!a||!c)return;let l=new Set(TK(a)),u=TK(c);for(let d of u)l.has(d)||s.push({kind:"request-field-now-required",location:r,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` is now required.`});for(let[d,p,f]of NK(a,c,n,i))s.push({kind:"request-field-type-changed",location:r,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` changed type from \`${p}\` to \`${f}\`.`})}function x$e(e,t,n,i,r,o,s){let a=e.responses??{},c=t.responses??{};for(let[l,u]of Object.entries(a)){if(!/^2\d\d$/.test(l))continue;let d=c[l];if(!d){s.push({kind:"response-status-removed",location:r,pointer:`${o}/responses/${l}`,detail:`Success response \`${l}\` was removed from \`${r}\`.`});continue}let p=fa(MP(u),n),f=fa(MP(d),i);if(!p||!f)continue;let m=Zk(p),g=Zk(f);for(let h of Object.keys(m))h in g||s.push({kind:"response-field-removed",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` is no longer returned by \`${r}\`.`});for(let[h,b,y]of NK(p,f,n,i))s.push({kind:"response-field-type-changed",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` changed type from \`${b}\` to \`${y}\`.`});for(let[h,b]of Object.entries(m)){let y=g[h];if(!y)continue;let w=Qk(b),_=Qk(y).filter(S=>!w.includes(S));w.length&&_.length&&s.push({kind:"response-enum-widened",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` can now return new values: ${_.map(S=>`\`${S}\``).join(", ")}. Exhaustive handling of this field must be updated.`})}}}function E$e(e,t,n,i,r){let o=e.security??[],s=t.security??[],a=o.length===0||o.some(l=>Object.keys(l).length===0),c=s.length===0||s.some(l=>Object.keys(l).length===0);if(a&&!c&&s.length>0){let l=[...new Set(s.flatMap(u=>Object.keys(u)))];r.push({kind:"security-added",location:n,pointer:`${i}/security`,detail:`\`${n}\` now requires authentication (${l.join(", ")}).`})}}function xK(e,t){let n=new Map;if(!Array.isArray(e))return n;for(let i of e){let r=fa(i,t);r?.name&&n.set(`${r.in??"query"}:${r.name}`,r)}return n}function EK(e){let t=e.requestBody;return t?MP(t):null}function MP(e){let t=e.content;if(!t)return e.schema??null;let n=Object.keys(t).find(i=>i.includes("json"))??Object.keys(t)[0];return n?t[n]?.schema??null:null}function fa(e,t,n=0){if(!e)return null;if(n>10)return e;let i=e.$ref;if(typeof i!="string")return e;if(!i.startsWith("#/"))return null;let r=i.slice(2).split("/").map(T$e),o=t;for(let s of r){if(!o||typeof o!="object")return null;o=o[s]}return!o||typeof o!="object"?null:fa(o,t,n+1)}function Zk(e){let t=e.properties??{},n=e.allOf;if(!Array.isArray(n))return t;let i={...t};for(let r of n)r&&typeof r=="object"&&Object.assign(i,r.properties??{});return i}function TK(e){let t=Array.isArray(e.required)?e.required:[],i=(Array.isArray(e.allOf)?e.allOf:[]).flatMap(r=>{let o=r?.required;return Array.isArray(o)?o:[]});return[...new Set([...t,...i])]}function NK(e,t,n,i){let r=[],o=Zk(e),s=Zk(t);for(let[a,c]of Object.entries(o)){let l=s[a];if(!l)continue;let u=Yk(fa(c,n)),d=Yk(fa(l,i));u&&d&&u!==d&&r.push([a,u,d])}return r}function Yk(e){if(!e)return null;let t=e.type;if(typeof t=="string"){if(t==="array"){let n=e.items;return`array<${typeof n?.type=="string"?n.type:"unknown"}>`}return t}return Array.isArray(t)?t.join("|"):null}function Qk(e){let t=e?.enum;return Array.isArray(t)?t.map(n=>String(n)):[]}function IK(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function T$e(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}var e$=require("node:fs/promises"),es=require("node:path");function ma(e,t,n,i){return{available:!1,reason:t,detail:n,...i?{remedy:i}:{},tool:e}}var Nd="buf breaking",I$e="Install the Buf CLI (https://buf.build/docs/installation) so Drift can compare `.proto` revisions against the protobuf compatibility rules.",CK="Add the imported `.proto` files to `evidence.protobufSpecs` \u2014 Drift compiles every configured `.proto` together, so an import it was told about resolves. A pattern such as `proto/**/*.proto` covers a whole directory of them.",A$e=100,FP={id:"protobuf",source:"protobuf-diff",tool:Nd,weight:1,originClass:"computed-artifact",config:{enabled:"protobuf",paths:"protobufSpecs"},handles(e,t){return e.endsWith(".proto")?/^\s*(syntax\s*=|package\s+|message\s+|service\s+|enum\s+)/m.test(t):!1},async compute(e){let t=await e.exec("buf",["--version"],{timeoutMs:2e4,...e.env?{env:e.env}:{}});if(t.failure==="not-found"||t.code!==0)return ma(Nd,"tool-missing",`The Buf CLI is not installed or is not on PATH, so ${e.path} could not be checked against the protobuf compatibility rules.`,I$e);let n=(0,es.join)(e.workdir,"after"),i=(0,es.join)(e.workdir,"before");await Xk((0,es.join)(n,e.path),e.after),await Xk((0,es.join)(i,e.path),e.before);for(let a of e.siblings)a.path!==e.path&&(await Xk((0,es.join)(n,a.path),a.after),await Xk((0,es.join)(i,a.path),a.before));let r=await e.exec("buf",["breaking",n,"--against",i,"--error-format=json"],{cwd:e.workdir,timeoutMs:e.timeoutMs,...e.env?{env:e.env}:{}});if(r.code!==0&&r.code!==A$e){let a=(r.stderr||r.stdout||"no output").trim().split(` -`)[0]??"";return ma(Nd,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${a}`,CK)}let o;try{o=PK(r.stdout)}catch(a){return ma(Nd,"unexpected-output",`Drift could not read \`buf breaking\` output for ${e.path}: ${a.message}`)}let s=o.find(R$e);return s?ma(Nd,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${s.message}`,C$e(s)):{available:!0,changes:o.filter(a=>P$e(a,e.path)).map(a=>D$e(a,e.path)),tool:Nd,weight:1,locator:`${e.path} (buf breaking)`}},codes:{"proto-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` was deleted. Regenerate this repository's stubs and update every reader and writer of that field. Do not reuse its field number for anything else \u2014 reserve it \u2014 and if the value is genuinely gone, propagate the absence rather than substituting a placeholder that could be mistaken for real data.`},"proto-field-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` changed name. The wire encoding is unaffected \u2014 field numbers carry it \u2014 but generated accessors and any JSON representation are not. Regenerate the stubs and rename every use; check JSON payloads persisted or exchanged under the old name.`},"proto-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The type or cardinality of the protobuf field \`${e}\` changed. Regenerate the stubs and update every construction and read of that field. A value already persisted or in flight was encoded under the old type \u2014 check that decoding it still means what the code assumes.`},"proto-field-encoding-changed":{kind:"behaviour-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`An encoding option on the protobuf field \`${e}\` changed. Nothing about the schema's shape moved, so this compiles either way \u2014 what changes is the generated representation or the validation applied to the value. Review code that depends on that field's concrete representation.`},"proto-oneof-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf oneof \`${e}\` was deleted. Regenerate the stubs and rewrite every switch over its cases; a oneof's generated API has no drop-in replacement, so restructure the calling code rather than stubbing the accessor.`},"proto-message-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf message \`${e}\` no longer exists. Regenerate the stubs and migrate every use to the replacement message. If there is no replacement, leave the call site intact with a clearly-marked TODO and explain it in the PR description rather than inventing a local copy of the type.`},"proto-enum-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum \`${e}\` no longer exists. Regenerate the stubs and migrate every use to whatever now carries those values.`},"proto-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` was deleted. Regenerate the stubs and map every use onto a still-supported value. A peer that still sends the removed number will decode as the unknown/unrecognised case \u2014 make sure that path is handled rather than falling through silently.`},"proto-enum-value-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` changed name. The number is unchanged, so the wire encoding is safe; generated constants and JSON names are not. Regenerate the stubs and rename every use.`},"proto-rpc-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The RPC \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement RPC. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"proto-rpc-signature-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The signature of the RPC \`${e}\` changed \u2014 its request type, response type, or streaming shape. Regenerate the stubs and update every call site; a streaming change in particular rewrites the call's control flow, not just its types.`},"proto-service-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The service \`${e}\` no longer exists. Every client of it must be migrated to the replacement service; if there is none, leave the client intact with a clearly-marked TODO rather than deleting the feature.`},"proto-package-changed":{kind:"moved-export",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"package",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf package or a generated-code package option changed for \`${e}\`. The definitions still exist \u2014 their generated home moved. Regenerate the stubs and update the import paths; do not re-implement or stub the individual messages.`},"proto-file-removed":{kind:"removed-endpoint",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The \`.proto\` file \`${e}\` was deleted, taking everything it declared with it. Find where those definitions moved to and update the imports and generated-code references; if they were removed outright, say so in the PR description rather than recreating the file locally.`},"proto-contract-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e,detail:t})=>`\`buf\` reports a compatibility break at \`${e}\`: ${t} Regenerate this repository's stubs and update the code around that definition to match the new contract.`}}};async function Xk(e,t){await(0,e$.mkdir)((0,es.dirname)(e),{recursive:!0}),await(0,e$.writeFile)(e,t,"utf8")}function PK(e){let t=[];for(let n of e.split(` -`)){let i=n.trim();if(!i.startsWith("{"))continue;let r;try{r=JSON.parse(i)}catch{continue}if(!r||typeof r!="object")continue;let o=r;typeof o.type!="string"||typeof o.message!="string"||t.push({path:typeof o.path=="string"?o.path:"",type:o.type,message:o.message,...typeof o.start_line=="number"?{start_line:o.start_line}:{},...typeof o.start_column=="number"?{start_column:o.start_column}:{}})}return t}function R$e(e){return N$e.has(e.type)}var N$e=new Set(["COMPILE","PLUGIN_FAILURE","CONFIGURATION"]);function C$e(e){return e.type==="COMPILE"?CK:"Check the `buf` configuration and plugins in this repository, then re-run."}function P$e(e,t){return e.path===t||e.path.endsWith(`/${t}`)}function D$e(e,t){let n=e.start_line??0;return{code:DK(e.type),location:OK(e.message)??`${t}:${n}`,pointer:n>0?`${t}:${n}`:t,detail:e.message}}function DK(e){switch(e){case"FIELD_SAME_NAME":case"FIELD_SAME_JSON_NAME":return"proto-field-renamed";case"ENUM_VALUE_SAME_NAME":return"proto-enum-value-renamed";case"FIELD_SAME_TYPE":case"FIELD_SAME_LABEL":case"FIELD_SAME_CARDINALITY":case"FIELD_SAME_ONEOF":case"FIELD_WIRE_COMPATIBLE_TYPE":case"FIELD_WIRE_COMPATIBLE_CARDINALITY":case"FIELD_WIRE_JSON_COMPATIBLE_TYPE":case"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY":return"proto-field-type-changed";case"FIELD_SAME_CTYPE":case"FIELD_SAME_JSTYPE":case"FIELD_SAME_CPP_STRING_TYPE":case"FIELD_SAME_UTF8_VALIDATION":case"FIELD_SAME_JAVA_UTF8_VALIDATION":case"FIELD_SAME_DEFAULT":return"proto-field-encoding-changed";case"RPC_SAME_REQUEST_TYPE":case"RPC_SAME_RESPONSE_TYPE":case"RPC_SAME_CLIENT_STREAMING":case"RPC_SAME_SERVER_STREAMING":case"RPC_SAME_IDEMPOTENCY_LEVEL":return"proto-rpc-signature-changed";default:break}if(/^FILE_SAME_(GO|JAVA|PHP|RUBY|CSHARP|OBJC|SWIFT)_/.test(e)||e==="FILE_SAME_PACKAGE"||e==="PACKAGE_NO_DELETE")return"proto-package-changed";if(e==="FILE_NO_DELETE")return"proto-file-removed";if(e.endsWith("_NO_DELETE")||e.includes("_NO_DELETE_UNLESS_")){if(e.startsWith("FIELD_"))return"proto-field-removed";if(e.startsWith("ENUM_VALUE_"))return"proto-enum-value-removed";if(e.startsWith("ENUM_")||e.startsWith("PACKAGE_ENUM_"))return"proto-enum-removed";if(e.startsWith("ONEOF_"))return"proto-oneof-removed";if(e.startsWith("RPC_"))return"proto-rpc-removed";if(e.startsWith("SERVICE_")||e.startsWith("PACKAGE_SERVICE_"))return"proto-service-removed";if(e.startsWith("MESSAGE_")||e.startsWith("PACKAGE_MESSAGE_"))return"proto-message-removed"}return"proto-contract-changed"}function OK(e){let t=/\bon (?:message|service|enum|oneof|extension) "([^"]+)"/.exec(e)?.[1]??/\b(?:message|service|enum) "([^"]+)"/.exec(e)?.[1]??null,n=/\bwith name "([^"]+)"/.exec(e)?.[1]??/\bchanged name from "[^"]+" to "([^"]+)"/.exec(e)?.[1]??/\b(?:RPC|field|value|oneof) "([^"]+)"/i.exec(e)?.[1]??null,i=n&&!/^\d+$/.test(n)?n:null;return t&&i?`${t}.${i}`:t??i}function ce(e){return t$(e,[])}function t$(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return O$e(e,t);default:return String(e)}}function O$e(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(M$e(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:t$(i,n)}else if(Array.isArray(e))return F$e(e,n);return L$e(e,n)}function M$e(e){return typeof e.toJSON=="function"}function L$e(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+U$e(e)+"]":"{ "+n.map(([r,o])=>r+": "+t$(o,t)).join(", ")+" }"}function F$e(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let o=0;o1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function U$e(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}function j$e(e,t){return e?.__kind===t}var Nr=j$e;function MK(e){return e instanceof Error?e:new UP(e)}var UP=class extends Error{constructor(t){super("Unexpected error value: "+ce(t)),this.name="NonErrorThrown",this.thrownValue=t}};function Kn(e){return typeof e=="object"&&e!==null}function it(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var z$e=/\r\n|[\n\r]/g;function Cd(e,t){let n=0,i=1;for(let r of e.body.matchAll(z$e)){if(typeof r.index!="number"&&it(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function jP(e){return n$(e.source,Cd(e.source,e.start))}function n$(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?n:0,c=t.column+a,l=`${e.name}:${s}:${c} -`,u=i.split(/\r\n|[\n\r]/g),d=u[r];if(d.length>120){let p=Math.floor(c/80),f=c%80,m=[];for(let g=0;g["|",g]),["|","^".padStart(f)],["|",m[p+1]]])}return l+LK([[`${s-1} |`,u[r-1]],[`${s} |`,d],["|","^".padStart(c)],[`${s+1} |`,u[r+1]]])}function LK(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(` -`)}var O=class e extends Error{constructor(t,n={}){let{nodes:i,source:r,positions:o,path:s,originalError:a,cause:c,extensions:l}=n,u="cause"in n,d=u?c:a,p=u||a!=null?{cause:d}:void 0;super(t,p),this.name="GraphQLError",this.path=s??void 0;let f=a??(c instanceof Error?c:void 0);this.originalError=f,this.nodes=FK(Array.isArray(i)?i:i?[i]:void 0);let m=FK(this.nodes?.map(h=>h.loc).filter(h=>h!=null));this.source=r??m?.[0]?.source,this.positions=o??m?.map(h=>h.start),this.locations=o&&r?o.map(h=>Cd(r,h)):m?.map(h=>Cd(h.source,h.start));let g=Kn(f?.extensions)?f.extensions:void 0;this.extensions=l??g??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),a?.stack!=null?Object.defineProperty(this,"stack",{value:a.stack,writable:!0,configurable:!0}):Error.captureStackTrace!=null?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` - -`+jP(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` - -`+n$(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function FK(e){return e===void 0||e.length===0?void 0:e}function Ug(e){if(e instanceof O)return e;let t=MK(e);return new O(t.message,{originalError:t})}var Cr=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let i=this.get(t);i===void 0?this.set(t,[n]):i.push(n)}};function UK(e){return G$e("or",e)}function G$e(e,t){switch(t.length===0&&it(!1),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}let n=t.slice(0,-1),i=t.at(-1);return n.join(", ")+", "+e+" "+i}function ts(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}function r$(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}function ga(e,t){let n=Object.create(null);for(let i of Object.keys(e))n[i]=t(e[i],i);return n}function zP(e){return e.length===0?"":` at ${e.map(t=>typeof t=="number"?`[${t}]`:`.${t}`).join("")}`}var jg=class{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Pd=class{constructor(t,n,i,r,o,s){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=o,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},zg={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},V$e=new Set(Object.keys(zg));function GP(e){let t=e?.kind;return typeof t=="string"&&V$e.has(t)}var Jn={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"};var $={};_r($,{ARGUMENT:()=>Z$e,ARGUMENT_COORDINATE:()=>L_e,BOOLEAN:()=>o_e,DIRECTIVE:()=>d_e,DIRECTIVE_ARGUMENT_COORDINATE:()=>U_e,DIRECTIVE_COORDINATE:()=>F_e,DIRECTIVE_DEFINITION:()=>E_e,DIRECTIVE_EXTENSION:()=>I_e,DOCUMENT:()=>q$e,ENUM:()=>a_e,ENUM_TYPE_DEFINITION:()=>__e,ENUM_TYPE_EXTENSION:()=>P_e,ENUM_VALUE_DEFINITION:()=>S_e,FIELD:()=>J$e,FIELD_DEFINITION:()=>v_e,FLOAT:()=>r_e,FRAGMENT_ARGUMENT:()=>Y$e,FRAGMENT_DEFINITION:()=>e_e,FRAGMENT_SPREAD:()=>Q$e,INLINE_FRAGMENT:()=>X$e,INPUT_OBJECT_TYPE_DEFINITION:()=>x_e,INPUT_OBJECT_TYPE_EXTENSION:()=>D_e,INPUT_VALUE_DEFINITION:()=>w_e,INT:()=>n_e,INTERFACE_TYPE_DEFINITION:()=>k_e,INTERFACE_TYPE_EXTENSION:()=>N_e,LIST:()=>c_e,LIST_TYPE:()=>f_e,MEMBER_COORDINATE:()=>M_e,NAME:()=>B$e,NAMED_TYPE:()=>p_e,NON_NULL_TYPE:()=>m_e,NULL:()=>s_e,OBJECT:()=>l_e,OBJECT_FIELD:()=>u_e,OBJECT_TYPE_DEFINITION:()=>b_e,OBJECT_TYPE_EXTENSION:()=>R_e,OPERATION_DEFINITION:()=>W$e,OPERATION_TYPE_DEFINITION:()=>h_e,SCALAR_TYPE_DEFINITION:()=>y_e,SCALAR_TYPE_EXTENSION:()=>A_e,SCHEMA_DEFINITION:()=>g_e,SCHEMA_EXTENSION:()=>T_e,SELECTION_SET:()=>K$e,STRING:()=>i_e,TYPE_COORDINATE:()=>O_e,UNION_TYPE_DEFINITION:()=>$_e,UNION_TYPE_EXTENSION:()=>C_e,VARIABLE:()=>t_e,VARIABLE_DEFINITION:()=>H$e});var B$e="Name",q$e="Document",W$e="OperationDefinition",H$e="VariableDefinition",K$e="SelectionSet",J$e="Field",Z$e="Argument",Y$e="FragmentArgument",Q$e="FragmentSpread",X$e="InlineFragment",e_e="FragmentDefinition",t_e="Variable",n_e="IntValue",r_e="FloatValue",i_e="StringValue",o_e="BooleanValue",s_e="NullValue",a_e="EnumValue",c_e="ListValue",l_e="ObjectValue",u_e="ObjectField",d_e="Directive",p_e="NamedType",f_e="ListType",m_e="NonNullType",g_e="SchemaDefinition",h_e="OperationTypeDefinition",y_e="ScalarTypeDefinition",b_e="ObjectTypeDefinition",v_e="FieldDefinition",w_e="InputValueDefinition",k_e="InterfaceTypeDefinition",$_e="UnionTypeDefinition",__e="EnumTypeDefinition",S_e="EnumValueDefinition",x_e="InputObjectTypeDefinition",E_e="DirectiveDefinition",T_e="SchemaExtension",I_e="DirectiveExtension",A_e="ScalarTypeExtension",R_e="ObjectTypeExtension",N_e="InterfaceTypeExtension",C_e="UnionTypeExtension",P_e="EnumTypeExtension",D_e="InputObjectTypeExtension",O_e="TypeCoordinate",M_e="MemberCoordinate",L_e="ArgumentCoordinate",F_e="DirectiveCoordinate",U_e="DirectiveArgumentCoordinate";function fi(e,t){if(!e)throw new Error(t)}var j_e=5;function Zn(e,t){let[n,i]=t?[e,t]:[void 0,e];if(i.length===0)return"";let r=" Did you mean ";n!=null&&(r+=n+" ");let o=UK(i.slice(0,j_e).map(s=>`"${s}"`));return r+o+"?"}function VP(e){return e}function Gc(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}function Dd(e,t){let n=0,i=0;for(;n0);let a=0;do++i,a=a*10+o-BP,o=t.charCodeAt(i);while(i$(o)&&a>0);if(sa)return 1}else{if(ro)return 1;++n,++i}}return e.length-t.length}var BP=48,z_e=57;function i$(e){return!isNaN(e)&&BP<=e&&e<=z_e}function lr(e,t){let n=Object.create(null),i=new qP(e),r=Math.floor(e.length*.4)+1;for(let o of t){let s=i.measure(o,r);s!==void 0&&(n[o]=s)}return Object.keys(n).sort((o,s)=>{let a=n[o]-n[s];return a!==0?a:Dd(o,s)})}var qP=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=jK(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let r=jK(i),o=this._inputArray;if(r.lengthn)return;let c=this._rows;for(let u=0;u<=a;u++)c[0][u]=u;for(let u=1;u<=s;u++){let d=c[(u-1)%3],p=c[u%3],f=p[0]=u;for(let m=1;m<=a;m++){let g=r[u-1]===o[m-1]?0:1,h=Math.min(d[m]+1,p[m-1]+1,d[m-1]+g);if(u>1&&m>1&&r[u-1]===o[m-2]&&r[u-2]===o[m-1]){let b=c[(u-2)%3][m-2];h=Math.min(h,b+1)}hn)return}let l=c[s%3][a];return l<=n?l:void 0}};function jK(e){let t=e.length,n=new Array(t);for(let i=0;i=48&&e<=57}function zK(e){return e>=97&&e<=122||e>=65&&e<=90}function Gg(e){return zK(e)||e===95}function s$(e){return zK(e)||Vc(e)||e===95}function GK(e){let t=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let r=0;ro===0?r:r.slice(t)).slice(n??0,i+1)}function G_e(e){let t=0;for(;t1&&i.slice(1).every(f=>f.length===0||o$(f.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),l=a||c,u=!t?.minimize&&(!r||e.length>70||l||o||s),d="",p=r&&o$(e.charCodeAt(0));return(u&&!p||o)&&(d+=` +`)}}yo&&process.on("exit",()=>C_e());var N_e=1e4,D_e=1440*60*1e3,O_e=6e4,M_e=360*60*1e3,L_e="drift-bot/0.1 (+https://github.com/trydrift/drift)",fD=new Map,ta=new Map;function gD(e,t){let n=ta.get(e);if(n)return Ir("http","coalesced_hit"),n;let r=t().finally(()=>ta.delete(e));return ta.set(e,r),r}var es=null;function vJ(e){let t=fD.get(e);return t?Date.now()>=t.expiresAt?(fD.delete(e),{hit:!1}):{hit:!0,value:t.value}:{hit:!1}}function bo(e,t){let n=t===null?Date.now()+O_e:1/0;fD.set(e,{value:t,expiresAt:n})}function hD(e){if(!e)return"default";let t=Object.entries(e).filter(([r])=>/auth|token/i.test(r)||r.toLowerCase()==="accept").sort(([r],[i])=>r.localeCompare(i));if(t.length===0)return"default";let n=t.map(([r,i])=>`${r.toLowerCase()}=${i}`).join("&");return(0,od.createHash)("sha256").update(n).digest("hex").slice(0,16)}function o_(e,t){return(0,od.createHash)("sha256").update(`${hD(t)}:${e}`).digest("hex").slice(0,10)}function wJ(e,t){return(0,od.createHash)("sha256").update(`${e}|${t.maxBytes??""}|${t.timeoutMs??""}|${t.retries??""}`).digest("hex").slice(0,10)}function na(e){let t=e.indexOf("://");if(t<0)return"unknown";let n=e.slice(t+3),r=n.search(/[/?#]/);return(r<0?n:n.slice(0,r)).toLowerCase()}function ra(e){let t=e.indexOf("://");if(t<0)return e.split("?")[0];let n=e.slice(t+3),r=n.indexOf("/");return(r<0?"":n.slice(r)).split("?")[0]}function yD(e){return Math.max(0,Vt()-e)}function Br(e){let t={requestKey:e.requestKey,path:e.path,timeoutMs:Math.max(0,Math.round(e.timeoutMs))};return e.abortFiredAtMs!==null?(t.abortTimerFired=!0,t.abortDelayMs=Math.max(0,Math.round(e.abortFiredAtMs-e.attemptStartOffsetMs-e.timeoutMs))):t.abortTimerFired=!1,e.headersAtMs!==void 0&&e.headersAtMs!==null&&(t.headersMs=Math.max(0,Math.round(e.headersAtMs-e.attemptStartOffsetMs))),e.headersAtMs!==void 0&&e.headersAtMs!==null&&e.bodyDoneAtMs!==void 0&&e.bodyDoneAtMs!==null&&(t.bodyMs=Math.max(0,Math.round(e.bodyDoneAtMs-e.headersAtMs))),t}function Yt(e){fJ({host:na(e.url),method:e.method,path:ra(e.url),startOffsetMs:e.startOffsetMs,durationMs:Vt()-e.startOffsetMs,status:e.status,cache:e.cache,bytes:e.bytes,retries:e.retries,backoffMs:e.backoffMs,failure:e.failure})}function Vr(e){mJ({host:na(e.url),method:e.method,path:ra(e.url),startOffsetMs:e.startOffsetMs,durationMs:Vt()-e.startOffsetMs,status:e.status})}function kJ(e){es=e}function xc(){return es}function xe(e,t={}){let n=`json:${hD(t.headers)}:${e}`,r=vJ(n);if(r.hit)return tt("http.cache.memory"),Ir("http","memory_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:null,cache:"memory_hit"}),Promise.resolve(r.value);Zg()&&ta.has(n)&&tt("http.cache.coalesced");let i=Vt(),o=ta.has(n),s={Accept:"application/json",...t.headers},a=o_(e,s),c=o?At("http-coalesced-json",na(e),{requestKey:a,path:ra(e)}):null,l=gD(n,()=>F_e(e,n,t));return o?l.then(u=>(c?.end({waitMs:Math.round(yD(i))}),Yt({url:e,method:"GET",startOffsetMs:i,status:null,cache:"coalesced_hit"}),u)):l}async function F_e(e,t,n){let r={Accept:"application/json",...n.headers},i=await nt(e,{...n,headers:r});if(i===null)return bo(t,null),null;let o=At("json-parse",na(e),{requestKey:o_(e,r),path:ra(e),bytes:i.length});try{let s=JSON.parse(i);return bo(t,s),s}catch{return bo(t,null),null}finally{o.end()}}function nt(e,t={}){let n=`text:${hD(t.headers)}:${e}`,r=vJ(n);if(r.hit)return tt("http.cache.memory"),Ir("http","memory_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:null,cache:"memory_hit"}),Promise.resolve(r.value);Zg()&&ta.has(n)&&tt("http.cache.coalesced");let i=Vt(),o=ta.has(n),s=o_(e,t.headers),a=o?At("http-coalesced-text",na(e),{requestKey:s,path:ra(e)}):null;return gD(n,()=>j_e(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(yD(i))}),Yt({url:e,method:"GET",startOffsetMs:i,status:null,cache:"coalesced_hit"})),c))}async function j_e(e,t,n){let{timeoutMs:r=N_e,headers:i={},retries:o=2}=n,s=na(e),a=o_(e,i),c=ra(e),l=At("disk-cache",s,{requestKey:a,path:c}),u=await B_e(t);l.end({hit:u!==null});let d=n.cacheTtlMs??D_e,p=Date.now();if(u&&u.body!==null&&(u.immutable||n.immutable||p-u.fetchedAt{w=Vt(),b.abort()},r),$=At("http",s,{requestKey:a,path:c,timeoutMs:r,...h>0?{attempt:h}:{}});try{let S=await fetch(e,{signal:b.signal,headers:{"User-Agent":L_e,...f,...i},redirect:"follow"}),E=Vt();if(S.status===304&&u)return $.end({status:304,...Br({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:w,headersAtMs:E})}),Vr({url:e,method:"GET",startOffsetMs:v,status:304}),Yt({url:e,method:"GET",startOffsetMs:m,status:304,cache:"revalidated_304",retries:h,backoffMs:g}),tt("http.notModified"),Ir("http","revalidated_304"),Ir("http","write"),await pD(t,{...u,fetchedAt:p,immutable:u.immutable||n.immutable}),bo(t,u.body),u.body;if(S.ok){let R=await S.text(),j=Vt();return $.end({status:S.status,bytes:R.length,...Br({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:w,headersAtMs:E,bodyDoneAtMs:j})}),Vr({url:e,method:"GET",startOffsetMs:v,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",bytes:R.length,retries:h,backoffMs:g}),bo(t,R),Ir("http","write"),await pD(t,{key:t,body:R,etag:S.headers.get("etag")??void 0,fetchedAt:p,immutable:n.immutable}),R}if(S.status===404)return $.end({status:S.status,...Br({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:w,headersAtMs:E})}),Vr({url:e,method:"GET",startOffsetMs:v,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g}),bo(t,null),Ir("http","write"),await pD(t,{key:t,body:null,absent:!0,fetchedAt:p,immutable:n.immutable}),null;if(S.status===403){if(!(S.headers.get("x-ratelimit-remaining")==="0"||S.headers.has("retry-after"))||h===o){$.end({status:S.status,...Br({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:w,headersAtMs:E})}),Vr({url:e,method:"GET",startOffsetMs:v,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g});break}$.end({status:S.status,...Br({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:w,headersAtMs:E})}),Vr({url:e,method:"GET",startOffsetMs:v,status:S.status}),n.onRetry?.(h+1,"rate-limited");let j=Yg(h,S.headers.get("retry-after"));g+=j,await Qg(j);continue}if(!(S.status===429||S.status>=500)||h===o){$.end({status:S.status,...Br({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:w,headersAtMs:E})}),Vr({url:e,method:"GET",startOffsetMs:v,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g});break}$.end({status:S.status,...Br({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:w,headersAtMs:E})}),Vr({url:e,method:"GET",startOffsetMs:v,status:S.status}),n.onRetry?.(h+1,S.status===429?"rate-limited":"server-error");let A=Yg(h,S.headers.get("retry-after"));g+=A,await Qg(A)}catch(S){if($.end({status:0,...Br({requestKey:a,path:c,timeoutMs:r,attemptStartOffsetMs:v,abortFiredAtMs:w})}),Vr({url:e,method:"GET",startOffsetMs:v,status:null}),h===o){Yt({url:e,method:"GET",startOffsetMs:m,status:null,cache:"miss",retries:h,backoffMs:g,failure:S instanceof Error?S.name:"network-error"}),tt("http.error");break}tt("http.error"),n.onRetry?.(h+1,"network-error");let E=Yg(h,null);g+=E,await Qg(E)}finally{clearTimeout(k)}}return bo(t,null),u?.body!==void 0?(bo(t,u.body),u.body):null}function qt(e,t={}){let n=`archive:${e}`,r=`${n}|maxBytes=${t.maxBytes??""}|timeoutMs=${t.timeoutMs??""}|retries=${t.retries??""}`,i=Vt(),o=ta.has(r),s=wJ(e,t),a=o?At("http-coalesced-archive",na(e),{requestKey:s,path:ra(e)}):null;return gD(r,()=>U_e(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(yD(i))}),Yt({url:e,method:"GET",startOffsetMs:i,status:c.ok?200:c.status,cache:"coalesced_hit"})),c))}async function U_e(e,t,n){let r=na(e),i=ra(e),o=wJ(e,n),s=G_e(t),{retries:a=2,maxBytes:c}=n;if(s)try{let m=await(0,qi.readFile)(s);if(c===void 0||m.length<=c)return tt("http.cache.archive"),Ir("http","disk_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:200,cache:"disk_hit"}),{ok:!0,bytes:m}}catch{}Ir("http","miss");let l=n.timeoutMs??6e4,u=Date.now()+l,d=()=>u-Date.now();tt("http.archive");let p=Vt(),f=0;for(let m=0;m<=a;m++){let g=d();if(g<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:"timeout"}),{ok:!1,status:0,error:"Timed out before this attempt could start."};let h=Vt(),v=At("archive",r,{requestKey:o,path:i,timeoutMs:Math.max(0,Math.round(g)),...m>0?{attempt:m}:{}}),b=new AbortController,w=null,k=setTimeout(()=>{w=Vt(),b.abort()},g);try{let $=await fetch(e,{signal:b.signal}),S=Vt();if(!$.ok){v.end({status:$.status,...Br({requestKey:o,path:i,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S})}),Vr({url:e,method:"GET",startOffsetMs:h,status:$.status});let R=$.status===429||$.status>=500,j=Math.min(Yg(m,$.headers.get("retry-after")),d());if(!R||m===a||j<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:$.status,cache:"miss",retries:m,backoffMs:f}),{ok:!1,status:$.status};f+=j,await Qg(j);continue}let E=Number($.headers.get("content-length"));if(c!==void 0&&Number.isFinite(E)&&E>c)return v.end({status:$.status,bytes:E,oversized:!0,...Br({requestKey:o,path:i,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S})}),Vr({url:e,method:"GET",startOffsetMs:h,status:$.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:$.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:$.status,error:`Response of ${E} bytes exceeds the ${c}-byte limit for this archive.`};let T=await z_e($,c,b),A=Vt();if(T==="oversized")return v.end({status:$.status,oversized:!0,...Br({requestKey:o,path:i,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S,bodyDoneAtMs:A})}),Vr({url:e,method:"GET",startOffsetMs:h,status:$.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:$.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:$.status,error:`Response exceeds the ${c}-byte limit for this archive.`};if(v.end({status:$.status,bytes:T.length,...Br({requestKey:o,path:i,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S,bodyDoneAtMs:A})}),Vr({url:e,method:"GET",startOffsetMs:h,status:$.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:$.status,cache:"miss",bytes:T.length,retries:m,backoffMs:f}),s)try{await(0,qi.mkdir)(es,{recursive:!0});let R=`${s}.${process.pid}.partial`;await(0,qi.writeFile)(R,T),await(0,qi.rename)(R,s),Ir("http","write")}catch{}return{ok:!0,bytes:T}}catch($){if(v.end({status:0,...Br({requestKey:o,path:i,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w})}),Vr({url:e,method:"GET",startOffsetMs:h,status:null}),m===a)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:$ instanceof Error?$.name:"network-error"}),{ok:!1,status:0,error:$.message};let S=Math.min(Yg(m,null),d());if(S<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:$ instanceof Error?$.name:"network-error"}),{ok:!1,status:0,error:$.message};f+=S,await Qg(S)}finally{clearTimeout(k)}}return{ok:!1,status:0}}async function z_e(e,t,n){if(t===void 0||!e.body)return Buffer.from(await e.arrayBuffer());let r=e.body.getReader(),i=[],o=0;for(;;){let{done:s,value:a}=await r.read();if(s)break;if(o+=a.byteLength,o>t)return n.abort(),"oversized";i.push(a)}return Buffer.concat(i)}function G_e(e){return es?(0,mD.join)(es,`${(0,od.createHash)("sha256").update(e).digest("hex")}.bin`):null}async function B_e(e){if(!es)return null;try{let t=await(0,qi.readFile)(_J(e),"utf8"),n=JSON.parse(t);return n.key===e?n:null}catch{return null}}async function pD(e,t){if(es)try{await(0,qi.mkdir)(es,{recursive:!0}),await(0,qi.writeFile)(_J(e),JSON.stringify(t),"utf8")}catch{}}function _J(e){let t=(0,od.createHash)("sha256").update(e).digest("hex");return(0,mD.join)(es,`${t}.json`)}function Yg(e,t){if(t){let r=Number(t);if(Number.isFinite(r)&&r>0)return Math.min(r*1e3,3e4)}return 400*2**e+Math.random()*200}function Qg(e){return new Promise(t=>setTimeout(t,e))}async function qn(e,t,n){let r=new Array(e.length),i=0,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let s=i++;if(s>=e.length)return;r[s]=await n(e[s],s)}});return await Promise.all(o),r}var xJ=require("node:crypto"),EJ=require("node:zlib"),sd=require("node:fs/promises"),vD=require("node:path");var TJ="https://downloads.arduino.cc/libraries/library_index.json.gz",V_e=1440*60*1e3,q_e=12e4,$J=null;async function W_e(){return $J??=H_e(),$J}async function s_(e){return(await W_e())?.get(e.toLowerCase())??null}async function H_e(){let e=await SJ();if(e)return bD(e);let t=await K_e();if(!t){let r=await SJ({ignoreAge:!0});return r?bD(r):null}let n=J_e(t);return await Y_e(n),bD(n)}async function K_e(){try{let e=await fetch(TJ,{signal:AbortSignal.timeout(q_e),headers:{"User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"}});if(!e.ok)return null;let t=Buffer.from(await e.arrayBuffer()),n=t[0]===31&&t[1]===139?(0,EJ.gunzipSync)(t):t;return JSON.parse(n.toString("utf8"))}catch{return null}}function J_e(e){let t=new Map;for(let n of e.libraries??[]){if(!n.name||!n.version)continue;let r=n.name.toLowerCase(),i=t.get(r);i||(i={name:n.name,versions:[],githubRepo:null,website:null,description:null,archives:{}},t.set(r,i)),i.versions.includes(n.version)||i.versions.push(n.version),n.url&&(i.archives[n.version]=n.url),i.githubRepo=Z_e(n.repository)??i.githubRepo,i.website=n.website??i.website,i.description=n.sentence??i.description}return[...t.values()]}function Z_e(e){if(!e)return null;let t=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/.exec(e);return t?`${t[1]}/${t[2]}`:null}function bD(e){return new Map(e.map(t=>[t.name.toLowerCase(),t]))}function IJ(){let e=xc();if(!e)return null;let t=(0,xJ.createHash)("sha256").update(TJ).digest("hex");return(0,vD.join)(e,`arduino-index-${t.slice(0,16)}.json`)}async function SJ(e={}){let t=IJ();if(!t)return null;try{let n=JSON.parse(await(0,sd.readFile)(t,"utf8"));return!Array.isArray(n.libraries)||!e.ignoreAge&&Date.now()-n.fetchedAt>=V_e?null:n.libraries}catch{return null}}async function Y_e(e){let t=IJ();if(t)try{await(0,sd.mkdir)((0,vD.join)(t,".."),{recursive:!0});let n={fetchedAt:Date.now(),libraries:[...e]};await(0,sd.writeFile)(t,JSON.stringify(n),"utf8")}catch{}}var CJ=require("node:crypto");var Q_e=new Set(["sponsors","apps","marketplace","settings","about","pricing","features"]),AJ=/^[A-Za-z0-9._-]+$/;function RJ(e,t){let n=t.replace(/\.git$/i,"");return!e||!n||!AJ.test(e)||!AJ.test(n)||e==="."||e===".."||n==="."||n===".."||Q_e.has(e.toLowerCase())?null:`${e}/${n}`}function PJ(e){let t=e.toLowerCase();return t==="github.com"||t==="www.github.com"}function ia(e){if(!e)return null;let t=e.trim();if(!t)return null;t=t.replace(/^git\+/i,"");let n=/^(?:ssh:\/\/)?(?:[^@/\s]+@)?github\.com:(?[^/\s:]+)\/(?[^\s?#]+?)\/?$/i.exec(t);if(n?.groups)return PJ("github.com")?RJ(n.groups.owner,n.groups.repo):null;let r;try{r=new URL(t)}catch{return null}if(!["http:","https:","ssh:","git:"].includes(r.protocol)||!PJ(r.hostname))return null;let i=r.pathname.split("/").filter(Boolean);return i.length<2?null:RJ(i[0],i[1])}var wD=new Map;function X_e(e,t){let n=(0,CJ.createHash)("md5").update(e).digest("hex"),r=`${n[0]}/${n[1]}/${n[2]}`,i=encodeURIComponent(e);return`https://cdn.cocoapods.org/Specs/${r}/${i}/${encodeURIComponent(t)}/${i}.podspec.json`}function a_(e,t,n={}){let r=`${e}@${t}`,i=wD.get(r);if(i)return i;let o=e$e(e,t,n).catch(()=>null);return wD.set(r,o),o.then(s=>{s||wD.delete(r)}),o}async function e$e(e,t,n){let r=await xe(X_e(e,t),{immutable:!0,...n.timeoutMs?{timeoutMs:n.timeoutMs}:{}});if(!r)return null;let i=r.source&&typeof r.source=="object"?t$e(r.source):null;return{name:r.name??e,version:r.version??t,moduleName:typeof r.module_name=="string"&&r.module_name?r.module_name:null,source:i,homepage:kD(r.homepage),summary:kD(r.summary),description:kD(r.description)}}function t$e(e){let t=n=>{let r=e[n];return typeof r=="string"&&r?r:void 0};return{git:t("git"),tag:t("tag"),http:t("http"),svn:t("svn")}}function kD(e){return typeof e=="string"&&e.trim()?e.trim():null}function NJ(e){return ia(e.source?.git)??ia(e.homepage)}var n$e=e=>`https://api.github.com/repos/ocaml/opam-repository/contents/packages/${encodeURIComponent(e)}`,r$e="https://api.github.com/repos/ocaml/opam-repository/branches/master",DJ=(e,t,n)=>`https://raw.githubusercontent.com/ocaml/opam-repository/${n}/packages/${encodeURIComponent(e)}/${encodeURIComponent(`${e}.${t}`)}/opam`;async function i$e(e){let n=(await xe(r$e,{...e?{headers:e}:{}}).catch(()=>null))?.commit?.sha;return typeof n=="string"&&/^[0-9a-f]{40}$/.test(n)?n:null}function MJ(e){return/^[\w.+-]+$/.test(e)}async function c_(e,t={}){if(!MJ(e))return null;let n=await xe(n$e(e),{...t.headers?{headers:t.headers}:{}}).catch(()=>null);if(!Array.isArray(n))return null;let r=`${e}.`;return n.filter(i=>i.type==="dir"&&i.name?.startsWith(r)).map(i=>i.name.slice(r.length))}async function LJ(e,t){if(!MJ(e))return null;let n=await i$e(),r=n?await nt(DJ(e,t,n),{immutable:!0}).catch(()=>null):await nt(DJ(e,t,"master")).catch(()=>null);return r?o$e(r,e,t):null}function o$e(e,t,n){let r=a=>{let c=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e);return c?OJ(c[1]):null},i=a=>{let l=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e)?.[1]?.trim();return l||null},o=(()=>{let a=/(?:^|\n)\s*description\s*:\s*"""([\s\S]*?)"""/.exec(e);return a?a[1].trim()||null:i("description")})(),s=(()=>{let a=/(?:^|\n)\s*url\s*\{([\s\S]*?)\n[ \t]*\}/.exec(e),c=a?a[1]:e,l=/(?:^|\n)\s*src\s*:\s*"([^"\n]+)"/.exec(c)??/(?:^|\n)\s*archive\s*:\s*"([^"\n]+)"/.exec(c);return l?OJ(l[1]):null})();return{name:t,version:n,devRepo:r("dev-repo"),homepage:r("homepage"),bugReports:r("bug-reports"),doc:r("doc"),synopsis:i("synopsis"),description:o,sourceUrl:s}}function OJ(e){let t=e.trim();return!t||/%\{[^}]*\}%?/.test(t)?null:t}function FJ(e){return ia(e.devRepo)??ia(e.sourceUrl)??ia(e.homepage)??ia(e.bugReports)}function l_(e){let t={};return e.map(n=>{let r={...t,...n};return t=r,r})}function u_(e,t){return e.find(n=>n.version===t)}async function Wn(e,t,n){switch(t){case"npm":return x$e(e,n);case"pypi":return E$e(e,n);case"cargo":return T$e(e);case"go":return I$e(e);case"maven":return P$e(e);case"rubygems":return C$e(e);case"nuget":return a$e(e);case"packagist":return c$e(e,n);case"hex":return l$e(e);case"pub":return u$e(e);case"swift":return d$e(e);case"cocoapods":return p$e(e,n);case"conan":return f$e(e);case"vcpkg":return h$e(e);case"arduino":return y$e(e);case"opam":return s$e(e,n);default:return null}}async function s$e(e,t){let[n,r]=await Promise.all([c_(e),t?LJ(e,t):Promise.resolve(null)]);return!n&&!r?null:{name:e,ecosystem:"opam",githubRepo:r?FJ(r):null,homepage:r?.homepage??r?.devRepo??null,versions:n??[],deprecated:null,description:r?.description??r?.synopsis??null}}async function a$e(e){let t=e.toLowerCase(),[n,r]=await Promise.all([xe(`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(t)}/index.json`),xe(`https://api.nuget.org/v3/registration5-gz-semver2/${encodeURIComponent(t)}/index.json`)]);if(!n&&!r)return null;let i=(r?.items??[]).flatMap(s=>s.items??[]),o=i[i.length-1]?.catalogEntry;return{name:e,ecosystem:"nuget",githubRepo:jt(o?.repository?.url??null)??jt(o?.projectUrl??null),homepage:o?.projectUrl??`https://www.nuget.org/packages/${e}`,versions:n?.versions??[],deprecated:o?.deprecation?.message??null,description:o?.description??null}}async function c$e(e,t){let r=(await xe(`https://repo.packagist.org/p2/${e}.json`))?.packages?.[e];if(!r||r.length===0)return null;let i=l_(r),o=t?u_(i,t):i[0];if(!o)return null;let s=o.abandoned,a=s===void 0||s===!1?null:typeof s=="string"?`This package is abandoned; the author suggests using ${s} instead.`:"This package is abandoned and is no longer maintained.";return{name:e,ecosystem:"packagist",githubRepo:jt(o.source?.url??null)??jt(o.homepage??null),homepage:o.homepage??`https://packagist.org/packages/${e}`,versions:i.map(c=>c.version).filter(c=>!!c),deprecated:a,description:o.description??null}}async function l$e(e){let t=await xe(`https://hex.pm/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.meta?.links??{},r=Object.entries(n).map(([s,a])=>({key:s.toLowerCase(),value:a})),i=r.find(s=>s.key==="github")?.value??r.find(s=>s.key==="source")?.value,o=Object.values(t.retirements??{})[0];return{name:e,ecosystem:"hex",githubRepo:jt(i??null)??r.map(s=>jt(s.value)).find(Boolean)??null,homepage:t.html_url??`https://hex.pm/packages/${e}`,versions:(t.releases??[]).map(s=>s.version).filter(s=>!!s),deprecated:o?o.message??o.reason??"This release is retired.":null,description:t.meta?.description??null}}async function u$e(e){let t=await xe(`https://pub.dev/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.latest?.pubspec,r=n?.repository??n?.homepage??n?.issue_tracker;return{name:e,ecosystem:"pub",githubRepo:jt(r??null),homepage:n?.homepage??`https://pub.dev/packages/${e}`,versions:(t.versions??[]).map(i=>i.version).filter(i=>!!i),deprecated:t.latest?.retracted?"The latest version of this package has been retracted.":null,description:n?.description??null}}function d$e(e){return/^[\w.-]+\/[\w.-]+$/.test(e)?{name:e,ecosystem:"swift",githubRepo:e,homepage:`https://github.com/${e}`,versions:[],deprecated:null,description:null}:null}async function p$e(e,t){let[n,r]=await Promise.all([xe(`https://trunk.cocoapods.org/api/v1/pods/${encodeURIComponent(e)}`),t?a_(e,t):Promise.resolve(null)]);return n?{name:e,ecosystem:"cocoapods",githubRepo:r?NJ(r):null,homepage:r?.homepage??`https://cocoapods.org/pods/${e}`,versions:(n.versions??[]).map(i=>i.name).filter(i=>!!i),deprecated:null,description:r?.description??r?.summary??null}:null}async function f$e(e){let t=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,n=await nt(`${t}/config.yml`);if(!n)return null;let{versions:r,folders:i}=m$e(n);if(r.length===0)return null;let o=i[r[r.length-1]]??i[r[0]]??"all",s=await nt(`${t}/${o}/conandata.yml`);return{name:e,ecosystem:"conan",githubRepo:s?g$e(s):null,homepage:`https://conan.io/center/recipes/${e}`,versions:r,deprecated:null,description:null}}function m$e(e){let t=[],n={},r=!1,i=null;for(let o of e.split(` +`)){let s=o.split("#")[0].replace(/\s+$/,"");if(!s.trim())continue;if(/^versions\s*:/.test(s)){r=!0;continue}if(!/^\s/.test(s)){r=!1;continue}if(!r)continue;let a=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){i=a[1].trim(),i&&!t.includes(i)&&t.push(i);continue}let c=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(s);c&&i&&(n[i]=c[1])}return{versions:t,folders:n}}function g$e(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=jt(t[0]);if(n)return n}return null}async function h$e(e){let t=e[0]?.toLowerCase();if(!t||!/[a-z0-9]/.test(t))return null;let[n,r]=await Promise.all([xe(`https://raw.githubusercontent.com/microsoft/vcpkg/master/versions/${t}-/${encodeURIComponent(e)}.json`),xe(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`)]);if(!n)return null;let i=[];for(let s of n.versions??[]){let a=s.version??s["version-semver"]??s["version-string"]??s["version-date"];a&&!i.includes(a)&&i.push(a)}if(i.length===0)return null;let o=Array.isArray(r?.description)?r.description.join(" "):r?.description??null;return{name:e,ecosystem:"vcpkg",githubRepo:jt(r?.homepage??null),homepage:r?.homepage??`https://vcpkg.io/en/package/${e}`,versions:i,deprecated:null,description:o}}async function y$e(e){let t=await s_(e);if(t)return{name:t.name,ecosystem:"arduino",githubRepo:t.githubRepo,homepage:t.website??`https://www.arduino.cc/reference/en/libraries/${v$e(e)}/`,versions:t.versions,deprecated:null,description:t.description};let n=await b$e(e);return n?{name:n.name??e,ecosystem:"arduino",githubRepo:jt(n.repository_url??null),homepage:n.homepage??null,versions:n.version?.name?[n.version.name]:[],deprecated:null,description:n.description??null}:null}async function b$e(e){let n=((await xe(`https://api.registry.platformio.org/v3/search?query=${encodeURIComponent(e)}`))?.items??[]).find(r=>r.name?.toLowerCase()===e.toLowerCase()&&r.owner?.username);return n?xe(`https://api.registry.platformio.org/v3/packages/${encodeURIComponent(n.owner.username)}/library/${encodeURIComponent(n.name)}`):null}function v$e(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}async function oa(e,t,n){switch(t){case"npm":return w$e(e,n);case"pypi":return k$e(e,n);case"go":return _$e(e,n);case"cargo":return S$e(e,n);default:return null}}function d_(e){return{version:e,license:null,releasedAt:null,runtime:null,dependencies:[],withdrawn:null}}async function w$e(e,t){let n=await xe(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`),r=n?.versions?.[t];if(!r)return null;let i=r.engines?.node;return{...d_(t),license:typeof r.license=="string"?r.license:r.license?.type??null,releasedAt:n?.time?.[t]??null,runtime:i?{name:"Node.js",requirement:i}:null,dependencies:Object.keys(r.dependencies??{}),withdrawn:r.deprecated??null}}async function k$e(e,t){let n=await xe(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{immutable:!0});if(!n?.info)return null;let r=n.info.requires_python;return{...d_(t),license:n.info.license||null,releasedAt:n.urls?.[0]?.upload_time_iso_8601??null,runtime:r?{name:"Python",requirement:r}:null,dependencies:(n.info.requires_dist??[]).map(i=>/^\s*([A-Za-z0-9._-]+)/.exec(i)?.[1]).filter(i=>!!i),withdrawn:n.info.yanked?`Release yanked: ${n.info.yanked_reason??"no reason given"}`:null}}async function _$e(e,t){let n=t.startsWith("v")?t:`v${t}`,r=`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/${encodeURIComponent(n)}`,[i,o]=await Promise.all([nt(`${r}.mod`,{immutable:!0}),xe(`${r}.info`,{immutable:!0})]);if(!i&&!o)return null;let s=i?/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(i)?.[1]:null;return{...d_(n),releasedAt:o?.Time??null,runtime:s?{name:"Go",requirement:`>=${s}`}:null,withdrawn:i?$$e(i,n):null}}function $$e(e,t){let n=t.replace(/^v/,"");for(let i of e.matchAll(/^\s*retract\s+(.+)$/gm)){let o=i[1].trim(),s=/\/\/\s*(.+)$/.exec(o)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.",c=/^v?([\w.+-]+)/.exec(o.replace(/\/\/.*$/,"").trim())?.[1];if(c&&c===n)return a;let l=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(l&&jJ(n,l[1],l[2]))return a}let r=/^\s*retract\s*\(([\s\S]*?)^\s*\)/m.exec(e)?.[1];if(r)for(let i of r.split(` +`)){let o=i.replace(/\/\/.*$/,"").trim();if(!o)continue;let s=/\/\/\s*(.+)$/.exec(i)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.";if(/^v?([\w.+-]+)$/.exec(o)?.[1]===n)return a;let c=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(c&&jJ(n,c[1],c[2]))return a}return null}function jJ(e,t,n){return UJ(e,t)>=0&&UJ(e,n)<=0}function UJ(e,t){let n=e.split(/[.+-]/).map(i=>Number.parseInt(i,10)),r=t.split(/[.+-]/).map(i=>Number.parseInt(i,10));for(let i=0;i=${r}`}:null,withdrawn:n.version.yanked?"This release was yanked from crates.io.":null}}async function BJ(e,t,n){let r={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};t&&(r.Authorization=`Bearer ${t}`);let i=await xe(`https://api.github.com/repos/${e}`,{headers:r,...n?{onRetry:n}:{}});if(!i)return null;let o=i.license?.spdx_id;return{archived:i.archived===!0,pushedAt:i.pushed_at??null,license:o&&o!=="NOASSERTION"?o:null,url:i.html_url??`https://github.com/${e}`}}async function x$e(e,t){let n=await xe(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`);if(!n)return null;let r=Object.keys(n.versions??{}),i=t?n.versions?.[t]:void 0;return{name:e,ecosystem:"npm",githubRepo:jt(zJ(n.repository))??jt(zJ(i?.repository))??jt(n.homepage),homepage:n.homepage??null,versions:r,deprecated:i?.deprecated??null,description:n.description??null}}async function E$e(e,t){let n=await xe(`https://pypi.org/pypi/${encodeURIComponent(e)}/json`);if(!n)return null;let o=[...Object.values(n.info?.project_urls??{}),n.info?.home_page??""].map(jt).find(c=>c!==null)??null,a=(t?n.releases?.[t]??[]:[]).find(c=>c.yanked);return{name:e,ecosystem:"pypi",githubRepo:o,homepage:n.info?.home_page??null,versions:Object.keys(n.releases??{}),deprecated:a?`Release yanked: ${a.yanked_reason??"no reason given"}`:null,description:n.info?.summary??null}}async function T$e(e){let t=await xe(`https://crates.io/api/v1/crates/${encodeURIComponent(e)}`);return t?{name:e,ecosystem:"cargo",githubRepo:jt(t.crate?.repository)??jt(t.crate?.homepage),homepage:t.crate?.homepage??null,versions:(t.versions??[]).map(n=>n.num),deprecated:null,description:t.crate?.description??null}:null}async function I$e(e){let t=await nt(`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/list`);return{name:e,ecosystem:"go",githubRepo:R$e(e),homepage:`https://pkg.go.dev/${e}`,versions:t?t.split(` +`).map(n=>n.trim()).filter(Boolean):[],deprecated:null,description:null}}var A$e={grpc:"grpc/grpc-go",protobuf:"protocolbuffers/protobuf-go",api:"googleapis/google-api-go-client",genproto:"googleapis/go-genproto",appengine:"golang/appengine"};function R$e(e){let t=e.replace(/\/v[2-9]\d*$/,""),n=[[/^golang\.org\/x\/([\w.-]+)/,r=>`golang/${r[1]}`],[/^google\.golang\.org\/(\w+)/,r=>A$e[r[1]]??`googleapis/go-${r[1]}`],[/^go\.uber\.org\/([\w.-]+)/,r=>`uber-go/${r[1]}`],[/^sigs\.k8s\.io\/([\w.-]+)/,r=>`kubernetes-sigs/${r[1]}`],[/^k8s\.io\/([\w.-]+)/,r=>`kubernetes/${r[1]}`],[/^gopkg\.in\/([\w.-]+)\/([\w.-]+?)\.v\d+$/,r=>`${r[1]}/${r[2]}`],[/^gopkg\.in\/([\w.-]+?)\.v\d+$/,r=>`go-${r[1]}/${r[1]}`]];for(let[r,i]of n){let o=r.exec(t);if(o)return i(o)}return jt(`https://${t}`)}async function P$e(e){let[t,n]=e.split(":");if(!t||!n)return null;let r=await xe(`https://search.maven.org/solrsearch/select?q=g:%22${encodeURIComponent(t)}%22+AND+a:%22${encodeURIComponent(n)}%22&core=gav&rows=100&wt=json`);return{name:e,ecosystem:"maven",githubRepo:null,homepage:`https://central.sonatype.com/artifact/${t}/${n}`,versions:(r?.response?.docs??[]).map(i=>i.v),deprecated:null,description:null}}async function C$e(e){let t=await xe(`https://rubygems.org/api/v1/gems/${encodeURIComponent(e)}.json`);if(!t)return null;let n=await xe(`https://rubygems.org/api/v1/versions/${encodeURIComponent(e)}.json`);return{name:e,ecosystem:"rubygems",githubRepo:jt(t.source_code_uri)??jt(t.homepage_uri)??jt(t.changelog_uri),homepage:t.homepage_uri??null,versions:(n??[]).map(r=>r.number),deprecated:null,description:t.info??null,changelogUrl:t.changelog_uri??null,documentationUrl:t.documentation_uri??null}}function zJ(e){if(e)return typeof e=="string"?e:e.url}function jt(e){if(!e)return null;let t=/^github:([\w.-]+)\/([\w.-]+)$/.exec(e.trim());if(t)return`${t[1]}/${GJ(t[2])}`;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)/.exec(e);if(!n)return null;let r=n[1],i=GJ(n[2]);return!r||!i||r==="sponsors"?null:`${r}/${i}`}function GJ(e){return e.replace(/\.git$/,"")}async function qJ(e,t={}){let n=t.lookup??((r,i)=>Wn(r,i,null));return Promise.all(e.map(async r=>{let i=r.rawFrom!=null&&r.from===null,o=r.rawTo!=null&&r.to===null;if(!i&&!o||r.source==="lockfile"||!N$e.has(r.ecosystem))return r;let a=(await n(r.name,r.ecosystem).catch(p=>(t.logger?.debug?.(`range resolution: registry lookup for ${r.name} failed: ${String(p)}`),null)))?.versions??[];if(a.length===0)return r;let c=i?VJ(a,r.rawFrom):r.from,l=o?VJ(a,r.rawTo):r.to;if(i&&!c||o&&!l)return r;let u=c??r.from,d=l??r.to;return t.logger?.debug?.(`range resolution: ${r.name} ${r.rawFrom} \u2192 ${r.rawTo} resolves to ${u} \u2192 ${d}`),{...r,from:u,to:d,bump:u&&d?Qs(u,d,r.ecosystem):r.bump}}))}var N$e=new Set(["npm"]);function VJ(e,t){let n=t.trim().replace(/^v(?=\d)/,"");return Xg.default.valid(n)?e.includes(n)?n:Xg.default.valid(n):Xg.default.validRange(n)?Xg.default.maxSatisfying([...e],n,{includePrerelease:!1}):null}var ad=require("node:fs"),HJ=gt(rc(),1);function Hn(){return{async readFile(e){try{return(0,ad.readFileSync)(e,"utf8")}catch{return null}},async readDirectory(e){try{return(0,ad.readdirSync)(e)}catch{return[]}},async isDirectory(e){try{return(0,ad.statSync)(e).isDirectory()}catch{return!1}}}}async function cd(e,t){let r=(await Promise.all([D$e(e,t),O$e(e,t),M$e(e,t),L$e(e,t),F$e(e,t),j$e(e,t)])).filter(o=>o!==null);return r.find(o=>o.kind==="pnpm-workspace")?r.filter(o=>o.kind!=="npm-workspaces"):r}function ld(e){let t=new Set;for(let n of e)for(let r of n.members)t.add(r.dir);return t.size===0?[""]:[...t].sort()}function Ec(e,t){let n=null;for(let r of t){if(r===""){n===null&&(n="");continue}(e===r||e.startsWith(`${r}/`))&&(n===null||r.length>n.length)&&(n=r)}return n}function _D(e,t){return t===""||e===t||e.startsWith(`${t}/`)}function KJ(e,t){if(t.length===0)return[...e];let n=ld(t),r=new Map;for(let i of t)for(let o of i.members)o.name&&r.set(o.dir,o.name);return e.map(i=>{let o=Ec(i.manifestPath,n);if(o===null)return i;let s=r.get(o);return{...i,workspace:o,...s?{workspaceName:s}:{}}})}function p_(e){return e.workspace===void 0?null:e.workspaceName??(e.workspace===""?"the repository root":e.workspace)}async function D$e(e,t){let n=await t.readFile(qr(e,"package.json"));if(!n)return null;let r=Bt(n),i=Array.isArray(r?.workspaces)?r.workspaces:r?.workspaces?.packages;return!i||i.length===0?null:{kind:"npm-workspaces",ecosystem:"npm",declaredIn:"package.json",members:await ud(e,t,i,"npm","package.json",r?.name??null)}}async function O$e(e,t){let n=await t.readFile(qr(e,"pnpm-workspace.yaml"));if(!n)return null;let r=[];try{let o=(0,HJ.parse)(n);Array.isArray(o?.packages)&&(r=o.packages.filter(s=>typeof s=="string"))}catch{return null}if(r.length===0)return null;let i=Bt(await t.readFile(qr(e,"package.json"))??"")?.name??null;return{kind:"pnpm-workspace",ecosystem:"npm",declaredIn:"pnpm-workspace.yaml",members:await ud(e,t,r,"npm","package.json",i)}}async function M$e(e,t){let n=await t.readFile(qr(e,"Cargo.toml"));if(!n)return null;let r=di(n),i=r.find(c=>c.header==="workspace");if(!i)return null;let o=Wg(i.entries.get("members")??""),s=r.some(c=>c.header==="package"),a=s?JJ(r.find(c=>c.header==="package")?.entries.get("name")??""):null;return{kind:"cargo-workspace",ecosystem:"cargo",declaredIn:"Cargo.toml",members:await ud(e,t,o,"cargo","Cargo.toml",a,!s)}}async function L$e(e,t){let n=await t.readFile(qr(e,"go.work"));if(!n)return null;let r=[],i=!1;for(let o of n.split(` +`)){let s=o.split("//")[0].trim();if(!s)continue;if(/^use\s*\($/.test(s)){i=!0;continue}if(i&&s===")"){i=!1;continue}let a=/^use\s+(\S+)$/.exec(s);a?r.push(a[1]):i&&r.push(s)}return{kind:"go-work",ecosystem:"go",declaredIn:"go.work",members:await ud(e,t,r,"go","go.mod",null,!0)}}async function F$e(e,t){let n=await t.readFile(qr(e,"pom.xml"));if(!n)return null;let r=/([\s\S]*?)<\/modules>/.exec(n);if(!r)return null;let i=[...r[1].matchAll(/\s*([^<]+?)\s*<\/module>/g)].map(s=>s[1]);if(i.length===0)return null;let o=/\s*([^<]+?)\s*<\/artifactId>/.exec(n)?.[1]??null;return{kind:"maven-modules",ecosystem:"maven",declaredIn:"pom.xml",members:await ud(e,t,i,"maven","pom.xml",o)}}async function j$e(e,t){let n=await t.readFile(qr(e,"settings.gradle.kts"))?"settings.gradle.kts":await t.readFile(qr(e,"settings.gradle"))?"settings.gradle":null;if(!n)return null;let i=[...(await t.readFile(qr(e,n))??"").matchAll(/include\s*\(?\s*((?:['"][^'"]+['"]\s*,?\s*)+)/g)].flatMap(o=>[...o[1].matchAll(/['"]([^'"]+)['"]/g)].map(s=>s[1])).map(o=>o.replace(/^:/,"").replace(/:/g,"/"));return i.length===0?null:{kind:"gradle-settings",ecosystem:"maven",declaredIn:n,members:await ud(e,t,i,"maven","build.gradle",null,!0)}}async function ud(e,t,n,r,i,o,s=!1){let a=new Set,c=new Set;for(let u of n){let d=u.trim();if(d.startsWith("!"))for(let p of await WJ(e,t,d.slice(1),i))c.add(p);else for(let p of await WJ(e,t,d,i))a.add(p)}for(let u of c)a.delete(u);let l=[];s||l.push({dir:"",name:o,ecosystem:r});for(let u of[...a].sort())u!==""&&l.push({dir:u,name:await eh(e,t,u,i,r),ecosystem:r});return l}async function WJ(e,t,n,r){let i=n.replace(/^\.\//,"").replace(/\/+$/,"");if(i.startsWith("!"))return[];if(!i.includes("*"))return[i];let o=i.split("/"),s=o.findIndex(p=>p.includes("*")),a=o.slice(0,s).join("/"),c=o[s]==="**",l=o.slice(s+1).join("/"),u=[],d=async(p,f)=>{if(!(f>4))for(let m of await t.readDirectory(qr(e,p))){if(m.startsWith(".")||m==="node_modules"||m==="target")continue;let g=p?`${p}/${m}`:m;if(!await t.isDirectory(qr(e,g)))continue;let h=l?`${g}/${l}`:g;(!r||await t.readFile(qr(e,h,r))!==null)&&u.push(h),c&&await d(g,f+1)}};return await d(a,0),u}async function eh(e,t,n,r,i){let o=await t.readFile(qr(e,n,r));if(!o)return null;switch(i){case"npm":return Bt(o)?.name??null;case"cargo":{let s=di(o).find(a=>a.header==="package");return JJ(s?.entries.get("name")??"")||null}case"go":return/^\s*module\s+(\S+)/m.exec(o)?.[1]??null;case"maven":return/\s*([^<]+?)\s*<\/artifactId>/.exec(o)?.[1]??null;default:return null}}function JJ(e){return e.trim().replace(/^["']|["']$/g,"")}function qr(...e){return e.filter(Boolean).join("/")}var f_=(e,t,n,r)=>e==="dev"?[t]:e==="optional"?[n]:e==="peer"&&r?[r]:[],U$e=e=>e?[...e.section==="dev-dependencies"?["--dev"]:[],...e.section==="build-dependencies"?["--build"]:[],...e.target?["--target",e.target]:[]]:[],$D=[{id:"npm",batchable:!0,ecosystem:"npm",label:"npm",manifests:["package.json"],lockfiles:["package-lock.json","npm-shrinkwrap.json"],outdated:{command:"npm",args:["outdated","--json"]},install:{command:"npm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"npm",args:["install",`${e}@${t}`,...f_(n,"--save-dev","--save-optional","--save-peer")]})},{id:"pnpm",batchable:!0,ecosystem:"npm",label:"pnpm",manifests:["package.json"],lockfiles:["pnpm-lock.yaml"],outdated:{command:"pnpm",args:["outdated"]},install:{command:"pnpm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"pnpm",args:["add",`${e}@${t}`,...f_(n,"--save-dev","--save-optional","--save-peer")]})},{id:"yarn-berry",batchable:!0,ecosystem:"npm",label:"Yarn (berry)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:null,install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"yarn",args:["add",`${e}@${t}`,...f_(n,"--dev","--optional","--peer")]})},{id:"yarn",batchable:!0,ecosystem:"npm",label:"Yarn (classic)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:{command:"yarn",args:["outdated","--json"]},install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t})=>({command:"yarn",args:["upgrade",`${e}@${t}`]})},{id:"bun",batchable:!0,ecosystem:"npm",label:"Bun",manifests:["package.json"],lockfiles:["bun.lock","bun.lockb"],outdated:{command:"bun",args:["outdated"]},install:{command:"bun",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"bun",args:["add",`${e}@${t}`,...f_(n,"--dev","--optional","--peer")]})},{id:"uv",batchable:!0,ecosystem:"pypi",label:"uv",manifests:["pyproject.toml"],lockfiles:["uv.lock"],outdated:{command:"uv",args:["pip","list","--outdated","--format","json"]},install:{command:"uv",args:["sync"]},upgrade:({name:e,version:t,kind:n})=>({command:"uv",args:["add",`${e}==${t}`,...n==="dev"?["--dev"]:[]]})},{id:"poetry",batchable:!0,ecosystem:"pypi",label:"Poetry",manifests:["pyproject.toml"],lockfiles:["poetry.lock"],outdated:{command:"poetry",args:["show","--outdated"]},install:{command:"poetry",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"poetry",args:["add",`${e}==${t}`,...n==="dev"?["--group","dev"]:[]]})},{id:"pip",batchable:!0,ecosystem:"pypi",label:"pip",manifests:["requirements.in","requirements.txt","pyproject.toml","setup.py"],manifestPattern:/^(?:requirements|constraints)[\w.-]*\.(?:in|txt)$/i,lockfiles:[],outdated:{command:"pip",args:["list","--outdated","--format=json"]},upgrade:({name:e,version:t})=>({command:"pip",args:["install","--upgrade",`${e}==${t}`]}),rewriteManifest:(e,{name:t,version:n},r)=>$c(r)?z$e(e,t,n):G$e(e,t,n)},{id:"go",batchable:!0,ecosystem:"go",label:"Go modules",manifests:["go.mod"],lockfiles:["go.sum"],outdated:{command:"go",args:["list","-u","-m","all"]},upgrade:({name:e,version:t})=>({command:"go",args:["get",`${e}@${t.startsWith("v")?t:`v${t}`}`]})},{id:"cargo",batchable:!0,ecosystem:"cargo",label:"Cargo",manifests:["Cargo.toml"],lockfiles:["Cargo.lock"],outdated:{command:"cargo",args:["update","--dry-run"]},upgrade:({name:e,version:t,cargo:n})=>({command:"cargo",args:["add",`${e}@=${t}`,...U$e(n)]})},{id:"bundler",batchable:!0,ecosystem:"rubygems",label:"Bundler",manifests:["Gemfile"],lockfiles:["Gemfile.lock"],outdated:{command:"bundle",args:["outdated"]},install:{command:"bundle",args:["install"]},upgrade:({name:e})=>({command:"bundle",args:["update",e,"--conservative"]}),rewriteManifest:(e,{name:t,version:n})=>B$e(e,t,n)},{id:"maven",ecosystem:"maven",label:"Maven",manifests:["pom.xml"],lockfiles:[],outdated:{command:"mvn",args:["versions:display-dependency-updates"]},upgrade:({name:e,version:t})=>({command:"mvn",args:["versions:use-dep-version",`-Dincludes=${e}`,`-DdepVersion=${t}`,"-DforceVersion=true"]})},{id:"gradle",ecosystem:"maven",label:"Gradle",manifests:["gradle/libs.versions.toml","build.gradle","build.gradle.kts"],lockfiles:["gradle.lockfile"],outdated:{command:"gradle",args:["dependencyUpdates"]},upgrade:()=>null},{id:"sbt",ecosystem:"maven",label:"sbt",manifests:["build.sbt"],lockfiles:[],outdated:{command:"sbt",args:["dependencyUpdates"]},upgrade:()=>null},{id:"dotnet",ecosystem:"nuget",label:"NuGet",manifests:["Directory.Packages.props"],manifestPattern:/\.(cs|fs|vb)proj$/i,lockfiles:["packages.lock.json"],outdated:{command:"dotnet",args:["list","package","--outdated"]},install:{command:"dotnet",args:["restore"]},upgrade:({name:e,version:t})=>({command:"dotnet",args:["add","package",e,"--version",t]})},{id:"composer",batchable:!0,ecosystem:"packagist",label:"Composer",manifests:["composer.json"],lockfiles:["composer.lock"],outdated:{command:"composer",args:["outdated","--format=json"]},install:{command:"composer",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"composer",args:["require",`${e}:${t}`,...n==="dev"?["--dev"]:[]]})},{id:"mix",batchable:!0,ecosystem:"hex",label:"Mix",manifests:["mix.exs"],lockfiles:["mix.lock"],outdated:{command:"mix",args:["hex.outdated"]},install:{command:"mix",args:["deps.get"]},upgrade:({name:e})=>({command:"mix",args:["deps.update",e]}),rewriteManifest:(e,{name:t,version:n})=>V$e(e,t,n)},{id:"rebar",ecosystem:"hex",label:"Rebar3",manifests:["rebar.config"],lockfiles:["rebar.lock"],outdated:null,install:{command:"rebar3",args:["get-deps"]},upgrade:({name:e})=>({command:"rebar3",args:["upgrade",e]}),rewriteManifest:(e,{name:t,version:n})=>q$e(e,t,n)},{id:"flutter",ecosystem:"pub",label:"Flutter",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"flutter",args:["pub","outdated"]},install:{command:"flutter",args:["pub","get"]},upgrade:({name:e,version:t})=>({command:"flutter",args:["pub","add",`${e}:${t}`]})},{id:"dart",ecosystem:"pub",label:"Dart pub",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"dart",args:["pub","outdated"]},install:{command:"dart",args:["pub","get"]},upgrade:({name:e,version:t,kind:n})=>({command:"dart",args:["pub","add",...n==="dev"?["dev:"]:[],`${e}:${t}`]})},{id:"swiftpm",ecosystem:"swift",label:"Swift Package Manager",manifests:["Package.swift"],lockfiles:["Package.resolved"],outdated:null,upgrade:()=>null},{id:"cocoapods",batchable:!0,ecosystem:"cocoapods",label:"CocoaPods",manifests:["Podfile"],lockfiles:["Podfile.lock"],outdated:{command:"pod",args:["outdated"]},install:{command:"pod",args:["install"]},upgrade:({name:e})=>({command:"pod",args:["update",e]}),rewriteManifest:(e,{name:t,version:n})=>W$e(e,t,n)},{id:"opam",batchable:!0,ecosystem:"opam",label:"opam",manifests:["dune-project"],manifestPattern:/\.opam$/,lockfiles:[],outdated:null,upgrade:({name:e,version:t})=>({command:"opam",args:["install",`${e}.${t}`,"--yes"]})},{id:"conan",batchable:!0,ecosystem:"conan",label:"Conan",manifests:["conanfile.txt","conanfile.py"],lockfiles:["conan.lock"],outdated:null,upgrade:()=>({command:"conan",args:["install",".","--build=missing"]}),rewriteManifest:(e,{name:t,version:n})=>H$e(e,t,n)},{id:"vcpkg",batchable:!0,ecosystem:"vcpkg",label:"vcpkg",manifests:["vcpkg.json"],lockfiles:[],outdated:null,upgrade:()=>({command:"vcpkg",args:["install"]}),rewriteManifest:(e,{name:t,version:n})=>K$e(e,t,n)},{id:"arduino-cli",batchable:!0,ecosystem:"arduino",label:"Arduino CLI",manifests:["library.properties"],lockfiles:[],outdated:{command:"arduino-cli",args:["lib","upgrade","--dry-run"]},upgrade:({name:e,version:t})=>({command:"arduino-cli",args:["lib","install",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>J$e(e,t,n)},{id:"platformio",ecosystem:"arduino",label:"PlatformIO",manifests:["platformio.ini"],lockfiles:[],outdated:{command:"pio",args:["pkg","outdated"]},upgrade:({name:e,version:t})=>({command:"pio",args:["pkg","install","--library",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>Z$e(e,t,n)}];function sa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z$e(e,t,n){let r=sa(t).replace(/[-_.]/g,"[-_.]"),i=new RegExp(`^([ \\t]*${r})(\\[[^\\]]*\\])?[ \\t]*(?:[=<>!~]=?\\s*[^\\s;#,]+(?:\\s*,\\s*[=<>!~]=?\\s*[^\\s;#,]+)*)?`,"im");return i.test(e)?e.replace(i,(o,s,a)=>`${s}${a??""}==${n}`):e}function G$e(e,t,n){let r=sa(t).replace(/[-_.]/g,"[-_.]"),i=new RegExp(`(["'])${r}(\\[[^\\]]*\\])?(?:\\s*[=<>!~]=?\\s*[^"',;]+(?:\\s*,\\s*[=<>!~]=?\\s*[^"',;]+)*)?\\1`,"i");return i.test(e)?e.replace(i,(o,s,a)=>`${s}${t}${a??""}==${n}${s}`):e}function B$e(e,t,n){let r=sa(t),i=new RegExp(`(gem\\s+["']${r}["'])\\s*,\\s*["'][^"']*["']`);if(i.test(e))return e.replace(i,`$1, '${n}'`);let o=new RegExp(`(gem\\s+["']${r}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function V$e(e,t,n){let r=sa(t),i=new RegExp(`(\\{\\s*:${r}\\s*,\\s*)"[^"]*"`);return i.test(e)?e.replace(i,`$1"== ${n}"`):e}function q$e(e,t,n){let r=sa(t),i=new RegExp(`(\\{\\s*${r}\\s*,\\s*)"[^"]*"`);return i.test(e)?e.replace(i,`$1"${n}"`):e}function W$e(e,t,n){let r=sa(t),i=new RegExp(`(pod\\s+["']${r}["'])\\s*,\\s*["'][^"']*["']`);if(i.test(e))return e.replace(i,`$1, '${n}'`);let o=new RegExp(`(pod\\s+["']${r}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function H$e(e,t,n){let r=sa(t),i=new RegExp(`\\b${r}/[^\\s"'#@]+`,"g");return e.replace(i,`${t}/${n}`)}function K$e(e,t,n){let r;try{r=JSON.parse(e)}catch{return e}let i=Array.isArray(r.overrides)?r.overrides:[],o=i.find(s=>s.name===t);return o?o.version=n:i.push({name:t,version:n}),r.overrides=i,`${JSON.stringify(r,null,2)} +`}function J$e(e,t,n){return e.split(` +`).map(r=>{let i=/^(\s*depends\s*=\s*)(.*)$/i.exec(r);if(!i)return r;let o=i[2].split(",").map(s=>s.replace(/\s*\([^)]*\)\s*$/,"").trim()!==t?s:` ${t} (${n})`);return`${i[1]}${o.join(",").replace(/^\s+/,"")}`}).join(` +`)}function Z$e(e,t,n){let r=sa(t),i=new RegExp(`^(\\s*)((?:[\\w.-]+/)?${r})(@[^\\s;#]*)?\\s*$`,"gm");return e.replace(i,(o,s,a)=>/^\s+/.test(s)?`${s}${a}@${n}`:o)}function Tc(e){return $D.find(t=>t.id===e)}var aa=$D;function ZJ(e,t){if(!e.batchable||t.length===0)return null;let n=new Map;for(let r of t){let i=e.upgrade(r);if(!i)return null;let o=Y$e(e,r,i);if(o===void 0)return null;let s=o===null?i.args:i.args.filter((l,u)=>u!==o),a=`${i.command}\0${o}\0${s.join("\0")}`,c=n.get(a);if(c){o!==null&&c.specs.push(i.args[o]);continue}n.set(a,{command:i,at:o,specs:o===null?[]:[i.args[o]]})}return[...n.values()].map(({command:r,at:i,specs:o})=>i===null?r:{command:r.command,args:[...r.args.slice(0,i),...o,...r.args.slice(i+1)]})}function Y$e(e,t,n){let r=e.upgrade({...t,name:Q$e,version:X$e});if(!r||r.command!==n.command||r.args.length!==n.args.length)return;let i=n.args.reduce((o,s,a)=>s===r.args[a]?o:[...o,a],[]);return i.length===0?null:i.length===1?i[0]:void 0}var Q$e="\0drift-probe",X$e="\0drift-probe-version";function ca(e){let t=new Set(e.entries),n=[];for(let i of $D){let o=i.lockfiles.filter(a=>t.has(a)),s=[...i.manifests.filter(a=>t.has(a)),...i.manifestPattern?e.entries.filter(a=>i.manifestPattern.test(a)):[]];o.length===0&&s.length===0||eSe(i,e,t)&&n.push({manager:i,evidence:[...o,...s],fromLockfile:o.length>0})}let r=new Set(n.filter(i=>i.fromLockfile).map(i=>i.manager.ecosystem));return n.filter(i=>i.fromLockfile||!r.has(i.manager.ecosystem))}function eSe(e,t,n){if(e.id==="yarn"||e.id==="yarn-berry"){let r=n.has(".yarnrc.yml")||(t.read?.("yarn.lock")??"").includes("__metadata");return e.id==="yarn-berry"?r:!r}if(e.id==="dart"||e.id==="flutter"){let r=t.read?.("pubspec.yaml")??"",i=/^\s*(flutter|flutter_test)\s*:/m.test(r)||/sdk:\s*flutter/.test(r);return e.id==="flutter"?i:!i}return!0}function YJ(e){let t=new Map;for(let n of e){let r=t.get(n.manager.ecosystem)??[];r.push(n),t.set(n.manager.ecosystem,r)}return[...t.entries()].filter(([,n])=>n.length>1).map(([n,r])=>({ecosystem:n,candidates:r}))}function QJ(e){return[e.command,...e.args].join(" ")}var la=require("node:fs/promises"),Ic=require("node:path");var xD=new Set([".git",".hg",".svn","node_modules","vendor","bower_components",".venv","venv","env","__pycache__",".tox","site-packages","target","build","dist","out",".next",".nuxt",".svelte-kit","coverage",".pytest_cache",".mypy_cache",".gradle",".idea",".vscode",".terraform","Pods","DerivedData",".pio","third_party","thirdparty","cmake-build-debug","cmake-build-release"]),tSe=new Set(["package.json",".nvmrc",".node-version",".ruby-version",".python-version",".tool-versions","dockerfile","containerfile","go.mod","gemfile","pom.xml","build.gradle","build.gradle.kts","cargo.toml","rust-toolchain","rust-toolchain.toml","pyproject.toml","setup.py","setup.cfg","runtime.txt",".ruby-gemset"]);function ED(e){let t=(e.split("/").pop()??"").toLowerCase();return tSe.has(t)||t.startsWith("dockerfile")||t.startsWith("containerfile")||t.endsWith(".gemspec")?!0:/^\.github\/workflows\/.+\.ya?ml$/.test(e)||/^\.(gitlab-ci|circleci)/.test(e)}var nSe={".ts":"typescript",".tsx":"typescript",".mts":"typescript",".cts":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".go":"go",".rs":"rust",".c":"c",".h":"c",".cpp":"cpp",".cc":"cpp",".cxx":"cpp",".c++":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".h++":"cpp",".inl":"cpp",".tpp":"cpp",".ino":"cpp",".pde":"cpp",".java":"java",".kt":"java",".kts":"java",".scala":"java",".rb":"ruby",".rake":"ruby",".cs":"dotnet",".fs":"dotnet",".vb":"dotnet",".php":"php",".ex":"elixir",".exs":"elixir",".erl":"erlang",".dart":"dart",".swift":"swift",".ml":"ocaml",".mli":"ocaml"},XJ=64*1024,rSe=2e3,iSe=["@generated","do not edit","do not modify","auto-generated","autogenerated","generated by","webpackbootstrap","sourcemappingurl"];async function oSe(e){let t;try{let i=await(0,la.open)(e,"r");try{let o=Buffer.alloc(XJ),{bytesRead:s}=await i.read(o,0,XJ,0);t=o.subarray(0,s).toString("utf8")}finally{await i.close()}}catch{return!1}let n=t.slice(0,4e3).toLowerCase();if(iSe.some(i=>n.includes(i)))return!0;let r=t.split(` +`);return r.length===1?!0:r.slice(0,-1).some(i=>i.length>rSe)}function eZ(e){let t=e.lastIndexOf(".");return t===-1?"other":nSe[e.slice(t).toLowerCase()]??"other"}async function dd(e,t={}){let{maxFileBytes:n=512*1024,maxFiles:r=5e3,extraIgnores:i=[],members:o}=t,s=new Set([...xD,...i]),a=async $=>{let S;try{S=await sSe.run(()=>(0,la.readdir)($,{withFileTypes:!0}))}catch{return[]}let E=[];for(let T of S){let A=(0,Ic.join)($,T.name);if(T.isDirectory()){if(s.has(T.name)||T.name.startsWith(".")&&T.name!==".github"&&T.name!==".circleci")continue;E.push(a(A));continue}if(!T.isFile())continue;let R=cSe((0,Ic.relative)(e,A)),j=ED(R)?"config":eZ(T.name);j!=="other"&&(/\.min\.(js|ts)$/.test(T.name)||/\.d\.ts\.map$/.test(T.name)||E.push([{full:A,repoPath:R,language:j}]))}return(await Promise.all(E)).flat()},c=await a(e),l=c.filter($=>$.language==="config"),u=c.filter($=>$.language!=="config"),d=[],p=0,f=0,m=0,g=async $=>{let S=await qn($,aSe,async E=>{try{return(await(0,la.stat)(E.full)).size>n?(await oSe(E.full)?f+=1:m+=1,null):await(0,la.readFile)(E.full,"utf8")}catch{return null}});for(let[E,T]of S.entries()){if(T===null)continue;let A=$[E];d.push({path:A.repoPath,language:A.language,content:T,lineCount:lSe(T),...o?{member:Ec(A.repoPath,o)}:{}})}};await g(l);let h=0;for(;h$.path.localeCompare(S.path)),b=h+f===u.length,w=d.filter($=>$.language==="config").length,k={localizationRan:!0,localizationComplete:b,sourceFilesDiscovered:u.length,sourceFilesIndexed:h,sourceTruncated:!b,generatedFilesSkipped:f,oversizedSourceSkipped:m,runtimeConfigsDiscovered:l.length,runtimeConfigsIndexed:w,runtimeConfigComplete:l.length===w};return Object.defineProperty(v,"coverage",{value:k,enumerable:!1}),v}var SD=class{constructor(t){this.limit=t}limit;active=0;waiting=[];async run(t){this.active>=this.limit&&await new Promise(n=>this.waiting.push(n)),this.active+=1;try{return await t()}finally{this.active-=1,this.waiting.shift()?.()}}},sSe=new SD(64),aSe=16;function cSe(e){return Ic.sep==="/"?e:e.split(Ic.sep).join("/")}function lSe(e){let t=1;for(let n=0;ne.manifests)),TD=new Map;for(let e of aa)for(let t of e.manifests)TD.has(t)||TD.set(t,e.ecosystem);function tZ(e){let t=TD.get(e);if(t)return t;for(let n of aa){let r=n.manifestPattern;if(r&&(r.lastIndex=0,r.test(e)))return n.ecosystem}return null}async function g_(e,t,n=[],r=8){let i=new Set(n),o=[],s=async(a,c)=>{if(c>r)return;let l=await t.readDirectory(m_(e,a));if(l.length===0)return;let u=!1;if(a!==""&&!i.has(a)){u=l.includes(".git");let d=l.find(f=>uSe.has(f))??l.find(f=>tZ(f)),p=d?tZ(d):null;d&&p&&(u||!pSe(a))&&o.push({dir:a,ecosystem:p,manifestPath:m_(a,d),hasOwnGit:u})}if(!u)for(let d of l){if(xD.has(d)||d.startsWith(".")&&d!==".github")continue;let p=m_(a,d);i.has(p)||await t.isDirectory(m_(e,p))&&await s(p,c+1)}};return await s("",0),o}var dSe=new Set(["fixtures","__fixtures__","testdata","registry"]);function pSe(e){let t=e.split("/").filter(Boolean).map(r=>r.toLowerCase()),n=t.findIndex(r=>r==="test"||r==="tests");return n===-1?!1:t.slice(n+1).some(r=>dSe.has(r))}function m_(...e){return e.filter(Boolean).join("/")}var rZ=require("node:crypto");function xt(e,...t){let n=(0,rZ.createHash)("sha256").update(t.map(r=>String(r??"")).join(" ")).digest("hex");return`${e}_${n.slice(0,10)}`}function Ac(e){return e.workspace===void 0?e.name:`${e.workspace} ${e.name}`}function cn(e){return`${e.ecosystem} ${Ac(e)}`}function ID(e){return JSON.stringify([e.ecosystem,e.name,e.from??null,e.to??null])}function nZ(e){let t=0,n=e.length;for(;tt&&e.charCodeAt(n-1)===45;)n--;return e.slice(t,n)}function iZ(e,t=40){let n=nZ(e.toLowerCase().replace(/[^a-z0-9]+/g,"-"));return nZ(n.slice(0,t))||"change"}var fSe=["CHANGELOG.md","CHANGELOG.markdown","CHANGELOG","CHANGES.md","Changes.md","HISTORY.md","NEWS.md","RELEASES.md","RELEASE-NOTES.md","RELEASE_NOTES.md","CHANGELOG.rst","CHANGES.rst","CHANGELOG.txt","docs/CHANGELOG.md","docs/changelog.md","changelog.md"],mSe=["MIGRATING.md","MIGRATION.md","UPGRADING.md","UPGRADE.md","docs/migration.md","docs/migrating.md","docs/upgrading.md","docs/MIGRATION.md","docs/UPGRADE.md"];async function cZ(e,t=["main","master"]){return lZ(e,fSe,t)}async function gSe(e,t=["main","master"]){return lZ(e,mSe,t)}var oZ=1,sZ=16;function*hSe(e){if(e.length!==0){yield e.slice(0,oZ);for(let t=oZ;tt.map(o=>({branch:i,filename:o})));for(let i of hSe(r)){let o=await Promise.all(i.map(({branch:l,filename:u})=>nt(`https://raw.githubusercontent.com/${e}/${l}/${u}`,{retries:0}))),s=o.findIndex(l=>l!==null&&l.trim()!=="");if(s<0)continue;let{branch:a,filename:c}=i[s];return{path:c,url:`https://github.com/${e}/blob/${a}/${c}`,content:o[s],branch:a}}return null}function ySe(e,t="npm"){let n=[],r=new Set;for(let i of e.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)){let o=i[1],s=i[2];if(/^[a-z]+:/i.test(s)||s.startsWith("#")||!/\.(md|markdown|rst|txt)$/i.test(s))continue;let a=AD(o,t)??AD(s.replace(/[/\\]/g," "),t);if(!a)continue;let c=s.replace(/^\.?\//,"").split("#")[0];r.has(c)||(r.add(c),n.push({path:c,version:a}))}return n}async function uZ(e,t,n,r="npm",i={}){let{branches:o=["main","master"],maxDocuments:s=12}=i,a=await cZ(e,o);return a?pZ(a,e,t,n,r,s):[]}async function dZ(e,t,n,r,i="npm",o=12){let s=/^https?:\/\/github\.com\/([^/]+\/[^/]+)\/blob\/([^/]+)\/(.+)$/i.exec(e),a=s?`https://raw.githubusercontent.com/${s[1]}/${s[2]}/${s[3]}`:e,c=await nt(a,{retries:0});if(!c||!c.trim())return[];let l=decodeURIComponent(new URL(e).pathname.split("/").pop()||"changelog"),u=s?.[2]??"main",d=s?.[1]??t;s?.[3]&&(l=s[3]);let p={path:l,url:e,content:c,branch:u};return d?pZ(p,d,n,r,i,o):[p]}async function pZ(e,t,n,r,i,o){if(PD(RD(e.content,i),n,r,i).length>0)return[e];let s=ySe(e.content,i).filter(l=>bSe(l.version,n,r,i));if(s.length===0)return[e];let c=(await Promise.all([...s].sort((l,u)=>mZ(u.version,l.version,i)).slice(0,o).map(async l=>{let u=await nt(`https://raw.githubusercontent.com/${t}/${e.branch}/${l.path}`,{retries:0});return!u||!u.trim()?null:{path:l.path,url:`https://github.com/${t}/blob/${e.branch}/${l.path}`,content:u,branch:e.branch}}))).filter(l=>l!==null);return c.length>0?c:[e]}async function fZ(e,t=["main","master"]){let[n,r]=await Promise.all([gSe(e,t),cZ(e,t)]),i=n?[n]:[];if(!r)return i;let o=[...r.content.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)].filter(([,s,a])=>aZ.test(s)||aZ.test(a)).map(([,,s])=>s.replace(/^\.?\//,"").split("#")[0]).filter(s=>/\.(md|markdown|rst|txt)$/i.test(s)&&!/^[a-z]+:/i.test(s));for(let s of[...new Set(o)].slice(0,4)){if(i.some(c=>c.path===s))continue;let a=await nt(`https://raw.githubusercontent.com/${e}/${r.branch}/${s}`,{retries:0});!a||!a.trim()||i.push({path:s,url:`https://github.com/${e}/blob/${r.branch}/${s}`,content:a,branch:r.branch})}return i}var aZ=/migrat|upgrad/i;function bSe(e,t,n,r){let i=Re(t,r),o=Re(n,r),s=Re(e,r);if(!i||!o||!s)return!1;let a=Ye(o,i);if(a===null)return!1;let[c,l]=a>0?[i,o]:[o,i],u=Ye(s,c),d=Ye(s,l);return u!==null&&d!==null&&u>0&&d<=0}function RD(e,t="npm"){let n=[],r=e.split(` +`),i=null;for(let o=0;o0?[i,o]:[o,i];return e.filter(l=>{let u=Re(l.version,r);if(!u)return!1;let d=Ye(u,a),p=Ye(u,c);return d!==null&&p!==null&&d>0&&p<=0}).sort((l,u)=>mZ(u.version,l.version,r))}function mZ(e,t,n){let r=Re(e,n),i=Re(t,n);return r&&i?Ye(r,i)??0:0}function th(e){let t=[],n=e.split(` +`),r=!1,i=0;for(let o of n){let s=/^(#{1,6})\s(.*)$/.exec(o);if(s){let c=s[1].length,l=s[2].trimStart();if(wSe.test(l)){r=!0,i=c,t.push(o.trim());continue}r&&c<=i&&(r=!1)}let a=o.trim();if(a){if(r){t.push(a);continue}_Se(a)&&t.push(a)}}return $Se(t)}var vSe=/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b|\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,wSe=/breaking|incompatib|removed|migration|upgrade\s+guide|deprecat|commonjs/i,kSe=/\b(BREAKING(\s+CHANGE)?|breaking change|no longer|has been removed|have been removed|was removed|were removed|is removed|renamed to|renamed from|replaced by|replaced with|now requires?|required\s+node|must now|dropped support|drop support|removed support|is now required|are now required|moved to|deprecated in favou?r of|minimum\s+(?:supported\s+)?(?:node|python|go|ruby|java|rust))\b/i;function _Se(e){return kSe.test(e)||vSe.test(e)}function $Se(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}async function gZ(e,t,n,r,i={}){let{token:o,maxReleases:s=25}=i,a={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};o&&(a.Authorization=`Bearer ${o}`);let c=Re(t,r),l=Re(n,r);if(!c||!l)return[];let u=Ye(l,c);if(u===null)return[];let[d,p]=u>0?[c,l]:[l,c],f=[],m=100,g=5;for(let h=1;h<=g;h++){let v=await xe(`https://api.github.com/repos/${e}/releases?per_page=${m}&page=${h}`,{headers:a});if(!v||v.length===0)break;let b=!1;for(let w of v){if(w.draft)continue;let k=xSe(w.tag_name,r);if(!k)continue;let $=Ye(k,d),S=Ye(k,p);if(!($===null||S===null)){if($<=0){b=!0;continue}S>0||f.push({tag:w.tag_name,version:k.raw,name:w.name,body:w.body??"",url:w.html_url,publishedAt:w.published_at})}}if(b||v.lengthRe(a.version,n),i=[...e].sort((a,c)=>{let l=r(a),u=r(c);return l&&u?-(Ye(l,u)??0):0});if(i.length<=t)return i;let o=i.filter(a=>{let c=r(a);return!!(c?.release&&(c.release[2]??0)===0&&!c.prerelease)}).sort((a,c)=>{let l=r(a),u=r(c);return l&&u?Ye(l,u)??0:0}),s=new Map;for(let a of o){if(s.size>=t)break;s.set(a.version,a)}for(let a of i){if(s.size>=t)break;s.set(a.version,a)}return[...s.values()].sort((a,c)=>{let l=r(a),u=r(c);return l&&u?-(Ye(l,u)??0):0})}function xSe(e,t){let n=Re(e,t);if(n)return n;let r=e.match(/v?\d[0-9A-Za-z.!+_-]*(?:\.[0-9A-Za-z!+_-]+)*/g)??[];for(let i of r){let o=Re(i,t)??(i.startsWith("v")?Re(i.slice(1),t):null);if(o)return o}return null}var c$=require("node:fs/promises"),e9=require("node:os"),t9=require("node:path");var hZ=require("node:child_process");var ESe=18e4,TSe=32*1024*1024;function ISe(e,t){let n=e.slice(e.lastIndexOf("/")+1),r=t[0];return r&&!r.startsWith("-")?`${n} ${r}`:n}var Qe=(e,t,n={})=>new Promise(r=>{let i=ISe(e,t),o=Zg()?At("exec",i):null;o&&tt("exec.spawned");let s=Date.now(),a=(0,hZ.execFile)(e,[...t],{cwd:n.cwd,timeout:n.timeoutMs??ESe,maxBuffer:n.maxBuffer??TSe,env:n.env??process.env,windowsHide:!0,encoding:"utf8",...n.signal?{signal:n.signal}:{}},(c,l,u)=>{if(o?.end({code:c?1:0}),!c){aD({label:i,durationMs:Date.now()-s,exitCode:0,stdoutBytes:l.length,stderrBytes:u.length}),r({code:0,stdout:l,stderr:u});return}let d=c,p=d.code==="ENOENT"?"not-found":d.killed||d.name==="AbortError"||d.code==="ABORT_ERR"?"timeout":"error";aD({label:i,durationMs:Date.now()-s,exitCode:typeof d.code=="number"?d.code:null,failure:p,stdoutBytes:(l??"").length,stderrBytes:(u??"").length}),r({code:typeof d.code=="number"?d.code:1,stdout:l??"",stderr:u??String(c.message??""),failure:p})});if(n.onOutput){let c=l=>{try{n.onOutput(String(l))}catch{}};a.stdout?.on("data",c),a.stderr?.on("data",c)}a.stdin?.end()});async function h_(e,t,n=["--version"]){let r=await e(t,n,{timeoutMs:2e4});return r.failure!=="not-found"&&r.code===0}var kZ=gt(rc(),1),CD="openapi-diff",DD={id:"openapi",source:"openapi-diff",tool:CD,weight:1,originClass:"computed-artifact",config:{enabled:"openapi",paths:"openapiSpecs"},handles(e,t){return pd(t)!==null},async compute(e){return!pd(e.before)||!pd(e.after)?{available:!1,reason:"parse-failed",detail:`${e.path} is not a document Drift could read as an OpenAPI or Swagger spec on both sides of this change.`,tool:CD}:{available:!0,changes:_Z(e.before,e.after).map(t=>({code:t.kind,location:t.location,pointer:t.pointer,detail:t.detail})),tool:CD,weight:1,locator:e.path}},codes:{"path-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"operation-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"response-status-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this success status. Update response handling so the removed status is no longer treated as a success path.`},"parameter-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`A required parameter was removed from \`${e}\`. Remove it from client calls; sending it may now be rejected as an unexpected parameter.`},"parameter-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"parameter-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-now-required":{kind:"required-field-added",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"request-enum-narrowed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer accepts some previously-valid values. Find code that sends the removed values and map them onto still-supported ones.`},"response-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this field. Update every reader of that field. If the value is genuinely no longer available, propagate the absence properly rather than substituting a placeholder that could be mistaken for real data.`},"response-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The response type for \`${e}\` changed. Update parsing and any downstream type declarations.`},"response-enum-widened":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` can now return values this code has never seen. Add explicit handling; make sure exhaustive switches and mapping tables have a safe default rather than falling through silently.`},"security-added":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires authentication. Ensure the client attaches credentials for this call, reusing the repo's existing auth mechanism \u2014 never introduce a new credential source or hard-code a token.`}}},ASe=["get","put","post","delete","options","head","patch","trace"];function pd(e){let t;try{t=e.trim().startsWith("{")?JSON.parse(e):(0,kZ.parse)(e)}catch{return null}if(!t||typeof t!="object")return null;let n=t;return!n.openapi&&!n.swagger?null:n}function _Z(e,t){let n=pd(e),r=pd(t);if(!n||!r)return[];let i=[],o=n.paths??{},s=r.paths??{};for(let[a,c]of Object.entries(o)){let l=s[a];if(!l){i.push({kind:"path-removed",location:a,pointer:`#/paths/${wZ(a)}`,detail:`Path \`${a}\` no longer exists. Every request to it will 404.`});continue}for(let u of ASe){let d=c[u];if(!d)continue;let p=l[u],f=`${u.toUpperCase()} ${a}`,m=`#/paths/${wZ(a)}/${u}`;if(!p){i.push({kind:"operation-removed",location:f,pointer:m,detail:`Operation \`${f}\` was removed.`});continue}RSe(d,p,n,r,f,m,i),PSe(d,p,n,r,f,m,i),CSe(d,p,n,r,f,m,i),NSe(d,p,f,m,i)}}return i}function RSe(e,t,n,r,i,o,s){let a=yZ(e.parameters,n),c=yZ(t.parameters,r);for(let[l,u]of a){let d=c.get(l);if(!d){u.required&&s.push({kind:"parameter-removed",location:i,pointer:`${o}/parameters/${l}`,detail:`Required parameter \`${u.name}\` (in: ${u.in}) was removed.`});continue}!u.required&&d.required&&s.push({kind:"parameter-now-required",location:i,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` (in: ${d.in}) is now required. Calls omitting it will be rejected.`});let p=b_(u.schema??{type:u.type}),f=b_(d.schema??{type:d.type});p&&f&&p!==f&&s.push({kind:"parameter-type-changed",location:i,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` changed type from \`${p}\` to \`${f}\`.`});let m=v_(u.schema),g=v_(d.schema),h=m.filter(v=>!g.includes(v));m.length&&g.length&&h.length&&s.push({kind:"request-enum-narrowed",location:i,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` no longer accepts: ${h.map(v=>`\`${v}\``).join(", ")}.`})}}function PSe(e,t,n,r,i,o,s){let a=ua(bZ(e),n),c=ua(bZ(t),r);if(!a||!c)return;let l=new Set(vZ(a)),u=vZ(c);for(let d of u)l.has(d)||s.push({kind:"request-field-now-required",location:i,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` is now required.`});for(let[d,p,f]of $Z(a,c,n,r))s.push({kind:"request-field-type-changed",location:i,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` changed type from \`${p}\` to \`${f}\`.`})}function CSe(e,t,n,r,i,o,s){let a=e.responses??{},c=t.responses??{};for(let[l,u]of Object.entries(a)){if(!/^2\d\d$/.test(l))continue;let d=c[l];if(!d){s.push({kind:"response-status-removed",location:i,pointer:`${o}/responses/${l}`,detail:`Success response \`${l}\` was removed from \`${i}\`.`});continue}let p=ua(ND(u),n),f=ua(ND(d),r);if(!p||!f)continue;let m=y_(p),g=y_(f);for(let h of Object.keys(m))h in g||s.push({kind:"response-field-removed",location:i,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` is no longer returned by \`${i}\`.`});for(let[h,v,b]of $Z(p,f,n,r))s.push({kind:"response-field-type-changed",location:i,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` changed type from \`${v}\` to \`${b}\`.`});for(let[h,v]of Object.entries(m)){let b=g[h];if(!b)continue;let w=v_(v),$=v_(b).filter(S=>!w.includes(S));w.length&&$.length&&s.push({kind:"response-enum-widened",location:i,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` can now return new values: ${$.map(S=>`\`${S}\``).join(", ")}. Exhaustive handling of this field must be updated.`})}}}function NSe(e,t,n,r,i){let o=e.security??[],s=t.security??[],a=o.length===0||o.some(l=>Object.keys(l).length===0),c=s.length===0||s.some(l=>Object.keys(l).length===0);if(a&&!c&&s.length>0){let l=[...new Set(s.flatMap(u=>Object.keys(u)))];i.push({kind:"security-added",location:n,pointer:`${r}/security`,detail:`\`${n}\` now requires authentication (${l.join(", ")}).`})}}function yZ(e,t){let n=new Map;if(!Array.isArray(e))return n;for(let r of e){let i=ua(r,t);i?.name&&n.set(`${i.in??"query"}:${i.name}`,i)}return n}function bZ(e){let t=e.requestBody;return t?ND(t):null}function ND(e){let t=e.content;if(!t)return e.schema??null;let n=Object.keys(t).find(r=>r.includes("json"))??Object.keys(t)[0];return n?t[n]?.schema??null:null}function ua(e,t,n=0){if(!e)return null;if(n>10)return e;let r=e.$ref;if(typeof r!="string")return e;if(!r.startsWith("#/"))return null;let i=r.slice(2).split("/").map(DSe),o=t;for(let s of i){if(!o||typeof o!="object")return null;o=o[s]}return!o||typeof o!="object"?null:ua(o,t,n+1)}function y_(e){let t=e.properties??{},n=e.allOf;if(!Array.isArray(n))return t;let r={...t};for(let i of n)i&&typeof i=="object"&&Object.assign(r,i.properties??{});return r}function vZ(e){let t=Array.isArray(e.required)?e.required:[],r=(Array.isArray(e.allOf)?e.allOf:[]).flatMap(i=>{let o=i?.required;return Array.isArray(o)?o:[]});return[...new Set([...t,...r])]}function $Z(e,t,n,r){let i=[],o=y_(e),s=y_(t);for(let[a,c]of Object.entries(o)){let l=s[a];if(!l)continue;let u=b_(ua(c,n)),d=b_(ua(l,r));u&&d&&u!==d&&i.push([a,u,d])}return i}function b_(e){if(!e)return null;let t=e.type;if(typeof t=="string"){if(t==="array"){let n=e.items;return`array<${typeof n?.type=="string"?n.type:"unknown"}>`}return t}return Array.isArray(t)?t.join("|"):null}function v_(e){let t=e?.enum;return Array.isArray(t)?t.map(n=>String(n)):[]}function wZ(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function DSe(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}var k_=require("node:fs/promises"),ts=require("node:path");function da(e,t,n,r){return{available:!1,reason:t,detail:n,...r?{remedy:r}:{},tool:e}}var fd="buf breaking",OSe="Install the Buf CLI (https://buf.build/docs/installation) so Drift can compare `.proto` revisions against the protobuf compatibility rules.",SZ="Add the imported `.proto` files to `evidence.protobufSpecs` \u2014 Drift compiles every configured `.proto` together, so an import it was told about resolves. A pattern such as `proto/**/*.proto` covers a whole directory of them.",MSe=100,OD={id:"protobuf",source:"protobuf-diff",tool:fd,weight:1,originClass:"computed-artifact",config:{enabled:"protobuf",paths:"protobufSpecs"},handles(e,t){return e.endsWith(".proto")?/^\s*(syntax\s*=|package\s+|message\s+|service\s+|enum\s+)/m.test(t):!1},async compute(e){let t=await e.exec("buf",["--version"],{timeoutMs:2e4,...e.env?{env:e.env}:{}});if(t.failure==="not-found"||t.code!==0)return da(fd,"tool-missing",`The Buf CLI is not installed or is not on PATH, so ${e.path} could not be checked against the protobuf compatibility rules.`,OSe);let n=(0,ts.join)(e.workdir,"after"),r=(0,ts.join)(e.workdir,"before");await w_((0,ts.join)(n,e.path),e.after),await w_((0,ts.join)(r,e.path),e.before);for(let a of e.siblings)a.path!==e.path&&(await w_((0,ts.join)(n,a.path),a.after),await w_((0,ts.join)(r,a.path),a.before));let i=await e.exec("buf",["breaking",n,"--against",r,"--error-format=json"],{cwd:e.workdir,timeoutMs:e.timeoutMs,...e.env?{env:e.env}:{}});if(i.code!==0&&i.code!==MSe){let a=(i.stderr||i.stdout||"no output").trim().split(` +`)[0]??"";return da(fd,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${a}`,SZ)}let o;try{o=xZ(i.stdout)}catch(a){return da(fd,"unexpected-output",`Drift could not read \`buf breaking\` output for ${e.path}: ${a.message}`)}let s=o.find(LSe);return s?da(fd,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${s.message}`,jSe(s)):{available:!0,changes:o.filter(a=>USe(a,e.path)).map(a=>zSe(a,e.path)),tool:fd,weight:1,locator:`${e.path} (buf breaking)`}},codes:{"proto-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` was deleted. Regenerate this repository's stubs and update every reader and writer of that field. Do not reuse its field number for anything else \u2014 reserve it \u2014 and if the value is genuinely gone, propagate the absence rather than substituting a placeholder that could be mistaken for real data.`},"proto-field-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` changed name. The wire encoding is unaffected \u2014 field numbers carry it \u2014 but generated accessors and any JSON representation are not. Regenerate the stubs and rename every use; check JSON payloads persisted or exchanged under the old name.`},"proto-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The type or cardinality of the protobuf field \`${e}\` changed. Regenerate the stubs and update every construction and read of that field. A value already persisted or in flight was encoded under the old type \u2014 check that decoding it still means what the code assumes.`},"proto-field-encoding-changed":{kind:"behaviour-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`An encoding option on the protobuf field \`${e}\` changed. Nothing about the schema's shape moved, so this compiles either way \u2014 what changes is the generated representation or the validation applied to the value. Review code that depends on that field's concrete representation.`},"proto-oneof-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf oneof \`${e}\` was deleted. Regenerate the stubs and rewrite every switch over its cases; a oneof's generated API has no drop-in replacement, so restructure the calling code rather than stubbing the accessor.`},"proto-message-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf message \`${e}\` no longer exists. Regenerate the stubs and migrate every use to the replacement message. If there is no replacement, leave the call site intact with a clearly-marked TODO and explain it in the PR description rather than inventing a local copy of the type.`},"proto-enum-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum \`${e}\` no longer exists. Regenerate the stubs and migrate every use to whatever now carries those values.`},"proto-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` was deleted. Regenerate the stubs and map every use onto a still-supported value. A peer that still sends the removed number will decode as the unknown/unrecognised case \u2014 make sure that path is handled rather than falling through silently.`},"proto-enum-value-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` changed name. The number is unchanged, so the wire encoding is safe; generated constants and JSON names are not. Regenerate the stubs and rename every use.`},"proto-rpc-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The RPC \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement RPC. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"proto-rpc-signature-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The signature of the RPC \`${e}\` changed \u2014 its request type, response type, or streaming shape. Regenerate the stubs and update every call site; a streaming change in particular rewrites the call's control flow, not just its types.`},"proto-service-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The service \`${e}\` no longer exists. Every client of it must be migrated to the replacement service; if there is none, leave the client intact with a clearly-marked TODO rather than deleting the feature.`},"proto-package-changed":{kind:"moved-export",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"package",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf package or a generated-code package option changed for \`${e}\`. The definitions still exist \u2014 their generated home moved. Regenerate the stubs and update the import paths; do not re-implement or stub the individual messages.`},"proto-file-removed":{kind:"removed-endpoint",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The \`.proto\` file \`${e}\` was deleted, taking everything it declared with it. Find where those definitions moved to and update the imports and generated-code references; if they were removed outright, say so in the PR description rather than recreating the file locally.`},"proto-contract-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e,detail:t})=>`\`buf\` reports a compatibility break at \`${e}\`: ${t} Regenerate this repository's stubs and update the code around that definition to match the new contract.`}}};async function w_(e,t){await(0,k_.mkdir)((0,ts.dirname)(e),{recursive:!0}),await(0,k_.writeFile)(e,t,"utf8")}function xZ(e){let t=[];for(let n of e.split(` +`)){let r=n.trim();if(!r.startsWith("{"))continue;let i;try{i=JSON.parse(r)}catch{continue}if(!i||typeof i!="object")continue;let o=i;typeof o.type!="string"||typeof o.message!="string"||t.push({path:typeof o.path=="string"?o.path:"",type:o.type,message:o.message,...typeof o.start_line=="number"?{start_line:o.start_line}:{},...typeof o.start_column=="number"?{start_column:o.start_column}:{}})}return t}function LSe(e){return FSe.has(e.type)}var FSe=new Set(["COMPILE","PLUGIN_FAILURE","CONFIGURATION"]);function jSe(e){return e.type==="COMPILE"?SZ:"Check the `buf` configuration and plugins in this repository, then re-run."}function USe(e,t){return e.path===t||e.path.endsWith(`/${t}`)}function zSe(e,t){let n=e.start_line??0;return{code:EZ(e.type),location:TZ(e.message)??`${t}:${n}`,pointer:n>0?`${t}:${n}`:t,detail:e.message}}function EZ(e){switch(e){case"FIELD_SAME_NAME":case"FIELD_SAME_JSON_NAME":return"proto-field-renamed";case"ENUM_VALUE_SAME_NAME":return"proto-enum-value-renamed";case"FIELD_SAME_TYPE":case"FIELD_SAME_LABEL":case"FIELD_SAME_CARDINALITY":case"FIELD_SAME_ONEOF":case"FIELD_WIRE_COMPATIBLE_TYPE":case"FIELD_WIRE_COMPATIBLE_CARDINALITY":case"FIELD_WIRE_JSON_COMPATIBLE_TYPE":case"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY":return"proto-field-type-changed";case"FIELD_SAME_CTYPE":case"FIELD_SAME_JSTYPE":case"FIELD_SAME_CPP_STRING_TYPE":case"FIELD_SAME_UTF8_VALIDATION":case"FIELD_SAME_JAVA_UTF8_VALIDATION":case"FIELD_SAME_DEFAULT":return"proto-field-encoding-changed";case"RPC_SAME_REQUEST_TYPE":case"RPC_SAME_RESPONSE_TYPE":case"RPC_SAME_CLIENT_STREAMING":case"RPC_SAME_SERVER_STREAMING":case"RPC_SAME_IDEMPOTENCY_LEVEL":return"proto-rpc-signature-changed";default:break}if(/^FILE_SAME_(GO|JAVA|PHP|RUBY|CSHARP|OBJC|SWIFT)_/.test(e)||e==="FILE_SAME_PACKAGE"||e==="PACKAGE_NO_DELETE")return"proto-package-changed";if(e==="FILE_NO_DELETE")return"proto-file-removed";if(e.endsWith("_NO_DELETE")||e.includes("_NO_DELETE_UNLESS_")){if(e.startsWith("FIELD_"))return"proto-field-removed";if(e.startsWith("ENUM_VALUE_"))return"proto-enum-value-removed";if(e.startsWith("ENUM_")||e.startsWith("PACKAGE_ENUM_"))return"proto-enum-removed";if(e.startsWith("ONEOF_"))return"proto-oneof-removed";if(e.startsWith("RPC_"))return"proto-rpc-removed";if(e.startsWith("SERVICE_")||e.startsWith("PACKAGE_SERVICE_"))return"proto-service-removed";if(e.startsWith("MESSAGE_")||e.startsWith("PACKAGE_MESSAGE_"))return"proto-message-removed"}return"proto-contract-changed"}function TZ(e){let t=/\bon (?:message|service|enum|oneof|extension) "([^"]+)"/.exec(e)?.[1]??/\b(?:message|service|enum) "([^"]+)"/.exec(e)?.[1]??null,n=/\bwith name "([^"]+)"/.exec(e)?.[1]??/\bchanged name from "[^"]+" to "([^"]+)"/.exec(e)?.[1]??/\b(?:RPC|field|value|oneof) "([^"]+)"/i.exec(e)?.[1]??null,r=n&&!/^\d+$/.test(n)?n:null;return t&&r?`${t}.${r}`:t??r}function de(e){return __(e,[])}function __(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return GSe(e,t);default:return String(e)}}function GSe(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(BSe(e)){let r=e.toJSON();if(r!==e)return typeof r=="string"?r:__(r,n)}else if(Array.isArray(e))return qSe(e,n);return VSe(e,n)}function BSe(e){return typeof e.toJSON=="function"}function VSe(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+WSe(e)+"]":"{ "+n.map(([i,o])=>i+": "+__(o,t)).join(", ")+" }"}function qSe(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),r=e.length-n,i=[];for(let o=0;o1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function WSe(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}function HSe(e,t){return e?.__kind===t}var Ar=HSe;function IZ(e){return e instanceof Error?e:new MD(e)}var MD=class extends Error{constructor(t){super("Unexpected error value: "+de(t)),this.name="NonErrorThrown",this.thrownValue=t}};function Kn(e){return typeof e=="object"&&e!==null}function rt(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var KSe=/\r\n|[\n\r]/g;function md(e,t){let n=0,r=1;for(let i of e.body.matchAll(KSe)){if(typeof i.index!="number"&&rt(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function LD(e){return $_(e.source,md(e.source,e.start))}function $_(e,t){let n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?n:0,c=t.column+a,l=`${e.name}:${s}:${c} +`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){let p=Math.floor(c/80),f=c%80,m=[];for(let g=0;g["|",g]),["|","^".padStart(f)],["|",m[p+1]]])}return l+AZ([[`${s-1} |`,u[i-1]],[`${s} |`,d],["|","^".padStart(c)],[`${s+1} |`,u[i+1]]])}function AZ(e){let t=e.filter(([r,i])=>i!==void 0),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(` +`)}var F=class e extends Error{constructor(t,n={}){let{nodes:r,source:i,positions:o,path:s,originalError:a,cause:c,extensions:l}=n,u="cause"in n,d=u?c:a,p=u||a!=null?{cause:d}:void 0;super(t,p),this.name="GraphQLError",this.path=s??void 0;let f=a??(c instanceof Error?c:void 0);this.originalError=f,this.nodes=RZ(Array.isArray(r)?r:r?[r]:void 0);let m=RZ(this.nodes?.map(h=>h.loc).filter(h=>h!=null));this.source=i??m?.[0]?.source,this.positions=o??m?.map(h=>h.start),this.locations=o&&i?o.map(h=>md(i,h)):m?.map(h=>md(h.source,h.start));let g=Kn(f?.extensions)?f.extensions:void 0;this.extensions=l??g??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),a?.stack!=null?Object.defineProperty(this,"stack",{value:a.stack,writable:!0,configurable:!0}):Error.captureStackTrace!=null?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` + +`+LD(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` + +`+$_(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function RZ(e){return e===void 0||e.length===0?void 0:e}function nh(e){if(e instanceof F)return e;let t=IZ(e);return new F(t.message,{originalError:t})}var Rr=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let r=this.get(t);r===void 0?this.set(t,[n]):r.push(n)}};function PZ(e){return JSe("or",e)}function JSe(e,t){switch(t.length===0&&rt(!1),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}let n=t.slice(0,-1),r=t.at(-1);return n.join(", ")+", "+e+" "+r}function ns(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}function S_(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}function pa(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function FD(e){return e.length===0?"":` at ${e.map(t=>typeof t=="number"?`[${t}]`:`.${t}`).join("")}`}var rh=class{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},gd=class{constructor(t,n,r,i,o,s){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=o,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},ih={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},ZSe=new Set(Object.keys(ih));function jD(e){let t=e?.kind;return typeof t=="string"&&ZSe.has(t)}var Jn={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"};var _={};kr(_,{ARGUMENT:()=>rxe,ARGUMENT_COORDINATE:()=>Vxe,BOOLEAN:()=>pxe,DIRECTIVE:()=>bxe,DIRECTIVE_ARGUMENT_COORDINATE:()=>Wxe,DIRECTIVE_COORDINATE:()=>qxe,DIRECTIVE_DEFINITION:()=>Nxe,DIRECTIVE_EXTENSION:()=>Oxe,DOCUMENT:()=>QSe,ENUM:()=>mxe,ENUM_TYPE_DEFINITION:()=>Rxe,ENUM_TYPE_EXTENSION:()=>Uxe,ENUM_VALUE_DEFINITION:()=>Pxe,FIELD:()=>nxe,FIELD_DEFINITION:()=>Exe,FLOAT:()=>uxe,FRAGMENT_ARGUMENT:()=>ixe,FRAGMENT_DEFINITION:()=>axe,FRAGMENT_SPREAD:()=>oxe,INLINE_FRAGMENT:()=>sxe,INPUT_OBJECT_TYPE_DEFINITION:()=>Cxe,INPUT_OBJECT_TYPE_EXTENSION:()=>zxe,INPUT_VALUE_DEFINITION:()=>Txe,INT:()=>lxe,INTERFACE_TYPE_DEFINITION:()=>Ixe,INTERFACE_TYPE_EXTENSION:()=>Fxe,LIST:()=>gxe,LIST_TYPE:()=>wxe,MEMBER_COORDINATE:()=>Bxe,NAME:()=>YSe,NAMED_TYPE:()=>vxe,NON_NULL_TYPE:()=>kxe,NULL:()=>fxe,OBJECT:()=>hxe,OBJECT_FIELD:()=>yxe,OBJECT_TYPE_DEFINITION:()=>xxe,OBJECT_TYPE_EXTENSION:()=>Lxe,OPERATION_DEFINITION:()=>XSe,OPERATION_TYPE_DEFINITION:()=>$xe,SCALAR_TYPE_DEFINITION:()=>Sxe,SCALAR_TYPE_EXTENSION:()=>Mxe,SCHEMA_DEFINITION:()=>_xe,SCHEMA_EXTENSION:()=>Dxe,SELECTION_SET:()=>txe,STRING:()=>dxe,TYPE_COORDINATE:()=>Gxe,UNION_TYPE_DEFINITION:()=>Axe,UNION_TYPE_EXTENSION:()=>jxe,VARIABLE:()=>cxe,VARIABLE_DEFINITION:()=>exe});var YSe="Name",QSe="Document",XSe="OperationDefinition",exe="VariableDefinition",txe="SelectionSet",nxe="Field",rxe="Argument",ixe="FragmentArgument",oxe="FragmentSpread",sxe="InlineFragment",axe="FragmentDefinition",cxe="Variable",lxe="IntValue",uxe="FloatValue",dxe="StringValue",pxe="BooleanValue",fxe="NullValue",mxe="EnumValue",gxe="ListValue",hxe="ObjectValue",yxe="ObjectField",bxe="Directive",vxe="NamedType",wxe="ListType",kxe="NonNullType",_xe="SchemaDefinition",$xe="OperationTypeDefinition",Sxe="ScalarTypeDefinition",xxe="ObjectTypeDefinition",Exe="FieldDefinition",Txe="InputValueDefinition",Ixe="InterfaceTypeDefinition",Axe="UnionTypeDefinition",Rxe="EnumTypeDefinition",Pxe="EnumValueDefinition",Cxe="InputObjectTypeDefinition",Nxe="DirectiveDefinition",Dxe="SchemaExtension",Oxe="DirectiveExtension",Mxe="ScalarTypeExtension",Lxe="ObjectTypeExtension",Fxe="InterfaceTypeExtension",jxe="UnionTypeExtension",Uxe="EnumTypeExtension",zxe="InputObjectTypeExtension",Gxe="TypeCoordinate",Bxe="MemberCoordinate",Vxe="ArgumentCoordinate",qxe="DirectiveCoordinate",Wxe="DirectiveArgumentCoordinate";function pi(e,t){if(!e)throw new Error(t)}var Hxe=5;function Zn(e,t){let[n,r]=t?[e,t]:[void 0,e];if(r.length===0)return"";let i=" Did you mean ";n!=null&&(i+=n+" ");let o=PZ(r.slice(0,Hxe).map(s=>`"${s}"`));return i+o+"?"}function UD(e){return e}function Rc(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}function hd(e,t){let n=0,r=0;for(;n0);let a=0;do++r,a=a*10+o-zD,o=t.charCodeAt(r);while(x_(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}var zD=48,Kxe=57;function x_(e){return!isNaN(e)&&zD<=e&&e<=Kxe}function ur(e,t){let n=Object.create(null),r=new GD(e),i=Math.floor(e.length*.4)+1;for(let o of t){let s=r.measure(o,i);s!==void 0&&(n[o]=s)}return Object.keys(n).sort((o,s)=>{let a=n[o]-n[s];return a!==0?a:hd(o,s)})}var GD=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=CZ(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=CZ(r),o=this._inputArray;if(i.lengthn)return;let c=this._rows;for(let u=0;u<=a;u++)c[0][u]=u;for(let u=1;u<=s;u++){let d=c[(u-1)%3],p=c[u%3],f=p[0]=u;for(let m=1;m<=a;m++){let g=i[u-1]===o[m-1]?0:1,h=Math.min(d[m]+1,p[m-1]+1,d[m-1]+g);if(u>1&&m>1&&i[u-1]===o[m-2]&&i[u-2]===o[m-1]){let v=c[(u-2)%3][m-2];h=Math.min(h,v+1)}hn)return}let l=c[s%3][a];return l<=n?l:void 0}};function CZ(e){let t=e.length,n=new Array(t);for(let r=0;r=48&&e<=57}function NZ(e){return e>=97&&e<=122||e>=65&&e<=90}function oh(e){return NZ(e)||e===95}function T_(e){return NZ(e)||Pc(e)||e===95}function DZ(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;io===0?i:i.slice(t)).slice(n??0,r+1)}function Jxe(e){let t=0;for(;t1&&r.slice(1).every(f=>f.length===0||E_(f.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),l=a||c,u=!t?.minimize&&(!i||e.length>70||l||o||s),d="",p=i&&E_(e.charCodeAt(0));return(u&&!p||o)&&(d+=` `),d+=n,(u||l)&&(d+=` -`),'"""'+d+'"""'}function BK(e){return`"${e.replace(V_e,B_e)}"`}var V_e=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function B_e(e){return q_e[e.charCodeAt(0)]}var q_e=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var Od=Object.freeze({});function Md(e,t,n=zg){let i=new Map;for(let m of Object.values($))i.set(m,HP(t,m));let r,o=Array.isArray(e),s=[e],a=-1,c=[],l=e,u,d,p=[],f=[];do{a++;let m=a===s.length,g=m&&c.length!==0;if(m){if(u=f.length===0?void 0:p[p.length-1],l=d,d=f.pop(),g)if(o){l=l.slice();let b=0;for(let[y,w]of c){let k=y-b;w===null?(l.splice(k,1),b++):l[k]=w}}else{l={...l};for(let[b,y]of c)l[b]=y}a=r.index,s=r.keys,c=r.edits,o=r.inArray,r=r.prev}else if(d!=null){if(u=o?a:s[a],l=d[u],l==null)continue;p.push(u)}let h;if(!Array.isArray(l)){if(GP(l)||fi(!1,`Invalid AST Node: ${ce(l)}.`),h=(m?i.get(l.kind)?.leave:i.get(l.kind)?.enter)?.call(t,l,u,d,p,f),h===Od)break;if(h===!1){if(!m){p.pop();continue}}else if(h!==void 0&&(c.push([u,h]),!m))if(GP(h))l=h;else{p.pop();continue}}h===void 0&&g&&c.push([u,l]),m?p.pop():(r={inArray:o,index:a,keys:s,edits:c,prev:r},o=Array.isArray(l),s=o?l:n[l.kind]??[],a=-1,c=[],d!=null&&f.push(d),d=l)}while(r!==void 0);return c.length!==0?c.at(-1)[1]:e}function WP(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let i of Object.values($)){let r=!1,o=new Array(e.length).fill(void 0),s=new Array(e.length).fill(void 0);for(let c=0;ce.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>se(e.definitions,` +`),'"""'+d+'"""'}function MZ(e){return`"${e.replace(Zxe,Yxe)}"`}var Zxe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Yxe(e){return Qxe[e.charCodeAt(0)]}var Qxe=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var yd=Object.freeze({});function bd(e,t,n=ih){let r=new Map;for(let m of Object.values(_))r.set(m,VD(t,m));let i,o=Array.isArray(e),s=[e],a=-1,c=[],l=e,u,d,p=[],f=[];do{a++;let m=a===s.length,g=m&&c.length!==0;if(m){if(u=f.length===0?void 0:p[p.length-1],l=d,d=f.pop(),g)if(o){l=l.slice();let v=0;for(let[b,w]of c){let k=b-v;w===null?(l.splice(k,1),v++):l[k]=w}}else{l={...l};for(let[v,b]of c)l[v]=b}a=i.index,s=i.keys,c=i.edits,o=i.inArray,i=i.prev}else if(d!=null){if(u=o?a:s[a],l=d[u],l==null)continue;p.push(u)}let h;if(!Array.isArray(l)){if(jD(l)||pi(!1,`Invalid AST Node: ${de(l)}.`),h=(m?r.get(l.kind)?.leave:r.get(l.kind)?.enter)?.call(t,l,u,d,p,f),h===yd)break;if(h===!1){if(!m){p.pop();continue}}else if(h!==void 0&&(c.push([u,h]),!m))if(jD(h))l=h;else{p.pop();continue}}h===void 0&&g&&c.push([u,l]),m?p.pop():(i={inArray:o,index:a,keys:s,edits:c,prev:i},o=Array.isArray(l),s=o?l:n[l.kind]??[],a=-1,c=[],d!=null&&f.push(d),d=l)}while(i!==void 0);return c.length!==0?c.at(-1)[1]:e}function BD(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(_)){let i=!1,o=new Array(e.length).fill(void 0),s=new Array(e.length).fill(void 0);for(let c=0;ce.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>le(e.definitions,` -`)},OperationDefinition:{leave(e){let t=KP(e.variableDefinitions)?Pe(`( -`,se(e.variableDefinitions,` +`)},OperationDefinition:{leave(e){let t=qD(e.variableDefinitions)?De(`( +`,le(e.variableDefinitions,` `),` -)`):Pe("(",se(e.variableDefinitions,", "),")"),n=Pe("",e.description,` -`)+se([e.operation,se([e.name,t]),se(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i,description:r})=>Pe("",r,` -`)+e+": "+t+Pe(" = ",n)+Pe(" ",se(i," "))},SelectionSet:{leave:({selections:e})=>mi(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){let o=se([Pe("",e,": "),t],"");return se([qK(o,n),Pe(" ",se(i," ")),Pe(" ",r)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>{let i="..."+e;return qK(i,t)+Pe(" ",se(n," "))}},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>se(["...",Pe("on ",e),se(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r,description:o})=>Pe("",o,` -`)+`fragment ${e}${Pe("(",se(n,", "),")")} on ${t} ${Pe("",se(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?VK(e):BK(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t="["+se(e,", ")+"]";return t.length>JP?`[ -`+Vg(se(e,` +)`):De("(",le(e.variableDefinitions,", "),")"),n=De("",e.description,` +`)+le([e.operation,le([e.name,t]),le(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>De("",i,` +`)+e+": "+t+De(" = ",n)+De(" ",le(r," "))},SelectionSet:{leave:({selections:e})=>fi(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let o=le([De("",e,": "),t],"");return le([LZ(o,n),De(" ",le(r," ")),De(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>{let r="..."+e;return LZ(r,t)+De(" ",le(n," "))}},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>le(["...",De("on ",e),le(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:o})=>De("",o,` +`)+`fragment ${e}${De("(",le(n,", "),")")} on ${t} ${De("",le(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?OZ(e):MZ(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t="["+le(e,", ")+"]";return t.length>WD?`[ +`+sh(le(e,` `))+` -]`:t}},ObjectValue:{leave:({fields:e})=>{let t="{ "+se(e,", ")+" }";return t.length>JP?mi(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Pe("(",se(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Pe("",e,` -`)+se(["schema",se(t," "),mi(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Pe("",e,` -`)+se(["scalar",t,se(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>Pe("",e,` -`)+se(["type",t,Pe("implements ",se(n," & ")),se(i," "),mi(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>Pe("",e,` -`)+t+(KP(n)?Pe(`( -`,Vg(se(n,` +]`:t}},ObjectValue:{leave:({fields:e})=>{let t="{ "+le(e,", ")+" }";return t.length>WD?fi(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+De("(",le(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>De("",e,` +`)+le(["schema",le(t," "),fi(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>De("",e,` +`)+le(["scalar",t,le(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>De("",e,` +`)+le(["type",t,De("implements ",le(n," & ")),le(r," "),fi(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>De("",e,` +`)+t+(qD(n)?De(`( +`,sh(le(n,` `)),` -)`):Pe("(",se(n,", "),")"))+": "+i+Pe(" ",se(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:r})=>Pe("",e,` -`)+se([t+": "+n,Pe("= ",i),se(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>Pe("",e,` -`)+se(["interface",t,Pe("implements ",se(n," & ")),se(i," "),mi(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>Pe("",e,` -`)+se(["union",t,se(n," "),Pe("= ",se(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>Pe("",e,` -`)+se(["enum",t,se(n," "),mi(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Pe("",e,` -`)+se([t,se(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>Pe("",e,` -`)+se(["input",t,se(n," "),mi(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:i,repeatable:r,locations:o})=>Pe("",e,` -`)+"directive @"+t+(KP(n)?Pe(`( -`,Vg(se(n,` +)`):De("(",le(n,", "),")"))+": "+r+De(" ",le(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>De("",e,` +`)+le([t+": "+n,De("= ",r),le(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>De("",e,` +`)+le(["interface",t,De("implements ",le(n," & ")),le(r," "),fi(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>De("",e,` +`)+le(["union",t,le(n," "),De("= ",le(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>De("",e,` +`)+le(["enum",t,le(n," "),fi(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>De("",e,` +`)+le([t,le(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>De("",e,` +`)+le(["input",t,le(n," "),fi(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:o})=>De("",e,` +`)+"directive @"+t+(qD(n)?De(`( +`,sh(le(n,` `)),` -)`):Pe("(",se(n,", "),")"))+Pe(" ",se(i," "))+(r?" repeatable":"")+" on "+se(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>se(["extend schema",se(e," "),mi(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>se(["extend scalar",e,se(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>se(["extend type",e,Pe("implements ",se(t," & ")),se(n," "),mi(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>se(["extend interface",e,Pe("implements ",se(t," & ")),se(n," "),mi(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>se(["extend union",e,se(t," "),Pe("= ",se(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>se(["extend enum",e,se(t," "),mi(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>se(["extend input",e,se(t," "),mi(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>se(["extend directive @"+e,se(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>se([e,Pe(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>se([e,Pe(".",t),Pe("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>se(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>se(["@",e,Pe("(",t,":)")])}};function se(e,t=""){return e?.filter(n=>n!==void 0&&n!=="").join(t)??""}function mi(e){return Pe(`{ -`,Vg(se(e,` +)`):De("(",le(n,", "),")"))+De(" ",le(r," "))+(i?" repeatable":"")+" on "+le(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>le(["extend schema",le(e," "),fi(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>le(["extend scalar",e,le(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>le(["extend type",e,De("implements ",le(t," & ")),le(n," "),fi(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>le(["extend interface",e,De("implements ",le(t," & ")),le(n," "),fi(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>le(["extend union",e,le(t," "),De("= ",le(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>le(["extend enum",e,le(t," "),fi(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>le(["extend input",e,le(t," "),fi(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>le(["extend directive @"+e,le(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>le([e,De(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>le([e,De(".",t),De("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>le(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>le(["@",e,De("(",t,":)")])}};function le(e,t=""){return e?.filter(n=>n!==void 0&&n!=="").join(t)??""}function fi(e){return De(`{ +`,sh(le(e,` `)),` -}`)}function Pe(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Vg(e){return Pe(" ",e.replaceAll(` +}`)}function De(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function sh(e){return De(" ",e.replaceAll(` `,` - `))}function KP(e){return e?.some(t=>t.includes(` -`))??!1}function qK(e,t){let n=e+Pe("(",se(t,", "),")");return n.length>JP&&(n=e+Pe(`( -`,Vg(se(t,` + `))}function qD(e){return e?.some(t=>t.includes(` +`))??!1}function LZ(e,t){let n=e+De("(",le(t,", "),")");return n.length>WD&&(n=e+De(`( +`,sh(le(t,` `)),` -)`)),n}function Bg(e,t){switch(e.kind){case $.NULL:return null;case $.INT:return parseInt(e.value,10);case $.FLOAT:return parseFloat(e.value);case $.STRING:case $.ENUM:case $.BOOLEAN:return e.value;case $.LIST:return e.values.map(n=>Bg(n,t));case $.OBJECT:return Gc(e.fields,n=>n.name.value,n=>Bg(n.value,t));case $.VARIABLE:return t?.[e.name.value]}}function Pr(e){if(e.length===0)throw new O("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(Bg(n,i))),this.coerceOutputValue=t.coerceOutputValue??this.serialize,this.coerceInputValue=t.coerceInputValue??this.parseValue,this.coerceInputLiteral=t.coerceInputLiteral,this.valueToLiteral=t.valueToLiteral,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||fi(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),t.coerceInputLiteral&&(typeof t.coerceInputValue=="function"&&typeof t.coerceInputLiteral=="function"||fi(!1,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},Yn=class{constructor(t){this.__kind=YP,this.__kind=YP,this.name=Pr(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=tJ.bind(void 0,this,t.fields),this._interfaces=eJ.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ga(this.getFields(),t=>t.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function eJ(e){return u$(e??[])}function tJ(e,t){let n=Hg(t);return ga(n,(i,r)=>new Bc(e,r,i))}var Bc=class{constructor(t,n,i){this.__kind=H_e,this.parentType=t,this.name=Pr(n),this.description=i.description,this.type=i.type;let r=i.args;this.args=r?Object.entries(r).map(([o,s])=>new Ld(this,o,s)):[],this.resolve=i.resolve,this.subscribe=i.subscribe,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Gc(this.args,t=>t.name,t=>t.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}},Ld=class{constructor(t,n,i){this.__kind=HK,this.parent=t,this.name=Pr(n),this.description=i.description,this.type=i.type,this.defaultValue=i.defaultValue,this.default=i.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}};function ha(e){return _e(e.type)&&e.default===void 0&&e.defaultValue===void 0}var ns=class{constructor(t){this.__kind=KK,this.name=Pr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=tJ.bind(void 0,this,t.fields),this._interfaces=eJ.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ga(this.getFields(),t=>t.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},rs=class{constructor(t){this.__kind=JK,this.name=Pr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._types=Z_e.bind(void 0,t.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function Z_e(e){return u$(e)}var gi=class{constructor(t){this.__kind=ZK,this.name=Pr(t.name),this.description=t.description,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._values=Y_e.bind(void 0,this,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=this._values()),this._values}getValue(t){return this._nameLookup??=r$(this.getValues(),n=>n.name),this._nameLookup[t]}serialize(t){return this.coerceOutputValue(t)}coerceOutputValue(t){this._valueLookup??=new Map(this.getValues().map(i=>[i.value,i]));let n=this._valueLookup.get(t);if(n===void 0)throw new O(`Enum "${this.name}" cannot represent value: ${ce(t)}`);return n.name}parseValue(t,n){return this.coerceInputValue(t,n)}coerceInputValue(t,n){if(typeof t!="string"){let r=ce(t);throw new O(`Enum "${this.name}" cannot represent non-string value: ${r}.`+(n?"":a$(this,r)))}let i=this.getValue(t);if(i==null)throw new O(`Value "${t}" does not exist in "${this.name}" enum.`+(n?"":a$(this,t)));return i.value}parseLiteral(t,n,i){return this.coerceInputLiteral(t,i)}coerceInputLiteral(t,n){if(t.kind!==$.ENUM){let r=Ye(t);throw new O(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+(n?"":a$(this,r)),{nodes:t})}let i=this.getValue(t.value);if(i==null){let r=Ye(t);throw new O(`Value "${r}" does not exist in "${this.name}" enum.`+(n?"":a$(this,r)),{nodes:t})}return i.value}valueToLiteral(t){if(typeof t=="string"&&this.getValue(t))return{kind:$.ENUM,value:t}}toConfig(){return{name:this.name,description:this.description,values:Gc(this.getValues(),t=>t.name,t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function Y_e(e,t){let n=Hg(t);return Object.entries(n).map(([i,r])=>new QP(e,i,r))}function a$(e,t){let n=e.getValues().map(r=>r.name),i=lr(t,n);return Zn("the enum value",i)}var QP=class{constructor(t,n,i){this.__kind=K_e,this.parentEnum=t,this.name=ZP(n),this.description=i.description,this.value=i.value!==void 0?i.value:n,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}},is=class{constructor(t){this.__kind=YK,this.name=Pr(t.name),this.description=t.description,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this.isOneOf=t.isOneOf??!1,this._fields=Q_e.bind(void 0,this,t.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:ga(this.getFields(),t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function Q_e(e,t){let n=Hg(t);return ga(n,(i,r)=>new XP(e,r,i))}var XP=class{constructor(t,n,i){"resolve"in i&&fi(!1,`${t}.${n} field has a resolve property, but Input Types cannot define resolvers.`),this.__kind=J_e,this.parentType=t,this.name=Pr(n),this.description=i.description,this.type=i.type,this.defaultValue=i.defaultValue,this.default=i.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}};function qi(e){return _e(e.type)&&e.defaultValue===void 0&&e.default===void 0}function qc(e,t,n){return t===n?!0:_e(n)?_e(t)?qc(e,t.ofType,n.ofType):!1:_e(t)?qc(e,t.ofType,n):Ke(n)?Ke(t)?qc(e,t.ofType,n.ofType):!1:Ke(t)?!1:Kr(n)&&(Be(t)||at(t))&&e.isSubType(n,t)}function d$(e,t,n){return t===n?!0:Kr(t)?Kr(n)?e.getPossibleTypes(t).some(i=>e.isSubType(n,i)):e.isSubType(t,n):Kr(n)?e.isSubType(n,t):!1}function Wc(e,t,n){return{prev:e,key:t,typename:n}}function Kg(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function ss(e,t){if(_e(t))return e==null?void 0:ss(e,t.ofType);if(e==null)return{kind:$.NULL};if(Ke(t)){if(!ts(e))return ss(e,t.ofType);let i=[];for(let r of e){let o=ss(r,t.ofType);if(!o)return;i.push(o)}return{kind:$.LIST,values:i}}if(He(t)){if(!Kn(e))return;let i=[],r=t.getFields();if(Object.keys(e).some(s=>e[s]!==void 0&&!Object.hasOwn(r,s)))return;for(let s of Object.values(t.getFields()))if(e[s.name]===void 0){if(qi(s))return}else{let c=ss(e[s.name],s.type);if(!c)return;i.push({kind:$.OBJECT_FIELD,name:{kind:$.NAME,value:s.name},value:c})}return{kind:$.OBJECT,fields:i}}let n=wo(t);if(n.valueToLiteral)try{return n.valueToLiteral(e)}catch{return}return Hc(e)}function Hc(e){if(e==null)return{kind:$.NULL};switch(typeof e){case"boolean":return{kind:$.BOOLEAN,value:e};case"string":return{kind:$.STRING,value:e,block:!1};case"bigint":return{kind:$.INT,value:e.toString()};case"number":{if(!Number.isFinite(e))return{kind:$.NULL};let t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:$.INT,value:t}:{kind:$.FLOAT,value:t}}case"object":{if(ts(e))return{kind:$.LIST,values:Array.from(e,Hc)};let t=e,n=[];for(let i of Object.keys(t)){let r=t[i];r!==void 0&&n.push({kind:$.OBJECT_FIELD,name:{kind:$.NAME,value:i},value:Hc(r)})}return{kind:$.OBJECT,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${ce(e)}.`)}function ya(e,t,n){switch(e.kind){case $.VARIABLE:{let i=e.name.value,r=n?.sources[i];if(r){let s=r.value;if(s===void 0){let a=r.signature.default;return a!==void 0?a.literal:{kind:$.NULL}}return ya(s,t,r.fragmentVariableValues)}let o=t?.sources[i];if(o==null)return{kind:$.NULL};if(o.value===void 0){let s=o.signature.default;if(s!==void 0)return s.literal}return ss(o.value,o.signature.type)}case $.OBJECT:{let i=[];for(let r of e.fields){if(r.value.kind===$.VARIABLE){let s=n?.sources[r.value.name.value]??t?.sources[r.value.name.value];if(s?.value===void 0&&s?.signature.default===void 0)continue}let o=ya(r.value,t,n);i.push({...r,value:o})}return{...e,fields:i}}case $.LIST:{let i=[];for(let r of e.values){let o=ya(r,t,n);i.push(o)}return{...e,values:i}}default:return e}}function f$(e,t,n,i){return Jg(e,t,n,i,void 0)}function Jg(e,t,n,i,r){if(_e(t)){if(e===void 0){ba(n,`Expected a value of non-null type "${t}" to be provided.`,r);return}if(e===null){ba(n,`Expected value of non-null type "${t}" not to be null.`,r);return}return Jg(e,t.ofType,n,i,r)}if(e!=null)if(Ke(t))if(!ts(e))Jg(e,t.ofType,n,i,r);else{let o=0;for(let s of e)Jg(s,t.ofType,n,i,Wc(r,o++,void 0))}else if(He(t)){if(!Kn(e)||Array.isArray(e)){ba(n,`Expected value of type "${t}" to be an object, found: ${ce(e)}.`,r);return}let o=t.getFields();for(let a of Object.values(o)){let c=e[a.name];c===void 0?qi(a)&&ba(n,`Expected value of type "${t}" to include required field "${a.name}", found: ${ce(e)}.`,r):Jg(c,a.type,n,i,Wc(r,a.name,t.name))}let s=[];for(let a of Object.keys(e))if(e[a]!==void 0){if(!Object.hasOwn(o,a)){let c=i?"":Zn(lr(a,Object.keys(o)));ba(n,`Expected value of type "${t}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${ce(e)}.`,r);continue}s.push(a)}if(t.isOneOf){s.length!==1&&ba(n,p$(t),r);let a=s[0];e[a]===null&&ba(n,p$(t),Wc(r,a,t.name))}}else{wo(t);let o,s;try{o=t.coerceInputValue(e,i)}catch(a){if(a instanceof O){n(a,Kg(r));return}s=a}o===void 0&&ba(n,`Expected value of type "${t}"${s!=null?`, but encountered error "${rJ(s)}"; found`:", found"}: ${ce(e)}.`,r,Ug(s))}}function ba(e,t,n,i){e(new O(t,{originalError:i}),Kg(n))}function Kc(e,t,n,i,r,o){return Zg({static:!i&&!r,onError:n,variables:i,fragmentVariableValues:r},e,t,o,void 0)}function Zg(e,t,n,i,r){if(t.kind===$.VARIABLE){if(e.static)return;let s=nJ(e,t)?.coerced[t.name.value];_e(n)&&(s===void 0?Wi(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,r):s===null&&Wi(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,r));return}if(_e(n)){if(t.kind===$.NULL){Wi(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,r);return}return Zg(e,t,n.ofType,i,r)}if(t.kind!==$.NULL)if(Ke(n))if(t.kind!==$.LIST)Zg(e,t,n.ofType,i,r);else{let o=0;for(let s of t.values)Zg(e,s,n.ofType,i,Wc(r,o++,void 0))}else if(He(n)){if(t.kind!==$.OBJECT){Wi(e.onError,`Expected value of type "${n}" to be an object, found: ${Ye(t)}.`,t,r);return}let o=n.getFields(),s=r$(t.fields,l=>l.name.value);for(let l of Object.values(o)){let u=s[l.name];if(u===void 0)qi(l)&&Wi(e.onError,`Expected value of type "${n}" to include required field "${l.name}", found: ${Ye(t)}.`,t,r);else{let d=u.value;if(d.kind===$.VARIABLE&&!e.static){let p=nJ(e,d),f=d.name.value,m=p?.coerced[f];if(n.isOneOf)m===void 0?Wi(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,r):m===null&&Wi(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" not to be null.`,t,r);else if(m===void 0&&!qi(l))continue}Zg(e,d,l.type,i,Wc(r,l.name,n.name))}}let a=t.fields,c=[];for(let l of a){let u=l.name.value;if(Object.hasOwn(o,u))c.push(l);else{let d=i?"":Zn(lr(u,Object.keys(o)));Wi(e.onError,`Expected value of type "${n}" not to include unknown field "${u}"${d?`.${d} Found`:", found"}: ${Ye(t)}.`,l,r)}}if(n.isOneOf){if(c.length!==1){Wi(e.onError,p$(n),t,r);return}if(c[0].value.kind===$.NULL){let d=c[0].name.value;Wi(e.onError,p$(n),t,Wc(r,d,void 0))}}}else{wo(n);let o,s;try{o=n.coerceInputLiteral?n.coerceInputLiteral(ya(t,e.variables,e.fragmentVariableValues),i):n.parseLiteral(t,void 0,i)}catch(a){if(a instanceof O){e.onError(a,Kg(r));return}s=a}o===void 0&&Wi(e.onError,`Expected value of type "${n}"${s!=null?`, but encountered error "${rJ(s)}"; found`:", found"}: ${Ye(t)}.`,t,r,Ug(s))}}function nJ(e,t){let n=t.name.value,{fragmentVariableValues:i,variables:r}=e;return i?.sources[n]?i:r}function Wi(e,t,n,i,r){e(new O(t,{nodes:n,originalError:r}),Kg(i))}function rJ(e){if(Kn(e)){let t=e.message;if(typeof t=="string"&&t!=="")return t}return String(e)}function p$(e){return`Within OneOf Input Object type "${e}", exactly one field must be specified, and the value for that field must be non-null.`}var pe={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};var Fd=2147483647,Ud=-2147483648,m$=new dr({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){let t=Yg(e);if(typeof t=="number")return iJ(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return X_e(t);if(typeof t=="bigint")return oJ(t);throw new O(`Int cannot represent non-integer value: ${ce(t)}`)},coerceInputValue(e){if(typeof e=="number")return iJ(e);if(typeof e=="bigint")return oJ(e);throw new O(`Int cannot represent non-integer value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==$.INT)throw new O(`Int cannot represent non-integer value: ${Ye(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>Fd||t=Ud)return{kind:$.INT,value:String(e)}}}),cJ=new dr({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){let t=Yg(e);if(typeof t=="number")return sJ(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return eSe(t);if(typeof t=="bigint")return aJ(t);throw new O(`Float cannot represent non numeric value: ${ce(t)}`)},coerceInputValue(e){if(typeof e=="number")return sJ(e);if(typeof e=="bigint")return aJ(e);throw new O(`Float cannot represent non numeric value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==$.FLOAT&&e.kind!==$.INT)throw new O(`Float cannot represent non numeric value: ${Ye(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){let t=Hc(e);if(t.kind===$.FLOAT||t.kind===$.INT)return t}}),wt=new dr({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){let t=Yg(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number")return tSe(t);if(typeof t=="bigint")return String(t);throw new O(`String cannot represent value: ${ce(e)}`)},coerceInputValue(e){if(typeof e!="string")throw new O(`String cannot represent a non string value: ${ce(e)}`);return e},coerceInputLiteral(e){if(e.kind!==$.STRING)throw new O(`String cannot represent a non string value: ${Ye(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Hc(e);if(t.kind===$.STRING)return t}}),ln=new dr({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){let t=Yg(e);if(typeof t=="boolean")return t;if(typeof t=="number")return nSe(t);if(typeof t=="bigint")return t!==0n;throw new O(`Boolean cannot represent a non boolean value: ${ce(t)}`)},coerceInputValue(e){if(typeof e!="boolean")throw new O(`Boolean cannot represent a non boolean value: ${ce(e)}`);return e},coerceInputLiteral(e){if(e.kind!==$.BOOLEAN)throw new O(`Boolean cannot represent a non boolean value: ${Ye(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Hc(e);if(t.kind===$.BOOLEAN)return t}}),g$=new dr({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){let t=Yg(e);if(typeof t=="string")return t;if(typeof t=="number")return eD(t);if(typeof t=="bigint")return String(t);throw new O(`ID cannot represent value: ${ce(e)}`)},coerceInputValue(e){if(typeof e=="string")return e;if(typeof e=="number")return eD(e);if(typeof e=="bigint")return String(e);throw new O(`ID cannot represent value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==$.STRING&&e.kind!==$.INT)throw new O("ID cannot represent a non-string and non-integer value: "+Ye(e),{nodes:e});return e.value},valueToLiteral(e){if(typeof e=="string")return/^-?(?:0|[1-9][0-9]*)$/.test(e)?{kind:$.INT,value:e}:{kind:$.STRING,value:e,block:!1};if(typeof e=="number")return{kind:$.INT,value:eD(e)};if(typeof e=="bigint")return{kind:$.INT,value:String(e)}}}),va=Object.freeze([wt,m$,cJ,ln,g$]);function tD(e){return va.some(({name:t})=>e.name===t)}function Yg(e){if(Kn(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!Kn(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function iJ(e){if(!Number.isInteger(e))throw new O(`Int cannot represent non-integer value: ${ce(e)}`);if(e>Fd||eFd||tFd||enew Ld(this,i,r))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Gc(this.args,t=>t.name,t=>t.toConfig()),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return"@"+this.name}toJSON(){return this.toString()}},wa=new Tn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(ln),description:"Included when true."}}}),ka=new Tn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(ln),description:"Skipped when true."}}}),$o=new Tn({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(ln),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:wt,description:"Unique name"}}}),_o=new Tn({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[pe.FIELD],args:{initialCount:{default:{value:0},type:new ve(m$),description:"Number of items to return immediately"},if:{type:new ve(ln),description:"Stream when true or undefined.",default:{value:!0}},label:{type:wt,description:"Unique name"}}}),nD="No longer supported",Jr=new Tn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[pe.FIELD_DEFINITION,pe.ARGUMENT_DEFINITION,pe.INPUT_FIELD_DEFINITION,pe.ENUM_VALUE,pe.DIRECTIVE_DEFINITION],args:{reason:{type:new ve(wt),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:nD}}}}),Qg=new Tn({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[pe.SCALAR],args:{url:{type:new ve(wt),description:"The URL that specifies the behavior of this scalar."}}}),Xg=new Tn({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[pe.INPUT_OBJECT],args:{}}),AYe=new Tn({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[pe.QUERY,pe.MUTATION,pe.SUBSCRIPTION]}),fr=Object.freeze([wa,ka,Jr,Qg,Xg]);function Jc(e){return fr.some(({name:t})=>t===e.name)}function Zc(e,t){if(_e(t)){let n=Zc(e,t.ofType);return n?.kind===$.NULL?null:n}if(e===null)return{kind:$.NULL};if(e===void 0)return null;if(Ke(t)){let n=t.ofType;if(ts(e)){let i=[];for(let r of e){let o=Zc(r,n);o!=null&&i.push(o)}return{kind:$.LIST,values:i}}return Zc(e,n)}if(He(t)){if(!Kn(e))return null;let n=[];for(let i of Object.values(t.getFields())){let r=Zc(e[i.name],i.type);r&&n.push({kind:$.OBJECT_FIELD,name:{kind:$.NAME,value:i.name},value:r})}return{kind:$.OBJECT,fields:n}}if(hi(t)){let n=t.coerceOutputValue(e);if(n==null)return null;if(typeof n=="boolean")return{kind:$.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let i=String(n);return uJ.test(i)?{kind:$.INT,value:i}:{kind:$.FLOAT,value:i}}if(typeof n=="bigint")return{kind:$.INT,value:String(n)};if(typeof n=="string")return Xt(t)?{kind:$.ENUM,value:n}:t===g$&&uJ.test(n)?{kind:$.INT,value:n}:{kind:$.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${ce(n)}.`)}it(!1,"Unexpected input type: "+ce(t))}var uJ=/^-?(?:0|[1-9][0-9]*)$/;function dJ(e){let t=e.type,n=e.default;if(n){let r=n.literal??ss(n.value,t);return r==null&&it(!1,"Invalid default value"),r}let i=e.defaultValue;if(i!==void 0){let r=Zc(i,t);return r==null&&it(!1,"Invalid default value"),r}}var eh=new Yn({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:wt,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new ve(new qt(new ve(yi))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new ve(yi),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:yi,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:yi,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new ve(new qt(new ve(rD))),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>t===!0?e.getDirectives():e.getDirectives().filter(n=>n.deprecationReason==null)}})}),rD=new Yn({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. +)`)),n}function ah(e,t){switch(e.kind){case _.NULL:return null;case _.INT:return parseInt(e.value,10);case _.FLOAT:return parseFloat(e.value);case _.STRING:case _.ENUM:case _.BOOLEAN:return e.value;case _.LIST:return e.values.map(n=>ah(n,t));case _.OBJECT:return Rc(e.fields,n=>n.name.value,n=>ah(n.value,t));case _.VARIABLE:return t?.[e.name.value]}}function Pr(e){if(e.length===0)throw new F("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(ah(n,r))),this.coerceOutputValue=t.coerceOutputValue??this.serialize,this.coerceInputValue=t.coerceInputValue??this.parseValue,this.coerceInputLiteral=t.coerceInputLiteral,this.valueToLiteral=t.valueToLiteral,this.extensions=dr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||pi(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),t.coerceInputLiteral&&(typeof t.coerceInputValue=="function"&&typeof t.coerceInputLiteral=="function"||pi(!1,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},Yn=class{constructor(t){this.__kind=KD,this.__kind=KD,this.name=Pr(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=dr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=HZ.bind(void 0,this,t.fields),this._interfaces=WZ.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:pa(this.getFields(),t=>t.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function WZ(e){return P_(e??[])}function HZ(e,t){let n=uh(t);return pa(n,(r,i)=>new Cc(e,i,r))}var Cc=class{constructor(t,n,r){this.__kind=eEe,this.parentType=t,this.name=Pr(n),this.description=r.description,this.type=r.type;let i=r.args;this.args=i?Object.entries(i).map(([o,s])=>new vd(this,o,s)):[],this.resolve=r.resolve,this.subscribe=r.subscribe,this.deprecationReason=r.deprecationReason,this.extensions=dr(r.extensions),this.astNode=r.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Rc(this.args,t=>t.name,t=>t.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}},vd=class{constructor(t,n,r){this.__kind=jZ,this.parent=t,this.name=Pr(n),this.description=r.description,this.type=r.type,this.defaultValue=r.defaultValue,this.default=r.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=r.deprecationReason,this.extensions=dr(r.extensions),this.astNode=r.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}};function fa(e){return Te(e.type)&&e.default===void 0&&e.defaultValue===void 0}var rs=class{constructor(t){this.__kind=UZ,this.name=Pr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=dr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=HZ.bind(void 0,this,t.fields),this._interfaces=WZ.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:pa(this.getFields(),t=>t.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},is=class{constructor(t){this.__kind=zZ,this.name=Pr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=dr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._types=rEe.bind(void 0,t.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function rEe(e){return P_(e)}var mi=class{constructor(t){this.__kind=GZ,this.name=Pr(t.name),this.description=t.description,this.extensions=dr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._values=iEe.bind(void 0,this,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=this._values()),this._values}getValue(t){return this._nameLookup??=S_(this.getValues(),n=>n.name),this._nameLookup[t]}serialize(t){return this.coerceOutputValue(t)}coerceOutputValue(t){this._valueLookup??=new Map(this.getValues().map(r=>[r.value,r]));let n=this._valueLookup.get(t);if(n===void 0)throw new F(`Enum "${this.name}" cannot represent value: ${de(t)}`);return n.name}parseValue(t,n){return this.coerceInputValue(t,n)}coerceInputValue(t,n){if(typeof t!="string"){let i=de(t);throw new F(`Enum "${this.name}" cannot represent non-string value: ${i}.`+(n?"":I_(this,i)))}let r=this.getValue(t);if(r==null)throw new F(`Value "${t}" does not exist in "${this.name}" enum.`+(n?"":I_(this,t)));return r.value}parseLiteral(t,n,r){return this.coerceInputLiteral(t,r)}coerceInputLiteral(t,n){if(t.kind!==_.ENUM){let i=Ze(t);throw new F(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+(n?"":I_(this,i)),{nodes:t})}let r=this.getValue(t.value);if(r==null){let i=Ze(t);throw new F(`Value "${i}" does not exist in "${this.name}" enum.`+(n?"":I_(this,i)),{nodes:t})}return r.value}valueToLiteral(t){if(typeof t=="string"&&this.getValue(t))return{kind:_.ENUM,value:t}}toConfig(){return{name:this.name,description:this.description,values:Rc(this.getValues(),t=>t.name,t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function iEe(e,t){let n=uh(t);return Object.entries(n).map(([r,i])=>new JD(e,r,i))}function I_(e,t){let n=e.getValues().map(i=>i.name),r=ur(t,n);return Zn("the enum value",r)}var JD=class{constructor(t,n,r){this.__kind=tEe,this.parentEnum=t,this.name=HD(n),this.description=r.description,this.value=r.value!==void 0?r.value:n,this.deprecationReason=r.deprecationReason,this.extensions=dr(r.extensions),this.astNode=r.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}},os=class{constructor(t){this.__kind=BZ,this.name=Pr(t.name),this.description=t.description,this.extensions=dr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this.isOneOf=t.isOneOf??!1,this._fields=oEe.bind(void 0,this,t.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:pa(this.getFields(),t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function oEe(e,t){let n=uh(t);return pa(n,(r,i)=>new ZD(e,i,r))}var ZD=class{constructor(t,n,r){"resolve"in r&&pi(!1,`${t}.${n} field has a resolve property, but Input Types cannot define resolvers.`),this.__kind=nEe,this.parentType=t,this.name=Pr(n),this.description=r.description,this.type=r.type,this.defaultValue=r.defaultValue,this.default=r.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=r.deprecationReason,this.extensions=dr(r.extensions),this.astNode=r.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}};function Hi(e){return Te(e.type)&&e.defaultValue===void 0&&e.default===void 0}function Nc(e,t,n){return t===n?!0:Te(n)?Te(t)?Nc(e,t.ofType,n.ofType):!1:Te(t)?Nc(e,t.ofType,n):Ke(n)?Ke(t)?Nc(e,t.ofType,n.ofType):!1:Ke(t)?!1:Wr(n)&&(qe(t)||st(t))&&e.isSubType(n,t)}function C_(e,t,n){return t===n?!0:Wr(t)?Wr(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):Wr(n)?e.isSubType(n,t):!1}function Dc(e,t,n){return{prev:e,key:t,typename:n}}function dh(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function as(e,t){if(Te(t))return e==null?void 0:as(e,t.ofType);if(e==null)return{kind:_.NULL};if(Ke(t)){if(!ns(e))return as(e,t.ofType);let r=[];for(let i of e){let o=as(i,t.ofType);if(!o)return;r.push(o)}return{kind:_.LIST,values:r}}if(He(t)){if(!Kn(e))return;let r=[],i=t.getFields();if(Object.keys(e).some(s=>e[s]!==void 0&&!Object.hasOwn(i,s)))return;for(let s of Object.values(t.getFields()))if(e[s.name]===void 0){if(Hi(s))return}else{let c=as(e[s.name],s.type);if(!c)return;r.push({kind:_.OBJECT_FIELD,name:{kind:_.NAME,value:s.name},value:c})}return{kind:_.OBJECT,fields:r}}let n=vo(t);if(n.valueToLiteral)try{return n.valueToLiteral(e)}catch{return}return Oc(e)}function Oc(e){if(e==null)return{kind:_.NULL};switch(typeof e){case"boolean":return{kind:_.BOOLEAN,value:e};case"string":return{kind:_.STRING,value:e,block:!1};case"bigint":return{kind:_.INT,value:e.toString()};case"number":{if(!Number.isFinite(e))return{kind:_.NULL};let t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:_.INT,value:t}:{kind:_.FLOAT,value:t}}case"object":{if(ns(e))return{kind:_.LIST,values:Array.from(e,Oc)};let t=e,n=[];for(let r of Object.keys(t)){let i=t[r];i!==void 0&&n.push({kind:_.OBJECT_FIELD,name:{kind:_.NAME,value:r},value:Oc(i)})}return{kind:_.OBJECT,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${de(e)}.`)}function ma(e,t,n){switch(e.kind){case _.VARIABLE:{let r=e.name.value,i=n?.sources[r];if(i){let s=i.value;if(s===void 0){let a=i.signature.default;return a!==void 0?a.literal:{kind:_.NULL}}return ma(s,t,i.fragmentVariableValues)}let o=t?.sources[r];if(o==null)return{kind:_.NULL};if(o.value===void 0){let s=o.signature.default;if(s!==void 0)return s.literal}return as(o.value,o.signature.type)}case _.OBJECT:{let r=[];for(let i of e.fields){if(i.value.kind===_.VARIABLE){let s=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(s?.value===void 0&&s?.signature.default===void 0)continue}let o=ma(i.value,t,n);r.push({...i,value:o})}return{...e,fields:r}}case _.LIST:{let r=[];for(let i of e.values){let o=ma(i,t,n);r.push(o)}return{...e,values:r}}default:return e}}function D_(e,t,n,r){return ph(e,t,n,r,void 0)}function ph(e,t,n,r,i){if(Te(t)){if(e===void 0){ga(n,`Expected a value of non-null type "${t}" to be provided.`,i);return}if(e===null){ga(n,`Expected value of non-null type "${t}" not to be null.`,i);return}return ph(e,t.ofType,n,r,i)}if(e!=null)if(Ke(t))if(!ns(e))ph(e,t.ofType,n,r,i);else{let o=0;for(let s of e)ph(s,t.ofType,n,r,Dc(i,o++,void 0))}else if(He(t)){if(!Kn(e)||Array.isArray(e)){ga(n,`Expected value of type "${t}" to be an object, found: ${de(e)}.`,i);return}let o=t.getFields();for(let a of Object.values(o)){let c=e[a.name];c===void 0?Hi(a)&&ga(n,`Expected value of type "${t}" to include required field "${a.name}", found: ${de(e)}.`,i):ph(c,a.type,n,r,Dc(i,a.name,t.name))}let s=[];for(let a of Object.keys(e))if(e[a]!==void 0){if(!Object.hasOwn(o,a)){let c=r?"":Zn(ur(a,Object.keys(o)));ga(n,`Expected value of type "${t}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${de(e)}.`,i);continue}s.push(a)}if(t.isOneOf){s.length!==1&&ga(n,N_(t),i);let a=s[0];e[a]===null&&ga(n,N_(t),Dc(i,a,t.name))}}else{vo(t);let o,s;try{o=t.coerceInputValue(e,r)}catch(a){if(a instanceof F){n(a,dh(i));return}s=a}o===void 0&&ga(n,`Expected value of type "${t}"${s!=null?`, but encountered error "${JZ(s)}"; found`:", found"}: ${de(e)}.`,i,nh(s))}}function ga(e,t,n,r){e(new F(t,{originalError:r}),dh(n))}function Mc(e,t,n,r,i,o){return fh({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function fh(e,t,n,r,i){if(t.kind===_.VARIABLE){if(e.static)return;let s=KZ(e,t)?.coerced[t.name.value];Te(n)&&(s===void 0?Ki(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i):s===null&&Ki(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i));return}if(Te(n)){if(t.kind===_.NULL){Ki(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i);return}return fh(e,t,n.ofType,r,i)}if(t.kind!==_.NULL)if(Ke(n))if(t.kind!==_.LIST)fh(e,t,n.ofType,r,i);else{let o=0;for(let s of t.values)fh(e,s,n.ofType,r,Dc(i,o++,void 0))}else if(He(n)){if(t.kind!==_.OBJECT){Ki(e.onError,`Expected value of type "${n}" to be an object, found: ${Ze(t)}.`,t,i);return}let o=n.getFields(),s=S_(t.fields,l=>l.name.value);for(let l of Object.values(o)){let u=s[l.name];if(u===void 0)Hi(l)&&Ki(e.onError,`Expected value of type "${n}" to include required field "${l.name}", found: ${Ze(t)}.`,t,i);else{let d=u.value;if(d.kind===_.VARIABLE&&!e.static){let p=KZ(e,d),f=d.name.value,m=p?.coerced[f];if(n.isOneOf)m===void 0?Ki(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i):m===null&&Ki(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" not to be null.`,t,i);else if(m===void 0&&!Hi(l))continue}fh(e,d,l.type,r,Dc(i,l.name,n.name))}}let a=t.fields,c=[];for(let l of a){let u=l.name.value;if(Object.hasOwn(o,u))c.push(l);else{let d=r?"":Zn(ur(u,Object.keys(o)));Ki(e.onError,`Expected value of type "${n}" not to include unknown field "${u}"${d?`.${d} Found`:", found"}: ${Ze(t)}.`,l,i)}}if(n.isOneOf){if(c.length!==1){Ki(e.onError,N_(n),t,i);return}if(c[0].value.kind===_.NULL){let d=c[0].name.value;Ki(e.onError,N_(n),t,Dc(i,d,void 0))}}}else{vo(n);let o,s;try{o=n.coerceInputLiteral?n.coerceInputLiteral(ma(t,e.variables,e.fragmentVariableValues),r):n.parseLiteral(t,void 0,r)}catch(a){if(a instanceof F){e.onError(a,dh(i));return}s=a}o===void 0&&Ki(e.onError,`Expected value of type "${n}"${s!=null?`, but encountered error "${JZ(s)}"; found`:", found"}: ${Ze(t)}.`,t,i,nh(s))}}function KZ(e,t){let n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function Ki(e,t,n,r,i){e(new F(t,{nodes:n,originalError:i}),dh(r))}function JZ(e){if(Kn(e)){let t=e.message;if(typeof t=="string"&&t!=="")return t}return String(e)}function N_(e){return`Within OneOf Input Object type "${e}", exactly one field must be specified, and the value for that field must be non-null.`}var ge={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};var wd=2147483647,kd=-2147483648,O_=new pr({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){let t=mh(e);if(typeof t=="number")return ZZ(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return sEe(t);if(typeof t=="bigint")return YZ(t);throw new F(`Int cannot represent non-integer value: ${de(t)}`)},coerceInputValue(e){if(typeof e=="number")return ZZ(e);if(typeof e=="bigint")return YZ(e);throw new F(`Int cannot represent non-integer value: ${de(e)}`)},coerceInputLiteral(e){if(e.kind!==_.INT)throw new F(`Int cannot represent non-integer value: ${Ze(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>wd||t=kd)return{kind:_.INT,value:String(e)}}}),e3=new pr({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){let t=mh(e);if(typeof t=="number")return QZ(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return aEe(t);if(typeof t=="bigint")return XZ(t);throw new F(`Float cannot represent non numeric value: ${de(t)}`)},coerceInputValue(e){if(typeof e=="number")return QZ(e);if(typeof e=="bigint")return XZ(e);throw new F(`Float cannot represent non numeric value: ${de(e)}`)},coerceInputLiteral(e){if(e.kind!==_.FLOAT&&e.kind!==_.INT)throw new F(`Float cannot represent non numeric value: ${Ze(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){let t=Oc(e);if(t.kind===_.FLOAT||t.kind===_.INT)return t}}),kt=new pr({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){let t=mh(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number")return cEe(t);if(typeof t=="bigint")return String(t);throw new F(`String cannot represent value: ${de(e)}`)},coerceInputValue(e){if(typeof e!="string")throw new F(`String cannot represent a non string value: ${de(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_.STRING)throw new F(`String cannot represent a non string value: ${Ze(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Oc(e);if(t.kind===_.STRING)return t}}),ln=new pr({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){let t=mh(e);if(typeof t=="boolean")return t;if(typeof t=="number")return lEe(t);if(typeof t=="bigint")return t!==0n;throw new F(`Boolean cannot represent a non boolean value: ${de(t)}`)},coerceInputValue(e){if(typeof e!="boolean")throw new F(`Boolean cannot represent a non boolean value: ${de(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_.BOOLEAN)throw new F(`Boolean cannot represent a non boolean value: ${Ze(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Oc(e);if(t.kind===_.BOOLEAN)return t}}),M_=new pr({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){let t=mh(e);if(typeof t=="string")return t;if(typeof t=="number")return YD(t);if(typeof t=="bigint")return String(t);throw new F(`ID cannot represent value: ${de(e)}`)},coerceInputValue(e){if(typeof e=="string")return e;if(typeof e=="number")return YD(e);if(typeof e=="bigint")return String(e);throw new F(`ID cannot represent value: ${de(e)}`)},coerceInputLiteral(e){if(e.kind!==_.STRING&&e.kind!==_.INT)throw new F("ID cannot represent a non-string and non-integer value: "+Ze(e),{nodes:e});return e.value},valueToLiteral(e){if(typeof e=="string")return/^-?(?:0|[1-9][0-9]*)$/.test(e)?{kind:_.INT,value:e}:{kind:_.STRING,value:e,block:!1};if(typeof e=="number")return{kind:_.INT,value:YD(e)};if(typeof e=="bigint")return{kind:_.INT,value:String(e)}}}),ha=Object.freeze([kt,O_,e3,ln,M_]);function QD(e){return ha.some(({name:t})=>e.name===t)}function mh(e){if(Kn(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!Kn(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function ZZ(e){if(!Number.isInteger(e))throw new F(`Int cannot represent non-integer value: ${de(e)}`);if(e>wd||ewd||twd||enew vd(this,r,i))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Rc(this.args,t=>t.name,t=>t.toConfig()),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return"@"+this.name}toJSON(){return this.toString()}},ya=new En({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[ge.FIELD,ge.FRAGMENT_SPREAD,ge.INLINE_FRAGMENT],args:{if:{type:new _e(ln),description:"Included when true."}}}),ba=new En({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[ge.FIELD,ge.FRAGMENT_SPREAD,ge.INLINE_FRAGMENT],args:{if:{type:new _e(ln),description:"Skipped when true."}}}),ko=new En({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[ge.FRAGMENT_SPREAD,ge.INLINE_FRAGMENT],args:{if:{type:new _e(ln),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:kt,description:"Unique name"}}}),_o=new En({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[ge.FIELD],args:{initialCount:{default:{value:0},type:new _e(O_),description:"Number of items to return immediately"},if:{type:new _e(ln),description:"Stream when true or undefined.",default:{value:!0}},label:{type:kt,description:"Unique name"}}}),XD="No longer supported",Hr=new En({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[ge.FIELD_DEFINITION,ge.ARGUMENT_DEFINITION,ge.INPUT_FIELD_DEFINITION,ge.ENUM_VALUE,ge.DIRECTIVE_DEFINITION],args:{reason:{type:new _e(kt),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:XD}}}}),gh=new En({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[ge.SCALAR],args:{url:{type:new _e(kt),description:"The URL that specifies the behavior of this scalar."}}}),hh=new En({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[ge.INPUT_OBJECT],args:{}}),IQe=new En({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[ge.QUERY,ge.MUTATION,ge.SUBSCRIPTION]}),mr=Object.freeze([ya,ba,Hr,gh,hh]);function Lc(e){return mr.some(({name:t})=>t===e.name)}function Fc(e,t){if(Te(t)){let n=Fc(e,t.ofType);return n?.kind===_.NULL?null:n}if(e===null)return{kind:_.NULL};if(e===void 0)return null;if(Ke(t)){let n=t.ofType;if(ns(e)){let r=[];for(let i of e){let o=Fc(i,n);o!=null&&r.push(o)}return{kind:_.LIST,values:r}}return Fc(e,n)}if(He(t)){if(!Kn(e))return null;let n=[];for(let r of Object.values(t.getFields())){let i=Fc(e[r.name],r.type);i&&n.push({kind:_.OBJECT_FIELD,name:{kind:_.NAME,value:r.name},value:i})}return{kind:_.OBJECT,fields:n}}if(gi(t)){let n=t.coerceOutputValue(e);if(n==null)return null;if(typeof n=="boolean")return{kind:_.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let r=String(n);return n3.test(r)?{kind:_.INT,value:r}:{kind:_.FLOAT,value:r}}if(typeof n=="bigint")return{kind:_.INT,value:String(n)};if(typeof n=="string")return Xt(t)?{kind:_.ENUM,value:n}:t===M_&&n3.test(n)?{kind:_.INT,value:n}:{kind:_.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${de(n)}.`)}rt(!1,"Unexpected input type: "+de(t))}var n3=/^-?(?:0|[1-9][0-9]*)$/;function r3(e){let t=e.type,n=e.default;if(n){let i=n.literal??as(n.value,t);return i==null&&rt(!1,"Invalid default value"),i}let r=e.defaultValue;if(r!==void 0){let i=Fc(r,t);return i==null&&rt(!1,"Invalid default value"),i}}var yh=new Yn({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:kt,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new _e(new Wt(new _e(hi))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new _e(hi),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:hi,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:hi,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new _e(new Wt(new _e(eO))),args:{includeDeprecated:{type:new _e(ln),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>t===!0?e.getDirectives():e.getDirectives().filter(n=>n.deprecationReason==null)}})}),eO=new Yn({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. -In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},isRepeatable:{type:new ve(ln),resolve:e=>e.isRepeatable},locations:{type:new ve(new qt(new ve(iD))),resolve:e=>e.locations},args:{type:new ve(new qt(new ve(th))),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),iD=new gi({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:pe.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:pe.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:pe.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:pe.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:pe.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:pe.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:pe.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:pe.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:pe.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:pe.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:pe.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:pe.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:pe.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:pe.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:pe.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:pe.UNION,description:"Location adjacent to a union definition."},ENUM:{value:pe.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:pe.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:pe.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:pe.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:pe.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}}),yi=new Yn({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new ve(aD),resolve(e){if(pr(e))return Ln.SCALAR;if(at(e))return Ln.OBJECT;if(Be(e))return Ln.INTERFACE;if(Qt(e))return Ln.UNION;if(Xt(e))return Ln.ENUM;if(He(e))return Ln.INPUT_OBJECT;if(Ke(e))return Ln.LIST;if(_e(e))return Ln.NON_NULL;it(!1,`Unexpected type: "${ce(e)}".`)}},name:{type:wt,resolve:e=>"name"in e?e.name:void 0},description:{type:wt,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:wt,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new qt(new ve(oD)),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(at(e)||Be(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new qt(new ve(yi)),resolve(e){if(at(e)||Be(e))return e.getInterfaces()}},possibleTypes:{type:new qt(new ve(yi)),resolve(e,t,n,{schema:i}){if(Kr(e))return i.getPossibleTypes(e)}},enumValues:{type:new qt(new ve(sD)),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Xt(e)){let n=e.getValues();return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new qt(new ve(th)),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(He(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:yi,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:ln,resolve:e=>{if(He(e))return e.isOneOf}}})}),oD=new Yn({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},args:{type:new ve(new qt(new ve(th))),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new ve(yi),resolve:e=>e.type},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),th=new Yn({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},type:{type:new ve(yi),resolve:e=>e.type},defaultValue:{type:wt,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let t=dJ(e);return t?Ye(t):null}},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),sD=new Yn({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),Ln={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},aD=new gi({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Ln.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Ln.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Ln.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Ln.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Ln.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Ln.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Ln.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Ln.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),y$=new Bc(void 0,"__schema",{type:new ve(eh),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:i})=>i}),b$=new Bc(void 0,"__type",{type:yi,description:"Request the type information of a single type.",args:{name:{type:new ve(wt)}},resolve:(e,{name:t},n,{schema:i})=>i.getType(t)}),v$=new Bc(void 0,"__typename",{type:new ve(wt),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:i})=>i.name}),$a=Object.freeze([eh,rD,iD,yi,oD,th,sD,aD]);function cD(e){return $a.some(({name:t})=>e.name===t)}var rSe=Symbol("Schema"),nh=class{constructor(t){this.__kind=rSe,this.assumeValid=t.assumeValid??!1,this.__validationErrors=t.assumeValid===!0?[]:void 0,this.description=t.description,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=t.directives??fr;let n=new Set(t.types);if(t.types!=null)for(let i of t.types)n.delete(i),Hi(i,n);this._queryType!=null&&Hi(this._queryType,n),this._mutationType!=null&&Hi(this._mutationType,n),this._subscriptionType!=null&&Hi(this._subscriptionType,n);for(let i of this._directives)if(h$(i))for(let r of i.args)Hi(r.type,n);Hi(eh,n),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(let i of n){if(i==null)continue;let r=i.name;if(this._typeMap[r]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${r}".`);if(this._typeMap[r]=i,Be(i)){for(let o of i.getInterfaces())if(Be(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.interfaces.push(i)}}else if(at(i)){for(let o of i.getInterfaces())if(Be(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.objects.push(i)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Jn.QUERY:return this.getQueryType();case Jn.MUTATION:return this.getMutationType();case Jn.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return Qt(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){return this._implementationsMap[t.name]??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap.get(t);if(i===void 0){if(Qt(t))i=new Set(t.getTypes());else{let r=this.getImplementations(t);i=new Set([...r.objects,...r.interfaces])}this._subTypeMap.set(t,i)}return i.has(n)}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}getField(t,n){switch(n){case y$.name:return this.getQueryType()===t?y$:void 0;case b$.name:return this.getQueryType()===t?b$:void 0;case v$.name:return v$}if("getFields"in t)return t.getFields()[n]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}};function Hi(e,t){let n=ko(e);if(!t.has(n)){if(t.add(n),Qt(n))for(let i of n.getTypes())Hi(i,t);else if(at(n)||Be(n)){for(let i of n.getInterfaces())Hi(i,t);for(let i of Object.values(n.getFields())){Hi(i.type,t);for(let r of i.args)Hi(r.type,t)}}else if(He(n))for(let i of Object.values(n.getFields()))Hi(i.type,t)}return t}function pJ(e,t,n,i){if(e.literal){Kc(e.literal,t,n,void 0,void 0,i);return}f$(e.value,t,n,i)}function Ft(e,t,n){return new O(`Syntax Error: ${n}`,{source:e,positions:[t]})}function iSe(){let e;try{let t=globalThis.process;typeof t?.getBuiltinModule=="function"&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}var Yc=iSe(),lD=Yc?.tracingChannel("graphql:parse"),a9e=Yc?.tracingChannel("graphql:validate"),c9e=Yc?.tracingChannel("graphql:execute"),l9e=Yc?.tracingChannel("graphql:execute:variableCoercion"),u9e=Yc?.tracingChannel("graphql:execute:rootSelectionSet"),d9e=Yc?.tracingChannel("graphql:subscribe"),p9e=Yc?.tracingChannel("graphql:resolve"),oSe=["start","end","asyncStart","asyncEnd","error"];function fJ(e){if(e==null)return!1;let t=e.hasSubscribers;if(t!==void 0)return t;for(let n of oSe)if(e[n].hasSubscribers)return!0;return!1}var B={SOF:"",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",DOT:".",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};var ih=class{constructor(t){let n=new Pd(B.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==B.EOF)do if(t.next)t=t.next;else{let n=sSe(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===B.COMMENT);return t}};function gJ(e){return e===B.BANG||e===B.DOLLAR||e===B.AMP||e===B.PAREN_L||e===B.PAREN_R||e===B.DOT||e===B.SPREAD||e===B.COLON||e===B.EQUALS||e===B.AT||e===B.BRACKET_L||e===B.BRACKET_R||e===B.BRACE_L||e===B.PIPE||e===B.BRACE_R}function jd(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function k$(e,t){return hJ(e.charCodeAt(t))&&yJ(e.charCodeAt(t+1))}function hJ(e){return e>=55296&&e<=56319}function yJ(e){return e>=56320&&e<=57343}function Qc(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return B.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function un(e,t,n,i,r){let o=e.line,s=1+n-e.lineStart;return new Pd(t,n,i,o,s,r)}function sSe(e,t){let n=e.source.body,i=n.length,r=t;for(;r=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function pSe(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` -`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Ft(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function fSe(e,t){let n=e.source.body,i=n.length,r=e.lineStart,o=t+3,s=o,a="",c=[];for(;o0||fi(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||fi(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function vJ(e){return Nr(e,bJ,zd)}function dD(e,t){return fJ(lD)?lD.traceSync(()=>wJ(e,t),{source:e}):wJ(e,t)}function wJ(e,t){let n=new uD(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}var uD=class{constructor(t,n={}){let{lexer:i,...r}=n;if(i)this._lexer=i;else{let o=vJ(t)?t:new zd(t);this._lexer=new ih(o)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(B.NAME);return this.node(t,{kind:$.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:$.DOCUMENT,definitions:this.many(B.SOF,this.parseDefinition,B.EOF)})}parseDefinition(){if(this.peek(B.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===B.BRACE_L)throw Ft(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===B.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw Ft(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(B.BRACE_L))return this.node(t,{kind:$.OPERATION_DEFINITION,operation:Jn.QUERY,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});let n=this.parseDescription(),i=this.parseOperationType(),r;return this.peek(B.NAME)&&(r=this.parseName()),this.node(t,{kind:$.OPERATION_DEFINITION,operation:i,description:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(B.NAME);switch(t.value){case"query":return Jn.QUERY;case"mutation":return Jn.MUTATION;case"subscription":return Jn.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(B.PAREN_L,this.parseVariableDefinition,B.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:$.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(B.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(B.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(B.DOLLAR),this.node(t,{kind:$.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:$.SELECTION_SET,selections:this.many(B.BRACE_L,this.parseSelection,B.BRACE_R)})}parseSelection(){return this.peek(B.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(B.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:$.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(B.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(B.PAREN_L,n,B.PAREN_R)}parseFragmentArguments(){let t=this.parseFragmentArgument;return this.optionalMany(B.PAREN_L,t,B.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(B.COLON),this.node(n,{kind:$.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){let t=this._lexer.token,n=this.parseName();return this.expectToken(B.COLON),this.node(t,{kind:$.FRAGMENT_ARGUMENT,name:n,value:this.parseValueLiteral(!1)})}parseFragment(){let t=this._lexer.token;this.expectToken(B.SPREAD);let n=this.expectOptionalKeyword("on");if(!n&&this.peek(B.NAME)){let i=this.parseFragmentName();return this.peek(B.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(t,{kind:$.FRAGMENT_SPREAD,name:i,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(t,{kind:$.FRAGMENT_SPREAD,name:i,directives:this.parseDirectives(!1)})}return this.node(t,{kind:$.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.experimentalFragmentArguments===!0?this.node(t,{kind:$.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:$.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case B.BRACKET_L:return this.parseList(t);case B.BRACE_L:return this.parseObject(t);case B.INT:return this.advanceLexer(),this.node(n,{kind:$.INT,value:n.value});case B.FLOAT:return this.advanceLexer(),this.node(n,{kind:$.FLOAT,value:n.value});case B.STRING:case B.BLOCK_STRING:return this.parseStringLiteral();case B.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:$.BOOLEAN,value:!0});case"false":return this.node(n,{kind:$.BOOLEAN,value:!1});case"null":return this.node(n,{kind:$.NULL});default:return this.node(n,{kind:$.ENUM,value:n.value})}case B.DOLLAR:if(t)if(this.expectToken(B.DOLLAR),this._lexer.token.kind===B.NAME){let i=this._lexer.token.value;throw Ft(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:$.STRING,value:t.value,block:t.kind===B.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:$.LIST,values:this.any(B.BRACKET_L,n,B.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:$.OBJECT,fields:this.any(B.BRACE_L,n,B.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(B.COLON),this.node(n,{kind:$.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(B.AT);)n.push(this.parseDirective(t));if(n.length)return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(B.AT),this.node(n,{kind:$.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(B.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(B.BRACKET_R),n=this.node(t,{kind:$.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(B.BANG)?this.node(t,{kind:$.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:$.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(B.STRING)||this.peek(B.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(B.BRACE_L,this.parseOperationTypeDefinition,B.BRACE_R);return this.node(t,{kind:$.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(B.COLON);let i=this.parseNamedType();return this.node(t,{kind:$.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:$.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:$.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(B.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(B.BRACE_L,this.parseFieldDefinition,B.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(B.COLON);let o=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:$.FIELD_DEFINITION,description:n,name:i,arguments:r,type:o,directives:s})}parseArgumentDefs(){return this.optionalMany(B.PAREN_L,this.parseInputValueDef,B.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(B.COLON);let r=this.parseTypeReference(),o;this.expectOptionalToken(B.EQUALS)&&(o=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(t,{kind:$.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:o,directives:s})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:$.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:s})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:$.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(B.EQUALS)?this.delimitedMany(B.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:$.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:o})}parseEnumValuesDefinition(){return this.optionalMany(B.BRACE_L,this.parseEnumValueDefinition,B.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:$.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Ft(this._lexer.source,this._lexer.token.start,`${$$(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:$.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(B.BRACE_L,this.parseInputValueDef,B.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===B.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(B.BRACE_L,this.parseOperationTypeDefinition,B.BRACE_R);if(n===void 0&&i===void 0)throw this.unexpected();return this.node(t,{kind:$.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i===void 0)throw this.unexpected();return this.node(t,{kind:$.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i===void 0&&r===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:$.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i===void 0&&r===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:$.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:$.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:$.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:$.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(B.AT);let n=this.parseName(),i=this.parseConstDirectives();if(i===void 0)throw this.unexpected();return this.node(t,{kind:$.DIRECTIVE_EXTENSION,name:n,directives:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(B.AT);let i=this.parseName(),r=this.parseArgumentDefs(),o=this.parseConstDirectives(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:$.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,directives:o,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(B.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.hasOwn(pe,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){let t=this._lexer.token,n=this.expectOptionalToken(B.AT),i=this.parseName(),r;!n&&this.expectOptionalToken(B.DOT)&&(r=this.parseName());let o;return(n||r)&&this.expectOptionalToken(B.PAREN_L)&&(o=this.parseName(),this.expectToken(B.COLON),this.expectToken(B.PAREN_R)),n?o?this.node(t,{kind:$.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:o}):this.node(t,{kind:$.DIRECTIVE_COORDINATE,name:i}):r?o?this.node(t,{kind:$.ARGUMENT_COORDINATE,name:i,fieldName:r,argumentName:o}):this.node(t,{kind:$.MEMBER_COORDINATE,name:i,memberName:r}):this.node(t,{kind:$.TYPE_COORDINATE,name:i})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new jg(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw Ft(this._lexer.source,n.start,`Expected ${kJ(t)}, found ${$$(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===B.NAME&&n.value===t)this.advanceLexer();else throw Ft(this._lexer.source,n.start,`Expected "${t}", found ${$$(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===B.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return Ft(this._lexer.source,n.start,`Unexpected ${$$(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==B.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw Ft(this._lexer.source,n.start,`Document contains more than ${t} tokens. Parsing aborted.`)}};function $$(e){let t=e.value;return kJ(e.kind)+(t!=null?` "${t}"`:"")}function kJ(e){return gJ(e)?`"${e}"`:e}function vn(e,t){switch(t.kind){case $.LIST_TYPE:{let n=vn(e,t.type);return n&&new qt(n)}case $.NON_NULL_TYPE:{let n=vn(e,t.type);return n&&new ve(n)}case $.NAMED_TYPE:return e.getType(t.name.value)}}function $J(e){let t=new Map;return{Directive(n){if(n.name.value===$o.name||n.name.value===_o.name){let r=n.arguments?.find(s=>s.name.value==="label")?.value;if(!r||r.kind===$.NULL)return;if(r.kind!==$.STRING){e.reportError(new O(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));return}let o=t.get(r.value);o!=null?e.reportError(new O('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(r.value,n)}}}}function SJ(e){return{OperationDefinition(t){let n=e.getDocument(),i=new Map;for(let s of n.definitions)s.kind===$.FRAGMENT_DEFINITION&&i.set(s.name.value,s);if(t.operation!=="subscription"&&t.operation!=="mutation")return;let o=e.getSchema().getRootType(t.operation);o&&pD({context:e,operationType:t.operation,rootType:o,fragments:i,selectionSet:t.selectionSet,visitedFragments:new Set})}}}function pD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:r,visitedFragments:o}){for(let s of r.selections)if(s.kind==="Field"){let a=s.directives?.find(c=>c.name.value===_o.name);a&&e.reportError(new O(`Stream directive cannot be used on root ${t} type "${n}".`,{nodes:a}))}else if(s.kind==="FragmentSpread"){let a=s.name.value;if(o.has(a))continue;let c=i.get(a);if(c){let l=_J(s);l!==void 0&&e.reportError(new O(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:l})),pD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:c.selectionSet,visitedFragments:o})}o.add(a)}else if(s.kind==="InlineFragment"){let a=_J(s);a!==void 0&&e.reportError(new O(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:a})),pD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:s.selectionSet,visitedFragments:o})}}function _J(e){return e.directives?.find(t=>t.name.value===$o.name)}function xJ(e){let t=e.arguments?.find(n=>n.name.value==="if");if(!t)return!1;if(t.value.kind===$.BOOLEAN){if(t.value.value)return!1}else if(t.value.kind!==$.VARIABLE)return!1;return!0}function gSe(e){let t=e.arguments?.find(n=>n.name.value==="if");return t&&t.value.kind===$.BOOLEAN?!!t.value.value:!0}function hSe(e){let t=e.arguments?.find(n=>n.name.value==="if");return t?t?.value.kind===$.BOOLEAN?!t.value.value:!0:!1}function EJ(e){return{OperationDefinition(t){if(t.operation!==Jn.SUBSCRIPTION)return;let n=e.getDocument(),i=new Map;for(let o of n.definitions)o.kind===$.FRAGMENT_DEFINITION&&i.set(o.name.value,o);let r=new Set;fD({context:e,fragments:i,selectionSet:t.selectionSet,parentNodes:[],visitedFragments:r})}}}function fD({context:e,fragments:t,selectionSet:n,parentNodes:i,visitedFragments:r}){for(let o of n.selections){let s=o.directives?.find(c=>c.name.value===ka.name);if(s&&gSe(s))continue;let a=o.directives?.find(c=>c.name.value===wa.name);if(!(a&&hSe(a))){for(let c of o.directives??[])c.name.value===$o.name?xJ(c)||e.reportError(new O("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:[c,...i]})):c.name.value===_o.name&&(xJ(c)||e.reportError(new O("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:[c,...i]})));if(o.kind==="FragmentSpread"){let c=o.name.value;if(r.has(c))continue;r.add(c);let l=t.get(c);l&&fD({context:e,fragments:t,parentNodes:[o,...i],selectionSet:l?.selectionSet,visitedFragments:r})}else o.selectionSet&&fD({context:e,fragments:t,selectionSet:o.selectionSet,parentNodes:i,visitedFragments:r})}}}function mD(e){return e.kind===$.OPERATION_DEFINITION||e.kind===$.FRAGMENT_DEFINITION}function gD(e){return e.kind===$.SCHEMA_DEFINITION||_a(e)||e.kind===$.DIRECTIVE_DEFINITION}function _a(e){return e.kind===$.SCALAR_TYPE_DEFINITION||e.kind===$.OBJECT_TYPE_DEFINITION||e.kind===$.INTERFACE_TYPE_DEFINITION||e.kind===$.UNION_TYPE_DEFINITION||e.kind===$.ENUM_TYPE_DEFINITION||e.kind===$.INPUT_OBJECT_TYPE_DEFINITION}function hD(e){return e.kind===$.SCHEMA_EXTENSION||e.kind===$.DIRECTIVE_EXTENSION||_$(e)}function _$(e){return e.kind===$.SCALAR_TYPE_EXTENSION||e.kind===$.OBJECT_TYPE_EXTENSION||e.kind===$.INTERFACE_TYPE_EXTENSION||e.kind===$.UNION_TYPE_EXTENSION||e.kind===$.ENUM_TYPE_EXTENSION||e.kind===$.INPUT_OBJECT_TYPE_EXTENSION}function TJ(e){return{Document(t){for(let n of t.definitions)if(!mD(n)){let i=n.kind===$.SCHEMA_DEFINITION||n.kind===$.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new O(`The ${i} definition is not executable.`,{nodes:n}))}return!1}}}function IJ(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let r=e.getSchema(),o=t.name.value,s=Zn("to use an inline fragment on",e.hideSuggestions?[]:ySe(r,n,o));s===""&&(s=Zn(e.hideSuggestions?[]:bSe(n,o))),e.reportError(new O(`Cannot query field "${o}" on type "${n}".`+s,{nodes:t}))}}}}function ySe(e,t,n){if(!Kr(t))return[];let i=new Set,r=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]!=null){i.add(o),r[o.name]=1;for(let s of o.getInterfaces())s.getFields()[n]!=null&&(i.add(s),r[s.name]=(r[s.name]??0)+1)}return[...i].sort((o,s)=>{let a=r[s.name]-r[o.name];return a!==0?a:Be(o)&&e.isSubType(o,s)?-1:Be(s)&&e.isSubType(s,o)?1:Dd(o.name,s.name)}).map(o=>o.name)}function bSe(e,t){if(at(e)||Be(e)){let n=Object.keys(e.getFields());return lr(t,n)}return[]}function AJ(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let i=vn(e.getSchema(),n);if(i&&!os(i)){let r=Ye(n);e.reportError(new O(`Fragment cannot condition on non composite type "${r}".`,{nodes:n}))}}},FragmentDefinition(t){let n=vn(e.getSchema(),t.typeCondition);if(n&&!os(n)){let i=Ye(t.typeCondition);e.reportError(new O(`Fragment "${t.name.value}" cannot condition on non composite type "${i}".`,{nodes:t.typeCondition}))}}}}function RJ(e){return{...yD(e),FragmentArgument(t){let n=e.getFragmentSignature();if(n&&!n.variableDefinitions.get(t.name.value)){let r=t.name.value,o=e.hideSuggestions?[]:lr(r,Array.from(n.variableDefinitions.values()).map(s=>s.variable.name.value));e.reportError(new O(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+Zn(o),{nodes:t}))}},Argument(t){let n=e.getArgument(),i=e.getFieldDef();if(!n&&i){let r=t.name.value,o=e.hideSuggestions?[]:lr(r,i.args.map(s=>s.name));e.reportError(new O(`Unknown argument "${r}" on field "${i}".`+Zn(o),{nodes:t}))}}}}function yD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():fr;for(let o of i)t.set(o.name,o.args.map(s=>s.name));let r=e.getDocument().definitions;for(let o of r)if(o.kind===$.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,s.map(a=>a.name.value))}return{Directive(o){let s=o.name.value,a=t.get(s);if(o.arguments!=null&&a!=null)for(let c of o.arguments){let l=c.name.value;if(!a.includes(l)){let u=lr(l,a);e.reportError(new O(`Unknown argument "${l}" on directive "@${s}".`+(e.hideSuggestions?"":Zn(u)),{nodes:c}))}}return!1}}}function bD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():fr;for(let o of i)t.set(o.name,o.locations);let r=e.getDocument().definitions;for(let o of r)o.kind===$.DIRECTIVE_DEFINITION&&t.set(o.name.value,o.locations.map(s=>s.value));return{Directive(o,s,a,c,l){let u=o.name.value,d=t.get(u);if(d==null){e.reportError(new O(`Unknown directive "@${u}".`,{nodes:o}));return}let p=vSe(l);p!=null&&!d.includes(p)&&e.reportError(new O(`Directive "@${u}" may not be used on ${p}.`,{nodes:o}))}}}function vSe(e){let t=e.at(-1);switch(t!=null&&"kind"in t||it(!1),t.kind){case $.OPERATION_DEFINITION:return wSe(t.operation);case $.FIELD:return pe.FIELD;case $.FRAGMENT_SPREAD:return pe.FRAGMENT_SPREAD;case $.INLINE_FRAGMENT:return pe.INLINE_FRAGMENT;case $.FRAGMENT_DEFINITION:return pe.FRAGMENT_DEFINITION;case $.VARIABLE_DEFINITION:{let n=e[e.length-3];return"kind"in n||it(!1),n.kind===$.OPERATION_DEFINITION?pe.VARIABLE_DEFINITION:pe.FRAGMENT_VARIABLE_DEFINITION}case $.SCHEMA_DEFINITION:case $.SCHEMA_EXTENSION:return pe.SCHEMA;case $.SCALAR_TYPE_DEFINITION:case $.SCALAR_TYPE_EXTENSION:return pe.SCALAR;case $.OBJECT_TYPE_DEFINITION:case $.OBJECT_TYPE_EXTENSION:return pe.OBJECT;case $.FIELD_DEFINITION:return pe.FIELD_DEFINITION;case $.INTERFACE_TYPE_DEFINITION:case $.INTERFACE_TYPE_EXTENSION:return pe.INTERFACE;case $.UNION_TYPE_DEFINITION:case $.UNION_TYPE_EXTENSION:return pe.UNION;case $.ENUM_TYPE_DEFINITION:case $.ENUM_TYPE_EXTENSION:return pe.ENUM;case $.ENUM_VALUE_DEFINITION:return pe.ENUM_VALUE;case $.INPUT_OBJECT_TYPE_DEFINITION:case $.INPUT_OBJECT_TYPE_EXTENSION:return pe.INPUT_OBJECT;case $.INPUT_VALUE_DEFINITION:{let n=e.at(-3);return n!=null&&"kind"in n||it(!1),n.kind===$.INPUT_OBJECT_TYPE_DEFINITION||n.kind===$.INPUT_OBJECT_TYPE_EXTENSION?pe.INPUT_FIELD_DEFINITION:pe.ARGUMENT_DEFINITION}case $.DIRECTIVE_DEFINITION:case $.DIRECTIVE_EXTENSION:return pe.DIRECTIVE_DEFINITION;default:it(!1,"Unexpected kind: "+ce(t.kind))}}function wSe(e){switch(e){case Jn.QUERY:return pe.QUERY;case Jn.MUTATION:return pe.MUTATION;case Jn.SUBSCRIPTION:return pe.SUBSCRIPTION}}function NJ(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new O(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function CJ(e){let t=e.getSchema();return{OperationDefinition(n){let i=n.operation;t.getRootType(i)||e.reportError(new O(`The ${i} operation is not supported by the schema.`,{nodes:n}))}}}function vD(e){let{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},i=new Set([...Object.keys(n),...t.filter(_a).map(r=>r.name.value)]);return{NamedType(r,o,s,a,c){let l=r.name.value;if(!i.has(l)){let u=c[2]??s,d=u!=null&&kSe(u);if(d&&PJ.has(l))return;let p=e.hideSuggestions?[]:lr(l,d?[...PJ,...i]:[...i]);e.reportError(new O(`Unknown type "${l}".`+Zn(p),{nodes:r}))}}}}var PJ=new Set([...va,...$a].map(e=>e.name));function kSe(e){return"kind"in e&&(gD(e)||hD(e))}function DJ(e){let t=0;return{Document(n){t=n.definitions.filter(i=>i.kind===$.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new O("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function OJ(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),i=0;return{SchemaDefinition(r){if(n){e.reportError(new O("Cannot define a new schema within a schema extension.",{nodes:r}));return}i>0&&e.reportError(new O("Must provide only one schema definition.",{nodes:r})),++i}}}var $Se=3;function MJ(e){function t(n,i=Object.create(null),r=0){if(n.kind===$.FRAGMENT_SPREAD){let o=n.name.value;if(i[o]===!0)return!1;let s=e.getFragment(o);if(!s)return!1;try{return i[o]=!0,t(s,i,r)}finally{i[o]=void 0}}if(n.kind===$.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(r++,r>=$Se))return!0;if("selectionSet"in n&&n.selectionSet){for(let o of n.selectionSet.selections)if(t(o,i,r))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new O("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function LJ(e){let t=new Set,n=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(o){return r(o),!1}};function r(o){if(t.has(o.name.value))return;let s=o.name.value;t.add(s);let a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){i[s]=n.length;for(let c of a){let l=c.name.value,u=i[l];if(n.push(c),u===void 0){let d=e.getFragment(l);d&&r(d)}else{let d=n.slice(u),p=d.slice(0,-1).map(f=>'"'+f.name.value+'"').join(", ");e.reportError(new O(`Cannot spread fragment "${l}" within itself`+(p!==""?` via ${p}.`:"."),{nodes:d}))}n.pop()}i[s]=void 0}}}function FJ(e){return{OperationDefinition(t){let n=new Set(t.variableDefinitions?.map(r=>r.variable.name.value)),i=e.getRecursiveVariableUsages(t);for(let{node:r,fragmentVariableDefinition:o}of i){if(o)continue;let s=r.name.value;n.has(s)||e.reportError(new O(t.name?`Variable "$${s}" is not defined by operation "${t.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[r,t]}))}}}}function UJ(e){let t=new Set,n=[];return{OperationDefinition(i){for(let r of e.getRecursivelyReferencedFragments(i))t.add(r.name.value);return!1},FragmentDefinition(i){return n.push(i),!1},Document:{leave(){for(let i of n){let r=i.name.value;t.has(r)||e.reportError(new O(`Fragment "${r}" is never used.`,{nodes:i}))}}}}}function jJ(e){return{FragmentDefinition(t){let n=e.getVariableUsages(t),i=new Set(n.map(({node:o})=>o.name.value)),r=t.variableDefinitions??[];for(let o of r){let s=o.variable.name.value;i.has(s)||e.reportError(new O(`Variable "$${s}" is never used in fragment "${t.name.value}".`,{nodes:o}))}},OperationDefinition(t){let n=e.getRecursiveVariableUsages(t),i=new Set;for(let{node:o,fragmentVariableDefinition:s}of n){let a=o.name.value;s||i.add(a)}let r=t.variableDefinitions??[];for(let o of r){let s=o.variable.name.value;i.has(s)||e.reportError(new O(t.name?`Variable "$${s}" is never used in operation "${t.name.value}".`:`Variable "$${s}" is never used.`,{nodes:o}))}}}}function oh(e){switch(e.kind){case $.OBJECT:return{...e,fields:_Se(e.fields)};case $.LIST:return{...e,values:e.values.map(oh)};case $.INT:case $.FLOAT:case $.STRING:case $.BOOLEAN:case $.NULL:case $.ENUM:case $.VARIABLE:return e}}function _Se(e){return e.map(t=>({...t,value:oh(t.value)})).sort((t,n)=>Dd(t.name.value,n.name.value))}function VJ(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+VJ(n)).join(" and "):e}function BJ(e){let t=new T$,n=new $D,i=new Map;return{SelectionSet(r){let o=SSe(e,i,t,n,e.getParentType(),r);for(let[[s,a],c,l]of o){let u=VJ(a);e.reportError(new O(`Fields "${s}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:c.concat(l)}))}}}}function SSe(e,t,n,i,r,o){let s=[],[a,c]=E$(e,t,r,o,void 0);if(ESe(e,s,t,n,i,a),c.length!==0)for(let l=0;l1)for(let c=0;c[o.value,i===void 0?s:sh(s,i)]));return e.every(o=>{let s=o.value;t&&(s=sh(s,t));let a=r.get(o.name.value);return a===void 0?!1:zJ(s)===zJ(a)})}function sh(e,t){switch(e.kind){case $.VARIABLE:return t.get(e.name.value)??e;case $.LIST:return{...e,values:e.values.map(n=>sh(n,t))};case $.OBJECT:return{...e,fields:e.fields.map(n=>({...n,value:sh(n.value,t)}))};default:return e}}function zJ(e){return Ye(oh(e))}function GJ(e){return e?.find(t=>t.name.value==="stream")}function TSe(e,t,n,i){let r=GJ(e),o=GJ(n);if(!(!r&&!o))return r&&o&&SD(r.arguments,t,o.arguments,i)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives"}function wD(e,t){return Ke(e)?Ke(t)?wD(e.ofType,t.ofType):!0:Ke(t)?!0:_e(e)?_e(t)?wD(e.ofType,t.ofType):!0:_e(t)?!0:hi(e)||hi(t)?e!==t:!1}function E$(e,t,n,i,r){let o=t.get(i);if(o)return o;let s=new Map,a=new Map;WJ(e,n,i,s,a,r);let c=[s,Array.from(a.values())];return t.set(i,c),c}function kD(e,t,n,i){let r=t.get(n.selectionSet);if(r)return r;let o=vn(e.getSchema(),n.typeCondition);return E$(e,t,o,n.selectionSet,i)}function WJ(e,t,n,i,r,o){for(let s of n.selections)switch(s.kind){case $.FIELD:{let a=s.name.value,c;(at(t)||Be(t))&&(c=t.getFields()[a]);let l=s.alias?s.alias.value:a,u=i.get(l);u==null&&(u=[],i.set(l,u)),u.push([t,s,c]);break}case $.FRAGMENT_SPREAD:{let a=ISe(e,s,o);r.set(a.key,a);break}case $.INLINE_FRAGMENT:{let a=s.typeCondition,c=a?vn(e.getSchema(),a):t;WJ(e,c,s.selectionSet,i,r,o);break}}}function ISe(e,t,n){let i="",r=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(let a of t.arguments)s.set(a.name.value,a.value);if(o?.variableDefinitions){i+=t.name.value+"(";for(let[a,c]of o.variableDefinitions){let l=s.get(a);l&&(i+=a+": "+Ye(oh(l)));let u=s.get(a);u!==void 0?r.set(a,n!==void 0?sh(u,n):u):c.defaultValue&&r.set(a,c.defaultValue)}i+=")"}return{key:i,node:t,varMap:r.size>0?r:void 0}}function ASe(e,t,n,i){if(e.length>0)return[[t,e.map(([r])=>r)],[n,...e.map(([,r])=>r).flat()],[i,...e.map(([,,r])=>r).flat()]]}var T$=class{constructor(){this._data=new Map}has(t,n,i){let r=this._data.get(t)?.get(n);return r===void 0?!1:i?!0:i===r}add(t,n,i){let r=this._data.get(t);r===void 0?this._data.set(t,new Map([[n,i]])):r.set(n,i)}},$D=class{constructor(){this._orderedPairSet=new T$}has(t,n,i){return tr.name.value));for(let r of n.args)!i.has(r.name)&&ha(r)&&e.reportError(new O(`Argument "${r}" of type "${r.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){let n=e.getFragmentSignature();if(!n)return!1;let i=new Set(t.arguments?.map(r=>r.name.value));for(let[r,o]of n.variableDefinitions)if(!i.has(r)&&ZJ(o)){let s=vn(e.getSchema(),o.type),a=ce(s);e.reportError(new O(`Fragment "${t.name.value}" argument "${r}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function xD(e){let t=new Map,i=e.getSchema()?.getDirectives()??fr;for(let o of i)t.set(o.name,new Map(o.args.filter(ha).map(s=>[s.name,s])));let r=e.getDocument().definitions;for(let o of r)if(o.kind===$.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,new Map(s.filter(ZJ).map(a=>[a.name.value,a])))}return{Directive:{leave(o){let s=o.name.value,a=t.get(s);if(a!=null){let c=o.arguments??[],l=new Set(c.map(u=>u.name.value));for(let[u,d]of a.entries())if(!l.has(u)){let p=qg(d.type)?ce(d.type):Ye(d.type);e.reportError(new O(`Argument "@${s}(${u}:)" of type "${p}" is required, but it was not provided.`,{nodes:o}))}}}}}}function ZJ(e){return e.type.kind===$.NON_NULL_TYPE&&e.defaultValue==null}function YJ(e){return{Field(t){let n=e.getType(),i=t.selectionSet;if(n)if(hi(ko(n))){if(i){let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" must not have a selection since type "${o}" has no subfields.`,{nodes:i}))}}else if(i){if(i.selections.length===0){let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" of type "${o}" must have at least one field selected.`,{nodes:t}))}}else{let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" of type "${o}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}}function So(e,t){if(_e(t))return e==null?void 0:So(e,t.ofType);if(e==null)return null;if(Ke(t)){if(!ts(e)){let r=So(e,t.ofType);return r===void 0?void 0:[r]}let i=[];for(let r of e){let o=So(r,t.ofType);if(o===void 0)return;i.push(o)}return i}if(He(t)){if(!Kn(e)||Array.isArray(e))return;let i=Object.create(null),r=t.getFields(),o=0;for(let s of Object.keys(e))if(e[s]!==void 0&&(o++,!Object.hasOwn(r,s)))return;for(let s of Object.values(r)){let a=e[s.name];if(a===void 0){if(qi(s))return;let c=I$(s);c!==void 0&&(i[s.name]=c)}else{let c=So(a,s.type);if(c===void 0)return;i[s.name]=c}}if(t.isOneOf){let s=Object.keys(i);if(o!==1||s.length!==1)return;let a=s[0];if(i[a]===null)return}return i}let n=wo(t);try{return n.coerceInputValue(e)}catch{}}function as(e,t,n,i){if(e.kind===$.VARIABLE){let o=QJ(e,n,i);return o==null&&_e(t)?void 0:o}if(_e(t))return e.kind===$.NULL?void 0:as(e,t.ofType,n,i);if(e.kind===$.NULL)return null;if(Ke(t)){if(e.kind!==$.LIST){let s=as(e,t.ofType,n,i);return s===void 0?void 0:[s]}let o=[];for(let s of e.values){let a=as(s,t.ofType,n,i);if(a===void 0)if(s.kind===$.VARIABLE&&QJ(s,n,i)==null&&!_e(t.ofType))a=null;else return;o.push(a)}return o}if(He(t)){if(e.kind!==$.OBJECT)return;let o=Object.create(null),s=t.getFields();if(e.fields.some(l=>!Object.hasOwn(s,l.name.value)))return;let c=new Map(e.fields.map(l=>[l.name.value,l]));for(let l of Object.values(s)){let u=c.get(l.name);if(!u||u.value.kind===$.VARIABLE&&DSe(u.value,n,i)){if(qi(l))return;let d=I$(l);d!==void 0&&(o[l.name]=d)}else{let d=as(u.value,l.type,n,i);if(d===void 0)return;o[l.name]=d}}if(t.isOneOf){let l=Object.keys(o);if(c.size!==1||l.length!==1)return;for(let[u,d]of c)if(d.value.kind===$.NULL||o[u]===null)return}return o}let r=wo(t);try{return r.coerceInputLiteral?r.coerceInputLiteral(ya(e,n,i)):r.parseLiteral(e,n?.coerced)}catch{}}function QJ(e,t,n){let i=e.name.value;return n?.sources[i]!==void 0?n.coerced[i]:t?.coerced[i]}function DSe(e,t,n){let i=e.name.value;return(n?.sources[i]!==void 0?n.coerced:t?.coerced)?.[i]===void 0}function I$(e){let t=e._memoizedCoercedDefaultValue;if(t!==void 0)return t;let n=e.default;if(n!==void 0)return t=n.literal?as(n.literal,e.type):So(n.value,e.type),t===void 0&&it(!1,`Expected value of type "${e.type}" to be valid, found: ${ce(n.literal??n.value)}.`),e._memoizedCoercedDefaultValue=t,t;let i=e.defaultValue;return i!==void 0&&(e._memoizedCoercedDefaultValue=i),i}function XJ(e,t,n,i,r){try{let o=I$(n);o!==void 0&&(e[t]=o)}catch(o){let s=n.default;if(s===void 0)throw o;let a=!1;pJ(s,n.type,(c,l)=>{a=!0,i(c,l)},r),a||i(Ug(o),[])}}function eZ(e,t,n,i,r){let o=e.arguments??[],s=new Map(o.map(l=>[l.name.value,l])),a=Object.create(null),c=Object.create(null);for(let[l,u]of Object.entries(t)){let d=s.get(l);d!==void 0?a[l]=i==null?{signature:u,value:d.value}:{signature:u,value:d.value,fragmentVariableValues:i}:a[l]={signature:u},tZ(c,e,l,u,d,n,i,r)}return{sources:a,coerced:c}}function A$(e,t,n,i,r){let o=Object.create(null),s=t.arguments??[],a=new Map(s.map(c=>[c.name.value,c]));for(let c of e.args){let l=c.name;tZ(o,t,l,c,a.get(c.name),n,i,r)}return o}function tZ(e,t,n,i,r,o,s,a){let c=i.type,l=(p,f)=>{throw new O(`${ED(i,t)} has invalid default value${zP(f)}: ${p.message}`,{nodes:t})};if(!r){if(ha(i))throw new O(`${ED(i,t)} of required type "${c}" was not provided.`,{nodes:t});XJ(e,n,i,l,a);return}let u=r.value;if(u.kind===$.VARIABLE){let p=u.name.value,f=s?.sources[p]?s:o;if((f==null||!Object.hasOwn(f.coerced,p))&&!ha(i)){XJ(e,n,i,l,a);return}}let d=as(u,c,o,s);d===void 0&&(Kc(u,c,(p,f)=>{throw p.message=`${ED(i,t)} has invalid value${zP(f)}: ${p.message}`,p},o,s,a),it(!1,"Invalid argument")),e[n]=d}function ED(e,t){return c$(e)?`Argument "${e}"`:`Variable "$${e.name}" defined by fragment "${t.name.value}"`}function Gd(e,t,n,i,r){let o=t.directives?.find(s=>s.name.value===e.name);if(o)return A$(e,o,n,i,r)}function iZ(e,t,n,i,r,o,s=!1){let a=new Cr,c=[],l={schema:e,fragments:t,variableValues:n,runtimeType:i,visitedFragmentNames:new Map,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return R$(l,r,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:l.forbiddenDirectiveInstances}}function R$(e,t,n,i,r,o){let{schema:s,fragments:a,variableValues:c,runtimeType:l,visitedFragmentNames:u,hideSuggestions:d}=e;for(let p of t.selections)switch(p.kind){case $.FIELD:{if(!TD(e,p,c,o))continue;n.add(OSe(p),{node:p,deferUsage:r,fragmentVariableValues:o});break}case $.INLINE_FRAGMENT:{if(!TD(e,p,c,o)||!rZ(s,p,l))continue;let f=nZ(c,o,p,r);f?(i.push(f),R$(e,p.selectionSet,n,i,f,o)):R$(e,p.selectionSet,n,i,r,o);break}case $.FRAGMENT_SPREAD:{let f=p.name.value;if(!TD(e,p,c,o))continue;let m=a[f];if(m==null||!rZ(s,m.definition,l))continue;let g=nZ(c,o,p,r),h=u.get(f),b;if(g){if(h!==void 0)continue;u.set(f,!0),i.push(g),b=g}else{if(h===!1)continue;u.set(f,!1),b=r}let y=m.variableSignatures,w;y&&(w=eZ(p,y,c,o,d)),R$(e,m.definition.selectionSet,n,i,b,w);break}}}function nZ(e,t,n,i){let r=Gd($o,n,e,t);if(r&&r.if!==!1)return{label:typeof r.label=="string"?r.label:void 0,parentDeferUsage:i}}function TD(e,t,n,i){let r=t.directives?.find(c=>c.name.value===ka.name);if(r&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(r),!1;if((r?A$(ka,r,n,i,e.hideSuggestions):void 0)?.if===!0)return!1;let s=t.directives?.find(c=>c.name.value===wa.name);return s&&e.forbidSkipAndInclude?(e.forbiddenDirectiveInstances.push(s),!1):(s?A$(wa,s,n,i,e.hideSuggestions):void 0)?.if!==!1}function rZ(e,t,n){let i=t.typeCondition;if(!i)return!0;let r=vn(e,i);return r===n?!0:Kr(r)?e.isSubType(r,n):!1}function OSe(e){return e.alias?e.alias.value:e.name.value}function ID(e){return e.map(t=>t.node)}function oZ(e){return{OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),i=n.getSubscriptionType();if(i){let r=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(let u of s.definitions)u.kind===$.FRAGMENT_DEFINITION&&(a[u.name.value]={definition:u});let{groupedFieldSet:c,forbiddenDirectiveInstances:l}=iZ(n,a,o,i,t.selectionSet,e.hideSuggestions,!0);if(l.length>0){e.reportError(new O(r!=null?`Subscription "${r}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:l}));return}if(c.size>1){let p=[...c.values()].slice(1).flatMap(f=>ID(f));e.reportError(new O(r!=null?`Subscription "${r}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:p}))}for(let u of c.values())ID(u)[0].name.value.startsWith("__")&&e.reportError(new O(r!=null?`Subscription "${r}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:ID(u)}))}}}}}function sZ(e){return{Directive(t){let n=e.getFieldDef(),i=e.getParentType();n&&i&&t.name.value===_o.name&&!(Ke(n.type)||Bi(n.type)&&Ke(n.type.ofType))&&e.reportError(new O(`Directive "@stream" cannot be used on non-list field "${i}.${n.name}".`,{nodes:t}))}}}function Vd(e,t){let n=new Cr;for(let i of e)n.add(t(i),i);return n}function aZ(e){return{DirectiveDefinition(i){let r=i.arguments??[];return n(`@${i.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(i){let r=i.name.value,o=i.fields??[];for(let s of o){let a=s.name.value,c=s.arguments??[];n(`${r}.${a}`,c)}return!1}function n(i,r){let o=Vd(r,s=>s.name.value);for(let[s,a]of o)a.length>1&&e.reportError(new O(`Argument "${i}(${s}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}function AD(e){return{Field:t,Directive:t};function t(n){let i=n.arguments??[],r=Vd(i,o=>o.name.value);for(let[o,s]of r)s.length>1&&e.reportError(new O(`There can be only one argument named "${o}".`,{nodes:s.map(a=>a.name)}))}}function cZ(e){let t=new Map,n=e.getSchema();return{DirectiveDefinition(i){let r=i.name.value;if(n?.getDirective(r)){e.reportError(new O(`Directive "@${r}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}));return}let o=t.get(r);return o?e.reportError(new O(`There can be only one directive named "@${r}".`,{nodes:[o,i.name]})):t.set(r,i.name),!1}}}function RD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():fr;for(let c of i)t.set(c.name,!c.isRepeatable);let r=e.getDocument().definitions;for(let c of r)c.kind===$.DIRECTIVE_DEFINITION&&t.set(c.name.value,!c.repeatable);let o=new Map,s=new Map,a=new Map;return{enter(c){if(!("directives"in c)||!c.directives)return;let l;if(c.kind===$.SCHEMA_DEFINITION||c.kind===$.SCHEMA_EXTENSION)l=o;else if(_a(c)||_$(c)){let u=c.name.value;l=s.get(u),l===void 0&&(l=new Map,s.set(u,l))}else if(c.kind===$.DIRECTIVE_DEFINITION||c.kind===$.DIRECTIVE_EXTENSION){let u=c.name.value;l=a.get(u),l===void 0&&(l=new Map,a.set(u,l))}else l=new Map;for(let u of c.directives){let d=u.name.value;if(t.get(d)===!0){let p=l.get(d);p!=null?e.reportError(new O(`The directive "@${d}" can only be used once at this location.`,{nodes:[p,u]})):l.set(d,u)}}}}}function lZ(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=new Map;return{EnumTypeDefinition:r,EnumTypeExtension:r};function r(o){let s=o.name.value,a=i.get(s);a==null&&(a=new Map,i.set(s,a));let c=o.values??[];for(let l of c){let u=l.name.value,d=n[s];if(Xt(d)&&d.getValue(u)){e.reportError(new O(`Enum value "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let p=a.get(u);p!=null?e.reportError(new O(`Enum value "${s}.${u}" can only be defined once.`,{nodes:[p,l.name]})):a.set(u,l.name)}return!1}}function uZ(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=new Map;return{InputObjectTypeDefinition:r,InputObjectTypeExtension:r,InterfaceTypeDefinition:r,InterfaceTypeExtension:r,ObjectTypeDefinition:r,ObjectTypeExtension:r};function r(o){let s=o.name.value,a=i.get(s);a==null&&(a=new Map,i.set(s,a));let c=o.fields??[];for(let l of c){let u=l.name.value;if(MSe(n[s],u)){e.reportError(new O(`Field "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let d=a.get(u);d!=null?e.reportError(new O(`Field "${s}.${u}" can only be defined once.`,{nodes:[d,l.name]})):a.set(u,l.name)}return!1}}function MSe(e,t){return at(e)||Be(e)||He(e)?e.getFields()[t]!=null:!1}function dZ(e){let t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){let i=n.name.value,r=t.get(i);return r!=null?e.reportError(new O(`There can be only one fragment named "${i}".`,{nodes:[r,n.name]})):t.set(i,n.name),!1}}}function ND(e){let t=[],n=new Map;return{ObjectValue:{enter(){t.push(n),n=new Map},leave(){let i=t.pop();i==null&&it(!1),n=i}},ObjectField(i){let r=i.name.value,o=n.get(r);o!=null?e.reportError(new O(`There can be only one input field named "${r}".`,{nodes:[o,i.name]})):n.set(r,i.name)}}}function pZ(e){let t=new Map;return{OperationDefinition(n){let i=n.name;if(i!=null){let r=t.get(i.value);r!=null?e.reportError(new O(`There can be only one operation named "${i.value}".`,{nodes:[r,i]})):t.set(i.value,i)}return!1},FragmentDefinition:()=>!1}}function fZ(e){let t=e.getSchema(),n=new Map,i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:r,SchemaExtension:r};function r(o){let s=o.operationTypes??[];for(let a of s){let c=a.operation,l=n.get(c);i[c]?e.reportError(new O(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:a})):l?e.reportError(new O(`There can be only one ${c} type in schema.`,{nodes:[l,a]})):n.set(c,a)}return!1}}function mZ(e){let t=new Map,n=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(r){let o=r.name.value;if(n?.getType(o)){e.reportError(new O(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));return}let s=t.get(o);return s!=null?e.reportError(new O(`There can be only one type named "${o}".`,{nodes:[s,r.name]})):t.set(o,r.name),!1}}function gZ(e){return{OperationDefinition(t){let n=t.variableDefinitions??[],i=Vd(n,r=>r.variable.name.value);for(let[r,o]of i)o.length>1&&e.reportError(new O(`There can be only one variable named "$${r}".`,{nodes:o.map(s=>s.variable.name)}))}}}function hZ(e){return{NullValue:t=>Sa(e,t,e.getInputType()),ListValue:t=>Sa(e,t,e.getParentInputType()),ObjectValue:t=>Sa(e,t,e.getInputType()),EnumValue:t=>Sa(e,t,e.getInputType()),IntValue:t=>Sa(e,t,e.getInputType()),FloatValue:t=>Sa(e,t,e.getInputType()),StringValue:t=>Sa(e,t,e.getInputType()),BooleanValue:t=>Sa(e,t,e.getInputType())}}function Sa(e,t,n){return n&&Kc(t,n,i=>{e.reportError(i)},void 0,void 0,e.hideSuggestions),!1}function yZ(e){return{VariableDefinition(t){let n=vn(e.getSchema(),t.type);if(n!==void 0&&!Wg(n)){let i=t.variable.name.value,r=Ye(t.type);e.reportError(new O(`Variable "$${i}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}function bZ(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){let i=e.getRecursiveVariableUsages(n);for(let{node:r,type:o,parentType:s,defaultValue:a,fragmentVariableDefinition:c}of i){let l=r.name.value,u=c;if(u??=t.get(l),u&&o){let d=e.getSchema(),p=vn(d,u.type);p&&!LSe(d,p,u.defaultValue,o,a)&&e.reportError(new O(`Variable "$${l}" of type "${p}" used in position expecting type "${o}".`,{nodes:[u,r]})),He(s)&&s.isOneOf&&l$(p)&&e.reportError(new O(`Variable "$${l}" is of type "${p}" but must be non-nullable to be used for OneOf Input Object "${s}".`,{nodes:[u,r]}))}}}},VariableDefinition(n){t.set(n.variable.name.value,n)}}}function LSe(e,t,n,i,r){if(_e(i)&&!_e(t)){if(!(n!=null&&n.kind!==$.NULL)&&!(r!==void 0))return!1;let a=i.ofType;return qc(e,t,a)}return qc(e,t,i)}var FSe=Object.freeze([MJ]),USe=Object.freeze([TJ,CJ,pZ,DJ,oZ,vD,AJ,yZ,YJ,IJ,dZ,NJ,UJ,HJ,LJ,gZ,FJ,jJ,bD,RD,SJ,EJ,$J,sZ,RJ,AD,hZ,JJ,bZ,BJ,ND,...FSe]),vZ=Object.freeze([OJ,fZ,mZ,lZ,uZ,aZ,cZ,vD,bD,RD,KJ,yD,AD,ND,xD]);var CD=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let i of this.getDocument().definitions)i.kind===$.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let i=[t],r;for(;r=i.pop();)for(let o of r.selections)o.kind===$.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&i.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let i=new Set,r=[t.selectionSet],o;for(;o=r.pop();)for(let s of this.getFragmentSpreads(o)){let a=s.name.value;if(!i.has(a)){i.add(a);let c=this.getFragment(a);c&&(n.push(c),r.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}},N$=class extends CD{constructor(t,n,i){super(t,i),this._schema=n}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};var set=ga(zg,e=>e.filter(t=>t!=="description")),aet=new O("Too many validation errors, error limit reached. Validation aborted.");function jSe(e,t,n=vZ){let i=[],r=new N$(e,t,s=>{i.push(s)}),o=n.map(s=>s(r));return Md(e,WP(o)),i}function wZ(e){let t=jSe(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` +In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new _e(kt),resolve:e=>e.name},description:{type:kt,resolve:e=>e.description},isRepeatable:{type:new _e(ln),resolve:e=>e.isRepeatable},locations:{type:new _e(new Wt(new _e(tO))),resolve:e=>e.locations},args:{type:new _e(new Wt(new _e(bh))),args:{includeDeprecated:{type:new _e(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},isDeprecated:{type:new _e(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:kt,resolve:e=>e.deprecationReason}})}),tO=new mi({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:ge.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:ge.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:ge.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:ge.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:ge.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:ge.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:ge.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:ge.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:ge.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:ge.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:ge.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:ge.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:ge.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:ge.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:ge.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:ge.UNION,description:"Location adjacent to a union definition."},ENUM:{value:ge.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:ge.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:ge.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:ge.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:ge.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}}),hi=new Yn({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new _e(iO),resolve(e){if(fr(e))return Mn.SCALAR;if(st(e))return Mn.OBJECT;if(qe(e))return Mn.INTERFACE;if(Qt(e))return Mn.UNION;if(Xt(e))return Mn.ENUM;if(He(e))return Mn.INPUT_OBJECT;if(Ke(e))return Mn.LIST;if(Te(e))return Mn.NON_NULL;rt(!1,`Unexpected type: "${de(e)}".`)}},name:{type:kt,resolve:e=>"name"in e?e.name:void 0},description:{type:kt,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:kt,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new Wt(new _e(nO)),args:{includeDeprecated:{type:new _e(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(st(e)||qe(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new Wt(new _e(hi)),resolve(e){if(st(e)||qe(e))return e.getInterfaces()}},possibleTypes:{type:new Wt(new _e(hi)),resolve(e,t,n,{schema:r}){if(Wr(e))return r.getPossibleTypes(e)}},enumValues:{type:new Wt(new _e(rO)),args:{includeDeprecated:{type:new _e(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Xt(e)){let n=e.getValues();return t===!0?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new Wt(new _e(bh)),args:{includeDeprecated:{type:new _e(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(He(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:hi,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:ln,resolve:e=>{if(He(e))return e.isOneOf}}})}),nO=new Yn({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new _e(kt),resolve:e=>e.name},description:{type:kt,resolve:e=>e.description},args:{type:new _e(new Wt(new _e(bh))),args:{includeDeprecated:{type:new _e(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new _e(hi),resolve:e=>e.type},isDeprecated:{type:new _e(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:kt,resolve:e=>e.deprecationReason}})}),bh=new Yn({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new _e(kt),resolve:e=>e.name},description:{type:kt,resolve:e=>e.description},type:{type:new _e(hi),resolve:e=>e.type},defaultValue:{type:kt,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let t=r3(e);return t?Ze(t):null}},isDeprecated:{type:new _e(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:kt,resolve:e=>e.deprecationReason}})}),rO=new Yn({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new _e(kt),resolve:e=>e.name},description:{type:kt,resolve:e=>e.description},isDeprecated:{type:new _e(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:kt,resolve:e=>e.deprecationReason}})}),Mn={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},iO=new mi({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Mn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Mn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Mn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Mn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Mn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Mn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Mn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Mn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),F_=new Cc(void 0,"__schema",{type:new _e(yh),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),j_=new Cc(void 0,"__type",{type:hi,description:"Request the type information of a single type.",args:{name:{type:new _e(kt)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),U_=new Cc(void 0,"__typename",{type:new _e(kt),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),va=Object.freeze([yh,eO,tO,hi,nO,bh,rO,iO]);function oO(e){return va.some(({name:t})=>e.name===t)}var uEe=Symbol("Schema"),vh=class{constructor(t){this.__kind=uEe,this.assumeValid=t.assumeValid??!1,this.__validationErrors=t.assumeValid===!0?[]:void 0,this.description=t.description,this.extensions=dr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=t.directives??mr;let n=new Set(t.types);if(t.types!=null)for(let r of t.types)n.delete(r),Ji(r,n);this._queryType!=null&&Ji(this._queryType,n),this._mutationType!=null&&Ji(this._mutationType,n),this._subscriptionType!=null&&Ji(this._subscriptionType,n);for(let r of this._directives)if(L_(r))for(let i of r.args)Ji(i.type,n);Ji(yh,n),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(let r of n){if(r==null)continue;let i=r.name;if(this._typeMap[i]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${i}".`);if(this._typeMap[i]=r,qe(r)){for(let o of r.getInterfaces())if(qe(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.interfaces.push(r)}}else if(st(r)){for(let o of r.getInterfaces())if(qe(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.objects.push(r)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Jn.QUERY:return this.getQueryType();case Jn.MUTATION:return this.getMutationType();case Jn.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return Qt(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){return this._implementationsMap[t.name]??{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap.get(t);if(r===void 0){if(Qt(t))r=new Set(t.getTypes());else{let i=this.getImplementations(t);r=new Set([...i.objects,...i.interfaces])}this._subTypeMap.set(t,r)}return r.has(n)}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}getField(t,n){switch(n){case F_.name:return this.getQueryType()===t?F_:void 0;case j_.name:return this.getQueryType()===t?j_:void 0;case U_.name:return U_}if("getFields"in t)return t.getFields()[n]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}};function Ji(e,t){let n=wo(e);if(!t.has(n)){if(t.add(n),Qt(n))for(let r of n.getTypes())Ji(r,t);else if(st(n)||qe(n)){for(let r of n.getInterfaces())Ji(r,t);for(let r of Object.values(n.getFields())){Ji(r.type,t);for(let i of r.args)Ji(i.type,t)}}else if(He(n))for(let r of Object.values(n.getFields()))Ji(r.type,t)}return t}function i3(e,t,n,r){if(e.literal){Mc(e.literal,t,n,void 0,void 0,r);return}D_(e.value,t,n,r)}function Ut(e,t,n){return new F(`Syntax Error: ${n}`,{source:e,positions:[t]})}function dEe(){let e;try{let t=globalThis.process;typeof t?.getBuiltinModule=="function"&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}var jc=dEe(),sO=jc?.tracingChannel("graphql:parse"),sXe=jc?.tracingChannel("graphql:validate"),aXe=jc?.tracingChannel("graphql:execute"),cXe=jc?.tracingChannel("graphql:execute:variableCoercion"),lXe=jc?.tracingChannel("graphql:execute:rootSelectionSet"),uXe=jc?.tracingChannel("graphql:subscribe"),dXe=jc?.tracingChannel("graphql:resolve"),pEe=["start","end","asyncStart","asyncEnd","error"];function o3(e){if(e==null)return!1;let t=e.hasSubscribers;if(t!==void 0)return t;for(let n of pEe)if(e[n].hasSubscribers)return!0;return!1}var W={SOF:"",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",DOT:".",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};var kh=class{constructor(t){let n=new gd(W.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==W.EOF)do if(t.next)t=t.next;else{let n=fEe(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===W.COMMENT);return t}};function a3(e){return e===W.BANG||e===W.DOLLAR||e===W.AMP||e===W.PAREN_L||e===W.PAREN_R||e===W.DOT||e===W.SPREAD||e===W.COLON||e===W.EQUALS||e===W.AT||e===W.BRACKET_L||e===W.BRACKET_R||e===W.BRACE_L||e===W.PIPE||e===W.BRACE_R}function _d(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function G_(e,t){return c3(e.charCodeAt(t))&&l3(e.charCodeAt(t+1))}function c3(e){return e>=55296&&e<=56319}function l3(e){return e>=56320&&e<=57343}function Uc(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return W.EOF;if(n>=32&&n<=126){let r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function un(e,t,n,r,i){let o=e.line,s=1+n-e.lineStart;return new gd(t,n,r,o,s,i)}function fEe(e,t){let n=e.source.body,r=n.length,i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function vEe(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Ut(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function wEe(e,t){let n=e.source.body,r=n.length,i=e.lineStart,o=t+3,s=o,a="",c=[];for(;o0||pi(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||pi(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function d3(e){return Ar(e,u3,$d)}function cO(e,t){return o3(sO)?sO.traceSync(()=>p3(e,t),{source:e}):p3(e,t)}function p3(e,t){let n=new aO(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}var aO=class{constructor(t,n={}){let{lexer:r,...i}=n;if(r)this._lexer=r;else{let o=d3(t)?t:new $d(t);this._lexer=new kh(o)}this._options=i,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(W.NAME);return this.node(t,{kind:_.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:_.DOCUMENT,definitions:this.many(W.SOF,this.parseDefinition,W.EOF)})}parseDefinition(){if(this.peek(W.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===W.BRACE_L)throw Ut(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===W.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw Ut(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(W.BRACE_L))return this.node(t,{kind:_.OPERATION_DEFINITION,operation:Jn.QUERY,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});let n=this.parseDescription(),r=this.parseOperationType(),i;return this.peek(W.NAME)&&(i=this.parseName()),this.node(t,{kind:_.OPERATION_DEFINITION,operation:r,description:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(W.NAME);switch(t.value){case"query":return Jn.QUERY;case"mutation":return Jn.MUTATION;case"subscription":return Jn.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(W.PAREN_L,this.parseVariableDefinition,W.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:_.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(W.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(W.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(W.DOLLAR),this.node(t,{kind:_.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:_.SELECTION_SET,selections:this.many(W.BRACE_L,this.parseSelection,W.BRACE_R)})}parseSelection(){return this.peek(W.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),r,i;return this.expectOptionalToken(W.COLON)?(r=n,i=this.parseName()):i=n,this.node(t,{kind:_.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(W.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(W.PAREN_L,n,W.PAREN_R)}parseFragmentArguments(){let t=this.parseFragmentArgument;return this.optionalMany(W.PAREN_L,t,W.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,r=this.parseName();return this.expectToken(W.COLON),this.node(n,{kind:_.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){let t=this._lexer.token,n=this.parseName();return this.expectToken(W.COLON),this.node(t,{kind:_.FRAGMENT_ARGUMENT,name:n,value:this.parseValueLiteral(!1)})}parseFragment(){let t=this._lexer.token;this.expectToken(W.SPREAD);let n=this.expectOptionalKeyword("on");if(!n&&this.peek(W.NAME)){let r=this.parseFragmentName();return this.peek(W.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(t,{kind:_.FRAGMENT_SPREAD,name:r,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(t,{kind:_.FRAGMENT_SPREAD,name:r,directives:this.parseDirectives(!1)})}return this.node(t,{kind:_.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.experimentalFragmentArguments===!0?this.node(t,{kind:_.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:_.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case W.BRACKET_L:return this.parseList(t);case W.BRACE_L:return this.parseObject(t);case W.INT:return this.advanceLexer(),this.node(n,{kind:_.INT,value:n.value});case W.FLOAT:return this.advanceLexer(),this.node(n,{kind:_.FLOAT,value:n.value});case W.STRING:case W.BLOCK_STRING:return this.parseStringLiteral();case W.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:_.BOOLEAN,value:!0});case"false":return this.node(n,{kind:_.BOOLEAN,value:!1});case"null":return this.node(n,{kind:_.NULL});default:return this.node(n,{kind:_.ENUM,value:n.value})}case W.DOLLAR:if(t)if(this.expectToken(W.DOLLAR),this._lexer.token.kind===W.NAME){let r=this._lexer.token.value;throw Ut(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:_.STRING,value:t.value,block:t.kind===W.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:_.LIST,values:this.any(W.BRACKET_L,n,W.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:_.OBJECT,fields:this.any(W.BRACE_L,n,W.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,r=this.parseName();return this.expectToken(W.COLON),this.node(n,{kind:_.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(W.AT);)n.push(this.parseDirective(t));if(n.length)return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(W.AT),this.node(n,{kind:_.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(W.BRACKET_L)){let r=this.parseTypeReference();this.expectToken(W.BRACKET_R),n=this.node(t,{kind:_.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(W.BANG)?this.node(t,{kind:_.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:_.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(W.STRING)||this.peek(W.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let r=this.parseConstDirectives(),i=this.many(W.BRACE_L,this.parseOperationTypeDefinition,W.BRACE_R);return this.node(t,{kind:_.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(W.COLON);let r=this.parseNamedType();return this.node(t,{kind:_.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let r=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:_.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let r=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:_.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:o,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(W.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(W.BRACE_L,this.parseFieldDefinition,W.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(W.COLON);let o=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:_.FIELD_DEFINITION,description:n,name:r,arguments:i,type:o,directives:s})}parseArgumentDefs(){return this.optionalMany(W.PAREN_L,this.parseInputValueDef,W.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(W.COLON);let i=this.parseTypeReference(),o;this.expectOptionalToken(W.EQUALS)&&(o=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(t,{kind:_.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:o,directives:s})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let r=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:_.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:o,fields:s})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:_.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(W.EQUALS)?this.delimitedMany(W.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:_.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:o})}parseEnumValuesDefinition(){return this.optionalMany(W.BRACE_L,this.parseEnumValueDefinition,W.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:_.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Ut(this._lexer.source,this._lexer.token.start,`${B_(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let r=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:_.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(W.BRACE_L,this.parseInputValueDef,W.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===W.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),r=this.optionalMany(W.BRACE_L,this.parseOperationTypeDefinition,W.BRACE_R);if(n===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:_.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),r=this.parseConstDirectives();if(r===void 0)throw this.unexpected();return this.node(t,{kind:_.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(r===void 0&&i===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:_.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(r===void 0&&i===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:_.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r===void 0&&i===void 0)throw this.unexpected();return this.node(t,{kind:_.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r===void 0&&i===void 0)throw this.unexpected();return this.node(t,{kind:_.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r===void 0&&i===void 0)throw this.unexpected();return this.node(t,{kind:_.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(W.AT);let n=this.parseName(),r=this.parseConstDirectives();if(r===void 0)throw this.unexpected();return this.node(t,{kind:_.DIRECTIVE_EXTENSION,name:n,directives:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(W.AT);let r=this.parseName(),i=this.parseArgumentDefs(),o=this.parseConstDirectives(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:_.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,directives:o,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(W.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.hasOwn(ge,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){let t=this._lexer.token,n=this.expectOptionalToken(W.AT),r=this.parseName(),i;!n&&this.expectOptionalToken(W.DOT)&&(i=this.parseName());let o;return(n||i)&&this.expectOptionalToken(W.PAREN_L)&&(o=this.parseName(),this.expectToken(W.COLON),this.expectToken(W.PAREN_R)),n?o?this.node(t,{kind:_.DIRECTIVE_ARGUMENT_COORDINATE,name:r,argumentName:o}):this.node(t,{kind:_.DIRECTIVE_COORDINATE,name:r}):i?o?this.node(t,{kind:_.ARGUMENT_COORDINATE,name:r,fieldName:i,argumentName:o}):this.node(t,{kind:_.MEMBER_COORDINATE,name:r,memberName:i}):this.node(t,{kind:_.TYPE_COORDINATE,name:r})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new rh(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw Ut(this._lexer.source,n.start,`Expected ${f3(t)}, found ${B_(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===W.NAME&&n.value===t)this.advanceLexer();else throw Ut(this._lexer.source,n.start,`Expected "${t}", found ${B_(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===W.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return Ut(this._lexer.source,n.start,`Unexpected ${B_(n)}.`)}any(t,n,r){this.expectToken(t);let i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(t,n,r){if(this.expectOptionalToken(t)){let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}}many(t,n,r){this.expectToken(t);let i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(t,n){this.expectOptionalToken(t);let r=[];do r.push(n.call(this));while(this.expectOptionalToken(t));return r}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==W.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw Ut(this._lexer.source,n.start,`Document contains more than ${t} tokens. Parsing aborted.`)}};function B_(e){let t=e.value;return f3(e.kind)+(t!=null?` "${t}"`:"")}function f3(e){return a3(e)?`"${e}"`:e}function bn(e,t){switch(t.kind){case _.LIST_TYPE:{let n=bn(e,t.type);return n&&new Wt(n)}case _.NON_NULL_TYPE:{let n=bn(e,t.type);return n&&new _e(n)}case _.NAMED_TYPE:return e.getType(t.name.value)}}function m3(e){let t=new Map;return{Directive(n){if(n.name.value===ko.name||n.name.value===_o.name){let i=n.arguments?.find(s=>s.name.value==="label")?.value;if(!i||i.kind===_.NULL)return;if(i.kind!==_.STRING){e.reportError(new F(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));return}let o=t.get(i.value);o!=null?e.reportError(new F('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(i.value,n)}}}}function h3(e){return{OperationDefinition(t){let n=e.getDocument(),r=new Map;for(let s of n.definitions)s.kind===_.FRAGMENT_DEFINITION&&r.set(s.name.value,s);if(t.operation!=="subscription"&&t.operation!=="mutation")return;let o=e.getSchema().getRootType(t.operation);o&&lO({context:e,operationType:t.operation,rootType:o,fragments:r,selectionSet:t.selectionSet,visitedFragments:new Set})}}}function lO({context:e,operationType:t,rootType:n,fragments:r,selectionSet:i,visitedFragments:o}){for(let s of i.selections)if(s.kind==="Field"){let a=s.directives?.find(c=>c.name.value===_o.name);a&&e.reportError(new F(`Stream directive cannot be used on root ${t} type "${n}".`,{nodes:a}))}else if(s.kind==="FragmentSpread"){let a=s.name.value;if(o.has(a))continue;let c=r.get(a);if(c){let l=g3(s);l!==void 0&&e.reportError(new F(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:l})),lO({context:e,operationType:t,rootType:n,fragments:r,selectionSet:c.selectionSet,visitedFragments:o})}o.add(a)}else if(s.kind==="InlineFragment"){let a=g3(s);a!==void 0&&e.reportError(new F(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:a})),lO({context:e,operationType:t,rootType:n,fragments:r,selectionSet:s.selectionSet,visitedFragments:o})}}function g3(e){return e.directives?.find(t=>t.name.value===ko.name)}function y3(e){let t=e.arguments?.find(n=>n.name.value==="if");if(!t)return!1;if(t.value.kind===_.BOOLEAN){if(t.value.value)return!1}else if(t.value.kind!==_.VARIABLE)return!1;return!0}function _Ee(e){let t=e.arguments?.find(n=>n.name.value==="if");return t&&t.value.kind===_.BOOLEAN?!!t.value.value:!0}function $Ee(e){let t=e.arguments?.find(n=>n.name.value==="if");return t?t?.value.kind===_.BOOLEAN?!t.value.value:!0:!1}function b3(e){return{OperationDefinition(t){if(t.operation!==Jn.SUBSCRIPTION)return;let n=e.getDocument(),r=new Map;for(let o of n.definitions)o.kind===_.FRAGMENT_DEFINITION&&r.set(o.name.value,o);let i=new Set;uO({context:e,fragments:r,selectionSet:t.selectionSet,parentNodes:[],visitedFragments:i})}}}function uO({context:e,fragments:t,selectionSet:n,parentNodes:r,visitedFragments:i}){for(let o of n.selections){let s=o.directives?.find(c=>c.name.value===ba.name);if(s&&_Ee(s))continue;let a=o.directives?.find(c=>c.name.value===ya.name);if(!(a&&$Ee(a))){for(let c of o.directives??[])c.name.value===ko.name?y3(c)||e.reportError(new F("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:[c,...r]})):c.name.value===_o.name&&(y3(c)||e.reportError(new F("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:[c,...r]})));if(o.kind==="FragmentSpread"){let c=o.name.value;if(i.has(c))continue;i.add(c);let l=t.get(c);l&&uO({context:e,fragments:t,parentNodes:[o,...r],selectionSet:l?.selectionSet,visitedFragments:i})}else o.selectionSet&&uO({context:e,fragments:t,selectionSet:o.selectionSet,parentNodes:r,visitedFragments:i})}}}function dO(e){return e.kind===_.OPERATION_DEFINITION||e.kind===_.FRAGMENT_DEFINITION}function pO(e){return e.kind===_.SCHEMA_DEFINITION||wa(e)||e.kind===_.DIRECTIVE_DEFINITION}function wa(e){return e.kind===_.SCALAR_TYPE_DEFINITION||e.kind===_.OBJECT_TYPE_DEFINITION||e.kind===_.INTERFACE_TYPE_DEFINITION||e.kind===_.UNION_TYPE_DEFINITION||e.kind===_.ENUM_TYPE_DEFINITION||e.kind===_.INPUT_OBJECT_TYPE_DEFINITION}function fO(e){return e.kind===_.SCHEMA_EXTENSION||e.kind===_.DIRECTIVE_EXTENSION||V_(e)}function V_(e){return e.kind===_.SCALAR_TYPE_EXTENSION||e.kind===_.OBJECT_TYPE_EXTENSION||e.kind===_.INTERFACE_TYPE_EXTENSION||e.kind===_.UNION_TYPE_EXTENSION||e.kind===_.ENUM_TYPE_EXTENSION||e.kind===_.INPUT_OBJECT_TYPE_EXTENSION}function v3(e){return{Document(t){for(let n of t.definitions)if(!dO(n)){let r=n.kind===_.SCHEMA_DEFINITION||n.kind===_.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new F(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function w3(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let i=e.getSchema(),o=t.name.value,s=Zn("to use an inline fragment on",e.hideSuggestions?[]:SEe(i,n,o));s===""&&(s=Zn(e.hideSuggestions?[]:xEe(n,o))),e.reportError(new F(`Cannot query field "${o}" on type "${n}".`+s,{nodes:t}))}}}}function SEe(e,t,n){if(!Wr(t))return[];let r=new Set,i=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]!=null){r.add(o),i[o.name]=1;for(let s of o.getInterfaces())s.getFields()[n]!=null&&(r.add(s),i[s.name]=(i[s.name]??0)+1)}return[...r].sort((o,s)=>{let a=i[s.name]-i[o.name];return a!==0?a:qe(o)&&e.isSubType(o,s)?-1:qe(s)&&e.isSubType(s,o)?1:hd(o.name,s.name)}).map(o=>o.name)}function xEe(e,t){if(st(e)||qe(e)){let n=Object.keys(e.getFields());return ur(t,n)}return[]}function k3(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let r=bn(e.getSchema(),n);if(r&&!ss(r)){let i=Ze(n);e.reportError(new F(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){let n=bn(e.getSchema(),t.typeCondition);if(n&&!ss(n)){let r=Ze(t.typeCondition);e.reportError(new F(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}function _3(e){return{...mO(e),FragmentArgument(t){let n=e.getFragmentSignature();if(n&&!n.variableDefinitions.get(t.name.value)){let i=t.name.value,o=e.hideSuggestions?[]:ur(i,Array.from(n.variableDefinitions.values()).map(s=>s.variable.name.value));e.reportError(new F(`Unknown argument "${i}" on fragment "${n.definition.name.value}".`+Zn(o),{nodes:t}))}},Argument(t){let n=e.getArgument(),r=e.getFieldDef();if(!n&&r){let i=t.name.value,o=e.hideSuggestions?[]:ur(i,r.args.map(s=>s.name));e.reportError(new F(`Unknown argument "${i}" on field "${r}".`+Zn(o),{nodes:t}))}}}}function mO(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():mr;for(let o of r)t.set(o.name,o.args.map(s=>s.name));let i=e.getDocument().definitions;for(let o of i)if(o.kind===_.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,s.map(a=>a.name.value))}return{Directive(o){let s=o.name.value,a=t.get(s);if(o.arguments!=null&&a!=null)for(let c of o.arguments){let l=c.name.value;if(!a.includes(l)){let u=ur(l,a);e.reportError(new F(`Unknown argument "${l}" on directive "@${s}".`+(e.hideSuggestions?"":Zn(u)),{nodes:c}))}}return!1}}}function gO(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():mr;for(let o of r)t.set(o.name,o.locations);let i=e.getDocument().definitions;for(let o of i)o.kind===_.DIRECTIVE_DEFINITION&&t.set(o.name.value,o.locations.map(s=>s.value));return{Directive(o,s,a,c,l){let u=o.name.value,d=t.get(u);if(d==null){e.reportError(new F(`Unknown directive "@${u}".`,{nodes:o}));return}let p=EEe(l);p!=null&&!d.includes(p)&&e.reportError(new F(`Directive "@${u}" may not be used on ${p}.`,{nodes:o}))}}}function EEe(e){let t=e.at(-1);switch(t!=null&&"kind"in t||rt(!1),t.kind){case _.OPERATION_DEFINITION:return TEe(t.operation);case _.FIELD:return ge.FIELD;case _.FRAGMENT_SPREAD:return ge.FRAGMENT_SPREAD;case _.INLINE_FRAGMENT:return ge.INLINE_FRAGMENT;case _.FRAGMENT_DEFINITION:return ge.FRAGMENT_DEFINITION;case _.VARIABLE_DEFINITION:{let n=e[e.length-3];return"kind"in n||rt(!1),n.kind===_.OPERATION_DEFINITION?ge.VARIABLE_DEFINITION:ge.FRAGMENT_VARIABLE_DEFINITION}case _.SCHEMA_DEFINITION:case _.SCHEMA_EXTENSION:return ge.SCHEMA;case _.SCALAR_TYPE_DEFINITION:case _.SCALAR_TYPE_EXTENSION:return ge.SCALAR;case _.OBJECT_TYPE_DEFINITION:case _.OBJECT_TYPE_EXTENSION:return ge.OBJECT;case _.FIELD_DEFINITION:return ge.FIELD_DEFINITION;case _.INTERFACE_TYPE_DEFINITION:case _.INTERFACE_TYPE_EXTENSION:return ge.INTERFACE;case _.UNION_TYPE_DEFINITION:case _.UNION_TYPE_EXTENSION:return ge.UNION;case _.ENUM_TYPE_DEFINITION:case _.ENUM_TYPE_EXTENSION:return ge.ENUM;case _.ENUM_VALUE_DEFINITION:return ge.ENUM_VALUE;case _.INPUT_OBJECT_TYPE_DEFINITION:case _.INPUT_OBJECT_TYPE_EXTENSION:return ge.INPUT_OBJECT;case _.INPUT_VALUE_DEFINITION:{let n=e.at(-3);return n!=null&&"kind"in n||rt(!1),n.kind===_.INPUT_OBJECT_TYPE_DEFINITION||n.kind===_.INPUT_OBJECT_TYPE_EXTENSION?ge.INPUT_FIELD_DEFINITION:ge.ARGUMENT_DEFINITION}case _.DIRECTIVE_DEFINITION:case _.DIRECTIVE_EXTENSION:return ge.DIRECTIVE_DEFINITION;default:rt(!1,"Unexpected kind: "+de(t.kind))}}function TEe(e){switch(e){case Jn.QUERY:return ge.QUERY;case Jn.MUTATION:return ge.MUTATION;case Jn.SUBSCRIPTION:return ge.SUBSCRIPTION}}function $3(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new F(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function S3(e){let t=e.getSchema();return{OperationDefinition(n){let r=n.operation;t.getRootType(r)||e.reportError(new F(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}}function hO(e){let{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(wa).map(i=>i.name.value)]);return{NamedType(i,o,s,a,c){let l=i.name.value;if(!r.has(l)){let u=c[2]??s,d=u!=null&&IEe(u);if(d&&x3.has(l))return;let p=e.hideSuggestions?[]:ur(l,d?[...x3,...r]:[...r]);e.reportError(new F(`Unknown type "${l}".`+Zn(p),{nodes:i}))}}}}var x3=new Set([...ha,...va].map(e=>e.name));function IEe(e){return"kind"in e&&(pO(e)||fO(e))}function E3(e){let t=0;return{Document(n){t=n.definitions.filter(r=>r.kind===_.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new F("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function T3(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),r=0;return{SchemaDefinition(i){if(n){e.reportError(new F("Cannot define a new schema within a schema extension.",{nodes:i}));return}r>0&&e.reportError(new F("Must provide only one schema definition.",{nodes:i})),++r}}}var AEe=3;function I3(e){function t(n,r=Object.create(null),i=0){if(n.kind===_.FRAGMENT_SPREAD){let o=n.name.value;if(r[o]===!0)return!1;let s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===_.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=AEe))return!0;if("selectionSet"in n&&n.selectionSet){for(let o of n.selectionSet.selections)if(t(o,r,i))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new F("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function A3(e){let t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(o){return i(o),!1}};function i(o){if(t.has(o.name.value))return;let s=o.name.value;t.add(s);let a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){r[s]=n.length;for(let c of a){let l=c.name.value,u=r[l];if(n.push(c),u===void 0){let d=e.getFragment(l);d&&i(d)}else{let d=n.slice(u),p=d.slice(0,-1).map(f=>'"'+f.name.value+'"').join(", ");e.reportError(new F(`Cannot spread fragment "${l}" within itself`+(p!==""?` via ${p}.`:"."),{nodes:d}))}n.pop()}r[s]=void 0}}}function R3(e){return{OperationDefinition(t){let n=new Set(t.variableDefinitions?.map(i=>i.variable.name.value)),r=e.getRecursiveVariableUsages(t);for(let{node:i,fragmentVariableDefinition:o}of r){if(o)continue;let s=i.name.value;n.has(s)||e.reportError(new F(t.name?`Variable "$${s}" is not defined by operation "${t.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,t]}))}}}}function P3(e){let t=new Set,n=[];return{OperationDefinition(r){for(let i of e.getRecursivelyReferencedFragments(r))t.add(i.name.value);return!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){for(let r of n){let i=r.name.value;t.has(i)||e.reportError(new F(`Fragment "${i}" is never used.`,{nodes:r}))}}}}}function C3(e){return{FragmentDefinition(t){let n=e.getVariableUsages(t),r=new Set(n.map(({node:o})=>o.name.value)),i=t.variableDefinitions??[];for(let o of i){let s=o.variable.name.value;r.has(s)||e.reportError(new F(`Variable "$${s}" is never used in fragment "${t.name.value}".`,{nodes:o}))}},OperationDefinition(t){let n=e.getRecursiveVariableUsages(t),r=new Set;for(let{node:o,fragmentVariableDefinition:s}of n){let a=o.name.value;s||r.add(a)}let i=t.variableDefinitions??[];for(let o of i){let s=o.variable.name.value;r.has(s)||e.reportError(new F(t.name?`Variable "$${s}" is never used in operation "${t.name.value}".`:`Variable "$${s}" is never used.`,{nodes:o}))}}}}function _h(e){switch(e.kind){case _.OBJECT:return{...e,fields:REe(e.fields)};case _.LIST:return{...e,values:e.values.map(_h)};case _.INT:case _.FLOAT:case _.STRING:case _.BOOLEAN:case _.NULL:case _.ENUM:case _.VARIABLE:return e}}function REe(e){return e.map(t=>({...t,value:_h(t.value)})).sort((t,n)=>hd(t.name.value,n.name.value))}function O3(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+O3(n)).join(" and "):e}function M3(e){let t=new K_,n=new vO,r=new Map;return{SelectionSet(i){let o=PEe(e,r,t,n,e.getParentType(),i);for(let[[s,a],c,l]of o){let u=O3(a);e.reportError(new F(`Fields "${s}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:c.concat(l)}))}}}}function PEe(e,t,n,r,i,o){let s=[],[a,c]=H_(e,t,i,o,void 0);if(NEe(e,s,t,n,r,a),c.length!==0)for(let l=0;l1)for(let c=0;c[o.value,r===void 0?s:$h(s,r)]));return e.every(o=>{let s=o.value;t&&(s=$h(s,t));let a=i.get(o.name.value);return a===void 0?!1:N3(s)===N3(a)})}function $h(e,t){switch(e.kind){case _.VARIABLE:return t.get(e.name.value)??e;case _.LIST:return{...e,values:e.values.map(n=>$h(n,t))};case _.OBJECT:return{...e,fields:e.fields.map(n=>({...n,value:$h(n.value,t)}))};default:return e}}function N3(e){return Ze(_h(e))}function D3(e){return e?.find(t=>t.name.value==="stream")}function DEe(e,t,n,r){let i=D3(e),o=D3(n);if(!(!i&&!o))return i&&o&&kO(i.arguments,t,o.arguments,r)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives"}function yO(e,t){return Ke(e)?Ke(t)?yO(e.ofType,t.ofType):!0:Ke(t)?!0:Te(e)?Te(t)?yO(e.ofType,t.ofType):!0:Te(t)?!0:gi(e)||gi(t)?e!==t:!1}function H_(e,t,n,r,i){let o=t.get(r);if(o)return o;let s=new Map,a=new Map;F3(e,n,r,s,a,i);let c=[s,Array.from(a.values())];return t.set(r,c),c}function bO(e,t,n,r){let i=t.get(n.selectionSet);if(i)return i;let o=bn(e.getSchema(),n.typeCondition);return H_(e,t,o,n.selectionSet,r)}function F3(e,t,n,r,i,o){for(let s of n.selections)switch(s.kind){case _.FIELD:{let a=s.name.value,c;(st(t)||qe(t))&&(c=t.getFields()[a]);let l=s.alias?s.alias.value:a,u=r.get(l);u==null&&(u=[],r.set(l,u)),u.push([t,s,c]);break}case _.FRAGMENT_SPREAD:{let a=OEe(e,s,o);i.set(a.key,a);break}case _.INLINE_FRAGMENT:{let a=s.typeCondition,c=a?bn(e.getSchema(),a):t;F3(e,c,s.selectionSet,r,i,o);break}}}function OEe(e,t,n){let r="",i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(let a of t.arguments)s.set(a.name.value,a.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(let[a,c]of o.variableDefinitions){let l=s.get(a);l&&(r+=a+": "+Ze(_h(l)));let u=s.get(a);u!==void 0?i.set(a,n!==void 0?$h(u,n):u):c.defaultValue&&i.set(a,c.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}function MEe(e,t,n,r){if(e.length>0)return[[t,e.map(([i])=>i)],[n,...e.map(([,i])=>i).flat()],[r,...e.map(([,,i])=>i).flat()]]}var K_=class{constructor(){this._data=new Map}has(t,n,r){let i=this._data.get(t)?.get(n);return i===void 0?!1:r?!0:r===i}add(t,n,r){let i=this._data.get(t);i===void 0?this._data.set(t,new Map([[n,r]])):i.set(n,r)}},vO=class{constructor(){this._orderedPairSet=new K_}has(t,n,r){return ti.name.value));for(let i of n.args)!r.has(i.name)&&fa(i)&&e.reportError(new F(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){let n=e.getFragmentSignature();if(!n)return!1;let r=new Set(t.arguments?.map(i=>i.name.value));for(let[i,o]of n.variableDefinitions)if(!r.has(i)&&G3(o)){let s=bn(e.getSchema(),o.type),a=de(s);e.reportError(new F(`Fragment "${t.name.value}" argument "${i}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function _O(e){let t=new Map,r=e.getSchema()?.getDirectives()??mr;for(let o of r)t.set(o.name,new Map(o.args.filter(fa).map(s=>[s.name,s])));let i=e.getDocument().definitions;for(let o of i)if(o.kind===_.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,new Map(s.filter(G3).map(a=>[a.name.value,a])))}return{Directive:{leave(o){let s=o.name.value,a=t.get(s);if(a!=null){let c=o.arguments??[],l=new Set(c.map(u=>u.name.value));for(let[u,d]of a.entries())if(!l.has(u)){let p=ch(d.type)?de(d.type):Ze(d.type);e.reportError(new F(`Argument "@${s}(${u}:)" of type "${p}" is required, but it was not provided.`,{nodes:o}))}}}}}}function G3(e){return e.type.kind===_.NON_NULL_TYPE&&e.defaultValue==null}function B3(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n)if(gi(wo(n))){if(r){let i=t.name.value,o=de(n);e.reportError(new F(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(r.selections.length===0){let i=t.name.value,o=de(n);e.reportError(new F(`Field "${i}" of type "${o}" must have at least one field selected.`,{nodes:t}))}}else{let i=t.name.value,o=de(n);e.reportError(new F(`Field "${i}" of type "${o}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}function $o(e,t){if(Te(t))return e==null?void 0:$o(e,t.ofType);if(e==null)return null;if(Ke(t)){if(!ns(e)){let i=$o(e,t.ofType);return i===void 0?void 0:[i]}let r=[];for(let i of e){let o=$o(i,t.ofType);if(o===void 0)return;r.push(o)}return r}if(He(t)){if(!Kn(e)||Array.isArray(e))return;let r=Object.create(null),i=t.getFields(),o=0;for(let s of Object.keys(e))if(e[s]!==void 0&&(o++,!Object.hasOwn(i,s)))return;for(let s of Object.values(i)){let a=e[s.name];if(a===void 0){if(Hi(s))return;let c=J_(s);c!==void 0&&(r[s.name]=c)}else{let c=$o(a,s.type);if(c===void 0)return;r[s.name]=c}}if(t.isOneOf){let s=Object.keys(r);if(o!==1||s.length!==1)return;let a=s[0];if(r[a]===null)return}return r}let n=vo(t);try{return n.coerceInputValue(e)}catch{}}function cs(e,t,n,r){if(e.kind===_.VARIABLE){let o=V3(e,n,r);return o==null&&Te(t)?void 0:o}if(Te(t))return e.kind===_.NULL?void 0:cs(e,t.ofType,n,r);if(e.kind===_.NULL)return null;if(Ke(t)){if(e.kind!==_.LIST){let s=cs(e,t.ofType,n,r);return s===void 0?void 0:[s]}let o=[];for(let s of e.values){let a=cs(s,t.ofType,n,r);if(a===void 0)if(s.kind===_.VARIABLE&&V3(s,n,r)==null&&!Te(t.ofType))a=null;else return;o.push(a)}return o}if(He(t)){if(e.kind!==_.OBJECT)return;let o=Object.create(null),s=t.getFields();if(e.fields.some(l=>!Object.hasOwn(s,l.name.value)))return;let c=new Map(e.fields.map(l=>[l.name.value,l]));for(let l of Object.values(s)){let u=c.get(l.name);if(!u||u.value.kind===_.VARIABLE&&zEe(u.value,n,r)){if(Hi(l))return;let d=J_(l);d!==void 0&&(o[l.name]=d)}else{let d=cs(u.value,l.type,n,r);if(d===void 0)return;o[l.name]=d}}if(t.isOneOf){let l=Object.keys(o);if(c.size!==1||l.length!==1)return;for(let[u,d]of c)if(d.value.kind===_.NULL||o[u]===null)return}return o}let i=vo(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(ma(e,n,r)):i.parseLiteral(e,n?.coerced)}catch{}}function V3(e,t,n){let r=e.name.value;return n?.sources[r]!==void 0?n.coerced[r]:t?.coerced[r]}function zEe(e,t,n){let r=e.name.value;return(n?.sources[r]!==void 0?n.coerced:t?.coerced)?.[r]===void 0}function J_(e){let t=e._memoizedCoercedDefaultValue;if(t!==void 0)return t;let n=e.default;if(n!==void 0)return t=n.literal?cs(n.literal,e.type):$o(n.value,e.type),t===void 0&&rt(!1,`Expected value of type "${e.type}" to be valid, found: ${de(n.literal??n.value)}.`),e._memoizedCoercedDefaultValue=t,t;let r=e.defaultValue;return r!==void 0&&(e._memoizedCoercedDefaultValue=r),r}function q3(e,t,n,r,i){try{let o=J_(n);o!==void 0&&(e[t]=o)}catch(o){let s=n.default;if(s===void 0)throw o;let a=!1;i3(s,n.type,(c,l)=>{a=!0,r(c,l)},i),a||r(nh(o),[])}}function W3(e,t,n,r,i){let o=e.arguments??[],s=new Map(o.map(l=>[l.name.value,l])),a=Object.create(null),c=Object.create(null);for(let[l,u]of Object.entries(t)){let d=s.get(l);d!==void 0?a[l]=r==null?{signature:u,value:d.value}:{signature:u,value:d.value,fragmentVariableValues:r}:a[l]={signature:u},H3(c,e,l,u,d,n,r,i)}return{sources:a,coerced:c}}function Z_(e,t,n,r,i){let o=Object.create(null),s=t.arguments??[],a=new Map(s.map(c=>[c.name.value,c]));for(let c of e.args){let l=c.name;H3(o,t,l,c,a.get(c.name),n,r,i)}return o}function H3(e,t,n,r,i,o,s,a){let c=r.type,l=(p,f)=>{throw new F(`${$O(r,t)} has invalid default value${FD(f)}: ${p.message}`,{nodes:t})};if(!i){if(fa(r))throw new F(`${$O(r,t)} of required type "${c}" was not provided.`,{nodes:t});q3(e,n,r,l,a);return}let u=i.value;if(u.kind===_.VARIABLE){let p=u.name.value,f=s?.sources[p]?s:o;if((f==null||!Object.hasOwn(f.coerced,p))&&!fa(r)){q3(e,n,r,l,a);return}}let d=cs(u,c,o,s);d===void 0&&(Mc(u,c,(p,f)=>{throw p.message=`${$O(r,t)} has invalid value${FD(f)}: ${p.message}`,p},o,s,a),rt(!1,"Invalid argument")),e[n]=d}function $O(e,t){return A_(e)?`Argument "${e}"`:`Variable "$${e.name}" defined by fragment "${t.name.value}"`}function Sd(e,t,n,r,i){let o=t.directives?.find(s=>s.name.value===e.name);if(o)return Z_(e,o,n,r,i)}function Z3(e,t,n,r,i,o,s=!1){let a=new Rr,c=[],l={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Map,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return Y_(l,i,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:l.forbiddenDirectiveInstances}}function Y_(e,t,n,r,i,o){let{schema:s,fragments:a,variableValues:c,runtimeType:l,visitedFragmentNames:u,hideSuggestions:d}=e;for(let p of t.selections)switch(p.kind){case _.FIELD:{if(!SO(e,p,c,o))continue;n.add(GEe(p),{node:p,deferUsage:i,fragmentVariableValues:o});break}case _.INLINE_FRAGMENT:{if(!SO(e,p,c,o)||!J3(s,p,l))continue;let f=K3(c,o,p,i);f?(r.push(f),Y_(e,p.selectionSet,n,r,f,o)):Y_(e,p.selectionSet,n,r,i,o);break}case _.FRAGMENT_SPREAD:{let f=p.name.value;if(!SO(e,p,c,o))continue;let m=a[f];if(m==null||!J3(s,m.definition,l))continue;let g=K3(c,o,p,i),h=u.get(f),v;if(g){if(h!==void 0)continue;u.set(f,!0),r.push(g),v=g}else{if(h===!1)continue;u.set(f,!1),v=i}let b=m.variableSignatures,w;b&&(w=W3(p,b,c,o,d)),Y_(e,m.definition.selectionSet,n,r,v,w);break}}}function K3(e,t,n,r){let i=Sd(ko,n,e,t);if(i&&i.if!==!1)return{label:typeof i.label=="string"?i.label:void 0,parentDeferUsage:r}}function SO(e,t,n,r){let i=t.directives?.find(c=>c.name.value===ba.name);if(i&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(i),!1;if((i?Z_(ba,i,n,r,e.hideSuggestions):void 0)?.if===!0)return!1;let s=t.directives?.find(c=>c.name.value===ya.name);return s&&e.forbidSkipAndInclude?(e.forbiddenDirectiveInstances.push(s),!1):(s?Z_(ya,s,n,r,e.hideSuggestions):void 0)?.if!==!1}function J3(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=bn(e,r);return i===n?!0:Wr(i)?e.isSubType(i,n):!1}function GEe(e){return e.alias?e.alias.value:e.name.value}function xO(e){return e.map(t=>t.node)}function Y3(e){return{OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(let u of s.definitions)u.kind===_.FRAGMENT_DEFINITION&&(a[u.name.value]={definition:u});let{groupedFieldSet:c,forbiddenDirectiveInstances:l}=Z3(n,a,o,r,t.selectionSet,e.hideSuggestions,!0);if(l.length>0){e.reportError(new F(i!=null?`Subscription "${i}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:l}));return}if(c.size>1){let p=[...c.values()].slice(1).flatMap(f=>xO(f));e.reportError(new F(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:p}))}for(let u of c.values())xO(u)[0].name.value.startsWith("__")&&e.reportError(new F(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:xO(u)}))}}}}}function Q3(e){return{Directive(t){let n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===_o.name&&!(Ke(n.type)||Wi(n.type)&&Ke(n.type.ofType))&&e.reportError(new F(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}}function xd(e,t){let n=new Rr;for(let r of e)n.add(t(r),r);return n}function X3(e){return{DirectiveDefinition(r){let i=r.arguments??[];return n(`@${r.name.value}`,i)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){let i=r.name.value,o=r.fields??[];for(let s of o){let a=s.name.value,c=s.arguments??[];n(`${i}.${a}`,c)}return!1}function n(r,i){let o=xd(i,s=>s.name.value);for(let[s,a]of o)a.length>1&&e.reportError(new F(`Argument "${r}(${s}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}function EO(e){return{Field:t,Directive:t};function t(n){let r=n.arguments??[],i=xd(r,o=>o.name.value);for(let[o,s]of i)s.length>1&&e.reportError(new F(`There can be only one argument named "${o}".`,{nodes:s.map(a=>a.name)}))}}function e8(e){let t=new Map,n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n?.getDirective(i)){e.reportError(new F(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}let o=t.get(i);return o?e.reportError(new F(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}}function TO(e){let t=new Map,n=e.getSchema(),r=n?n.getDirectives():mr;for(let c of r)t.set(c.name,!c.isRepeatable);let i=e.getDocument().definitions;for(let c of i)c.kind===_.DIRECTIVE_DEFINITION&&t.set(c.name.value,!c.repeatable);let o=new Map,s=new Map,a=new Map;return{enter(c){if(!("directives"in c)||!c.directives)return;let l;if(c.kind===_.SCHEMA_DEFINITION||c.kind===_.SCHEMA_EXTENSION)l=o;else if(wa(c)||V_(c)){let u=c.name.value;l=s.get(u),l===void 0&&(l=new Map,s.set(u,l))}else if(c.kind===_.DIRECTIVE_DEFINITION||c.kind===_.DIRECTIVE_EXTENSION){let u=c.name.value;l=a.get(u),l===void 0&&(l=new Map,a.set(u,l))}else l=new Map;for(let u of c.directives){let d=u.name.value;if(t.get(d)===!0){let p=l.get(d);p!=null?e.reportError(new F(`The directive "@${d}" can only be used once at this location.`,{nodes:[p,u]})):l.set(d,u)}}}}}function t8(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(o){let s=o.name.value,a=r.get(s);a==null&&(a=new Map,r.set(s,a));let c=o.values??[];for(let l of c){let u=l.name.value,d=n[s];if(Xt(d)&&d.getValue(u)){e.reportError(new F(`Enum value "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let p=a.get(u);p!=null?e.reportError(new F(`Enum value "${s}.${u}" can only be defined once.`,{nodes:[p,l.name]})):a.set(u,l.name)}return!1}}function n8(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(o){let s=o.name.value,a=r.get(s);a==null&&(a=new Map,r.set(s,a));let c=o.fields??[];for(let l of c){let u=l.name.value;if(BEe(n[s],u)){e.reportError(new F(`Field "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let d=a.get(u);d!=null?e.reportError(new F(`Field "${s}.${u}" can only be defined once.`,{nodes:[d,l.name]})):a.set(u,l.name)}return!1}}function BEe(e,t){return st(e)||qe(e)||He(e)?e.getFields()[t]!=null:!1}function r8(e){let t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value,i=t.get(r);return i!=null?e.reportError(new F(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}}function IO(e){let t=[],n=new Map;return{ObjectValue:{enter(){t.push(n),n=new Map},leave(){let r=t.pop();r==null&&rt(!1),n=r}},ObjectField(r){let i=r.name.value,o=n.get(i);o!=null?e.reportError(new F(`There can be only one input field named "${i}".`,{nodes:[o,r.name]})):n.set(i,r.name)}}}function i8(e){let t=new Map;return{OperationDefinition(n){let r=n.name;if(r!=null){let i=t.get(r.value);i!=null?e.reportError(new F(`There can be only one operation named "${r.value}".`,{nodes:[i,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}}function o8(e){let t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(o){let s=o.operationTypes??[];for(let a of s){let c=a.operation,l=n.get(c);r[c]?e.reportError(new F(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:a})):l?e.reportError(new F(`There can be only one ${c} type in schema.`,{nodes:[l,a]})):n.set(c,a)}return!1}}function s8(e){let t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){let o=i.name.value;if(n?.getType(o)){e.reportError(new F(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}let s=t.get(o);return s!=null?e.reportError(new F(`There can be only one type named "${o}".`,{nodes:[s,i.name]})):t.set(o,i.name),!1}}function a8(e){return{OperationDefinition(t){let n=t.variableDefinitions??[],r=xd(n,i=>i.variable.name.value);for(let[i,o]of r)o.length>1&&e.reportError(new F(`There can be only one variable named "$${i}".`,{nodes:o.map(s=>s.variable.name)}))}}}function c8(e){return{NullValue:t=>ka(e,t,e.getInputType()),ListValue:t=>ka(e,t,e.getParentInputType()),ObjectValue:t=>ka(e,t,e.getInputType()),EnumValue:t=>ka(e,t,e.getInputType()),IntValue:t=>ka(e,t,e.getInputType()),FloatValue:t=>ka(e,t,e.getInputType()),StringValue:t=>ka(e,t,e.getInputType()),BooleanValue:t=>ka(e,t,e.getInputType())}}function ka(e,t,n){return n&&Mc(t,n,r=>{e.reportError(r)},void 0,void 0,e.hideSuggestions),!1}function l8(e){return{VariableDefinition(t){let n=bn(e.getSchema(),t.type);if(n!==void 0&&!lh(n)){let r=t.variable.name.value,i=Ze(t.type);e.reportError(new F(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}function u8(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i,type:o,parentType:s,defaultValue:a,fragmentVariableDefinition:c}of r){let l=i.name.value,u=c;if(u??=t.get(l),u&&o){let d=e.getSchema(),p=bn(d,u.type);p&&!VEe(d,p,u.defaultValue,o,a)&&e.reportError(new F(`Variable "$${l}" of type "${p}" used in position expecting type "${o}".`,{nodes:[u,i]})),He(s)&&s.isOneOf&&R_(p)&&e.reportError(new F(`Variable "$${l}" is of type "${p}" but must be non-nullable to be used for OneOf Input Object "${s}".`,{nodes:[u,i]}))}}}},VariableDefinition(n){t.set(n.variable.name.value,n)}}}function VEe(e,t,n,r,i){if(Te(r)&&!Te(t)){if(!(n!=null&&n.kind!==_.NULL)&&!(i!==void 0))return!1;let a=r.ofType;return Nc(e,t,a)}return Nc(e,t,r)}var qEe=Object.freeze([I3]),WEe=Object.freeze([v3,S3,i8,E3,Y3,hO,k3,l8,B3,w3,r8,$3,P3,j3,A3,a8,R3,C3,gO,TO,h3,b3,m3,Q3,_3,EO,c8,z3,u8,M3,IO,...qEe]),d8=Object.freeze([T3,o8,s8,t8,n8,X3,e8,hO,gO,TO,U3,mO,EO,IO,_O]);var AO=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let r of this.getDocument().definitions)r.kind===_.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let r=[t],i;for(;i=r.pop();)for(let o of i.selections)o.kind===_.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&r.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let r=new Set,i=[t.selectionSet],o;for(;o=i.pop();)for(let s of this.getFragmentSpreads(o)){let a=s.name.value;if(!r.has(a)){r.add(a);let c=this.getFragment(a);c&&(n.push(c),i.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}},Q_=class extends AO{constructor(t,n,r){super(t,r),this._schema=n}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};var art=pa(ih,e=>e.filter(t=>t!=="description")),crt=new F("Too many validation errors, error limit reached. Validation aborted.");function HEe(e,t,n=d8){let r=[],i=new Q_(e,t,s=>{r.push(s)}),o=n.map(s=>s(i));return bd(e,BD(o)),r}function p8(e){let t=HEe(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` -`))}var dn={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function kZ(e,t){let n=t({getNamedType:c,setNamedType:l,getNamedTypes:u}),i=new Map;for(let x of e.types){let E=x.name,T=d(x);T&&i.set(E,T)}let r=[];for(let x of e.directives){if(Jc(x)){r.push(x);continue}let E=S(x.toConfig());E&&r.push(new Tn(E))}let o={...e,query:e.query&&c(e.query.name),mutation:e.mutation&&c(e.mutation.name),subscription:e.subscription&&c(e.subscription.name),types:Array.from(i.values()),directives:r},s=n[dn.SCHEMA];return s==null?o:s(o);function a(x){return Ke(x)?new qt(a(x.ofType)):_e(x)?new ve(a(x.ofType)):c(x.name)}function c(x){let E=mxe.get(x)??i.get(x);return E===void 0&&it(!1,`Unknown type: "${x}".`),E}function l(x){i.set(x.name,x)}function u(){return Array.from(i.values())}function d(x){if(cD(x)||tD(x))return x;if(pr(x))return p(x);if(at(x))return f(x);if(Be(x))return h(x);if(Qt(x))return b(x);if(Xt(x))return y(x);if(He(x))return k(x);it(!1,"Unexpected type: "+ce(x))}function p(x){let E=x.toConfig(),T=n[dn.SCALAR];return E=T==null?E:T(E),new dr(E)}function f(x){let E=x.toConfig(),T={...E,interfaces:()=>E.interfaces.map(L=>c(L.name)),fields:()=>m(E.fields,x.name)},A=n[dn.OBJECT];return T=A==null?T:A(T),new Yn(T)}function m(x,E){let T=Object.create(null);for(let[A,L]of Object.entries(x)){let F={...L,type:a(L.type),args:g(L.args,A,E)},K=n[dn.FIELD];K&&(F=K(F,E)),T[A]=F}return T}function g(x,E,T){let A=Object.create(null);for(let[L,F]of Object.entries(x)){let K={...F,type:a(F.type)},te=n[dn.ARGUMENT];te&&(K=te(K,E,T)),A[L]=K}return A}function h(x){let E=x.toConfig(),T={...E,interfaces:()=>E.interfaces.map(L=>c(L.name)),fields:()=>m(E.fields,x.name)},A=n[dn.INTERFACE];return T=A==null?T:A(T),new ns(T)}function b(x){let E=x.toConfig(),T={...E,types:()=>E.types.map(L=>c(L.name))},A=n[dn.UNION];return T=A==null?T:A(T),new rs(T)}function y(x){let E=x.toConfig(),T={...E,values:()=>{let L=Object.create(null);for(let[F,K]of Object.entries(E.values)){let te=w(K,F,x.name);L[F]=te}return L}},A=n[dn.ENUM];return T=A==null?T:A(T),new gi(T)}function w(x,E,T){let A={...x},L=n[dn.ENUM_VALUE];return L==null?A:L(A,E,T)}function k(x){let E=x.toConfig(),T={...E,fields:()=>{let L=Object.create(null);for(let[F,K]of Object.entries(E.fields)){let te=_(K,F,x.name);L[F]=te}return L}},A=n[dn.INPUT_OBJECT];return T=A==null?T:A(T),new is(T)}function _(x,E,T){let A={...x,type:a(x.type)},L=n[dn.INPUT_FIELD];return L==null?A:L(A,E,T)}function S(x){let E={...x,args:g(x.args,x.name,void 0)},T=n[dn.DIRECTIVE];return T==null?E:T(E)}}var mxe=new Map([...va,...$a].map(e=>[e.name,e]));function $Z(e,t,n){let i=[],r=new Cr,o=new Cr,s=new Cr,a=new Cr,c=new Cr,l=new Cr,u=new Cr,d=[],p,f=[],m=!1;for(let g of t.definitions){switch(g.kind){case $.SCHEMA_DEFINITION:p=g;break;case $.SCHEMA_EXTENSION:f.push(g);break;case $.DIRECTIVE_DEFINITION:d.push(g);break;case $.DIRECTIVE_EXTENSION:u.add(g.name.value,g);break;case $.SCALAR_TYPE_DEFINITION:case $.OBJECT_TYPE_DEFINITION:case $.INTERFACE_TYPE_DEFINITION:case $.UNION_TYPE_DEFINITION:case $.ENUM_TYPE_DEFINITION:case $.INPUT_OBJECT_TYPE_DEFINITION:i.push(g);break;case $.SCALAR_TYPE_EXTENSION:r.add(g.name.value,g);break;case $.OBJECT_TYPE_EXTENSION:o.add(g.name.value,g);break;case $.INTERFACE_TYPE_EXTENSION:s.add(g.name.value,g);break;case $.UNION_TYPE_EXTENSION:a.add(g.name.value,g);break;case $.ENUM_TYPE_EXTENSION:c.add(g.name.value,g);break;case $.INPUT_OBJECT_TYPE_EXTENSION:l.add(g.name.value,g);break;default:continue}m=!0}return m?kZ(e,g=>{let{getNamedType:h,setNamedType:b,getNamedTypes:y}=g;return{[dn.SCHEMA]:D=>{for(let re of i){let ie=gxe.get(re.name.value)??te(re);b(ie)}let X={query:D.query&&h(D.query.name),mutation:D.mutation&&h(D.mutation.name),subscription:D.subscription&&h(D.subscription.name),...p&&w([p]),...w(f)};return{description:p?.description?.value??D.description,...X,types:y(),directives:[...D.directives.map(x),...d.map(S)],extensions:D.extensions,astNode:p??D.astNode,extensionASTNodes:D.extensionASTNodes.concat(f),assumeValid:n?.assumeValid??!1}},[dn.INPUT_OBJECT]:D=>{let X=l.get(D.name)??[];return{...D,fields:()=>({...D.fields(),...A(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.ENUM]:D=>{let X=c.get(D.name)??[];return{...D,values:()=>({...D.values(),...L(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.SCALAR]:D=>{let X=r.get(D.name)??[],re=D.specifiedByURL;for(let ie of X)re=PD(ie)??re;return{...D,specifiedByURL:re,extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.OBJECT]:D=>{let X=o.get(D.name)??[];return{...D,interfaces:()=>[...D.interfaces(),...F(X)],fields:()=>({...D.fields(),...E(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.INTERFACE]:D=>{let X=s.get(D.name)??[];return{...D,interfaces:()=>[...D.interfaces(),...F(X)],fields:()=>({...D.fields(),...E(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.UNION]:D=>{let X=a.get(D.name)??[];return{...D,types:()=>[...D.types(),...K(X)],extensionASTNodes:D.extensionASTNodes.concat(X)}}};function w(D){let X={};for(let re of D){let ie=re.operationTypes??[];for(let ke of ie)X[ke.operation]=k(ke.type)}return X}function k(D){let X=D.name.value,re=h(X);return re===void 0&&it(!1,`Unknown type: "${X}".`),re}function _(D){return D.kind===$.LIST_TYPE?new qt(_(D.type)):D.kind===$.NON_NULL_TYPE?new ve(_(D.type)):k(D)}function S(D){let X=u.get(D.name.value)??[],re=Xc(D)??X.map(ie=>Xc(ie)).find(ie=>ie!=null);return new Tn({name:D.name.value,description:D.description?.value,locations:D.locations.map(({value:ie})=>ie),isRepeatable:D.repeatable,args:T(D.arguments),deprecationReason:re,astNode:D,extensionASTNodes:X})}function x(D){let X=u.get(D.name)??[];if(X.length===0)return D;let re=D.deprecationReason??X.map(ie=>Xc(ie)).find(ie=>ie!=null);return new Tn({...D.toConfig(),deprecationReason:re,extensionASTNodes:D.extensionASTNodes.concat(X)})}function E(D){let X=Object.create(null);for(let re of D){let ie=re.fields??[];for(let ke of ie)X[ke.name.value]={type:_(ke.type),description:ke.description?.value,args:T(ke.arguments),deprecationReason:Xc(ke),astNode:ke}}return X}function T(D){let X=D??[],re=Object.create(null);for(let ie of X){let ke=_(ie.type);re[ie.name.value]={type:ke,description:ie.description?.value,default:ie.defaultValue&&{literal:ie.defaultValue},deprecationReason:Xc(ie),astNode:ie}}return re}function A(D){let X=Object.create(null);for(let re of D){let ie=re.fields??[];for(let ke of ie){let We=_(ke.type);X[ke.name.value]={type:We,description:ke.description?.value,default:ke.defaultValue&&{literal:ke.defaultValue},deprecationReason:Xc(ke),astNode:ke}}}return X}function L(D){let X=Object.create(null);for(let re of D){let ie=re.values??[];for(let ke of ie)X[ke.name.value]={description:ke.description?.value,deprecationReason:Xc(ke),astNode:ke}}return X}function F(D){return D.flatMap(X=>X.interfaces?.map(k)??[])}function K(D){return D.flatMap(X=>X.types?.map(k)??[])}function te(D){let X=D.name.value;switch(D.kind){case $.OBJECT_TYPE_DEFINITION:{let re=o.get(X)??[],ie=[D,...re];return new Yn({name:X,description:D.description?.value,interfaces:()=>F(ie),fields:()=>E(ie),astNode:D,extensionASTNodes:re})}case $.INTERFACE_TYPE_DEFINITION:{let re=s.get(X)??[],ie=[D,...re];return new ns({name:X,description:D.description?.value,interfaces:()=>F(ie),fields:()=>E(ie),astNode:D,extensionASTNodes:re})}case $.ENUM_TYPE_DEFINITION:{let re=c.get(X)??[],ie=[D,...re];return new gi({name:X,description:D.description?.value,values:()=>L(ie),astNode:D,extensionASTNodes:re})}case $.UNION_TYPE_DEFINITION:{let re=a.get(X)??[],ie=[D,...re];return new rs({name:X,description:D.description?.value,types:()=>K(ie),astNode:D,extensionASTNodes:re})}case $.SCALAR_TYPE_DEFINITION:{let re=r.get(X)??[],ie=PD(D);for(let ke of re)ie=PD(ke)??ie;return new dr({name:X,description:D.description?.value,specifiedByURL:ie,astNode:D,extensionASTNodes:re})}case $.INPUT_OBJECT_TYPE_DEFINITION:{let re=l.get(X)??[],ie=[D,...re];return new is({name:X,description:D.description?.value,fields:()=>A(ie),astNode:D,extensionASTNodes:re,isOneOf:hxe(D)})}}}}):e}var gxe=new Map([...va,...$a].map(e=>[e.name,e]));function Xc(e){return Gd(Jr,e)?.reason}function PD(e){return Gd(Qg,e)?.url}function hxe(e){return!!Gd(Xg,e)}function DD(e,t){t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&wZ(e);let i=$Z({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(i.astNode==null)for(let o of i.types)switch(o.name){case"Query":i.query=o;break;case"Mutation":i.mutation=o;break;case"Subscription":i.subscription=o;break}let r=[...i.directives,...fr.filter(o=>i.directives.every(s=>s.name!==o.name))];return new nh({...i,directives:r})}function ah(e,t){let n=dD(e,{noLocation:t?.noLocation,experimentalFragmentArguments:t?.experimentalFragmentArguments});return DD(n,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}function xa(e,t,n){if(e){if(e.kind===$.VARIABLE){let i=e.name.value;if(n==null||!Object.hasOwn(n,i))return;let r=n[i];return r===void 0||r===null&&_e(t)?void 0:r}if(_e(t))return e.kind===$.NULL?void 0:xa(e,t.ofType,n);if(e.kind===$.NULL)return null;if(Ke(t)){let i=t.ofType;if(e.kind===$.LIST){let o=[];for(let s of e.values)if(_Z(s,n)){if(_e(i))return;o.push(null)}else{let a=xa(s,i,n);if(a===void 0)return;o.push(a)}return o}let r=xa(e,i,n);return r===void 0?void 0:[r]}if(He(t)){if(e.kind!==$.OBJECT)return;let i=Object.create(null),r=t.getFields();if(e.fields.some(a=>!Object.hasOwn(r,a.name.value)))return;let s=new Map(e.fields.map(a=>[a.name.value,a]));for(let a of Object.values(r)){let c=s.get(a.name);if(c==null||_Z(c.value,n)){if(a.defaultValue!==void 0)i[a.name]=a.defaultValue;else if(_e(a.type))return;continue}let l=xa(c.value,a.type,n);if(l===void 0)return;i[a.name]=l}if(t.isOneOf){let a=Object.keys(i);if(s.size!==1||a.length!==1)return;for(let[c,l]of s)if(l.value.kind===$.NULL||i[c]===null)return}return i}if(hi(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}it(!1,"Unexpected input type: "+ce(t))}}function _Z(e,t){return e.kind===$.VARIABLE&&(t?.[e.name.value]===void 0||!Object.hasOwn(t,e.name.value))}function cs(e){return"isDeprecated"in e?!!e.isDeprecated:!!(e.deprecationReason!=null||e.astNode?.directives?.some(t=>t.name.value==="deprecated"))}function Zr(e){return e.default!==void 0?e.default.literal!==void 0?xa(e.default.literal,e.type):So(e.default.value,e.type):e.defaultValue}function Bd(e){return e.default!==void 0||e.defaultValue!==void 0}function qd(e,t){return OD(e==null?void 0:Zr(e),Zr(t))}function OD(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,i)=>OD(n,t[i]));if(e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"){let n=e,i=t,r=Object.keys(n),o=Object.keys(i);return r.length===o.length&&r.every(s=>Object.prototype.hasOwnProperty.call(i,s)&&OD(n[s],i[s]))}return!1}function ch(e,t){if(!Bi(e)&&!Bi(t))return e.toString()===t.toString();if(_e(t)){let n=_e(e)?e.ofType:e;return ch(n,t.ofType)}return Ke(e)?Ke(t)&&ch(e.ofType,t.ofType)||_e(t)&&ch(e,t.ofType):!1}function Ea(e,t){if(!Bi(e)&&!Bi(t))return e?.toString()===t.toString();if(Ke(e)&&Ke(t))return Ea(e.ofType,t.ofType);if(_e(e)){let n=_e(t)?t.ofType:t;return Ea(e.ofType,n)}return!1}function lh(e){return e.astNode?.kind||""}function MD(e){return["String","Int","Float","Boolean","ID"].includes(typeof e=="string"?e:e.name)}function LD(e){return["__Schema","__Type","__TypeKind","__Field","__InputValue","__EnumValue","__Directive","__DirectiveLocation"].includes(typeof e=="string"?e:e.name)}var W;(function(e){e.Breaking="BREAKING",e.NonBreaking="NON_BREAKING",e.Dangerous="DANGEROUS"})(W||(W={}));var P={FieldArgumentDescriptionChanged:"FIELD_ARGUMENT_DESCRIPTION_CHANGED",FieldArgumentDefaultChanged:"FIELD_ARGUMENT_DEFAULT_CHANGED",FieldArgumentTypeChanged:"FIELD_ARGUMENT_TYPE_CHANGED",DirectiveRemoved:"DIRECTIVE_REMOVED",DirectiveAdded:"DIRECTIVE_ADDED",DirectiveDescriptionChanged:"DIRECTIVE_DESCRIPTION_CHANGED",DirectiveLocationAdded:"DIRECTIVE_LOCATION_ADDED",DirectiveLocationRemoved:"DIRECTIVE_LOCATION_REMOVED",DirectiveArgumentAdded:"DIRECTIVE_ARGUMENT_ADDED",DirectiveArgumentRemoved:"DIRECTIVE_ARGUMENT_REMOVED",DirectiveArgumentDescriptionChanged:"DIRECTIVE_ARGUMENT_DESCRIPTION_CHANGED",DirectiveArgumentDefaultValueChanged:"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED",DirectiveArgumentTypeChanged:"DIRECTIVE_ARGUMENT_TYPE_CHANGED",DirectiveRepeatableAdded:"DIRECTIVE_REPEATABLE_ADDED",DirectiveRepeatableRemoved:"DIRECTIVE_REPEATABLE_REMOVED",EnumValueRemoved:"ENUM_VALUE_REMOVED",EnumValueAdded:"ENUM_VALUE_ADDED",EnumValueDescriptionChanged:"ENUM_VALUE_DESCRIPTION_CHANGED",EnumValueDeprecationReasonChanged:"ENUM_VALUE_DEPRECATION_REASON_CHANGED",EnumValueDeprecationReasonAdded:"ENUM_VALUE_DEPRECATION_REASON_ADDED",EnumValueDeprecationReasonRemoved:"ENUM_VALUE_DEPRECATION_REASON_REMOVED",FieldRemoved:"FIELD_REMOVED",FieldAdded:"FIELD_ADDED",FieldDescriptionChanged:"FIELD_DESCRIPTION_CHANGED",FieldDescriptionAdded:"FIELD_DESCRIPTION_ADDED",FieldDescriptionRemoved:"FIELD_DESCRIPTION_REMOVED",FieldDeprecationAdded:"FIELD_DEPRECATION_ADDED",FieldDeprecationRemoved:"FIELD_DEPRECATION_REMOVED",FieldDeprecationReasonChanged:"FIELD_DEPRECATION_REASON_CHANGED",FieldDeprecationReasonAdded:"FIELD_DEPRECATION_REASON_ADDED",FieldDeprecationReasonRemoved:"FIELD_DEPRECATION_REASON_REMOVED",FieldTypeChanged:"FIELD_TYPE_CHANGED",FieldArgumentAdded:"FIELD_ARGUMENT_ADDED",FieldArgumentRemoved:"FIELD_ARGUMENT_REMOVED",InputFieldRemoved:"INPUT_FIELD_REMOVED",InputFieldAdded:"INPUT_FIELD_ADDED",InputFieldDescriptionAdded:"INPUT_FIELD_DESCRIPTION_ADDED",InputFieldDescriptionRemoved:"INPUT_FIELD_DESCRIPTION_REMOVED",InputFieldDescriptionChanged:"INPUT_FIELD_DESCRIPTION_CHANGED",InputFieldDefaultValueChanged:"INPUT_FIELD_DEFAULT_VALUE_CHANGED",InputFieldTypeChanged:"INPUT_FIELD_TYPE_CHANGED",ObjectTypeInterfaceAdded:"OBJECT_TYPE_INTERFACE_ADDED",ObjectTypeInterfaceRemoved:"OBJECT_TYPE_INTERFACE_REMOVED",SchemaQueryTypeChanged:"SCHEMA_QUERY_TYPE_CHANGED",SchemaMutationTypeChanged:"SCHEMA_MUTATION_TYPE_CHANGED",SchemaSubscriptionTypeChanged:"SCHEMA_SUBSCRIPTION_TYPE_CHANGED",TypeRemoved:"TYPE_REMOVED",TypeAdded:"TYPE_ADDED",TypeKindChanged:"TYPE_KIND_CHANGED",TypeDescriptionChanged:"TYPE_DESCRIPTION_CHANGED",TypeDescriptionRemoved:"TYPE_DESCRIPTION_REMOVED",TypeDescriptionAdded:"TYPE_DESCRIPTION_ADDED",UnionMemberRemoved:"UNION_MEMBER_REMOVED",UnionMemberAdded:"UNION_MEMBER_ADDED",DirectiveUsageUnionMemberAdded:"DIRECTIVE_USAGE_UNION_MEMBER_ADDED",DirectiveUsageUnionMemberRemoved:"DIRECTIVE_USAGE_UNION_MEMBER_REMOVED",DirectiveUsageEnumAdded:"DIRECTIVE_USAGE_ENUM_ADDED",DirectiveUsageEnumRemoved:"DIRECTIVE_USAGE_ENUM_REMOVED",DirectiveUsageEnumValueAdded:"DIRECTIVE_USAGE_ENUM_VALUE_ADDED",DirectiveUsageEnumValueRemoved:"DIRECTIVE_USAGE_ENUM_VALUE_REMOVED",DirectiveUsageInputObjectAdded:"DIRECTIVE_USAGE_INPUT_OBJECT_ADDED",DirectiveUsageInputObjectRemoved:"DIRECTIVE_USAGE_INPUT_OBJECT_REMOVED",DirectiveUsageFieldAdded:"DIRECTIVE_USAGE_FIELD_ADDED",DirectiveUsageFieldRemoved:"DIRECTIVE_USAGE_FIELD_REMOVED",DirectiveUsageScalarAdded:"DIRECTIVE_USAGE_SCALAR_ADDED",DirectiveUsageScalarRemoved:"DIRECTIVE_USAGE_SCALAR_REMOVED",DirectiveUsageObjectAdded:"DIRECTIVE_USAGE_OBJECT_ADDED",DirectiveUsageObjectRemoved:"DIRECTIVE_USAGE_OBJECT_REMOVED",DirectiveUsageInterfaceAdded:"DIRECTIVE_USAGE_INTERFACE_ADDED",DirectiveUsageInterfaceRemoved:"DIRECTIVE_USAGE_INTERFACE_REMOVED",DirectiveUsageArgumentDefinitionAdded:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_ADDED",DirectiveUsageArgumentDefinitionRemoved:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_REMOVED",DirectiveUsageSchemaAdded:"DIRECTIVE_USAGE_SCHEMA_ADDED",DirectiveUsageSchemaRemoved:"DIRECTIVE_USAGE_SCHEMA_REMOVED",DirectiveUsageFieldDefinitionAdded:"DIRECTIVE_USAGE_FIELD_DEFINITION_ADDED",DirectiveUsageFieldDefinitionRemoved:"DIRECTIVE_USAGE_FIELD_DEFINITION_REMOVED",DirectiveUsageInputFieldDefinitionAdded:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_ADDED",DirectiveUsageInputFieldDefinitionRemoved:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_REMOVED",DirectiveUsageArgumentAdded:"DIRECTIVE_USAGE_ARGUMENT_ADDED",DirectiveUsageArgumentRemoved:"DIRECTIVE_USAGE_ARGUMENT_REMOVED"};function SZ(e,t){return e.reduce((n,i)=>(n[t(i)]=i,n),Object.create(null))}function C$(e,t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n"u"||e===null}function FD(e,t){return e.filter(n=>!t.some(i=>C$(i,n)))}function bi(e){return typeof e=="string"?e:e.value}function en(e,t,n){let i=SZ(e,({name:c})=>bi(c)),r=SZ(t,({name:c})=>bi(c)),o=[],s=[],a=[];for(let c of e){let l=r[bi(c.name)]??null;l===null?s.push(c):a.push({newVersion:l,oldVersion:c??null})}for(let c of t)i[bi(c.name)]===void 0&&o.push(c);if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function tn(e,t,n){let i=xZ(e,({name:c})=>bi(c)),r=xZ(t,({name:c})=>bi(c)),o=[],s=[],a=[];for(let c of e){let l=r[bi(c.name)]??null;if(l===null)s.push(c);else{let[u,...d]=l;d.length>0?r[bi(c.name)]=d:delete r[bi(c.name)],a.push({newVersion:u,oldVersion:c??null})}}for(let c of t){let l=i[bi(c.name)]??null;if(l===null)o.push(c);else{let[u,...d]=l;d.length>0?i[bi(c.name)]=d:delete i[bi(c.name)]}}if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function xZ(e,t){return e.reduce((n,i)=>{let r=t(i);return n[r]=[...n[r]??[],i],n},Object.create(null))}function vi(e,t){return e==="deprecated"?W.NonBreaking:e==="oneOf"?W.Breaking:t}function wi(e,t){return e==="deprecated"?W.NonBreaking:e==="oneOf"?W.NonBreaking:t}function vxe(e){return`Directive '${e.addedDirectiveName}' was added to argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function wxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to argument '${e.meta.argumentName}'`},type:P.DirectiveUsageArgumentDefinitionAdded,message:vxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function kxe(e){return`Directive '${e.removedDirectiveName}' was removed from argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function $xe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from argument '${e.meta.argumentName}'`},type:P.DirectiveUsageArgumentDefinitionRemoved,message:kxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function _xe(e){return`Directive '${e.addedDirectiveName}' was added to input object '${e.inputObjectName}'`}function Sxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input object '${e.meta.inputObjectName}'`},type:P.DirectiveUsageInputObjectAdded,message:_xe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function xxe(e){return`Directive '${e.removedDirectiveName}' was removed from input object '${e.inputObjectName}'`}function Exe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input object '${e.meta.inputObjectName}'`},type:P.DirectiveUsageInputObjectRemoved,message:xxe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Txe(e){return`Directive '${e.addedDirectiveName}' was added to interface '${e.interfaceName}'`}function Ixe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to interface '${e.meta.interfaceName}'`},type:P.DirectiveUsageInterfaceAdded,message:Txe(e.meta),path:[e.meta.interfaceName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Axe(e){return`Directive '${e.removedDirectiveName}' was removed from interface '${e.interfaceName}'`}function Rxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from interface '${e.meta.interfaceName}'`},type:P.DirectiveUsageInterfaceRemoved,message:Axe(e.meta),path:[e.meta.interfaceName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Nxe(e){return`Directive '${e.addedDirectiveName}' was added to input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function Cxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input field '${e.meta.inputFieldName}'`},type:P.DirectiveUsageInputFieldDefinitionAdded,message:Nxe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Pxe(e){return`Directive '${e.removedDirectiveName}' was removed from input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function Dxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input field '${e.meta.inputFieldName}'`},type:P.DirectiveUsageInputFieldDefinitionRemoved,message:Pxe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Oxe(e){return`Directive '${e.addedDirectiveName}' was added to object '${e.objectName}'`}function Mxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to object '${e.meta.objectName}'`},type:P.DirectiveUsageObjectAdded,message:Oxe(e.meta),path:[e.meta.objectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Lxe(e){return`Directive '${e.removedDirectiveName}' was removed from object '${e.objectName}'`}function Fxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from object '${e.meta.objectName}'`},type:P.DirectiveUsageObjectRemoved,message:Lxe(e.meta),path:[e.meta.objectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Uxe(e){return`Directive '${e.addedDirectiveName}' was added to enum '${e.enumName}'`}function jxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum '${e.meta.enumName}'`},type:P.DirectiveUsageEnumAdded,message:Uxe(e.meta),path:[e.meta.enumName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function zxe(e){return`Directive '${e.removedDirectiveName}' was removed from enum '${e.enumName}'`}function Gxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum '${e.meta.enumName}'`},type:P.DirectiveUsageEnumRemoved,message:zxe(e.meta),path:[e.meta.enumName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Vxe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function Bxe(e){return{criticality:{level:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldAdded,message:Vxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.addedDirectiveName].join("."),meta:e.meta}}function qxe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function Wxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldDefinitionAdded,message:qxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Hxe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function Kxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldRemoved,message:Hxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.removedDirectiveName].join("."),meta:e.meta}}function Jxe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function Zxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldDefinitionRemoved,message:Jxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Yxe(e){return`Directive '${e.addedDirectiveName}' was added to enum value '${e.enumName}.${e.enumValueName}'`}function Qxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:P.DirectiveUsageEnumValueAdded,message:Yxe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Xxe(e){return`Directive '${e.removedDirectiveName}' was removed from enum value '${e.enumName}.${e.enumValueName}'`}function eEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:P.DirectiveUsageEnumValueRemoved,message:Xxe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function tEe(e){return`Directive '${e.addedDirectiveName}' was added to schema`}function nEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to schema`},type:P.DirectiveUsageSchemaAdded,message:tEe(e.meta),path:`.@${e.meta.addedDirectiveName}`,meta:e.meta}}function rEe(e){return`Directive '${e.removedDirectiveName}' was removed from schema`}function iEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from schema`},type:P.DirectiveUsageSchemaRemoved,message:rEe(e.meta),path:`.@${e.meta.removedDirectiveName}`,meta:e.meta}}function oEe(e){return`Directive '${e.addedDirectiveName}' was added to scalar '${e.scalarName}'`}function sEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to scalar '${e.meta.scalarName}'`},type:P.DirectiveUsageScalarAdded,message:oEe(e.meta),path:[e.meta.scalarName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function aEe(e){return`Directive '${e.removedDirectiveName}' was removed from scalar '${e.scalarName}'`}function cEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from scalar '${e.meta.scalarName}'`},type:P.DirectiveUsageScalarRemoved,message:aEe(e.meta),path:[e.meta.scalarName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function lEe(e){return`Directive '${e.addedDirectiveName}' was added to union member '${e.unionName}'`}function uEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to union member '${e.meta.unionName}.${e.meta.addedUnionMemberTypeName}'`},type:P.DirectiveUsageUnionMemberAdded,message:lEe(e.meta),path:[e.meta.unionName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function dEe(e){return`Directive '${e.removedDirectiveName}' was removed from union member '${e.unionName}'`}function pEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from union member '${e.meta.unionName}.${e.meta.removedUnionMemberTypeName}'`},type:P.DirectiveUsageUnionMemberRemoved,message:dEe(e.meta),path:[e.meta.unionName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function nn(e,t,n,i){return Nt(e,$.ARGUMENT,n)?wxe({type:P.DirectiveUsageArgumentDefinitionAdded,meta:{addedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,addedToNewType:i,directiveRepeatedTimes:yt(n.argument.astNode?.directives??[],t)}}):Nt(e,$.INPUT_VALUE_DEFINITION,n)?Cxe({type:P.DirectiveUsageInputFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,inputFieldName:n.field.name,inputFieldType:n.field.type.toString(),inputObjectName:n.type.name,addedToNewType:i,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.INPUT_OBJECT_TYPE_DEFINITION,n)?Sxe({type:P.DirectiveUsageInputObjectAdded,meta:{addedDirectiveName:t.name.value,addedInputFieldName:t.name.value,addedInputFieldType:n.name,inputObjectName:n.name,isAddedInputFieldTypeNullable:e===$.INPUT_VALUE_DEFINITION,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.INTERFACE_TYPE_DEFINITION,n)?Ixe({type:P.DirectiveUsageInterfaceAdded,meta:{addedDirectiveName:t.name.value,interfaceName:n.name,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.OBJECT,n)?Mxe({type:P.DirectiveUsageObjectAdded,meta:{objectName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_TYPE_DEFINITION,n)?jxe({type:P.DirectiveUsageEnumAdded,meta:{enumName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.FIELD,n)?Bxe({type:P.DirectiveUsageFieldAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.FIELD_DEFINITION,n)?Wxe({type:P.DirectiveUsageFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,addedToNewType:i,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.UNION_TYPE_DEFINITION,n)?uEe({type:P.DirectiveUsageUnionMemberAdded,meta:{addedDirectiveName:t.name.value,addedUnionMemberTypeName:n.name,unionName:n.name,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_VALUE_DEFINITION,n)?Qxe({type:P.DirectiveUsageEnumValueAdded,meta:{enumName:n.type.name,enumValueName:n.value.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.value.astNode?.directives??[],t)}}):Nt(e,$.SCHEMA_DEFINITION,n)?nEe({type:P.DirectiveUsageSchemaAdded,meta:{addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n?.astNode?.directives??[],t)}}):Nt(e,$.SCALAR_TYPE_DEFINITION,n)?sEe({type:P.DirectiveUsageScalarAdded,meta:{scalarName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):{}}function yt(e,t){let n=t.name.value,i=0;for(let r of e)if(r.name.value===n&&(i+=1),r===t)return i;return 0}function rn(e,t,n){return Nt(e,$.ARGUMENT,n)?$xe({type:P.DirectiveUsageArgumentDefinitionRemoved,meta:{removedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,directiveRepeatedTimes:yt(n.argument.astNode?.directives??[],t)}}):Nt(e,$.INPUT_VALUE_DEFINITION,n)?Dxe({type:P.DirectiveUsageInputFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,inputFieldName:n.field.name,inputObjectName:n.type.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.INPUT_OBJECT_TYPE_DEFINITION,n)?Exe({type:P.DirectiveUsageInputObjectRemoved,meta:{removedDirectiveName:t.name.value,removedInputFieldName:t.name.value,removedInputFieldType:n.name,inputObjectName:n.name,isRemovedInputFieldTypeNullable:e===$.INPUT_VALUE_DEFINITION,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.INTERFACE_TYPE_DEFINITION,n)?Rxe({type:P.DirectiveUsageInterfaceRemoved,meta:{removedDirectiveName:t.name.value,interfaceName:n.name,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.OBJECT,n)?Fxe({type:P.DirectiveUsageObjectRemoved,meta:{objectName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_TYPE_DEFINITION,n)?Gxe({type:P.DirectiveUsageEnumRemoved,meta:{enumName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.FIELD,n)?Kxe({type:P.DirectiveUsageFieldRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.FIELD_DEFINITION,n)?Zxe({type:P.DirectiveUsageFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.UNION_TYPE_DEFINITION,n)?pEe({type:P.DirectiveUsageUnionMemberRemoved,meta:{removedDirectiveName:t.name.value,removedUnionMemberTypeName:n.name,unionName:n.name,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_VALUE_DEFINITION,n)?eEe({type:P.DirectiveUsageEnumValueRemoved,meta:{enumName:n.type.name,enumValueName:n.value.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.value.astNode?.directives??[],t)}}):Nt(e,$.SCHEMA_DEFINITION,n)?iEe({type:P.DirectiveUsageSchemaRemoved,meta:{removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n?.astNode?.directives??[],t)}}):Nt(e,$.SCALAR_TYPE_DEFINITION,n)?cEe({type:P.DirectiveUsageScalarRemoved,meta:{scalarName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):{}}function Nt(e,t,n){return e===t}function EZ(e){return{type:P.DirectiveUsageArgumentAdded,criticality:{level:W.NonBreaking},message:`Argument '${e.meta.addedArgumentName}' was added to '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.addedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function TZ(e){return{type:P.DirectiveUsageArgumentRemoved,criticality:{level:W.Dangerous,reason:"Changing an argument on a directive can change runtime behavior."},message:`Argument '${e.meta.removedArgumentName}' was removed from '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.removedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function et(e,t,n,i,r,o,s){en(e?.arguments||[],t.arguments||[],{onAdded(a){n(EZ({type:P.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.name.value,addedArgumentValue:Ye(a.value),oldArgumentValue:null,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}}))},onMutual(a){a.oldVersion&&Ye(a.oldVersion.value)===Ye(a.newVersion.value)||(a.oldVersion&&n(TZ({type:P.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.oldVersion.name.value,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}})),n(EZ({type:P.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.newVersion.name.value,addedArgumentValue:Ye(a.newVersion.value),oldArgumentValue:(a.oldVersion?.value&&Ye(a.oldVersion.value))??null,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}})))},onRemoved(a){n(TZ({type:P.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.name.value,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}}))}})}var ZZ=gt(JZ(),1);function Ki(e){return typeof e=="string"?JSON.stringify(e):(0,ZZ.default)(e).replace(/\[Object: null prototype\] /g,"").replace(/(^')|('$)/g,"")}function je(e){return e.replace(/'/g,"\\'")}function jEe(e){return`Directive '${e.removedDirectiveName}' was removed`}var zEe="A directive could be in use of a client application. Removing it could break the client application.";function GEe(e){return{criticality:{level:W.Breaking,reason:zEe},type:P.DirectiveRemoved,message:jEe(e.meta),path:`@${e.meta.removedDirectiveName}`,meta:e.meta}}function YZ(e){return GEe({type:P.DirectiveRemoved,meta:{removedDirectiveName:e.name}})}function VEe(e){return`Directive '${e.addedDirectiveName}' was added`}function BEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveAdded,message:VEe(e.meta),path:`@${e.meta.addedDirectiveName}`,meta:e.meta}}function QZ(e){return BEe({type:P.DirectiveAdded,meta:{addedDirectiveName:e.name,addedDirectiveDescription:e.description??null,addedDirectiveLocations:e.locations.map(t=>String(t)),addedDirectiveRepeatable:e.isRepeatable}})}function qEe(e){return e.oldDirectiveDescription===null&&e.newDirectiveDescription!==null?`Directive '${e.directiveName}' description '${je(e.newDirectiveDescription)}' was added`:e.newDirectiveDescription===null&&e.oldDirectiveDescription!==null?`Directive '${e.directiveName}' description '${je(e.oldDirectiveDescription)}' was removed`:`Directive '${e.directiveName}' description changed from '${je(e.oldDirectiveDescription??"")}' to '${je(e.newDirectiveDescription??"")}'`}function WEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveDescriptionChanged,message:qEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function XZ(e,t){return WEe({type:P.DirectiveDescriptionChanged,meta:{directiveName:t.name,oldDirectiveDescription:e?.description??null,newDirectiveDescription:t.description??null}})}function HEe(e){return`Directive '${e.directiveName}' added repeatable.`}function KEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveRepeatableAdded,message:HEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function e3(e){return KEe({type:P.DirectiveRepeatableAdded,meta:{directiveName:e.name}})}function JEe(e){return`Directive '${e.directiveName}' removed repeatable.`}function ZEe(e){return{criticality:{level:W.Dangerous},type:P.DirectiveRepeatableRemoved,message:JEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function t3(e){return ZEe({type:P.DirectiveRepeatableRemoved,meta:{directiveName:e.name}})}function YEe(e){return`Location '${e.addedDirectiveLocation}' was added to directive '${e.directiveName}'`}function QEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveLocationAdded,message:YEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function n3(e,t){return QEe({type:P.DirectiveLocationAdded,meta:{directiveName:e.name,addedDirectiveLocation:String(t)}})}function XEe(e){return`Location '${e.removedDirectiveLocation}' was removed from directive '${e.directiveName}'`}var eTe="A directive could be in use of a client application. Removing it could break the client application.";function tTe(e){return{criticality:{level:W.Breaking,reason:eTe},type:P.DirectiveLocationRemoved,message:XEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function r3(e,t){return tTe({type:P.DirectiveLocationRemoved,meta:{directiveName:e.name,removedDirectiveLocation:t.toString()}})}var nTe="A directive could be in use of a client application. Adding a non-nullable argument will break those clients.",rTe="A directive could be in use of a client application. Adding a nullable argument will not break those clients.",iTe="Refer to the directive usage for the breaking status. If the directive is new and therefore unused, then adding an argument does not risk breaking clients.";function oTe(e){return{criticality:e.meta.addedToNewDirective?{level:W.NonBreaking,reason:iTe}:e.meta.addedDirectiveArgumentTypeIsNonNull?{level:W.Breaking,reason:nTe}:{level:W.NonBreaking,reason:rTe},type:P.DirectiveArgumentAdded,message:`Argument '${e.meta.addedDirectiveArgumentName}' was added to directive '${e.meta.directiveName}'`,path:`@${e.meta.directiveName}`,meta:e.meta}}function i3(e,t,n){return oTe({type:P.DirectiveArgumentAdded,meta:{directiveName:e.name,addedDirectiveArgumentName:t.name,addedDirectiveArgumentType:t.type.toString(),addedDirectiveDefaultValue:Bd(t)?Ki(Zr(t)):void 0,addedDirectiveArgumentTypeIsNonNull:_e(t.type),addedDirectiveArgumentDescription:t.description??void 0,addedToNewDirective:n}})}function sTe(e){return`Argument '${e.removedDirectiveArgumentName}' was removed from directive '${e.directiveName}'`}var aTe="A directive argument could be in use of a client application. Removing the argument can break client applications.";function cTe(e){return{criticality:{level:W.Breaking,reason:aTe},type:P.DirectiveArgumentRemoved,message:sTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.removedDirectiveArgumentName}`,meta:e.meta}}function o3(e,t){return cTe({type:P.DirectiveArgumentRemoved,meta:{directiveName:e.name,removedDirectiveArgumentName:t.name}})}function lTe(e){return e.oldDirectiveArgumentDescription===null&&e.newDirectiveArgumentDescription!==null?`Description '${je(e.newDirectiveArgumentDescription)}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:e.newDirectiveArgumentDescription===null&&e.oldDirectiveArgumentDescription!==null?`Description '${je(e.oldDirectiveArgumentDescription)}' was removed from argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Description for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${je(e.oldDirectiveArgumentDescription??"")}' to '${je(e.newDirectiveArgumentDescription??"")}'`}function uTe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveArgumentDescriptionChanged,message:lTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function s3(e,t,n){return uTe({type:P.DirectiveArgumentDescriptionChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentDescription:t?.description??null,newDirectiveArgumentDescription:n.description??null}})}function dTe(e){return e.oldDirectiveArgumentDefaultValue===void 0?`Default value '${e.newDirectiveArgumentDefaultValue}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Default value for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${e.oldDirectiveArgumentDefaultValue}' to '${e.newDirectiveArgumentDefaultValue}'`}var pTe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function fTe(e){return{criticality:{level:W.Dangerous,reason:pTe},type:P.DirectiveArgumentDefaultValueChanged,message:dTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function a3(e,t,n){let i={directiveName:e.name,directiveArgumentName:n.name},r=t===null?void 0:Zr(t),o=Zr(n);return r!==void 0&&(i.oldDirectiveArgumentDefaultValue=Ki(r)),o!==void 0&&(i.newDirectiveArgumentDefaultValue=Ki(o)),fTe({type:P.DirectiveArgumentDefaultValueChanged,meta:i})}function mTe(e){return`Type for argument '${e.meta.directiveArgumentName}' on directive '${e.meta.directiveName}' changed from '${e.meta.oldDirectiveArgumentType}' to '${e.meta.newDirectiveArgumentType}'`}var gTe="Changing an input field from non-null to null is considered non-breaking.";function hTe(e){return{criticality:e.meta.isSafeDirectiveArgumentTypeChange?{level:W.NonBreaking,reason:gTe}:{level:W.Breaking},type:P.DirectiveArgumentTypeChanged,message:mTe(e),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function c3(e,t,n){return hTe({type:P.DirectiveArgumentTypeChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentType:t?.type.toString()??"",newDirectiveArgumentType:n.type.toString(),isSafeDirectiveArgumentTypeChange:Ea(t.type,n.type)}})}function yTe(e){return e.oldQueryTypeName===null?`Schema query root type was set to '${e.newQueryTypeName}'.`:e.newQueryTypeName===null?`Schema query root type '${e.oldQueryTypeName}' was removed.`:`Schema query root type was changed from '${e.oldQueryTypeName}' to '${e.newQueryTypeName}'`}function bTe(e){return{type:P.SchemaQueryTypeChanged,criticality:{level:e.meta.oldQueryTypeName===null?W.NonBreaking:W.Breaking},message:yTe(e.meta),meta:e.meta}}function l3(e,t){let n=e?.getQueryType()?.name||null,i=t?.getQueryType()?.name||null;return bTe({type:P.SchemaQueryTypeChanged,meta:{oldQueryTypeName:n,newQueryTypeName:i}})}function vTe(e){return e.oldMutationTypeName===null?`Schema mutation type was set to '${e.newMutationTypeName}'.`:e.newMutationTypeName===null?`Schema mutation type '${e.oldMutationTypeName}' was removed.`:`Schema mutation type was changed from '${e.oldMutationTypeName}' to '${e.newMutationTypeName}'`}function wTe(e){return{type:P.SchemaMutationTypeChanged,criticality:{level:e.meta.oldMutationTypeName===null?W.NonBreaking:W.Breaking},message:vTe(e.meta),meta:e.meta}}function u3(e,t){let n=e?.getMutationType()?.name||null,i=t?.getMutationType()?.name||null;return wTe({type:P.SchemaMutationTypeChanged,meta:{newMutationTypeName:i,oldMutationTypeName:n}})}function kTe(e){return e.oldSubscriptionTypeName===null?`Schema subscription type was set to '${e.newSubscriptionTypeName}'.`:e.newSubscriptionTypeName===null?`Schema subscription type '${e.oldSubscriptionTypeName}' was removed.`:`Schema subscription type was changed from '${e.oldSubscriptionTypeName}' to '${e.newSubscriptionTypeName}'`}function $Te(e){return{type:P.SchemaSubscriptionTypeChanged,criticality:{level:e.meta.oldSubscriptionTypeName===null?W.NonBreaking:W.Breaking},message:kTe(e.meta),meta:e.meta}}function d3(e,t){let n=e?.getSubscriptionType()?.name||null,i=t?.getSubscriptionType()?.name||null;return $Te({type:P.SchemaSubscriptionTypeChanged,meta:{newSubscriptionTypeName:i,oldSubscriptionTypeName:n}})}function _Te(e){return`Type '${e.removedTypeName}' was removed`}function STe(e){return{criticality:{level:W.Breaking},type:P.TypeRemoved,message:_Te(e.meta),meta:e.meta,path:e.meta.removedTypeName}}function p3(e){return STe({type:P.TypeRemoved,meta:{removedTypeName:e.name}})}function xTe(e){return`Type '${e.addedTypeName}' was added`}function ETe(e){return{criticality:{level:W.NonBreaking},type:P.TypeAdded,message:xTe(e.meta),meta:e.meta,path:e.meta.addedTypeName}}function TTe(e){return Xt(e)?{addedTypeKind:$.ENUM_TYPE_DEFINITION,addedTypeName:e.name}:at(e)||Be(e)?{addedTypeKind:lh(e),addedTypeName:e.name}:Qt(e)?{addedTypeKind:$.UNION_TYPE_DEFINITION,addedTypeName:e.name}:He(e)?{addedTypeKind:$.INPUT_OBJECT_TYPE_DEFINITION,addedTypeIsOneOf:e.isOneOf,addedTypeName:e.name}:{addedTypeKind:lh(e),addedTypeName:e.name}}function f3(e){return ETe({type:P.TypeAdded,meta:TTe(e)})}function ITe(e){return`'${e.meta.typeName}' kind changed from '${e.meta.oldTypeKind}' to '${e.meta.newTypeKind}'`}function ATe(e){return{criticality:{level:W.Breaking,reason:"Changing the kind of a type is a breaking change because it can cause existing queries to error. For example, turning an object type to a scalar type would break queries that define a selection set for this type."},type:P.TypeKindChanged,message:ITe(e),path:e.meta.typeName,meta:e.meta}}function m3(e,t){return ATe({type:P.TypeKindChanged,meta:{typeName:t.name,newTypeKind:String(lh(t)),oldTypeKind:String(lh(e))}})}function RTe(e){let t=je(e.oldTypeDescription),n=je(e.newTypeDescription);return`Description '${t}' on type '${e.typeName}' has changed to '${n}'`}function NTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionChanged,message:RTe(e.meta),path:e.meta.typeName,meta:e.meta}}function g3(e,t){return NTe({type:P.TypeDescriptionChanged,meta:{typeName:e.name,newTypeDescription:t.description??"",oldTypeDescription:e.description??""}})}function CTe(e){return`Description '${je(e.removedTypeDescription)}' was removed from object type '${e.typeName}'`}function PTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionRemoved,message:CTe(e.meta),path:e.meta.typeName,meta:e.meta}}function h3(e){return PTe({type:P.TypeDescriptionRemoved,meta:{typeName:e.name,removedTypeDescription:e.description??""}})}function DTe(e){let t=je(e.addedTypeDescription);return`Object type '${e.typeName}' has description '${t}'`}function OTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionAdded,message:DTe(e.meta),path:e.meta.typeName,meta:e.meta}}function y3(e){return OTe({type:P.TypeDescriptionAdded,meta:{typeName:e.name,addedTypeDescription:e.description??""}})}function YD(e,t,n){Wt(e?.description,t.description)&&n(XZ(e,t)),!t.isRepeatable&&e?.isRepeatable&&n(t3(t)),t.isRepeatable&&!e?.isRepeatable&&n(e3(t));let i={added:FD(t.locations,e?.locations??[]),removed:FD(e?.locations??[],t.locations)};for(let r of i.added)n(n3(t,r));for(let r of i.removed)n(r3(t,r));en(e?.args??[],t.args,{onAdded(r){n(i3(t,r,e===null))},onRemoved(r){n(o3(t,r))},onMutual(r){MTe(t,r.oldVersion,r.newVersion,n)}})}function MTe(e,t,n,i){Wt(t?.description,n.description)&&i(s3(e,t,n)),qd(t,n)||i(a3(e,t,n)),Wt(t.type.toString(),n.type.toString())&&i(c3(e,t,n))}function LTe(e){return`Enum value '${e.removedEnumValueName}' ${e.isEnumValueDeprecated?"(deprecated) ":""}was removed from enum '${e.enumName}'`}var FTe="Removing an enum value will cause existing queries that use this enum value to error.";function UTe(e){return{type:P.EnumValueRemoved,criticality:{level:W.Breaking,reason:FTe},message:LTe(e.meta),meta:e.meta,path:[e.meta.enumName,e.meta.removedEnumValueName].join(".")}}function b3(e,t){return UTe({type:P.EnumValueRemoved,meta:{enumName:e.name,removedEnumValueName:t.name,isEnumValueDeprecated:cs(t)}})}function jTe(e){return`Enum value '${e.meta.addedEnumValueName}' was added to enum '${e.meta.enumName}'`}var zTe="Adding an enum value may break existing clients that were not programming defensively against an added case when querying an enum.";function GTe(e){let t=e.meta.addedToNewType;return{type:P.EnumValueAdded,criticality:{level:t?W.NonBreaking:W.Dangerous,reason:t?void 0:zTe},message:jTe(e),meta:e.meta,path:[e.meta.enumName,e.meta.addedEnumValueName].join(".")}}function v3(e,t,n){return GTe({type:P.EnumValueAdded,meta:{enumName:e.name,addedEnumValueName:t.name,addedToNewType:n,addedDirectiveDescription:t.description??null}})}function VTe(e){return e.oldEnumValueDescription===null&&e.newEnumValueDescription!==null?`Description '${je(e.newEnumValueDescription)}' was added to enum value '${e.enumName}.${e.enumValueName}'`:e.newEnumValueDescription===null&&e.oldEnumValueDescription!==null?`Description '${je(e.oldEnumValueDescription)}' was removed from enum value '${e.enumName}.${e.enumValueName}'`:`Description for enum value '${e.enumName}.${e.enumValueName}' changed from '${je(e.oldEnumValueDescription??"")}' to '${je(e.newEnumValueDescription??"")}'`}function BTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDescriptionChanged,message:VTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function w3(e,t,n){return BTe({type:P.EnumValueDescriptionChanged,meta:{enumName:e.name,enumValueName:n.name,oldEnumValueDescription:t?.description??null,newEnumValueDescription:n.description??null}})}function qTe(e){let t=je(e.oldEnumValueDeprecationReason),n=je(e.newEnumValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' deprecation reason changed from '${t}' to '${n}'`}function WTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonChanged,message:qTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${Jr.name}`].join("."),meta:e.meta}}function k3(e,t,n){return WTe({type:P.EnumValueDeprecationReasonChanged,meta:{enumName:e.name,enumValueName:t.name,oldEnumValueDeprecationReason:t.deprecationReason??"",newEnumValueDeprecationReason:n.deprecationReason??""}})}function HTe(e){let t=je(e.addedValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' was deprecated with reason '${t}'`}function KTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonAdded,message:HTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${Jr.name}`].join("."),meta:e.meta}}function $3(e,t,n){return KTe({type:P.EnumValueDeprecationReasonAdded,meta:{enumName:e.name,enumValueName:n.name,addedValueDeprecationReason:n.deprecationReason??""}})}function JTe(e){return`Deprecation reason was removed from enum value '${e.enumName}.${e.enumValueName}'`}function ZTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonRemoved,message:JTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function _3(e,t,n){return ZTe({type:P.EnumValueDeprecationReasonRemoved,meta:{enumName:e.name,enumValueName:t.name,removedEnumValueDeprecationReason:t.deprecationReason??""}})}var S3="No longer supported";function E3(e,t,n){en(e?.getValues()??[],t.getValues(),{onAdded(i){n(v3(t,i,e===null)),x3({newVersion:i,oldVersion:null},t,n)},onRemoved(i){n(b3(e,i))},onMutual(i){x3(i,t,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(i){n(nn($.ENUM_TYPE_DEFINITION,i,t,e===null)),et(null,i,n,t)},onMutual(i){et(i.oldVersion,i.newVersion,n,t)},onRemoved(i){n(rn($.ENUM_TYPE_DEFINITION,i,t))}})}function x3(e,t,n){let i=e.oldVersion,r=e.newVersion;Wt(i?.description,r.description)&&n(w3(t,i,r)),Wt(i?.deprecationReason,r.deprecationReason)&&(At(i?.deprecationReason)||i?.deprecationReason===S3?n($3(t,i,r)):At(r.deprecationReason)||r?.deprecationReason===S3?n(_3(t,i,r)):n(k3(t,i,r))),tn(i?.astNode?.directives||[],r.astNode?.directives||[],{onAdded(o){n(nn($.ENUM_VALUE_DEFINITION,o,{type:t,value:r},i===null)),et(null,o,n,t,void 0,void 0,r)},onMutual(o){et(o.oldVersion,o.newVersion,n,t,void 0,void 0,r)},onRemoved(o){n(rn($.ENUM_VALUE_DEFINITION,o,{type:t,value:i}))}})}function YTe(e){return`Input field '${e.removedFieldName}' ${e.isInputFieldDeprecated?"(deprecated) ":""}was removed from input object type '${e.inputName}'`}function QTe(e){return{type:P.InputFieldRemoved,criticality:{level:W.Breaking,reason:"Removing an input field will cause existing queries that use this input field to error."},message:YTe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.removedFieldName].join(".")}}function T3(e,t){return QTe({type:P.InputFieldRemoved,meta:{inputName:e.name,removedFieldName:t.name,isInputFieldDeprecated:cs(t)}})}function XTe(e){return`Input field '${e.addedInputFieldName}' of type '${e.addedInputFieldType}'${e.addedFieldDefault?` with default value '${e.addedFieldDefault}'`:""} was added to input object type '${e.inputName}'`}function eIe(e){let t,n=e.meta.isAddedInputFieldTypeNullable&&e.meta.addedFieldDefault===void 0;return e.meta.addedToNewType?t={level:W.NonBreaking,reason:"The field is being added to a new type."}:n?t={level:W.NonBreaking,reason:"The field is nullable and no default is set."}:e.meta.addedFieldDefault===void 0?t={level:W.Breaking,reason:"Adding a required input field to an existing input object type is a breaking change because it will cause existing uses of this input object type to error."}:t={level:W.Dangerous,reason:"Adding a field with a default value can change runtime behavior for clients that previously omitted it, and during rolling deploys consumers may receive the new default before producers are ready to handle it."},{type:P.InputFieldAdded,criticality:t,message:XTe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.addedInputFieldName].join(".")}}function I3(e,t,n){let i=Zr(t);return eIe({type:P.InputFieldAdded,meta:{inputName:e.name,addedInputFieldName:t.name,isAddedInputFieldTypeNullable:!_e(t.type),addedInputFieldType:t.type.toString(),...Bd(t)?{addedFieldDefault:Ki(i)}:{},addedToNewType:n}})}function tIe(e){let t=je(e.addedInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' has description '${t}'`}function nIe(e){return{type:P.InputFieldDescriptionAdded,criticality:{level:W.NonBreaking},message:tIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function A3(e,t){return nIe({type:P.InputFieldDescriptionAdded,meta:{inputName:e.name,inputFieldName:t.name,addedInputFieldDescription:t.description??""}})}function rIe(e){return`Description '${je(e.removedDescription)}' was removed from input field '${e.inputName}.${e.inputFieldName}'`}function iIe(e){return{type:P.InputFieldDescriptionRemoved,criticality:{level:W.NonBreaking},message:rIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function R3(e,t){return iIe({type:P.InputFieldDescriptionRemoved,meta:{inputName:e.name,inputFieldName:t.name,removedDescription:t.description??""}})}function oIe(e){let t=je(e.oldInputFieldDescription),n=je(e.newInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' description changed from '${t}' to '${n}'`}function sIe(e){return{type:P.InputFieldDescriptionChanged,criticality:{level:W.NonBreaking},message:oIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function N3(e,t,n){return sIe({type:P.InputFieldDescriptionChanged,meta:{inputName:e.name,inputFieldName:t.name,oldInputFieldDescription:t.description??"",newInputFieldDescription:n.description??""}})}function aIe(e){return`Input field '${e.inputName}.${e.inputFieldName}' default value changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}function cIe(e){let t={level:W.Dangerous,reason:"Changing the default value for an argument may change the runtime behavior of a field if it was never provided."};return{type:P.InputFieldDefaultValueChanged,criticality:t,message:aIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function C3(e,t,n){let i={inputName:e.name,inputFieldName:n.name},r=Zr(t),o=Zr(n);return r!==void 0&&(i.oldDefaultValue=Ki(r)),o!==void 0&&(i.newDefaultValue=Ki(o)),cIe({type:P.InputFieldDefaultValueChanged,meta:i})}function lIe(e){return`Input field '${e.inputName}.${e.inputFieldName}' changed type from '${e.oldInputFieldType}' to '${e.newInputFieldType}'`}function uIe(e){return{type:P.InputFieldTypeChanged,criticality:e.meta.isInputFieldTypeChangeSafe?{level:W.NonBreaking,reason:"Changing an input field from non-null to null is considered non-breaking."}:{level:W.Breaking,reason:"Changing the type of an input field can cause existing queries that use this field to error."},message:lIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function P3(e,t,n){return uIe({type:P.InputFieldTypeChanged,meta:{inputName:e.name,inputFieldName:n.name,oldInputFieldType:t.type.toString(),newInputFieldType:n.type.toString(),isInputFieldTypeChangeSafe:Ea(t.type,n.type)}})}function O3(e,t,n){let i=e?.getFields()??{},r=t.getFields();en(Object.values(i),Object.values(r),{onAdded(o){n(I3(t,o,e==null)),D3(t,null,o,n)},onRemoved(o){n(T3(e,o))},onMutual(o){D3(t,o.oldVersion,o.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(nn($.INPUT_OBJECT_TYPE_DEFINITION,o,t,e===null)),et(null,o,n,t)},onMutual(o){et(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(rn($.INPUT_OBJECT_TYPE_DEFINITION,o,e))}})}function D3(e,t,n,i){Wt(t?.description,n.description)&&(At(t?.description)?i(A3(e,n)):At(n.description)?i(R3(e,t)):i(N3(e,t,n))),At(t)||(qd(t,n)||i(C3(e,t,n)),!At(t)&&Wt(t.type.toString(),n.type.toString())&&i(P3(e,t,n))),(t?.astNode?.directives||n.astNode?.directives)&&tn(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(r){i(nn($.INPUT_VALUE_DEFINITION,r,{type:e,field:n},t===null)),et(null,r,i,e,n)},onMutual(r){et(r.oldVersion,r.newVersion,i,e,n)},onRemoved(r){i(rn($.INPUT_VALUE_DEFINITION,r,{type:e,field:n}))}})}function dIe(e){return`Field '${e.removedFieldName}' ${e.isRemovedFieldDeprecated?"(deprecated) ":""}was removed from ${e.typeType} '${e.typeName}'`}function pIe(e){return{type:P.FieldRemoved,criticality:{level:W.Breaking,reason:e.meta.isRemovedFieldDeprecated?"Removing a deprecated field is a breaking change. Before removing it, you may want to look at the field's usage to see the impact of removing the field.":"Removing a field is a breaking change. It is preferable to deprecate the field before removing it. This applies to removed union fields as well, since removal breaks client operations that contain fragments that reference the removed type through direct (... on RemovedType) or indirect means such as __typename in the consumers."},message:dIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.removedFieldName].join(".")}}function M$(e,t){let n=Be(e)?"interface":"object type";return pIe({type:P.FieldRemoved,meta:{typeName:e.name,removedFieldName:t.name,isRemovedFieldDeprecated:t.deprecationReason!=null,typeType:n}})}function fIe(e){return`Field '${e.addedFieldName}' was added to ${e.typeType} '${e.typeName}'`}function mIe(e){return{type:P.FieldAdded,criticality:{level:W.NonBreaking},message:fIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.addedFieldName].join(".")}}function L$(e,t){let n=Be(e)?"interface":"object type";return mIe({type:P.FieldAdded,meta:{typeName:e.name,addedFieldName:t.name,typeType:n,addedFieldReturnType:t.type.toString()}})}function gIe(e){return!e.oldDescription&&e.newDescription?`Field '${e.typeName}.${e.fieldName}' description '${je(e.newDescription)}' was added`:!e.newDescription&&e.oldDescription?`Field '${e.typeName}.${e.fieldName}' description '${je(e.oldDescription)}' was removed`:`Field '${e.typeName}.${e.fieldName}' description changed from '${je(e.oldDescription)}' to '${je(e.newDescription)}'`}function hIe(e){return{type:P.FieldDescriptionChanged,criticality:{level:W.NonBreaking},message:gIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function M3(e,t,n){return hIe({type:P.FieldDescriptionChanged,meta:{fieldName:t.name,typeName:e.name,oldDescription:t.description??"",newDescription:n.description??""}})}function yIe(e){let t=je(e.addedDescription);return`Field '${e.typeName}.${e.fieldName}' has description '${t}'`}function bIe(e){return{type:P.FieldDescriptionAdded,criticality:{level:W.NonBreaking},message:yIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function L3(e,t){return bIe({type:P.FieldDescriptionAdded,meta:{typeName:e.name,fieldName:t.name,addedDescription:t.description??""}})}function vIe(e){return`Description was removed from field '${e.typeName}.${e.fieldName}'`}function wIe(e){return{type:P.FieldDescriptionRemoved,criticality:{level:W.NonBreaking},message:vIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function F3(e,t){return wIe({type:P.FieldDescriptionRemoved,meta:{typeName:e.name,fieldName:t.name}})}function kIe(e){return`Field '${e.typeName}.${e.fieldName}' is deprecated`}function $Ie(e){return{type:P.FieldDeprecationAdded,criticality:{level:W.NonBreaking},message:kIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function U3(e,t){return $Ie({type:P.FieldDeprecationAdded,meta:{typeName:e.name,fieldName:t.name,deprecationReason:t.deprecationReason??""}})}function _Ie(e){return{type:P.FieldDeprecationRemoved,criticality:{level:W.NonBreaking},message:`Field '${e.meta.typeName}.${e.meta.fieldName}' is no longer deprecated`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function j3(e,t){return _Ie({type:P.FieldDeprecationRemoved,meta:{fieldName:t.name,typeName:e.name}})}function SIe(e){let t=je(e.oldDeprecationReason),n=je(e.newDeprecationReason);return`Deprecation reason on field '${e.typeName}.${e.fieldName}' has changed from '${t}' to '${n}'`}function xIe(e){return{type:P.FieldDeprecationReasonChanged,criticality:{level:W.NonBreaking},message:SIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function z3(e,t,n){return xIe({type:P.FieldDeprecationReasonChanged,meta:{fieldName:n.name,typeName:e.name,newDeprecationReason:n.deprecationReason??"",oldDeprecationReason:t.deprecationReason??""}})}function EIe(e){let t=je(e.addedDeprecationReason);return`Field '${e.typeName}.${e.fieldName}' has deprecation reason '${t}'`}function TIe(e){return{type:P.FieldDeprecationReasonAdded,criticality:{level:W.NonBreaking},message:EIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function G3(e,t){return TIe({type:P.FieldDeprecationReasonAdded,meta:{typeName:e.name,fieldName:t.name,addedDeprecationReason:t.deprecationReason??""}})}function IIe(e){return{type:P.FieldDeprecationReasonRemoved,criticality:{level:W.NonBreaking},message:`Deprecation reason was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function V3(e,t){return IIe({type:P.FieldDeprecationReasonRemoved,meta:{typeName:e.name,fieldName:t.name}})}function AIe(e){return`Field '${e.meta.typeName}.${e.meta.fieldName}' changed type from '${e.meta.oldFieldType}' to '${e.meta.newFieldType}'`}function RIe(e){return{type:P.FieldTypeChanged,criticality:{level:e.meta.isSafeFieldTypeChange?W.NonBreaking:W.Breaking},message:AIe(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function B3(e,t,n){return RIe({type:P.FieldTypeChanged,meta:{typeName:e.name,fieldName:t.name,oldFieldType:t.type.toString(),newFieldType:n.type.toString(),isSafeFieldTypeChange:ch(t.type,n.type)}})}function NIe(e){return`Argument '${e.addedArgumentName}: ${e.addedArgumentType}'${e.hasDefaultValue?" (with default value) ":" "}added to field '${e.typeName}.${e.fieldName}'`}function CIe(e){return{type:P.FieldArgumentAdded,criticality:{level:e.meta.addedToNewField?W.NonBreaking:e.meta.isAddedFieldArgumentBreaking?W.Breaking:W.Dangerous},message:NIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.addedArgumentName].join(".")}}function q3(e,t,n,i){let r=Bd(n),o=_e(n.type)&&!r;return CIe({type:P.FieldArgumentAdded,meta:{typeName:e.name,fieldName:t.name,addedArgumentName:n.name,addedArgumentType:n.type.toString(),hasDefaultValue:r,addedToNewField:i,isAddedFieldArgumentBreaking:o}})}function PIe(e){return`Argument '${e.meta.removedFieldArgumentName}: ${e.meta.removedFieldType}' was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`}function DIe(e){return{type:P.FieldArgumentRemoved,criticality:{level:W.Breaking},message:PIe(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.removedFieldArgumentName].join(".")}}function W3(e,t,n){return DIe({type:P.FieldArgumentRemoved,meta:{typeName:e.name,fieldName:t.name,removedFieldArgumentName:n.name,removedFieldType:n.type.toString()}})}function OIe(e){return`'${e.objectTypeName}' object implements '${e.addedInterfaceName}' interface`}function MIe(e){return{type:P.ObjectTypeInterfaceAdded,criticality:{level:e.meta.addedToNewType?W.NonBreaking:W.Dangerous,reason:"Adding an interface to an object type may break existing clients that are consuming a field returning the interface type that are not programming defensively against this new possible type."},message:OIe(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function F$(e,t,n){return MIe({type:P.ObjectTypeInterfaceAdded,meta:{objectTypeName:t.name,addedInterfaceName:e.name,addedToNewType:n}})}function LIe(e){return`'${e.objectTypeName}' object type no longer implements '${e.removedInterfaceName}' interface`}function FIe(e){return{type:P.ObjectTypeInterfaceRemoved,criticality:{level:W.Breaking,reason:"Removing an interface from an object type can cause existing queries that use this in a fragment spread to error."},message:LIe(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function U$(e,t){return FIe({type:P.ObjectTypeInterfaceRemoved,meta:{objectTypeName:t.name,removedInterfaceName:e.name}})}function UIe(e){return e.oldDescription===null&&e.newDescription!==null?`Description '${je(e.newDescription)}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:e.newDescription===null&&e.oldDescription!==null?`Description '${je(e.oldDescription)}' was removed from argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Description for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${je(e.oldDescription??"")}' to '${je(e.newDescription??"")}'`}function jIe(e){return{type:P.FieldArgumentDescriptionChanged,criticality:{level:W.NonBreaking},message:UIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function H3(e,t,n,i){return jIe({type:P.FieldArgumentDescriptionChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:i.name,oldDescription:n?.description??null,newDescription:i.description??null}})}function zIe(e){return e.oldDefaultValue===void 0?`Default value '${e.newDefaultValue}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Default value for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}var GIe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function VIe(e){return{type:P.FieldArgumentDefaultChanged,criticality:{level:W.Dangerous,reason:GIe},message:zIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function K3(e,t,n,i){let r={typeName:e.name,fieldName:t.name,argumentName:i.name},o=n===null?void 0:Zr(n),s=Zr(i);return o!==void 0&&(r.oldDefaultValue=Ki(o)),s!==void 0&&(r.newDefaultValue=Ki(s)),VIe({type:P.FieldArgumentDefaultChanged,meta:r})}function BIe(e){return`Type for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldArgumentType}' to '${e.newArgumentType}'`}var qIe="Changing an input field from non-null to null is considered non-breaking.",WIe="Changing the type of a field's argument can cause existing queries that use this argument to error.";function HIe(e){return{type:P.FieldArgumentTypeChanged,criticality:e.meta.isSafeArgumentTypeChange?{level:W.NonBreaking,reason:qIe}:{level:W.Breaking,reason:WIe},message:BIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function J3(e,t,n,i){return HIe({type:P.FieldArgumentTypeChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:i.name,oldArgumentType:n?.type.toString()??"",newArgumentType:i.type.toString(),isSafeArgumentTypeChange:!n||Ea(n.type,i.type)}})}function Z3(e,t,n,i,r){Wt(n?.description,i.description)&&r(H3(e,t,n,i)),qd(n,i)||r(K3(e,t,n,i)),Wt(n?.type.toString(),i.type.toString())&&r(J3(e,t,n,i)),(n?.astNode?.directives||i.astNode?.directives)&&tn(n?.astNode?.directives||[],i.astNode?.directives||[],{onAdded(o){r(nn($.ARGUMENT,o,{argument:i,field:t,type:e},n===null)),et(null,o,r,e,t,i)},onMutual(o){et(o.oldVersion,o.newVersion,r,e,t,i)},onRemoved(o){r(rn($.ARGUMENT,o,{argument:n,field:t,type:e}))}})}var Y3="No longer supported";function Hd(e,t,n,i){Wt(t?.description,n.description)&&(At(t?.description)?i(L3(e,n)):At(n.description)?i(F3(e,t)):i(M3(e,t,n))),At(t)||!cs(t)?cs(n)&&i(U3(e,n)):cs(n)?Wt(t.deprecationReason,n.deprecationReason)&&(At(t.deprecationReason)||t.deprecationReason===Y3?i(G3(e,n)):At(n.deprecationReason)||n.deprecationReason===Y3?i(V3(e,t)):i(z3(e,t,n))):cs(t)&&i(j3(e,t)),!At(t)&&Wt(t.type.toString(),n.type.toString())&&i(B3(e,t,n)),en(t?.args??[],n.args,{onAdded(r){i(q3(e,n,r,t===null))},onRemoved(r){i(W3(e,n,r))},onMutual(r){Z3(e,n,r.oldVersion,r.newVersion,i)}}),tn(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(r){i(nn($.FIELD_DEFINITION,r,{parentType:e,field:n},t===null)),et(null,r,i,e,n)},onMutual(r){et(r.oldVersion,r.newVersion,i,e,n)},onRemoved(r){i(rn($.FIELD_DEFINITION,r,{parentType:e,field:t}))}})}function Q3(e,t,n){let i=e?.getInterfaces()??[],r=t.getInterfaces();en(i,r,{onAdded(a){n(F$(a,t,e===null))},onRemoved(a){n(U$(a,e))}});let o=e?.getFields()??{},s=t.getFields();en(Object.values(o),Object.values(s),{onAdded(a){n(L$(t,a)),Hd(t,null,a,n)},onRemoved(a){n(M$(e,a))},onMutual(a){Hd(t,a.oldVersion,a.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(nn($.INTERFACE_TYPE_DEFINITION,a,t,e===null)),et(null,a,n,t)},onMutual(a){et(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(rn($.INTERFACE_TYPE_DEFINITION,a,e))}})}function X3(e,t,n){let i=e?.getInterfaces()??[],r=t.getInterfaces(),o=e?.getFields()??{},s=t.getFields();en(i,r,{onAdded(a){n(F$(a,t,e===null))},onRemoved(a){n(U$(a,e))}}),en(Object.values(o),Object.values(s),{onAdded(a){n(L$(t,a)),Hd(t,null,a,n)},onRemoved(a){n(M$(e,a))},onMutual(a){Hd(t,a.oldVersion,a.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(nn($.OBJECT,a,t,e===null)),et(null,a,n,t)},onMutual(a){et(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(rn($.OBJECT,a,e))}})}function e8(e,t,n){tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(i){n(nn($.SCALAR_TYPE_DEFINITION,i,t,e===null)),et(null,i,n,t)},onMutual(i){et(i.oldVersion,i.newVersion,n,t)},onRemoved(i){n(rn($.SCALAR_TYPE_DEFINITION,i,e))}})}function KIe(e){return`Member '${e.removedUnionMemberTypeName}' was removed from Union type '${e.unionName}'`}function JIe(e){return{criticality:{level:W.Breaking,reason:"Removing a union member from a union can cause existing queries that use this union member in a fragment spread to error."},type:P.UnionMemberRemoved,message:KIe(e.meta),meta:e.meta,path:e.meta.unionName}}function t8(e,t){return JIe({type:P.UnionMemberRemoved,meta:{unionName:e.name,removedUnionMemberTypeName:t.name}})}function ZIe(e){return`Member '${e.addedUnionMemberTypeName}' was added to Union type '${e.unionName}'`}function YIe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:W.Dangerous,reason:"Adding a possible type to Unions may break existing clients that were not programming defensively against a new possible type."},type:P.UnionMemberAdded,message:ZIe(e.meta),meta:e.meta,path:e.meta.unionName}}function n8(e,t,n){return YIe({type:P.UnionMemberAdded,meta:{unionName:e.name,addedUnionMemberTypeName:t.name,addedToNewType:n}})}function r8(e,t,n){let i=e?.getTypes()??[],r=t.getTypes();en(i,r,{onAdded(o){n(n8(t,o,e===null))},onRemoved(o){n(t8(e,o))}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(nn($.UNION_TYPE_DEFINITION,o,t,e===null)),et(null,o,n,t)},onMutual(o){et(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(rn($.UNION_TYPE_DEFINITION,o,e))}})}function o8(e,t){let n=[];function i(r){n.push(r)}en((e?.getDirectives()??[]).filter(r=>!Jc(r)),(t?.getDirectives()??[]).filter(r=>!Jc(r)),{onAdded(r){i(QZ(r)),YD(null,r,i)},onRemoved(r){i(YZ(r))},onMutual(r){YD(r.oldVersion,r.newVersion,i)}}),QIe(e,t,i),en(Object.values(e?.getTypeMap()??{}).filter(r=>!MD(r)&&!LD(r)),Object.values(t?.getTypeMap()??{}).filter(r=>!MD(r)&&!LD(r)),{onAdded(r){i(f3(r)),i8(null,r,i)},onRemoved(r){i(p3(r))},onMutual(r){i8(r.oldVersion,r.newVersion,i)}}),tn(e?.astNode?.directives||[],t?.astNode?.directives||[],{onAdded(r){i(nn($.SCHEMA_DEFINITION,r,t,!1)),et(null,r,i)},onMutual(r){et(r.oldVersion,r.newVersion,i)},onRemoved(r){i(rn($.SCHEMA_DEFINITION,r,e))}});for(let r=0;r{let a=await o;return s({changes:a,oldSchema:e,newSchema:t,config:i})},Promise.resolve(r))}var j$="graphql-inspector",XD={id:"graphql",source:"graphql-diff",tool:j$,weight:1,originClass:"computed-artifact",config:{enabled:"graphql",paths:"graphqlSchemas"},handles(e,t){return/\.(graphql|graphqls|gql|sdl)$/i.test(e)?/\b(type|interface|enum|union|input|scalar|schema|directive)\b/.test(t):!1},async compute(e){let t,n;try{t=ah(e.before,{assumeValidSDL:!0}),n=ah(e.after,{assumeValidSDL:!0})}catch(o){return ma(j$,"parse-failed",`${e.path} could not be parsed as GraphQL SDL on both sides of this change: ${o.message}`)}let i;try{i=await QD(t,n)}catch(o){return ma(j$,"toolchain-failed",`graphql-inspector could not compare ${e.path}: ${o.message}`)}let r=[];for(let o of i){let s=o.criticality?.level;if(s!=="BREAKING"&&s!=="DANGEROUS")continue;let a=o.path??o.type;r.push({code:s8(o.type,s),location:a,pointer:`${e.path}#${a}`,detail:o.message})}return{available:!0,changes:r,tool:j$,weight:1,locator:`${e.path} (GraphQL SDL)`}},codes:{"graphql-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL field \`${e}\` was removed. Every query, mutation, or fragment in this repository that selects it will now be rejected outright \u2014 the whole document fails validation, not just that selection. Find those documents and migrate each to the replacement field; if there is none, propagate the absence rather than substituting a placeholder.`},"graphql-input-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL input field \`${e}\` no longer exists. Stop sending it: an unknown field on an input object fails validation, so every variable payload and inline argument that still carries it will be rejected.`},"graphql-type-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"type",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL type \`${e}\` no longer exists. Every fragment on it, every \`... on ${e}\` inline fragment, and every variable declared with it must be migrated. If there is no replacement type, leave the operation intact with a clearly-marked TODO and explain it in the PR description.`},"graphql-type-kind-changed":{kind:"type-change",taxonomy:{nature:"type-contract",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`\`${e}\` changed kind: ${t} Selections written against the old kind are no longer valid \u2014 an object's field selection does not survive becoming a union or a scalar. Rewrite each selection set for the new kind rather than adjusting it in place.`},"graphql-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL field \`${e}\` changed: ${t} Update the sub-selection and any client-side parsing of the value. A field that became nullable can now return null where the code assumed a value \u2014 handle that explicitly rather than asserting it away.`},"graphql-input-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL input field \`${e}\` changed: ${t} Update every variable payload that sets it so the value sent matches the new type.`},"graphql-argument-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL argument \`${e}\` was removed. Stop passing it \u2014 an unknown argument fails validation, so the whole operation is rejected, not just that argument.`},"graphql-argument-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL argument \`${e}\` changed: ${t} Update the variable declarations and the values passed at every call site.`},"graphql-argument-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is now required and has no default. Supply it in every operation that reaches this field, using a value that preserves the previous behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`},"graphql-argument-default-changed":{kind:"default-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The default value of \`${e}\` changed: ${t} Operations that omit it will silently behave differently. Pass the old value explicitly wherever the previous behaviour was intended.`},"graphql-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL enum value \`${e}\` was removed. Find code that sends it and map it onto a still-supported value; code that only *reads* the enum should keep its fallback branch, since a stored value may still carry the old name.`},"graphql-enum-value-added":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is a new value this code has never seen returned. Add explicit handling; make sure exhaustive switches and mapping tables over that enum have a safe default rather than falling through silently.`},"graphql-union-member-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A union or interface membership changed: ${t} An \`... on ${e}\` fragment against a type that is no longer a member fails validation. Rewrite those fragments for the members the schema still declares.`},"graphql-directive-removed":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A GraphQL directive changed or was removed: ${t} Every operation that applies \`${e}\` \u2014 or applies it where it is no longer allowed \u2014 fails validation. Remove or relocate those usages.`},"graphql-root-type-changed":{kind:"moved-export",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The root operation type \`${e}\` changed: ${t} Every operation of that kind is now rooted somewhere else \u2014 check that the top-level selections in this repository's documents still exist on the new root.`},"graphql-schema-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`graphql-inspector reports a breaking schema change at \`${e}\`: ${t} Update the operations in this repository that touch it.`}}};function s8(e,t){switch(e){case"FIELD_REMOVED":return"graphql-field-removed";case"INPUT_FIELD_REMOVED":return"graphql-input-field-removed";case"TYPE_REMOVED":return"graphql-type-removed";case"TYPE_KIND_CHANGED":return"graphql-type-kind-changed";case"FIELD_TYPE_CHANGED":return"graphql-field-type-changed";case"INPUT_FIELD_TYPE_CHANGED":return"graphql-input-field-type-changed";case"FIELD_ARGUMENT_REMOVED":case"DIRECTIVE_ARGUMENT_REMOVED":return"graphql-argument-removed";case"FIELD_ARGUMENT_TYPE_CHANGED":case"DIRECTIVE_ARGUMENT_TYPE_CHANGED":return"graphql-argument-type-changed";case"FIELD_ARGUMENT_ADDED":case"INPUT_FIELD_ADDED":case"DIRECTIVE_ARGUMENT_ADDED":return t==="BREAKING"?"graphql-argument-now-required":"graphql-schema-changed";case"FIELD_ARGUMENT_DEFAULT_CHANGED":case"INPUT_FIELD_DEFAULT_VALUE_CHANGED":case"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED":return"graphql-argument-default-changed";case"ENUM_VALUE_REMOVED":return"graphql-enum-value-removed";case"ENUM_VALUE_ADDED":return"graphql-enum-value-added";case"UNION_MEMBER_REMOVED":case"UNION_MEMBER_ADDED":case"OBJECT_TYPE_INTERFACE_REMOVED":return"graphql-union-member-removed";case"DIRECTIVE_REMOVED":case"DIRECTIVE_LOCATION_REMOVED":case"DIRECTIVE_REPEATABLE_REMOVED":return"graphql-directive-removed";case"SCHEMA_QUERY_TYPE_CHANGED":case"SCHEMA_MUTATION_TYPE_CHANGED":case"SCHEMA_SUBSCRIPTION_TYPE_CHANGED":return"graphql-root-type-changed";default:return"graphql-schema-changed"}}var XIe=["openapi-diff","protobuf-diff","graphql-diff"];function a8(e){return XIe.includes(e)}var el=[LP,FP,XD];var u8=Object.fromEntries(el.map(e=>[e.source,e.weight])),d8=Object.fromEntries(el.map(e=>[e.source,e.originClass])),e0e=Object.fromEntries(el.flatMap(e=>Object.entries(e.codes)));function eO(e){return e0e[e]}function p8(e,t){return t.evidence[e.config.enabled]===!0}function f8(e,t){let n=t.evidence[e.config.paths];return Array.isArray(n)?n:[]}var t0e=12e4;async function m8(e,t,n){let i=await(0,z$.mkdtemp)((0,l8.join)((0,c8.tmpdir)(),"drift-spec-"));try{return await e.compute({path:t.path,before:t.before,after:t.after,siblings:n.siblings??[],workdir:i,exec:n.exec??Xe,logger:n.logger,...n.env?{env:n.env}:{},timeoutMs:n.timeoutMs??t0e})}catch(r){return n.logger.debug(`Spec diff crashed for ${t.path}: ${r.message}`),{available:!1,reason:"toolchain-failed",detail:`Drift could not compare ${t.path}: ${r.message}`,tool:e.tool}}finally{await(0,z$.rm)(i,{recursive:!0,force:!0}).catch(()=>{})}}var g8=require("node:crypto"),Ra=require("node:fs/promises"),h8=require("node:path");function y8(e){let t=Lc();return t?(0,h8.join)(t,`artifact-${(0,g8.createHash)("sha256").update(e).digest("hex")}.json`):null}async function Na(e){let t=y8(e);if(!t)return null;try{let n=JSON.parse(await(0,Ra.readFile)(t,"utf8"));return n.format!==1||n.key!==e?null:(nt("artifact.cache.hit"),n.value)}catch{return nt("artifact.cache.miss"),null}}async function Ca(e,t){let n=y8(e);if(n)try{await(0,Ra.mkdir)(Lc(),{recursive:!0});let i=`${n}.${process.pid}.partial`;await(0,Ra.writeFile)(i,JSON.stringify({format:1,key:e,value:t}),"utf8"),await(0,Ra.rename)(i,n)}catch{}}var V$=require("node:zlib");function n0e(e){return e.length>2&&e[0]===31&&e[1]===139}function r0e(e){return e.length>4&&e[0]===80&&e[1]===75}var b8=200*1024*1024;function Fn(e,t={}){let n=t.maxDecompressedBytes??b8;return r0e(e)?tO(e,{maxDecompressedBytes:n}):c0e(n0e(e)?(0,V$.gunzipSync)(e,{maxOutputLength:n}):e)}var i0e=101010256,o0e=33639248;function tO(e,t={}){let n=t.maxDecompressedBytes??b8,i=a0e(e);if(i===-1)return[];let r=e.readUInt16LE(i+10),o=e.readUInt32LE(i+16),s=[];for(let a=0;ae.length||e.readUInt32LE(o)!==o0e);a++){let c=e.readUInt16LE(o+10),l=e.readUInt32LE(o+20),u=e.readUInt32LE(o+24),d=e.readUInt16LE(o+28),p=e.readUInt16LE(o+30),f=e.readUInt16LE(o+32),m=e.readUInt32LE(o+42),g=e.toString("utf8",o+46,o+46+d);o+=46+d+p+f,!g.endsWith("/")&&s.push({path:g,size:u,read:()=>s0e(e,m,c,l,n)})}return s}function s0e(e,t,n,i,r){let o=e.readUInt16LE(t+26),s=e.readUInt16LE(t+28),a=t+30+o+s,c=e.subarray(a,a+i);if(n===0){if(c.length>r)throw new Error(`Stored zip entry exceeds the ${r}-byte decompressed-size limit.`);return Buffer.from(c)}if(n===8)return(0,V$.inflateRawSync)(c,{maxOutputLength:r});throw new Error(`Unsupported zip compression method ${n}`)}function a0e(e){let t=Math.max(0,e.length-65535-22);for(let n=e.length-22;n>=t;n--)if(e.readUInt32LE(n)===i0e)return n;return-1}var fh=512;function c0e(e){let t=[],n=0,i=null;for(;n+fh<=e.length;){let r=e.subarray(n,n+fh);if(r[0]===0)break;let o=G$(r.subarray(0,100)),s=l0e(r.subarray(124,136)),a=String.fromCharCode(r[156]??0),c=G$(r.subarray(345,500)),l=n+fh,u=l+s;if(n=l+Math.ceil(s/fh)*fh,a==="L"){i=G$(e.subarray(l,u));continue}if(a==="x"||a==="X"){i=u0e(e.subarray(l,u))??i;continue}if(a!=="0"&&a!=="\0"&&a!=="7"){i=null;continue}let d=i??(c?`${c}/${o}`:o);if(i=null,!d)continue;let p=e.subarray(l,u);t.push({path:d,size:s,read:()=>Buffer.from(p)})}return t}function G$(e){let t=e.indexOf(0);return e.toString("utf8",0,t===-1?e.length:t).trim()}function l0e(e){let t=G$(e).replace(/[^0-7]/g,"");return t?Number.parseInt(t,8):0}function u0e(e){for(let t of e.toString("utf8").split(` -`)){let n=/^\d+\s+path=(.*)$/.exec(t);if(n)return n[1]}return null}function d0e(e){return/^[aeiou]/i.test(e.trim())?"an":"a"}function Eo(e){return`${d0e(e)} ${e}`}var j8="https://data.jsdelivr.com/v1/packages/npm",dO="https://cdn.jsdelivr.net/npm",p0e="https://registry.npmjs.org",f0e=50*1024*1024,v8=200*1024*1024,w8=20*1024*1024,B$=new Map;function tl(e,t,n={}){if(n.traversal)return m0e+=1,En("surface",e,()=>$8(e,t,n));let i=`${e}@${t}#${n.followDependencies===!1?"own":"deps"}`+(n.subpath?`#${n.subpath}`:""),r=B$.get(i);if(r)return nt("surface.cache.hit"),r;nt("surface.cache.miss");let o=En("surface",e,()=>$8(e,t,n));return B$.set(i,o),o.then(s=>{s||B$.delete(i)},()=>B$.delete(i)),o}var m0e=0;var g0e=6;function h0e(e,t,n,i){return`npm-surface:v${g0e}:${e}@${t}#${n?"deps":"own"}`+(i?`#${i}`:"")}async function y0e(e,t,n,i){let r=fO(z8(n?.exports,i)),o=[...r?gh(nl(r)):[],...gh(nl(i))],s=[...new Set(o)],a=await pO(e,t,s);if(a!==void 0)return a;for(let c of s)if(await Q$(e,t,c))return c;return null}function k8(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function z8(e,t){if(!e||typeof e!="object")return;let n=e;for(let i of[`./${t}`,t])if(i in n)return n[i]}async function $8(e,t,n){let i=n.followDependencies!==!1,r=h0e(e,t,i,n.subpath),o=await Na(r);if(o)return nt("surface.diskCache.hit"),{...o,incomplete:o.incomplete??!1,api:new Map(o.api)};nt("surface.diskCache.miss");let s=await oO(e,t),a=n.subpath?await y0e(e,t,s,n.subpath):await P0e(e,t,s),c=a?await En("surface-sources",e,()=>nO(e,t,a)):{sources:[],truncated:!1};if(!a||c.sources.length===0){let h=await $0e(e,t);if(!h)throw new Kd(e,t);if(s=h.manifest,a=n.subpath?await O0e(s,n.subpath,h.files):D0e(e,s,h.files),a&&(c=await En("surface-sources",e,()=>nO(e,t,a,h)),c.sources.length===0))throw new Kd(e,t)}if(!a){if(a=await M0e(e,t,n.subpath),!a)return null;c=await En("surface-sources",e,()=>nO(e,t,a))}let l=c.sources,u=c.truncated;if(nt("surface.declarationFiles",l.length),l.length===0)return null;let d=new Map,p=[];for(let h of l)B0e(h.content,h.path,d,p,e);K0e(d,p),q8(d);let f=d.size,m=!s||!i?{followed:[],attempted:!1,incomplete:!1}:await En("surface-deps",e,()=>I0e(s,l,d,`${e}@${t}`,n.traversal)),g=d.size>0?{api:d,entryPath:a,viaDependencies:m.followed,ownSymbols:f,subpaths:C0e(s?.exports),incomplete:m.incomplete||u}:null;return g&&!m.attempted&&!g.incomplete&&await Ca(r,{...g,api:[...g.api]}),g}var Y$=class extends Error{constructor(n,i){super(`${n}@${i} could not be fetched`);this.packageName=n;this.version=i;this.name="VersionUnavailableError"}packageName;version},Kd=class extends Error{constructor(n,i){super(`${n}@${i} artifact could not be inspected`);this.packageName=n;this.version=i;this.name="ArtifactUnavailableError"}packageName;version};function oO(e,t){return $e(`${dO}/${e}@${t}/package.json`)}async function G8(e,t,n){let[i,r]=await Promise.all([oO(e,t),oO(e,n)]);if(!i||!r)return[];let o=_8(e,i),s=_8(e,r),a=[],c=[...o.requireConditions].filter(u=>!s.requireConditions.has(u)&&!s.commonJsExports.has(u));for(let u of c){let d=aO(e,u),p=w0e(u)?"affectedSpecifierPatterns":"affectedSpecifiers";a.push({kind:"exports-require-condition-removed",symbol:e,detail:u==="."?"The root CommonJS export condition was removed":`The CommonJS export condition for ${u} was removed`,before:[...o.requireConditions].sort().join(` +`))}var dn={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function f8(e,t){let n=t({getNamedType:c,setNamedType:l,getNamedTypes:u}),r=new Map;for(let E of e.types){let T=E.name,A=d(E);A&&r.set(T,A)}let i=[];for(let E of e.directives){if(Lc(E)){i.push(E);continue}let T=S(E.toConfig());T&&i.push(new En(T))}let o={...e,query:e.query&&c(e.query.name),mutation:e.mutation&&c(e.mutation.name),subscription:e.subscription&&c(e.subscription.name),types:Array.from(r.values()),directives:i},s=n[dn.SCHEMA];return s==null?o:s(o);function a(E){return Ke(E)?new Wt(a(E.ofType)):Te(E)?new _e(a(E.ofType)):c(E.name)}function c(E){let T=kTe.get(E)??r.get(E);return T===void 0&&rt(!1,`Unknown type: "${E}".`),T}function l(E){r.set(E.name,E)}function u(){return Array.from(r.values())}function d(E){if(oO(E)||QD(E))return E;if(fr(E))return p(E);if(st(E))return f(E);if(qe(E))return h(E);if(Qt(E))return v(E);if(Xt(E))return b(E);if(He(E))return k(E);rt(!1,"Unexpected type: "+de(E))}function p(E){let T=E.toConfig(),A=n[dn.SCALAR];return T=A==null?T:A(T),new pr(T)}function f(E){let T=E.toConfig(),A={...T,interfaces:()=>T.interfaces.map(j=>c(j.name)),fields:()=>m(T.fields,E.name)},R=n[dn.OBJECT];return A=R==null?A:R(A),new Yn(A)}function m(E,T){let A=Object.create(null);for(let[R,j]of Object.entries(E)){let U={...j,type:a(j.type),args:g(j.args,R,T)},Z=n[dn.FIELD];Z&&(U=Z(U,T)),A[R]=U}return A}function g(E,T,A){let R=Object.create(null);for(let[j,U]of Object.entries(E)){let Z={...U,type:a(U.type)},re=n[dn.ARGUMENT];re&&(Z=re(Z,T,A)),R[j]=Z}return R}function h(E){let T=E.toConfig(),A={...T,interfaces:()=>T.interfaces.map(j=>c(j.name)),fields:()=>m(T.fields,E.name)},R=n[dn.INTERFACE];return A=R==null?A:R(A),new rs(A)}function v(E){let T=E.toConfig(),A={...T,types:()=>T.types.map(j=>c(j.name))},R=n[dn.UNION];return A=R==null?A:R(A),new is(A)}function b(E){let T=E.toConfig(),A={...T,values:()=>{let j=Object.create(null);for(let[U,Z]of Object.entries(T.values)){let re=w(Z,U,E.name);j[U]=re}return j}},R=n[dn.ENUM];return A=R==null?A:R(A),new mi(A)}function w(E,T,A){let R={...E},j=n[dn.ENUM_VALUE];return j==null?R:j(R,T,A)}function k(E){let T=E.toConfig(),A={...T,fields:()=>{let j=Object.create(null);for(let[U,Z]of Object.entries(T.fields)){let re=$(Z,U,E.name);j[U]=re}return j}},R=n[dn.INPUT_OBJECT];return A=R==null?A:R(A),new os(A)}function $(E,T,A){let R={...E,type:a(E.type)},j=n[dn.INPUT_FIELD];return j==null?R:j(R,T,A)}function S(E){let T={...E,args:g(E.args,E.name,void 0)},A=n[dn.DIRECTIVE];return A==null?T:A(T)}}var kTe=new Map([...ha,...va].map(e=>[e.name,e]));function m8(e,t,n){let r=[],i=new Rr,o=new Rr,s=new Rr,a=new Rr,c=new Rr,l=new Rr,u=new Rr,d=[],p,f=[],m=!1;for(let g of t.definitions){switch(g.kind){case _.SCHEMA_DEFINITION:p=g;break;case _.SCHEMA_EXTENSION:f.push(g);break;case _.DIRECTIVE_DEFINITION:d.push(g);break;case _.DIRECTIVE_EXTENSION:u.add(g.name.value,g);break;case _.SCALAR_TYPE_DEFINITION:case _.OBJECT_TYPE_DEFINITION:case _.INTERFACE_TYPE_DEFINITION:case _.UNION_TYPE_DEFINITION:case _.ENUM_TYPE_DEFINITION:case _.INPUT_OBJECT_TYPE_DEFINITION:r.push(g);break;case _.SCALAR_TYPE_EXTENSION:i.add(g.name.value,g);break;case _.OBJECT_TYPE_EXTENSION:o.add(g.name.value,g);break;case _.INTERFACE_TYPE_EXTENSION:s.add(g.name.value,g);break;case _.UNION_TYPE_EXTENSION:a.add(g.name.value,g);break;case _.ENUM_TYPE_EXTENSION:c.add(g.name.value,g);break;case _.INPUT_OBJECT_TYPE_EXTENSION:l.add(g.name.value,g);break;default:continue}m=!0}return m?f8(e,g=>{let{getNamedType:h,setNamedType:v,getNamedTypes:b}=g;return{[dn.SCHEMA]:L=>{for(let se of r){let ae=_Te.get(se.name.value)??re(se);v(ae)}let te={query:L.query&&h(L.query.name),mutation:L.mutation&&h(L.mutation.name),subscription:L.subscription&&h(L.subscription.name),...p&&w([p]),...w(f)};return{description:p?.description?.value??L.description,...te,types:b(),directives:[...L.directives.map(E),...d.map(S)],extensions:L.extensions,astNode:p??L.astNode,extensionASTNodes:L.extensionASTNodes.concat(f),assumeValid:n?.assumeValid??!1}},[dn.INPUT_OBJECT]:L=>{let te=l.get(L.name)??[];return{...L,fields:()=>({...L.fields(),...R(te)}),extensionASTNodes:L.extensionASTNodes.concat(te)}},[dn.ENUM]:L=>{let te=c.get(L.name)??[];return{...L,values:()=>({...L.values(),...j(te)}),extensionASTNodes:L.extensionASTNodes.concat(te)}},[dn.SCALAR]:L=>{let te=i.get(L.name)??[],se=L.specifiedByURL;for(let ae of te)se=RO(ae)??se;return{...L,specifiedByURL:se,extensionASTNodes:L.extensionASTNodes.concat(te)}},[dn.OBJECT]:L=>{let te=o.get(L.name)??[];return{...L,interfaces:()=>[...L.interfaces(),...U(te)],fields:()=>({...L.fields(),...T(te)}),extensionASTNodes:L.extensionASTNodes.concat(te)}},[dn.INTERFACE]:L=>{let te=s.get(L.name)??[];return{...L,interfaces:()=>[...L.interfaces(),...U(te)],fields:()=>({...L.fields(),...T(te)}),extensionASTNodes:L.extensionASTNodes.concat(te)}},[dn.UNION]:L=>{let te=a.get(L.name)??[];return{...L,types:()=>[...L.types(),...Z(te)],extensionASTNodes:L.extensionASTNodes.concat(te)}}};function w(L){let te={};for(let se of L){let ae=se.operationTypes??[];for(let Se of ae)te[Se.operation]=k(Se.type)}return te}function k(L){let te=L.name.value,se=h(te);return se===void 0&&rt(!1,`Unknown type: "${te}".`),se}function $(L){return L.kind===_.LIST_TYPE?new Wt($(L.type)):L.kind===_.NON_NULL_TYPE?new _e($(L.type)):k(L)}function S(L){let te=u.get(L.name.value)??[],se=zc(L)??te.map(ae=>zc(ae)).find(ae=>ae!=null);return new En({name:L.name.value,description:L.description?.value,locations:L.locations.map(({value:ae})=>ae),isRepeatable:L.repeatable,args:A(L.arguments),deprecationReason:se,astNode:L,extensionASTNodes:te})}function E(L){let te=u.get(L.name)??[];if(te.length===0)return L;let se=L.deprecationReason??te.map(ae=>zc(ae)).find(ae=>ae!=null);return new En({...L.toConfig(),deprecationReason:se,extensionASTNodes:L.extensionASTNodes.concat(te)})}function T(L){let te=Object.create(null);for(let se of L){let ae=se.fields??[];for(let Se of ae)te[Se.name.value]={type:$(Se.type),description:Se.description?.value,args:A(Se.arguments),deprecationReason:zc(Se),astNode:Se}}return te}function A(L){let te=L??[],se=Object.create(null);for(let ae of te){let Se=$(ae.type);se[ae.name.value]={type:Se,description:ae.description?.value,default:ae.defaultValue&&{literal:ae.defaultValue},deprecationReason:zc(ae),astNode:ae}}return se}function R(L){let te=Object.create(null);for(let se of L){let ae=se.fields??[];for(let Se of ae){let We=$(Se.type);te[Se.name.value]={type:We,description:Se.description?.value,default:Se.defaultValue&&{literal:Se.defaultValue},deprecationReason:zc(Se),astNode:Se}}}return te}function j(L){let te=Object.create(null);for(let se of L){let ae=se.values??[];for(let Se of ae)te[Se.name.value]={description:Se.description?.value,deprecationReason:zc(Se),astNode:Se}}return te}function U(L){return L.flatMap(te=>te.interfaces?.map(k)??[])}function Z(L){return L.flatMap(te=>te.types?.map(k)??[])}function re(L){let te=L.name.value;switch(L.kind){case _.OBJECT_TYPE_DEFINITION:{let se=o.get(te)??[],ae=[L,...se];return new Yn({name:te,description:L.description?.value,interfaces:()=>U(ae),fields:()=>T(ae),astNode:L,extensionASTNodes:se})}case _.INTERFACE_TYPE_DEFINITION:{let se=s.get(te)??[],ae=[L,...se];return new rs({name:te,description:L.description?.value,interfaces:()=>U(ae),fields:()=>T(ae),astNode:L,extensionASTNodes:se})}case _.ENUM_TYPE_DEFINITION:{let se=c.get(te)??[],ae=[L,...se];return new mi({name:te,description:L.description?.value,values:()=>j(ae),astNode:L,extensionASTNodes:se})}case _.UNION_TYPE_DEFINITION:{let se=a.get(te)??[],ae=[L,...se];return new is({name:te,description:L.description?.value,types:()=>Z(ae),astNode:L,extensionASTNodes:se})}case _.SCALAR_TYPE_DEFINITION:{let se=i.get(te)??[],ae=RO(L);for(let Se of se)ae=RO(Se)??ae;return new pr({name:te,description:L.description?.value,specifiedByURL:ae,astNode:L,extensionASTNodes:se})}case _.INPUT_OBJECT_TYPE_DEFINITION:{let se=l.get(te)??[],ae=[L,...se];return new os({name:te,description:L.description?.value,fields:()=>R(ae),astNode:L,extensionASTNodes:se,isOneOf:$Te(L)})}}}}):e}var _Te=new Map([...ha,...va].map(e=>[e.name,e]));function zc(e){return Sd(Hr,e)?.reason}function RO(e){return Sd(gh,e)?.url}function $Te(e){return!!Sd(hh,e)}function PO(e,t){t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&p8(e);let r=m8({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(r.astNode==null)for(let o of r.types)switch(o.name){case"Query":r.query=o;break;case"Mutation":r.mutation=o;break;case"Subscription":r.subscription=o;break}let i=[...r.directives,...mr.filter(o=>r.directives.every(s=>s.name!==o.name))];return new vh({...r,directives:i})}function Sh(e,t){let n=cO(e,{noLocation:t?.noLocation,experimentalFragmentArguments:t?.experimentalFragmentArguments});return PO(n,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}function _a(e,t,n){if(e){if(e.kind===_.VARIABLE){let r=e.name.value;if(n==null||!Object.hasOwn(n,r))return;let i=n[r];return i===void 0||i===null&&Te(t)?void 0:i}if(Te(t))return e.kind===_.NULL?void 0:_a(e,t.ofType,n);if(e.kind===_.NULL)return null;if(Ke(t)){let r=t.ofType;if(e.kind===_.LIST){let o=[];for(let s of e.values)if(g8(s,n)){if(Te(r))return;o.push(null)}else{let a=_a(s,r,n);if(a===void 0)return;o.push(a)}return o}let i=_a(e,r,n);return i===void 0?void 0:[i]}if(He(t)){if(e.kind!==_.OBJECT)return;let r=Object.create(null),i=t.getFields();if(e.fields.some(a=>!Object.hasOwn(i,a.name.value)))return;let s=new Map(e.fields.map(a=>[a.name.value,a]));for(let a of Object.values(i)){let c=s.get(a.name);if(c==null||g8(c.value,n)){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(Te(a.type))return;continue}let l=_a(c.value,a.type,n);if(l===void 0)return;r[a.name]=l}if(t.isOneOf){let a=Object.keys(r);if(s.size!==1||a.length!==1)return;for(let[c,l]of s)if(l.value.kind===_.NULL||r[c]===null)return}return r}if(gi(t)){let r;try{r=t.parseLiteral(e,n)}catch{return}return r===void 0?void 0:r}rt(!1,"Unexpected input type: "+de(t))}}function g8(e,t){return e.kind===_.VARIABLE&&(t?.[e.name.value]===void 0||!Object.hasOwn(t,e.name.value))}function ls(e){return"isDeprecated"in e?!!e.isDeprecated:!!(e.deprecationReason!=null||e.astNode?.directives?.some(t=>t.name.value==="deprecated"))}function Kr(e){return e.default!==void 0?e.default.literal!==void 0?_a(e.default.literal,e.type):$o(e.default.value,e.type):e.defaultValue}function Ed(e){return e.default!==void 0||e.defaultValue!==void 0}function Td(e,t){return CO(e==null?void 0:Kr(e),Kr(t))}function CO(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,r)=>CO(n,t[r]));if(e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"){let n=e,r=t,i=Object.keys(n),o=Object.keys(r);return i.length===o.length&&i.every(s=>Object.prototype.hasOwnProperty.call(r,s)&&CO(n[s],r[s]))}return!1}function xh(e,t){if(!Wi(e)&&!Wi(t))return e.toString()===t.toString();if(Te(t)){let n=Te(e)?e.ofType:e;return xh(n,t.ofType)}return Ke(e)?Ke(t)&&xh(e.ofType,t.ofType)||Te(t)&&xh(e,t.ofType):!1}function $a(e,t){if(!Wi(e)&&!Wi(t))return e?.toString()===t.toString();if(Ke(e)&&Ke(t))return $a(e.ofType,t.ofType);if(Te(e)){let n=Te(t)?t.ofType:t;return $a(e.ofType,n)}return!1}function Eh(e){return e.astNode?.kind||""}function NO(e){return["String","Int","Float","Boolean","ID"].includes(typeof e=="string"?e:e.name)}function DO(e){return["__Schema","__Type","__TypeKind","__Field","__InputValue","__EnumValue","__Directive","__DirectiveLocation"].includes(typeof e=="string"?e:e.name)}var K;(function(e){e.Breaking="BREAKING",e.NonBreaking="NON_BREAKING",e.Dangerous="DANGEROUS"})(K||(K={}));var M={FieldArgumentDescriptionChanged:"FIELD_ARGUMENT_DESCRIPTION_CHANGED",FieldArgumentDefaultChanged:"FIELD_ARGUMENT_DEFAULT_CHANGED",FieldArgumentTypeChanged:"FIELD_ARGUMENT_TYPE_CHANGED",DirectiveRemoved:"DIRECTIVE_REMOVED",DirectiveAdded:"DIRECTIVE_ADDED",DirectiveDescriptionChanged:"DIRECTIVE_DESCRIPTION_CHANGED",DirectiveLocationAdded:"DIRECTIVE_LOCATION_ADDED",DirectiveLocationRemoved:"DIRECTIVE_LOCATION_REMOVED",DirectiveArgumentAdded:"DIRECTIVE_ARGUMENT_ADDED",DirectiveArgumentRemoved:"DIRECTIVE_ARGUMENT_REMOVED",DirectiveArgumentDescriptionChanged:"DIRECTIVE_ARGUMENT_DESCRIPTION_CHANGED",DirectiveArgumentDefaultValueChanged:"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED",DirectiveArgumentTypeChanged:"DIRECTIVE_ARGUMENT_TYPE_CHANGED",DirectiveRepeatableAdded:"DIRECTIVE_REPEATABLE_ADDED",DirectiveRepeatableRemoved:"DIRECTIVE_REPEATABLE_REMOVED",EnumValueRemoved:"ENUM_VALUE_REMOVED",EnumValueAdded:"ENUM_VALUE_ADDED",EnumValueDescriptionChanged:"ENUM_VALUE_DESCRIPTION_CHANGED",EnumValueDeprecationReasonChanged:"ENUM_VALUE_DEPRECATION_REASON_CHANGED",EnumValueDeprecationReasonAdded:"ENUM_VALUE_DEPRECATION_REASON_ADDED",EnumValueDeprecationReasonRemoved:"ENUM_VALUE_DEPRECATION_REASON_REMOVED",FieldRemoved:"FIELD_REMOVED",FieldAdded:"FIELD_ADDED",FieldDescriptionChanged:"FIELD_DESCRIPTION_CHANGED",FieldDescriptionAdded:"FIELD_DESCRIPTION_ADDED",FieldDescriptionRemoved:"FIELD_DESCRIPTION_REMOVED",FieldDeprecationAdded:"FIELD_DEPRECATION_ADDED",FieldDeprecationRemoved:"FIELD_DEPRECATION_REMOVED",FieldDeprecationReasonChanged:"FIELD_DEPRECATION_REASON_CHANGED",FieldDeprecationReasonAdded:"FIELD_DEPRECATION_REASON_ADDED",FieldDeprecationReasonRemoved:"FIELD_DEPRECATION_REASON_REMOVED",FieldTypeChanged:"FIELD_TYPE_CHANGED",FieldArgumentAdded:"FIELD_ARGUMENT_ADDED",FieldArgumentRemoved:"FIELD_ARGUMENT_REMOVED",InputFieldRemoved:"INPUT_FIELD_REMOVED",InputFieldAdded:"INPUT_FIELD_ADDED",InputFieldDescriptionAdded:"INPUT_FIELD_DESCRIPTION_ADDED",InputFieldDescriptionRemoved:"INPUT_FIELD_DESCRIPTION_REMOVED",InputFieldDescriptionChanged:"INPUT_FIELD_DESCRIPTION_CHANGED",InputFieldDefaultValueChanged:"INPUT_FIELD_DEFAULT_VALUE_CHANGED",InputFieldTypeChanged:"INPUT_FIELD_TYPE_CHANGED",ObjectTypeInterfaceAdded:"OBJECT_TYPE_INTERFACE_ADDED",ObjectTypeInterfaceRemoved:"OBJECT_TYPE_INTERFACE_REMOVED",SchemaQueryTypeChanged:"SCHEMA_QUERY_TYPE_CHANGED",SchemaMutationTypeChanged:"SCHEMA_MUTATION_TYPE_CHANGED",SchemaSubscriptionTypeChanged:"SCHEMA_SUBSCRIPTION_TYPE_CHANGED",TypeRemoved:"TYPE_REMOVED",TypeAdded:"TYPE_ADDED",TypeKindChanged:"TYPE_KIND_CHANGED",TypeDescriptionChanged:"TYPE_DESCRIPTION_CHANGED",TypeDescriptionRemoved:"TYPE_DESCRIPTION_REMOVED",TypeDescriptionAdded:"TYPE_DESCRIPTION_ADDED",UnionMemberRemoved:"UNION_MEMBER_REMOVED",UnionMemberAdded:"UNION_MEMBER_ADDED",DirectiveUsageUnionMemberAdded:"DIRECTIVE_USAGE_UNION_MEMBER_ADDED",DirectiveUsageUnionMemberRemoved:"DIRECTIVE_USAGE_UNION_MEMBER_REMOVED",DirectiveUsageEnumAdded:"DIRECTIVE_USAGE_ENUM_ADDED",DirectiveUsageEnumRemoved:"DIRECTIVE_USAGE_ENUM_REMOVED",DirectiveUsageEnumValueAdded:"DIRECTIVE_USAGE_ENUM_VALUE_ADDED",DirectiveUsageEnumValueRemoved:"DIRECTIVE_USAGE_ENUM_VALUE_REMOVED",DirectiveUsageInputObjectAdded:"DIRECTIVE_USAGE_INPUT_OBJECT_ADDED",DirectiveUsageInputObjectRemoved:"DIRECTIVE_USAGE_INPUT_OBJECT_REMOVED",DirectiveUsageFieldAdded:"DIRECTIVE_USAGE_FIELD_ADDED",DirectiveUsageFieldRemoved:"DIRECTIVE_USAGE_FIELD_REMOVED",DirectiveUsageScalarAdded:"DIRECTIVE_USAGE_SCALAR_ADDED",DirectiveUsageScalarRemoved:"DIRECTIVE_USAGE_SCALAR_REMOVED",DirectiveUsageObjectAdded:"DIRECTIVE_USAGE_OBJECT_ADDED",DirectiveUsageObjectRemoved:"DIRECTIVE_USAGE_OBJECT_REMOVED",DirectiveUsageInterfaceAdded:"DIRECTIVE_USAGE_INTERFACE_ADDED",DirectiveUsageInterfaceRemoved:"DIRECTIVE_USAGE_INTERFACE_REMOVED",DirectiveUsageArgumentDefinitionAdded:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_ADDED",DirectiveUsageArgumentDefinitionRemoved:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_REMOVED",DirectiveUsageSchemaAdded:"DIRECTIVE_USAGE_SCHEMA_ADDED",DirectiveUsageSchemaRemoved:"DIRECTIVE_USAGE_SCHEMA_REMOVED",DirectiveUsageFieldDefinitionAdded:"DIRECTIVE_USAGE_FIELD_DEFINITION_ADDED",DirectiveUsageFieldDefinitionRemoved:"DIRECTIVE_USAGE_FIELD_DEFINITION_REMOVED",DirectiveUsageInputFieldDefinitionAdded:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_ADDED",DirectiveUsageInputFieldDefinitionRemoved:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_REMOVED",DirectiveUsageArgumentAdded:"DIRECTIVE_USAGE_ARGUMENT_ADDED",DirectiveUsageArgumentRemoved:"DIRECTIVE_USAGE_ARGUMENT_REMOVED"};function h8(e,t){return e.reduce((n,r)=>(n[t(r)]=r,n),Object.create(null))}function X_(e,t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n"u"||e===null}function OO(e,t){return e.filter(n=>!t.some(r=>X_(r,n)))}function yi(e){return typeof e=="string"?e:e.value}function en(e,t,n){let r=h8(e,({name:c})=>yi(c)),i=h8(t,({name:c})=>yi(c)),o=[],s=[],a=[];for(let c of e){let l=i[yi(c.name)]??null;l===null?s.push(c):a.push({newVersion:l,oldVersion:c??null})}for(let c of t)r[yi(c.name)]===void 0&&o.push(c);if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function tn(e,t,n){let r=y8(e,({name:c})=>yi(c)),i=y8(t,({name:c})=>yi(c)),o=[],s=[],a=[];for(let c of e){let l=i[yi(c.name)]??null;if(l===null)s.push(c);else{let[u,...d]=l;d.length>0?i[yi(c.name)]=d:delete i[yi(c.name)],a.push({newVersion:u,oldVersion:c??null})}}for(let c of t){let l=r[yi(c.name)]??null;if(l===null)o.push(c);else{let[u,...d]=l;d.length>0?r[yi(c.name)]=d:delete r[yi(c.name)]}}if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function y8(e,t){return e.reduce((n,r)=>{let i=t(r);return n[i]=[...n[i]??[],r],n},Object.create(null))}function bi(e,t){return e==="deprecated"?K.NonBreaking:e==="oneOf"?K.Breaking:t}function vi(e,t){return e==="deprecated"?K.NonBreaking:e==="oneOf"?K.NonBreaking:t}function ETe(e){return`Directive '${e.addedDirectiveName}' was added to argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function TTe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to argument '${e.meta.argumentName}'`},type:M.DirectiveUsageArgumentDefinitionAdded,message:ETe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function ITe(e){return`Directive '${e.removedDirectiveName}' was removed from argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function ATe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from argument '${e.meta.argumentName}'`},type:M.DirectiveUsageArgumentDefinitionRemoved,message:ITe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function RTe(e){return`Directive '${e.addedDirectiveName}' was added to input object '${e.inputObjectName}'`}function PTe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input object '${e.meta.inputObjectName}'`},type:M.DirectiveUsageInputObjectAdded,message:RTe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function CTe(e){return`Directive '${e.removedDirectiveName}' was removed from input object '${e.inputObjectName}'`}function NTe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input object '${e.meta.inputObjectName}'`},type:M.DirectiveUsageInputObjectRemoved,message:CTe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function DTe(e){return`Directive '${e.addedDirectiveName}' was added to interface '${e.interfaceName}'`}function OTe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to interface '${e.meta.interfaceName}'`},type:M.DirectiveUsageInterfaceAdded,message:DTe(e.meta),path:[e.meta.interfaceName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function MTe(e){return`Directive '${e.removedDirectiveName}' was removed from interface '${e.interfaceName}'`}function LTe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from interface '${e.meta.interfaceName}'`},type:M.DirectiveUsageInterfaceRemoved,message:MTe(e.meta),path:[e.meta.interfaceName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function FTe(e){return`Directive '${e.addedDirectiveName}' was added to input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function jTe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input field '${e.meta.inputFieldName}'`},type:M.DirectiveUsageInputFieldDefinitionAdded,message:FTe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function UTe(e){return`Directive '${e.removedDirectiveName}' was removed from input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function zTe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input field '${e.meta.inputFieldName}'`},type:M.DirectiveUsageInputFieldDefinitionRemoved,message:UTe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function GTe(e){return`Directive '${e.addedDirectiveName}' was added to object '${e.objectName}'`}function BTe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to object '${e.meta.objectName}'`},type:M.DirectiveUsageObjectAdded,message:GTe(e.meta),path:[e.meta.objectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function VTe(e){return`Directive '${e.removedDirectiveName}' was removed from object '${e.objectName}'`}function qTe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from object '${e.meta.objectName}'`},type:M.DirectiveUsageObjectRemoved,message:VTe(e.meta),path:[e.meta.objectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function WTe(e){return`Directive '${e.addedDirectiveName}' was added to enum '${e.enumName}'`}function HTe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum '${e.meta.enumName}'`},type:M.DirectiveUsageEnumAdded,message:WTe(e.meta),path:[e.meta.enumName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function KTe(e){return`Directive '${e.removedDirectiveName}' was removed from enum '${e.enumName}'`}function JTe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum '${e.meta.enumName}'`},type:M.DirectiveUsageEnumRemoved,message:KTe(e.meta),path:[e.meta.enumName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function ZTe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function YTe(e){return{criticality:{level:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:M.DirectiveUsageFieldAdded,message:ZTe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.addedDirectiveName].join("."),meta:e.meta}}function QTe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function XTe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:M.DirectiveUsageFieldDefinitionAdded,message:QTe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function eIe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function tIe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:M.DirectiveUsageFieldRemoved,message:eIe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.removedDirectiveName].join("."),meta:e.meta}}function nIe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function rIe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:M.DirectiveUsageFieldDefinitionRemoved,message:nIe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function iIe(e){return`Directive '${e.addedDirectiveName}' was added to enum value '${e.enumName}.${e.enumValueName}'`}function oIe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:M.DirectiveUsageEnumValueAdded,message:iIe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function sIe(e){return`Directive '${e.removedDirectiveName}' was removed from enum value '${e.enumName}.${e.enumValueName}'`}function aIe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:M.DirectiveUsageEnumValueRemoved,message:sIe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function cIe(e){return`Directive '${e.addedDirectiveName}' was added to schema`}function lIe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to schema`},type:M.DirectiveUsageSchemaAdded,message:cIe(e.meta),path:`.@${e.meta.addedDirectiveName}`,meta:e.meta}}function uIe(e){return`Directive '${e.removedDirectiveName}' was removed from schema`}function dIe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from schema`},type:M.DirectiveUsageSchemaRemoved,message:uIe(e.meta),path:`.@${e.meta.removedDirectiveName}`,meta:e.meta}}function pIe(e){return`Directive '${e.addedDirectiveName}' was added to scalar '${e.scalarName}'`}function fIe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to scalar '${e.meta.scalarName}'`},type:M.DirectiveUsageScalarAdded,message:pIe(e.meta),path:[e.meta.scalarName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function mIe(e){return`Directive '${e.removedDirectiveName}' was removed from scalar '${e.scalarName}'`}function gIe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from scalar '${e.meta.scalarName}'`},type:M.DirectiveUsageScalarRemoved,message:mIe(e.meta),path:[e.meta.scalarName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function hIe(e){return`Directive '${e.addedDirectiveName}' was added to union member '${e.unionName}'`}function yIe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:bi(e.meta.addedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to union member '${e.meta.unionName}.${e.meta.addedUnionMemberTypeName}'`},type:M.DirectiveUsageUnionMemberAdded,message:hIe(e.meta),path:[e.meta.unionName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function bIe(e){return`Directive '${e.removedDirectiveName}' was removed from union member '${e.unionName}'`}function vIe(e){return{criticality:{level:vi(e.meta.removedDirectiveName,K.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from union member '${e.meta.unionName}.${e.meta.removedUnionMemberTypeName}'`},type:M.DirectiveUsageUnionMemberRemoved,message:bIe(e.meta),path:[e.meta.unionName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function nn(e,t,n,r){return Nt(e,_.ARGUMENT,n)?TTe({type:M.DirectiveUsageArgumentDefinitionAdded,meta:{addedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,addedToNewType:r,directiveRepeatedTimes:yt(n.argument.astNode?.directives??[],t)}}):Nt(e,_.INPUT_VALUE_DEFINITION,n)?jTe({type:M.DirectiveUsageInputFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,inputFieldName:n.field.name,inputFieldType:n.field.type.toString(),inputObjectName:n.type.name,addedToNewType:r,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,_.INPUT_OBJECT_TYPE_DEFINITION,n)?PTe({type:M.DirectiveUsageInputObjectAdded,meta:{addedDirectiveName:t.name.value,addedInputFieldName:t.name.value,addedInputFieldType:n.name,inputObjectName:n.name,isAddedInputFieldTypeNullable:e===_.INPUT_VALUE_DEFINITION,addedToNewType:r,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,_.INTERFACE_TYPE_DEFINITION,n)?OTe({type:M.DirectiveUsageInterfaceAdded,meta:{addedDirectiveName:t.name.value,interfaceName:n.name,addedToNewType:r,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,_.OBJECT,n)?BTe({type:M.DirectiveUsageObjectAdded,meta:{objectName:n.name,addedDirectiveName:t.name.value,addedToNewType:r,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,_.ENUM_TYPE_DEFINITION,n)?HTe({type:M.DirectiveUsageEnumAdded,meta:{enumName:n.name,addedDirectiveName:t.name.value,addedToNewType:r,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,_.FIELD,n)?YTe({type:M.DirectiveUsageFieldAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,_.FIELD_DEFINITION,n)?XTe({type:M.DirectiveUsageFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,addedToNewType:r,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,_.UNION_TYPE_DEFINITION,n)?yIe({type:M.DirectiveUsageUnionMemberAdded,meta:{addedDirectiveName:t.name.value,addedUnionMemberTypeName:n.name,unionName:n.name,addedToNewType:r,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,_.ENUM_VALUE_DEFINITION,n)?oIe({type:M.DirectiveUsageEnumValueAdded,meta:{enumName:n.type.name,enumValueName:n.value.name,addedDirectiveName:t.name.value,addedToNewType:r,directiveRepeatedTimes:yt(n.value.astNode?.directives??[],t)}}):Nt(e,_.SCHEMA_DEFINITION,n)?lIe({type:M.DirectiveUsageSchemaAdded,meta:{addedDirectiveName:t.name.value,addedToNewType:r,directiveRepeatedTimes:yt(n?.astNode?.directives??[],t)}}):Nt(e,_.SCALAR_TYPE_DEFINITION,n)?fIe({type:M.DirectiveUsageScalarAdded,meta:{scalarName:n.name,addedDirectiveName:t.name.value,addedToNewType:r,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):{}}function yt(e,t){let n=t.name.value,r=0;for(let i of e)if(i.name.value===n&&(r+=1),i===t)return r;return 0}function rn(e,t,n){return Nt(e,_.ARGUMENT,n)?ATe({type:M.DirectiveUsageArgumentDefinitionRemoved,meta:{removedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,directiveRepeatedTimes:yt(n.argument.astNode?.directives??[],t)}}):Nt(e,_.INPUT_VALUE_DEFINITION,n)?zTe({type:M.DirectiveUsageInputFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,inputFieldName:n.field.name,inputObjectName:n.type.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,_.INPUT_OBJECT_TYPE_DEFINITION,n)?NTe({type:M.DirectiveUsageInputObjectRemoved,meta:{removedDirectiveName:t.name.value,removedInputFieldName:t.name.value,removedInputFieldType:n.name,inputObjectName:n.name,isRemovedInputFieldTypeNullable:e===_.INPUT_VALUE_DEFINITION,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,_.INTERFACE_TYPE_DEFINITION,n)?LTe({type:M.DirectiveUsageInterfaceRemoved,meta:{removedDirectiveName:t.name.value,interfaceName:n.name,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,_.OBJECT,n)?qTe({type:M.DirectiveUsageObjectRemoved,meta:{objectName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,_.ENUM_TYPE_DEFINITION,n)?JTe({type:M.DirectiveUsageEnumRemoved,meta:{enumName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,_.FIELD,n)?tIe({type:M.DirectiveUsageFieldRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,_.FIELD_DEFINITION,n)?rIe({type:M.DirectiveUsageFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,_.UNION_TYPE_DEFINITION,n)?vIe({type:M.DirectiveUsageUnionMemberRemoved,meta:{removedDirectiveName:t.name.value,removedUnionMemberTypeName:n.name,unionName:n.name,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,_.ENUM_VALUE_DEFINITION,n)?aIe({type:M.DirectiveUsageEnumValueRemoved,meta:{enumName:n.type.name,enumValueName:n.value.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.value.astNode?.directives??[],t)}}):Nt(e,_.SCHEMA_DEFINITION,n)?dIe({type:M.DirectiveUsageSchemaRemoved,meta:{removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n?.astNode?.directives??[],t)}}):Nt(e,_.SCALAR_TYPE_DEFINITION,n)?gIe({type:M.DirectiveUsageScalarRemoved,meta:{scalarName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):{}}function Nt(e,t,n){return e===t}function b8(e){return{type:M.DirectiveUsageArgumentAdded,criticality:{level:K.NonBreaking},message:`Argument '${e.meta.addedArgumentName}' was added to '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.addedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function v8(e){return{type:M.DirectiveUsageArgumentRemoved,criticality:{level:K.Dangerous,reason:"Changing an argument on a directive can change runtime behavior."},message:`Argument '${e.meta.removedArgumentName}' was removed from '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.removedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function Xe(e,t,n,r,i,o,s){en(e?.arguments||[],t.arguments||[],{onAdded(a){n(b8({type:M.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.name.value,addedArgumentValue:Ze(a.value),oldArgumentValue:null,directiveName:t.name.value,parentTypeName:r?.name??null,parentFieldName:i?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||i||r)?.astNode?.directives??[],t)}}))},onMutual(a){a.oldVersion&&Ze(a.oldVersion.value)===Ze(a.newVersion.value)||(a.oldVersion&&n(v8({type:M.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.oldVersion.name.value,directiveName:t.name.value,parentTypeName:r?.name??null,parentFieldName:i?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||i||r)?.astNode?.directives??[],t)}})),n(b8({type:M.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.newVersion.name.value,addedArgumentValue:Ze(a.newVersion.value),oldArgumentValue:(a.oldVersion?.value&&Ze(a.oldVersion.value))??null,directiveName:t.name.value,parentTypeName:r?.name??null,parentFieldName:i?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||i||r)?.astNode?.directives??[],t)}})))},onRemoved(a){n(v8({type:M.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.name.value,directiveName:t.name.value,parentTypeName:r?.name??null,parentFieldName:i?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||i||r)?.astNode?.directives??[],t)}}))}})}var G8=gt(z8(),1);function Zi(e){return typeof e=="string"?JSON.stringify(e):(0,G8.default)(e).replace(/\[Object: null prototype\] /g,"").replace(/(^')|('$)/g,"")}function Ue(e){return e.replace(/'/g,"\\'")}function HIe(e){return`Directive '${e.removedDirectiveName}' was removed`}var KIe="A directive could be in use of a client application. Removing it could break the client application.";function JIe(e){return{criticality:{level:K.Breaking,reason:KIe},type:M.DirectiveRemoved,message:HIe(e.meta),path:`@${e.meta.removedDirectiveName}`,meta:e.meta}}function B8(e){return JIe({type:M.DirectiveRemoved,meta:{removedDirectiveName:e.name}})}function ZIe(e){return`Directive '${e.addedDirectiveName}' was added`}function YIe(e){return{criticality:{level:K.NonBreaking},type:M.DirectiveAdded,message:ZIe(e.meta),path:`@${e.meta.addedDirectiveName}`,meta:e.meta}}function V8(e){return YIe({type:M.DirectiveAdded,meta:{addedDirectiveName:e.name,addedDirectiveDescription:e.description??null,addedDirectiveLocations:e.locations.map(t=>String(t)),addedDirectiveRepeatable:e.isRepeatable}})}function QIe(e){return e.oldDirectiveDescription===null&&e.newDirectiveDescription!==null?`Directive '${e.directiveName}' description '${Ue(e.newDirectiveDescription)}' was added`:e.newDirectiveDescription===null&&e.oldDirectiveDescription!==null?`Directive '${e.directiveName}' description '${Ue(e.oldDirectiveDescription)}' was removed`:`Directive '${e.directiveName}' description changed from '${Ue(e.oldDirectiveDescription??"")}' to '${Ue(e.newDirectiveDescription??"")}'`}function XIe(e){return{criticality:{level:K.NonBreaking},type:M.DirectiveDescriptionChanged,message:QIe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function q8(e,t){return XIe({type:M.DirectiveDescriptionChanged,meta:{directiveName:t.name,oldDirectiveDescription:e?.description??null,newDirectiveDescription:t.description??null}})}function eAe(e){return`Directive '${e.directiveName}' added repeatable.`}function tAe(e){return{criticality:{level:K.NonBreaking},type:M.DirectiveRepeatableAdded,message:eAe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function W8(e){return tAe({type:M.DirectiveRepeatableAdded,meta:{directiveName:e.name}})}function nAe(e){return`Directive '${e.directiveName}' removed repeatable.`}function rAe(e){return{criticality:{level:K.Dangerous},type:M.DirectiveRepeatableRemoved,message:nAe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function H8(e){return rAe({type:M.DirectiveRepeatableRemoved,meta:{directiveName:e.name}})}function iAe(e){return`Location '${e.addedDirectiveLocation}' was added to directive '${e.directiveName}'`}function oAe(e){return{criticality:{level:K.NonBreaking},type:M.DirectiveLocationAdded,message:iAe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function K8(e,t){return oAe({type:M.DirectiveLocationAdded,meta:{directiveName:e.name,addedDirectiveLocation:String(t)}})}function sAe(e){return`Location '${e.removedDirectiveLocation}' was removed from directive '${e.directiveName}'`}var aAe="A directive could be in use of a client application. Removing it could break the client application.";function cAe(e){return{criticality:{level:K.Breaking,reason:aAe},type:M.DirectiveLocationRemoved,message:sAe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function J8(e,t){return cAe({type:M.DirectiveLocationRemoved,meta:{directiveName:e.name,removedDirectiveLocation:t.toString()}})}var lAe="A directive could be in use of a client application. Adding a non-nullable argument will break those clients.",uAe="A directive could be in use of a client application. Adding a nullable argument will not break those clients.",dAe="Refer to the directive usage for the breaking status. If the directive is new and therefore unused, then adding an argument does not risk breaking clients.";function pAe(e){return{criticality:e.meta.addedToNewDirective?{level:K.NonBreaking,reason:dAe}:e.meta.addedDirectiveArgumentTypeIsNonNull?{level:K.Breaking,reason:lAe}:{level:K.NonBreaking,reason:uAe},type:M.DirectiveArgumentAdded,message:`Argument '${e.meta.addedDirectiveArgumentName}' was added to directive '${e.meta.directiveName}'`,path:`@${e.meta.directiveName}`,meta:e.meta}}function Z8(e,t,n){return pAe({type:M.DirectiveArgumentAdded,meta:{directiveName:e.name,addedDirectiveArgumentName:t.name,addedDirectiveArgumentType:t.type.toString(),addedDirectiveDefaultValue:Ed(t)?Zi(Kr(t)):void 0,addedDirectiveArgumentTypeIsNonNull:Te(t.type),addedDirectiveArgumentDescription:t.description??void 0,addedToNewDirective:n}})}function fAe(e){return`Argument '${e.removedDirectiveArgumentName}' was removed from directive '${e.directiveName}'`}var mAe="A directive argument could be in use of a client application. Removing the argument can break client applications.";function gAe(e){return{criticality:{level:K.Breaking,reason:mAe},type:M.DirectiveArgumentRemoved,message:fAe(e.meta),path:`@${e.meta.directiveName}.${e.meta.removedDirectiveArgumentName}`,meta:e.meta}}function Y8(e,t){return gAe({type:M.DirectiveArgumentRemoved,meta:{directiveName:e.name,removedDirectiveArgumentName:t.name}})}function hAe(e){return e.oldDirectiveArgumentDescription===null&&e.newDirectiveArgumentDescription!==null?`Description '${Ue(e.newDirectiveArgumentDescription)}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:e.newDirectiveArgumentDescription===null&&e.oldDirectiveArgumentDescription!==null?`Description '${Ue(e.oldDirectiveArgumentDescription)}' was removed from argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Description for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${Ue(e.oldDirectiveArgumentDescription??"")}' to '${Ue(e.newDirectiveArgumentDescription??"")}'`}function yAe(e){return{criticality:{level:K.NonBreaking},type:M.DirectiveArgumentDescriptionChanged,message:hAe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function Q8(e,t,n){return yAe({type:M.DirectiveArgumentDescriptionChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentDescription:t?.description??null,newDirectiveArgumentDescription:n.description??null}})}function bAe(e){return e.oldDirectiveArgumentDefaultValue===void 0?`Default value '${e.newDirectiveArgumentDefaultValue}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Default value for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${e.oldDirectiveArgumentDefaultValue}' to '${e.newDirectiveArgumentDefaultValue}'`}var vAe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function wAe(e){return{criticality:{level:K.Dangerous,reason:vAe},type:M.DirectiveArgumentDefaultValueChanged,message:bAe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function X8(e,t,n){let r={directiveName:e.name,directiveArgumentName:n.name},i=t===null?void 0:Kr(t),o=Kr(n);return i!==void 0&&(r.oldDirectiveArgumentDefaultValue=Zi(i)),o!==void 0&&(r.newDirectiveArgumentDefaultValue=Zi(o)),wAe({type:M.DirectiveArgumentDefaultValueChanged,meta:r})}function kAe(e){return`Type for argument '${e.meta.directiveArgumentName}' on directive '${e.meta.directiveName}' changed from '${e.meta.oldDirectiveArgumentType}' to '${e.meta.newDirectiveArgumentType}'`}var _Ae="Changing an input field from non-null to null is considered non-breaking.";function $Ae(e){return{criticality:e.meta.isSafeDirectiveArgumentTypeChange?{level:K.NonBreaking,reason:_Ae}:{level:K.Breaking},type:M.DirectiveArgumentTypeChanged,message:kAe(e),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function eY(e,t,n){return $Ae({type:M.DirectiveArgumentTypeChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentType:t?.type.toString()??"",newDirectiveArgumentType:n.type.toString(),isSafeDirectiveArgumentTypeChange:$a(t.type,n.type)}})}function SAe(e){return e.oldQueryTypeName===null?`Schema query root type was set to '${e.newQueryTypeName}'.`:e.newQueryTypeName===null?`Schema query root type '${e.oldQueryTypeName}' was removed.`:`Schema query root type was changed from '${e.oldQueryTypeName}' to '${e.newQueryTypeName}'`}function xAe(e){return{type:M.SchemaQueryTypeChanged,criticality:{level:e.meta.oldQueryTypeName===null?K.NonBreaking:K.Breaking},message:SAe(e.meta),meta:e.meta}}function tY(e,t){let n=e?.getQueryType()?.name||null,r=t?.getQueryType()?.name||null;return xAe({type:M.SchemaQueryTypeChanged,meta:{oldQueryTypeName:n,newQueryTypeName:r}})}function EAe(e){return e.oldMutationTypeName===null?`Schema mutation type was set to '${e.newMutationTypeName}'.`:e.newMutationTypeName===null?`Schema mutation type '${e.oldMutationTypeName}' was removed.`:`Schema mutation type was changed from '${e.oldMutationTypeName}' to '${e.newMutationTypeName}'`}function TAe(e){return{type:M.SchemaMutationTypeChanged,criticality:{level:e.meta.oldMutationTypeName===null?K.NonBreaking:K.Breaking},message:EAe(e.meta),meta:e.meta}}function nY(e,t){let n=e?.getMutationType()?.name||null,r=t?.getMutationType()?.name||null;return TAe({type:M.SchemaMutationTypeChanged,meta:{newMutationTypeName:r,oldMutationTypeName:n}})}function IAe(e){return e.oldSubscriptionTypeName===null?`Schema subscription type was set to '${e.newSubscriptionTypeName}'.`:e.newSubscriptionTypeName===null?`Schema subscription type '${e.oldSubscriptionTypeName}' was removed.`:`Schema subscription type was changed from '${e.oldSubscriptionTypeName}' to '${e.newSubscriptionTypeName}'`}function AAe(e){return{type:M.SchemaSubscriptionTypeChanged,criticality:{level:e.meta.oldSubscriptionTypeName===null?K.NonBreaking:K.Breaking},message:IAe(e.meta),meta:e.meta}}function rY(e,t){let n=e?.getSubscriptionType()?.name||null,r=t?.getSubscriptionType()?.name||null;return AAe({type:M.SchemaSubscriptionTypeChanged,meta:{newSubscriptionTypeName:r,oldSubscriptionTypeName:n}})}function RAe(e){return`Type '${e.removedTypeName}' was removed`}function PAe(e){return{criticality:{level:K.Breaking},type:M.TypeRemoved,message:RAe(e.meta),meta:e.meta,path:e.meta.removedTypeName}}function iY(e){return PAe({type:M.TypeRemoved,meta:{removedTypeName:e.name}})}function CAe(e){return`Type '${e.addedTypeName}' was added`}function NAe(e){return{criticality:{level:K.NonBreaking},type:M.TypeAdded,message:CAe(e.meta),meta:e.meta,path:e.meta.addedTypeName}}function DAe(e){return Xt(e)?{addedTypeKind:_.ENUM_TYPE_DEFINITION,addedTypeName:e.name}:st(e)||qe(e)?{addedTypeKind:Eh(e),addedTypeName:e.name}:Qt(e)?{addedTypeKind:_.UNION_TYPE_DEFINITION,addedTypeName:e.name}:He(e)?{addedTypeKind:_.INPUT_OBJECT_TYPE_DEFINITION,addedTypeIsOneOf:e.isOneOf,addedTypeName:e.name}:{addedTypeKind:Eh(e),addedTypeName:e.name}}function oY(e){return NAe({type:M.TypeAdded,meta:DAe(e)})}function OAe(e){return`'${e.meta.typeName}' kind changed from '${e.meta.oldTypeKind}' to '${e.meta.newTypeKind}'`}function MAe(e){return{criticality:{level:K.Breaking,reason:"Changing the kind of a type is a breaking change because it can cause existing queries to error. For example, turning an object type to a scalar type would break queries that define a selection set for this type."},type:M.TypeKindChanged,message:OAe(e),path:e.meta.typeName,meta:e.meta}}function sY(e,t){return MAe({type:M.TypeKindChanged,meta:{typeName:t.name,newTypeKind:String(Eh(t)),oldTypeKind:String(Eh(e))}})}function LAe(e){let t=Ue(e.oldTypeDescription),n=Ue(e.newTypeDescription);return`Description '${t}' on type '${e.typeName}' has changed to '${n}'`}function FAe(e){return{criticality:{level:K.NonBreaking},type:M.TypeDescriptionChanged,message:LAe(e.meta),path:e.meta.typeName,meta:e.meta}}function aY(e,t){return FAe({type:M.TypeDescriptionChanged,meta:{typeName:e.name,newTypeDescription:t.description??"",oldTypeDescription:e.description??""}})}function jAe(e){return`Description '${Ue(e.removedTypeDescription)}' was removed from object type '${e.typeName}'`}function UAe(e){return{criticality:{level:K.NonBreaking},type:M.TypeDescriptionRemoved,message:jAe(e.meta),path:e.meta.typeName,meta:e.meta}}function cY(e){return UAe({type:M.TypeDescriptionRemoved,meta:{typeName:e.name,removedTypeDescription:e.description??""}})}function zAe(e){let t=Ue(e.addedTypeDescription);return`Object type '${e.typeName}' has description '${t}'`}function GAe(e){return{criticality:{level:K.NonBreaking},type:M.TypeDescriptionAdded,message:zAe(e.meta),path:e.meta.typeName,meta:e.meta}}function lY(e){return GAe({type:M.TypeDescriptionAdded,meta:{typeName:e.name,addedTypeDescription:e.description??""}})}function KO(e,t,n){Ht(e?.description,t.description)&&n(q8(e,t)),!t.isRepeatable&&e?.isRepeatable&&n(H8(t)),t.isRepeatable&&!e?.isRepeatable&&n(W8(t));let r={added:OO(t.locations,e?.locations??[]),removed:OO(e?.locations??[],t.locations)};for(let i of r.added)n(K8(t,i));for(let i of r.removed)n(J8(t,i));en(e?.args??[],t.args,{onAdded(i){n(Z8(t,i,e===null))},onRemoved(i){n(Y8(t,i))},onMutual(i){BAe(t,i.oldVersion,i.newVersion,n)}})}function BAe(e,t,n,r){Ht(t?.description,n.description)&&r(Q8(e,t,n)),Td(t,n)||r(X8(e,t,n)),Ht(t.type.toString(),n.type.toString())&&r(eY(e,t,n))}function VAe(e){return`Enum value '${e.removedEnumValueName}' ${e.isEnumValueDeprecated?"(deprecated) ":""}was removed from enum '${e.enumName}'`}var qAe="Removing an enum value will cause existing queries that use this enum value to error.";function WAe(e){return{type:M.EnumValueRemoved,criticality:{level:K.Breaking,reason:qAe},message:VAe(e.meta),meta:e.meta,path:[e.meta.enumName,e.meta.removedEnumValueName].join(".")}}function uY(e,t){return WAe({type:M.EnumValueRemoved,meta:{enumName:e.name,removedEnumValueName:t.name,isEnumValueDeprecated:ls(t)}})}function HAe(e){return`Enum value '${e.meta.addedEnumValueName}' was added to enum '${e.meta.enumName}'`}var KAe="Adding an enum value may break existing clients that were not programming defensively against an added case when querying an enum.";function JAe(e){let t=e.meta.addedToNewType;return{type:M.EnumValueAdded,criticality:{level:t?K.NonBreaking:K.Dangerous,reason:t?void 0:KAe},message:HAe(e),meta:e.meta,path:[e.meta.enumName,e.meta.addedEnumValueName].join(".")}}function dY(e,t,n){return JAe({type:M.EnumValueAdded,meta:{enumName:e.name,addedEnumValueName:t.name,addedToNewType:n,addedDirectiveDescription:t.description??null}})}function ZAe(e){return e.oldEnumValueDescription===null&&e.newEnumValueDescription!==null?`Description '${Ue(e.newEnumValueDescription)}' was added to enum value '${e.enumName}.${e.enumValueName}'`:e.newEnumValueDescription===null&&e.oldEnumValueDescription!==null?`Description '${Ue(e.oldEnumValueDescription)}' was removed from enum value '${e.enumName}.${e.enumValueName}'`:`Description for enum value '${e.enumName}.${e.enumValueName}' changed from '${Ue(e.oldEnumValueDescription??"")}' to '${Ue(e.newEnumValueDescription??"")}'`}function YAe(e){return{criticality:{level:K.NonBreaking},type:M.EnumValueDescriptionChanged,message:ZAe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function pY(e,t,n){return YAe({type:M.EnumValueDescriptionChanged,meta:{enumName:e.name,enumValueName:n.name,oldEnumValueDescription:t?.description??null,newEnumValueDescription:n.description??null}})}function QAe(e){let t=Ue(e.oldEnumValueDeprecationReason),n=Ue(e.newEnumValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' deprecation reason changed from '${t}' to '${n}'`}function XAe(e){return{criticality:{level:K.NonBreaking},type:M.EnumValueDeprecationReasonChanged,message:QAe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${Hr.name}`].join("."),meta:e.meta}}function fY(e,t,n){return XAe({type:M.EnumValueDeprecationReasonChanged,meta:{enumName:e.name,enumValueName:t.name,oldEnumValueDeprecationReason:t.deprecationReason??"",newEnumValueDeprecationReason:n.deprecationReason??""}})}function e0e(e){let t=Ue(e.addedValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' was deprecated with reason '${t}'`}function t0e(e){return{criticality:{level:K.NonBreaking},type:M.EnumValueDeprecationReasonAdded,message:e0e(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${Hr.name}`].join("."),meta:e.meta}}function mY(e,t,n){return t0e({type:M.EnumValueDeprecationReasonAdded,meta:{enumName:e.name,enumValueName:n.name,addedValueDeprecationReason:n.deprecationReason??""}})}function n0e(e){return`Deprecation reason was removed from enum value '${e.enumName}.${e.enumValueName}'`}function r0e(e){return{criticality:{level:K.NonBreaking},type:M.EnumValueDeprecationReasonRemoved,message:n0e(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function gY(e,t,n){return r0e({type:M.EnumValueDeprecationReasonRemoved,meta:{enumName:e.name,enumValueName:t.name,removedEnumValueDeprecationReason:t.deprecationReason??""}})}var hY="No longer supported";function bY(e,t,n){en(e?.getValues()??[],t.getValues(),{onAdded(r){n(dY(t,r,e===null)),yY({newVersion:r,oldVersion:null},t,n)},onRemoved(r){n(uY(e,r))},onMutual(r){yY(r,t,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(r){n(nn(_.ENUM_TYPE_DEFINITION,r,t,e===null)),Xe(null,r,n,t)},onMutual(r){Xe(r.oldVersion,r.newVersion,n,t)},onRemoved(r){n(rn(_.ENUM_TYPE_DEFINITION,r,t))}})}function yY(e,t,n){let r=e.oldVersion,i=e.newVersion;Ht(r?.description,i.description)&&n(pY(t,r,i)),Ht(r?.deprecationReason,i.deprecationReason)&&(Rt(r?.deprecationReason)||r?.deprecationReason===hY?n(mY(t,r,i)):Rt(i.deprecationReason)||i?.deprecationReason===hY?n(gY(t,r,i)):n(fY(t,r,i))),tn(r?.astNode?.directives||[],i.astNode?.directives||[],{onAdded(o){n(nn(_.ENUM_VALUE_DEFINITION,o,{type:t,value:i},r===null)),Xe(null,o,n,t,void 0,void 0,i)},onMutual(o){Xe(o.oldVersion,o.newVersion,n,t,void 0,void 0,i)},onRemoved(o){n(rn(_.ENUM_VALUE_DEFINITION,o,{type:t,value:r}))}})}function i0e(e){return`Input field '${e.removedFieldName}' ${e.isInputFieldDeprecated?"(deprecated) ":""}was removed from input object type '${e.inputName}'`}function o0e(e){return{type:M.InputFieldRemoved,criticality:{level:K.Breaking,reason:"Removing an input field will cause existing queries that use this input field to error."},message:i0e(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.removedFieldName].join(".")}}function vY(e,t){return o0e({type:M.InputFieldRemoved,meta:{inputName:e.name,removedFieldName:t.name,isInputFieldDeprecated:ls(t)}})}function s0e(e){return`Input field '${e.addedInputFieldName}' of type '${e.addedInputFieldType}'${e.addedFieldDefault?` with default value '${e.addedFieldDefault}'`:""} was added to input object type '${e.inputName}'`}function a0e(e){let t,n=e.meta.isAddedInputFieldTypeNullable&&e.meta.addedFieldDefault===void 0;return e.meta.addedToNewType?t={level:K.NonBreaking,reason:"The field is being added to a new type."}:n?t={level:K.NonBreaking,reason:"The field is nullable and no default is set."}:e.meta.addedFieldDefault===void 0?t={level:K.Breaking,reason:"Adding a required input field to an existing input object type is a breaking change because it will cause existing uses of this input object type to error."}:t={level:K.Dangerous,reason:"Adding a field with a default value can change runtime behavior for clients that previously omitted it, and during rolling deploys consumers may receive the new default before producers are ready to handle it."},{type:M.InputFieldAdded,criticality:t,message:s0e(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.addedInputFieldName].join(".")}}function wY(e,t,n){let r=Kr(t);return a0e({type:M.InputFieldAdded,meta:{inputName:e.name,addedInputFieldName:t.name,isAddedInputFieldTypeNullable:!Te(t.type),addedInputFieldType:t.type.toString(),...Ed(t)?{addedFieldDefault:Zi(r)}:{},addedToNewType:n}})}function c0e(e){let t=Ue(e.addedInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' has description '${t}'`}function l0e(e){return{type:M.InputFieldDescriptionAdded,criticality:{level:K.NonBreaking},message:c0e(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function kY(e,t){return l0e({type:M.InputFieldDescriptionAdded,meta:{inputName:e.name,inputFieldName:t.name,addedInputFieldDescription:t.description??""}})}function u0e(e){return`Description '${Ue(e.removedDescription)}' was removed from input field '${e.inputName}.${e.inputFieldName}'`}function d0e(e){return{type:M.InputFieldDescriptionRemoved,criticality:{level:K.NonBreaking},message:u0e(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function _Y(e,t){return d0e({type:M.InputFieldDescriptionRemoved,meta:{inputName:e.name,inputFieldName:t.name,removedDescription:t.description??""}})}function p0e(e){let t=Ue(e.oldInputFieldDescription),n=Ue(e.newInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' description changed from '${t}' to '${n}'`}function f0e(e){return{type:M.InputFieldDescriptionChanged,criticality:{level:K.NonBreaking},message:p0e(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function $Y(e,t,n){return f0e({type:M.InputFieldDescriptionChanged,meta:{inputName:e.name,inputFieldName:t.name,oldInputFieldDescription:t.description??"",newInputFieldDescription:n.description??""}})}function m0e(e){return`Input field '${e.inputName}.${e.inputFieldName}' default value changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}function g0e(e){let t={level:K.Dangerous,reason:"Changing the default value for an argument may change the runtime behavior of a field if it was never provided."};return{type:M.InputFieldDefaultValueChanged,criticality:t,message:m0e(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function SY(e,t,n){let r={inputName:e.name,inputFieldName:n.name},i=Kr(t),o=Kr(n);return i!==void 0&&(r.oldDefaultValue=Zi(i)),o!==void 0&&(r.newDefaultValue=Zi(o)),g0e({type:M.InputFieldDefaultValueChanged,meta:r})}function h0e(e){return`Input field '${e.inputName}.${e.inputFieldName}' changed type from '${e.oldInputFieldType}' to '${e.newInputFieldType}'`}function y0e(e){return{type:M.InputFieldTypeChanged,criticality:e.meta.isInputFieldTypeChangeSafe?{level:K.NonBreaking,reason:"Changing an input field from non-null to null is considered non-breaking."}:{level:K.Breaking,reason:"Changing the type of an input field can cause existing queries that use this field to error."},message:h0e(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function xY(e,t,n){return y0e({type:M.InputFieldTypeChanged,meta:{inputName:e.name,inputFieldName:n.name,oldInputFieldType:t.type.toString(),newInputFieldType:n.type.toString(),isInputFieldTypeChangeSafe:$a(t.type,n.type)}})}function TY(e,t,n){let r=e?.getFields()??{},i=t.getFields();en(Object.values(r),Object.values(i),{onAdded(o){n(wY(t,o,e==null)),EY(t,null,o,n)},onRemoved(o){n(vY(e,o))},onMutual(o){EY(t,o.oldVersion,o.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(nn(_.INPUT_OBJECT_TYPE_DEFINITION,o,t,e===null)),Xe(null,o,n,t)},onMutual(o){Xe(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(rn(_.INPUT_OBJECT_TYPE_DEFINITION,o,e))}})}function EY(e,t,n,r){Ht(t?.description,n.description)&&(Rt(t?.description)?r(kY(e,n)):Rt(n.description)?r(_Y(e,t)):r($Y(e,t,n))),Rt(t)||(Td(t,n)||r(SY(e,t,n)),!Rt(t)&&Ht(t.type.toString(),n.type.toString())&&r(xY(e,t,n))),(t?.astNode?.directives||n.astNode?.directives)&&tn(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(i){r(nn(_.INPUT_VALUE_DEFINITION,i,{type:e,field:n},t===null)),Xe(null,i,r,e,n)},onMutual(i){Xe(i.oldVersion,i.newVersion,r,e,n)},onRemoved(i){r(rn(_.INPUT_VALUE_DEFINITION,i,{type:e,field:n}))}})}function b0e(e){return`Field '${e.removedFieldName}' ${e.isRemovedFieldDeprecated?"(deprecated) ":""}was removed from ${e.typeType} '${e.typeName}'`}function v0e(e){return{type:M.FieldRemoved,criticality:{level:K.Breaking,reason:e.meta.isRemovedFieldDeprecated?"Removing a deprecated field is a breaking change. Before removing it, you may want to look at the field's usage to see the impact of removing the field.":"Removing a field is a breaking change. It is preferable to deprecate the field before removing it. This applies to removed union fields as well, since removal breaks client operations that contain fragments that reference the removed type through direct (... on RemovedType) or indirect means such as __typename in the consumers."},message:b0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.removedFieldName].join(".")}}function r$(e,t){let n=qe(e)?"interface":"object type";return v0e({type:M.FieldRemoved,meta:{typeName:e.name,removedFieldName:t.name,isRemovedFieldDeprecated:t.deprecationReason!=null,typeType:n}})}function w0e(e){return`Field '${e.addedFieldName}' was added to ${e.typeType} '${e.typeName}'`}function k0e(e){return{type:M.FieldAdded,criticality:{level:K.NonBreaking},message:w0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.addedFieldName].join(".")}}function i$(e,t){let n=qe(e)?"interface":"object type";return k0e({type:M.FieldAdded,meta:{typeName:e.name,addedFieldName:t.name,typeType:n,addedFieldReturnType:t.type.toString()}})}function _0e(e){return!e.oldDescription&&e.newDescription?`Field '${e.typeName}.${e.fieldName}' description '${Ue(e.newDescription)}' was added`:!e.newDescription&&e.oldDescription?`Field '${e.typeName}.${e.fieldName}' description '${Ue(e.oldDescription)}' was removed`:`Field '${e.typeName}.${e.fieldName}' description changed from '${Ue(e.oldDescription)}' to '${Ue(e.newDescription)}'`}function $0e(e){return{type:M.FieldDescriptionChanged,criticality:{level:K.NonBreaking},message:_0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function IY(e,t,n){return $0e({type:M.FieldDescriptionChanged,meta:{fieldName:t.name,typeName:e.name,oldDescription:t.description??"",newDescription:n.description??""}})}function S0e(e){let t=Ue(e.addedDescription);return`Field '${e.typeName}.${e.fieldName}' has description '${t}'`}function x0e(e){return{type:M.FieldDescriptionAdded,criticality:{level:K.NonBreaking},message:S0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function AY(e,t){return x0e({type:M.FieldDescriptionAdded,meta:{typeName:e.name,fieldName:t.name,addedDescription:t.description??""}})}function E0e(e){return`Description was removed from field '${e.typeName}.${e.fieldName}'`}function T0e(e){return{type:M.FieldDescriptionRemoved,criticality:{level:K.NonBreaking},message:E0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function RY(e,t){return T0e({type:M.FieldDescriptionRemoved,meta:{typeName:e.name,fieldName:t.name}})}function I0e(e){return`Field '${e.typeName}.${e.fieldName}' is deprecated`}function A0e(e){return{type:M.FieldDeprecationAdded,criticality:{level:K.NonBreaking},message:I0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Hr.name}`].join(".")}}function PY(e,t){return A0e({type:M.FieldDeprecationAdded,meta:{typeName:e.name,fieldName:t.name,deprecationReason:t.deprecationReason??""}})}function R0e(e){return{type:M.FieldDeprecationRemoved,criticality:{level:K.NonBreaking},message:`Field '${e.meta.typeName}.${e.meta.fieldName}' is no longer deprecated`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Hr.name}`].join(".")}}function CY(e,t){return R0e({type:M.FieldDeprecationRemoved,meta:{fieldName:t.name,typeName:e.name}})}function P0e(e){let t=Ue(e.oldDeprecationReason),n=Ue(e.newDeprecationReason);return`Deprecation reason on field '${e.typeName}.${e.fieldName}' has changed from '${t}' to '${n}'`}function C0e(e){return{type:M.FieldDeprecationReasonChanged,criticality:{level:K.NonBreaking},message:P0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Hr.name}`].join(".")}}function NY(e,t,n){return C0e({type:M.FieldDeprecationReasonChanged,meta:{fieldName:n.name,typeName:e.name,newDeprecationReason:n.deprecationReason??"",oldDeprecationReason:t.deprecationReason??""}})}function N0e(e){let t=Ue(e.addedDeprecationReason);return`Field '${e.typeName}.${e.fieldName}' has deprecation reason '${t}'`}function D0e(e){return{type:M.FieldDeprecationReasonAdded,criticality:{level:K.NonBreaking},message:N0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Hr.name}`].join(".")}}function DY(e,t){return D0e({type:M.FieldDeprecationReasonAdded,meta:{typeName:e.name,fieldName:t.name,addedDeprecationReason:t.deprecationReason??""}})}function O0e(e){return{type:M.FieldDeprecationReasonRemoved,criticality:{level:K.NonBreaking},message:`Deprecation reason was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function OY(e,t){return O0e({type:M.FieldDeprecationReasonRemoved,meta:{typeName:e.name,fieldName:t.name}})}function M0e(e){return`Field '${e.meta.typeName}.${e.meta.fieldName}' changed type from '${e.meta.oldFieldType}' to '${e.meta.newFieldType}'`}function L0e(e){return{type:M.FieldTypeChanged,criticality:{level:e.meta.isSafeFieldTypeChange?K.NonBreaking:K.Breaking},message:M0e(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function MY(e,t,n){return L0e({type:M.FieldTypeChanged,meta:{typeName:e.name,fieldName:t.name,oldFieldType:t.type.toString(),newFieldType:n.type.toString(),isSafeFieldTypeChange:xh(t.type,n.type)}})}function F0e(e){return`Argument '${e.addedArgumentName}: ${e.addedArgumentType}'${e.hasDefaultValue?" (with default value) ":" "}added to field '${e.typeName}.${e.fieldName}'`}function j0e(e){return{type:M.FieldArgumentAdded,criticality:{level:e.meta.addedToNewField?K.NonBreaking:e.meta.isAddedFieldArgumentBreaking?K.Breaking:K.Dangerous},message:F0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.addedArgumentName].join(".")}}function LY(e,t,n,r){let i=Ed(n),o=Te(n.type)&&!i;return j0e({type:M.FieldArgumentAdded,meta:{typeName:e.name,fieldName:t.name,addedArgumentName:n.name,addedArgumentType:n.type.toString(),hasDefaultValue:i,addedToNewField:r,isAddedFieldArgumentBreaking:o}})}function U0e(e){return`Argument '${e.meta.removedFieldArgumentName}: ${e.meta.removedFieldType}' was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`}function z0e(e){return{type:M.FieldArgumentRemoved,criticality:{level:K.Breaking},message:U0e(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.removedFieldArgumentName].join(".")}}function FY(e,t,n){return z0e({type:M.FieldArgumentRemoved,meta:{typeName:e.name,fieldName:t.name,removedFieldArgumentName:n.name,removedFieldType:n.type.toString()}})}function G0e(e){return`'${e.objectTypeName}' object implements '${e.addedInterfaceName}' interface`}function B0e(e){return{type:M.ObjectTypeInterfaceAdded,criticality:{level:e.meta.addedToNewType?K.NonBreaking:K.Dangerous,reason:"Adding an interface to an object type may break existing clients that are consuming a field returning the interface type that are not programming defensively against this new possible type."},message:G0e(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function o$(e,t,n){return B0e({type:M.ObjectTypeInterfaceAdded,meta:{objectTypeName:t.name,addedInterfaceName:e.name,addedToNewType:n}})}function V0e(e){return`'${e.objectTypeName}' object type no longer implements '${e.removedInterfaceName}' interface`}function q0e(e){return{type:M.ObjectTypeInterfaceRemoved,criticality:{level:K.Breaking,reason:"Removing an interface from an object type can cause existing queries that use this in a fragment spread to error."},message:V0e(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function s$(e,t){return q0e({type:M.ObjectTypeInterfaceRemoved,meta:{objectTypeName:t.name,removedInterfaceName:e.name}})}function W0e(e){return e.oldDescription===null&&e.newDescription!==null?`Description '${Ue(e.newDescription)}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:e.newDescription===null&&e.oldDescription!==null?`Description '${Ue(e.oldDescription)}' was removed from argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Description for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${Ue(e.oldDescription??"")}' to '${Ue(e.newDescription??"")}'`}function H0e(e){return{type:M.FieldArgumentDescriptionChanged,criticality:{level:K.NonBreaking},message:W0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function jY(e,t,n,r){return H0e({type:M.FieldArgumentDescriptionChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:r.name,oldDescription:n?.description??null,newDescription:r.description??null}})}function K0e(e){return e.oldDefaultValue===void 0?`Default value '${e.newDefaultValue}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Default value for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}var J0e="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function Z0e(e){return{type:M.FieldArgumentDefaultChanged,criticality:{level:K.Dangerous,reason:J0e},message:K0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function UY(e,t,n,r){let i={typeName:e.name,fieldName:t.name,argumentName:r.name},o=n===null?void 0:Kr(n),s=Kr(r);return o!==void 0&&(i.oldDefaultValue=Zi(o)),s!==void 0&&(i.newDefaultValue=Zi(s)),Z0e({type:M.FieldArgumentDefaultChanged,meta:i})}function Y0e(e){return`Type for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldArgumentType}' to '${e.newArgumentType}'`}var Q0e="Changing an input field from non-null to null is considered non-breaking.",X0e="Changing the type of a field's argument can cause existing queries that use this argument to error.";function eRe(e){return{type:M.FieldArgumentTypeChanged,criticality:e.meta.isSafeArgumentTypeChange?{level:K.NonBreaking,reason:Q0e}:{level:K.Breaking,reason:X0e},message:Y0e(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function zY(e,t,n,r){return eRe({type:M.FieldArgumentTypeChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:r.name,oldArgumentType:n?.type.toString()??"",newArgumentType:r.type.toString(),isSafeArgumentTypeChange:!n||$a(n.type,r.type)}})}function GY(e,t,n,r,i){Ht(n?.description,r.description)&&i(jY(e,t,n,r)),Td(n,r)||i(UY(e,t,n,r)),Ht(n?.type.toString(),r.type.toString())&&i(zY(e,t,n,r)),(n?.astNode?.directives||r.astNode?.directives)&&tn(n?.astNode?.directives||[],r.astNode?.directives||[],{onAdded(o){i(nn(_.ARGUMENT,o,{argument:r,field:t,type:e},n===null)),Xe(null,o,i,e,t,r)},onMutual(o){Xe(o.oldVersion,o.newVersion,i,e,t,r)},onRemoved(o){i(rn(_.ARGUMENT,o,{argument:n,field:t,type:e}))}})}var BY="No longer supported";function Ad(e,t,n,r){Ht(t?.description,n.description)&&(Rt(t?.description)?r(AY(e,n)):Rt(n.description)?r(RY(e,t)):r(IY(e,t,n))),Rt(t)||!ls(t)?ls(n)&&r(PY(e,n)):ls(n)?Ht(t.deprecationReason,n.deprecationReason)&&(Rt(t.deprecationReason)||t.deprecationReason===BY?r(DY(e,n)):Rt(n.deprecationReason)||n.deprecationReason===BY?r(OY(e,t)):r(NY(e,t,n))):ls(t)&&r(CY(e,t)),!Rt(t)&&Ht(t.type.toString(),n.type.toString())&&r(MY(e,t,n)),en(t?.args??[],n.args,{onAdded(i){r(LY(e,n,i,t===null))},onRemoved(i){r(FY(e,n,i))},onMutual(i){GY(e,n,i.oldVersion,i.newVersion,r)}}),tn(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(i){r(nn(_.FIELD_DEFINITION,i,{parentType:e,field:n},t===null)),Xe(null,i,r,e,n)},onMutual(i){Xe(i.oldVersion,i.newVersion,r,e,n)},onRemoved(i){r(rn(_.FIELD_DEFINITION,i,{parentType:e,field:t}))}})}function VY(e,t,n){let r=e?.getInterfaces()??[],i=t.getInterfaces();en(r,i,{onAdded(a){n(o$(a,t,e===null))},onRemoved(a){n(s$(a,e))}});let o=e?.getFields()??{},s=t.getFields();en(Object.values(o),Object.values(s),{onAdded(a){n(i$(t,a)),Ad(t,null,a,n)},onRemoved(a){n(r$(e,a))},onMutual(a){Ad(t,a.oldVersion,a.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(nn(_.INTERFACE_TYPE_DEFINITION,a,t,e===null)),Xe(null,a,n,t)},onMutual(a){Xe(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(rn(_.INTERFACE_TYPE_DEFINITION,a,e))}})}function qY(e,t,n){let r=e?.getInterfaces()??[],i=t.getInterfaces(),o=e?.getFields()??{},s=t.getFields();en(r,i,{onAdded(a){n(o$(a,t,e===null))},onRemoved(a){n(s$(a,e))}}),en(Object.values(o),Object.values(s),{onAdded(a){n(i$(t,a)),Ad(t,null,a,n)},onRemoved(a){n(r$(e,a))},onMutual(a){Ad(t,a.oldVersion,a.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(nn(_.OBJECT,a,t,e===null)),Xe(null,a,n,t)},onMutual(a){Xe(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(rn(_.OBJECT,a,e))}})}function WY(e,t,n){tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(r){n(nn(_.SCALAR_TYPE_DEFINITION,r,t,e===null)),Xe(null,r,n,t)},onMutual(r){Xe(r.oldVersion,r.newVersion,n,t)},onRemoved(r){n(rn(_.SCALAR_TYPE_DEFINITION,r,e))}})}function tRe(e){return`Member '${e.removedUnionMemberTypeName}' was removed from Union type '${e.unionName}'`}function nRe(e){return{criticality:{level:K.Breaking,reason:"Removing a union member from a union can cause existing queries that use this union member in a fragment spread to error."},type:M.UnionMemberRemoved,message:tRe(e.meta),meta:e.meta,path:e.meta.unionName}}function HY(e,t){return nRe({type:M.UnionMemberRemoved,meta:{unionName:e.name,removedUnionMemberTypeName:t.name}})}function rRe(e){return`Member '${e.addedUnionMemberTypeName}' was added to Union type '${e.unionName}'`}function iRe(e){return{criticality:{level:e.meta.addedToNewType?K.NonBreaking:K.Dangerous,reason:"Adding a possible type to Unions may break existing clients that were not programming defensively against a new possible type."},type:M.UnionMemberAdded,message:rRe(e.meta),meta:e.meta,path:e.meta.unionName}}function KY(e,t,n){return iRe({type:M.UnionMemberAdded,meta:{unionName:e.name,addedUnionMemberTypeName:t.name,addedToNewType:n}})}function JY(e,t,n){let r=e?.getTypes()??[],i=t.getTypes();en(r,i,{onAdded(o){n(KY(t,o,e===null))},onRemoved(o){n(HY(e,o))}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(nn(_.UNION_TYPE_DEFINITION,o,t,e===null)),Xe(null,o,n,t)},onMutual(o){Xe(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(rn(_.UNION_TYPE_DEFINITION,o,e))}})}function YY(e,t){let n=[];function r(i){n.push(i)}en((e?.getDirectives()??[]).filter(i=>!Lc(i)),(t?.getDirectives()??[]).filter(i=>!Lc(i)),{onAdded(i){r(V8(i)),KO(null,i,r)},onRemoved(i){r(B8(i))},onMutual(i){KO(i.oldVersion,i.newVersion,r)}}),oRe(e,t,r),en(Object.values(e?.getTypeMap()??{}).filter(i=>!NO(i)&&!DO(i)),Object.values(t?.getTypeMap()??{}).filter(i=>!NO(i)&&!DO(i)),{onAdded(i){r(oY(i)),ZY(null,i,r)},onRemoved(i){r(iY(i))},onMutual(i){ZY(i.oldVersion,i.newVersion,r)}}),tn(e?.astNode?.directives||[],t?.astNode?.directives||[],{onAdded(i){r(nn(_.SCHEMA_DEFINITION,i,t,!1)),Xe(null,i,r)},onMutual(i){Xe(i.oldVersion,i.newVersion,r)},onRemoved(i){r(rn(_.SCHEMA_DEFINITION,i,e))}});for(let i=0;i{let a=await o;return s({changes:a,oldSchema:e,newSchema:t,config:r})},Promise.resolve(i))}var a$="graphql-inspector",ZO={id:"graphql",source:"graphql-diff",tool:a$,weight:1,originClass:"computed-artifact",config:{enabled:"graphql",paths:"graphqlSchemas"},handles(e,t){return/\.(graphql|graphqls|gql|sdl)$/i.test(e)?/\b(type|interface|enum|union|input|scalar|schema|directive)\b/.test(t):!1},async compute(e){let t,n;try{t=Sh(e.before,{assumeValidSDL:!0}),n=Sh(e.after,{assumeValidSDL:!0})}catch(o){return da(a$,"parse-failed",`${e.path} could not be parsed as GraphQL SDL on both sides of this change: ${o.message}`)}let r;try{r=await JO(t,n)}catch(o){return da(a$,"toolchain-failed",`graphql-inspector could not compare ${e.path}: ${o.message}`)}let i=[];for(let o of r){let s=o.criticality?.level;if(s!=="BREAKING"&&s!=="DANGEROUS")continue;let a=o.path??o.type;i.push({code:QY(o.type,s),location:a,pointer:`${e.path}#${a}`,detail:o.message})}return{available:!0,changes:i,tool:a$,weight:1,locator:`${e.path} (GraphQL SDL)`}},codes:{"graphql-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL field \`${e}\` was removed. Every query, mutation, or fragment in this repository that selects it will now be rejected outright \u2014 the whole document fails validation, not just that selection. Find those documents and migrate each to the replacement field; if there is none, propagate the absence rather than substituting a placeholder.`},"graphql-input-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL input field \`${e}\` no longer exists. Stop sending it: an unknown field on an input object fails validation, so every variable payload and inline argument that still carries it will be rejected.`},"graphql-type-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"type",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL type \`${e}\` no longer exists. Every fragment on it, every \`... on ${e}\` inline fragment, and every variable declared with it must be migrated. If there is no replacement type, leave the operation intact with a clearly-marked TODO and explain it in the PR description.`},"graphql-type-kind-changed":{kind:"type-change",taxonomy:{nature:"type-contract",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`\`${e}\` changed kind: ${t} Selections written against the old kind are no longer valid \u2014 an object's field selection does not survive becoming a union or a scalar. Rewrite each selection set for the new kind rather than adjusting it in place.`},"graphql-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL field \`${e}\` changed: ${t} Update the sub-selection and any client-side parsing of the value. A field that became nullable can now return null where the code assumed a value \u2014 handle that explicitly rather than asserting it away.`},"graphql-input-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL input field \`${e}\` changed: ${t} Update every variable payload that sets it so the value sent matches the new type.`},"graphql-argument-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL argument \`${e}\` was removed. Stop passing it \u2014 an unknown argument fails validation, so the whole operation is rejected, not just that argument.`},"graphql-argument-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL argument \`${e}\` changed: ${t} Update the variable declarations and the values passed at every call site.`},"graphql-argument-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is now required and has no default. Supply it in every operation that reaches this field, using a value that preserves the previous behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`},"graphql-argument-default-changed":{kind:"default-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The default value of \`${e}\` changed: ${t} Operations that omit it will silently behave differently. Pass the old value explicitly wherever the previous behaviour was intended.`},"graphql-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL enum value \`${e}\` was removed. Find code that sends it and map it onto a still-supported value; code that only *reads* the enum should keep its fallback branch, since a stored value may still carry the old name.`},"graphql-enum-value-added":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is a new value this code has never seen returned. Add explicit handling; make sure exhaustive switches and mapping tables over that enum have a safe default rather than falling through silently.`},"graphql-union-member-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A union or interface membership changed: ${t} An \`... on ${e}\` fragment against a type that is no longer a member fails validation. Rewrite those fragments for the members the schema still declares.`},"graphql-directive-removed":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A GraphQL directive changed or was removed: ${t} Every operation that applies \`${e}\` \u2014 or applies it where it is no longer allowed \u2014 fails validation. Remove or relocate those usages.`},"graphql-root-type-changed":{kind:"moved-export",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The root operation type \`${e}\` changed: ${t} Every operation of that kind is now rooted somewhere else \u2014 check that the top-level selections in this repository's documents still exist on the new root.`},"graphql-schema-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`graphql-inspector reports a breaking schema change at \`${e}\`: ${t} Update the operations in this repository that touch it.`}}};function QY(e,t){switch(e){case"FIELD_REMOVED":return"graphql-field-removed";case"INPUT_FIELD_REMOVED":return"graphql-input-field-removed";case"TYPE_REMOVED":return"graphql-type-removed";case"TYPE_KIND_CHANGED":return"graphql-type-kind-changed";case"FIELD_TYPE_CHANGED":return"graphql-field-type-changed";case"INPUT_FIELD_TYPE_CHANGED":return"graphql-input-field-type-changed";case"FIELD_ARGUMENT_REMOVED":case"DIRECTIVE_ARGUMENT_REMOVED":return"graphql-argument-removed";case"FIELD_ARGUMENT_TYPE_CHANGED":case"DIRECTIVE_ARGUMENT_TYPE_CHANGED":return"graphql-argument-type-changed";case"FIELD_ARGUMENT_ADDED":case"INPUT_FIELD_ADDED":case"DIRECTIVE_ARGUMENT_ADDED":return t==="BREAKING"?"graphql-argument-now-required":"graphql-schema-changed";case"FIELD_ARGUMENT_DEFAULT_CHANGED":case"INPUT_FIELD_DEFAULT_VALUE_CHANGED":case"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED":return"graphql-argument-default-changed";case"ENUM_VALUE_REMOVED":return"graphql-enum-value-removed";case"ENUM_VALUE_ADDED":return"graphql-enum-value-added";case"UNION_MEMBER_REMOVED":case"UNION_MEMBER_ADDED":case"OBJECT_TYPE_INTERFACE_REMOVED":return"graphql-union-member-removed";case"DIRECTIVE_REMOVED":case"DIRECTIVE_LOCATION_REMOVED":case"DIRECTIVE_REPEATABLE_REMOVED":return"graphql-directive-removed";case"SCHEMA_QUERY_TYPE_CHANGED":case"SCHEMA_MUTATION_TYPE_CHANGED":case"SCHEMA_SUBSCRIPTION_TYPE_CHANGED":return"graphql-root-type-changed";default:return"graphql-schema-changed"}}var sRe=["openapi-diff","protobuf-diff","graphql-diff"];function XY(e){return sRe.includes(e)}var Gc=[DD,OD,ZO];var n9=Object.fromEntries(Gc.map(e=>[e.source,e.weight])),r9=Object.fromEntries(Gc.map(e=>[e.source,e.originClass])),aRe=Object.fromEntries(Gc.flatMap(e=>Object.entries(e.codes)));function YO(e){return aRe[e]}function i9(e,t){return t.evidence[e.config.enabled]===!0}function o9(e,t){let n=t.evidence[e.config.paths];return Array.isArray(n)?n:[]}var cRe=12e4;async function s9(e,t,n){let r=await(0,c$.mkdtemp)((0,t9.join)((0,e9.tmpdir)(),"drift-spec-"));try{return await e.compute({path:t.path,before:t.before,after:t.after,siblings:n.siblings??[],workdir:r,exec:n.exec??Qe,logger:n.logger,...n.env?{env:n.env}:{},timeoutMs:n.timeoutMs??cRe})}catch(i){return n.logger.debug(`Spec diff crashed for ${t.path}: ${i.message}`),{available:!1,reason:"toolchain-failed",detail:`Drift could not compare ${t.path}: ${i.message}`,tool:e.tool}}finally{await(0,c$.rm)(r,{recursive:!0,force:!0}).catch(()=>{})}}var a9=require("node:crypto"),Ta=require("node:fs/promises"),c9=require("node:path");function l9(e){let t=xc();return t?(0,c9.join)(t,`artifact-${(0,a9.createHash)("sha256").update(e).digest("hex")}.json`):null}async function Ia(e){let t=l9(e);if(!t)return null;try{let n=JSON.parse(await(0,Ta.readFile)(t,"utf8"));return n.format!==1||n.key!==e?null:(tt("artifact.cache.hit"),n.value)}catch{return tt("artifact.cache.miss"),null}}async function Aa(e,t){let n=l9(e);if(n)try{await(0,Ta.mkdir)(xc(),{recursive:!0});let r=`${n}.${process.pid}.partial`;await(0,Ta.writeFile)(r,JSON.stringify({format:1,key:e,value:t}),"utf8"),await(0,Ta.rename)(r,n)}catch{}}var u$=require("node:zlib");function lRe(e){return e.length>2&&e[0]===31&&e[1]===139}function uRe(e){return e.length>4&&e[0]===80&&e[1]===75}var u9=200*1024*1024;function Ln(e,t={}){let n=t.maxDecompressedBytes??u9;return uRe(e)?QO(e,{maxDecompressedBytes:n}):gRe(lRe(e)?(0,u$.gunzipSync)(e,{maxOutputLength:n}):e)}var dRe=101010256,pRe=33639248;function QO(e,t={}){let n=t.maxDecompressedBytes??u9,r=mRe(e);if(r===-1)return[];let i=e.readUInt16LE(r+10),o=e.readUInt32LE(r+16),s=[];for(let a=0;ae.length||e.readUInt32LE(o)!==pRe);a++){let c=e.readUInt16LE(o+10),l=e.readUInt32LE(o+20),u=e.readUInt32LE(o+24),d=e.readUInt16LE(o+28),p=e.readUInt16LE(o+30),f=e.readUInt16LE(o+32),m=e.readUInt32LE(o+42),g=e.toString("utf8",o+46,o+46+d);o+=46+d+p+f,!g.endsWith("/")&&s.push({path:g,size:u,read:()=>fRe(e,m,c,l,n)})}return s}function fRe(e,t,n,r,i){let o=e.readUInt16LE(t+26),s=e.readUInt16LE(t+28),a=t+30+o+s,c=e.subarray(a,a+r);if(n===0){if(c.length>i)throw new Error(`Stored zip entry exceeds the ${i}-byte decompressed-size limit.`);return Buffer.from(c)}if(n===8)return(0,u$.inflateRawSync)(c,{maxOutputLength:i});throw new Error(`Unsupported zip compression method ${n}`)}function mRe(e){let t=Math.max(0,e.length-65535-22);for(let n=e.length-22;n>=t;n--)if(e.readUInt32LE(n)===dRe)return n;return-1}var Rh=512;function gRe(e){let t=[],n=0,r=null;for(;n+Rh<=e.length;){let i=e.subarray(n,n+Rh);if(i[0]===0)break;let o=l$(i.subarray(0,100)),s=hRe(i.subarray(124,136)),a=String.fromCharCode(i[156]??0),c=l$(i.subarray(345,500)),l=n+Rh,u=l+s;if(n=l+Math.ceil(s/Rh)*Rh,a==="L"){r=l$(e.subarray(l,u));continue}if(a==="x"||a==="X"){r=yRe(e.subarray(l,u))??r;continue}if(a!=="0"&&a!=="\0"&&a!=="7"){r=null;continue}let d=r??(c?`${c}/${o}`:o);if(r=null,!d)continue;let p=e.subarray(l,u);t.push({path:d,size:s,read:()=>Buffer.from(p)})}return t}function l$(e){let t=e.indexOf(0);return e.toString("utf8",0,t===-1?e.length:t).trim()}function hRe(e){let t=l$(e).replace(/[^0-7]/g,"");return t?Number.parseInt(t,8):0}function yRe(e){for(let t of e.toString("utf8").split(` +`)){let n=/^\d+\s+path=(.*)$/.exec(t);if(n)return n[1]}return null}function bRe(e){return/^[aeiou]/i.test(e.trim())?"an":"a"}function xo(e){return`${bRe(e)} ${e}`}var C9="https://data.jsdelivr.com/v1/packages/npm",cM="https://cdn.jsdelivr.net/npm",vRe="https://registry.npmjs.org",wRe=50*1024*1024,d9=200*1024*1024,p9=20*1024*1024,d$=new Map;function Bc(e,t,n={}){if(n.traversal)return kRe+=1,xn("surface",e,()=>m9(e,t,n));let r=`${e}@${t}#${n.followDependencies===!1?"own":"deps"}`+(n.subpath?`#${n.subpath}`:""),i=d$.get(r);if(i)return tt("surface.cache.hit"),i;tt("surface.cache.miss");let o=xn("surface",e,()=>m9(e,t,n));return d$.set(r,o),o.then(s=>{s||d$.delete(r)},()=>d$.delete(r)),o}var kRe=0;var _Re=6;function $Re(e,t,n,r){return`npm-surface:v${_Re}:${e}@${t}#${n?"deps":"own"}`+(r?`#${r}`:"")}async function SRe(e,t,n,r){let i=uM(N9(n?.exports,r)),o=[...i?Ch(Vc(i)):[],...Ch(Vc(r))],s=[...new Set(o)],a=await lM(e,t,s);if(a!==void 0)return a;for(let c of s)if(await v$(e,t,c))return c;return null}function f9(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function N9(e,t){if(!e||typeof e!="object")return;let n=e;for(let r of[`./${t}`,t])if(r in n)return n[r]}async function m9(e,t,n){let r=n.followDependencies!==!1,i=$Re(e,t,r,n.subpath),o=await Ia(i);if(o)return tt("surface.diskCache.hit"),{...o,incomplete:o.incomplete??!1,api:new Map(o.api)};tt("surface.diskCache.miss");let s=await nM(e,t),a=n.subpath?await SRe(e,t,s,n.subpath):await URe(e,t,s),c=a?await xn("surface-sources",e,()=>XO(e,t,a)):{sources:[],truncated:!1};if(!a||c.sources.length===0){let h=await ARe(e,t);if(!h)throw new Rd(e,t);if(s=h.manifest,a=n.subpath?await GRe(s,n.subpath,h.files):zRe(e,s,h.files),a&&(c=await xn("surface-sources",e,()=>XO(e,t,a,h)),c.sources.length===0))throw new Rd(e,t)}if(!a){if(a=await BRe(e,t,n.subpath),!a)return null;c=await xn("surface-sources",e,()=>XO(e,t,a))}let l=c.sources,u=c.truncated;if(tt("surface.declarationFiles",l.length),l.length===0)return null;let d=new Map,p=[];for(let h of l)YRe(h.content,h.path,d,p,e);tPe(d,p),L9(d);let f=d.size,m=!s||!r?{followed:[],attempted:!1,incomplete:!1}:await xn("surface-deps",e,()=>ORe(s,l,d,`${e}@${t}`,n.traversal)),g=d.size>0?{api:d,entryPath:a,viaDependencies:m.followed,ownSymbols:f,subpaths:jRe(s?.exports),incomplete:m.incomplete||u}:null;return g&&!m.attempted&&!g.incomplete&&await Aa(i,{...g,api:[...g.api]}),g}var b$=class extends Error{constructor(n,r){super(`${n}@${r} could not be fetched`);this.packageName=n;this.version=r;this.name="VersionUnavailableError"}packageName;version},Rd=class extends Error{constructor(n,r){super(`${n}@${r} artifact could not be inspected`);this.packageName=n;this.version=r;this.name="ArtifactUnavailableError"}packageName;version};function nM(e,t){return xe(`${cM}/${e}@${t}/package.json`)}async function D9(e,t,n){let[r,i]=await Promise.all([nM(e,t),nM(e,n)]);if(!r||!i)return[];let o=g9(e,r),s=g9(e,i),a=[],c=[...o.requireConditions].filter(u=>!s.requireConditions.has(u)&&!s.commonJsExports.has(u));for(let u of c){let d=iM(e,u),p=TRe(u)?"affectedSpecifierPatterns":"affectedSpecifiers";a.push({kind:"exports-require-condition-removed",symbol:e,detail:u==="."?"The root CommonJS export condition was removed":`The CommonJS export condition for ${u} was removed`,before:[...o.requireConditions].sort().join(` `),after:[...s.requireConditions].sort().join(` -`)||"(none)",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"],[p]:[d]}})}let l=c.includes(".");return o.hasRootCommonJsEntry&&!s.hasRootCommonJsEntry&&!l?a.push({kind:"commonjs-entry-removed",symbol:e,detail:"The package no longer exposes a CommonJS-compatible entry point",before:o.entrySummary,after:s.entrySummary,moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"],affectedSpecifiers:[e]}}):i.type!==r.type&&r.type==="module"&&!s.hasRootCommonJsEntry&&!l&&a.push({kind:"package-type-changed",symbol:e,detail:"The package type changed to ESM without a CommonJS-compatible entry point",before:S8(i),after:S8(r),moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"],affectedSpecifiers:[e]}}),k0e(a)}function _8(e,t){let n=b0e(t.exports),i=v0e(t.exports,t),r=t.exports!==void 0?i.has("."):cO(t.main,t)||cO("./index.js",t),o=[`type: ${t.type??"(absent)"}`,t.exports===void 0&&t.main?`main: ${t.main}`:"",t.module?`module: ${t.module}`:"",n.size>0?`exports.require: ${[...n].sort().map(s=>aO(e,s)).join(", ")}`:"",i.size>0?`exports.commonjs: ${[...i].sort().map(s=>aO(e,s)).join(", ")}`:""].filter(Boolean).join(` -`)||"(no CommonJS-compatible entry point detected)";return{hasRootCommonJsEntry:r,requireConditions:n,commonJsExports:i,entrySummary:o}}function b0e(e){let t=new Set;return K$(e,".",t),t}function K$(e,t,n){if(Array.isArray(e)){for(let o of e)K$(o,t,n);return}if(!e||typeof e!="object")return;let i=Object.entries(e),r=i.some(([o])=>o==="."||o.startsWith("./"));for(let[o,s]of i)o==="require"&&n.add(t),r&&(o==="."||o.startsWith("./"))?K$(s,o,n):typeof s=="object"&&K$(s,t,n)}function v0e(e,t){let n=new Set;return sO(e,".",t,n),n}function sO(e,t,n,i){if(J$(e,n)&&i.add(t),Array.isArray(e)){for(let s of e)sO(s,t,n,i);return}if(!e||typeof e!="object")return;let r=Object.entries(e);if(r.some(([s])=>s==="."||s.startsWith("./")))for(let[s,a]of r)(s==="."||s.startsWith("./"))&&sO(a,s,n,i)}function aO(e,t){return t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function w0e(e){return e.includes("*")}function J$(e,t){if(typeof e=="string")return cO(e,t);if(Array.isArray(e))return e.some(i=>J$(i,t));if(!e||typeof e!="object")return!1;let n=e;return"require"in n?mh(n.require):"node"in n&&J$(n.node,t)?!0:"default"in n?J$(n.default,t):!1}function mh(e){if(typeof e=="string")return!/\.mjs$/i.test(e);if(Array.isArray(e))return e.some(mh);if(!e||typeof e!="object")return!1;let t=e;return"require"in t?mh(t.require):"node"in t&&mh(t.node)?!0:"default"in t?mh(t.default):!1}function cO(e,t){return e?/\.cjs$/i.test(e)?!0:/\.mjs$/i.test(e)?!1:(/\.[jt]sx?$/i.test(e),t.type!=="module"):!1}function S8(e){return`type: ${e.type??"(absent)"} -${e.main?`main: ${e.main}`:"main: (absent)"}`}function k0e(e){let t=new Set;return e.filter(n=>{let i=n.moduleSystem?.affectedSpecifiers?.join(",")??"",r=n.moduleSystem?.affectedSpecifierPatterns?.join(",")??"",o=`${n.kind}:${i}:${r}:${n.symbol}`;return t.has(o)?!1:(t.add(o),!0)})}var x8=new Map,q$=new Map;function $0e(e,t){let n=`${e}@${t}`,i=q$.get(n);if(i)return i;let r=encodeURIComponent(e).replaceAll("%40","@"),o=(async()=>{let s=await $e(`${p0e}/${r}/${encodeURIComponent(t)}`,{immutable:!0});if(!s?.dist?.tarball||s.version!==t)return null;let a=await Bt(s.dist.tarball,{maxBytes:f0e,timeoutMs:6e4,retries:2});if(!a.ok)return null;let c;try{c=Fn(a.bytes,{maxDecompressedBytes:v8})}catch{return null}if(c.length===0)return null;let l=c.reduce((f,m)=>f+Math.max(0,m.size),0);if(!Number.isSafeInteger(l)||l>v8)return null;let u=new Map;for(let f of c){let m=_0e(f.path);if(m===null)return null;!m||u.has(m)||u.set(m,f)}let d=u.get("package.json");if(!d||d.size>1024*1024)return null;let p;try{p=JSON.parse(d.read().toString("utf8"))}catch{return null}return p.version!==t?null:{manifest:p,files:u}})();return q$.set(n,o),o.then(s=>{s||q$.delete(n)},()=>q$.delete(n)),o}function _0e(e){let t=e.replaceAll("\\","/");if(!t||t.includes("\0")||t.startsWith("/")||/^[A-Za-z]:\//.test(t))return null;let n=t.split("/");if(n.some(i=>i===".."))return null;for(;n[0]==="."||n[0]==="";)n.shift();return n[0]==="package"&&n.shift(),n.join("/")}function V8(e,t){let n=`${e}@${t}`,i=x8.get(n);if(i)return i;let r=$e(`${j8}/${e}@${t}?structure=flat`,{immutable:!0,retries:0}).then(o=>o?.files?new Set(o.files.map(s=>s.name).filter(s=>typeof s=="string").map(s=>s.startsWith("/")?s.slice(1):s)):null).catch(()=>null);return x8.set(n,r),r}async function pO(e,t,n){let i=await V8(e,t);if(i)return n.find(r=>i.has(r))??null}var S0e=8,E8=8,x0e=4,E0e=24;function T0e(e){return e.star||e.reExported.size>0}async function I0e(e,t,n,i,r){let o={...e?.dependencies,...e?.peerDependencies},s=[...T8(t,n)].some(([y,w])=>w.star&&!o[k8(y)]);if(Object.keys(o).length===0)return{followed:[],attempted:!1,incomplete:s};let a=r?.depth??0,c=r?.budget??{remaining:E0e},l=new Set([...r?.visited??[],i]),u=[...T8(t,n)].map(([y,w])=>{let k=k8(y),_=y.length>k.length?y.slice(k.length+1):void 0;return{specifier:y,reference:w,pkg:k,subpath:_}}).filter(y=>o[y.pkg]),d=u.length>0;if(!d)return{followed:[],attempted:!1,incomplete:s};let p=[],f=!1,m=await qn(u,E8,y=>N0e(y.pkg,o[y.pkg])),g=[],h=0;for(let[y,{specifier:w,reference:k,pkg:_,subpath:S}]of u.entries()){let x=m[y],E=T0e(k);if(!x){E&&(f=!0);continue}let T=l.has(`${w}@${x}`);if(!E){if(h>=S0e)continue;h+=1,g.push({specifier:w,pkg:_,subpath:S,reference:k,resolved:x,publicEdge:E,recurse:!1});continue}let A=!T&&a0;A?c.remaining-=1:T||(f=!0),g.push({specifier:w,pkg:_,subpath:S,reference:k,resolved:x,publicEdge:E,recurse:A})}let b=new Array(g.length);await qn(g.map((y,w)=>({entry:y,index:w})),E8,async({entry:y,index:w})=>{y.recurse||(b[w]=await tl(y.pkg,y.resolved,{followDependencies:!1,...y.subpath?{subpath:y.subpath}:{}}).catch(()=>null))});for(let[y,w]of g.entries())w.recurse&&(b[y]=await tl(w.pkg,w.resolved,{followDependencies:!0,...w.subpath?{subpath:w.subpath}:{},traversal:{depth:a+1,visited:new Set([...l,`${w.specifier}@${w.resolved}`]),budget:c}}).catch(()=>null));for(let[y,w]of g.entries()){let k=b[y];if(w.publicEdge&&!k&&(f=!0),k?.incomplete&&(f=!0),!k)continue;let _=0;for(let[S,x]of w.reference.names(k.api)){let E=k.api.get(x);if(!E)continue;let T=w.reference.star||w.reference.reExported.has(S)?S:`${w.specifier}#${S}`;n.has(T)||(n.set(T,{...hh(E,S),via:w.specifier}),_+=1)}_>0&&p.push(`${w.specifier}@${w.resolved}`)}return{followed:p,attempted:d,incomplete:f||s}}function T8(e,t){let n=new Map,i=s=>{let a=n.get(s);if(a)return a;let c={named:new Map,star:!1,reExported:new Set,names(l){if(!this.star)return[...this.named];let u=[...l.keys()].map(d=>[d,d]);return[...this.named,...u.filter(([d])=>!this.named.has(d))]}};return n.set(s,c),c},r=[...t.values()].map(s=>s.signature).join(` -`),o=s=>new RegExp(`\\b${e_(s)}\\b`).test(r);for(let s of e)for(let a of A0e(s.content)){if(R0e(a.specifier))continue;let c=i(a.specifier);if(a.kind==="export"&&a.star){c.star=!0;continue}for(let l of a.bindings)a.kind==="export"?(c.named.set(l.local,l.imported),c.reExported.add(l.local)):o(l.local)&&c.named.set(l.imported,l.imported)}return n}function A0e(e){let t=[],n=/\b(import|export)\s+(?:type\s+)?(?:(\*(?:\s+as\s+\w+)?)|(\{[^}]*\})|(\w+))\s+from\s+['"]([^'"]+)['"]/g;for(let i of e.matchAll(n)){let[,r="",o,s,a,c=""]=i,l=r==="export"?"export":"import";if(o){t.push({kind:l,specifier:c,star:!0,bindings:[]});continue}if(a){t.push({kind:l,specifier:c,star:!1,bindings:[{imported:"default",local:a}]});continue}let u=[];for(let d of(s??"").replace(/[{}]/g,"").split(",")){let p=d.replace(/\btype\s+/g,"").trim();if(!p)continue;let[f,m]=p.split(/\s+as\s+/).map(g=>g.trim());f&&u.push({imported:f,local:m||f})}u.length>0&&t.push({kind:l,specifier:c,star:!1,bindings:u})}return t}function R0e(e){return e.startsWith(".")||e.startsWith("/")}async function N0e(e,t){return(await $e(`${j8}/${e}/resolved?specifier=${encodeURIComponent(t)}`))?.version??null}function C0e(e){return!e||typeof e!="object"?[]:Object.keys(e).filter(t=>t.startsWith("./")&&!t.endsWith("package.json")).slice(0,20)}async function P0e(e,t,n){let i=B8(e,n),r=await pO(e,t,i);if(r!==void 0){if(r)return r}else for(let o of i)if(await Q$(e,t,o))return o;return null}function D0e(e,t,n){return B8(e,t).find(i=>n.has(i))??null}function O0e(e,t,n){let i=fO(z8(e?.exports,t)),r=[...i?gh(nl(i)):[],...gh(nl(t))];return[...new Set(r)].find(o=>n.has(o))??null}function B8(e,t){let n=[];if(t){let i=t.types??t.typings??fO(t.exports);i&&n.push(...gh(nl(i))),t.main&&n.push(nl(t.main).replace(/\.(c|m)?js$/,".d.ts"))}return n.push(...F0e(e)),[...new Set(n)]}async function M0e(e,t,n){let i=e.startsWith("@")?`@types/${e.slice(1).replace("/","__")}`:`@types/${e}`,r=n?`${n}.d.ts`:"index.d.ts",o=n?`#${n}`:"",s=/^\D*(\d+)\./.exec(t)?.[1]??/^\D*(\d+)$/.exec(t)?.[1];return s&&await Q$(i,s,r)?`@types:${i}@${s}${o}`:await Q$(i,"latest",r)?`@types:${i}@latest${o}`:null}function L0e(e){let t=e.slice(7),n=t.indexOf("#"),i=n===-1?t:t.slice(0,n),r=n===-1?void 0:t.slice(n+1),o=i.lastIndexOf("@"),s=o>0?{name:i.slice(0,o),range:i.slice(o+1)}:{name:i,range:"latest"};return r?{...s,subpath:r}:s}function F0e(e){return["index.d.ts","dist/index.d.ts","lib/index.d.ts","types/index.d.ts",`types/${e.split("/").pop()?.replace(/^@/,"")||e}.d.ts`]}function gh(e){if(/\.d\.(c|m)?ts$/.test(e))return[e,e.replace(/\.d\.(c|m)?ts$/,".d.ts")];let t=e.replace(/\.(c|m)?[jt]s$/,"").replace(/\/$/,""),n=[`${t}.d.ts`,`${t}.d.cts`,`${t}.d.mts`,`${t}/index.d.ts`];return/\.(c|m)?js$/.test(e)||n.push(e),n}function fO(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=(n,i)=>{if(i>6||!n)return null;if(typeof n=="string")return i>0?n:null;if(typeof n!="object")return null;let r=n,o=r.types??r.typings;if(typeof o=="string")return o;let s=[".","import","require","default","node"];for(let a of[...s,...Object.keys(r)]){if(!(a in r))continue;let c=t(r[a],i+1);if(c)return c}return null};return t(e,0)}async function nO(e,t,n,i){let r=n.startsWith("@types:")?L0e(n):null,o=r?`${r.name}@${r.range}`:`${e}@${t}`,s=r?r.subpath?`${r.subpath}.d.ts`:"index.d.ts":n,a=r?null:i?new Set(i.files.keys()):await V8(e,t),c=0,l=[],u=new Set,d=[[s]],p=async g=>{let h=a?g.find(b=>a.has(b))??null:void 0;for(let b of h===void 0?g:h?[h]:[]){let y;if(i){let w=i.files.get(b);if(!w||w.size>w8-c)return null;let k=w.read();if(c+=k.length,c>w8)return null;y=k.toString("utf8")}else y=await rt(`${dO}/${o}/${b}`,{retries:0});if(y)return{path:b,content:y}}return null},f=!1;for(;d.length>0&&l.length0&&g.length+l.length!u.has(y));for(let y of b)u.add(y);b.length>0&&g.push(b)}if(g.length===0)continue;let h=await qn(g,U0e,b=>p(b));for(let b of h)if(b&&l.length>=W$&&(f=!0),!(!b||l.length>=W$)){l.push(b);for(let y of j0e(b.content))d.push(rO(b.path,y));for(let y of V0e(b.content))d.push(rO(b.path,y));for(let y of z0e(b.content))d.push(rO(b.path,y))}}return d.some(g=>g.some(h=>!u.has(h)))&&(f=!0),{sources:l,truncated:f}}var U0e=8,W$=Number(process.env.DRIFT_MAX_DECLARATION_FILES)||150;function j0e(e){let t=new Set,n=/\bexport\b\s*(?:type\b\s*)?(?:\*(?:\s+as\s+\w+)?|\{[^}]*\})\s*from\s*['"](\.[^'"]+)['"]/g;for(let r of e.matchAll(n))t.add(r[1]);let i=/\bimport\s+[A-Za-z_$][\w$]*\s*=\s*require\((['"])(\.[^'"]+)\1\)/g;for(let r of e.matchAll(i))t.add(r[2]);return[...t]}function z0e(e){if(!/\bexport\b\s*\{[^}]*\}(?!\s*from)/.test(e))return[];let t=new Set,n=/\bimport\b[^'"]*?\bfrom\s*['"](\.[^'"]+)['"]/g;for(let i of e.matchAll(n))t.add(i[1]);return[...t]}function G0e(e,t){if(!t)return[];let n=new Set([t,t.replace(/^@types\//,"")]),i=[],r=/\bdeclare\s+module\s+['"]([^'"]+)['"]\s*\{/g;for(let o=r.exec(e);o;o=r.exec(e)){let s=e.indexOf("{",o.index),a=ls(e,s);if(s<0||a<0)continue;let c=o[1];(n.has(c)||[...n].some(l=>c.startsWith(`${l}/`)))&&i.push(e.slice(s+1,a)),r.lastIndex=a+1}return i}function V0e(e){let t=new Set,n=/\/\/\/\s*/g;for(let i of e.matchAll(n))t.add(i[1]);return[...t]}function rO(e,t){let n=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",r=nl(n?`${n}/${t}`:t).replace(/\.(d\.(c|m)?ts|(c|m)?js|(c|m)?ts)$/,"");return[`${r}.d.ts`,`${r}.d.cts`,`${r}.d.mts`,`${r}/index.d.ts`,`${r}/index.d.cts`]}function nl(e){let t=[];for(let n of e.replace(/^\.\//,"").split("/"))!n||n==="."||(n===".."?t.pop():t.push(n));return t.join("/")}async function Q$(e,t,n){let i=await pO(e,t,[n]);return i!==void 0?i!==null:await rt(`${dO}/${e}@${t}/${n}`,{retries:0})!==null}function B0e(e,t,n=new Map,i=[],r){let o=new Map,s=(c,l)=>{let u=c.get(l.name);u&&u.kind===l.kind?(u.signature=`${u.signature} | ${l.signature}`,u.members=[...new Set([...u.members,...l.members])],u.requiredMembers=[...new Set([...u.requiredMembers,...l.requiredMembers])]):u||c.set(l.name,l)},a=gO(e);for(let c of A8(a))s(o,c.entry),c.exported&&s(n,c.entry);for(let c of G0e(a,r)){for(let l of A8(c))s(n,l.entry);I8(c,o,n,{override:!0})}return q0e(a,o),W0e(a,n),H0e(a,o,n,i),I8(a,o,n),Z0e(a,o,n),q8(n,o),n}function q8(e,t){let n=r=>e.get(r)??t?.get(r),i=(r,o)=>{if(!(!r.extends||o.has(r.name))){o.add(r.name);for(let s of r.extends){let a=n(s);!a||a===r||(i(a,o),r.members=[...new Set([...r.members,...a.members])],r.requiredMembers=[...new Set([...r.requiredMembers,...a.requiredMembers])])}}};for(let r of e.values())i(r,new Set)}function q0e(e,t){let n=i=>{t.has(i)||t.set(i,{name:i,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})};for(let i of e.matchAll(/\bimport\s+\*\s+as\s+([A-Za-z_$][\w$]*)\s+from\s+['"][^'"]+['"]/g))n(i[1]);for(let i of e.matchAll(/\bimport\s+(?:type\s+)?\{([^}]+)\}\s+from\s+['"][^'"]+['"]/g))for(let{exported:r}of hO(i[1]??""))n(r);for(let i of e.matchAll(/\bimport\s+([A-Za-z_$][\w$]*)\s*=\s*require\(['"][^'"]+['"]\)/g))n(i[1]);for(let i of e.matchAll(/\bimport\s+(?!type\s)([A-Za-z_$][\w$]*)\s*(?:,\s*\{[^}]*\})?\s+from\s+['"][^'"]+['"]/g))n(i[1])}function W0e(e,t){let n=/\bexport\b\s*(?:type\b\s*)?\*\s+as\s+([A-Za-z_$][\w$]*)\s*from\s*['"][^'"]+['"]/g;for(let i of e.matchAll(n)){let r=i[1];t.has(r)||t.set(r,{name:r,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})}}function H0e(e,t,n,i){let r=/\bexport\b\s*(?:type\b\s*)?\{([^}]+)\}(?:\s*from\s*['"][^'"]+['"])?\s*;/g;for(let o of e.matchAll(r))for(let{exported:s,local:a}of hO(o[1]??"")){if(n.has(s))continue;let c=t.get(a);c?n.set(s,hh(c,s)):i.push({exported:s,local:a})}}function K0e(e,t){for(let n of t){if(e.has(n.exported))continue;let i=e.get(n.local);i&&e.set(n.exported,hh(i,n.exported))}}function I8(e,t,n,i={}){for(let r of e.matchAll(/\bexport\s*=\s*([A-Za-z_$][\w$.]*)\s*(?:;|$)/gm))W8("default",r[1],t,n,i.override),J0e("default",r[1],t,n,i.override)}function J0e(e,t,n,i,r=!1){let o=i.get(e);if(!o||o.members.length>0&&!r)return;let s=n.get(t);if(!s)return;let a=s.signature.replace(/\s*\bexport\s*=[\s\S]*$/,"").replace(/\s*\}\s*$/,"").trim(),c=/:\s*([A-Za-z_$][\w$.]*)\s*;?\s*$/.exec(a)?.[1],l=c?n.get(c):void 0;l&&(o.members=[...l.members],o.requiredMembers=[...l.requiredMembers])}function W8(e,t,n,i,r=!1){let o=n.get(t);o&&(r||!i.has(e))&&i.set(e,hh(o,e));for(let s of n.values()){if(!s.name.startsWith(`${t}.`))continue;let a=`${e}.${s.name.slice(t.length+1)}`;(r||!i.has(a))&&i.set(a,hh(s,a))}}function Z0e(e,t,n){for(let i of e.matchAll(/\bexport\s+default\s+(?:abstract\s+)?(?:class|function|enum|const|let|var)?\s*([A-Za-z_$][\w$]*)/g)){let r=i[1];t.has(r)&&W8("default",r,t,n)}}function hh(e,t){return{...e,name:t,signature:e.signature.replace(new RegExp(`\\b${e_(e.name)}\\b`,"g"),t)}}function e_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yh(e){return e.replace(/\/\*(?:[^*]|\*(?!\/))*\*\//g,"").replace(/\/\/[^\n]*/g,"").replace(/\s+/g," ").trim()}function A8(e){let t=[];for(let n of K8(e))t.push({exported:n.exported,entry:{name:n.name,kind:"function",signature:yh(e.slice(n.start,To(e,n.start))),members:[],requiredMembers:[]}});return R8(e,/\b(export\s+)?(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g,"variable",t),tAe(e,t),R8(e,/\b(export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g,"type",t),iO(e,/\b(export\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"class",t),iO(e,/\b(export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"interface",t),iO(e,/\b(export\s+)?(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"enum",t),H8(e,"",!1,t),t}function H8(e,t,n,i){let r=/\b(export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\{/g;for(let o=r.exec(e);o;o=r.exec(e)){let s=e.indexOf("{",o.index),a=ls(e,s);if(s<0||a<0)continue;let c=n||!!o[1],l=t?`${t}.${o[2]}`:o[2],u=e.slice(s+1,a);i.push({exported:c,entry:{name:l,kind:"namespace",signature:`namespace ${l}`,members:X0e(u),requiredMembers:[]}}),Q0e(u,l,c,i),H8(u,l,c,i),Y0e(u,l,c,i),r.lastIndex=a+1}}function Y0e(e,t,n,i){let r=mO(e);for(let o of r.matchAll(/\bexport\b\s*\{([^}]+)\}\s*;?/g))for(let{exported:s}of hO(o[1]??""))i.push({exported:n,entry:{name:`${t}.${s}`,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0}})}function Q0e(e,t,n,i){let r=mO(e),o=(s,a,c,l=[],u=[])=>{i.push({exported:n,entry:{name:`${t}.${s}`,kind:a,signature:yh(c.replace(new RegExp(`\\b${e_(s)}\\b`),`${t}.${s}`)),members:l,requiredMembers:u}})};for(let s of K8(r))o(s.name,"function",r.slice(s.start,To(r,s.start)));for(let s of r.matchAll(/\b(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"variable",r.slice(a,To(r,a)))}for(let s of r.matchAll(/\b(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"type",r.slice(a,To(r,a)))}for(let s of r.matchAll(/\b(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"",d=X$(u,!0);o(s[1],"class",r.slice(a,c>=0?c:To(r,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of r.matchAll(/\b(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"",d=X$(u,!1);o(s[1],"interface",r.slice(a,c>=0?c:To(r,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of r.matchAll(/\b(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"";o(s[1],"enum",r.slice(a,c>=0?c:To(r,a)),Y8(u).map(d=>d.name))}}function mO(e){let t=[],n=/\b(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\s*\{/g;for(let r of e.matchAll(n)){let o=e.indexOf("{",r.index),s=ls(e,o);o>=0&&s>=0&&t.push([r.index??0,s+1])}if(t.length===0)return e;let i=[...e];for(let[r,o]of t)for(let s=r;s"){if(e[i-1]==="=")continue;if(n-=1,n===0)return i}else if(r==="("&&n===0)return-1}return-1}function gO(e){let t="",n=0;for(;n0?`exports.require: ${[...n].sort().map(s=>iM(e,s)).join(", ")}`:"",r.size>0?`exports.commonjs: ${[...r].sort().map(s=>iM(e,s)).join(", ")}`:""].filter(Boolean).join(` +`)||"(no CommonJS-compatible entry point detected)";return{hasRootCommonJsEntry:i,requireConditions:n,commonJsExports:r,entrySummary:o}}function xRe(e){let t=new Set;return g$(e,".",t),t}function g$(e,t,n){if(Array.isArray(e)){for(let o of e)g$(o,t,n);return}if(!e||typeof e!="object")return;let r=Object.entries(e),i=r.some(([o])=>o==="."||o.startsWith("./"));for(let[o,s]of r)o==="require"&&n.add(t),i&&(o==="."||o.startsWith("./"))?g$(s,o,n):typeof s=="object"&&g$(s,t,n)}function ERe(e,t){let n=new Set;return rM(e,".",t,n),n}function rM(e,t,n,r){if(h$(e,n)&&r.add(t),Array.isArray(e)){for(let s of e)rM(s,t,n,r);return}if(!e||typeof e!="object")return;let i=Object.entries(e);if(i.some(([s])=>s==="."||s.startsWith("./")))for(let[s,a]of i)(s==="."||s.startsWith("./"))&&rM(a,s,n,r)}function iM(e,t){return t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function TRe(e){return e.includes("*")}function h$(e,t){if(typeof e=="string")return oM(e,t);if(Array.isArray(e))return e.some(r=>h$(r,t));if(!e||typeof e!="object")return!1;let n=e;return"require"in n?Ph(n.require):"node"in n&&h$(n.node,t)?!0:"default"in n?h$(n.default,t):!1}function Ph(e){if(typeof e=="string")return!/\.mjs$/i.test(e);if(Array.isArray(e))return e.some(Ph);if(!e||typeof e!="object")return!1;let t=e;return"require"in t?Ph(t.require):"node"in t&&Ph(t.node)?!0:"default"in t?Ph(t.default):!1}function oM(e,t){return e?/\.cjs$/i.test(e)?!0:/\.mjs$/i.test(e)?!1:(/\.[jt]sx?$/i.test(e),t.type!=="module"):!1}function h9(e){return`type: ${e.type??"(absent)"} +${e.main?`main: ${e.main}`:"main: (absent)"}`}function IRe(e){let t=new Set;return e.filter(n=>{let r=n.moduleSystem?.affectedSpecifiers?.join(",")??"",i=n.moduleSystem?.affectedSpecifierPatterns?.join(",")??"",o=`${n.kind}:${r}:${i}:${n.symbol}`;return t.has(o)?!1:(t.add(o),!0)})}var y9=new Map,p$=new Map;function ARe(e,t){let n=`${e}@${t}`,r=p$.get(n);if(r)return r;let i=encodeURIComponent(e).replaceAll("%40","@"),o=(async()=>{let s=await xe(`${vRe}/${i}/${encodeURIComponent(t)}`,{immutable:!0});if(!s?.dist?.tarball||s.version!==t)return null;let a=await qt(s.dist.tarball,{maxBytes:wRe,timeoutMs:6e4,retries:2});if(!a.ok)return null;let c;try{c=Ln(a.bytes,{maxDecompressedBytes:d9})}catch{return null}if(c.length===0)return null;let l=c.reduce((f,m)=>f+Math.max(0,m.size),0);if(!Number.isSafeInteger(l)||l>d9)return null;let u=new Map;for(let f of c){let m=RRe(f.path);if(m===null)return null;!m||u.has(m)||u.set(m,f)}let d=u.get("package.json");if(!d||d.size>1024*1024)return null;let p;try{p=JSON.parse(d.read().toString("utf8"))}catch{return null}return p.version!==t?null:{manifest:p,files:u}})();return p$.set(n,o),o.then(s=>{s||p$.delete(n)},()=>p$.delete(n)),o}function RRe(e){let t=e.replaceAll("\\","/");if(!t||t.includes("\0")||t.startsWith("/")||/^[A-Za-z]:\//.test(t))return null;let n=t.split("/");if(n.some(r=>r===".."))return null;for(;n[0]==="."||n[0]==="";)n.shift();return n[0]==="package"&&n.shift(),n.join("/")}function O9(e,t){let n=`${e}@${t}`,r=y9.get(n);if(r)return r;let i=xe(`${C9}/${e}@${t}?structure=flat`,{immutable:!0,retries:0}).then(o=>o?.files?new Set(o.files.map(s=>s.name).filter(s=>typeof s=="string").map(s=>s.startsWith("/")?s.slice(1):s)):null).catch(()=>null);return y9.set(n,i),i}async function lM(e,t,n){let r=await O9(e,t);if(r)return n.find(i=>r.has(i))??null}var PRe=8,b9=8,CRe=4,NRe=24;function DRe(e){return e.star||e.reExported.size>0}async function ORe(e,t,n,r,i){let o={...e?.dependencies,...e?.peerDependencies},s=[...v9(t,n)].some(([b,w])=>w.star&&!o[f9(b)]);if(Object.keys(o).length===0)return{followed:[],attempted:!1,incomplete:s};let a=i?.depth??0,c=i?.budget??{remaining:NRe},l=new Set([...i?.visited??[],r]),u=[...v9(t,n)].map(([b,w])=>{let k=f9(b),$=b.length>k.length?b.slice(k.length+1):void 0;return{specifier:b,reference:w,pkg:k,subpath:$}}).filter(b=>o[b.pkg]),d=u.length>0;if(!d)return{followed:[],attempted:!1,incomplete:s};let p=[],f=!1,m=await qn(u,b9,b=>FRe(b.pkg,o[b.pkg])),g=[],h=0;for(let[b,{specifier:w,reference:k,pkg:$,subpath:S}]of u.entries()){let E=m[b],T=DRe(k);if(!E){T&&(f=!0);continue}let A=l.has(`${w}@${E}`);if(!T){if(h>=PRe)continue;h+=1,g.push({specifier:w,pkg:$,subpath:S,reference:k,resolved:E,publicEdge:T,recurse:!1});continue}let R=!A&&a0;R?c.remaining-=1:A||(f=!0),g.push({specifier:w,pkg:$,subpath:S,reference:k,resolved:E,publicEdge:T,recurse:R})}let v=new Array(g.length);await qn(g.map((b,w)=>({entry:b,index:w})),b9,async({entry:b,index:w})=>{b.recurse||(v[w]=await Bc(b.pkg,b.resolved,{followDependencies:!1,...b.subpath?{subpath:b.subpath}:{}}).catch(()=>null))});for(let[b,w]of g.entries())w.recurse&&(v[b]=await Bc(w.pkg,w.resolved,{followDependencies:!0,...w.subpath?{subpath:w.subpath}:{},traversal:{depth:a+1,visited:new Set([...l,`${w.specifier}@${w.resolved}`]),budget:c}}).catch(()=>null));for(let[b,w]of g.entries()){let k=v[b];if(w.publicEdge&&!k&&(f=!0),k?.incomplete&&(f=!0),!k)continue;let $=0;for(let[S,E]of w.reference.names(k.api)){let T=k.api.get(E);if(!T)continue;let A=w.reference.star||w.reference.reExported.has(S)?S:`${w.specifier}#${S}`;n.has(A)||(n.set(A,{...Nh(T,S),via:w.specifier}),$+=1)}$>0&&p.push(`${w.specifier}@${w.resolved}`)}return{followed:p,attempted:d,incomplete:f||s}}function v9(e,t){let n=new Map,r=s=>{let a=n.get(s);if(a)return a;let c={named:new Map,star:!1,reExported:new Set,names(l){if(!this.star)return[...this.named];let u=[...l.keys()].map(d=>[d,d]);return[...this.named,...u.filter(([d])=>!this.named.has(d))]}};return n.set(s,c),c},i=[...t.values()].map(s=>s.signature).join(` +`),o=s=>new RegExp(`\\b${k$(s)}\\b`).test(i);for(let s of e)for(let a of MRe(s.content)){if(LRe(a.specifier))continue;let c=r(a.specifier);if(a.kind==="export"&&a.star){c.star=!0;continue}for(let l of a.bindings)a.kind==="export"?(c.named.set(l.local,l.imported),c.reExported.add(l.local)):o(l.local)&&c.named.set(l.imported,l.imported)}return n}function MRe(e){let t=[],n=/\b(import|export)\s+(?:type\s+)?(?:(\*(?:\s+as\s+\w+)?)|(\{[^}]*\})|(\w+))\s+from\s+['"]([^'"]+)['"]/g;for(let r of e.matchAll(n)){let[,i="",o,s,a,c=""]=r,l=i==="export"?"export":"import";if(o){t.push({kind:l,specifier:c,star:!0,bindings:[]});continue}if(a){t.push({kind:l,specifier:c,star:!1,bindings:[{imported:"default",local:a}]});continue}let u=[];for(let d of(s??"").replace(/[{}]/g,"").split(",")){let p=d.replace(/\btype\s+/g,"").trim();if(!p)continue;let[f,m]=p.split(/\s+as\s+/).map(g=>g.trim());f&&u.push({imported:f,local:m||f})}u.length>0&&t.push({kind:l,specifier:c,star:!1,bindings:u})}return t}function LRe(e){return e.startsWith(".")||e.startsWith("/")}async function FRe(e,t){return(await xe(`${C9}/${e}/resolved?specifier=${encodeURIComponent(t)}`))?.version??null}function jRe(e){return!e||typeof e!="object"?[]:Object.keys(e).filter(t=>t.startsWith("./")&&!t.endsWith("package.json")).slice(0,20)}async function URe(e,t,n){let r=M9(e,n),i=await lM(e,t,r);if(i!==void 0){if(i)return i}else for(let o of r)if(await v$(e,t,o))return o;return null}function zRe(e,t,n){return M9(e,t).find(r=>n.has(r))??null}function GRe(e,t,n){let r=uM(N9(e?.exports,t)),i=[...r?Ch(Vc(r)):[],...Ch(Vc(t))];return[...new Set(i)].find(o=>n.has(o))??null}function M9(e,t){let n=[];if(t){let r=t.types??t.typings??uM(t.exports);r&&n.push(...Ch(Vc(r))),t.main&&n.push(Vc(t.main).replace(/\.(c|m)?js$/,".d.ts"))}return n.push(...qRe(e)),[...new Set(n)]}async function BRe(e,t,n){let r=e.startsWith("@")?`@types/${e.slice(1).replace("/","__")}`:`@types/${e}`,i=n?`${n}.d.ts`:"index.d.ts",o=n?`#${n}`:"",s=/^\D*(\d+)\./.exec(t)?.[1]??/^\D*(\d+)$/.exec(t)?.[1];return s&&await v$(r,s,i)?`@types:${r}@${s}${o}`:await v$(r,"latest",i)?`@types:${r}@latest${o}`:null}function VRe(e){let t=e.slice(7),n=t.indexOf("#"),r=n===-1?t:t.slice(0,n),i=n===-1?void 0:t.slice(n+1),o=r.lastIndexOf("@"),s=o>0?{name:r.slice(0,o),range:r.slice(o+1)}:{name:r,range:"latest"};return i?{...s,subpath:i}:s}function qRe(e){return["index.d.ts","dist/index.d.ts","lib/index.d.ts","types/index.d.ts",`types/${e.split("/").pop()?.replace(/^@/,"")||e}.d.ts`]}function Ch(e){if(/\.d\.(c|m)?ts$/.test(e))return[e,e.replace(/\.d\.(c|m)?ts$/,".d.ts")];let t=e.replace(/\.(c|m)?[jt]s$/,"").replace(/\/$/,""),n=[`${t}.d.ts`,`${t}.d.cts`,`${t}.d.mts`,`${t}/index.d.ts`];return/\.(c|m)?js$/.test(e)||n.push(e),n}function uM(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=(n,r)=>{if(r>6||!n)return null;if(typeof n=="string")return r>0?n:null;if(typeof n!="object")return null;let i=n,o=i.types??i.typings;if(typeof o=="string")return o;let s=[".","import","require","default","node"];for(let a of[...s,...Object.keys(i)]){if(!(a in i))continue;let c=t(i[a],r+1);if(c)return c}return null};return t(e,0)}async function XO(e,t,n,r){let i=n.startsWith("@types:")?VRe(n):null,o=i?`${i.name}@${i.range}`:`${e}@${t}`,s=i?i.subpath?`${i.subpath}.d.ts`:"index.d.ts":n,a=i?null:r?new Set(r.files.keys()):await O9(e,t),c=0,l=[],u=new Set,d=[[s]],p=async g=>{let h=a?g.find(v=>a.has(v))??null:void 0;for(let v of h===void 0?g:h?[h]:[]){let b;if(r){let w=r.files.get(v);if(!w||w.size>p9-c)return null;let k=w.read();if(c+=k.length,c>p9)return null;b=k.toString("utf8")}else b=await nt(`${cM}/${o}/${v}`,{retries:0});if(b)return{path:v,content:b}}return null},f=!1;for(;d.length>0&&l.length0&&g.length+l.length!u.has(b));for(let b of v)u.add(b);v.length>0&&g.push(v)}if(g.length===0)continue;let h=await qn(g,WRe,v=>p(v));for(let v of h)if(v&&l.length>=f$&&(f=!0),!(!v||l.length>=f$)){l.push(v);for(let b of HRe(v.content))d.push(eM(v.path,b));for(let b of ZRe(v.content))d.push(eM(v.path,b));for(let b of KRe(v.content))d.push(eM(v.path,b))}}return d.some(g=>g.some(h=>!u.has(h)))&&(f=!0),{sources:l,truncated:f}}var WRe=8,f$=Number(process.env.DRIFT_MAX_DECLARATION_FILES)||150;function HRe(e){let t=new Set,n=/\bexport\b\s*(?:type\b\s*)?(?:\*(?:\s+as\s+\w+)?|\{[^}]*\})\s*from\s*['"](\.[^'"]+)['"]/g;for(let i of e.matchAll(n))t.add(i[1]);let r=/\bimport\s+[A-Za-z_$][\w$]*\s*=\s*require\((['"])(\.[^'"]+)\1\)/g;for(let i of e.matchAll(r))t.add(i[2]);return[...t]}function KRe(e){if(!/\bexport\b\s*\{[^}]*\}(?!\s*from)/.test(e))return[];let t=new Set,n=/\bimport\b[^'"]*?\bfrom\s*['"](\.[^'"]+)['"]/g;for(let r of e.matchAll(n))t.add(r[1]);return[...t]}function JRe(e,t){if(!t)return[];let n=new Set([t,t.replace(/^@types\//,"")]),r=[],i=/\bdeclare\s+module\s+['"]([^'"]+)['"]\s*\{/g;for(let o=i.exec(e);o;o=i.exec(e)){let s=e.indexOf("{",o.index),a=us(e,s);if(s<0||a<0)continue;let c=o[1];(n.has(c)||[...n].some(l=>c.startsWith(`${l}/`)))&&r.push(e.slice(s+1,a)),i.lastIndex=a+1}return r}function ZRe(e){let t=new Set,n=/\/\/\/\s*/g;for(let r of e.matchAll(n))t.add(r[1]);return[...t]}function eM(e,t){let n=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",i=Vc(n?`${n}/${t}`:t).replace(/\.(d\.(c|m)?ts|(c|m)?js|(c|m)?ts)$/,"");return[`${i}.d.ts`,`${i}.d.cts`,`${i}.d.mts`,`${i}/index.d.ts`,`${i}/index.d.cts`]}function Vc(e){let t=[];for(let n of e.replace(/^\.\//,"").split("/"))!n||n==="."||(n===".."?t.pop():t.push(n));return t.join("/")}async function v$(e,t,n){let r=await lM(e,t,[n]);return r!==void 0?r!==null:await nt(`${cM}/${e}@${t}/${n}`,{retries:0})!==null}function YRe(e,t,n=new Map,r=[],i){let o=new Map,s=(c,l)=>{let u=c.get(l.name);u&&u.kind===l.kind?(u.signature=`${u.signature} | ${l.signature}`,u.members=[...new Set([...u.members,...l.members])],u.requiredMembers=[...new Set([...u.requiredMembers,...l.requiredMembers])]):u||c.set(l.name,l)},a=pM(e);for(let c of k9(a))s(o,c.entry),c.exported&&s(n,c.entry);for(let c of JRe(a,i)){for(let l of k9(c))s(n,l.entry);w9(c,o,n,{override:!0})}return QRe(a,o),XRe(a,n),ePe(a,o,n,r),w9(a,o,n),rPe(a,o,n),L9(n,o),n}function L9(e,t){let n=i=>e.get(i)??t?.get(i),r=(i,o)=>{if(!(!i.extends||o.has(i.name))){o.add(i.name);for(let s of i.extends){let a=n(s);!a||a===i||(r(a,o),i.members=[...new Set([...i.members,...a.members])],i.requiredMembers=[...new Set([...i.requiredMembers,...a.requiredMembers])])}}};for(let i of e.values())r(i,new Set)}function QRe(e,t){let n=r=>{t.has(r)||t.set(r,{name:r,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})};for(let r of e.matchAll(/\bimport\s+\*\s+as\s+([A-Za-z_$][\w$]*)\s+from\s+['"][^'"]+['"]/g))n(r[1]);for(let r of e.matchAll(/\bimport\s+(?:type\s+)?\{([^}]+)\}\s+from\s+['"][^'"]+['"]/g))for(let{exported:i}of fM(r[1]??""))n(i);for(let r of e.matchAll(/\bimport\s+([A-Za-z_$][\w$]*)\s*=\s*require\(['"][^'"]+['"]\)/g))n(r[1]);for(let r of e.matchAll(/\bimport\s+(?!type\s)([A-Za-z_$][\w$]*)\s*(?:,\s*\{[^}]*\})?\s+from\s+['"][^'"]+['"]/g))n(r[1])}function XRe(e,t){let n=/\bexport\b\s*(?:type\b\s*)?\*\s+as\s+([A-Za-z_$][\w$]*)\s*from\s*['"][^'"]+['"]/g;for(let r of e.matchAll(n)){let i=r[1];t.has(i)||t.set(i,{name:i,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})}}function ePe(e,t,n,r){let i=/\bexport\b\s*(?:type\b\s*)?\{([^}]+)\}(?:\s*from\s*['"][^'"]+['"])?\s*;/g;for(let o of e.matchAll(i))for(let{exported:s,local:a}of fM(o[1]??"")){if(n.has(s))continue;let c=t.get(a);c?n.set(s,Nh(c,s)):r.push({exported:s,local:a})}}function tPe(e,t){for(let n of t){if(e.has(n.exported))continue;let r=e.get(n.local);r&&e.set(n.exported,Nh(r,n.exported))}}function w9(e,t,n,r={}){for(let i of e.matchAll(/\bexport\s*=\s*([A-Za-z_$][\w$.]*)\s*(?:;|$)/gm))F9("default",i[1],t,n,r.override),nPe("default",i[1],t,n,r.override)}function nPe(e,t,n,r,i=!1){let o=r.get(e);if(!o||o.members.length>0&&!i)return;let s=n.get(t);if(!s)return;let a=s.signature.replace(/\s*\bexport\s*=[\s\S]*$/,"").replace(/\s*\}\s*$/,"").trim(),c=/:\s*([A-Za-z_$][\w$.]*)\s*;?\s*$/.exec(a)?.[1],l=c?n.get(c):void 0;l&&(o.members=[...l.members],o.requiredMembers=[...l.requiredMembers])}function F9(e,t,n,r,i=!1){let o=n.get(t);o&&(i||!r.has(e))&&r.set(e,Nh(o,e));for(let s of n.values()){if(!s.name.startsWith(`${t}.`))continue;let a=`${e}.${s.name.slice(t.length+1)}`;(i||!r.has(a))&&r.set(a,Nh(s,a))}}function rPe(e,t,n){for(let r of e.matchAll(/\bexport\s+default\s+(?:abstract\s+)?(?:class|function|enum|const|let|var)?\s*([A-Za-z_$][\w$]*)/g)){let i=r[1];t.has(i)&&F9("default",i,t,n)}}function Nh(e,t){return{...e,name:t,signature:e.signature.replace(new RegExp(`\\b${k$(e.name)}\\b`,"g"),t)}}function k$(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dh(e){return e.replace(/\/\*(?:[^*]|\*(?!\/))*\*\//g,"").replace(/\/\/[^\n]*/g,"").replace(/\s+/g," ").trim()}function k9(e){let t=[];for(let n of U9(e))t.push({exported:n.exported,entry:{name:n.name,kind:"function",signature:Dh(e.slice(n.start,Eo(e,n.start))),members:[],requiredMembers:[]}});return _9(e,/\b(export\s+)?(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g,"variable",t),cPe(e,t),_9(e,/\b(export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g,"type",t),tM(e,/\b(export\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"class",t),tM(e,/\b(export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"interface",t),tM(e,/\b(export\s+)?(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"enum",t),j9(e,"",!1,t),t}function j9(e,t,n,r){let i=/\b(export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\{/g;for(let o=i.exec(e);o;o=i.exec(e)){let s=e.indexOf("{",o.index),a=us(e,s);if(s<0||a<0)continue;let c=n||!!o[1],l=t?`${t}.${o[2]}`:o[2],u=e.slice(s+1,a);r.push({exported:c,entry:{name:l,kind:"namespace",signature:`namespace ${l}`,members:sPe(u),requiredMembers:[]}}),oPe(u,l,c,r),j9(u,l,c,r),iPe(u,l,c,r),i.lastIndex=a+1}}function iPe(e,t,n,r){let i=dM(e);for(let o of i.matchAll(/\bexport\b\s*\{([^}]+)\}\s*;?/g))for(let{exported:s}of fM(o[1]??""))r.push({exported:n,entry:{name:`${t}.${s}`,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0}})}function oPe(e,t,n,r){let i=dM(e),o=(s,a,c,l=[],u=[])=>{r.push({exported:n,entry:{name:`${t}.${s}`,kind:a,signature:Dh(c.replace(new RegExp(`\\b${k$(s)}\\b`),`${t}.${s}`)),members:l,requiredMembers:u}})};for(let s of U9(i))o(s.name,"function",i.slice(s.start,Eo(i,s.start)));for(let s of i.matchAll(/\b(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"variable",i.slice(a,Eo(i,a)))}for(let s of i.matchAll(/\b(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"type",i.slice(a,Eo(i,a)))}for(let s of i.matchAll(/\b(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=i.indexOf("{",a),l=us(i,c),u=c>=0&&l>c?i.slice(c+1,l):"",d=w$(u,!0);o(s[1],"class",i.slice(a,c>=0?c:Eo(i,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of i.matchAll(/\b(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=i.indexOf("{",a),l=us(i,c),u=c>=0&&l>c?i.slice(c+1,l):"",d=w$(u,!1);o(s[1],"interface",i.slice(a,c>=0?c:Eo(i,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of i.matchAll(/\b(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=i.indexOf("{",a),l=us(i,c),u=c>=0&&l>c?i.slice(c+1,l):"";o(s[1],"enum",i.slice(a,c>=0?c:Eo(i,a)),B9(u).map(d=>d.name))}}function dM(e){let t=[],n=/\b(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\s*\{/g;for(let i of e.matchAll(n)){let o=e.indexOf("{",i.index),s=us(e,o);o>=0&&s>=0&&t.push([i.index??0,s+1])}if(t.length===0)return e;let r=[...e];for(let[i,o]of t)for(let s=i;s"){if(e[r-1]==="=")continue;if(n-=1,n===0)return r}else if(i==="("&&n===0)return-1}return-1}function pM(e){let t="",n=0;for(;nl.name),requiredMembers:a.filter(l=>l.required).map(l=>l.name)}})}}}function nAe(e){let t=/^\s*(?:export\s+)?(?:declare\s+)?(?:const|let|var)\s+/.exec(e);if(!t)return[];let n=0,i=0,r=0,o=0,s=[],a="";for(let c=t[0].length;c"&&e[c-1]!=="=")o=Math.max(0,o-1);else if(l==="{")r+=1;else if(l==="}")r-=1;else if(n<=0&&i<=0&&r<=0&&o<=0){if(l===","){s.push(a),a="";continue}if(l===";")break}a+=l}return s.push(a),s.slice(1).filter(c=>c.trim()!=="")}function R8(e,t,n,i){for(let r of e.matchAll(t)){let o=r.index??0,s=To(e,o),a=e.slice(o,s),c=n==="type"?rAe(a):n==="variable"?J8(a):[];i.push({exported:!!r[1],entry:{name:r[2],kind:n,signature:yh(a),members:c.map(l=>l.name),requiredMembers:c.filter(l=>l.required).map(l=>l.name)}})}}function rAe(e){return Z8(e,"=")}function J8(e){return Z8(e,":")}function Z8(e,t){let n=e.indexOf(t);if(n<0)return[];let i=e.slice(n+1),r=i.indexOf("{");if(r<0||i.slice(0,r).trim()!=="")return[];let o=ls(i,r);return o<0?[]:i.slice(o+1).replace(/;\s*$/,"").trim()!==""?[]:X$(i.slice(r+1,o),!1)}function iO(e,t,n,i){for(let r of e.matchAll(t)){let o=r.index??0,s=e.indexOf("{",o),a=ls(e,s),c=a>=0?a+1:To(e,o),l=s>=0&&a>s?e.slice(s+1,a):"",u=n==="enum"?Y8(l):X$(l,n==="class"),d=s>=0?iAe(e.slice(o,s)):[];i.push({exported:!!r[1],entry:{name:r[2],kind:n,signature:yh(e.slice(o,s>=0?s:c)),members:u.map(p=>p.name),requiredMembers:u.filter(p=>p.required).map(p=>p.name),...d.length>0?{extends:d}:{}}})}}function iAe(e){let t=/\b(?:extends|implements)\s+([\s\S]+)$/.exec(e);return t?bh(t[1]).map(n=>/^\s*([A-Za-z_$][\w$]*)/.exec(n.replace(/\bimplements\b/g,","))?.[1]).filter(n=>!!n):[]}function To(e,t){let n=0,i=0,r=0,o=0;for(let s=t;s"&&e[s-1]!=="=")o=Math.max(0,o-1);else if(a==="{"){if(n===0&&i===0&&r===0&&o===0){let c=ls(e,s);return c>=0?c+1:e.length}r+=1}else if(a==="}")r-=1;else if(a===";"&&n<=0&&i<=0&&r<=0&&o<=0)return s+1}return e.length}function ls(e,t){if(t<0)return-1;let n=0;for(let i=t;i/^[\s\n]*([A-Za-z_$][\w$]*)/.exec(t)?.[1]).filter(t=>!!t).map(t=>({name:t,required:!1}))}function X$(e,t){let n=[],i=/(?:^|[;\n])\s*((?:public|protected|private|readonly|static|abstract|declare|override)\s+)*(#?[A-Za-z_$][\w$]*)(\?)?\s*(\(|:|<)/g;for(let r of e.matchAll(i)){let o=r[1]??"",s=r[2];s==="constructor"||o.includes("private")||s.startsWith("#")||n.push({name:s,required:t?r[4]===":"&&!r[3]:!r[3]})}return n}function hO(e){let t=[];for(let n of e.split(",")){let i=n.replace(/\btype\s+/g,"").trim();if(!i)continue;let[r,o]=i.split(/\s+as\s+/).map(s=>s.trim());r&&t.push({local:r,exported:o||r})}return t}function oAe(e,t){let n=r=>r==="variable"||r==="function";if(n(e)&&n(t))return!0;let i=r=>r==="interface"||r==="type";return i(e)&&i(t)}function Q8(e,t,n){if(t.api.size<20)return null;let r=0;for(let a of t.api.keys())n.api.has(a)&&(r+=1);if(r>t.api.size*.1||n.api.size>t.api.size*.1)return null;let o=n.subpaths.filter(a=>a!=="."),s=o.length>0?` The new version publishes ${o.length} other entry point${o.length===1?"":"s"}: ${o.join(", ")}. Import from the one that carries the API you use, rather than replacing the symbols individually.`:" Nothing in the new version publishes the old symbols under the old import path.";return{kind:"entry-point-moved",symbol:e,detail:`Importing \`${e}\` no longer gives you its API: the root entry point went from ${t.api.size} exported symbols to ${n.api.size}.${s}`,before:`${t.entryPath} \u2014 ${t.api.size} exports`,after:`${n.entryPath} \u2014 ${n.api.size} exports`}}function sAe(e,t,n){if(e.shapeUnknown||t.length===0)return null;let i=a=>/^[A-Za-z_$][\w$]*$/.test(Z$(a.name))&&!/[#/]/.test(a.name),r=Z$(e.name);if(r.length<3||!/^[A-Za-z_$][\w$]*$/.test(r))return null;let o=t.filter(a=>i(a)&&a.kind===e.kind&&N8(e)&&N8(a)&&C8(e.signature,e.name)===C8(a.signature,a.name)&&aAe(e,a));if(o.length===1)return o[0];let s=(n??"").replace(/^@[^/]+\//,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase();if(s){let a=t.filter(c=>{if(!i(c))return!1;let l=Z$(c.name).toLowerCase();return l===`${s}${r.toLowerCase()}`||l===`${r.toLowerCase()}${s}`});if(a.length===1)return a[0]}return null}function N8(e){let t=e.signature??"";return t.includes("(")&&t.replace(/\s+/g,"").length>=20?!0:e.members.length>=2}function aAe(e,t){if(e.members.length===0&&t.members.length===0)return!0;let n=[...e.members].sort().join(","),i=[...t.members].sort().join(",");return n===i}function Z$(e){return e.split(".").pop()??e}function C8(e,t){let n=Z$(t);return e.replace(new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"g"),"\0").replace(/\s+/g," ").trim()}function Dr(e,t,n={}){let i=[],r=[...t.entries()].filter(([o])=>!e.has(o)).map(([,o])=>o);for(let[o,s]of e){let a=t.get(o),c=s.name,l=s.via?` (declared in ${s.via})`:"";if(!a){if(n.afterComplete===!1&&s.via)continue;let g=sAe(s,r,n.packageName);i.push({kind:"export-removed",symbol:c,detail:s.shapeUnknown?`\`${c}\` is no longer exported${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`:`\`${c}\` is no longer exported (was ${Eo(s.kind)})${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`,before:s.signature,...g?{after:g.signature,replacement:g.name}:{},...s.shapeUnknown?{}:{fromKind:s.kind}});continue}if(s.shapeUnknown||a.shapeUnknown)continue;if(s.kind!==a.kind&&!oAe(s.kind,a.kind)){i.push({kind:"kind-changed",symbol:c,detail:`\`${c}\` changed from ${Eo(s.kind)} to ${Eo(a.kind)}${l}.`,before:s.signature,after:a.signature,fromKind:s.kind,toKind:a.kind});continue}for(let g of s.members)if(!a.members.includes(g))i.push({kind:"member-removed",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` was removed${l}.`});else{let h=s.memberSignatures?.[g],b=a.memberSignatures?.[g];h&&b&&h!==b&&i.push({kind:"signature-changed",symbol:`${c}.${g}`,detail:`The signature of \`${c}.${g}\` changed${l}.`,before:h,after:b})}let u=new Set(s.requiredMembers);for(let g of a.requiredMembers)!u.has(g)&&s.members.includes(g)&&i.push({kind:"member-now-required",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` is now required; it was previously optional${l}.`});let[d,p]=tY(s.signature,a.signature),f=!!(s.callable&&a.callable);(f?!uAe(s.callable,a.callable):d!==p&&s.kind!=="interface"&&s.kind!=="class"&&!vAe(d,p)&&!lAe(d,p))&&i.push({kind:"signature-changed",symbol:c,detail:`The signature of \`${c}\` changed${l}.`,before:s.signature,after:a.signature,...f?{changed:"parameters"}:cAe(d,p)??{}})}return i}function cAe(e,t){let n=rl(e),i=rl(t);if(!n||!i)return null;let r=!il(n.returns,i.returns),o=n.parameters.length!==i.parameters.length||n.parameters.some((s,a)=>{let c=i.parameters[a];return!c||s.optional!==c.optional||s.rest!==c.rest||!il(s.type,c.type)});return r&&o?{changed:"both"}:r?{changed:"return-type"}:o?{changed:"parameters"}:null}function lAe(e,t){if(e.includes(" | declare ")||t.includes(" | declare ")||e.includes(" | export ")||t.includes(" | export "))return!1;let n=rl(e),i=rl(t);if(!n||!i||!il(n.returns,i.returns)||i.parameters.lengthr.optional||r.rest)}function uAe(e,t){let n=p=>p.parameters.filter(f=>f.kind==="positional-only"||f.kind==="positional-or-keyword"),i=(p,f)=>p.parameters.some(m=>m.kind===f),r=p=>p.parameters.filter(f=>f.kind==="positional-or-keyword"||f.kind==="keyword-only"),o=(p,f)=>p.parameters.find(m=>m.name===f),s=n(e),a=n(t),c=s.filter(p=>p.required).length,l=a.filter(p=>p.required).length,u=i(e,"var-positional")?1/0:s.length,d=i(t,"var-positional")?1/0:a.length;if(l>c||dc!==null),s=uO(r).map(rl).filter(c=>c!==null);if(o.length===0||s.length===0)return!1;let a=o.filter(c=>lO(c,n));return a.length===0?!1:a.every(c=>s.some(l=>{if(!lO(l,n)||!il(c.returns,l.returns))return!1;for(let u=0;ui!==null);return n.length===0?!1:!n.some(i=>lO(i,t))}function lO(e,t){let n=e.parameters.filter(i=>!i.optional&&!i.rest).length;return ti.rest)||t<=e.parameters.length}function uO(e){return e.split(/ \| (?=(?:export\s+)?declare\b)/).map(t=>t.trim()).filter(Boolean)}function rl(e){let t=dAe(e);if(t<0)return null;let n=pAe(e,t);if(n<0)return null;let i=e.slice(t+1,n),r=e.slice(n+1).trim(),o=/^(?:=>|:)\s*([\s\S]*?)\s*;?$/.exec(r)?.[1];if(o===void 0)return null;let s=[];for(let a of bh(i)){let c=a.trim();if(!c)continue;let l=/^(\.\.\.)?\s*(?:readonly\s+)?([A-Za-z_$][\w$]*|\{[\s\S]*?\}|\[[\s\S]*?\])\s*(\?)?\s*:\s*([\s\S]+)$/.exec(c);if(!l)return null;s.push({rest:!!l[1],optional:!!l[3]||!!l[1],type:l[4]})}return{parameters:s,returns:o}}function dAe(e){let t=0;for(let n=0;n"&&e[n-1]!=="=")t-=1;else if(i==="("&&t<=0)return n}return-1}function pAe(e,t){let n=0;for(let i=t;i=fAe)return!1;let i=e.trim(),r=t.trim(),o=[O8(i),O8(r)];return o[0]&&o[1]?il(o[0].check,o[1].check)&&Jd(o[0].whenTrue,o[1].whenTrue,n+1)&&Jd(o[0].whenFalse,o[1].whenFalse,n+1):H$(i,"{","}")&&H$(r,"{","}")?mAe(i,r,n):H$(i,"[","]")&&H$(r,"[","]")?gAe(i,r,n):!1}var fAe=6;function mAe(e,t,n){let i=P8(e),r=P8(t);if(!i||!r)return!1;for(let[o,s]of i){let a=r.get(o);if(!a||s.optional&&!a.optional||!Jd(s.type,a.type,n+1))return!1}for(let[o,s]of r)if(!i.has(o)&&!s.optional)return!1;return!0}function gAe(e,t,n){let i=D8(e),r=D8(t);if(!i||!r||r.lengtho.optional||o.rest)}function P8(e){let t=new Map;for(let n of yAe(e.trim().slice(1,-1))){let i=n.trim();if(!i)continue;let r=/^(?:readonly\s+)?(?:'([^']+)'|"([^"]+)"|([A-Za-z_$][\w$]*))\s*(\?)?\s*:\s*([\s\S]+)$/.exec(i);if(!r)return null;let o=r[1]??r[2]??r[3];t.set(o,{optional:!!r[4],type:r[5].trim()})}return t}function D8(e){let t=[];for(let n of bh(e.trim().slice(1,-1))){let i=n.trim();if(!i)continue;let r=/^(\.\.\.)?\s*([A-Za-z_$][\w$]*)\s*(\?)?\s*:\s*([\s\S]+)$/.exec(i);if(r){t.push({rest:!!r[1],optional:!!r[3]||!!r[1],type:r[4].trim()});continue}let o=/^(\.\.\.)?\s*([\s\S]+?)(\?)?$/.exec(i);if(!o)return null;t.push({rest:!!o[1],optional:!!o[3]||!!o[1],type:o[2].trim()})}return t}function O8(e){let t=0;for(let n=0;n)]}".includes(i))i===">"&&e[n-1]==="="||(t-=1);else if(i==="?"&&t===0){let r=e.slice(0,n);if(!/\bextends\b/.test(r))return null;let o=hAe(e,n+1);return o===-1?null:{check:r.trim(),whenTrue:e.slice(n+1,o).trim(),whenFalse:e.slice(o+1).trim()}}}return null}function hAe(e,t){let n=0,i=0;for(let r=t;r)]}".includes(o))o===">"&&e[r-1]==="="||(n-=1);else if(n===0&&o==="?")i+=1;else if(n===0&&o===":"){if(i===0)return r;i-=1}}return-1}function yAe(e){return bh(e,";,")}function H$(e,t,n){if(!e.startsWith(t)||!e.endsWith(n))return!1;let i=0;for(let r=0;rn.some(o=>il(r,o)))}function M8(e){let t=[],n=0,i="";for(let r of e){if("<([{".includes(r)?n+=1:">)]}".includes(r)&&(n-=1),r==="|"&&n===0){t.push(i),i="";continue}i+=r}return i.trim()&&t.push(i),t.map(r=>r.trim()).filter(Boolean)}function il(e,t){let n=i=>i.replace(/\s+/g,"").replace(/\|undefined$/,"");return n(e)===n(t)}function vAe(e,t){if(e===t)return!0;let n=U8(e);return n===U8(t)&&n!==null}function tY(e,t){let n=L8(e),i=L8(t);if(n.size===0&&i.size===0)return[e,t];for(let[r,o]of n){let s=i.get(r);if(s!==void 0&&s!==o)return[e,t]}return[F8(e),F8(t)]}function L8(e){let t=new Map,n=/\bimport\((["'])((?:(?!\1).)*)\1\)\.([A-Za-z_$][\w$]*)/g;for(let i of e.matchAll(n))t.set(i[3],i[2]);return t}function F8(e){return e.replace(/\bimport\((["'])(?:(?!\1).)*\1\)\./g,"")}function U8(e){let t=wAe(e);if(t.length===0)return null;let n=e;return t.forEach((i,r)=>{n=n.replace(new RegExp(`\\b${e_(i)}\\b`,"g"),`\0T${r}`)}),n}function wAe(e){let t=[];for(let n=0;n"&&(n-=1,n===0))return i;return-1}function bh(e,t=","){let n=[],i=0,r="";for(let o=0;o)]}".includes(s)&&(s===">"&&e[o-1]==="="||(i-=1)),t.includes(s)&&i===0){n.push(r),r="";continue}r+=s}return r.trim()&&n.push(r),n}var c_=require("node:fs/promises"),W9=require("node:os"),H9=require("node:path");var vh=require("node:fs/promises"),Zd=require("node:path");var yO=new Map;async function bO(e,t){if(!e.autoInstall)return!1;let n=yO.get(t.id);if(n)return n;let i=$Ae(e,t).finally(()=>{yO.delete(t.id)});return yO.set(t.id,i),i}async function $Ae(e,t){e.logger.info(`Installing ${t.label.replace(/^Install\s+/i,"")}...`);let n=await e.exec(t.command,t.args,{...e.env?{env:e.env}:{},timeoutMs:10*6e4});return n.code!==0?(e.logger.warn(`${t.label} failed: ${(n.stderr||n.stdout||"no output").trim()}`),!1):(e.logger.info(`${t.label.replace(/^Install\s+/i,"")} installed.`),!0)}function ne(e,t,n,i,r){return{available:!1,reason:t,detail:n,...i?{remedy:i}:{},...r?{install:r}:{},tool:e}}function t_(e,t){return new Promise(n=>{let i=setTimeout(()=>n({timedOut:!0}),Math.max(0,t));e.then(r=>{clearTimeout(i),n({timedOut:!1,value:r})},()=>{clearTimeout(i),n({timedOut:!0})})})}var _Ae=1,SAe=3,nY=750,lY=1,vO=0,rY=[];async function xAe(){vO<_Ae?vO+=1:await new Promise(t=>rY.push(t));let e=!1;return()=>{if(e)return;e=!0;let t=rY.shift();t?t():vO-=1}}function EAe(e){return/waiting for file lock on (?:package cache|build directory|the registry index)/i.test(e)?!/error\[E\d+\]|could not compile|error: could not|linking with|error: linker|failed to run custom build|toolchain '[^']*' is not installed/i.test(e):!1}var iY=/^(?:Updating|Downloading|Downloaded|Compiling|Compiled|Checking|Blocking)\b/i;function oY(e){let t=e.replace(/\u001b\[[0-9;]*m/g,"").split(` -`).map(r=>r.trim()).filter(Boolean),n=r=>/error\[E\d+\]/i.test(r)?100:/requires rustc\b/i.test(r)?95:/failed to select a version|no matching package/i.test(r)?90:/failed to run custom build command|failed custom build/i.test(r)?85:/linking with .* failed|linker .* (?:failed|not found)|cannot find -l/i.test(r)?80:/missing (?:required )?feature|feature .* (?:is not enabled|does not exist|not found)/i.test(r)?75:/could not compile/i.test(r)?70:/^error:/i.test(r)?60:0,i=null;for(let[r,o]of t.entries()){let s=n(o);s>(i?.score??0)&&(i={line:o,score:s,index:r})}if(i){let r=t.slice(i.index+1).find(o=>!iY.test(o)&&n(o)>0&&o!==i.line);return r?`${i.line} -${r}`:i.line}return t.find(r=>!iY.test(r))??t[0]??"unknown Cargo failure"}var TAe=e=>new Promise(t=>setTimeout(t,e)),Io="cargo public-api",IAe="Install Rust and Cargo with rustup, or make sure `cargo` is on PATH.",sY={id:"cargo-public-api",label:"Install cargo-public-api",command:"cargo",args:["install","cargo-public-api","--locked"]},AAe="Drift can install the missing `cargo-public-api` helper for you after approval.",wO={id:"rustup-nightly",label:"Install the Rust nightly toolchain",command:"rustup",args:["toolchain","install","nightly","--profile","minimal"]},uY="Drift can install the Rust nightly toolchain for you after approval, or run `rustup toolchain install nightly` yourself.",dY={ecosystem:"cargo",tool:Io,weight:1,async compute(e){let t=e.workdir,n=(g,h)=>OAe(e.exec,g,h,e.env,t),i=(g,h)=>DAe(e.exec,g,h,e.env,t),r=await n("cargo",["--version"]);if(r===null)return ne(Io,"tool-missing",`The Rust Cargo toolchain is not installed or is not on PATH, so ${e.name}'s public API could not be compared directly.`,IAe);let o=await n("cargo",["public-api","--version"]);if(o===null&&!(await bO(e,sY)&&(o=await n("cargo",["public-api","--version"]))!==null))return ne(Io,"tool-missing",`Rust and Cargo are installed, but Drift's Rust API helper is missing. ${e.name}'s public API could not be compared directly.`,AAe,sY);let s=/^cargo 1\b/.test(r)&&!/nightly/.test(r),a=/nightly/.test(r),c=null,l="nightly";if(a)l="active",c=await n("rustc",["--version"]);else if(s&&await i("rustup",["--version"])&&(c=await n("rustup",["run","nightly","rustc","--version"]),c===null&&!(await bO(e,wO)&&(c=await n("rustup",["run","nightly","rustc","--version"]))!==null)))return ne(Io,"tool-missing",`\`cargo public-api\` needs the Rust nightly toolchain to read rustdoc's JSON output, and it is not installed. ${e.name}'s public API could not be compared directly.`,uY,wO);let u=o===null||c===null?null:[`cpa=${o}`,`${l}=${c}`,`parser=${lY}`].join("|"),d=aY(e,e.from,u),p=aY(e,e.to,u);p.catch(()=>{});let f=await d;if(!f.ok)return f.failure;let m=await p;return m.ok?{available:!0,changes:Dr(f.api,m.api),tool:Io,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (rustdoc JSON)`}:m.failure}};async function aY(e,t,n){let i=(0,Zd.join)(e.workdir,`probe-${t}`),r=n===null?null:`rust-surface:v${lY}:${e.name}@${t}#${n}`;if(r){let d=await Na(r);if(d&&d.length>0)return{ok:!0,api:new Map(d)}}try{await(0,vh.mkdir)((0,Zd.join)(i,"src"),{recursive:!0}),await(0,vh.writeFile)((0,Zd.join)(i,"Cargo.toml"),RAe(e.name,t),"utf8"),await(0,vh.writeFile)((0,Zd.join)(i,"src","lib.rs"),"","utf8")}catch(d){return{ok:!1,failure:ne(Io,"toolchain-failed",`Could not prepare a scratch crate: ${d.message}`)}}let s={...e.env??process.env,CARGO_TARGET_DIR:(0,Zd.join)(i,"target")},a=Date.now()+e.timeoutMs,c=()=>({ok:!1,failure:ne(Io,"toolchain-failed",`\`cargo public-api\` on ${e.name} ${t} ran out of time waiting for the Cargo package-cache lock.`)}),l;for(let d=0;;d+=1){if(a-Date.now()<=0)return c();let p=await xAe(),f=!1;try{let m=a-Date.now();if(m<=0)return p(),f=!0,c();l=await e.exec("cargo",["public-api","--simplified","--package",e.name],{cwd:i,timeoutMs:m,env:s})}finally{f||p()}if(l.code===0)break;if(dl.name),requiredMembers:a.filter(l=>l.required).map(l=>l.name)}})}}}function lPe(e){let t=/^\s*(?:export\s+)?(?:declare\s+)?(?:const|let|var)\s+/.exec(e);if(!t)return[];let n=0,r=0,i=0,o=0,s=[],a="";for(let c=t[0].length;c"&&e[c-1]!=="=")o=Math.max(0,o-1);else if(l==="{")i+=1;else if(l==="}")i-=1;else if(n<=0&&r<=0&&i<=0&&o<=0){if(l===","){s.push(a),a="";continue}if(l===";")break}a+=l}return s.push(a),s.slice(1).filter(c=>c.trim()!=="")}function _9(e,t,n,r){for(let i of e.matchAll(t)){let o=i.index??0,s=Eo(e,o),a=e.slice(o,s),c=n==="type"?uPe(a):n==="variable"?z9(a):[];r.push({exported:!!i[1],entry:{name:i[2],kind:n,signature:Dh(a),members:c.map(l=>l.name),requiredMembers:c.filter(l=>l.required).map(l=>l.name)}})}}function uPe(e){return G9(e,"=")}function z9(e){return G9(e,":")}function G9(e,t){let n=e.indexOf(t);if(n<0)return[];let r=e.slice(n+1),i=r.indexOf("{");if(i<0||r.slice(0,i).trim()!=="")return[];let o=us(r,i);return o<0?[]:r.slice(o+1).replace(/;\s*$/,"").trim()!==""?[]:w$(r.slice(i+1,o),!1)}function tM(e,t,n,r){for(let i of e.matchAll(t)){let o=i.index??0,s=e.indexOf("{",o),a=us(e,s),c=a>=0?a+1:Eo(e,o),l=s>=0&&a>s?e.slice(s+1,a):"",u=n==="enum"?B9(l):w$(l,n==="class"),d=s>=0?dPe(e.slice(o,s)):[];r.push({exported:!!i[1],entry:{name:i[2],kind:n,signature:Dh(e.slice(o,s>=0?s:c)),members:u.map(p=>p.name),requiredMembers:u.filter(p=>p.required).map(p=>p.name),...d.length>0?{extends:d}:{}}})}}function dPe(e){let t=/\b(?:extends|implements)\s+([\s\S]+)$/.exec(e);return t?Oh(t[1]).map(n=>/^\s*([A-Za-z_$][\w$]*)/.exec(n.replace(/\bimplements\b/g,","))?.[1]).filter(n=>!!n):[]}function Eo(e,t){let n=0,r=0,i=0,o=0;for(let s=t;s"&&e[s-1]!=="=")o=Math.max(0,o-1);else if(a==="{"){if(n===0&&r===0&&i===0&&o===0){let c=us(e,s);return c>=0?c+1:e.length}i+=1}else if(a==="}")i-=1;else if(a===";"&&n<=0&&r<=0&&i<=0&&o<=0)return s+1}return e.length}function us(e,t){if(t<0)return-1;let n=0;for(let r=t;r/^[\s\n]*([A-Za-z_$][\w$]*)/.exec(t)?.[1]).filter(t=>!!t).map(t=>({name:t,required:!1}))}function w$(e,t){let n=[],r=/(?:^|[;\n])\s*((?:public|protected|private|readonly|static|abstract|declare|override)\s+)*(#?[A-Za-z_$][\w$]*)(\?)?\s*(\(|:|<)/g;for(let i of e.matchAll(r)){let o=i[1]??"",s=i[2];s==="constructor"||o.includes("private")||s.startsWith("#")||n.push({name:s,required:t?i[4]===":"&&!i[3]:!i[3]})}return n}function fM(e){let t=[];for(let n of e.split(",")){let r=n.replace(/\btype\s+/g,"").trim();if(!r)continue;let[i,o]=r.split(/\s+as\s+/).map(s=>s.trim());i&&t.push({local:i,exported:o||i})}return t}function pPe(e,t){let n=i=>i==="variable"||i==="function";if(n(e)&&n(t))return!0;let r=i=>i==="interface"||i==="type";return r(e)&&r(t)}function V9(e,t,n){if(t.api.size<20)return null;let i=0;for(let a of t.api.keys())n.api.has(a)&&(i+=1);if(i>t.api.size*.1||n.api.size>t.api.size*.1)return null;let o=n.subpaths.filter(a=>a!=="."),s=o.length>0?` The new version publishes ${o.length} other entry point${o.length===1?"":"s"}: ${o.join(", ")}. Import from the one that carries the API you use, rather than replacing the symbols individually.`:" Nothing in the new version publishes the old symbols under the old import path.";return{kind:"entry-point-moved",symbol:e,detail:`Importing \`${e}\` no longer gives you its API: the root entry point went from ${t.api.size} exported symbols to ${n.api.size}.${s}`,before:`${t.entryPath} \u2014 ${t.api.size} exports`,after:`${n.entryPath} \u2014 ${n.api.size} exports`}}function fPe(e,t,n){if(e.shapeUnknown||t.length===0)return null;let r=a=>/^[A-Za-z_$][\w$]*$/.test(y$(a.name))&&!/[#/]/.test(a.name),i=y$(e.name);if(i.length<3||!/^[A-Za-z_$][\w$]*$/.test(i))return null;let o=t.filter(a=>r(a)&&a.kind===e.kind&&$9(e)&&$9(a)&&S9(e.signature,e.name)===S9(a.signature,a.name)&&mPe(e,a));if(o.length===1)return o[0];let s=(n??"").replace(/^@[^/]+\//,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase();if(s){let a=t.filter(c=>{if(!r(c))return!1;let l=y$(c.name).toLowerCase();return l===`${s}${i.toLowerCase()}`||l===`${i.toLowerCase()}${s}`});if(a.length===1)return a[0]}return null}function $9(e){let t=e.signature??"";return t.includes("(")&&t.replace(/\s+/g,"").length>=20?!0:e.members.length>=2}function mPe(e,t){if(e.members.length===0&&t.members.length===0)return!0;let n=[...e.members].sort().join(","),r=[...t.members].sort().join(",");return n===r}function y$(e){return e.split(".").pop()??e}function S9(e,t){let n=y$(t);return e.replace(new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"g"),"\0").replace(/\s+/g," ").trim()}function Cr(e,t,n={}){let r=[],i=[...t.entries()].filter(([o])=>!e.has(o)).map(([,o])=>o);for(let[o,s]of e){let a=t.get(o),c=s.name,l=s.via?` (declared in ${s.via})`:"";if(!a){if(n.afterComplete===!1&&s.via)continue;let g=fPe(s,i,n.packageName);r.push({kind:"export-removed",symbol:c,detail:s.shapeUnknown?`\`${c}\` is no longer exported${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`:`\`${c}\` is no longer exported (was ${xo(s.kind)})${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`,before:s.signature,...g?{after:g.signature,replacement:g.name}:{},...s.shapeUnknown?{}:{fromKind:s.kind}});continue}if(s.shapeUnknown||a.shapeUnknown)continue;if(s.kind!==a.kind&&!pPe(s.kind,a.kind)){r.push({kind:"kind-changed",symbol:c,detail:`\`${c}\` changed from ${xo(s.kind)} to ${xo(a.kind)}${l}.`,before:s.signature,after:a.signature,fromKind:s.kind,toKind:a.kind});continue}for(let g of s.members)if(!a.members.includes(g))r.push({kind:"member-removed",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` was removed${l}.`});else{let h=s.memberSignatures?.[g],v=a.memberSignatures?.[g];h&&v&&h!==v&&r.push({kind:"signature-changed",symbol:`${c}.${g}`,detail:`The signature of \`${c}.${g}\` changed${l}.`,before:h,after:v})}let u=new Set(s.requiredMembers);for(let g of a.requiredMembers)!u.has(g)&&s.members.includes(g)&&r.push({kind:"member-now-required",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` is now required; it was previously optional${l}.`});let[d,p]=H9(s.signature,a.signature),f=!!(s.callable&&a.callable);(f?!yPe(s.callable,a.callable):d!==p&&s.kind!=="interface"&&s.kind!=="class"&&!EPe(d,p)&&!hPe(d,p))&&r.push({kind:"signature-changed",symbol:c,detail:`The signature of \`${c}\` changed${l}.`,before:s.signature,after:a.signature,...f?{changed:"parameters"}:gPe(d,p)??{}})}return r}function gPe(e,t){let n=qc(e),r=qc(t);if(!n||!r)return null;let i=!Wc(n.returns,r.returns),o=n.parameters.length!==r.parameters.length||n.parameters.some((s,a)=>{let c=r.parameters[a];return!c||s.optional!==c.optional||s.rest!==c.rest||!Wc(s.type,c.type)});return i&&o?{changed:"both"}:i?{changed:"return-type"}:o?{changed:"parameters"}:null}function hPe(e,t){if(e.includes(" | declare ")||t.includes(" | declare ")||e.includes(" | export ")||t.includes(" | export "))return!1;let n=qc(e),r=qc(t);if(!n||!r||!Wc(n.returns,r.returns)||r.parameters.lengthi.optional||i.rest)}function yPe(e,t){let n=p=>p.parameters.filter(f=>f.kind==="positional-only"||f.kind==="positional-or-keyword"),r=(p,f)=>p.parameters.some(m=>m.kind===f),i=p=>p.parameters.filter(f=>f.kind==="positional-or-keyword"||f.kind==="keyword-only"),o=(p,f)=>p.parameters.find(m=>m.name===f),s=n(e),a=n(t),c=s.filter(p=>p.required).length,l=a.filter(p=>p.required).length,u=r(e,"var-positional")?1/0:s.length,d=r(t,"var-positional")?1/0:a.length;if(l>c||dc!==null),s=aM(i).map(qc).filter(c=>c!==null);if(o.length===0||s.length===0)return!1;let a=o.filter(c=>sM(c,n));return a.length===0?!1:a.every(c=>s.some(l=>{if(!sM(l,n)||!Wc(c.returns,l.returns))return!1;for(let u=0;ur!==null);return n.length===0?!1:!n.some(r=>sM(r,t))}function sM(e,t){let n=e.parameters.filter(r=>!r.optional&&!r.rest).length;return tr.rest)||t<=e.parameters.length}function aM(e){return e.split(/ \| (?=(?:export\s+)?declare\b)/).map(t=>t.trim()).filter(Boolean)}function qc(e){let t=bPe(e);if(t<0)return null;let n=vPe(e,t);if(n<0)return null;let r=e.slice(t+1,n),i=e.slice(n+1).trim(),o=/^(?:=>|:)\s*([\s\S]*?)\s*;?$/.exec(i)?.[1];if(o===void 0)return null;let s=[];for(let a of Oh(r)){let c=a.trim();if(!c)continue;let l=/^(\.\.\.)?\s*(?:readonly\s+)?([A-Za-z_$][\w$]*|\{[\s\S]*?\}|\[[\s\S]*?\])\s*(\?)?\s*:\s*([\s\S]+)$/.exec(c);if(!l)return null;s.push({rest:!!l[1],optional:!!l[3]||!!l[1],type:l[4]})}return{parameters:s,returns:o}}function bPe(e){let t=0;for(let n=0;n"&&e[n-1]!=="=")t-=1;else if(r==="("&&t<=0)return n}return-1}function vPe(e,t){let n=0;for(let r=t;r=wPe)return!1;let r=e.trim(),i=t.trim(),o=[T9(r),T9(i)];return o[0]&&o[1]?Wc(o[0].check,o[1].check)&&Pd(o[0].whenTrue,o[1].whenTrue,n+1)&&Pd(o[0].whenFalse,o[1].whenFalse,n+1):m$(r,"{","}")&&m$(i,"{","}")?kPe(r,i,n):m$(r,"[","]")&&m$(i,"[","]")?_Pe(r,i,n):!1}var wPe=6;function kPe(e,t,n){let r=x9(e),i=x9(t);if(!r||!i)return!1;for(let[o,s]of r){let a=i.get(o);if(!a||s.optional&&!a.optional||!Pd(s.type,a.type,n+1))return!1}for(let[o,s]of i)if(!r.has(o)&&!s.optional)return!1;return!0}function _Pe(e,t,n){let r=E9(e),i=E9(t);if(!r||!i||i.lengtho.optional||o.rest)}function x9(e){let t=new Map;for(let n of SPe(e.trim().slice(1,-1))){let r=n.trim();if(!r)continue;let i=/^(?:readonly\s+)?(?:'([^']+)'|"([^"]+)"|([A-Za-z_$][\w$]*))\s*(\?)?\s*:\s*([\s\S]+)$/.exec(r);if(!i)return null;let o=i[1]??i[2]??i[3];t.set(o,{optional:!!i[4],type:i[5].trim()})}return t}function E9(e){let t=[];for(let n of Oh(e.trim().slice(1,-1))){let r=n.trim();if(!r)continue;let i=/^(\.\.\.)?\s*([A-Za-z_$][\w$]*)\s*(\?)?\s*:\s*([\s\S]+)$/.exec(r);if(i){t.push({rest:!!i[1],optional:!!i[3]||!!i[1],type:i[4].trim()});continue}let o=/^(\.\.\.)?\s*([\s\S]+?)(\?)?$/.exec(r);if(!o)return null;t.push({rest:!!o[1],optional:!!o[3]||!!o[1],type:o[2].trim()})}return t}function T9(e){let t=0;for(let n=0;n)]}".includes(r))r===">"&&e[n-1]==="="||(t-=1);else if(r==="?"&&t===0){let i=e.slice(0,n);if(!/\bextends\b/.test(i))return null;let o=$Pe(e,n+1);return o===-1?null:{check:i.trim(),whenTrue:e.slice(n+1,o).trim(),whenFalse:e.slice(o+1).trim()}}}return null}function $Pe(e,t){let n=0,r=0;for(let i=t;i)]}".includes(o))o===">"&&e[i-1]==="="||(n-=1);else if(n===0&&o==="?")r+=1;else if(n===0&&o===":"){if(r===0)return i;r-=1}}return-1}function SPe(e){return Oh(e,";,")}function m$(e,t,n){if(!e.startsWith(t)||!e.endsWith(n))return!1;let r=0;for(let i=0;in.some(o=>Wc(i,o)))}function I9(e){let t=[],n=0,r="";for(let i of e){if("<([{".includes(i)?n+=1:">)]}".includes(i)&&(n-=1),i==="|"&&n===0){t.push(r),r="";continue}r+=i}return r.trim()&&t.push(r),t.map(i=>i.trim()).filter(Boolean)}function Wc(e,t){let n=r=>r.replace(/\s+/g,"").replace(/\|undefined$/,"");return n(e)===n(t)}function EPe(e,t){if(e===t)return!0;let n=P9(e);return n===P9(t)&&n!==null}function H9(e,t){let n=A9(e),r=A9(t);if(n.size===0&&r.size===0)return[e,t];for(let[i,o]of n){let s=r.get(i);if(s!==void 0&&s!==o)return[e,t]}return[R9(e),R9(t)]}function A9(e){let t=new Map,n=/\bimport\((["'])((?:(?!\1).)*)\1\)\.([A-Za-z_$][\w$]*)/g;for(let r of e.matchAll(n))t.set(r[3],r[2]);return t}function R9(e){return e.replace(/\bimport\((["'])(?:(?!\1).)*\1\)\./g,"")}function P9(e){let t=TPe(e);if(t.length===0)return null;let n=e;return t.forEach((r,i)=>{n=n.replace(new RegExp(`\\b${k$(r)}\\b`,"g"),`\0T${i}`)}),n}function TPe(e){let t=[];for(let n=0;n"&&(n-=1,n===0))return r;return-1}function Oh(e,t=","){let n=[],r=0,i="";for(let o=0;o)]}".includes(s)&&(s===">"&&e[o-1]==="="||(r-=1)),t.includes(s)&&r===0){n.push(i),i="";continue}i+=s}return i.trim()&&n.push(i),n}var A$=require("node:fs/promises"),FQ=require("node:os"),jQ=require("node:path");var Mh=require("node:fs/promises"),Cd=require("node:path");var mM=new Map;async function gM(e,t){if(!e.autoInstall)return!1;let n=mM.get(t.id);if(n)return n;let r=APe(e,t).finally(()=>{mM.delete(t.id)});return mM.set(t.id,r),r}async function APe(e,t){e.logger.info(`Installing ${t.label.replace(/^Install\s+/i,"")}...`);let n=await e.exec(t.command,t.args,{...e.env?{env:e.env}:{},timeoutMs:10*6e4});return n.code!==0?(e.logger.warn(`${t.label} failed: ${(n.stderr||n.stdout||"no output").trim()}`),!1):(e.logger.info(`${t.label.replace(/^Install\s+/i,"")} installed.`),!0)}function oe(e,t,n,r,i){return{available:!1,reason:t,detail:n,...r?{remedy:r}:{},...i?{install:i}:{},tool:e}}function _$(e,t){return new Promise(n=>{let r=setTimeout(()=>n({timedOut:!0}),Math.max(0,t));e.then(i=>{clearTimeout(r),n({timedOut:!1,value:i})},()=>{clearTimeout(r),n({timedOut:!0})})})}var RPe=1,PPe=3,K9=750,t5=1,hM=0,J9=[];async function CPe(){hMJ9.push(t));let e=!1;return()=>{if(e)return;e=!0;let t=J9.shift();t?t():hM-=1}}function NPe(e){return/waiting for file lock on (?:package cache|build directory|the registry index)/i.test(e)?!/error\[E\d+\]|could not compile|error: could not|linking with|error: linker|failed to run custom build|toolchain '[^']*' is not installed/i.test(e):!1}var Z9=/^(?:Updating|Downloading|Downloaded|Compiling|Compiled|Checking|Blocking)\b/i;function Y9(e){let t=e.replace(/\u001b\[[0-9;]*m/g,"").split(` +`).map(i=>i.trim()).filter(Boolean),n=i=>/error\[E\d+\]/i.test(i)?100:/requires rustc\b/i.test(i)?95:/failed to select a version|no matching package/i.test(i)?90:/failed to run custom build command|failed custom build/i.test(i)?85:/linking with .* failed|linker .* (?:failed|not found)|cannot find -l/i.test(i)?80:/missing (?:required )?feature|feature .* (?:is not enabled|does not exist|not found)/i.test(i)?75:/could not compile/i.test(i)?70:/^error:/i.test(i)?60:0,r=null;for(let[i,o]of t.entries()){let s=n(o);s>(r?.score??0)&&(r={line:o,score:s,index:i})}if(r){let i=t.slice(r.index+1).find(o=>!Z9.test(o)&&n(o)>0&&o!==r.line);return i?`${r.line} +${i}`:r.line}return t.find(i=>!Z9.test(i))??t[0]??"unknown Cargo failure"}var DPe=e=>new Promise(t=>setTimeout(t,e)),To="cargo public-api",OPe="Install Rust and Cargo with rustup, or make sure `cargo` is on PATH.",Q9={id:"cargo-public-api",label:"Install cargo-public-api",command:"cargo",args:["install","cargo-public-api","--locked"]},MPe="Drift can install the missing `cargo-public-api` helper for you after approval.",yM={id:"rustup-nightly",label:"Install the Rust nightly toolchain",command:"rustup",args:["toolchain","install","nightly","--profile","minimal"]},n5="Drift can install the Rust nightly toolchain for you after approval, or run `rustup toolchain install nightly` yourself.",r5={ecosystem:"cargo",tool:To,weight:1,async compute(e){let t=e.workdir,n=(g,h)=>GPe(e.exec,g,h,e.env,t),r=(g,h)=>zPe(e.exec,g,h,e.env,t),i=await n("cargo",["--version"]);if(i===null)return oe(To,"tool-missing",`The Rust Cargo toolchain is not installed or is not on PATH, so ${e.name}'s public API could not be compared directly.`,OPe);let o=await n("cargo",["public-api","--version"]);if(o===null&&!(await gM(e,Q9)&&(o=await n("cargo",["public-api","--version"]))!==null))return oe(To,"tool-missing",`Rust and Cargo are installed, but Drift's Rust API helper is missing. ${e.name}'s public API could not be compared directly.`,MPe,Q9);let s=/^cargo 1\b/.test(i)&&!/nightly/.test(i),a=/nightly/.test(i),c=null,l="nightly";if(a)l="active",c=await n("rustc",["--version"]);else if(s&&await r("rustup",["--version"])&&(c=await n("rustup",["run","nightly","rustc","--version"]),c===null&&!(await gM(e,yM)&&(c=await n("rustup",["run","nightly","rustc","--version"]))!==null)))return oe(To,"tool-missing",`\`cargo public-api\` needs the Rust nightly toolchain to read rustdoc's JSON output, and it is not installed. ${e.name}'s public API could not be compared directly.`,n5,yM);let u=o===null||c===null?null:[`cpa=${o}`,`${l}=${c}`,`parser=${t5}`].join("|"),d=X9(e,e.from,u),p=X9(e,e.to,u);p.catch(()=>{});let f=await d;if(!f.ok)return f.failure;let m=await p;return m.ok?{available:!0,changes:Cr(f.api,m.api),tool:To,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (rustdoc JSON)`}:m.failure}};async function X9(e,t,n){let r=(0,Cd.join)(e.workdir,`probe-${t}`),i=n===null?null:`rust-surface:v${t5}:${e.name}@${t}#${n}`;if(i){let d=await Ia(i);if(d&&d.length>0)return{ok:!0,api:new Map(d)}}try{await(0,Mh.mkdir)((0,Cd.join)(r,"src"),{recursive:!0}),await(0,Mh.writeFile)((0,Cd.join)(r,"Cargo.toml"),LPe(e.name,t),"utf8"),await(0,Mh.writeFile)((0,Cd.join)(r,"src","lib.rs"),"","utf8")}catch(d){return{ok:!1,failure:oe(To,"toolchain-failed",`Could not prepare a scratch crate: ${d.message}`)}}let s={...e.env??process.env,CARGO_TARGET_DIR:(0,Cd.join)(r,"target")},a=Date.now()+e.timeoutMs,c=()=>({ok:!1,failure:oe(To,"toolchain-failed",`\`cargo public-api\` on ${e.name} ${t} ran out of time waiting for the Cargo package-cache lock.`)}),l;for(let d=0;;d+=1){if(a-Date.now()<=0)return c();let p=await CPe(),f=!1;try{let m=a-Date.now();if(m<=0)return p(),f=!0,c();l=await e.exec("cargo",["public-api","--simplified","--package",e.name],{cwd:r,timeoutMs:m,env:s})}finally{f||p()}if(l.code===0)break;if(d({pkg:ol(r.Pkg),error:ol(r.Error)})):[],platforms:Yd(n.Platforms)}}function ol(e){return typeof e=="string"?e:""}function Yd(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}var mY=8,gY=200,hY={"package-removed":0,"export-removed":1,"kind-changed":2,"member-removed":3,"member-now-required":4,"signature-changed":5,"constant-value-changed":6};function vY(e,t){let n=[],i=[],r=new Set(e.packages),o=new Set(t.packages),s=e.packages.filter(u=>!o.has(u));for(let u of s)n.push({kind:"package-removed",symbol:u,detail:`The package \`${u}\` no longer exists. Every import of it must move to its replacement \u2014 do not re-implement the symbols it exported.`});for(let u of t.packages)r.has(u)||i.push({kind:"package-added",symbol:u});let a=new Set(s),c=[];for(let[u,d]of e.symbols){if(a.has(d.pkg))continue;let p=t.symbols.get(u),f=yY(d);if(!p){if(MAe(d,e,t))continue;n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer exported (was ${Eo(kO(d.kind))}).`,before:d.signatures[0]});continue}if(d.kind!==p.kind){n.push({kind:"kind-changed",symbol:f,detail:`\`${f}\` changed from ${Eo(kO(d.kind))} to ${Eo(kO(p.kind))}.`,before:d.signatures[0],after:p.signatures[0]});continue}let m=d.platforms.filter(b=>!p.platforms.includes(b));m.length>0&&p.platforms.length>0&&n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer available on ${m.join(", ")}; it remains on ${p.platforms.join(", ")}.`,before:d.signatures[0]});for(let b of d.members)p.members.includes(b)||n.push({kind:"member-removed",symbol:`${f}.${b}`,detail:d.kind==="interface"?`The method \`${b}\` was removed from the interface \`${f}\`.`:`\`${f}.${b}\` was removed.`});if(d.kind==="interface")for(let b of p.requiredMembers)d.requiredMembers.includes(b)||n.push({kind:"member-now-required",symbol:`${f}.${b}`,detail:`The interface \`${f}\` now requires a \`${b}\` method. Any type in this repository that implements \`${f}\` must gain one.`,after:t.symbols.get(`${p.pkg}.${p.name}.${b}`)?.signatures[0]});let g=d.signatures.join(" | "),h=p.signatures.join(" | ");if(g!==h){if(LAe(d.signatures,p.signatures)){c.push(`${f}: ${g} \u2192 ${h}`);continue}n.push({kind:"signature-changed",symbol:f,detail:`The signature of \`${f}\` changed.`,before:g,after:h})}}for(let[u,d]of t.symbols)e.symbols.has(u)||!r.has(d.pkg)||i.push({kind:"export-added",symbol:yY(d)});if(c.length>0&&c.length<=mY)for(let u of c){let[d,p]=wh(u,": ");n.push({kind:"constant-value-changed",symbol:d,detail:`The constant \`${d}\` changed value.`,before:wh(p," \u2192 ")[0],after:wh(p," \u2192 ")[1]})}else c.length>mY&&n.push({kind:"constant-value-changed",symbol:`${e.module} constants`,detail:`${c.length} exported constants changed value. This is usually a regenerated platform header rather than a deliberate API change, but code that compares against a literal copy of one of these values will now disagree.`,after:c.slice(0,10).join("; ")});n.sort((u,d)=>(hY[u.kind]??9)-(hY[d.kind]??9));let l=Math.max(0,n.length-gY);return{changes:n.slice(0,gY),additions:i,omitted:l}}function MAe(e,t,n){let i=e.name.lastIndexOf(".");if(i<=0)return!1;let r=`${e.pkg}.${e.name.slice(0,i)}`;return t.symbols.has(r)&&n.symbols.has(r)}function yY(e){return e.pkgName?`${e.pkgName}.${e.name}`:e.name}function kO(e){switch(e){case"class":return"struct";case"function":return"function";case"interface":return"interface";case"variable":return"constant or variable";default:return"type"}}function LAe(e,t){if(e.length!==1||t.length!==1)return!1;let[n,i]=[e[0],t[0]];return!n.startsWith("const ")||!i.startsWith("const ")?!1:wh(n," = ")[0]===wh(i," = ")[0]}function wh(e,t){let n=e.indexOf(t);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length)]}var FAe="1.24",UAe=["linux/amd64","darwin/arm64","windows/amd64"];function wY(){let e=[...UAe],t=`${jAe()}/${zAe()}`;return e.includes(t)?e:[...e,t]}function jAe(){switch(process.platform){case"win32":return"windows";case"darwin":return"darwin";default:return"linux"}}function zAe(){switch(process.arch){case"x64":return"amd64";case"arm64":return"arm64";case"arm":return"arm";default:return"amd64"}}async function kY(e,t){let n=await e("go",["version"],{timeoutMs:2e4,...t?{env:t}:{}});if(n.failure==="not-found"||n.code!==0)return{available:!1};let i=/go(\d+\.\d+(?:\.\d+)?)/.exec(n.stdout)?.[1],r=await e("go",["env","GOMODCACHE"],{timeoutMs:2e4,...t?{env:t}:{}}),o=r.code===0?r.stdout.trim():"";return{available:!0,...i?{version:i}:{},...o?{moduleCache:o}:{}}}async function $Y(e,t=GAe){if(e)for(let n of t){let i=await e(n).catch(()=>null);if(!i)continue;let r=n.endsWith(".yml")||n.endsWith(".yaml")?BAe(i):VAe(i);if(r)return{version:r,source:n}}return{version:FAe,source:"Drift default"}}var GAe=["go.work","go.mod",".github/workflows/go.yml",".github/workflows/ci.yml",".github/workflows/test.yml",".github/workflows/build.yml"];function VAe(e){let t=/^\s*toolchain\s+go(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1];return t||(/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1]??null)}function BAe(e){let t=/go-version(?:-file)?\s*:\s*['"]?(\d+\.\d+(?:\.\d+|\.x)?)/.exec(e)?.[1];return t?t.replace(/\.x$/,""):null}function _Y(e,t){let n=e.version;return t?`Add \`actions/setup-go\` with \`go-version: '${n}'\` to the Drift workflow, before the Drift step, to install Go ${n} and enable exported-API comparison.`:`Install Go ${n} and make \`go\` available on PATH, or configure \`go-version\` in the Drift workflow, to enable exported-API comparison.`}function SY(){return process.env.GITHUB_ACTIONS==="true"}var us="go (go/build + go/parser)",IY={ecosystem:"go",tool:us,weight:1,async compute(e){let t=await $Y(e.readRepoFile);if(!(await kY(e.exec,e.env)).available)return ne(us,"tool-missing",`The Go toolchain is not installed, so ${e.name}'s exported API could not be compared.`,_Y(t,SY()));let i=await HAe(e.exec,e.logger,e.env);if(!i)return ne(us,"toolchain-failed",`Drift could not prepare a scratch Go module to run its API extractor in, so ${e.name} could not be compared.`);let r=wY(),o=await xY(e,i,e.from,r,t);if("failure"in o)return o.failure;let s=await xY(e,i,e.to,r,t);if("failure"in s)return s.failure;let{changes:a,additions:c,omitted:l}=vY(o.api,s.api),u=new Set([...o.api.failures,...s.api.failures].map(d=>d.pkg));return u.size>0&&e.logger.debug(`${e.name}: ${u.size} package(s) could not be parsed and were skipped`),{available:!0,changes:a,tool:us,weight:1,locator:qAe(e,o.api,s.api,r,u.size,l),additions:c}}};function qAe(e,t,n,i,r,o){let s=[`${e.name} ${e.from} \u2192 ${e.to}`,`${n.packages.length} package(s), ${n.symbols.size} exported symbol(s)`,`platforms: ${i.join(", ")}`];return t.packages.length!==n.packages.length&&s.push(`${t.packages.length} package(s) before`),r>0&&s.push(`${r} package(s) unparseable and skipped`),o>0&&s.push(`${o} further finding(s) not listed`),s.join(" \xB7 ")}var AY=new Map,Qd=new Map;async function xY(e,t,n,i,r){let o=n.startsWith("v")?n:`v${n}`,s=`${e.name}@${o}|${i.join(",")}`;for(;;){let a=AY.get(s);if(a)return{api:a};let c=Qd.get(s);if(c){let d=await t_(c,e.timeoutMs);if(d.timedOut)return{failure:ne(us,"toolchain-failed",`Ran out of time comparing ${e.name} ${o}'s exported API.`)};if("failure"in d.value&&!d.value.failure.available&&d.value.failure.reason==="toolchain-failed"){Qd.get(s)===c&&Qd.delete(s);continue}return d.value}let l=WAe(e,t,n,i,r,s);Qd.set(s,l);let u=()=>{Qd.get(s)===l&&Qd.delete(s)};return l.then(u,u),l}}async function WAe(e,t,n,i,r,o){let s=n.startsWith("v")?n:`v${n}`,a=await e.exec("go",["mod","download","-json",`${e.name}@${s}`],{cwd:t,timeoutMs:e.timeoutMs,env:$O(e.env)}),c=RY(a.stdout);if(!c){let d=`${a.stderr} -${a.stdout}`,p=/unknown revision|invalid version|no matching versions|404 Not Found|does not contain package/i.test(d);return{failure:ne(us,p?"version-unavailable":"toolchain-failed",p?`The Go module proxy has no ${e.name} ${s}, so there was nothing to compare against. It may be retracted, or the module may be private.`:`\`go mod download ${e.name}@${s}\` failed: ${_O(d)}`)}}let l=await e.exec("go",["run","apidump.go","-dir",c,"-module",e.name,"-platforms",i.join(",")],{cwd:t,timeoutMs:e.timeoutMs,env:$O(e.env)});if(l.code!==0)return{failure:ne(us,"toolchain-failed",`Drift's API extractor could not run under the installed Go toolchain (${r.source} asks for Go ${r.version}): ${_O(l.stderr)}`)};let u=bY(l.stdout);return u?u.symbols.size===0?{failure:ne(us,"no-public-surface",`${e.name} ${s} exports nothing from any importable package on ${i.join(", ")}, so there is no API to compare.`)}:(AY.set(o,u),{api:u}):{failure:ne(us,"parse-failed",`Drift could not read its own API extractor's output for ${e.name} ${s}.`)}}function RY(e){let t=e.indexOf("{");if(t<0)return null;try{let n=JSON.parse(e.slice(t,e.lastIndexOf("}")+1));return n.Dir&&!n.Error?n.Dir:null}catch{return/"Dir":\s*"((?:[^"\\]|\\.)*)"/.exec(e)?.[1]?.replace(/\\(.)/g,"$1")??null}}var EY=new Map;function HAe(e,t,n){let i=n?.PATH??process.env.PATH??"",r=EY.get(i);return r??=(async()=>{try{let o=await(0,sl.mkdtemp)((0,kh.join)((0,TY.tmpdir)(),"drift-go-apidump-"));await(0,sl.mkdir)(o,{recursive:!0}),await(0,sl.writeFile)((0,kh.join)(o,"go.mod"),`module driftapidump +`;function u5(e){let t;try{t=JSON.parse(e.trim())}catch{return null}if(!t||typeof t!="object")return null;let n=t;if(!Array.isArray(n.Symbols)||!Array.isArray(n.Packages))return null;let r=new Map;for(let i of n.Symbols){let o=typeof i.Key=="string"?i.Key:null;o&&r.set(o,{key:o,name:Hc(i.Name),pkg:Hc(i.Pkg),pkgName:Hc(i.PkgName),kind:Hc(i.Kind)||"variable",signatures:Nd(i.Signatures),members:Nd(i.Members),requiredMembers:Nd(i.RequiredMembers),platforms:Nd(i.Platforms)})}return{module:Hc(n.Module),packages:Nd(n.Packages),symbols:r,failures:Array.isArray(n.Failures)?n.Failures.map(i=>({pkg:Hc(i.Pkg),error:Hc(i.Error)})):[],platforms:Nd(n.Platforms)}}function Hc(e){return typeof e=="string"?e:""}function Nd(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}var s5=8,a5=200,c5={"package-removed":0,"export-removed":1,"kind-changed":2,"member-removed":3,"member-now-required":4,"signature-changed":5,"constant-value-changed":6};function d5(e,t){let n=[],r=[],i=new Set(e.packages),o=new Set(t.packages),s=e.packages.filter(u=>!o.has(u));for(let u of s)n.push({kind:"package-removed",symbol:u,detail:`The package \`${u}\` no longer exists. Every import of it must move to its replacement \u2014 do not re-implement the symbols it exported.`});for(let u of t.packages)i.has(u)||r.push({kind:"package-added",symbol:u});let a=new Set(s),c=[];for(let[u,d]of e.symbols){if(a.has(d.pkg))continue;let p=t.symbols.get(u),f=l5(d);if(!p){if(BPe(d,e,t))continue;n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer exported (was ${xo(bM(d.kind))}).`,before:d.signatures[0]});continue}if(d.kind!==p.kind){n.push({kind:"kind-changed",symbol:f,detail:`\`${f}\` changed from ${xo(bM(d.kind))} to ${xo(bM(p.kind))}.`,before:d.signatures[0],after:p.signatures[0]});continue}let m=d.platforms.filter(v=>!p.platforms.includes(v));m.length>0&&p.platforms.length>0&&n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer available on ${m.join(", ")}; it remains on ${p.platforms.join(", ")}.`,before:d.signatures[0]});for(let v of d.members)p.members.includes(v)||n.push({kind:"member-removed",symbol:`${f}.${v}`,detail:d.kind==="interface"?`The method \`${v}\` was removed from the interface \`${f}\`.`:`\`${f}.${v}\` was removed.`});if(d.kind==="interface")for(let v of p.requiredMembers)d.requiredMembers.includes(v)||n.push({kind:"member-now-required",symbol:`${f}.${v}`,detail:`The interface \`${f}\` now requires a \`${v}\` method. Any type in this repository that implements \`${f}\` must gain one.`,after:t.symbols.get(`${p.pkg}.${p.name}.${v}`)?.signatures[0]});let g=d.signatures.join(" | "),h=p.signatures.join(" | ");if(g!==h){if(VPe(d.signatures,p.signatures)){c.push(`${f}: ${g} \u2192 ${h}`);continue}n.push({kind:"signature-changed",symbol:f,detail:`The signature of \`${f}\` changed.`,before:g,after:h})}}for(let[u,d]of t.symbols)e.symbols.has(u)||!i.has(d.pkg)||r.push({kind:"export-added",symbol:l5(d)});if(c.length>0&&c.length<=s5)for(let u of c){let[d,p]=Lh(u,": ");n.push({kind:"constant-value-changed",symbol:d,detail:`The constant \`${d}\` changed value.`,before:Lh(p," \u2192 ")[0],after:Lh(p," \u2192 ")[1]})}else c.length>s5&&n.push({kind:"constant-value-changed",symbol:`${e.module} constants`,detail:`${c.length} exported constants changed value. This is usually a regenerated platform header rather than a deliberate API change, but code that compares against a literal copy of one of these values will now disagree.`,after:c.slice(0,10).join("; ")});n.sort((u,d)=>(c5[u.kind]??9)-(c5[d.kind]??9));let l=Math.max(0,n.length-a5);return{changes:n.slice(0,a5),additions:r,omitted:l}}function BPe(e,t,n){let r=e.name.lastIndexOf(".");if(r<=0)return!1;let i=`${e.pkg}.${e.name.slice(0,r)}`;return t.symbols.has(i)&&n.symbols.has(i)}function l5(e){return e.pkgName?`${e.pkgName}.${e.name}`:e.name}function bM(e){switch(e){case"class":return"struct";case"function":return"function";case"interface":return"interface";case"variable":return"constant or variable";default:return"type"}}function VPe(e,t){if(e.length!==1||t.length!==1)return!1;let[n,r]=[e[0],t[0]];return!n.startsWith("const ")||!r.startsWith("const ")?!1:Lh(n," = ")[0]===Lh(r," = ")[0]}function Lh(e,t){let n=e.indexOf(t);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length)]}var qPe="1.24",WPe=["linux/amd64","darwin/arm64","windows/amd64"];function p5(){let e=[...WPe],t=`${HPe()}/${KPe()}`;return e.includes(t)?e:[...e,t]}function HPe(){switch(process.platform){case"win32":return"windows";case"darwin":return"darwin";default:return"linux"}}function KPe(){switch(process.arch){case"x64":return"amd64";case"arm64":return"arm64";case"arm":return"arm";default:return"amd64"}}async function f5(e,t){let n=await e("go",["version"],{timeoutMs:2e4,...t?{env:t}:{}});if(n.failure==="not-found"||n.code!==0)return{available:!1};let r=/go(\d+\.\d+(?:\.\d+)?)/.exec(n.stdout)?.[1],i=await e("go",["env","GOMODCACHE"],{timeoutMs:2e4,...t?{env:t}:{}}),o=i.code===0?i.stdout.trim():"";return{available:!0,...r?{version:r}:{},...o?{moduleCache:o}:{}}}async function m5(e,t=JPe){if(e)for(let n of t){let r=await e(n).catch(()=>null);if(!r)continue;let i=n.endsWith(".yml")||n.endsWith(".yaml")?YPe(r):ZPe(r);if(i)return{version:i,source:n}}return{version:qPe,source:"Drift default"}}var JPe=["go.work","go.mod",".github/workflows/go.yml",".github/workflows/ci.yml",".github/workflows/test.yml",".github/workflows/build.yml"];function ZPe(e){let t=/^\s*toolchain\s+go(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1];return t||(/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1]??null)}function YPe(e){let t=/go-version(?:-file)?\s*:\s*['"]?(\d+\.\d+(?:\.\d+|\.x)?)/.exec(e)?.[1];return t?t.replace(/\.x$/,""):null}function g5(e,t){let n=e.version;return t?`Add \`actions/setup-go\` with \`go-version: '${n}'\` to the Drift workflow, before the Drift step, to install Go ${n} and enable exported-API comparison.`:`Install Go ${n} and make \`go\` available on PATH, or configure \`go-version\` in the Drift workflow, to enable exported-API comparison.`}function h5(){return process.env.GITHUB_ACTIONS==="true"}var ds="go (go/build + go/parser)",w5={ecosystem:"go",tool:ds,weight:1,async compute(e){let t=await m5(e.readRepoFile);if(!(await f5(e.exec,e.env)).available)return oe(ds,"tool-missing",`The Go toolchain is not installed, so ${e.name}'s exported API could not be compared.`,g5(t,h5()));let r=await eCe(e.exec,e.logger,e.env);if(!r)return oe(ds,"toolchain-failed",`Drift could not prepare a scratch Go module to run its API extractor in, so ${e.name} could not be compared.`);let i=p5(),o=await y5(e,r,e.from,i,t);if("failure"in o)return o.failure;let s=await y5(e,r,e.to,i,t);if("failure"in s)return s.failure;let{changes:a,additions:c,omitted:l}=d5(o.api,s.api),u=new Set([...o.api.failures,...s.api.failures].map(d=>d.pkg));return u.size>0&&e.logger.debug(`${e.name}: ${u.size} package(s) could not be parsed and were skipped`),{available:!0,changes:a,tool:ds,weight:1,locator:QPe(e,o.api,s.api,i,u.size,l),additions:c}}};function QPe(e,t,n,r,i,o){let s=[`${e.name} ${e.from} \u2192 ${e.to}`,`${n.packages.length} package(s), ${n.symbols.size} exported symbol(s)`,`platforms: ${r.join(", ")}`];return t.packages.length!==n.packages.length&&s.push(`${t.packages.length} package(s) before`),i>0&&s.push(`${i} package(s) unparseable and skipped`),o>0&&s.push(`${o} further finding(s) not listed`),s.join(" \xB7 ")}var k5=new Map,Dd=new Map;async function y5(e,t,n,r,i){let o=n.startsWith("v")?n:`v${n}`,s=`${e.name}@${o}|${r.join(",")}`;for(;;){let a=k5.get(s);if(a)return{api:a};let c=Dd.get(s);if(c){let d=await _$(c,e.timeoutMs);if(d.timedOut)return{failure:oe(ds,"toolchain-failed",`Ran out of time comparing ${e.name} ${o}'s exported API.`)};if("failure"in d.value&&!d.value.failure.available&&d.value.failure.reason==="toolchain-failed"){Dd.get(s)===c&&Dd.delete(s);continue}return d.value}let l=XPe(e,t,n,r,i,s);Dd.set(s,l);let u=()=>{Dd.get(s)===l&&Dd.delete(s)};return l.then(u,u),l}}async function XPe(e,t,n,r,i,o){let s=n.startsWith("v")?n:`v${n}`,a=await e.exec("go",["mod","download","-json",`${e.name}@${s}`],{cwd:t,timeoutMs:e.timeoutMs,env:vM(e.env)}),c=_5(a.stdout);if(!c){let d=`${a.stderr} +${a.stdout}`,p=/unknown revision|invalid version|no matching versions|404 Not Found|does not contain package/i.test(d);return{failure:oe(ds,p?"version-unavailable":"toolchain-failed",p?`The Go module proxy has no ${e.name} ${s}, so there was nothing to compare against. It may be retracted, or the module may be private.`:`\`go mod download ${e.name}@${s}\` failed: ${wM(d)}`)}}let l=await e.exec("go",["run","apidump.go","-dir",c,"-module",e.name,"-platforms",r.join(",")],{cwd:t,timeoutMs:e.timeoutMs,env:vM(e.env)});if(l.code!==0)return{failure:oe(ds,"toolchain-failed",`Drift's API extractor could not run under the installed Go toolchain (${i.source} asks for Go ${i.version}): ${wM(l.stderr)}`)};let u=u5(l.stdout);return u?u.symbols.size===0?{failure:oe(ds,"no-public-surface",`${e.name} ${s} exports nothing from any importable package on ${r.join(", ")}, so there is no API to compare.`)}:(k5.set(o,u),{api:u}):{failure:oe(ds,"parse-failed",`Drift could not read its own API extractor's output for ${e.name} ${s}.`)}}function _5(e){let t=e.indexOf("{");if(t<0)return null;try{let n=JSON.parse(e.slice(t,e.lastIndexOf("}")+1));return n.Dir&&!n.Error?n.Dir:null}catch{return/"Dir":\s*"((?:[^"\\]|\\.)*)"/.exec(e)?.[1]?.replace(/\\(.)/g,"$1")??null}}var b5=new Map;function eCe(e,t,n){let r=n?.PATH??process.env.PATH??"",i=b5.get(r);return i??=(async()=>{try{let o=await(0,Kc.mkdtemp)((0,Fh.join)((0,v5.tmpdir)(),"drift-go-apidump-"));await(0,Kc.mkdir)(o,{recursive:!0}),await(0,Kc.writeFile)((0,Fh.join)(o,"go.mod"),`module driftapidump go 1.21 -`,"utf8"),await(0,sl.writeFile)((0,kh.join)(o,"apidump.go"),fY,"utf8");let s=await e("go",["build","-o",(0,kh.join)(o,"apidump-check"),"."],{cwd:o,timeoutMs:12e4,env:$O(n)});return s.code!==0?(t.debug(`Drift's Go API extractor failed to build: ${_O(s.stderr)}`),null):o}catch(o){return t.debug(`Could not create the Go scratch module: ${o.message}`),null}})(),EY.set(i,r),r}function $O(e=process.env){return{...e,GOFLAGS:"-mod=mod"}}function _O(e){return e.split(` -`).find(t=>t.trim().length>0)?.trim()??"no output"}var al=require("node:fs/promises"),WY=require("node:path");var CY=require("node:crypto"),Ao=require("node:fs/promises"),PY=require("node:os"),$h=require("node:path");var SO=new Map,KAe=new Map;function JAe(){let e=Lc()??(0,$h.join)((0,PY.tmpdir)(),"drift-cache");return(0,$h.join)(e,"helpers")}function NY(e){return(0,CY.createHash)("sha256").update(e).digest("hex")}function DY(e){let t=KAe.get(e.id);if(t)return Promise.resolve({ok:!0,path:t});let n=`${e.id}@${e.version}#${e.sha256}`,i=SO.get(n);if(i)return i;let r=ZAe(e).finally(()=>SO.delete(n));return SO.set(n,r),r}async function ZAe(e){let t=JAe(),n=(0,$h.join)(t,`${e.id}-${e.version}.${e.extension??"jar"}`);try{let s=await(0,Ao.readFile)(n);if(NY(s)===e.sha256)return{ok:!0,path:n}}catch{}let i;try{i=await Bt(e.url,{timeoutMs:12e4})}catch(s){return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s.message}`}}}if(!i.ok){let s=i.status?`HTTP ${i.status}`:i.error??"the request failed";return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s}`}}}let r=NY(i.bytes);if(r!==e.sha256)return{ok:!1,error:{kind:"checksum-failed",detail:`${e.url}: expected SHA-256 ${e.sha256}, got ${r}`}};let o=(0,$h.join)(t,`.${e.id}-${e.version}.${process.pid}.${Date.now()}.tmp`);try{return await(0,Ao.mkdir)(t,{recursive:!0}),await(0,Ao.writeFile)(o,i.bytes),await(0,Ao.rename)(o,n),{ok:!0,path:n}}catch(s){return await(0,Ao.rm)(o,{force:!0}).catch(()=>{}),{ok:!1,error:{kind:"cache-failed",detail:`${n}: ${s.message}`}}}}function FY(e){let t=0,n="";for(let i of e)i==="<"?t++:i===">"?t=Math.max(0,t-1):t===0&&(n+=i);return n.replace(/\[\]/g,"").trim()}function YAe(e){let t=[],n=0,i="";for(let r of e){if(r==="<"?n++:r===">"&&(n=Math.max(0,n-1)),r===","&&n===0){t.push(i),i="";continue}i+=r}return t.push(i),t.map(r=>FY(r)).filter(r=>r.length>0)}function UY(e,t,n){let i=e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").trim(),r=i.indexOf("("),o=i.lastIndexOf(")");if(r===-1||o0?e.slice(0,t):null}function MY(e){return e.slice(e.lastIndexOf(".")+1)}function jY(e,t){let n=c=>`${c.owner} ${c.name} ${c.params.length}`,i=new Map;for(let c of t){let l=i.get(n(c));l?l.push(c):i.set(n(c),[c])}let r=new Map;for(let c of e)for(let l of i.get(n(c))??[]){let u=[...c.params,...c.returns===null?[]:[c.returns]],d=[...l.params,...l.returns===null?[]:[l.returns]];if(u.length===d.length)for(let[p,f]of u.entries()){let m=d[p];if(f===m||MY(f)!==MY(m))continue;let g=OY(f),h=OY(m);if(!g||!h||g===h)continue;let b=`${g} ${h}`,y=r.get(b);y||(y={types:new Map,witnesses:new Set,binaryBreaking:!1},r.set(b,y)),y.types.set(f,m),y.witnesses.add(`${c.owner}.${c.name}/${c.params.length}`),c.binaryBreaking&&(y.binaryBreaking=!0)}}let o=[];for(let[c,l]of r){if(!l.binaryBreaking||l.witnesses.size<2)continue;let[u,d]=c.split(" ");o.push({fromPackage:u,toPackage:d,types:[...l.types].map(([p,f])=>({from:p,to:f}))})}o.sort((c,l)=>l.types.length-c.types.length||c.fromPackage.localeCompare(l.fromPackage));let s=64,a=[];for(let c of o){if(s<=0)break;a.push({...c,types:c.types.slice(0,s)}),s-=Math.min(s,c.types.length)}return a}function LY(e){let t=e-44;return t>=5&&t<=99?t:null}function zY(e){let t=0,n=0;for(let o of e.split(` -`)){let s=/CLASS FILE FORMAT VERSION:\s*(\d+)(?:\.\d+)?\s*<-\s*(\d+)(?:\.\d+)?/.exec(o);s&&(n=Math.max(n,Number(s[1])),t=Math.max(t,Number(s[2])))}if(n<=t)return null;let i=LY(t),r=LY(n);return i!==null&&r!==null?{from:i,to:r}:null}var Ro="japicmp",r_="Maven POM contract",ds="https://repo1.maven.org/maven2",GY=5*1024*1024,EO="0.23.1",QAe=`${ds}/com/github/siom79/japicmp/japicmp/${EO}/japicmp-${EO}-jar-with-dependencies.jar`,XAe="f2300a8531b68e25b678247874a1eae13a07d6842a4a1236845481fc90c5c6c7",eRe="Install a JDK (11 or newer) and re-run. Drift downloads and runs japicmp itself, but does not install Java.",HY={ecosystem:"maven",tool:Ro,weight:1,async compute(e){let t=KY(e.name);if(!t)return ne(Ro,"unsupported-ecosystem",`\`${e.name}\` is not a \`groupId:artifactId\` coordinate, so Drift could not locate it on Maven Central.`);let n=[ds,...await nRe(e)],[i,r]=await Promise.all([i_(t,e.from,n),i_(t,e.to,n)]);if(!i.ok)return i.failure;if(!r.ok)return r.failure;let o=BY(i.contract.packaging),s=BY(r.contract.packaging);if(o==="pom"||s==="pom")return{available:!0,changes:rRe(i.contract,r.contract),tool:r_,weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (POM contract; ${o} \u2192 ${s})`,packageRole:s};let a;if(o!=="library"||s!=="library"){await(0,al.mkdir)(e.workdir,{recursive:!0});let[h,b]=await Promise.all([n_(t,e.from,e.workdir,n),n_(t,e.to,e.workdir,n)]);if(!h.ok||!b.ok)return{...ne(r_,"artifact-type-unsupported",`${e.name} is packaged as ${r.contract.packaging}, not as a Java library jar, and publishes no companion jar Drift could compare instead.`),packageRole:s};a={before:h,after:b}}if(!await Jk(e.exec,"java",["-version"]))return ne(Ro,"tool-missing",`Java is not installed, so ${e.name}'s classfile API could not be compared directly.`,eRe);let c=await DY({id:"japicmp",version:EO,url:QAe,sha256:XAe});if(!c.ok){let h=c.error.kind==="checksum-failed"?`Drift's pinned japicmp helper failed its SHA-256 check and was not run (${c.error.detail}).`:c.error.kind==="cache-failed"?`Drift verified its pinned japicmp helper but could not cache it for use (${c.error.detail}).`:`Drift could not download its pinned japicmp helper (${c.error.detail}).`;return ne(Ro,"toolchain-failed",h)}let l=c.path;await(0,al.mkdir)(e.workdir,{recursive:!0});let u,d;if(a)u=a.before,d=a.after;else{let h=n_(t,e.from,e.workdir,n),b=n_(t,e.to,e.workdir,n);if(b.catch(()=>{}),u=await h,!u.ok)return u.failure;if(d=await b,!d.ok)return d.failure}if(!u.ok)return u.failure;if(!d.ok)return d.failure;let[p,f]=await Promise.all([qY(u.path),qY(d.path)]);if(!p||!f)return{...ne(Ro,"artifact-type-unsupported",`${e.name} ${e.from} \u2192 ${e.to} ships no classfiles of its own (an aggregator, starter, or relocated artifact) \u2014 its published API surface is not this jar's contents, so Drift did not claim a classfile comparison for it.`),packageRole:"jar"};let m=await e.exec("java",["-jar",l,"-o",u.path,"-n",d.path,"--only-modified","--ignore-missing-classes"],{cwd:e.workdir,timeoutMs:e.timeoutMs});if(m.stdout.trim().length===0)return ne(Ro,m.code===0?"no-public-surface":"toolchain-failed",m.code===0?`japicmp found no differences it could read between ${e.name} ${e.from} and ${e.to}.`:`japicmp execution failed on ${e.name}: ${uRe(m.stderr)}`);if(!lRe(m.stdout))return ne(Ro,"parse-failed",`japicmp output for ${e.name} was not in a recognised report format.`);let g=aRe(m.stdout);return{available:!0,changes:JY(m.stdout),...g>0?{sourceIncompatibleCount:g}:{},tool:Ro,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (classfiles)`,packageRole:"jar"}}},tRe=4;async function nRe(e){let t=e.readRepoFile;if(!t)return[];let n=[...new Set([e.manifestPath,"pom.xml"].filter(r=>!!r))],i=[];for(let r of n){let o=await t(r).catch(()=>null);if(o){for(let s of o.replace(//g,"").matchAll(/([\s\S]*?)<\/repositories>/g))for(let a of s[1].matchAll(/]*)?>([\s\S]*?)<\/repository>/g)){let c=Xn(a[1],"url");c&&/^https:\/\//i.test(c)&&i.push(c.replace(/\/+$/,""))}if(i.length>0)break}}return[...new Set(i)].slice(0,tRe)}function KY(e){let[t,n]=e.split(":");return!t||!n?null:{groupId:t,artifactId:n}}function TO(e,t,n=ds){let i=e.groupId.replace(/\./g,"/");return`${n}/${i}/${e.artifactId}/${t}/${e.artifactId}-${t}.jar`}function VY(e,t,n=ds){let i=e.groupId.replace(/\./g,"/");return`${n}/${i}/${e.artifactId}/${t}/${e.artifactId}-${t}.pom`}function BY(e){let t=(e??"jar").trim().toLowerCase();return t==="jar"||t==="bundle"?"library":t==="pom"?"pom":t==="maven-plugin"?"maven-plugin":"unsupported"}async function i_(e,t,n=[ds]){let i=VY(e,t,n[0]??ds),r=await Bt(i,{timeoutMs:6e4,maxBytes:GY});for(let o of n.slice(1)){if(r.ok)break;i=VY(e,t,o),r=await Bt(i,{timeoutMs:6e4,maxBytes:GY})}if(!r.ok)return{ok:!1,failure:ne(r_,r.status===404?"version-unavailable":"artifact-unavailable",r.status===404?`No POM for ${e.groupId}:${e.artifactId}:${t} in ${ZY(n)}.`:`The exact Maven POM at ${i} could not be downloaded (HTTP ${r.status||"unavailable"}).`)};try{return{ok:!0,contract:IO(r.bytes.toString("utf8"))}}catch(o){return{ok:!1,failure:ne(r_,"parse-failed",`The exact Maven POM at ${i} could not be parsed: ${o.message}`)}}}function IO(e){if(!/)/i.test(e))throw new Error("missing project element");let t=e.replace(//g,""),n=Xn(t,"packaging")??"jar",i=_h(t,"parent"),r=i?[Xn(i,"groupId"),Xn(i,"artifactId"),Xn(i,"version")].map(o=>o??"").join(":"):null;return{packaging:n,parent:r,properties:iRe(_h(t,"properties")),dependencyManagement:oRe(_h(t,"dependencyManagement")),pluginManagement:sRe(_h(t,"pluginManagement"))}}function rRe(e,t){let n=[];return e.packaging!==t.packaging&&n.push({kind:"signature-changed",symbol:"pom:packaging",detail:`The Maven artifact role changed from ${e.packaging} to ${t.packaging}.`,before:e.packaging,after:t.packaging}),e.parent!==t.parent&&n.push({kind:"signature-changed",symbol:"pom:parent",detail:"The inherited Maven parent coordinates changed.",before:e.parent??"(none)",after:t.parent??"(none)"}),xO("property",e.properties,t.properties,n),xO("dependencyManagement",e.dependencyManagement,t.dependencyManagement,n),xO("pluginManagement",e.pluginManagement,t.pluginManagement,n),n}function xO(e,t,n,i){for(let[r,o]of t){let s=`pom:${e}:${r}`;n.has(r)?n.get(r)!==o&&i.push({kind:"signature-changed",symbol:s,detail:`The ${e} entry ${r} changed in the published POM contract.`,before:o,after:n.get(r)}):i.push({kind:"export-removed",symbol:s,detail:`The ${e} entry ${r} was removed from the published POM contract.`,before:o})}}function Xn(e,t){return new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]?.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()||null}function _h(e,t){return e?new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]??null:null}function iRe(e){let t=new Map;if(!e)return t;let n=/<([A-Za-z_][\w.-]*)(?:\s[^>]*)?>([\s\S]*?)<\/\1>/g;for(let i of e.matchAll(n)){let r=i[2].replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();r&&t.set(i[1],r)}return t}function oRe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/dependency>/g)){let i=n[1],r=`${Xn(i,"groupId")??""}:${Xn(i,"artifactId")??""}`;if(r===":")continue;let o=[...i.matchAll(/]*)?>([\s\S]*?)<\/exclusion>/g)].map(s=>`${Xn(s[1],"groupId")??""}:${Xn(s[1],"artifactId")??""}`).sort();t.set(r,[Xn(i,"version"),Xn(i,"type"),Xn(i,"scope"),Xn(i,"classifier"),...o].filter(Boolean).join("|"))}return t}function sRe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/plugin>/g)){let i=n[1],r=`${Xn(i,"groupId")??"org.apache.maven.plugins"}:${Xn(i,"artifactId")??""}`;r.endsWith(":")||t.set(r,[Xn(i,"version"),_h(i,"configuration")?.replace(/\s+/g," ").trim()].filter(Boolean).join("|"))}return t}async function qY(e){let t=await(0,al.readFile)(e);return tO(t).some(n=>n.path.endsWith(".class"))}async function n_(e,t,n,i=[ds]){let r=TO(e,t,i[0]??ds),o=(0,WY.join)(n,`${e.artifactId}-${t}.jar`);try{let s=await Bt(r,{timeoutMs:6e4});for(let a of i.slice(1)){if(s.ok)break;r=TO(e,t,a),s=await Bt(r,{timeoutMs:6e4})}if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");return s.ok?(await(0,al.writeFile)(o,s.bytes),{ok:!0,path:o}):{ok:!1,failure:ne(Ro,s.status===404?"version-unavailable":"toolchain-failed",s.status===404?`No jar for ${e.groupId}:${e.artifactId}:${t} in ${ZY(i)}. It may be an internal artefact, or published only as a POM or a BOM.`:`${r} returned ${s.status}.`)}}catch(s){return{ok:!1,failure:ne(Ro,"toolchain-failed",`Could not download ${r}: ${s.message}`)}}}function JY(e){let t=[],n=null,i=[],r=[];for(let s of e.split(` -`)){let a=s.trim(),c=/^([-+*])\1\1([!*])?\s+(\w+)\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)(?:\s*\(<-\s*\w+\))?\s*:\s*(.+)$/.exec(a);if(!c)continue;let[,,l,u,d,p]=c,f=d==="CLASS"||d==="INTERFACE"||d==="ANNOTATION",m=cRe(p);if(!m)continue;if(f&&(n=m),!f&&n&&(d==="METHOD"||d==="CONSTRUCTOR")){let h=UY(p,n,l==="!");h&&(u==="REMOVED"?i.push(h):u==="NEW"&&r.push(h))}if(u==="NEW"||l!=="!")continue;let g=f||!n?m:`${n}.${m}`;u==="REMOVED"?t.push({kind:f?"export-removed":"member-removed",symbol:g,detail:f?`\`${g}\` is no longer published (was ${Eo(d.toLowerCase())}).`:`\`${g}\` was removed.`}):u==="MODIFIED"&&t.push({kind:"signature-changed",symbol:g,detail:f?`The declaration of \`${g}\` changed in a way an existing compiled caller may not be binary-compatible with.`:`The signature of \`${g}\` changed.`,after:p.trim()})}let o=zY(e);o&&t.push({kind:"runtime-requirement-raised",symbol:"Java",detail:`This version is compiled for Java ${o.to}; the previous one was Java ${o.from}. A project building or running on Java ${o.from} cannot use it \u2014 javac rejects it at build time and the JVM raises \`UnsupportedClassVersionError\` at runtime.`,before:String(o.from),after:String(o.to)});for(let s of jY(i,r))for(let a of s.types)t.push({kind:"export-removed",symbol:a.from,detail:`\`${a.from}\` is no longer part of this library's API: \`${s.fromPackage}\` moved to \`${s.toPackage}\`. Code that imports \`${a.from}\` no longer compiles against this version \u2014 import \`${a.to}\` instead.`,before:a.from,after:a.to});return t}function aRe(e){let t=0;for(let n of e.split(` -`))/^([-+*])\1\1\*\s+\w+\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/.test(n.trim())&&(t+=1);return t}function cRe(e){let n=(e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").replace(/\s+\(not serializable\)\s*$/,"").trim().split("(")[0].trim().split(/\s+/).pop()??"").trim();return/^[\w.$]+$/.test(n)?n:null}function lRe(e){return/Comparing (?:binary|source) compatibility/i.test(e)||/^[*+-]{3}/m.test(e)||/^(?:UNCHANGED|MODIFIED|REMOVED|NEW)\s+(?:CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/m.test(e)}function ZY(e){let t=e.filter(n=>n!==ds);return t.length===0?"Maven Central":`Maven Central or ${t.join(", ")} (declared by this project)`}function uRe(e){return e.split(` -`).find(t=>t.trim().length>0)?.trim()??"no output"}var ll=require("node:fs/promises"),tp=require("node:path"),d9=require("node:crypto");var dRe=/(^|\/)(detail|details|internal|impl|private|priv|test|tests|examples?|demos?|sketch(es)?|dev|sandbox|tools?|scripts?|fuzz|contrib|bench|benchmarks?|docs?|third[_-]?party|extern(al)?|deps?)(\/|$)/i,pRe=/(^|\/)(_|.*[-_](inl|impl|internal|private|guts)\.)|(^|\/)[\w-]*guts\.h$/i,fRe=/\.(h|hpp|hh|hxx|h\+\+|inl|tpp)$/i,mRe=/(^|_)(VERSION|VERNUM|VER)(_?(MAJOR|MINOR|PATCH|REVISION|SUBREVISION|BUILD|STRING|NUM|TEXT|CODE))?$/i,gRe=["include/","inc/","src/",""];function AO(e){let t=hRe(e);return e.map(n=>({path:n.slice(t.length),original:n})).filter(n=>fRe.test(n.path)).filter(n=>!dRe.test(n.path)).filter(n=>!pRe.test(n.path)).filter(n=>gRe.some(i=>n.path.startsWith(i)))}function hRe(e){let t=e[0];if(!t)return"";let n=t.indexOf("/");if(n===-1)return"";let i=t.slice(0,n+1);return e.every(r=>r.startsWith(i))?i:""}function RO(e){let t=new Map;for(let n of e)for(let i of QY(n.content)){let r=t.get(i.name);r&&r.members.length>=i.members.length||t.set(i.name,i)}return t}function QY(e){let t=[],i=ORe(e).split(` -`),r=0,o=[],s=null,a=!1,c=()=>{for(;o.length>0&&r<=o.at(-1).depth;)o.pop()},l=(u,d)=>{for(let p=u;p<=d&&pyRe.test(S))&&s===null?s=r:y&&o.push({path:w?[]:y.split("::").filter(Boolean),depth:r,inline:w});let k=p.indexOf("{"),_=k>=0?p.slice(k+1).replace(/}\s*;?\s*$/,"").trim():"";if(_&&s===null&&!a){let S=YY(_,o.flatMap(x=>x.path));S&&t.push(S)}l(u,u);continue}if(s!==null||a){l(u,u);continue}let m=kRe(p);if(m){t.push(m),l(u,u);continue}let g=$Re(i,u,o.flatMap(y=>y.path));if(g){t.push(g.entry),l(u,g.endLine),u=g.endLine;continue}let h=DRe(i,u);if(!h){l(u,u);continue}let b=YY(h.text,o.flatMap(y=>y.path));b&&t.push(b),l(u,h.endLine),u=h.endLine}return t}var yRe=/^(detail|details|internal|impl|private|_\w+)$/i,bRe=/^\w*BEGIN_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE\b/,vRe=/^\w*(END_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE|BEGIN_PUBLIC_NAMESPACE)\b/;function wRe(e){let t=0;for(let n of e)n==="{"?t++:n==="}"&&t--;return t}function kRe(e){let t=/^#\s*define\s+(\w+)\s*(\([^)]*\))?\s*(.*)$/.exec(e);if(!t)return null;let n=t[1];if(/^_+|_H(_|PP)?$|_INCLUDED$|_GUARD$/i.test(n)||mRe.test(n))return null;let i=t[2]??"",r=t[3]?.trim()??"";return{name:n,kind:i?"function":"variable",signature:ps(`#define ${n}${i}${r?` ${r}`:""}`),members:[],requiredMembers:[]}}function $Re(e,t,n){let i=e[t].trim(),r=/^(?:typedef\s+)?(?:template\s*<[^>]*>\s*)?(struct|class|union|enum)(?:\s+class|\s+struct)?\s+(?:\w+_(?:API|EXPORT)\s+)?(\w+)?\s*(?::[^{]*)?\s*\{/.exec(i);if(!r)return null;let o=r[1],s=0,a=t,c=[];for(let f=t;ft&&c.push(m),s<=0&&f>=t){a=f;break}a=f}let l=e[a],u=/\}\s*(\w+)\s*;/.exec(l),d=r[2]??u?.[1];if(!d)return null;let p=Sh(n,d);return{entry:{name:p,kind:_Re(o),signature:ps(`${o} ${p}`),...SRe(c.join(` -`),o),requiredMembers:[]},endLine:a}}function _Re(e){return e==="enum"?"enum":e==="class"?"class":"interface"}function SRe(e,t){if(t==="enum")return{members:[...new Set(e.replace(/\{|\}[^}]*$/g,"").split(",").map(s=>/^\s*(\w+)/.exec(s)?.[1]).filter(s=>!!s))]};let n=[],i={},r=t!=="class",o=0;for(let s of e.split(` -`)){let a=s.trim(),c=/^(public|private|protected)\s*:/.exec(a);if(c){r=c[1]==="public";continue}let l=o;for(let f of a)f==="{"?o++:f==="}"&&o--;if(l>0||!r)continue;let u=NO(a);if(u){n.push(u.identity),i[u.identity]=u.signature;continue}let d=/(\w+)\s*\([^)]*\)\s*(?:const\s*)?(?:noexcept\s*)?[;{=]/.exec(a);if(d?.[1]&&!xh.has(d[1])){n.push(d[1]);continue}if(d?.[1])continue;let p=/^[\w:<>,\s*&[\]]+?(\w+)\s*(?:\[[^\]]*\]\s*)?(?:=\s*[^;]+)?;/.exec(a);p?.[1]&&!xh.has(p[1])&&!MRe.test(p[1])&&n.push(p[1])}return{members:[...new Set(n)],memberSignatures:i}}function xRe(e){return NO(e)?.identity??null}function NO(e){let t=e.search(/\boperator\b/);if(t<0)return null;let n=e.slice(t+8).trimStart(),i=IRe(n);if(!i)return null;let r=i.end;for(;/\s/.test(n[r]??"");)r++;if(n[r]!=="(")return null;let o=XY(n,r);if(!o)return null;let s=ARe(n.slice(o.end+1)),a=i.conversion?`operator ${i.name}`:/^[A-Za-z]/.test(i.name)?`operator ${i.name}(${o_(o.content)})`:`operator${i.name}(${o_(o.content)})`,c=ERe(e.slice(0,t)),l=`${a}${s}`,u=`${c?`${c} `:""}operator ${i.name}(${o_(o.content)})${s}`;return{identity:l,signature:u}}function ERe(e){return ps(e).replace(/\b(?:extern|static|inline|virtual|friend|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall)\b/g,"").replace(/\s+/g," ").trim()}var TRe=["<=>","->*","<<=",">>=","new[]","delete[]","()","[]","->","<<",">>","==","!=","<=",">=","&&","||","++","--","+=","-=","*=","/=","%=","^=","&=","|=","co_await","new","delete","+","-","*","/","%","^","&","|","~","!","=","<",">",","];function IRe(e){let t=/^""\s*([A-Za-z_]\w*)/.exec(e);if(t)return{name:`""${t[1]}`,end:t[0].length,conversion:!1};for(let i of TRe){let o=(i==="new[]"?/^new\s*\[\]/:i==="delete[]"?/^delete\s*\[\]/:null)?.exec(e)?.[0]??(e.startsWith(i)?i:null);if(o&&!(/^[A-Za-z_]/.test(i)&&/[A-Za-z0-9_]/.test(e[o.length]??"")))return{name:i,end:o.length,conversion:!1}}let n=0;for(let i=0;i"&&n>0)n--;else if(r==="("&&n===0){let o=ps(e.slice(0,i));return o?{name:o,end:i,conversion:!0}:null}}return null}function XY(e,t){let n=0;for(let i=t;i=0){let s=r+8;for(;/\s/.test(t[s]??"");)s++;if(t[s]==="("){let a=XY(t,s);n.push(a?`noexcept(${ps(a.content)})`:"noexcept")}else n.push("noexcept")}let o=/\brequires\s+(.+?)(?=\s*(?:;|\{|$))/.exec(t)?.[1];return o&&n.push(`requires ${ps(o)}`),n.length>0?` ${n.join(" ")}`:""}function YY(e,t=[]){let n=e.trim().replace(/^(?:\[\[[^\]]*\]\]\s*)+/,"").replace(/\s+/g," ");if(!n||n.startsWith("#"))return null;let i=/^typedef\s+(.+?)\s*;$/.exec(n);if(i){let l=/\(\s*\*\s*(\w+)\s*\)/.exec(i[1])?.[1]??/(\w+)\s*(?:\[[^\]]*\])?$/.exec(i[1])?.[1];return!l||xh.has(l)?null:{name:Sh(t,l),kind:"type",signature:ps(n),members:[],requiredMembers:[]}}let r=RRe(n);if(xRe(n)){let c=NO(n);return{name:Sh(t,c.identity),kind:"function",signature:c.signature,members:[],requiredMembers:[]}}let s=/^((?:const\s+|unsigned\s+|signed\s+|struct\s+|enum\s+|class\s+)*[\w:]+(?:\s*<[^>]*>)?[\s*&]+)(\w+)\s*\(([^)]*)\)\s*(const)?\s*(?:noexcept)?\s*[;{]$/.exec(r);if(s){let c=ps(s[1]),l=s[2];return xh.has(l)?null:{name:Sh(t,l),kind:"function",signature:`${c} ${l}(${o_(s[3])})${s[4]?" const":""}`,members:[],requiredMembers:[]}}let a=/^extern\s+((?:const\s+)?[\w:]+[\s*&]+)(\w+)\s*(?:\[[^\]]*\])?\s*;$/.exec(n);if(a){let c=a[2];return xh.has(c)?null:{name:Sh(t,c),kind:"variable",signature:ps(n.replace(/;$/,"")),members:[],requiredMembers:[]}}return null}function RRe(e){let t=e;for(;;){let n=/^(?:extern|static|inline|constexpr|virtual|explicit|friend|EXTERN_C|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall|__forceinline|__inline__|__restrict__|__host__|__device__|[A-Za-z_]\w*_(?:API|EXPORT))\s+/.exec(t);if(n){t=t.slice(n[0].length);continue}let i=/^(?:__declspec|__attribute__)\s*/.exec(t);if(!i)return t;let r=i[0].length;if(t[r]!=="(")return t;let o=0;for(;r{let r=n.split("=")[0].trim().replace(/\s*\[[^\]]*\]\s*$/,"");if(r.split(/(?<=[\s*&])/).length<2)return r;let s=/\b(\w+)\s*$/.exec(r)?.[1];if(s&&NRe.has(s))return r;let a=r.match(/\b\w+\b/g)??[];return a.length===2&&CRe.has(a[0])?r:r.replace(/\b\w+\s*$/,"").trim()||r}).join(", ")}var NRe=new Set(["void","bool","char","wchar_t","char8_t","char16_t","char32_t","short","int","long","float","double","signed","unsigned","const","volatile"]),CRe=new Set(["struct","class","enum","union","const","volatile","signed","unsigned","short","long"]);function PRe(e){let t=[],n=0,i="";for(let r of e){if(r==="<"||r==="("||r==="["?n++:(r===">"||r===")"||r==="]")&&n--,r===","&&n===0){t.push(i),i="";continue}i+=r}return i.trim()&&t.push(i),t}function DRe(e,t){let n="";for(let i=t;iFRe(e,t)}}var n9=CO("arduino"),r9=CO("conan"),i9=CO("vcpkg");async function FRe(e,t){let n=LRe[e];if(!n)return ne(cl,"unsupported-ecosystem",`No source resolver for ${e}.`);let i=e9(e,n,t,t.from),r=e9(e,n,t,t.to);r.catch(()=>{});let o=await i;if(!o.ok)return o.failure;let s=await r;return s.ok?o.api.size===0&&s.api.size===0?ne(cl,"no-public-surface",`No declarations could be read from ${t.name}'s headers in either version. A library whose API is generated by macros, or shipped as a prebuilt binary, has no header text to compare.`):{available:!0,changes:Dr(o.api,s.api),tool:cl,weight:t9,locator:`${t.name} ${t.from} \u2192 ${t.to} (public headers)`}:s.failure}async function e9(e,t,n,i){let r=await t(n.name,i);if(!r)return{ok:!1,failure:ne(cl,"version-unavailable",`No source archive is published for ${n.name} ${i} in ${URe(e)}, so its headers could not be read.`)};let o;try{let s=await Bt(r,{timeoutMs:n.timeoutMs});if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");if(!s.ok)return{ok:!1,failure:ne(cl,"version-unavailable",`${r} returned ${s.status}.`)};let a=Fn(s.bytes),c=new Map(a.map(l=>[l.path,l]));o=AO([...c.keys()]).map(l=>({path:l.path,content:c.get(l.original).read().toString("utf8")})).filter(l=>l.content.length>0)}catch(s){return{ok:!1,failure:ne(cl,"artifact-unavailable",`Could not read ${n.name} ${i} from ${r}: ${s.message}`)}}return n.logger.debug(`${n.name} ${i}: ${o.length} public header(s)`),{ok:!0,api:RO(o)}}function URe(e){return e==="conan"?"ConanCenter":e==="vcpkg"?"the vcpkg registry":"the Arduino Library Manager"}async function jRe(e,t){let n=await Uk(e),i=n?.archives[t];if(i)return i;let r=n?.githubRepo??await zRe(e);return r?PO(r,t):null}async function zRe(e){return(await Wn(e,"arduino",null))?.githubRepo??null}async function GRe(e,t){let n=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,i=await rt(`${n}/config.yml`);if(!i)return null;let r=o9(i,t)??VRe(i);if(!r)return null;let o=await rt(`${n}/${r}/conandata.yml`);if(!o)return null;let s=s9(o,t);if(s)return s;let a=BRe(o);return a?PO(a,t):null}function VRe(e){return/folder\s*:\s*["']?([^"'\s]+)["']?/.exec(e)?.[1]??null}function BRe(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=Lt(t[0]);if(n)return n}return null}async function PO(e,t){let i=(await $e(`https://api.github.com/repos/${e}/tags?per_page=100`)??[]).map(r=>r.name).find(r=>!!r&&Xd(r,t));return i?`https://codeload.github.com/${e}/tar.gz/refs/tags/${encodeURIComponent(i)}`:null}function o9(e,t){let n=e.split(` -`),i=null;for(let r of n){let o=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(r.replace(/\s+$/,""));if(o){i=o[1].trim();continue}let s=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(r);if(s&&i===t)return s[1]}return null}function s9(e,t){let n=e.split(` -`),i=!1,r=!1;for(let o of n){let s=o.replace(/\s+$/,"");if(!s.trim())continue;if(/^sources\s*:/.test(s)){i=!0;continue}if(!/^\s/.test(s)){i=!1,r=!1;continue}if(!i)continue;let a=/^ {2}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){r=a[1].trim()===t;continue}if(!r)continue;let c=/https?:\/\/\S+/.exec(s);if(c&&!c[0].endsWith(".git"))return c[0].replace(/["',]+$/,"")}return null}async function qRe(e,t){let n=await $e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`),i=Lt(n?.homepage??null);return i?PO(i,t):null}function Xd(e,t){let n=i=>i.replace(/^[^\d]*/,"").replace(/_/g,".");return e===t||n(e)===n(t)}var Un="python ast",WRe="Install Python 3 and make `python3` available on PATH.",a9=.9,HRe=.6,p9={ecosystem:"pypi",tool:Un,weight:a9,async compute(e){if(!await Jk(e.exec,"python3",["--version"]))return ne(Un,"tool-missing",`Python 3 is not installed, so ${e.name}'s public symbols could not be compared.`,WRe);await(0,ll.mkdir)(e.workdir,{recursive:!0});let t=(0,tp.join)(e.workdir,"surface.py");await(0,ll.writeFile)(t,m9,"utf8");let n=`${iNe}/${await oNe(e)}`,i=Date.now()+e.timeoutMs,r=c9(e,e.from,t,n,i),o=c9(e,e.to,t,n,i);o.catch(()=>{});let s=await r;if(!s.ok)return s.failure;let a=await o;if(!a.ok)return a.failure;let c=s.usedGitHubFallback||a.usedGitHubFallback,l=c?"; source: GitHub tag mirror, PyPI archive was unreadable":"";return{available:!0,changes:Dr(s.api,a.api),tool:Un,weight:c?HRe:a9,locator:`${e.name} ${e.from} \u2192 ${e.to} (public symbols, best-effort${l})`}}};function ki(e){return Math.max(0,e-Date.now())}var ep=new Map;async function c9(e,t,n,i,r){let o=`python-surface:${i}:${e.name}@${t}`;for(;;){let s=ki(r);if(s<=0)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let a=ep.get(o);if(a){let l=await t_(a.promise,s);if(l.timedOut)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};if(!l.value.ok&&l.value.budgetExhausted){ep.get(o)===a&&ep.delete(o);continue}return l.value}let c=(async()=>{let l=await Na(o);if(l)return{ok:!0,api:new Map(l),usedGitHubFallback:!1};let u=await KRe(e,t,n,r);return u.ok?(u.usedGitHubFallback||await Ca(o,[...u.api]),u):ki(r)<=0?{...u,budgetExhausted:!0}:u})();return ep.set(o,{promise:c}),c.catch(()=>{}).then(()=>{ep.get(o)?.promise===c&&ep.delete(o)}),c}}async function KRe(e,t,n,i){if(ki(i)<=0)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let r=await nNe(e.name,t,ki(i));if(!r)return{ok:!1,failure:ne(Un,"version-unavailable",`PyPI has no source archive for ${e.name} ${t}. It may be private, yanked, or published only as a built wheel Drift cannot open.`)};let o=(0,tp.join)(e.workdir,`probe-${t.replace(/[^\w.-]/g,"_")}`),s,a=!1;try{await(0,ll.mkdir)(o,{recursive:!0});let d=await Bt(r.url,{timeoutMs:ki(i),retries:2});if(d.ok)s=d.bytes;else{let p=ki(i)>0?await QRe(e.name,t,i):null;if(!p)return d.status===0?{ok:!1,failure:ne(Un,"toolchain-failed",`Could not download ${r.url}: ${d.error??"the request did not complete"}`)}:{ok:!1,failure:ne(Un,"version-unavailable",`PyPI returned ${d.status} for ${r.url}.`)};s=p,a=!0}}catch(d){return{ok:!1,failure:ne(Un,"toolchain-failed",`Could not download ${r.url}: ${d.message}`)}}let c=0;try{let d=Fn(s),p=d,f="";if(a){let m=tNe(d.map(h=>h.path),e.name);if(!m)return{ok:!1,failure:ne(Un,"no-public-surface",`Could not confidently identify ${e.name}'s own source directory inside its GitHub repository, so the fallback was declined rather than comparing the whole repository.`)};let g=`${m}/`;p=d.filter(h=>h.path.startsWith(g)),f=m.slice(0,m.lastIndexOf("/")+1)}for(let m of p){let g=ZRe(f?m.path.slice(f.length):m.path);if(!g)continue;let h=(0,tp.join)(o,g);await(0,ll.mkdir)((0,tp.dirname)(h),{recursive:!0}),await(0,ll.writeFile)(h,m.read()),c+=1}}catch(d){return{ok:!1,failure:ne(Un,"toolchain-failed",`Could not unpack ${r.filename}: ${l9(d.message)}`)}}if(c===0)return{ok:!1,failure:ne(Un,"no-public-surface",`${e.name} ${t} ships no Python sources Drift could read.`)};if(ki(i)<=0)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t}'s source could be parsed.`)};let l=await e.exec("python3",[n,o,e.name],{timeoutMs:ki(i)});if(l.code!==0)return{ok:!1,failure:ne(Un,"parse-failed",`Could not read ${e.name} ${t}'s public symbols: ${l9(l.stderr)}`)};let u=f9(l.stdout);return u?u.size===0?{ok:!1,failure:ne(Un,"no-public-surface",`${e.name} ${t} declares no public symbols Drift could read statically.`)}:{ok:!0,api:u,usedGitHubFallback:a}:{ok:!1,failure:ne(Un,"parse-failed",`Unreadable symbol listing for ${e.name} ${t}.`)}}var JRe=new Set(["test","tests",".git","__pycache__"]);function ZRe(e){let t=e.split("/").filter(s=>s!==""&&s!==".");if(t.length===0||t.some(s=>s==="..")||e.startsWith("/")||/^[a-zA-Z]:/.test(e)||t.slice(0,-1).some(s=>JRe.has(s)))return null;let n=t.at(-1),i=n.endsWith(".py")||n.endsWith(".pyi"),r=["pyproject.toml","setup.cfg","setup.py"].includes(n),o=n==="top_level.txt"&&t.some(s=>s.endsWith(".dist-info")||s.endsWith(".egg-info"));return!i&&!r&&!o?null:t.join("/")}var YRe=25*1024*1024;async function QRe(e,t,n){let i=await Wn(e,"pypi",t);if(!i?.githubRepo||ki(n)<=0)return null;let r=await $e(`https://api.github.com/repos/${i.githubRepo}/tags?per_page=100`,{timeoutMs:ki(n)}),o=XRe(r??[],e,t);if(!o||ki(n)<=0)return null;let a=r?.find(l=>l.name===o)?.commit?.sha??`refs/tags/${o}`,c=await Bt(`https://codeload.github.com/${i.githubRepo}/tar.gz/${a}`,{timeoutMs:ki(n),retries:2,maxBytes:YRe});return c.ok?c.bytes:null}function XRe(e,t,n){let i=e.filter(a=>!!a.name&&Xd(a.name,n)),r=t.toLowerCase().replace(/[_.]/g,"-"),o=new RegExp(`(^|[^a-z0-9])${eNe(r)}([^a-z0-9]|$)`),s=i.filter(a=>o.test(a.name.toLowerCase().replace(/[_.]/g,"-")));return s.length===1?s[0].name:s.length>1?null:i.length===1?i[0].name:null}function eNe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tNe(e,t){let n=t.toLowerCase().replace(/[-.]+/g,"_"),i=new Set;for(let r of e){let o=r.split("/").filter(s=>s!=="");for(let s=0;sc.packagetype==="sdist"),s=r.find(c=>c.packagetype==="bdist_wheel"),a=o??s;return a?{url:a.url,filename:a.filename}:null}var rNe={function:"function",class:"class",variable:"variable",unknown:"unknown"};function f9(e){let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t))return null;let n=new Map;for(let i of t)if(i?.name){if(i.shapeUnknown){n.set(i.name,{name:i.name,kind:"unknown",signature:i.name,members:[],requiredMembers:[],shapeUnknown:!0});continue}n.set(i.name,{name:i.name,kind:rNe[i.kind]??"variable",signature:i.signature??i.name,members:i.members??[],requiredMembers:[],...Array.isArray(i.callable)?{callable:{parameters:i.callable}}:{}})}return n}var m9=`import ast, json, os, re, sys +`,"utf8"),await(0,Kc.writeFile)((0,Fh.join)(o,"apidump.go"),o5,"utf8");let s=await e("go",["build","-o",(0,Fh.join)(o,"apidump-check"),"."],{cwd:o,timeoutMs:12e4,env:vM(n)});return s.code!==0?(t.debug(`Drift's Go API extractor failed to build: ${wM(s.stderr)}`),null):o}catch(o){return t.debug(`Could not create the Go scratch module: ${o.message}`),null}})(),b5.set(r,i),i}function vM(e=process.env){return{...e,GOFLAGS:"-mod=mod"}}function wM(e){return e.split(` +`).find(t=>t.trim().length>0)?.trim()??"no output"}var Jc=require("node:fs/promises"),F5=require("node:path");var S5=require("node:crypto"),Io=require("node:fs/promises"),x5=require("node:os"),jh=require("node:path");var kM=new Map,tCe=new Map;function nCe(){let e=xc()??(0,jh.join)((0,x5.tmpdir)(),"drift-cache");return(0,jh.join)(e,"helpers")}function $5(e){return(0,S5.createHash)("sha256").update(e).digest("hex")}function E5(e){let t=tCe.get(e.id);if(t)return Promise.resolve({ok:!0,path:t});let n=`${e.id}@${e.version}#${e.sha256}`,r=kM.get(n);if(r)return r;let i=rCe(e).finally(()=>kM.delete(n));return kM.set(n,i),i}async function rCe(e){let t=nCe(),n=(0,jh.join)(t,`${e.id}-${e.version}.${e.extension??"jar"}`);try{let s=await(0,Io.readFile)(n);if($5(s)===e.sha256)return{ok:!0,path:n}}catch{}let r;try{r=await qt(e.url,{timeoutMs:12e4})}catch(s){return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s.message}`}}}if(!r.ok){let s=r.status?`HTTP ${r.status}`:r.error??"the request failed";return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s}`}}}let i=$5(r.bytes);if(i!==e.sha256)return{ok:!1,error:{kind:"checksum-failed",detail:`${e.url}: expected SHA-256 ${e.sha256}, got ${i}`}};let o=(0,jh.join)(t,`.${e.id}-${e.version}.${process.pid}.${Date.now()}.tmp`);try{return await(0,Io.mkdir)(t,{recursive:!0}),await(0,Io.writeFile)(o,r.bytes),await(0,Io.rename)(o,n),{ok:!0,path:n}}catch(s){return await(0,Io.rm)(o,{force:!0}).catch(()=>{}),{ok:!1,error:{kind:"cache-failed",detail:`${n}: ${s.message}`}}}}function R5(e){let t=0,n="";for(let r of e)r==="<"?t++:r===">"?t=Math.max(0,t-1):t===0&&(n+=r);return n.replace(/\[\]/g,"").trim()}function iCe(e){let t=[],n=0,r="";for(let i of e){if(i==="<"?n++:i===">"&&(n=Math.max(0,n-1)),i===","&&n===0){t.push(r),r="";continue}r+=i}return t.push(r),t.map(i=>R5(i)).filter(i=>i.length>0)}function P5(e,t,n){let r=e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").trim(),i=r.indexOf("("),o=r.lastIndexOf(")");if(i===-1||o0?e.slice(0,t):null}function I5(e){return e.slice(e.lastIndexOf(".")+1)}function C5(e,t){let n=c=>`${c.owner} ${c.name} ${c.params.length}`,r=new Map;for(let c of t){let l=r.get(n(c));l?l.push(c):r.set(n(c),[c])}let i=new Map;for(let c of e)for(let l of r.get(n(c))??[]){let u=[...c.params,...c.returns===null?[]:[c.returns]],d=[...l.params,...l.returns===null?[]:[l.returns]];if(u.length===d.length)for(let[p,f]of u.entries()){let m=d[p];if(f===m||I5(f)!==I5(m))continue;let g=T5(f),h=T5(m);if(!g||!h||g===h)continue;let v=`${g} ${h}`,b=i.get(v);b||(b={types:new Map,witnesses:new Set,binaryBreaking:!1},i.set(v,b)),b.types.set(f,m),b.witnesses.add(`${c.owner}.${c.name}/${c.params.length}`),c.binaryBreaking&&(b.binaryBreaking=!0)}}let o=[];for(let[c,l]of i){if(!l.binaryBreaking||l.witnesses.size<2)continue;let[u,d]=c.split(" ");o.push({fromPackage:u,toPackage:d,types:[...l.types].map(([p,f])=>({from:p,to:f}))})}o.sort((c,l)=>l.types.length-c.types.length||c.fromPackage.localeCompare(l.fromPackage));let s=64,a=[];for(let c of o){if(s<=0)break;a.push({...c,types:c.types.slice(0,s)}),s-=Math.min(s,c.types.length)}return a}function A5(e){let t=e-44;return t>=5&&t<=99?t:null}function N5(e){let t=0,n=0;for(let o of e.split(` +`)){let s=/CLASS FILE FORMAT VERSION:\s*(\d+)(?:\.\d+)?\s*<-\s*(\d+)(?:\.\d+)?/.exec(o);s&&(n=Math.max(n,Number(s[1])),t=Math.max(t,Number(s[2])))}if(n<=t)return null;let r=A5(t),i=A5(n);return r!==null&&i!==null?{from:r,to:i}:null}var Ao="japicmp",S$="Maven POM contract",ps="https://repo1.maven.org/maven2",D5=5*1024*1024,$M="0.23.1",oCe=`${ps}/com/github/siom79/japicmp/japicmp/${$M}/japicmp-${$M}-jar-with-dependencies.jar`,sCe="f2300a8531b68e25b678247874a1eae13a07d6842a4a1236845481fc90c5c6c7",aCe="Install a JDK (11 or newer) and re-run. Drift downloads and runs japicmp itself, but does not install Java.",j5={ecosystem:"maven",tool:Ao,weight:1,async compute(e){let t=U5(e.name);if(!t)return oe(Ao,"unsupported-ecosystem",`\`${e.name}\` is not a \`groupId:artifactId\` coordinate, so Drift could not locate it on Maven Central.`);let n=[ps,...await lCe(e)],[r,i]=await Promise.all([x$(t,e.from,n),x$(t,e.to,n)]);if(!r.ok)return r.failure;if(!i.ok)return i.failure;let o=M5(r.contract.packaging),s=M5(i.contract.packaging);if(o==="pom"||s==="pom")return{available:!0,changes:uCe(r.contract,i.contract),tool:S$,weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (POM contract; ${o} \u2192 ${s})`,packageRole:s};let a;if(o!=="library"||s!=="library"){await(0,Jc.mkdir)(e.workdir,{recursive:!0});let[h,v]=await Promise.all([$$(t,e.from,e.workdir,n),$$(t,e.to,e.workdir,n)]);if(!h.ok||!v.ok)return{...oe(S$,"artifact-type-unsupported",`${e.name} is packaged as ${i.contract.packaging}, not as a Java library jar, and publishes no companion jar Drift could compare instead.`),packageRole:s};a={before:h,after:v}}if(!await h_(e.exec,"java",["-version"]))return oe(Ao,"tool-missing",`Java is not installed, so ${e.name}'s classfile API could not be compared directly.`,aCe);let c=await E5({id:"japicmp",version:$M,url:oCe,sha256:sCe});if(!c.ok){let h=c.error.kind==="checksum-failed"?`Drift's pinned japicmp helper failed its SHA-256 check and was not run (${c.error.detail}).`:c.error.kind==="cache-failed"?`Drift verified its pinned japicmp helper but could not cache it for use (${c.error.detail}).`:`Drift could not download its pinned japicmp helper (${c.error.detail}).`;return oe(Ao,"toolchain-failed",h)}let l=c.path;await(0,Jc.mkdir)(e.workdir,{recursive:!0});let u,d;if(a)u=a.before,d=a.after;else{let h=$$(t,e.from,e.workdir,n),v=$$(t,e.to,e.workdir,n);if(v.catch(()=>{}),u=await h,!u.ok)return u.failure;if(d=await v,!d.ok)return d.failure}if(!u.ok)return u.failure;if(!d.ok)return d.failure;let[p,f]=await Promise.all([L5(u.path),L5(d.path)]);if(!p||!f)return{...oe(Ao,"artifact-type-unsupported",`${e.name} ${e.from} \u2192 ${e.to} ships no classfiles of its own (an aggregator, starter, or relocated artifact) \u2014 its published API surface is not this jar's contents, so Drift did not claim a classfile comparison for it.`),packageRole:"jar"};let m=await e.exec("java",["-jar",l,"-o",u.path,"-n",d.path,"--only-modified","--ignore-missing-classes"],{cwd:e.workdir,timeoutMs:e.timeoutMs});if(m.stdout.trim().length===0)return oe(Ao,m.code===0?"no-public-surface":"toolchain-failed",m.code===0?`japicmp found no differences it could read between ${e.name} ${e.from} and ${e.to}.`:`japicmp execution failed on ${e.name}: ${yCe(m.stderr)}`);if(!hCe(m.stdout))return oe(Ao,"parse-failed",`japicmp output for ${e.name} was not in a recognised report format.`);let g=mCe(m.stdout);return{available:!0,changes:z5(m.stdout),...g>0?{sourceIncompatibleCount:g}:{},tool:Ao,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (classfiles)`,packageRole:"jar"}}},cCe=4;async function lCe(e){let t=e.readRepoFile;if(!t)return[];let n=[...new Set([e.manifestPath,"pom.xml"].filter(i=>!!i))],r=[];for(let i of n){let o=await t(i).catch(()=>null);if(o){for(let s of o.replace(//g,"").matchAll(/([\s\S]*?)<\/repositories>/g))for(let a of s[1].matchAll(/]*)?>([\s\S]*?)<\/repository>/g)){let c=Xn(a[1],"url");c&&/^https:\/\//i.test(c)&&r.push(c.replace(/\/+$/,""))}if(r.length>0)break}}return[...new Set(r)].slice(0,cCe)}function U5(e){let[t,n]=e.split(":");return!t||!n?null:{groupId:t,artifactId:n}}function SM(e,t,n=ps){let r=e.groupId.replace(/\./g,"/");return`${n}/${r}/${e.artifactId}/${t}/${e.artifactId}-${t}.jar`}function O5(e,t,n=ps){let r=e.groupId.replace(/\./g,"/");return`${n}/${r}/${e.artifactId}/${t}/${e.artifactId}-${t}.pom`}function M5(e){let t=(e??"jar").trim().toLowerCase();return t==="jar"||t==="bundle"?"library":t==="pom"?"pom":t==="maven-plugin"?"maven-plugin":"unsupported"}async function x$(e,t,n=[ps]){let r=O5(e,t,n[0]??ps),i=await qt(r,{timeoutMs:6e4,maxBytes:D5});for(let o of n.slice(1)){if(i.ok)break;r=O5(e,t,o),i=await qt(r,{timeoutMs:6e4,maxBytes:D5})}if(!i.ok)return{ok:!1,failure:oe(S$,i.status===404?"version-unavailable":"artifact-unavailable",i.status===404?`No POM for ${e.groupId}:${e.artifactId}:${t} in ${G5(n)}.`:`The exact Maven POM at ${r} could not be downloaded (HTTP ${i.status||"unavailable"}).`)};try{return{ok:!0,contract:xM(i.bytes.toString("utf8"))}}catch(o){return{ok:!1,failure:oe(S$,"parse-failed",`The exact Maven POM at ${r} could not be parsed: ${o.message}`)}}}function xM(e){if(!/)/i.test(e))throw new Error("missing project element");let t=e.replace(//g,""),n=Xn(t,"packaging")??"jar",r=Uh(t,"parent"),i=r?[Xn(r,"groupId"),Xn(r,"artifactId"),Xn(r,"version")].map(o=>o??"").join(":"):null;return{packaging:n,parent:i,properties:dCe(Uh(t,"properties")),dependencyManagement:pCe(Uh(t,"dependencyManagement")),pluginManagement:fCe(Uh(t,"pluginManagement"))}}function uCe(e,t){let n=[];return e.packaging!==t.packaging&&n.push({kind:"signature-changed",symbol:"pom:packaging",detail:`The Maven artifact role changed from ${e.packaging} to ${t.packaging}.`,before:e.packaging,after:t.packaging}),e.parent!==t.parent&&n.push({kind:"signature-changed",symbol:"pom:parent",detail:"The inherited Maven parent coordinates changed.",before:e.parent??"(none)",after:t.parent??"(none)"}),_M("property",e.properties,t.properties,n),_M("dependencyManagement",e.dependencyManagement,t.dependencyManagement,n),_M("pluginManagement",e.pluginManagement,t.pluginManagement,n),n}function _M(e,t,n,r){for(let[i,o]of t){let s=`pom:${e}:${i}`;n.has(i)?n.get(i)!==o&&r.push({kind:"signature-changed",symbol:s,detail:`The ${e} entry ${i} changed in the published POM contract.`,before:o,after:n.get(i)}):r.push({kind:"export-removed",symbol:s,detail:`The ${e} entry ${i} was removed from the published POM contract.`,before:o})}}function Xn(e,t){return new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]?.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()||null}function Uh(e,t){return e?new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]??null:null}function dCe(e){let t=new Map;if(!e)return t;let n=/<([A-Za-z_][\w.-]*)(?:\s[^>]*)?>([\s\S]*?)<\/\1>/g;for(let r of e.matchAll(n)){let i=r[2].replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();i&&t.set(r[1],i)}return t}function pCe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/dependency>/g)){let r=n[1],i=`${Xn(r,"groupId")??""}:${Xn(r,"artifactId")??""}`;if(i===":")continue;let o=[...r.matchAll(/]*)?>([\s\S]*?)<\/exclusion>/g)].map(s=>`${Xn(s[1],"groupId")??""}:${Xn(s[1],"artifactId")??""}`).sort();t.set(i,[Xn(r,"version"),Xn(r,"type"),Xn(r,"scope"),Xn(r,"classifier"),...o].filter(Boolean).join("|"))}return t}function fCe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/plugin>/g)){let r=n[1],i=`${Xn(r,"groupId")??"org.apache.maven.plugins"}:${Xn(r,"artifactId")??""}`;i.endsWith(":")||t.set(i,[Xn(r,"version"),Uh(r,"configuration")?.replace(/\s+/g," ").trim()].filter(Boolean).join("|"))}return t}async function L5(e){let t=await(0,Jc.readFile)(e);return QO(t).some(n=>n.path.endsWith(".class"))}async function $$(e,t,n,r=[ps]){let i=SM(e,t,r[0]??ps),o=(0,F5.join)(n,`${e.artifactId}-${t}.jar`);try{let s=await qt(i,{timeoutMs:6e4});for(let a of r.slice(1)){if(s.ok)break;i=SM(e,t,a),s=await qt(i,{timeoutMs:6e4})}if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");return s.ok?(await(0,Jc.writeFile)(o,s.bytes),{ok:!0,path:o}):{ok:!1,failure:oe(Ao,s.status===404?"version-unavailable":"toolchain-failed",s.status===404?`No jar for ${e.groupId}:${e.artifactId}:${t} in ${G5(r)}. It may be an internal artefact, or published only as a POM or a BOM.`:`${i} returned ${s.status}.`)}}catch(s){return{ok:!1,failure:oe(Ao,"toolchain-failed",`Could not download ${i}: ${s.message}`)}}}function z5(e){let t=[],n=null,r=[],i=[];for(let s of e.split(` +`)){let a=s.trim(),c=/^([-+*])\1\1([!*])?\s+(\w+)\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)(?:\s*\(<-\s*\w+\))?\s*:\s*(.+)$/.exec(a);if(!c)continue;let[,,l,u,d,p]=c,f=d==="CLASS"||d==="INTERFACE"||d==="ANNOTATION",m=gCe(p);if(!m)continue;if(f&&(n=m),!f&&n&&(d==="METHOD"||d==="CONSTRUCTOR")){let h=P5(p,n,l==="!");h&&(u==="REMOVED"?r.push(h):u==="NEW"&&i.push(h))}if(u==="NEW"||l!=="!")continue;let g=f||!n?m:`${n}.${m}`;u==="REMOVED"?t.push({kind:f?"export-removed":"member-removed",symbol:g,detail:f?`\`${g}\` is no longer published (was ${xo(d.toLowerCase())}).`:`\`${g}\` was removed.`}):u==="MODIFIED"&&t.push({kind:"signature-changed",symbol:g,detail:f?`The declaration of \`${g}\` changed in a way an existing compiled caller may not be binary-compatible with.`:`The signature of \`${g}\` changed.`,after:p.trim()})}let o=N5(e);o&&t.push({kind:"runtime-requirement-raised",symbol:"Java",detail:`This version is compiled for Java ${o.to}; the previous one was Java ${o.from}. A project building or running on Java ${o.from} cannot use it \u2014 javac rejects it at build time and the JVM raises \`UnsupportedClassVersionError\` at runtime.`,before:String(o.from),after:String(o.to)});for(let s of C5(r,i))for(let a of s.types)t.push({kind:"export-removed",symbol:a.from,detail:`\`${a.from}\` is no longer part of this library's API: \`${s.fromPackage}\` moved to \`${s.toPackage}\`. Code that imports \`${a.from}\` no longer compiles against this version \u2014 import \`${a.to}\` instead.`,before:a.from,after:a.to});return t}function mCe(e){let t=0;for(let n of e.split(` +`))/^([-+*])\1\1\*\s+\w+\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/.test(n.trim())&&(t+=1);return t}function gCe(e){let n=(e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").replace(/\s+\(not serializable\)\s*$/,"").trim().split("(")[0].trim().split(/\s+/).pop()??"").trim();return/^[\w.$]+$/.test(n)?n:null}function hCe(e){return/Comparing (?:binary|source) compatibility/i.test(e)||/^[*+-]{3}/m.test(e)||/^(?:UNCHANGED|MODIFIED|REMOVED|NEW)\s+(?:CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/m.test(e)}function G5(e){let t=e.filter(n=>n!==ps);return t.length===0?"Maven Central":`Maven Central or ${t.join(", ")} (declared by this project)`}function yCe(e){return e.split(` +`).find(t=>t.trim().length>0)?.trim()??"no output"}var Yc=require("node:fs/promises"),Ld=require("node:path"),rQ=require("node:crypto");var bCe=/(^|\/)(detail|details|internal|impl|private|priv|test|tests|examples?|demos?|sketch(es)?|dev|sandbox|tools?|scripts?|fuzz|contrib|bench|benchmarks?|docs?|third[_-]?party|extern(al)?|deps?)(\/|$)/i,vCe=/(^|\/)(_|.*[-_](inl|impl|internal|private|guts)\.)|(^|\/)[\w-]*guts\.h$/i,wCe=/\.(h|hpp|hh|hxx|h\+\+|inl|tpp)$/i,kCe=/(^|_)(VERSION|VERNUM|VER)(_?(MAJOR|MINOR|PATCH|REVISION|SUBREVISION|BUILD|STRING|NUM|TEXT|CODE))?$/i,_Ce=["include/","inc/","src/",""];function EM(e){let t=$Ce(e);return e.map(n=>({path:n.slice(t.length),original:n})).filter(n=>wCe.test(n.path)).filter(n=>!bCe.test(n.path)).filter(n=>!vCe.test(n.path)).filter(n=>_Ce.some(r=>n.path.startsWith(r)))}function $Ce(e){let t=e[0];if(!t)return"";let n=t.indexOf("/");if(n===-1)return"";let r=t.slice(0,n+1);return e.every(i=>i.startsWith(r))?r:""}function TM(e){let t=new Map;for(let n of e)for(let r of V5(n.content)){let i=t.get(r.name);i&&i.members.length>=r.members.length||t.set(r.name,r)}return t}function V5(e){let t=[],r=GCe(e).split(` +`),i=0,o=[],s=null,a=!1,c=()=>{for(;o.length>0&&i<=o.at(-1).depth;)o.pop()},l=(u,d)=>{for(let p=u;p<=d&&pSCe.test(S))&&s===null?s=i:b&&o.push({path:w?[]:b.split("::").filter(Boolean),depth:i,inline:w});let k=p.indexOf("{"),$=k>=0?p.slice(k+1).replace(/}\s*;?\s*$/,"").trim():"";if($&&s===null&&!a){let S=B5($,o.flatMap(E=>E.path));S&&t.push(S)}l(u,u);continue}if(s!==null||a){l(u,u);continue}let m=ICe(p);if(m){t.push(m),l(u,u);continue}let g=ACe(r,u,o.flatMap(b=>b.path));if(g){t.push(g.entry),l(u,g.endLine),u=g.endLine;continue}let h=zCe(r,u);if(!h){l(u,u);continue}let v=B5(h.text,o.flatMap(b=>b.path));v&&t.push(v),l(u,h.endLine),u=h.endLine}return t}var SCe=/^(detail|details|internal|impl|private|_\w+)$/i,xCe=/^\w*BEGIN_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE\b/,ECe=/^\w*(END_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE|BEGIN_PUBLIC_NAMESPACE)\b/;function TCe(e){let t=0;for(let n of e)n==="{"?t++:n==="}"&&t--;return t}function ICe(e){let t=/^#\s*define\s+(\w+)\s*(\([^)]*\))?\s*(.*)$/.exec(e);if(!t)return null;let n=t[1];if(/^_+|_H(_|PP)?$|_INCLUDED$|_GUARD$/i.test(n)||kCe.test(n))return null;let r=t[2]??"",i=t[3]?.trim()??"";return{name:n,kind:r?"function":"variable",signature:fs(`#define ${n}${r}${i?` ${i}`:""}`),members:[],requiredMembers:[]}}function ACe(e,t,n){let r=e[t].trim(),i=/^(?:typedef\s+)?(?:template\s*<[^>]*>\s*)?(struct|class|union|enum)(?:\s+class|\s+struct)?\s+(?:\w+_(?:API|EXPORT)\s+)?(\w+)?\s*(?::[^{]*)?\s*\{/.exec(r);if(!i)return null;let o=i[1],s=0,a=t,c=[];for(let f=t;ft&&c.push(m),s<=0&&f>=t){a=f;break}a=f}let l=e[a],u=/\}\s*(\w+)\s*;/.exec(l),d=i[2]??u?.[1];if(!d)return null;let p=zh(n,d);return{entry:{name:p,kind:RCe(o),signature:fs(`${o} ${p}`),...PCe(c.join(` +`),o),requiredMembers:[]},endLine:a}}function RCe(e){return e==="enum"?"enum":e==="class"?"class":"interface"}function PCe(e,t){if(t==="enum")return{members:[...new Set(e.replace(/\{|\}[^}]*$/g,"").split(",").map(s=>/^\s*(\w+)/.exec(s)?.[1]).filter(s=>!!s))]};let n=[],r={},i=t!=="class",o=0;for(let s of e.split(` +`)){let a=s.trim(),c=/^(public|private|protected)\s*:/.exec(a);if(c){i=c[1]==="public";continue}let l=o;for(let f of a)f==="{"?o++:f==="}"&&o--;if(l>0||!i)continue;let u=IM(a);if(u){n.push(u.identity),r[u.identity]=u.signature;continue}let d=/(\w+)\s*\([^)]*\)\s*(?:const\s*)?(?:noexcept\s*)?[;{=]/.exec(a);if(d?.[1]&&!Gh.has(d[1])){n.push(d[1]);continue}if(d?.[1])continue;let p=/^[\w:<>,\s*&[\]]+?(\w+)\s*(?:\[[^\]]*\]\s*)?(?:=\s*[^;]+)?;/.exec(a);p?.[1]&&!Gh.has(p[1])&&!BCe.test(p[1])&&n.push(p[1])}return{members:[...new Set(n)],memberSignatures:r}}function CCe(e){return IM(e)?.identity??null}function IM(e){let t=e.search(/\boperator\b/);if(t<0)return null;let n=e.slice(t+8).trimStart(),r=OCe(n);if(!r)return null;let i=r.end;for(;/\s/.test(n[i]??"");)i++;if(n[i]!=="(")return null;let o=q5(n,i);if(!o)return null;let s=MCe(n.slice(o.end+1)),a=r.conversion?`operator ${r.name}`:/^[A-Za-z]/.test(r.name)?`operator ${r.name}(${E$(o.content)})`:`operator${r.name}(${E$(o.content)})`,c=NCe(e.slice(0,t)),l=`${a}${s}`,u=`${c?`${c} `:""}operator ${r.name}(${E$(o.content)})${s}`;return{identity:l,signature:u}}function NCe(e){return fs(e).replace(/\b(?:extern|static|inline|virtual|friend|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall)\b/g,"").replace(/\s+/g," ").trim()}var DCe=["<=>","->*","<<=",">>=","new[]","delete[]","()","[]","->","<<",">>","==","!=","<=",">=","&&","||","++","--","+=","-=","*=","/=","%=","^=","&=","|=","co_await","new","delete","+","-","*","/","%","^","&","|","~","!","=","<",">",","];function OCe(e){let t=/^""\s*([A-Za-z_]\w*)/.exec(e);if(t)return{name:`""${t[1]}`,end:t[0].length,conversion:!1};for(let r of DCe){let o=(r==="new[]"?/^new\s*\[\]/:r==="delete[]"?/^delete\s*\[\]/:null)?.exec(e)?.[0]??(e.startsWith(r)?r:null);if(o&&!(/^[A-Za-z_]/.test(r)&&/[A-Za-z0-9_]/.test(e[o.length]??"")))return{name:r,end:o.length,conversion:!1}}let n=0;for(let r=0;r"&&n>0)n--;else if(i==="("&&n===0){let o=fs(e.slice(0,r));return o?{name:o,end:r,conversion:!0}:null}}return null}function q5(e,t){let n=0;for(let r=t;r=0){let s=i+8;for(;/\s/.test(t[s]??"");)s++;if(t[s]==="("){let a=q5(t,s);n.push(a?`noexcept(${fs(a.content)})`:"noexcept")}else n.push("noexcept")}let o=/\brequires\s+(.+?)(?=\s*(?:;|\{|$))/.exec(t)?.[1];return o&&n.push(`requires ${fs(o)}`),n.length>0?` ${n.join(" ")}`:""}function B5(e,t=[]){let n=e.trim().replace(/^(?:\[\[[^\]]*\]\]\s*)+/,"").replace(/\s+/g," ");if(!n||n.startsWith("#"))return null;let r=/^typedef\s+(.+?)\s*;$/.exec(n);if(r){let l=/\(\s*\*\s*(\w+)\s*\)/.exec(r[1])?.[1]??/(\w+)\s*(?:\[[^\]]*\])?$/.exec(r[1])?.[1];return!l||Gh.has(l)?null:{name:zh(t,l),kind:"type",signature:fs(n),members:[],requiredMembers:[]}}let i=LCe(n);if(CCe(n)){let c=IM(n);return{name:zh(t,c.identity),kind:"function",signature:c.signature,members:[],requiredMembers:[]}}let s=/^((?:const\s+|unsigned\s+|signed\s+|struct\s+|enum\s+|class\s+)*[\w:]+(?:\s*<[^>]*>)?[\s*&]+)(\w+)\s*\(([^)]*)\)\s*(const)?\s*(?:noexcept)?\s*[;{]$/.exec(i);if(s){let c=fs(s[1]),l=s[2];return Gh.has(l)?null:{name:zh(t,l),kind:"function",signature:`${c} ${l}(${E$(s[3])})${s[4]?" const":""}`,members:[],requiredMembers:[]}}let a=/^extern\s+((?:const\s+)?[\w:]+[\s*&]+)(\w+)\s*(?:\[[^\]]*\])?\s*;$/.exec(n);if(a){let c=a[2];return Gh.has(c)?null:{name:zh(t,c),kind:"variable",signature:fs(n.replace(/;$/,"")),members:[],requiredMembers:[]}}return null}function LCe(e){let t=e;for(;;){let n=/^(?:extern|static|inline|constexpr|virtual|explicit|friend|EXTERN_C|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall|__forceinline|__inline__|__restrict__|__host__|__device__|[A-Za-z_]\w*_(?:API|EXPORT))\s+/.exec(t);if(n){t=t.slice(n[0].length);continue}let r=/^(?:__declspec|__attribute__)\s*/.exec(t);if(!r)return t;let i=r[0].length;if(t[i]!=="(")return t;let o=0;for(;i{let i=n.split("=")[0].trim().replace(/\s*\[[^\]]*\]\s*$/,"");if(i.split(/(?<=[\s*&])/).length<2)return i;let s=/\b(\w+)\s*$/.exec(i)?.[1];if(s&&FCe.has(s))return i;let a=i.match(/\b\w+\b/g)??[];return a.length===2&&jCe.has(a[0])?i:i.replace(/\b\w+\s*$/,"").trim()||i}).join(", ")}var FCe=new Set(["void","bool","char","wchar_t","char8_t","char16_t","char32_t","short","int","long","float","double","signed","unsigned","const","volatile"]),jCe=new Set(["struct","class","enum","union","const","volatile","signed","unsigned","short","long"]);function UCe(e){let t=[],n=0,r="";for(let i of e){if(i==="<"||i==="("||i==="["?n++:(i===">"||i===")"||i==="]")&&n--,i===","&&n===0){t.push(r),r="";continue}r+=i}return r.trim()&&t.push(r),t}function zCe(e,t){let n="";for(let r=t;rqCe(e,t)}}var K5=AM("arduino"),J5=AM("conan"),Z5=AM("vcpkg");async function qCe(e,t){let n=VCe[e];if(!n)return oe(Zc,"unsupported-ecosystem",`No source resolver for ${e}.`);let r=W5(e,n,t,t.from),i=W5(e,n,t,t.to);i.catch(()=>{});let o=await r;if(!o.ok)return o.failure;let s=await i;return s.ok?o.api.size===0&&s.api.size===0?oe(Zc,"no-public-surface",`No declarations could be read from ${t.name}'s headers in either version. A library whose API is generated by macros, or shipped as a prebuilt binary, has no header text to compare.`):{available:!0,changes:Cr(o.api,s.api),tool:Zc,weight:H5,locator:`${t.name} ${t.from} \u2192 ${t.to} (public headers)`}:s.failure}async function W5(e,t,n,r){let i=await t(n.name,r);if(!i)return{ok:!1,failure:oe(Zc,"version-unavailable",`No source archive is published for ${n.name} ${r} in ${WCe(e)}, so its headers could not be read.`)};let o;try{let s=await qt(i,{timeoutMs:n.timeoutMs});if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");if(!s.ok)return{ok:!1,failure:oe(Zc,"version-unavailable",`${i} returned ${s.status}.`)};let a=Ln(s.bytes),c=new Map(a.map(l=>[l.path,l]));o=EM([...c.keys()]).map(l=>({path:l.path,content:c.get(l.original).read().toString("utf8")})).filter(l=>l.content.length>0)}catch(s){return{ok:!1,failure:oe(Zc,"artifact-unavailable",`Could not read ${n.name} ${r} from ${i}: ${s.message}`)}}return n.logger.debug(`${n.name} ${r}: ${o.length} public header(s)`),{ok:!0,api:TM(o)}}function WCe(e){return e==="conan"?"ConanCenter":e==="vcpkg"?"the vcpkg registry":"the Arduino Library Manager"}async function HCe(e,t){let n=await s_(e),r=n?.archives[t];if(r)return r;let i=n?.githubRepo??await KCe(e);return i?RM(i,t):null}async function KCe(e){return(await Wn(e,"arduino",null))?.githubRepo??null}async function JCe(e,t){let n=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,r=await nt(`${n}/config.yml`);if(!r)return null;let i=Y5(r,t)??ZCe(r);if(!i)return null;let o=await nt(`${n}/${i}/conandata.yml`);if(!o)return null;let s=Q5(o,t);if(s)return s;let a=YCe(o);return a?RM(a,t):null}function ZCe(e){return/folder\s*:\s*["']?([^"'\s]+)["']?/.exec(e)?.[1]??null}function YCe(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=jt(t[0]);if(n)return n}return null}async function RM(e,t){let r=(await xe(`https://api.github.com/repos/${e}/tags?per_page=100`)??[]).map(i=>i.name).find(i=>!!i&&Od(i,t));return r?`https://codeload.github.com/${e}/tar.gz/refs/tags/${encodeURIComponent(r)}`:null}function Y5(e,t){let n=e.split(` +`),r=null;for(let i of n){let o=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(i.replace(/\s+$/,""));if(o){r=o[1].trim();continue}let s=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(i);if(s&&r===t)return s[1]}return null}function Q5(e,t){let n=e.split(` +`),r=!1,i=!1;for(let o of n){let s=o.replace(/\s+$/,"");if(!s.trim())continue;if(/^sources\s*:/.test(s)){r=!0;continue}if(!/^\s/.test(s)){r=!1,i=!1;continue}if(!r)continue;let a=/^ {2}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){i=a[1].trim()===t;continue}if(!i)continue;let c=/https?:\/\/\S+/.exec(s);if(c&&!c[0].endsWith(".git"))return c[0].replace(/["',]+$/,"")}return null}async function QCe(e,t){let n=await xe(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`),r=jt(n?.homepage??null);return r?RM(r,t):null}function Od(e,t){let n=r=>r.replace(/^[^\d]*/,"").replace(/_/g,".");return e===t||n(e)===n(t)}var Fn="python ast",XCe="Install Python 3 and make `python3` available on PATH.",X5=.9,eNe=.6,iQ={ecosystem:"pypi",tool:Fn,weight:X5,async compute(e){if(!await h_(e.exec,"python3",["--version"]))return oe(Fn,"tool-missing",`Python 3 is not installed, so ${e.name}'s public symbols could not be compared.`,XCe);await(0,Yc.mkdir)(e.workdir,{recursive:!0});let t=(0,Ld.join)(e.workdir,"surface.py");await(0,Yc.writeFile)(t,sQ,"utf8");let n=`${dNe}/${await pNe(e)}`,r=Date.now()+e.timeoutMs,i=eQ(e,e.from,t,n,r),o=eQ(e,e.to,t,n,r);o.catch(()=>{});let s=await i;if(!s.ok)return s.failure;let a=await o;if(!a.ok)return a.failure;let c=s.usedGitHubFallback||a.usedGitHubFallback,l=c?"; source: GitHub tag mirror, PyPI archive was unreadable":"";return{available:!0,changes:Cr(s.api,a.api),tool:Fn,weight:c?eNe:X5,locator:`${e.name} ${e.from} \u2192 ${e.to} (public symbols, best-effort${l})`}}};function wi(e){return Math.max(0,e-Date.now())}var Md=new Map;async function eQ(e,t,n,r,i){let o=`python-surface:${r}:${e.name}@${t}`;for(;;){let s=wi(i);if(s<=0)return{ok:!1,failure:oe(Fn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let a=Md.get(o);if(a){let l=await _$(a.promise,s);if(l.timedOut)return{ok:!1,failure:oe(Fn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};if(!l.value.ok&&l.value.budgetExhausted){Md.get(o)===a&&Md.delete(o);continue}return l.value}let c=(async()=>{let l=await Ia(o);if(l)return{ok:!0,api:new Map(l),usedGitHubFallback:!1};let u=await tNe(e,t,n,i);return u.ok?(u.usedGitHubFallback||await Aa(o,[...u.api]),u):wi(i)<=0?{...u,budgetExhausted:!0}:u})();return Md.set(o,{promise:c}),c.catch(()=>{}).then(()=>{Md.get(o)?.promise===c&&Md.delete(o)}),c}}async function tNe(e,t,n,r){if(wi(r)<=0)return{ok:!1,failure:oe(Fn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let i=await lNe(e.name,t,wi(r));if(!i)return{ok:!1,failure:oe(Fn,"version-unavailable",`PyPI has no source archive for ${e.name} ${t}. It may be private, yanked, or published only as a built wheel Drift cannot open.`)};let o=(0,Ld.join)(e.workdir,`probe-${t.replace(/[^\w.-]/g,"_")}`),s,a=!1;try{await(0,Yc.mkdir)(o,{recursive:!0});let d=await qt(i.url,{timeoutMs:wi(r),retries:2});if(d.ok)s=d.bytes;else{let p=wi(r)>0?await oNe(e.name,t,r):null;if(!p)return d.status===0?{ok:!1,failure:oe(Fn,"toolchain-failed",`Could not download ${i.url}: ${d.error??"the request did not complete"}`)}:{ok:!1,failure:oe(Fn,"version-unavailable",`PyPI returned ${d.status} for ${i.url}.`)};s=p,a=!0}}catch(d){return{ok:!1,failure:oe(Fn,"toolchain-failed",`Could not download ${i.url}: ${d.message}`)}}let c=0;try{let d=Ln(s),p=d,f="";if(a){let m=cNe(d.map(h=>h.path),e.name);if(!m)return{ok:!1,failure:oe(Fn,"no-public-surface",`Could not confidently identify ${e.name}'s own source directory inside its GitHub repository, so the fallback was declined rather than comparing the whole repository.`)};let g=`${m}/`;p=d.filter(h=>h.path.startsWith(g)),f=m.slice(0,m.lastIndexOf("/")+1)}for(let m of p){let g=rNe(f?m.path.slice(f.length):m.path);if(!g)continue;let h=(0,Ld.join)(o,g);await(0,Yc.mkdir)((0,Ld.dirname)(h),{recursive:!0}),await(0,Yc.writeFile)(h,m.read()),c+=1}}catch(d){return{ok:!1,failure:oe(Fn,"toolchain-failed",`Could not unpack ${i.filename}: ${tQ(d.message)}`)}}if(c===0)return{ok:!1,failure:oe(Fn,"no-public-surface",`${e.name} ${t} ships no Python sources Drift could read.`)};if(wi(r)<=0)return{ok:!1,failure:oe(Fn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t}'s source could be parsed.`)};let l=await e.exec("python3",[n,o,e.name],{timeoutMs:wi(r)});if(l.code!==0)return{ok:!1,failure:oe(Fn,"parse-failed",`Could not read ${e.name} ${t}'s public symbols: ${tQ(l.stderr)}`)};let u=oQ(l.stdout);return u?u.size===0?{ok:!1,failure:oe(Fn,"no-public-surface",`${e.name} ${t} declares no public symbols Drift could read statically.`)}:{ok:!0,api:u,usedGitHubFallback:a}:{ok:!1,failure:oe(Fn,"parse-failed",`Unreadable symbol listing for ${e.name} ${t}.`)}}var nNe=new Set(["test","tests",".git","__pycache__"]);function rNe(e){let t=e.split("/").filter(s=>s!==""&&s!==".");if(t.length===0||t.some(s=>s==="..")||e.startsWith("/")||/^[a-zA-Z]:/.test(e)||t.slice(0,-1).some(s=>nNe.has(s)))return null;let n=t.at(-1),r=n.endsWith(".py")||n.endsWith(".pyi"),i=["pyproject.toml","setup.cfg","setup.py"].includes(n),o=n==="top_level.txt"&&t.some(s=>s.endsWith(".dist-info")||s.endsWith(".egg-info"));return!r&&!i&&!o?null:t.join("/")}var iNe=25*1024*1024;async function oNe(e,t,n){let r=await Wn(e,"pypi",t);if(!r?.githubRepo||wi(n)<=0)return null;let i=await xe(`https://api.github.com/repos/${r.githubRepo}/tags?per_page=100`,{timeoutMs:wi(n)}),o=sNe(i??[],e,t);if(!o||wi(n)<=0)return null;let a=i?.find(l=>l.name===o)?.commit?.sha??`refs/tags/${o}`,c=await qt(`https://codeload.github.com/${r.githubRepo}/tar.gz/${a}`,{timeoutMs:wi(n),retries:2,maxBytes:iNe});return c.ok?c.bytes:null}function sNe(e,t,n){let r=e.filter(a=>!!a.name&&Od(a.name,n)),i=t.toLowerCase().replace(/[_.]/g,"-"),o=new RegExp(`(^|[^a-z0-9])${aNe(i)}([^a-z0-9]|$)`),s=r.filter(a=>o.test(a.name.toLowerCase().replace(/[_.]/g,"-")));return s.length===1?s[0].name:s.length>1?null:r.length===1?r[0].name:null}function aNe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cNe(e,t){let n=t.toLowerCase().replace(/[-.]+/g,"_"),r=new Set;for(let i of e){let o=i.split("/").filter(s=>s!=="");for(let s=0;sc.packagetype==="sdist"),s=i.find(c=>c.packagetype==="bdist_wheel"),a=o??s;return a?{url:a.url,filename:a.filename}:null}var uNe={function:"function",class:"class",variable:"variable",unknown:"unknown"};function oQ(e){let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t))return null;let n=new Map;for(let r of t)if(r?.name){if(r.shapeUnknown){n.set(r.name,{name:r.name,kind:"unknown",signature:r.name,members:[],requiredMembers:[],shapeUnknown:!0});continue}n.set(r.name,{name:r.name,kind:uNe[r.kind]??"variable",signature:r.signature??r.name,members:r.members??[],requiredMembers:[],...Array.isArray(r.callable)?{callable:{parameters:r.callable}}:{}})}return n}var sQ=`import ast, json, os, re, sys def public(name): return not name.startswith('_') or (name.startswith('__') and name.endswith('__')) @@ -1391,23 +1369,23 @@ for module, entry in index.items(): symbols[key] = emitted json.dump(sorted(symbols.values(), key=lambda s: s['name']), sys.stdout) -`;function l9(e){return e.split(` -`).find(t=>t.trim().length>0)?.trim()??"no output"}var iNe=(0,d9.createHash)("sha256").update(m9).digest("hex").slice(0,12),u9=null;function oNe(e){return u9??=e.exec("python3",["--version"],{timeoutMs:2e4}).then(t=>(t.stdout||t.stderr).trim().replace(/\s+/g,"-")||"unknown").catch(()=>"unknown"),u9}var E9=require("node:crypto");MO();var np="assembly metadata",_9=1,T9={ecosystem:"nuget",tool:np,weight:_9,async compute(e){let t=S9(e,e.from),n=S9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.role!=="managed-library"||r.role!=="managed-library"?{available:!0,changes:ENe(i,r),tool:"NuGet package contract",weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (NuGet package roles: ${i.role} \u2192 ${r.role})`,packageRole:r.role}:{available:!0,changes:Dr(i.api,r.api),tool:np,weight:_9,locator:`${e.name} ${e.from} \u2192 ${e.to} (${i.framework} assembly metadata)`,packageRole:"managed-library"}:r.failure}};async function S9(e,t){let n=e.name.toLowerCase(),i=t.toLowerCase(),r=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(n)}/${encodeURIComponent(i)}/${encodeURIComponent(n)}.${encodeURIComponent(i)}.nupkg`,o;try{let u=await Bt(r,{timeoutMs:e.timeoutMs});if(!u.ok&&u.status===0)throw new Error(u.error??"the request failed");if(!u.ok)return{ok:!1,failure:ne(np,u.status===404?"version-unavailable":"artifact-unavailable",u.status===404?`NuGet has no package for ${e.name} ${t}. It may be unlisted, delisted, or published to a private feed.`:`NuGet returned ${u.status} for ${e.name} ${t}.`)};o=Fn(u.bytes)}catch(u){return{ok:!1,failure:ne(np,"artifact-unavailable",`Could not read ${e.name} ${t} from NuGet: ${u.message}`)}}let s=SNe(o);if(s!=="managed-library")return s==="unsupported"?{ok:!1,failure:{...ne("NuGet package contract","artifact-type-unsupported",`${e.name} ${t} contains no managed library, analyzer, MSBuild, tool, or dependency-only contract Drift can classify.`),packageRole:s}}:{ok:!0,role:s,contract:xNe(o,s),framework:s};let a=I9(o.map(u=>u.path));if(!a)return{ok:!1,failure:ne(np,"parse-failed",`${e.name} ${t} was classified as a managed library, but no readable assembly could be selected under lib/ or ref/.`)};let c=o.find(u=>u.path===a.path),l=s_(c.read());return l?{ok:!0,role:s,contract:new Map,api:TNe(l),framework:a.framework}:{ok:!1,failure:ne(np,"parse-failed",`${a.path} in ${e.name} ${t} is not a managed assembly Drift could read.`)}}function SNe(e){let t=e.map(i=>i.path.replaceAll("\\","/").toLowerCase());if(I9(t))return"managed-library";if(t.some(i=>i.startsWith("analyzers/")))return"analyzer";if(t.some(i=>i.startsWith("build/")||i.startsWith("buildtransitive/")))return"msbuild";if(t.some(i=>i.startsWith("tools/")))return"tool";let n=e.find(i=>i.path.toLowerCase().endsWith(".nuspec"));return n&&/<(?:dependency|group)\b/i.test(n.read().toString("utf8"))?"meta-package":"unsupported"}function xNe(e,t){let n=new Map;if(t==="meta-package"){let r=e.find(s=>s.path.toLowerCase().endsWith(".nuspec"));if(!r)return n;let o=r.read().toString("utf8");for(let s of o.matchAll(/]*)\/?\s*>/gi)){let a=Object.fromEntries([...s[1].matchAll(/([\w.-]+)\s*=\s*["']([^"']*)["']/g)].map(c=>[c[1].toLowerCase(),c[2]]));a.id&&n.set(`dependency:${a.id}`,[a.version,a.include,a.exclude].filter(Boolean).join("|"))}return n}let i=t==="analyzer"?["analyzers/"]:t==="msbuild"?["build/","buildtransitive/"]:["tools/"];for(let r of e){let o=r.path.replaceAll("\\","/").toLowerCase();i.some(s=>o.startsWith(s))&&n.set(o,(0,E9.createHash)("sha256").update(r.read()).digest("hex"))}return n}function ENe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"nuget:package-role",detail:`The NuGet package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[i,r]of e.contract){let o=`nuget:${e.role}:${i}`;t.contract.has(i)?t.contract.get(i)!==r&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${i} changed in the NuGet package.`,before:r,after:t.contract.get(i)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${i} was removed from the NuGet package.`,before:r})}return n}function TNe(e){let t=new Map;for(let n of e)t.set(n.fullName,{name:n.fullName,kind:n.kind==="struct"||n.kind==="delegate"?"type":n.kind,signature:`${n.kind} ${n.fullName}`,members:[...n.members,...n.signatures],requiredMembers:[]});return t}function I9(e){let t=e.map(r=>{let o=/^(lib|ref)\/([^/]+)\/([^/]+\.dll)$/i.exec(r);if(!o)return null;let s=o[3];return/\.resources\.dll$/i.test(s)?null:{path:r,area:o[1].toLowerCase(),framework:o[2].toLowerCase(),name:s}}).filter(r=>r!==null);if(t.length===0)return null;let i=[...t].sort((r,o)=>{if(r.area!==o.area)return r.area==="ref"?-1:1;let s=x9(o.framework)-x9(r.framework);return s!==0?s:r.name.length-o.name.length||r.name.localeCompare(o.name)})[0];return{path:i.path,framework:i.framework}}function x9(e){if(e.startsWith("netstandard2.0"))return 1e3;if(e.startsWith("netstandard"))return 900;let t=/^net(\d+)\.(\d+)/.exec(e);if(t)return 500+Number(t[1])*10+Number(t[2]);let n=/^net(\d+)$/.exec(e);return n?100+Number(n[1]):0}var C9=require("node:crypto"),P9=gt(gc(),1);var Eh="pub source",A9=.8,D9={ecosystem:"pub",tool:Eh,weight:A9,async compute(e){let t=R9(e,e.from),n=R9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.role!=="code"||r.role!=="code"?{available:!0,changes:RNe(i,r),tool:"pub package contract",weight:.8,locator:`${e.name} ${e.from} \u2192 ${e.to} (published Pub roles: ${i.role} \u2192 ${r.role})`,packageRole:r.role}:i.api.size===0&&r.api.size===0?ne(Eh,"no-public-surface",`${e.name} publishes no public Dart library Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Dr(i.api,r.api),tool:Eh,weight:A9,locator:`${e.name} ${e.from} \u2192 ${e.to} (published lib/)`,packageRole:"code"}:r.failure}};async function R9(e,t){let n=`https://pub.dev/api/archives/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar.gz`,i;try{let o=await Bt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:ne(Eh,o.status===404?"version-unavailable":"artifact-unavailable",o.status===404?`pub.dev has no archive for ${e.name} ${t}. It may be retracted, or published to a private pub server.`:`pub.dev returned ${o.status} for ${e.name} ${t}.`)};i=Fn(o.bytes)}catch(o){return{ok:!1,failure:ne(Eh,"artifact-unavailable",`Could not read ${e.name} ${t} from pub.dev: ${o.message}`)}}let r=INe(i);return r==="unsupported"?{ok:!1,failure:{...ne("pub package contract","artifact-type-unsupported",`${e.name} ${t} contains no Dart library, declared asset/font contract, or executable tooling Drift can classify.`),packageRole:r}}:r==="code"?{ok:!0,role:r,contract:new Map,api:M9(i)}:{ok:!0,role:r,contract:ANe(i,r)}}function INe(e){let t=FO(e).map(({path:a})=>a);if(t.some(a=>/^lib\/.+\.dart$/i.test(a)))return"code";let n=O9(e);if(Pa(n?.executables)&&Object.keys(n.executables).length>0||t.some(a=>/^bin\/.+\.dart$/i.test(a)))return"tooling";let r=Pa(n?.flutter)?n.flutter:void 0,o=Array.isArray(r?.assets)&&r.assets.length>0,s=Array.isArray(r?.fonts)&&r.fonts.length>0;return o||s?"asset":"unsupported"}function ANe(e,t){let n=FO(e),i=new Map,r=O9(e);if(t==="tooling"){if(Pa(r?.executables))for(let[c,l]of Object.entries(r.executables).sort(([u],[d])=>u.localeCompare(d)))i.set(`executable:${c}`,typeof l=="string"?l:"");return N9(i,n.filter(({path:c})=>/^bin\/.+\.dart$/i.test(c))),i}let o=Pa(r?.flutter)?r.flutter:void 0,s=[...Array.isArray(o?.assets)?o.assets:[],...Array.isArray(o?.fonts)?o.fonts:[]];i.set("pubspec:flutter-assets-and-fonts",LO(s));let a=NNe(s);return N9(i,n.filter(({path:c})=>a.some(l=>c===l||c.startsWith(`${l}/`)))),i}function RNe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"pub:package-role",detail:`The Pub package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[i,r]of e.contract){let o=`pub:${e.role}:${i}`;t.contract.has(i)?t.contract.get(i)!==r&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${i} changed in the Pub package.`,before:r,after:t.contract.get(i)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${i} was removed from the Pub package.`,before:r})}return n}function FO(e){let t=e.some(n=>/^(?:lib|bin|assets?)\//i.test(n.path)||/^pubspec\.ya?ml$/i.test(n.path));return e.map(n=>({path:(t?n.path:n.path.replace(/^[^/]+\//,"")).replaceAll("\\","/").replace(/\/$/,""),entry:n}))}function O9(e){let t=FO(e).find(({path:n})=>/^pubspec\.ya?ml$/i.test(n));if(t)try{let n=(0,P9.parse)(t.entry.read().toString("utf8"));return Pa(n)?n:void 0}catch{return}}function NNe(e){let t=new Set;for(let n of e){if(typeof n=="string"&&t.add(n.replace(/^\.\//,"").replace(/\/$/,"")),!Pa(n))continue;let i=Array.isArray(n.fonts)?n.fonts:[];for(let r of i)Pa(r)&&typeof r.asset=="string"&&t.add(r.asset.replace(/^\.\//,""))}return[...t].filter(Boolean)}function N9(e,t){for(let{path:n,entry:i}of[...t].sort((r,o)=>r.path.localeCompare(o.path)))e.set(`file:${n}`,(0,C9.createHash)("sha256").update(i.read()).digest("hex"))}function LO(e){return Array.isArray(e)?`[${e.map(LO).join(",")}]`:Pa(e)?`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${LO(e[t])}`).join(",")}}`:JSON.stringify(e)??"null"}function Pa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function M9(e){let t=e.some(s=>s.path.startsWith("lib/")),n=new Map;for(let s of e){let a=t?s.path:s.path.replace(/^[^/]+\//,"");a.startsWith("lib/")&&a.endsWith(".dart")&&n.set(a,s)}let i=new Map,r=new Set,o=[...n.keys()].filter(s=>!s.startsWith("lib/src/"));for(;o.length>0;){let s=o.shift();if(r.has(s))continue;r.add(s);let a=n.get(s);if(!a)continue;let c;try{c=a.read().toString("utf8")}catch{continue}for(let l of L9(c))i.has(l.name)||i.set(l.name,l);for(let l of CNe(c)){let u=PNe(s,l);u&&n.has(u)&&o.push(u)}}return i}function CNe(e){let t=[];for(let n of e.matchAll(/^\s*export\s+['"]([^'"]+)['"]/gm)){let i=n[1];i.startsWith("package:")||i.startsWith("dart:")||t.push(i)}return t}function PNe(e,t){let n=[...e.split("/").slice(0,-1),...t.split("/")],i=[];for(let r of n)if(!(r===""||r===".")){if(r===".."){if(i.length===0)return;i.pop();continue}i.push(r)}return i.join("/")}function L9(e){let t=[],n=ONe(e).split(` -`);for(let i=0;i,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(([^)]*)\)\s*(?:async\s*\*?|sync\s*\*)?\s*[{=;]/.exec(r);if(a?.[1]&&!a[1].startsWith("_")&&!F9.has(a[1])){t.push({name:a[1],kind:"function",signature:a_(r),members:[],requiredMembers:[]});continue}let c=/^(?:const|final|var|late\s+final|late\s+var)\s+(?:[\w$<>,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*=/.exec(r);c?.[1]&&!c[1].startsWith("_")&&t.push({name:c[1],kind:"variable",signature:a_(r),members:[],requiredMembers:[]})}return t}function DNe(e,t){let n=[],i;for(let r=t+1;r,\s?[\]]+\s+)?(?:get\s+|set\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*[({=;]/.exec(o);a?.[1]&&!a[1].startsWith("_")&&!F9.has(a[1])&&n.push(a[1])}return[...new Set(n)]}var F9=new Set(["if","for","while","switch","catch","return","assert","super","this","new","await","yield","throw","else","do","try","case","with","is","as","in","on","of","when","get","set","factory","operator","part","import","export","library","typedef","class","enum","mixin","extension","const","final","var","void","late","required","covariant","abstract","static","external"]);function ONe(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").split(` +`;function tQ(e){return e.split(` +`).find(t=>t.trim().length>0)?.trim()??"no output"}var dNe=(0,rQ.createHash)("sha256").update(sQ).digest("hex").slice(0,12),nQ=null;function pNe(e){return nQ??=e.exec("python3",["--version"],{timeoutMs:2e4}).then(t=>(t.stdout||t.stderr).trim().replace(/\s+/g,"-")||"unknown").catch(()=>"unknown"),nQ}var bQ=require("node:crypto");NM();var Fd="assembly metadata",gQ=1,vQ={ecosystem:"nuget",tool:Fd,weight:gQ,async compute(e){let t=hQ(e,e.from),n=hQ(e,e.to);n.catch(()=>{});let r=await t;if(!r.ok)return r.failure;let i=await n;return i.ok?r.role!=="managed-library"||i.role!=="managed-library"?{available:!0,changes:NNe(r,i),tool:"NuGet package contract",weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (NuGet package roles: ${r.role} \u2192 ${i.role})`,packageRole:i.role}:{available:!0,changes:Cr(r.api,i.api),tool:Fd,weight:gQ,locator:`${e.name} ${e.from} \u2192 ${e.to} (${r.framework} assembly metadata)`,packageRole:"managed-library"}:i.failure}};async function hQ(e,t){let n=e.name.toLowerCase(),r=t.toLowerCase(),i=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(n)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}.${encodeURIComponent(r)}.nupkg`,o;try{let u=await qt(i,{timeoutMs:e.timeoutMs});if(!u.ok&&u.status===0)throw new Error(u.error??"the request failed");if(!u.ok)return{ok:!1,failure:oe(Fd,u.status===404?"version-unavailable":"artifact-unavailable",u.status===404?`NuGet has no package for ${e.name} ${t}. It may be unlisted, delisted, or published to a private feed.`:`NuGet returned ${u.status} for ${e.name} ${t}.`)};o=Ln(u.bytes)}catch(u){return{ok:!1,failure:oe(Fd,"artifact-unavailable",`Could not read ${e.name} ${t} from NuGet: ${u.message}`)}}let s=PNe(o);if(s!=="managed-library")return s==="unsupported"?{ok:!1,failure:{...oe("NuGet package contract","artifact-type-unsupported",`${e.name} ${t} contains no managed library, analyzer, MSBuild, tool, or dependency-only contract Drift can classify.`),packageRole:s}}:{ok:!0,role:s,contract:CNe(o,s),framework:s};let a=wQ(o.map(u=>u.path));if(!a)return{ok:!1,failure:oe(Fd,"parse-failed",`${e.name} ${t} was classified as a managed library, but no readable assembly could be selected under lib/ or ref/.`)};let c=o.find(u=>u.path===a.path),l=T$(c.read());return l?{ok:!0,role:s,contract:new Map,api:DNe(l),framework:a.framework}:{ok:!1,failure:oe(Fd,"parse-failed",`${a.path} in ${e.name} ${t} is not a managed assembly Drift could read.`)}}function PNe(e){let t=e.map(r=>r.path.replaceAll("\\","/").toLowerCase());if(wQ(t))return"managed-library";if(t.some(r=>r.startsWith("analyzers/")))return"analyzer";if(t.some(r=>r.startsWith("build/")||r.startsWith("buildtransitive/")))return"msbuild";if(t.some(r=>r.startsWith("tools/")))return"tool";let n=e.find(r=>r.path.toLowerCase().endsWith(".nuspec"));return n&&/<(?:dependency|group)\b/i.test(n.read().toString("utf8"))?"meta-package":"unsupported"}function CNe(e,t){let n=new Map;if(t==="meta-package"){let i=e.find(s=>s.path.toLowerCase().endsWith(".nuspec"));if(!i)return n;let o=i.read().toString("utf8");for(let s of o.matchAll(/]*)\/?\s*>/gi)){let a=Object.fromEntries([...s[1].matchAll(/([\w.-]+)\s*=\s*["']([^"']*)["']/g)].map(c=>[c[1].toLowerCase(),c[2]]));a.id&&n.set(`dependency:${a.id}`,[a.version,a.include,a.exclude].filter(Boolean).join("|"))}return n}let r=t==="analyzer"?["analyzers/"]:t==="msbuild"?["build/","buildtransitive/"]:["tools/"];for(let i of e){let o=i.path.replaceAll("\\","/").toLowerCase();r.some(s=>o.startsWith(s))&&n.set(o,(0,bQ.createHash)("sha256").update(i.read()).digest("hex"))}return n}function NNe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"nuget:package-role",detail:`The NuGet package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[r,i]of e.contract){let o=`nuget:${e.role}:${r}`;t.contract.has(r)?t.contract.get(r)!==i&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${r} changed in the NuGet package.`,before:i,after:t.contract.get(r)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${r} was removed from the NuGet package.`,before:i})}return n}function DNe(e){let t=new Map;for(let n of e)t.set(n.fullName,{name:n.fullName,kind:n.kind==="struct"||n.kind==="delegate"?"type":n.kind,signature:`${n.kind} ${n.fullName}`,members:[...n.members,...n.signatures],requiredMembers:[]});return t}function wQ(e){let t=e.map(i=>{let o=/^(lib|ref)\/([^/]+)\/([^/]+\.dll)$/i.exec(i);if(!o)return null;let s=o[3];return/\.resources\.dll$/i.test(s)?null:{path:i,area:o[1].toLowerCase(),framework:o[2].toLowerCase(),name:s}}).filter(i=>i!==null);if(t.length===0)return null;let r=[...t].sort((i,o)=>{if(i.area!==o.area)return i.area==="ref"?-1:1;let s=yQ(o.framework)-yQ(i.framework);return s!==0?s:i.name.length-o.name.length||i.name.localeCompare(o.name)})[0];return{path:r.path,framework:r.framework}}function yQ(e){if(e.startsWith("netstandard2.0"))return 1e3;if(e.startsWith("netstandard"))return 900;let t=/^net(\d+)\.(\d+)/.exec(e);if(t)return 500+Number(t[1])*10+Number(t[2]);let n=/^net(\d+)$/.exec(e);return n?100+Number(n[1]):0}var SQ=require("node:crypto"),xQ=gt(rc(),1);var Bh="pub source",kQ=.8,EQ={ecosystem:"pub",tool:Bh,weight:kQ,async compute(e){let t=_Q(e,e.from),n=_Q(e,e.to);n.catch(()=>{});let r=await t;if(!r.ok)return r.failure;let i=await n;return i.ok?r.role!=="code"||i.role!=="code"?{available:!0,changes:LNe(r,i),tool:"pub package contract",weight:.8,locator:`${e.name} ${e.from} \u2192 ${e.to} (published Pub roles: ${r.role} \u2192 ${i.role})`,packageRole:i.role}:r.api.size===0&&i.api.size===0?oe(Bh,"no-public-surface",`${e.name} publishes no public Dart library Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Cr(r.api,i.api),tool:Bh,weight:kQ,locator:`${e.name} ${e.from} \u2192 ${e.to} (published lib/)`,packageRole:"code"}:i.failure}};async function _Q(e,t){let n=`https://pub.dev/api/archives/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar.gz`,r;try{let o=await qt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:oe(Bh,o.status===404?"version-unavailable":"artifact-unavailable",o.status===404?`pub.dev has no archive for ${e.name} ${t}. It may be retracted, or published to a private pub server.`:`pub.dev returned ${o.status} for ${e.name} ${t}.`)};r=Ln(o.bytes)}catch(o){return{ok:!1,failure:oe(Bh,"artifact-unavailable",`Could not read ${e.name} ${t} from pub.dev: ${o.message}`)}}let i=ONe(r);return i==="unsupported"?{ok:!1,failure:{...oe("pub package contract","artifact-type-unsupported",`${e.name} ${t} contains no Dart library, declared asset/font contract, or executable tooling Drift can classify.`),packageRole:i}}:i==="code"?{ok:!0,role:i,contract:new Map,api:IQ(r)}:{ok:!0,role:i,contract:MNe(r,i)}}function ONe(e){let t=OM(e).map(({path:a})=>a);if(t.some(a=>/^lib\/.+\.dart$/i.test(a)))return"code";let n=TQ(e);if(Ra(n?.executables)&&Object.keys(n.executables).length>0||t.some(a=>/^bin\/.+\.dart$/i.test(a)))return"tooling";let i=Ra(n?.flutter)?n.flutter:void 0,o=Array.isArray(i?.assets)&&i.assets.length>0,s=Array.isArray(i?.fonts)&&i.fonts.length>0;return o||s?"asset":"unsupported"}function MNe(e,t){let n=OM(e),r=new Map,i=TQ(e);if(t==="tooling"){if(Ra(i?.executables))for(let[c,l]of Object.entries(i.executables).sort(([u],[d])=>u.localeCompare(d)))r.set(`executable:${c}`,typeof l=="string"?l:"");return $Q(r,n.filter(({path:c})=>/^bin\/.+\.dart$/i.test(c))),r}let o=Ra(i?.flutter)?i.flutter:void 0,s=[...Array.isArray(o?.assets)?o.assets:[],...Array.isArray(o?.fonts)?o.fonts:[]];r.set("pubspec:flutter-assets-and-fonts",DM(s));let a=FNe(s);return $Q(r,n.filter(({path:c})=>a.some(l=>c===l||c.startsWith(`${l}/`)))),r}function LNe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"pub:package-role",detail:`The Pub package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[r,i]of e.contract){let o=`pub:${e.role}:${r}`;t.contract.has(r)?t.contract.get(r)!==i&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${r} changed in the Pub package.`,before:i,after:t.contract.get(r)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${r} was removed from the Pub package.`,before:i})}return n}function OM(e){let t=e.some(n=>/^(?:lib|bin|assets?)\//i.test(n.path)||/^pubspec\.ya?ml$/i.test(n.path));return e.map(n=>({path:(t?n.path:n.path.replace(/^[^/]+\//,"")).replaceAll("\\","/").replace(/\/$/,""),entry:n}))}function TQ(e){let t=OM(e).find(({path:n})=>/^pubspec\.ya?ml$/i.test(n));if(t)try{let n=(0,xQ.parse)(t.entry.read().toString("utf8"));return Ra(n)?n:void 0}catch{return}}function FNe(e){let t=new Set;for(let n of e){if(typeof n=="string"&&t.add(n.replace(/^\.\//,"").replace(/\/$/,"")),!Ra(n))continue;let r=Array.isArray(n.fonts)?n.fonts:[];for(let i of r)Ra(i)&&typeof i.asset=="string"&&t.add(i.asset.replace(/^\.\//,""))}return[...t].filter(Boolean)}function $Q(e,t){for(let{path:n,entry:r}of[...t].sort((i,o)=>i.path.localeCompare(o.path)))e.set(`file:${n}`,(0,SQ.createHash)("sha256").update(r.read()).digest("hex"))}function DM(e){return Array.isArray(e)?`[${e.map(DM).join(",")}]`:Ra(e)?`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${DM(e[t])}`).join(",")}}`:JSON.stringify(e)??"null"}function Ra(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function IQ(e){let t=e.some(s=>s.path.startsWith("lib/")),n=new Map;for(let s of e){let a=t?s.path:s.path.replace(/^[^/]+\//,"");a.startsWith("lib/")&&a.endsWith(".dart")&&n.set(a,s)}let r=new Map,i=new Set,o=[...n.keys()].filter(s=>!s.startsWith("lib/src/"));for(;o.length>0;){let s=o.shift();if(i.has(s))continue;i.add(s);let a=n.get(s);if(!a)continue;let c;try{c=a.read().toString("utf8")}catch{continue}for(let l of AQ(c))r.has(l.name)||r.set(l.name,l);for(let l of jNe(c)){let u=UNe(s,l);u&&n.has(u)&&o.push(u)}}return r}function jNe(e){let t=[];for(let n of e.matchAll(/^\s*export\s+['"]([^'"]+)['"]/gm)){let r=n[1];r.startsWith("package:")||r.startsWith("dart:")||t.push(r)}return t}function UNe(e,t){let n=[...e.split("/").slice(0,-1),...t.split("/")],r=[];for(let i of n)if(!(i===""||i===".")){if(i===".."){if(r.length===0)return;r.pop();continue}r.push(i)}return r.join("/")}function AQ(e){let t=[],n=GNe(e).split(` +`);for(let r=0;r,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(([^)]*)\)\s*(?:async\s*\*?|sync\s*\*)?\s*[{=;]/.exec(i);if(a?.[1]&&!a[1].startsWith("_")&&!RQ.has(a[1])){t.push({name:a[1],kind:"function",signature:I$(i),members:[],requiredMembers:[]});continue}let c=/^(?:const|final|var|late\s+final|late\s+var)\s+(?:[\w$<>,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*=/.exec(i);c?.[1]&&!c[1].startsWith("_")&&t.push({name:c[1],kind:"variable",signature:I$(i),members:[],requiredMembers:[]})}return t}function zNe(e,t){let n=[],r;for(let i=t+1;i,\s?[\]]+\s+)?(?:get\s+|set\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*[({=;]/.exec(o);a?.[1]&&!a[1].startsWith("_")&&!RQ.has(a[1])&&n.push(a[1])}return[...new Set(n)]}var RQ=new Set(["if","for","while","switch","catch","return","assert","super","this","new","await","yield","throw","else","do","try","case","with","is","as","in","on","of","when","get","set","factory","operator","part","import","export","library","typedef","class","enum","mixin","extension","const","final","var","void","late","required","covariant","abstract","static","external"]);function GNe(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").split(` `).map(t=>/^\s*\/\//.test(t)?"":t).join(` -`)}function a_(e){return e.replace(/\s+/g," ").replace(/\s*[{=;]\s*$/,"").trim()}var ul="hex sources",U9=.8,G9={ecosystem:"hex",tool:ul,weight:U9,async compute(e){let t=j9(e,e.from),n=j9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.api.size===0&&r.api.size===0?ne(ul,"no-public-surface",`${e.name} ships no Elixir or Erlang source Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Dr(i.api,r.api),tool:ul,weight:U9,locator:`${e.name} ${e.from} \u2192 ${e.to} (published sources)`}:r.failure}};async function j9(e,t){let n=`https://repo.hex.pm/tarballs/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar`,i;try{let o=await Bt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:ne(ul,"version-unavailable",o.status===404?`Hex has no release for ${e.name} ${t}. It may have been retired, or published to a private repository.`:`Hex returned ${o.status} for ${e.name} ${t}.`)};i=Fn(o.bytes)}catch(o){return{ok:!1,failure:ne(ul,"toolchain-failed",`Could not read ${e.name} ${t} from Hex: ${o.message}`)}}let r=i.find(o=>o.path==="contents.tar.gz"||o.path.endsWith("/contents.tar.gz"));if(!r)return{ok:!1,failure:ne(ul,"parse-failed",`${e.name} ${t} is not in the layout Hex tarballs use, so Drift could not read its sources.`)};try{return{ok:!0,api:V9(Fn(r.read()))}}catch(o){return{ok:!1,failure:ne(ul,"parse-failed",`Could not unpack ${e.name} ${t}: ${o.message}`)}}}function V9(e){let t=new Map;for(let n of e){if(!/^(lib|src)\//.test(n.path))continue;let i;try{i=n.read().toString("utf8")}catch{continue}if(/\.ex$/.test(n.path)){for(let[r,o]of B9(i))z9(t,r,o,`defmodule ${r}`);continue}if(/\.erl$/.test(n.path)){let r=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(i)?.[1];r&&z9(t,r,q9(i),`-module(${r})`)}}return t}function z9(e,t,n,i){let r=e.get(t);if(r){r.members=[...new Set([...r.members,...n])];return}e.set(t,{name:t,kind:"class",signature:i,members:n,requiredMembers:[]})}function B9(e){let t=new Map,n=[],i=e.split(` -`),r=!1,o=(s,a)=>{for(;n.length>0&&n[n.length-1].indent>=s;)n.pop();n.push({indent:s,name:a})};for(let s=0;s0&&n[n.length-1].indent>=m;)n.pop();let g=n[n.length-1]?.name,h=g?`${g}.${l[2]}`:l[2];o(m,h),t.has(h)||t.set(h,[]);continue}let u=/^(\s*)defimpl\s+/.exec(a);if(u){o(u[1].length,null);continue}let d=/^(\s*)(?:def|defmacro|defguard|defdelegate)\s+([a-z_][\w]*[!?]?)\s*(\(|,|\s+when\b|\s+do\b|\s*$)/.exec(a);if(!d)continue;let p=d[1].length;for(;n.length>0&&n[n.length-1].indent>=p;)n.pop();let f=n[n.length-1]?.name;if(f)for(let m of MNe(i,s,d[3]==="("))t.get(f)?.push(`${d[2]}/${m}`)}for(let[s,a]of t)t.set(s,[...new Set(a)]);return t}function MNe(e,t,n){if(!n)return[0];let i=e[t].indexOf("("),r="",o=0,s=!1;e:for(let u=t;u=1&&(r+=f)}r+=" "}if(!s)return[0];let a=LNe(r);if(a.length===0)return[0];let c=a.filter(u=>!u.includes("\\\\")).length,l=a.length;return Array.from({length:l-c+1},(u,d)=>c+d)}function LNe(e){let t=e.trim();if(t==="")return[];let n=[],i=0,r="";for(let o of t){if(o==="("||o==="["||o==="{"||o==="<"?i+=1:(o===")"||o==="]"||o==="}"||o===">")&&(i-=1),o===","&&i===0){n.push(r),r="";continue}r+=o}return n.push(r),n.map(o=>o.trim()).filter(o=>o!=="")}function q9(e){let t=[];for(let n of e.matchAll(/-export\(\s*\[([\s\S]*?)\]\s*\)/g))for(let i of n[1].split(",")){let r=/([a-z_][\w]*)\s*\/\s*(\d+)/.exec(i);r&&t.push(`${r[1]}/${r[2]}`)}return[...new Set(t)]}var FNe=[dY,IY,HY,p9,r9,i9,n9,T9,D9,G9];function UNe(e){return FNe.find(t=>t.ecosystem===e)}var jNe=18e4;async function K9(e,t){let n=UNe(e.ecosystem);if(!n)return ne("none","unsupported-ecosystem",`Drift has no computed API-surface diff for ${e.ecosystem}; this upgrade rests on prose evidence alone.`);if(!e.from||!e.to)return ne(n.tool,"version-unavailable",`${e.name} has no pair of versions to compare.`);let i=await(0,c_.mkdtemp)((0,H9.join)((0,W9.tmpdir)(),"drift-surface-"));try{return await En("surface",e.name,()=>n.compute({name:e.name,from:e.from,to:e.to,exec:t.exec??Xe,workdir:i,logger:t.logger,...t.env?{env:t.env}:{},timeoutMs:t.timeoutMs??jNe,...t.readRepoFile?{readRepoFile:t.readRepoFile}:{},...e.manifestPath?{manifestPath:e.manifestPath}:{},...t.autoInstall?{autoInstall:!0}:{}}),{ecosystem:e.ecosystem})}catch(r){return t.logger.debug(`Surface diff crashed for ${e.name}: ${r.message}`),ne(n.tool,"toolchain-failed",`Drift could not compare ${e.name}: ${r.message}`)}finally{await(0,c_.rm)(i,{recursive:!0,force:!0}).catch(()=>{})}}var X9=require("node:fs/promises"),e5=require("node:path"),_i={"type-surface-diff":1,...u8,"migration-guide":.8,"github-release":.7,changelog:.65,"registry-metadata":.4,"semver-heuristic":.25};async function t5(e,t){let n=await qn(e,4,r=>n5(r,t)),i=await KNe(t);return[...n.flat(),...i]}async function n5(e,t){let{config:n,logger:i}=t,r=[],o=y=>e.workspace===void 0?y:y.map(w=>({...w,workspace:e.workspace})),s=QNe(e);if(s&&r.push({id:St("ev",e.name,"semver",e.from,e.to),source:"semver-heuristic",dependency:e.name,url:YNe(e),title:`${e.name} ${e.from} \u2192 ${e.to} (${e.bump})`,content:s,weight:_i["semver-heuristic"]}),!e.from||!e.to)return o(r);let a=ca(e.name,e.ecosystem,e.from).catch(()=>null),c=await Wn(e.name,e.ecosystem,e.to),[l,u]=await Promise.all([a,ca(e.name,e.ecosystem,e.to).catch(()=>null)]);c?.deprecated&&r.push({id:St("ev",e.name,"deprecated",e.to),source:"registry-metadata",dependency:e.name,url:c.homepage??void 0,title:`${e.name}@${e.to} is deprecated`,content:c.deprecated,weight:_i["registry-metadata"]});let d=zNe(l?.runtime??null,u?.runtime??null);d&&r.push({id:St("ev",e.name,"runtime-metadata",e.to,d.runtime,d.requirement),source:"registry-metadata",dependency:e.name,url:c?.homepage??void 0,title:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}`,content:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}.`,weight:_i["registry-metadata"]});let p=c?.githubRepo,f=n.evidence.typeSurface?VNe(e,t):null,m=p&&n.evidence.githubReleases?_K(p,e.from,e.to,e.ecosystem,{token:t.githubToken,maxReleases:n.evidence.maxReleases}):null,g=n.evidence.changelog&&(c?.changelogUrl||p)?(async()=>{if(c?.changelogUrl){let y=await vK(c.changelogUrl,p??null,e.from,e.to,e.ecosystem);if(y.length>0)return y}return p?bK(p,e.from,e.to,e.ecosystem):[]})():null,h=p&&n.evidence.changelog?kK(p):null;for(let y of[f,m,g,h])y?.catch(()=>{});let b=f?await f:null;if(b&&r.push(b),!p&&!g)return i.debug(`No source repository or declared changelog resolved for ${e.name}; prose evidence unavailable`),o(r);if(m){let y=await m;for(let w of y){let k=Fg(w.body);t.onProseConsulted?.(e,{kind:"github-release",label:`${w.name??w.tag} release notes`,url:w.url,breaking:k.length>0}),k.length!==0&&r.push({id:St("ev",e.name,"release",w.tag),source:"github-release",dependency:e.name,url:w.url,title:`${e.name} ${w.name??w.tag} release notes`,content:k.join(` +`)}function I$(e){return e.replace(/\s+/g," ").replace(/\s*[{=;]\s*$/,"").trim()}var Qc="hex sources",PQ=.8,DQ={ecosystem:"hex",tool:Qc,weight:PQ,async compute(e){let t=CQ(e,e.from),n=CQ(e,e.to);n.catch(()=>{});let r=await t;if(!r.ok)return r.failure;let i=await n;return i.ok?r.api.size===0&&i.api.size===0?oe(Qc,"no-public-surface",`${e.name} ships no Elixir or Erlang source Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Cr(r.api,i.api),tool:Qc,weight:PQ,locator:`${e.name} ${e.from} \u2192 ${e.to} (published sources)`}:i.failure}};async function CQ(e,t){let n=`https://repo.hex.pm/tarballs/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar`,r;try{let o=await qt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:oe(Qc,"version-unavailable",o.status===404?`Hex has no release for ${e.name} ${t}. It may have been retired, or published to a private repository.`:`Hex returned ${o.status} for ${e.name} ${t}.`)};r=Ln(o.bytes)}catch(o){return{ok:!1,failure:oe(Qc,"toolchain-failed",`Could not read ${e.name} ${t} from Hex: ${o.message}`)}}let i=r.find(o=>o.path==="contents.tar.gz"||o.path.endsWith("/contents.tar.gz"));if(!i)return{ok:!1,failure:oe(Qc,"parse-failed",`${e.name} ${t} is not in the layout Hex tarballs use, so Drift could not read its sources.`)};try{return{ok:!0,api:OQ(Ln(i.read()))}}catch(o){return{ok:!1,failure:oe(Qc,"parse-failed",`Could not unpack ${e.name} ${t}: ${o.message}`)}}}function OQ(e){let t=new Map;for(let n of e){if(!/^(lib|src)\//.test(n.path))continue;let r;try{r=n.read().toString("utf8")}catch{continue}if(/\.ex$/.test(n.path)){for(let[i,o]of MQ(r))NQ(t,i,o,`defmodule ${i}`);continue}if(/\.erl$/.test(n.path)){let i=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(r)?.[1];i&&NQ(t,i,LQ(r),`-module(${i})`)}}return t}function NQ(e,t,n,r){let i=e.get(t);if(i){i.members=[...new Set([...i.members,...n])];return}e.set(t,{name:t,kind:"class",signature:r,members:n,requiredMembers:[]})}function MQ(e){let t=new Map,n=[],r=e.split(` +`),i=!1,o=(s,a)=>{for(;n.length>0&&n[n.length-1].indent>=s;)n.pop();n.push({indent:s,name:a})};for(let s=0;s0&&n[n.length-1].indent>=m;)n.pop();let g=n[n.length-1]?.name,h=g?`${g}.${l[2]}`:l[2];o(m,h),t.has(h)||t.set(h,[]);continue}let u=/^(\s*)defimpl\s+/.exec(a);if(u){o(u[1].length,null);continue}let d=/^(\s*)(?:def|defmacro|defguard|defdelegate)\s+([a-z_][\w]*[!?]?)\s*(\(|,|\s+when\b|\s+do\b|\s*$)/.exec(a);if(!d)continue;let p=d[1].length;for(;n.length>0&&n[n.length-1].indent>=p;)n.pop();let f=n[n.length-1]?.name;if(f)for(let m of BNe(r,s,d[3]==="("))t.get(f)?.push(`${d[2]}/${m}`)}for(let[s,a]of t)t.set(s,[...new Set(a)]);return t}function BNe(e,t,n){if(!n)return[0];let r=e[t].indexOf("("),i="",o=0,s=!1;e:for(let u=t;u=1&&(i+=f)}i+=" "}if(!s)return[0];let a=VNe(i);if(a.length===0)return[0];let c=a.filter(u=>!u.includes("\\\\")).length,l=a.length;return Array.from({length:l-c+1},(u,d)=>c+d)}function VNe(e){let t=e.trim();if(t==="")return[];let n=[],r=0,i="";for(let o of t){if(o==="("||o==="["||o==="{"||o==="<"?r+=1:(o===")"||o==="]"||o==="}"||o===">")&&(r-=1),o===","&&r===0){n.push(i),i="";continue}i+=o}return n.push(i),n.map(o=>o.trim()).filter(o=>o!=="")}function LQ(e){let t=[];for(let n of e.matchAll(/-export\(\s*\[([\s\S]*?)\]\s*\)/g))for(let r of n[1].split(",")){let i=/([a-z_][\w]*)\s*\/\s*(\d+)/.exec(r);i&&t.push(`${i[1]}/${i[2]}`)}return[...new Set(t)]}var qNe=[r5,w5,j5,iQ,J5,Z5,K5,vQ,EQ,DQ];function WNe(e){return qNe.find(t=>t.ecosystem===e)}var HNe=18e4;async function UQ(e,t){let n=WNe(e.ecosystem);if(!n)return oe("none","unsupported-ecosystem",`Drift has no computed API-surface diff for ${e.ecosystem}; this upgrade rests on prose evidence alone.`);if(!e.from||!e.to)return oe(n.tool,"version-unavailable",`${e.name} has no pair of versions to compare.`);let r=await(0,A$.mkdtemp)((0,jQ.join)((0,FQ.tmpdir)(),"drift-surface-"));try{return await xn("surface",e.name,()=>n.compute({name:e.name,from:e.from,to:e.to,exec:t.exec??Qe,workdir:r,logger:t.logger,...t.env?{env:t.env}:{},timeoutMs:t.timeoutMs??HNe,...t.readRepoFile?{readRepoFile:t.readRepoFile}:{},...e.manifestPath?{manifestPath:e.manifestPath}:{},...t.autoInstall?{autoInstall:!0}:{}}),{ecosystem:e.ecosystem})}catch(i){return t.logger.debug(`Surface diff crashed for ${e.name}: ${i.message}`),oe(n.tool,"toolchain-failed",`Drift could not compare ${e.name}: ${i.message}`)}finally{await(0,A$.rm)(r,{recursive:!0,force:!0}).catch(()=>{})}}var qQ=require("node:fs/promises"),WQ=require("node:path"),_i={"type-surface-diff":1,...n9,"migration-guide":.8,"github-release":.7,changelog:.65,"registry-metadata":.4,"semver-heuristic":.25};async function HQ(e,t){let n=await qn(e,4,i=>KQ(i,t)),r=await tDe(t);return[...n.flat(),...r]}async function KQ(e,t){let{config:n,logger:r}=t,i=[],o=b=>e.workspace===void 0?b:b.map(w=>({...w,workspace:e.workspace})),s=oDe(e);if(s&&i.push({id:xt("ev",e.name,"semver",e.from,e.to),source:"semver-heuristic",dependency:e.name,url:iDe(e),title:`${e.name} ${e.from} \u2192 ${e.to} (${e.bump})`,content:s,weight:_i["semver-heuristic"]}),!e.from||!e.to)return o(i);let a=oa(e.name,e.ecosystem,e.from).catch(()=>null),c=await Wn(e.name,e.ecosystem,e.to),[l,u]=await Promise.all([a,oa(e.name,e.ecosystem,e.to).catch(()=>null)]);c?.deprecated&&i.push({id:xt("ev",e.name,"deprecated",e.to),source:"registry-metadata",dependency:e.name,url:c.homepage??void 0,title:`${e.name}@${e.to} is deprecated`,content:c.deprecated,weight:_i["registry-metadata"]});let d=KNe(l?.runtime??null,u?.runtime??null);d&&i.push({id:xt("ev",e.name,"runtime-metadata",e.to,d.runtime,d.requirement),source:"registry-metadata",dependency:e.name,url:c?.homepage??void 0,title:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}`,content:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}.`,weight:_i["registry-metadata"]});let p=c?.githubRepo,f=n.evidence.typeSurface?ZNe(e,t):null,m=p&&n.evidence.githubReleases?gZ(p,e.from,e.to,e.ecosystem,{token:t.githubToken,maxReleases:n.evidence.maxReleases}):null,g=n.evidence.changelog&&(c?.changelogUrl||p)?(async()=>{if(c?.changelogUrl){let b=await dZ(c.changelogUrl,p??null,e.from,e.to,e.ecosystem);if(b.length>0)return b}return p?uZ(p,e.from,e.to,e.ecosystem):[]})():null,h=p&&n.evidence.changelog?fZ(p):null;for(let b of[f,m,g,h])b?.catch(()=>{});let v=f?await f:null;if(v&&i.push(v),!p&&!g)return r.debug(`No source repository or declared changelog resolved for ${e.name}; prose evidence unavailable`),o(i);if(m){let b=await m;for(let w of b){let k=th(w.body);t.onProseConsulted?.(e,{kind:"github-release",label:`${w.name??w.tag} release notes`,url:w.url,breaking:k.length>0}),k.length!==0&&i.push({id:xt("ev",e.name,"release",w.tag),source:"github-release",dependency:e.name,url:w.url,title:`${e.name} ${w.name??w.tag} release notes`,content:k.join(` -`),weight:_i["github-release"]})}}if(g){let y=await g;for(let w of y){let k=DP(PP(w.content,e.ecosystem),e.from,e.to,e.ecosystem),_=k.some(S=>Fg(S.body).length>0);t.onProseConsulted?.(e,{kind:"changelog",label:w.path,url:w.url,breaking:_});for(let S of k){let x=Fg(S.body);x.length!==0&&r.push({id:St("ev",e.name,"changelog",w.path,S.version),source:"changelog",dependency:e.name,url:`${w.url}#L${S.line}`,locator:`${w.path}:${S.line}`,title:`${e.name} CHANGELOG \xA7 ${S.version}`,content:x.join(` +`),weight:_i["github-release"]})}}if(g){let b=await g;for(let w of b){let k=PD(RD(w.content,e.ecosystem),e.from,e.to,e.ecosystem),$=k.some(S=>th(S.body).length>0);t.onProseConsulted?.(e,{kind:"changelog",label:w.path,url:w.url,breaking:$});for(let S of k){let E=th(S.body);E.length!==0&&i.push({id:xt("ev",e.name,"changelog",w.path,S.version),source:"changelog",dependency:e.name,url:`${w.url}#L${S.line}`,locator:`${w.path}:${S.line}`,title:`${e.name} CHANGELOG \xA7 ${S.version}`,content:E.join(` -`),weight:_i.changelog})}}}if(h)for(let y of await h){let w=Fg(y.content);t.onProseConsulted?.(e,{kind:"migration-guide",label:y.path,url:y.url,breaking:w.length>0}),w.length!==0&&r.push({id:St("ev",e.name,"migration",y.path),source:"migration-guide",dependency:e.name,url:y.url,locator:y.path,title:`${e.name} migration guide (${y.path})`,content:w.slice(0,200).join(` +`),weight:_i.changelog})}}}if(h)for(let b of await h){let w=th(b.content);t.onProseConsulted?.(e,{kind:"migration-guide",label:b.path,url:b.url,breaking:w.length>0}),w.length!==0&&i.push({id:xt("ev",e.name,"migration",b.path),source:"migration-guide",dependency:e.name,url:b.url,locator:b.path,title:`${e.name} migration guide (${b.path})`,content:w.slice(0,200).join(` -`),weight:_i["migration-guide"]})}return o(r)}async function UO(e,t){return n5(e,t)}var J9={node:"Node.js","node.js":"Node.js",nodejs:"Node.js",python:"Python",go:"Go",ruby:"Ruby",java:"Java",rust:"Rust"};function zNe(e,t){if(!t?.requirement)return null;let n=J9[t.name.toLowerCase()];if(!n)return null;let i=t.requirement.trim();if(!i)return null;if(!(e&&J9[e.name.toLowerCase()]===n))return{runtime:n,requirement:i};let o=c=>{let l=/(\d+(?:\.\d+)*)/.exec(c)?.[1];return l?l.split(".").map(u=>Number(u)):null},[s,a]=[o(e.requirement),o(i)];if(!s||!a)return null;for(let c=0;cu)return{runtime:n,requirement:i};if(l(n.debug(`Package module metadata diff failed for ${e.name}: ${l.message}`),[])),WNe(e.name,i,r,n)]);if(!a)return s.length>0?(t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, though its package.json changed between versions \u2014 that metadata-level change is counted below, but nothing about its public API could be verified.`)),Th(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:$i(e.name,r,"package.json"),beforeUrl:$i(e.name,i,"package.json"),afterUrl:$i(e.name,r,"package.json")})):(t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, so this upgrade rests on prose evidence.`)),null);if(a.comparisonFailed){let l=`Comparing ${e.name}'s TypeScript declarations failed unexpectedly (${a.comparisonFailed}). This does not mean ${e.name} publishes no declarations.`;return s.length>0?(t.onUnavailableSurface?.(e,ne("TypeScript declarations","toolchain-failed",l)),Th(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:$i(e.name,r,"package.json"),beforeUrl:$i(e.name,i,"package.json"),afterUrl:$i(e.name,r,"package.json")})):(t.onUnavailableSurface?.(e,ne("TypeScript declarations","toolchain-failed",l)),null)}if(a.artifactUnavailable){let l=`${a.artifactUnavailable} could not be obtained and inspected from either jsDelivr or the exact npm registry tarball. This is an artifact availability failure, not proof that the package publishes no declarations.`;return t.onUnavailableSurface?.(e,ne("TypeScript declarations","artifact-unavailable",l)),s.length>0?Th(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:$i(e.name,r,"package.json"),beforeUrl:$i(e.name,i,"package.json"),afterUrl:$i(e.name,r,"package.json")}):null}if(a.unreachable)return t.onUnavailableSurface?.(e,ne("TypeScript declarations","version-unavailable",`${a.unreachable} could not be fetched, so nothing was compared. That version may have been unpublished, or the CDN may not carry it.`)),null;if(a.definitelyTyped)return t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} ships no declarations of its own; its types live in @types/${e.name.replace(/^@/,"").replace("/","__")}, which versions separately and does not move with this upgrade. Nothing was compared.`)),null;let c=[...s,...a.changes];return c.length===0?(a.comparable?t.onSurfaceComputed?.(e,{available:!0,changes:[],tool:"jsdelivr-dts-diff",weight:_i["type-surface-diff"],locator:`${e.name}@${i}:${a.beforeEntryPath} \u2192 ${e.name}@${r}:${a.afterEntryPath}`}):t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name}'s public API is neither in its own declarations nor in any dependency Drift could follow, so comparing its declarations proves nothing about this upgrade.`)),null):Th(e,{changes:c,weight:GNe(a)?_i["type-surface-diff"]*.9:_i["type-surface-diff"],locator:`${e.name}@${i}:${a.beforeEntryPath} + package.json \u2192 ${e.name}@${r}:${a.afterEntryPath} + package.json`,url:$i(e.name,r,a.afterEntryPath),beforeUrl:$i(e.name,i,a.beforeEntryPath),afterUrl:$i(e.name,r,a.afterEntryPath)})}let o=await K9(e,{logger:n,exec:t.exec,env:t.env,readRepoFile:BNe(t),autoInstall:t.config.tools.autoInstall});return o.available?(t.onSurfaceComputed?.(e,o),o.changes.length===0?null:Th(e,{changes:o.changes,weight:o.weight,locator:`${o.locator} \xB7 computed by ${o.tool}`,...o.packageRole?{packageRole:o.packageRole}:{}})):(n.debug(`No computed surface for ${e.name}: ${o.detail}`),t.onUnavailableSurface?.(e,o),null)}function BNe(e){let{workspaceRoot:t,readRepoFile:n,afterSha:i}=e;if(t)return async r=>(0,X9.readFile)((0,e5.join)(t,r),"utf8").catch(()=>null);if(n&&i)return r=>n(r,i).catch(()=>null)}function Th(e,t){let n=t.beforeUrl||t.afterUrl?["Declaration sources:",t.beforeUrl?`- before: ${t.beforeUrl}`:"",t.afterUrl?`- after: ${t.afterUrl}`:"",""].filter(Boolean).join(` -`):"";return{id:St("ev",e.name,"surface",e.from??"",e.to??""),source:"type-surface-diff",dependency:e.name,url:t.url,locator:t.locator,title:`${t.changes.length} ${qNe(t.packageRole)} change(s) in ${e.name}`,content:`${n}${HNe(t.changes)}`,findings:t.changes.map(i=>({code:i.kind,symbol:i.symbol,detail:i.detail,before:i.before,after:i.after,...i.changed?{changed:i.changed}:{},...i.replacement?{replacement:i.replacement}:{},...i.fromKind?{fromKind:i.fromKind}:{},...i.toKind?{toKind:i.toKind}:{},...i.moduleSystem?{moduleSystem:{...i.moduleSystem,incompatibleUsage:[...i.moduleSystem.incompatibleUsage],...i.moduleSystem.affectedSpecifiers?{affectedSpecifiers:[...i.moduleSystem.affectedSpecifiers]}:{},...i.moduleSystem.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...i.moduleSystem.affectedSpecifierPatterns]}:{}}}:{}})),weight:t.weight}}function qNe(e){switch(e){case"pom":return"Maven POM contract";case"analyzer":case"msbuild":case"tool":case"meta-package":return"NuGet package contract";case"asset":case"tooling":return"Pub package contract";default:return"API surface"}}var Z9=3;async function WNe(e,t,n,i){try{let[r,o]=await Promise.all([tl(e,t),tl(e,n)]);if(!r||!o)return null;(r.viaDependencies.length>0||o.viaDependencies.length>0)&&i.debug(`${e} surface includes ${[...new Set([...r.viaDependencies,...o.viaDependencies])].join(", ")}`);let s=Q8(e,r,o),a=Dr(r.api,o.api,{beforeComplete:!r.incomplete,afterComplete:!o.incomplete,packageName:e}),c=r.entryPath.startsWith("@types:")&&o.entryPath.startsWith("@types:")&&r.entryPath===o.entryPath;return{changes:s?[s,...a]:a,comparable:r.api.size>=Z9&&o.api.size>=Z9,beforeEntryPath:r.entryPath,afterEntryPath:o.entryPath,...c?{definitelyTyped:c}:{}}}catch(r){return i.debug(`Type surface diff failed for ${e}: ${r.message}`),r instanceof Y$?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",unreachable:`${r.packageName}@${r.version}`}:r instanceof Kd?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",artifactUnavailable:`${r.packageName}@${r.version}`}:{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",comparisonFailed:r.message}}}function $i(e,t,n){if(!(!n||n.startsWith("@types:")))return`https://cdn.jsdelivr.net/npm/${e}@${t}/${n}`}function Y9(e){return XNe(e.replace(/\s+/g," ").trim(),4e3)}function HNe(e){let n=e.slice(0,60).map(i=>{let r=[`- ${i.detail}`];return i.before&&i.after&&(r.push(` before: ${Y9(i.before)}`),r.push(` after: ${Y9(i.after)}`)),r.join(` +`),weight:_i["migration-guide"]})}return o(i)}async function MM(e,t){return KQ(e,t)}var zQ={node:"Node.js","node.js":"Node.js",nodejs:"Node.js",python:"Python",go:"Go",ruby:"Ruby",java:"Java",rust:"Rust"};function KNe(e,t){if(!t?.requirement)return null;let n=zQ[t.name.toLowerCase()];if(!n)return null;let r=t.requirement.trim();if(!r)return null;if(!(e&&zQ[e.name.toLowerCase()]===n))return{runtime:n,requirement:r};let o=c=>{let l=/(\d+(?:\.\d+)*)/.exec(c)?.[1];return l?l.split(".").map(u=>Number(u)):null},[s,a]=[o(e.requirement),o(r)];if(!s||!a)return null;for(let c=0;cu)return{runtime:n,requirement:r};if(l(n.debug(`Package module metadata diff failed for ${e.name}: ${l.message}`),[])),XNe(e.name,r,i,n)]);if(!a)return s.length>0?(t.onUnavailableSurface?.(e,oe("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, though its package.json changed between versions \u2014 that metadata-level change is counted below, but nothing about its public API could be verified.`)),Vh(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${r}:package.json \u2192 ${e.name}@${i}:package.json`,url:ki(e.name,i,"package.json"),beforeUrl:ki(e.name,r,"package.json"),afterUrl:ki(e.name,i,"package.json")})):(t.onUnavailableSurface?.(e,oe("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, so this upgrade rests on prose evidence.`)),null);if(a.comparisonFailed){let l=`Comparing ${e.name}'s TypeScript declarations failed unexpectedly (${a.comparisonFailed}). This does not mean ${e.name} publishes no declarations.`;return s.length>0?(t.onUnavailableSurface?.(e,oe("TypeScript declarations","toolchain-failed",l)),Vh(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${r}:package.json \u2192 ${e.name}@${i}:package.json`,url:ki(e.name,i,"package.json"),beforeUrl:ki(e.name,r,"package.json"),afterUrl:ki(e.name,i,"package.json")})):(t.onUnavailableSurface?.(e,oe("TypeScript declarations","toolchain-failed",l)),null)}if(a.artifactUnavailable){let l=`${a.artifactUnavailable} could not be obtained and inspected from either jsDelivr or the exact npm registry tarball. This is an artifact availability failure, not proof that the package publishes no declarations.`;return t.onUnavailableSurface?.(e,oe("TypeScript declarations","artifact-unavailable",l)),s.length>0?Vh(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${r}:package.json \u2192 ${e.name}@${i}:package.json`,url:ki(e.name,i,"package.json"),beforeUrl:ki(e.name,r,"package.json"),afterUrl:ki(e.name,i,"package.json")}):null}if(a.unreachable)return t.onUnavailableSurface?.(e,oe("TypeScript declarations","version-unavailable",`${a.unreachable} could not be fetched, so nothing was compared. That version may have been unpublished, or the CDN may not carry it.`)),null;if(a.definitelyTyped)return t.onUnavailableSurface?.(e,oe("TypeScript declarations","no-public-surface",`${e.name} ships no declarations of its own; its types live in @types/${e.name.replace(/^@/,"").replace("/","__")}, which versions separately and does not move with this upgrade. Nothing was compared.`)),null;let c=[...s,...a.changes];return c.length===0?(a.comparable?t.onSurfaceComputed?.(e,{available:!0,changes:[],tool:"jsdelivr-dts-diff",weight:_i["type-surface-diff"],locator:`${e.name}@${r}:${a.beforeEntryPath} \u2192 ${e.name}@${i}:${a.afterEntryPath}`}):t.onUnavailableSurface?.(e,oe("TypeScript declarations","no-public-surface",`${e.name}'s public API is neither in its own declarations nor in any dependency Drift could follow, so comparing its declarations proves nothing about this upgrade.`)),null):Vh(e,{changes:c,weight:JNe(a)?_i["type-surface-diff"]*.9:_i["type-surface-diff"],locator:`${e.name}@${r}:${a.beforeEntryPath} + package.json \u2192 ${e.name}@${i}:${a.afterEntryPath} + package.json`,url:ki(e.name,i,a.afterEntryPath),beforeUrl:ki(e.name,r,a.beforeEntryPath),afterUrl:ki(e.name,i,a.afterEntryPath)})}let o=await UQ(e,{logger:n,exec:t.exec,env:t.env,readRepoFile:YNe(t),autoInstall:t.config.tools.autoInstall});return o.available?(t.onSurfaceComputed?.(e,o),o.changes.length===0?null:Vh(e,{changes:o.changes,weight:o.weight,locator:`${o.locator} \xB7 computed by ${o.tool}`,...o.packageRole?{packageRole:o.packageRole}:{}})):(n.debug(`No computed surface for ${e.name}: ${o.detail}`),t.onUnavailableSurface?.(e,o),null)}function YNe(e){let{workspaceRoot:t,readRepoFile:n,afterSha:r}=e;if(t)return async i=>(0,qQ.readFile)((0,WQ.join)(t,i),"utf8").catch(()=>null);if(n&&r)return i=>n(i,r).catch(()=>null)}function Vh(e,t){let n=t.beforeUrl||t.afterUrl?["Declaration sources:",t.beforeUrl?`- before: ${t.beforeUrl}`:"",t.afterUrl?`- after: ${t.afterUrl}`:"",""].filter(Boolean).join(` +`):"";return{id:xt("ev",e.name,"surface",e.from??"",e.to??""),source:"type-surface-diff",dependency:e.name,url:t.url,locator:t.locator,title:`${t.changes.length} ${QNe(t.packageRole)} change(s) in ${e.name}`,content:`${n}${eDe(t.changes)}`,findings:t.changes.map(r=>({code:r.kind,symbol:r.symbol,detail:r.detail,before:r.before,after:r.after,...r.changed?{changed:r.changed}:{},...r.replacement?{replacement:r.replacement}:{},...r.fromKind?{fromKind:r.fromKind}:{},...r.toKind?{toKind:r.toKind}:{},...r.moduleSystem?{moduleSystem:{...r.moduleSystem,incompatibleUsage:[...r.moduleSystem.incompatibleUsage],...r.moduleSystem.affectedSpecifiers?{affectedSpecifiers:[...r.moduleSystem.affectedSpecifiers]}:{},...r.moduleSystem.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...r.moduleSystem.affectedSpecifierPatterns]}:{}}}:{}})),weight:t.weight}}function QNe(e){switch(e){case"pom":return"Maven POM contract";case"analyzer":case"msbuild":case"tool":case"meta-package":return"NuGet package contract";case"asset":case"tooling":return"Pub package contract";default:return"API surface"}}var GQ=3;async function XNe(e,t,n,r){try{let[i,o]=await Promise.all([Bc(e,t),Bc(e,n)]);if(!i||!o)return null;(i.viaDependencies.length>0||o.viaDependencies.length>0)&&r.debug(`${e} surface includes ${[...new Set([...i.viaDependencies,...o.viaDependencies])].join(", ")}`);let s=V9(e,i,o),a=Cr(i.api,o.api,{beforeComplete:!i.incomplete,afterComplete:!o.incomplete,packageName:e}),c=i.entryPath.startsWith("@types:")&&o.entryPath.startsWith("@types:")&&i.entryPath===o.entryPath;return{changes:s?[s,...a]:a,comparable:i.api.size>=GQ&&o.api.size>=GQ,beforeEntryPath:i.entryPath,afterEntryPath:o.entryPath,...c?{definitelyTyped:c}:{}}}catch(i){return r.debug(`Type surface diff failed for ${e}: ${i.message}`),i instanceof b$?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",unreachable:`${i.packageName}@${i.version}`}:i instanceof Rd?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",artifactUnavailable:`${i.packageName}@${i.version}`}:{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",comparisonFailed:i.message}}}function ki(e,t,n){if(!(!n||n.startsWith("@types:")))return`https://cdn.jsdelivr.net/npm/${e}@${t}/${n}`}function BQ(e){return sDe(e.replace(/\s+/g," ").trim(),4e3)}function eDe(e){let n=e.slice(0,60).map(r=>{let i=[`- ${r.detail}`];return r.before&&r.after&&(i.push(` before: ${BQ(r.before)}`),i.push(` after: ${BQ(r.after)}`)),i.join(` `)});return e.length>60&&n.push(`- \u2026and ${e.length-60} more`),n.join(` -`)}async function KNe(e){let{config:t,logger:n,readRepoFile:i,beforeSha:r,afterSha:o}=e;if(!i||!r||!o)return[];let s=[];for(let a of el){if(!p8(a,t))continue;let c=await JNe(f8(a,t),e);for(let u of c.unresolvable)e.onUnavailableSpec?.(u,{available:!1,reason:"toolchain-failed",detail:`Drift could not list the files in this repository, so the pattern \`${u}\` could not be expanded and the contracts it covers were not compared.`,remedy:"List the contract documents by literal path instead of by pattern.",tool:a.tool});let l=[];for(let u of c.paths){let[d,p]=await Promise.all([i(u,r),i(u,o)]);!d||!p||a.handles(u,p)&&l.push({path:u,before:d,after:p})}for(let u of l){let d=u.path;if(u.before===u.after)continue;let p=await m8(a,u,{logger:n,exec:e.exec,env:e.env,siblings:l.filter(f=>f.path!==d)});if(!p.available){n.debug(`No ${a.id} diff for ${d}: ${p.detail}`),e.onUnavailableSpec?.(d,p);continue}e.onSpecComputed?.(d,a),p.changes.length!==0&&s.push({id:St("ev",d,a.id,o),source:a.source,dependency:d,locator:d,title:`${p.changes.length} breaking change(s) in ${d}`,content:ZNe(p.changes),findings:p.changes.map(f=>({code:f.code,symbol:f.location,detail:f.detail,...f.before!==void 0?{before:f.before}:{},...f.after!==void 0?{after:f.after}:{}})),weight:p.weight})}}return s}async function JNe(e,t){let n=e.filter(Q9),i=e.filter(s=>!Q9(s));if(n.length===0)return{paths:i,unresolvable:[]};let r=t.listRepoFiles&&t.afterSha?await t.listRepoFiles(t.afterSha):null;if(!r)return{paths:i,unresolvable:n};let o=new Set(i);for(let s of n)for(let a of r)DC(s,a)&&o.add(a);return{paths:[...o].sort(),unresolvable:[]}}function Q9(e){return e.includes("*")||e.includes("?")}function ZNe(e){return e.map(t=>`- \`${t.location}\` \u2014 ${t.detail}`).join(` -`)}function YNe(e){return e.from&&e.to&&Ig(e.from,e.to,e.ecosystem)?"https://semver.org/#spec-item-4":e.bump==="major"?"https://semver.org/#spec-item-8":"https://semver.org/"}function QNe(e){if(!e.from||!e.to)return null;let t=[];return e.bump==="major"?t.push(`Major version bump ${e.from} \u2192 ${e.to}. Semver permits arbitrary breaking changes across a major boundary.`):Ig(e.from,e.to,e.ecosystem)?t.push(`0.x minor bump ${e.from} \u2192 ${e.to}. Under semver \xA74 the minor position carries breaking changes while the major version is 0.`):e.bump==="minor"?t.push(`Minor bump ${e.from} \u2192 ${e.to}. Semver says this should be additive, which is a convention rather than a guarantee \u2014 minor releases do break consumers, so the version number alone is not evidence either way.`):e.bump==="patch"&&t.push(`Patch bump ${e.from} \u2192 ${e.to}. Breakage here is usually accidental.`),Tg(e.from,e.to,e.ecosystem)&&t.push(`This is a DOWNGRADE. Code written against ${e.from} may rely on APIs that do not exist in ${e.to}.`),t.length>0?t.join(" "):null}function XNe(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var rp=["","<","<=",">",">=","=","=="];function ip(e,t){return e==="="||e==="=="?t:e}var jO={node:{runtime:"node",acceptedOperators:[...rp,"^","~"],parserKind:"semver",supportsDisjunction:!0,normalizeOperator:e=>ip(e,"=")},python:{runtime:"python",acceptedOperators:[...rp,"~="],parserKind:"pep440",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"==")},ruby:{runtime:"ruby",acceptedOperators:rp,parserKind:"rubygems",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")},go:{runtime:"go",acceptedOperators:rp,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")},java:{runtime:"java",acceptedOperators:rp,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")},rust:{runtime:"rust",acceptedOperators:[...rp,"^","~"],parserKind:"cargo",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")}};function zO(e,t){let n=jO[e];if(!n.acceptedOperators.includes(t))return{status:"unknown",operator:t};let i=n.normalizeOperator(t);return i===null?{status:"unknown",operator:t}:{status:"parsed",operator:i}}function l_(e){let t=eO(e);if(t)return t.kind;switch(e){case"export-removed":return"removed-export";case"member-removed":return"removed-export";case"signature-changed":return"signature-change";case"constant-value-changed":return"signature-change";case"kind-changed":return"type-change";case"member-now-required":return"required-field-added";case"entry-point-moved":case"package-removed":return"moved-export";case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":return"module-system-change";case"runtime-requirement-raised":return"runtime-requirement";default:return"unknown"}}function o5(e,t){let{code:n,symbol:i}=e,r=eO(n);if(r)return r.remediation(e);let o=eCe(i);if(o&&(n==="export-removed"||n==="member-removed"))return`The published ${o} entry \`${i}\` was removed. Review the consuming manifest, build, asset, or tooling configuration and update it if it relies on this entry; assess this package-role contract independently of source call signatures.`;if(o&&n==="signature-changed")return`The published ${o} entry \`${i}\` changed. Review the consuming manifest, build, asset, or tooling configuration against the new contract; this is not an ordinary call-site signature change.`;switch(n){case"runtime-requirement-raised":return`\`${t}\` is now compiled for Java ${e.after??"a newer release"}. Raise this project's Java toolchain to match \u2014 the compiler release and target in the build (\`maven.compiler.release\`, \`sourceCompatibility\`/\`targetCompatibility\`), the JDK used in CI, and any runtime base image \u2014 or stay on the previous version. There is no source change that avoids this.`;case"export-removed":return`Every use of \`${i}\` from \`${t}\` must be replaced. Find the supported replacement in the new version's exports and migrate each call site. Do not stub \`${i}\` out or re-implement it locally unless no replacement exists \u2014 if none exists, say so in the PR description rather than inventing one.`;case"member-removed":return`The member \`${i}\` no longer exists in \`${t}\`. Update each access to use the replacement member, or restructure the calling code if the capability was removed outright.`;case"signature-changed":switch(e.changed){case"parameters":return`The parameters of \`${i}\` changed; its return type did not. Update every call site to pass arguments matching the new list \u2014 check argument order, argument count, and whether an options object replaced positional arguments. A call that only reads the result of \`${i}\` needs no change beyond its arguments.`;case"return-type":return`The return type of \`${i}\` changed; its parameters did not, so no call site needs its arguments touched. What changed is what a caller gets back. In a statically typed language, a call site that assigns or passes the result on will fail to compile and point you straight at the fix; nothing here needs a source change beyond letting the type checker find those. In a dynamically typed one (plain JavaScript, Python, Ruby), nothing will catch this automatically \u2014 search for call sites that store, destructure, or pass along the result of \`${i}\` and check each one against the new type by hand.`;case"both":return`Both the parameters and the return type of \`${i}\` changed. Update every call site's arguments to match the new parameter list, then separately check what each call site does with the result: a statically typed caller will have a mismatched return type caught by its own compiler, a dynamically typed one will not.`;default:return`The signature of \`${i}\` changed. Update every call site to match the new signature exactly. Pay attention to argument order, argument count, and whether an options object replaced positional arguments.`}case"constant-value-changed":return`\`${i}\` changed underlying value. This does not necessarily require a source change \u2014 most code that only refers to \`${i}\` by name keeps working. Review code in this repository that depends on the concrete value: a hard-coded copy of the old number, a value persisted or sent over the wire, or a comparison against zero or another literal.`;case"kind-changed":return tCe(i,e.fromKind,e.toKind);case"entry-point-moved":return`The import path changed, not the API. ${e.detail} Update the import specifier in every file that imports from \`${t}\`, and do not replace, stub, or re-implement the individual symbols \u2014 they still exist under the new entry point. If you cannot determine which entry point carries a symbol this repository uses, leave that import alone with a \`TODO(drift):\` comment naming the symbol.`;case"package-removed":return`The package \`${i}\` no longer exists in \`${t}\`. Update the import path in every file that imports it to whichever package now provides the same API. Do not re-implement or stub the symbols it exported \u2014 if you cannot determine the replacement package, leave the import in place with a \`TODO(drift):\` comment naming it rather than guessing.`;case"member-now-required":return`\`${i}\` is now required. Supply an explicit value at every construction site. Choose the value that preserves the previous default behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`;case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":{let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,c=s?.length&&a?.length?`the affected \`require()\` sites for ${[...s.map(l=>`\`${l}\``),...a.map(l=>`specifier pattern \`${l}\``)].join(", ")}`:s&&s.length===1?`\`require('${s[0]}')\``:s&&s.length>1?`the affected \`require()\` sites for ${s.map(l=>`\`${l}\``).join(", ")}`:a&&a.length===1?`\`require()\` sites whose specifier matches \`${a[0]}\``:a&&a.length>1?`the affected \`require()\` sites matching ${a.map(l=>`\`${l}\``).join(", ")}`:`each localized \`require('${t}')\` site`;return`\`${t}\` no longer exposes the CommonJS loading compatibility it exposed before. Update ${c} to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import()\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`}default:return`Review usages of \`${i}\` from \`${t}\` and update them for the new version.`}}function eCe(e){return e.startsWith("pom:")?"Maven POM contract":e.startsWith("nuget:")?"NuGet package contract":e.startsWith("pub:")?"Pub package contract":null}function tCe(e,t,n){return t==="class"&&n==="function"?`\`${e}\` is no longer a class \u2014 it is a function now. Remove \`new\` from every construction site (\`new ${e}(...)\` becomes \`${e}(...)\`); calling it without \`new\` on the old version would have thrown or behaved differently, so every call site necessarily used \`new\` and necessarily needs it removed. Anything that did \`instanceof ${e}\` on the result has no replacement to fall back on automatically \u2014 check what it was actually testing for.`:t==="function"&&n==="class"?`\`${e}\` is a class now, not a function. Add \`new\` at every call site (\`${e}(...)\` becomes \`new ${e}(...)\`); calling a class without \`new\` throws in JavaScript, so this is a hard requirement, not a style choice.`:(t==="interface"||t==="type")&&n==="class"?`\`${e}\` is a class now, not just a type. Nothing changes for code that only used it as a type annotation \u2014 but if this repository ever constructed a value shaped like it by hand (an object literal, a factory function), that code should now go through \`new ${e}(...)\` if the class provides real behaviour a plain object cannot.`:t==="class"&&(n==="interface"||n==="type")?`\`${e}\` is a plain type now, not a class. Replace every \`new ${e}(...)\` with however the package now wants this value built. Remove any \`instanceof ${e}\` check \u2014 there is no runtime class left to test against; if the value's presence still needs checking, do a structural check on its fields instead.`:t==="namespace"||n==="namespace"?`\`${e}\` moved between a namespace and a ${t==="namespace"?n:t}. Update every access through \`${e}.\` to match how its members are reached in the new form, and update any type position that named \`${e}\` directly.`:`\`${e}\` changed from a ${t??"previous form"} to a ${n??"different form"}. Update declarations, \`new\` expressions, and type positions accordingly.`}function nCe(...e){let t=e.flatMap(n=>{let[i,r]=n.split("|");return[i,r,`${i}s`]});return`(?:${[...new Set(t)].join("|")})`}var rCe=nCe("remove|removed","drop|dropped","delete|deleted"),op=String.raw`(node(?:\.js)?|python|go|ruby|java|rust)\b`,dl=String.raw`([<>=^~]*\s*v?\d+(?:\.\d+){0,3}(?:(?:\s*,\s*|\s*\|\|\s*|\s+)\s*[<>=^~]*\s*v?\d+(?:\.\d+){0,3})*)`,r5=String.raw`(?:versions?\s*)?(?:is\s+|:\s*)?`,i5=[{id:"prose-dropped-runtime-prefix",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:(?:dropped|drops?|removed)\s+support\s+for|no\s+longer\s+supports?)\s+${op}\s*${r5}${dl}`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${op}\s*(?:versions?\s*)?${dl}\s+(?:is|are|was|were)\s+no\s+longer\s+supported`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-support-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bsupport\s+for\s+${op}\s*(?:versions?\s*)?${dl}\s+(?:was|were|is|has\s+been)\s+removed`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-min-runtime-leading",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:requires?|required|now\s+requires?|minimum(?:\s+supported)?)\s+${op}\s*${r5}(?:raised\s+to\s*)?${dl}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version raised to ${e[2]?.trim()}`},{id:"prose-min-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${op}\s+v?${dl}\s+is\s+now\s+required`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-supported-version",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bminimum\s+supported\s+${op}\s+version\s+is\s+(?:now\s+)?${dl}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-msrv",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(rust)\b\s+MSRV\s+is\s+(?:now\s+)?${dl}`,"i"),symbolGroup:1,summarize:e=>`Minimum Rust version is ${e[2]?.trim()}`}],iCe=[...i5.filter(e=>e.id.startsWith("prose-dropped-runtime")),{id:"prose-removed",kind:"removed-export",pattern:/`([\w$.]+)`(?:\(\))?\s+(?:has been|have been|was|were|is|are)\s+removed\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-removed-passive",kind:"removed-export",pattern:new RegExp(`\\b${rCe}\\s+(?:the\\s+)?\`([\\w$.]+)\``,"i"),symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-renamed",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?renamed\s+to\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was renamed to \`${e[2]}\``},{id:"prose-replaced",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?replaced\s+(?:by|with)\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was replaced by \`${e[2]}\``},{id:"prose-deprecated-in-favour",kind:"renamed-export",pattern:/`([\w$.]+)`\s+is\s+deprecated\s+in\s+favou?r\s+of\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` is deprecated in favour of \`${e[2]}\``},{id:"prose-no-longer",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer ${e[2]?.trim()}`},{id:"prose-now-requires",kind:"signature-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+(?:requires|takes|accepts|expects)\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now requires ${e[2]?.trim()}`},{id:"prose-now-returns",kind:"type-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+returns\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now returns ${e[2]?.trim()}`},{id:"prose-signature-of-symbol",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+of\s+`([\w$.]+)`[^.\n]{0,40}?\b(?:changed|changes|change\b|different|new\b)/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-symbol-signature-changed",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:call|constructor|method)?\s*signature\s+(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-nth-argument-of-symbol",kind:"signature-change",pattern:/\b(?:first|second|third|fourth|fifth|sixth|last|\d+(?:st|nd|rd|th))\s+(?:positional\s+)?(?:argument|parameter|param|arg)\s+(?:for|of|to|in|passed\s+to)\s+`([\w$.]+)`/i,symbolGroup:1,summarize:e=>`an argument of \`${e[1]}\` changed`},{id:"prose-symbol-no-longer-takes",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(?:takes|accepts|expects|requires)\s+(.{2,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer takes ${e[2]?.trim()}`},{id:"prose-signature-changed-phrase",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+(?:of\b[^.\n]{0,80}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b|\bchanged\s+(?:the\s+)?(?:\w+\s+){0,3}signature\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-call-shape-rewrite",kind:"signature-change",pattern:/\b(?:refactor(?:ed|ing)?\s+)?([\w$.]+)\s*\((?:[^()]|\([^()]*\))*\)\s*(?:->|→|into)\s*\1\s*\(/i,symbolGroup:0,summarize:()=>"a call signature was rewritten"},{id:"prose-verb-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:changed?|changing|updated?|updating|revamp(?:ed)?|rework(?:ed)?|adjust(?:ed)?|modif(?:y|ied)|switch(?:ed)?|new|different|generic\s+single)\s+(?:the\s+)?[\w`.$()/,&\s-]{0,45}?\bsignatures?\b|\bsignatures?\s+(?:of\b[^.\n]{0,60}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+|now\s+|changed|change[ds]|updated?)\b|\b(?:two|multiple|separate|distinct|overloaded)\s+signatures?\b|\binterfaces?\s+(?:has\s+|have\s+)?changed\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-argument-list-changed",kind:"signature-change",refinement:!0,pattern:new RegExp([String.raw`\b(?:arg(?:ument)?|param(?:eter)?)s?\s+order\b`,String.raw`\bargs?\s+now\s+(?:given|passed|taken)\b`,String.raw`\b(?:standardi[sz]e|standardi[sz]ed)\s+(?:the\s+)?arg(?:ument)?s?\b`,String.raw`\barg(?:ument)?s?\s+(?:have\s+been\s+|were\s+|are\s+|been\s+)?(?:swapped|reordered|re-ordered)\b`,"\\b`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\s+(?:(?:to|of|from|in|for)\\s+`?[\\w$.]+`?\\s+)?(?:have\\s+|has\\s+|have\\s+been\\s+|has\\s+been\\s+|is\\s+|are\\s+|was\\s+|were\\s+|been\\s+)?(?:removed|added|dropped|changed)\\b",String.raw`\breturn\s+types?\s+(?:has\s+|have\s+|now\s+)?(?:changed|change[ds])\b`,String.raw`\bupdate\s+[\w$.()]+\s+to\s+return\b`,String.raw`\btype\s+changed\s+from\b`,"\\breplaced?\\s+[\\w$.()`]{0,30}?\\s+args?\\s+w(?:ith|/)\\b","\\b(?:removed?|dropped?|added?)\\s+(?:the\\s+|a\\s+|an\\s+)?(?:deprecated\\s+|new\\s+|optional\\s+|required\\s+)?`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\b",String.raw`\bno\s+longer\s+(?:accepts?|takes?|supports?|allows?|passes?)\b[^.\n]{0,45}?(?:arg(?:ument)?s?|param(?:eter)?s?|[Ss]elector|callbacks?|thisArg)\b`,String.raw`\bcall\s+pattern\s+is\s+no\s+longer\b`,String.raw`\bis\s+no\s+longer\s+(?:a\s+)?valid\s+call\b`,"\\b(?:`?thisArg`?|this\\s+argument)\\b[^.\\n]{0,40}?\\b(?:removed|no\\s+longer|default|undefined|dropped)\\b",String.raw`\b(?:requires?|required|takes?|needs?|accepts?|expects?)\s+(?:a\s+|an\s+|the\s+)?(?:new|additional|extra|second|third|fourth)\s+(?:constructor\s+)?(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\b(?:constructor|function|method)\s+(?:signature\s+)?(?:now\s+)?(?:requires?|takes?|accepts?|expects?|required)\b`,String.raw`\bis\s+no\s+longer\s+(?:the\s+)?(?:first|second|third|fourth|fifth|last|\d+(?:st|nd|rd|th))\s+(?:arg(?:ument)?|param(?:eter)?)\b`,String.raw`\bnow\s+(?:have|has)\s+(?:two|three|multiple|several)\s+(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\bnow\s+(?:two|three)\s+param(?:eter)?s\b`,"\\b(?:use|using|takes?|expects?|switch(?:ed)?\\s+`?[\\w$.]+`?(?:\\s+setting)?\\s+to|switch(?:ed)?\\s+to|pass(?:ing)?|is\\s+now|are\\s+now|it\\s+is\\s+now)\\s+(?:an?\\s+|two\\s+|the\\s+)?(?:object\\s+options?|options?\\s+(?:object|hash)|config(?:uration)?\\s+(?:object|hash)|`?[\\w$.]+`?\\s+option\\b)",String.raw`\b(?:options?|config(?:uration)?)\s+(?:object|hash)\s+(?:as\b|instead\b|for\b)`,String.raw`\bparam(?:eter)?s?\s+(?:are|is)\s+no\s+longer\s+optional\b`,String.raw`\bformerly\s+a\s+config\s+object\b`].join("|"),"i"),symbolGroup:0,summarize:()=>"an argument list changed"},{id:"prose-async-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:make[s]?|made|turn(?:ed)?|change)\s+[\w`#.$()"\s]{1,40}?\s+(?:(?:in)?to\s+)?(?:be\s+)?(?:an?\s+)?a?sync(?:hronous)?(?:\s+function)?\b|\b(?:is|are|be)\s+(?:now\s+|an?\s+)*a?sync(?:hronous)?(?:\s+function|\s+now)?\b|\bnow\s+a?sync(?:hronous)?\b|\ba?sync\s+now\b|\basync\b[^.\n]{0,40}?\b(?:callback|promise|await|sync)\b|\b(?:callback|promise|sync)s?\b[^.\n]{0,40}?\basync\b|\bpromises?\s+instead\s+of\s+(?:using\s+)?callbacks?\b|\bnow\s+returns?\s+(?:a\s+|an\s+)?(?:promise|observable|thenable|query)\b|\bnow\s+return\s+promises\b|\breturns?\s+[\w"']+,?\s+not\s+(?:a\s+)?(?:promise|callback|query)\b|\b(?:needs?|has|have|dosnt\s+wait|doesn'?t\s+wait)\s+to\s+be\s+awaited\b|\bmust\s+(?:now\s+)?be\s+awaited\b|\b(?:update|change|updated)\s+(?:the\s+)?return\s+types?\b|\bdrop(?:ped|s)?\s+(?:support\s+for\s+)?callbacks?\b|\bremove[d]?\s+callback\s+support\b|\bno\s+(?:longer\s+)?(?:takes?|accepts?|using)\s+(?:a\s+|the\s+)?callbacks?\b/i,symbolGroup:0,summarize:()=>"a callback/return signature changed"},{id:"prose-symbol-now-required",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:is|are|becomes?|became)\s+now\s+(?:required|mandatory|non-optional)\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now required`},{id:"prose-is-now",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+(?:is|are|must)\s+now\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now ${e[2]?.trim()}`},{id:"prose-moved",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has\s+)?moved\s+to\s+`([\w$./@-]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` moved to \`${e[2]}\``},...i5.filter(e=>e.id.startsWith("prose-min-runtime")),{id:"prose-esm-only",kind:"module-system-change",pattern:/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b/i,symbolGroup:0,summarize:()=>"The package is now ESM-only and no longer supports `require()`",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-dropped-commonjs",kind:"module-system-change",pattern:/\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,symbolGroup:0,summarize:()=>"CommonJS support was dropped",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-breaking-change-footer",kind:"behaviour-change",pattern:/^BREAKING[ -]CHANGES?:\s*(.{3,160}?)(?:[.;]|$)/i,symbolGroup:0,summarize:e=>`Declared as a breaking change: ${e[1]?.trim()}`},{id:"prose-breaking-change-marker",kind:"unknown",pattern:/^BREAKING[ -]CHANGES?\b\s*:?\s*(?:none|n\/a)?\s*$/i,symbolGroup:0,summarize:()=>"Declared as a breaking change (no detail given)"}];function s5(e){for(let t of e.split(` -`)){let n=t.replace(/\r$/,"").replace(/^\s*[-*>]+\s+/,"").replace(/\*{1,3}([^*\n]+?)\*{1,3}/g,"$1").replace(/\s*[-*=]{2,}\s*$/,"").trim();if(/^BREAKING[ -]CHANGES?\b[ \t]*(?::|[-–—][ \t]|$)/i.test(n)||/^#{1,6}[ \t].*\bbreaking\s+changes?\b/i.test(n))return!0}return!1}function a5(e,t={}){let n=[],i=e.replace(/^[-*+]\s+/,"").trim();if(!i)return n;for(let r of iCe){let o=r.pattern.exec(i);if(!o)continue;let s=r.symbolGroup===0?null:o[r.symbolGroup];if(r.symbolGroup!==0&&!s)continue;let a=r.kind==="runtime-requirement"?oCe(o,r.id):void 0;if(r.kind==="runtime-requirement"&&!a)continue;let c=r.replacementGroup?o[r.replacementGroup]:void 0;n.push({ruleId:r.id,kind:r.kind,summary:a?a.kind==="minimum-runtime"?a.requirement.includes("||")?`Supported ${a.runtime} versions are now ${a.requirement}`:`Minimum ${a.runtime} version is now ${a.requirement}`:`${a.runtime} ${a.requirement} is no longer supported`:r.summarize(o),symbols:s?[s]:[],...a?{runtime:a}:{},replacementSymbols:c?[c]:[],...r.moduleSystem?{moduleSystem:{...r.moduleSystem,incompatibleUsage:[...r.moduleSystem.incompatibleUsage]}}:{},...r.refinement?{refinement:!0}:{},passage:i})}return t.anchored||n.some(r=>!r.refinement)?n:n.filter(r=>!r.refinement)}function oCe(e,t){let n=e[1]?.toLowerCase().replace(/\.js$/,""),i=e[2]?.trim();if(!n||!i||!["node","python","go","ruby","java","rust"].includes(n))return null;if(i.includes("||"))return aCe(n,i,e[0].trim(),t);let r=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(i);if(!r)return null;let o=r[1]??"",s=r[2],a=i.replace(/v?(\d+(?:\.\d+){0,3})/gi,(p,f)=>n==="java"?f.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):f),c=e[0].trim(),l=zO(n,o),u=l.status,d=a.replace(/^\s*[<>=^~]*\s*/,l.operator||">=");if(t.startsWith("prose-dropped-runtime")){if(o===""){let p=s.split(".");return{kind:"unsupported-runtime-range",runtime:n,requirement:i.includes(",")||/\s+[<>=^~]/.test(i)?d:p.length<3?`${s}.x`:s,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"unsupported-runtime-range",runtime:n,requirement:d,...o==="<"?{derivedMinimum:`>=${s}`}:{},...o==="<="?{derivedMinimum:`>${s}`}:{},sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"minimum-runtime",runtime:n,requirement:d,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}function sCe(e){let t=/^v?(\d+(?:\.\d+){0,3})$/i.exec(e.trim());if(!t)return e;let n=t[1];return n.split(".").length<3?`${n}.x`:n}function aCe(e,t,n,i){let r=t.split("||").map(c=>c.trim()).filter(Boolean);if(r.length<2)return null;let o=jO[e].supportsDisjunction?"parsed":"unknown",s=[];for(let c of r){let l=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(c);if(!l)return null;let u=l[1]??"",d=zO(e,u);d.status==="unknown"&&(o="unknown");let p=c.replace(/v?(\d+(?:\.\d+){0,3})/gi,(f,m)=>e==="java"?m.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):m);s.push(u===""?sCe(p):p.replace(/^\s*[<>=^~]*\s*/,d.operator))}let a={runtime:e,requirement:s.join(" || "),sourceText:n,...o==="unknown"?{rangeParseStatus:"unknown"}:{}};return i.startsWith("prose-dropped-runtime")?{kind:"unsupported-runtime-range",...a}:{kind:"minimum-runtime",...a}}function c5(e,t){let n=e.symbols[0]??"the affected API",i=e.replacementSymbols[0];switch(e.kind){case"removed-export":return`\`${n}\` was removed from \`${t}\`. Replace every usage. Verify against the installed version's actual exports before choosing a replacement \u2014 the changelog may be incomplete.`;case"renamed-export":return i?`Replace every usage of \`${n}\` with \`${i}\`, checking that the new API's signature matches before assuming it is a drop-in rename.`:`\`${n}\` was replaced. Migrate every usage to the documented successor.`;case"signature-change":return`The way \`${n}\` is called changed: ${e.summary}. Update every call site and confirm against the installed type declarations.`;case"type-change":return`The type produced by \`${n}\` changed: ${e.summary}. Update consumers of its return value, including any local type declarations.`;case"behaviour-change":return`Behaviour changed: ${e.summary}. Review call sites for assumptions that no longer hold. Prefer making the assumption explicit over silently adapting to the new behaviour.`;case"runtime-requirement":return e.runtime?.kind==="unsupported-runtime-range"?e.runtime.derivedMinimum?`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported. That unambiguously means a floor of ${e.runtime.derivedMinimum}; update the runtime version declared in CI workflows, engine fields, and container images accordingly.`:`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported, but the release note does not establish a replacement minimum. Review the project's declared runtime against authoritative upstream compatibility guidance rather than inventing one.`:`${e.summary}. Update the runtime version declared in CI workflows, engine fields, and container images. Do not change application logic for this.`;case"module-system-change":return`\`${t}\` no longer exposes a CommonJS-compatible entry point. Update each localized \`require('${t}')\` site to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import('${t}')\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`;case"config-change":return`Configuration must change: ${e.summary}.`;default:return`Review usages of \`${n}\` and update them: ${e.summary}`}}var cCe=["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"],lCe=["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"],uCe=["symbol","type","module","package","dependency-cohort","runtime","ecosystem"],dCe=["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"];var pCe={"export-removed":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["direct"]},"member-removed":{nature:"api-shape",detectability:["compile-time"],scope:"symbol",visibility:["direct"]},"signature-changed":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["direct"]},"kind-changed":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"member-now-required":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"entry-point-moved":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"package-removed":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"commonjs-entry-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"exports-require-condition-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"package-type-changed":{nature:"packaging",detectability:["manifest","link-or-import","compile-time"],scope:"package",visibility:["direct"]},"constant-value-changed":{nature:"behaviour",detectability:["static-semantic","runtime-only"],scope:"symbol",visibility:["direct"]},...fCe()};function fCe(){let e={};for(let t of el)for(let[n,i]of Object.entries(t.codes))e[n]=i.taxonomy;return e}var mCe={"removed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"renamed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"moved-export":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"module",visibility:["unknown"]},"signature-change":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["unknown"]},"type-change":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["unknown"]},"behaviour-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"default-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"removed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},"changed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},"required-field-added":{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"type",visibility:["unknown"]},"config-change":{nature:"configuration",detectability:["static-semantic","runtime-only"],scope:"module",visibility:["unknown"]},"module-system-change":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"runtime-requirement":{nature:"runtime-environment",detectability:["manifest","runtime-only"],scope:"runtime",visibility:["direct"]},unknown:{nature:"behaviour",detectability:["runtime-only"],scope:"module",visibility:["unknown"]}};function sp(e,t){let n=t?pCe[t]:void 0;if(n)return{...l5(n),origin:"computed"};let i=mCe[e];return{...l5(i),origin:e==="unknown"?"default":"rule"}}function l5(e){return{nature:e.nature,detectability:[...e.detectability],scope:e.scope,visibility:[...e.visibility]}}function Or(e){return e.taxonomy??sp(e.kind)}function p5(e,t){if(!e||typeof e!="object")return t;let n=e,i=u5(n.nature,cCe),r=u5(n.scope,uCe),o=d5(n.detectability,lCe),s=d5(n.visibility,dCe);return!i||!r?t:{nature:i,scope:r,detectability:o.length>0?o:[...t.detectability],visibility:s.length>0?s:["unknown"],origin:"llm-normalized"}}function u5(e,t){return typeof e=="string"&&t.includes(e)?e:null}function d5(e,t){if(!Array.isArray(e))return[];let n=new Set;for(let i of e)typeof i=="string"&&t.includes(i)&&n.add(i);return t.filter(i=>n.has(i))}function u_(e){let t=["manifest","link-or-import","compile-time","static-semantic"];return!e.detectability.some(n=>t.includes(n))}var OOe={type:"object",properties:{changes:{type:"array",items:{type:"object",properties:{summary:{type:"string",description:"One sentence stating what changed upstream and why it breaks consumers."},remediation:{type:"string",description:"Imperative instructions for fixing affected call sites."},symbols:{type:"array",items:{type:"string"},description:"Exact identifiers to search for in consumer code: export names, method names, option keys, endpoint paths. Empty if the evidence names none."},kind:{type:"string",enum:["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement","unknown"]},evidenceId:{type:"string",description:"The id of the evidence excerpt this was extracted from."},taxonomy:{type:"object",properties:{nature:{type:"string",enum:["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"]},detectability:{type:"array",items:{type:"string",enum:["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"]},description:"What would have to run to notice this. Be honest: a change that only shows up at runtime must not be listed as compile-time."},scope:{type:"string",enum:["symbol","type","module","package","dependency-cohort","runtime","ecosystem"]},visibility:{type:"array",items:{type:"string",enum:["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"]},description:"Use `unknown` when the evidence does not say. Do not guess `direct`."}},required:["nature","detectability","scope","visibility"],additionalProperties:!1}},required:["summary","remediation","symbols","kind","evidenceId"],additionalProperties:!1}}},required:["changes"],additionalProperties:!1},MOe=`You extract breaking changes from dependency release notes for an automated refactoring tool. +`)}async function tDe(e){let{config:t,logger:n,readRepoFile:r,beforeSha:i,afterSha:o}=e;if(!r||!i||!o)return[];let s=[];for(let a of Gc){if(!i9(a,t))continue;let c=await nDe(o9(a,t),e);for(let u of c.unresolvable)e.onUnavailableSpec?.(u,{available:!1,reason:"toolchain-failed",detail:`Drift could not list the files in this repository, so the pattern \`${u}\` could not be expanded and the contracts it covers were not compared.`,remedy:"List the contract documents by literal path instead of by pattern.",tool:a.tool});let l=[];for(let u of c.paths){let[d,p]=await Promise.all([r(u,i),r(u,o)]);!d||!p||a.handles(u,p)&&l.push({path:u,before:d,after:p})}for(let u of l){let d=u.path;if(u.before===u.after)continue;let p=await s9(a,u,{logger:n,exec:e.exec,env:e.env,siblings:l.filter(f=>f.path!==d)});if(!p.available){n.debug(`No ${a.id} diff for ${d}: ${p.detail}`),e.onUnavailableSpec?.(d,p);continue}e.onSpecComputed?.(d,a),p.changes.length!==0&&s.push({id:xt("ev",d,a.id,o),source:a.source,dependency:d,locator:d,title:`${p.changes.length} breaking change(s) in ${d}`,content:rDe(p.changes),findings:p.changes.map(f=>({code:f.code,symbol:f.location,detail:f.detail,...f.before!==void 0?{before:f.before}:{},...f.after!==void 0?{after:f.after}:{}})),weight:p.weight})}}return s}async function nDe(e,t){let n=e.filter(VQ),r=e.filter(s=>!VQ(s));if(n.length===0)return{paths:r,unresolvable:[]};let i=t.listRepoFiles&&t.afterSha?await t.listRepoFiles(t.afterSha):null;if(!i)return{paths:r,unresolvable:n};let o=new Set(r);for(let s of n)for(let a of i)PN(s,a)&&o.add(a);return{paths:[...o].sort(),unresolvable:[]}}function VQ(e){return e.includes("*")||e.includes("?")}function rDe(e){return e.map(t=>`- \`${t.location}\` \u2014 ${t.detail}`).join(` +`)}function iDe(e){return e.from&&e.to&&qg(e.from,e.to,e.ecosystem)?"https://semver.org/#spec-item-4":e.bump==="major"?"https://semver.org/#spec-item-8":"https://semver.org/"}function oDe(e){if(!e.from||!e.to)return null;let t=[];return e.bump==="major"?t.push(`Major version bump ${e.from} \u2192 ${e.to}. Semver permits arbitrary breaking changes across a major boundary.`):qg(e.from,e.to,e.ecosystem)?t.push(`0.x minor bump ${e.from} \u2192 ${e.to}. Under semver \xA74 the minor position carries breaking changes while the major version is 0.`):e.bump==="minor"?t.push(`Minor bump ${e.from} \u2192 ${e.to}. Semver says this should be additive, which is a convention rather than a guarantee \u2014 minor releases do break consumers, so the version number alone is not evidence either way.`):e.bump==="patch"&&t.push(`Patch bump ${e.from} \u2192 ${e.to}. Breakage here is usually accidental.`),Vg(e.from,e.to,e.ecosystem)&&t.push(`This is a DOWNGRADE. Code written against ${e.from} may rely on APIs that do not exist in ${e.to}.`),t.length>0?t.join(" "):null}function sDe(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var jd=["","<","<=",">",">=","=","=="];function Ud(e,t){return e==="="||e==="=="?t:e}var LM={node:{runtime:"node",acceptedOperators:[...jd,"^","~"],parserKind:"semver",supportsDisjunction:!0,normalizeOperator:e=>Ud(e,"=")},python:{runtime:"python",acceptedOperators:[...jd,"~="],parserKind:"pep440",supportsDisjunction:!1,normalizeOperator:e=>Ud(e,"==")},ruby:{runtime:"ruby",acceptedOperators:jd,parserKind:"rubygems",supportsDisjunction:!1,normalizeOperator:e=>Ud(e,"=")},go:{runtime:"go",acceptedOperators:jd,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>Ud(e,"=")},java:{runtime:"java",acceptedOperators:jd,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>Ud(e,"=")},rust:{runtime:"rust",acceptedOperators:[...jd,"^","~"],parserKind:"cargo",supportsDisjunction:!1,normalizeOperator:e=>Ud(e,"=")}};function FM(e,t){let n=LM[e];if(!n.acceptedOperators.includes(t))return{status:"unknown",operator:t};let r=n.normalizeOperator(t);return r===null?{status:"unknown",operator:t}:{status:"parsed",operator:r}}function R$(e){let t=YO(e);if(t)return t.kind;switch(e){case"export-removed":return"removed-export";case"member-removed":return"removed-export";case"signature-changed":return"signature-change";case"constant-value-changed":return"signature-change";case"kind-changed":return"type-change";case"member-now-required":return"required-field-added";case"entry-point-moved":case"package-removed":return"moved-export";case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":return"module-system-change";case"runtime-requirement-raised":return"runtime-requirement";default:return"unknown"}}function YQ(e,t){let{code:n,symbol:r}=e,i=YO(n);if(i)return i.remediation(e);let o=aDe(r);if(o&&(n==="export-removed"||n==="member-removed"))return`The published ${o} entry \`${r}\` was removed. Review the consuming manifest, build, asset, or tooling configuration and update it if it relies on this entry; assess this package-role contract independently of source call signatures.`;if(o&&n==="signature-changed")return`The published ${o} entry \`${r}\` changed. Review the consuming manifest, build, asset, or tooling configuration against the new contract; this is not an ordinary call-site signature change.`;switch(n){case"runtime-requirement-raised":return`\`${t}\` is now compiled for Java ${e.after??"a newer release"}. Raise this project's Java toolchain to match \u2014 the compiler release and target in the build (\`maven.compiler.release\`, \`sourceCompatibility\`/\`targetCompatibility\`), the JDK used in CI, and any runtime base image \u2014 or stay on the previous version. There is no source change that avoids this.`;case"export-removed":return`Every use of \`${r}\` from \`${t}\` must be replaced. Find the supported replacement in the new version's exports and migrate each call site. Do not stub \`${r}\` out or re-implement it locally unless no replacement exists \u2014 if none exists, say so in the PR description rather than inventing one.`;case"member-removed":return`The member \`${r}\` no longer exists in \`${t}\`. Update each access to use the replacement member, or restructure the calling code if the capability was removed outright.`;case"signature-changed":switch(e.changed){case"parameters":return`The parameters of \`${r}\` changed; its return type did not. Update every call site to pass arguments matching the new list \u2014 check argument order, argument count, and whether an options object replaced positional arguments. A call that only reads the result of \`${r}\` needs no change beyond its arguments.`;case"return-type":return`The return type of \`${r}\` changed; its parameters did not, so no call site needs its arguments touched. What changed is what a caller gets back. In a statically typed language, a call site that assigns or passes the result on will fail to compile and point you straight at the fix; nothing here needs a source change beyond letting the type checker find those. In a dynamically typed one (plain JavaScript, Python, Ruby), nothing will catch this automatically \u2014 search for call sites that store, destructure, or pass along the result of \`${r}\` and check each one against the new type by hand.`;case"both":return`Both the parameters and the return type of \`${r}\` changed. Update every call site's arguments to match the new parameter list, then separately check what each call site does with the result: a statically typed caller will have a mismatched return type caught by its own compiler, a dynamically typed one will not.`;default:return`The signature of \`${r}\` changed. Update every call site to match the new signature exactly. Pay attention to argument order, argument count, and whether an options object replaced positional arguments.`}case"constant-value-changed":return`\`${r}\` changed underlying value. This does not necessarily require a source change \u2014 most code that only refers to \`${r}\` by name keeps working. Review code in this repository that depends on the concrete value: a hard-coded copy of the old number, a value persisted or sent over the wire, or a comparison against zero or another literal.`;case"kind-changed":return cDe(r,e.fromKind,e.toKind);case"entry-point-moved":return`The import path changed, not the API. ${e.detail} Update the import specifier in every file that imports from \`${t}\`, and do not replace, stub, or re-implement the individual symbols \u2014 they still exist under the new entry point. If you cannot determine which entry point carries a symbol this repository uses, leave that import alone with a \`TODO(drift):\` comment naming the symbol.`;case"package-removed":return`The package \`${r}\` no longer exists in \`${t}\`. Update the import path in every file that imports it to whichever package now provides the same API. Do not re-implement or stub the symbols it exported \u2014 if you cannot determine the replacement package, leave the import in place with a \`TODO(drift):\` comment naming it rather than guessing.`;case"member-now-required":return`\`${r}\` is now required. Supply an explicit value at every construction site. Choose the value that preserves the previous default behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`;case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":{let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,c=s?.length&&a?.length?`the affected \`require()\` sites for ${[...s.map(l=>`\`${l}\``),...a.map(l=>`specifier pattern \`${l}\``)].join(", ")}`:s&&s.length===1?`\`require('${s[0]}')\``:s&&s.length>1?`the affected \`require()\` sites for ${s.map(l=>`\`${l}\``).join(", ")}`:a&&a.length===1?`\`require()\` sites whose specifier matches \`${a[0]}\``:a&&a.length>1?`the affected \`require()\` sites matching ${a.map(l=>`\`${l}\``).join(", ")}`:`each localized \`require('${t}')\` site`;return`\`${t}\` no longer exposes the CommonJS loading compatibility it exposed before. Update ${c} to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import()\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`}default:return`Review usages of \`${r}\` from \`${t}\` and update them for the new version.`}}function aDe(e){return e.startsWith("pom:")?"Maven POM contract":e.startsWith("nuget:")?"NuGet package contract":e.startsWith("pub:")?"Pub package contract":null}function cDe(e,t,n){return t==="class"&&n==="function"?`\`${e}\` is no longer a class \u2014 it is a function now. Remove \`new\` from every construction site (\`new ${e}(...)\` becomes \`${e}(...)\`); calling it without \`new\` on the old version would have thrown or behaved differently, so every call site necessarily used \`new\` and necessarily needs it removed. Anything that did \`instanceof ${e}\` on the result has no replacement to fall back on automatically \u2014 check what it was actually testing for.`:t==="function"&&n==="class"?`\`${e}\` is a class now, not a function. Add \`new\` at every call site (\`${e}(...)\` becomes \`new ${e}(...)\`); calling a class without \`new\` throws in JavaScript, so this is a hard requirement, not a style choice.`:(t==="interface"||t==="type")&&n==="class"?`\`${e}\` is a class now, not just a type. Nothing changes for code that only used it as a type annotation \u2014 but if this repository ever constructed a value shaped like it by hand (an object literal, a factory function), that code should now go through \`new ${e}(...)\` if the class provides real behaviour a plain object cannot.`:t==="class"&&(n==="interface"||n==="type")?`\`${e}\` is a plain type now, not a class. Replace every \`new ${e}(...)\` with however the package now wants this value built. Remove any \`instanceof ${e}\` check \u2014 there is no runtime class left to test against; if the value's presence still needs checking, do a structural check on its fields instead.`:t==="namespace"||n==="namespace"?`\`${e}\` moved between a namespace and a ${t==="namespace"?n:t}. Update every access through \`${e}.\` to match how its members are reached in the new form, and update any type position that named \`${e}\` directly.`:`\`${e}\` changed from a ${t??"previous form"} to a ${n??"different form"}. Update declarations, \`new\` expressions, and type positions accordingly.`}function lDe(...e){let t=e.flatMap(n=>{let[r,i]=n.split("|");return[r,i,`${r}s`]});return`(?:${[...new Set(t)].join("|")})`}var uDe=lDe("remove|removed","drop|dropped","delete|deleted"),zd=String.raw`(node(?:\.js)?|python|go|ruby|java|rust)\b`,Xc=String.raw`([<>=^~]*\s*v?\d+(?:\.\d+){0,3}(?:(?:\s*,\s*|\s*\|\|\s*|\s+)\s*[<>=^~]*\s*v?\d+(?:\.\d+){0,3})*)`,JQ=String.raw`(?:versions?\s*)?(?:is\s+|:\s*)?`,ZQ=[{id:"prose-dropped-runtime-prefix",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:(?:dropped|drops?|removed)\s+support\s+for|no\s+longer\s+supports?)\s+${zd}\s*${JQ}${Xc}`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${zd}\s*(?:versions?\s*)?${Xc}\s+(?:is|are|was|were)\s+no\s+longer\s+supported`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-support-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bsupport\s+for\s+${zd}\s*(?:versions?\s*)?${Xc}\s+(?:was|were|is|has\s+been)\s+removed`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-min-runtime-leading",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:requires?|required|now\s+requires?|minimum(?:\s+supported)?)\s+${zd}\s*${JQ}(?:raised\s+to\s*)?${Xc}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version raised to ${e[2]?.trim()}`},{id:"prose-min-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${zd}\s+v?${Xc}\s+is\s+now\s+required`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-supported-version",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bminimum\s+supported\s+${zd}\s+version\s+is\s+(?:now\s+)?${Xc}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-msrv",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(rust)\b\s+MSRV\s+is\s+(?:now\s+)?${Xc}`,"i"),symbolGroup:1,summarize:e=>`Minimum Rust version is ${e[2]?.trim()}`}],dDe=[...ZQ.filter(e=>e.id.startsWith("prose-dropped-runtime")),{id:"prose-removed",kind:"removed-export",pattern:/`([\w$.]+)`(?:\(\))?\s+(?:has been|have been|was|were|is|are)\s+removed\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-removed-passive",kind:"removed-export",pattern:new RegExp(`\\b${uDe}\\s+(?:the\\s+)?\`([\\w$.]+)\``,"i"),symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-renamed",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?renamed\s+to\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was renamed to \`${e[2]}\``},{id:"prose-replaced",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?replaced\s+(?:by|with)\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was replaced by \`${e[2]}\``},{id:"prose-deprecated-in-favour",kind:"renamed-export",pattern:/`([\w$.]+)`\s+is\s+deprecated\s+in\s+favou?r\s+of\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` is deprecated in favour of \`${e[2]}\``},{id:"prose-no-longer",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer ${e[2]?.trim()}`},{id:"prose-now-requires",kind:"signature-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+(?:requires|takes|accepts|expects)\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now requires ${e[2]?.trim()}`},{id:"prose-now-returns",kind:"type-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+returns\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now returns ${e[2]?.trim()}`},{id:"prose-signature-of-symbol",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+of\s+`([\w$.]+)`[^.\n]{0,40}?\b(?:changed|changes|change\b|different|new\b)/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-symbol-signature-changed",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:call|constructor|method)?\s*signature\s+(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-nth-argument-of-symbol",kind:"signature-change",pattern:/\b(?:first|second|third|fourth|fifth|sixth|last|\d+(?:st|nd|rd|th))\s+(?:positional\s+)?(?:argument|parameter|param|arg)\s+(?:for|of|to|in|passed\s+to)\s+`([\w$.]+)`/i,symbolGroup:1,summarize:e=>`an argument of \`${e[1]}\` changed`},{id:"prose-symbol-no-longer-takes",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(?:takes|accepts|expects|requires)\s+(.{2,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer takes ${e[2]?.trim()}`},{id:"prose-signature-changed-phrase",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+(?:of\b[^.\n]{0,80}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b|\bchanged\s+(?:the\s+)?(?:\w+\s+){0,3}signature\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-call-shape-rewrite",kind:"signature-change",pattern:/\b(?:refactor(?:ed|ing)?\s+)?([\w$.]+)\s*\((?:[^()]|\([^()]*\))*\)\s*(?:->|→|into)\s*\1\s*\(/i,symbolGroup:0,summarize:()=>"a call signature was rewritten"},{id:"prose-verb-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:changed?|changing|updated?|updating|revamp(?:ed)?|rework(?:ed)?|adjust(?:ed)?|modif(?:y|ied)|switch(?:ed)?|new|different|generic\s+single)\s+(?:the\s+)?[\w`.$()/,&\s-]{0,45}?\bsignatures?\b|\bsignatures?\s+(?:of\b[^.\n]{0,60}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+|now\s+|changed|change[ds]|updated?)\b|\b(?:two|multiple|separate|distinct|overloaded)\s+signatures?\b|\binterfaces?\s+(?:has\s+|have\s+)?changed\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-argument-list-changed",kind:"signature-change",refinement:!0,pattern:new RegExp([String.raw`\b(?:arg(?:ument)?|param(?:eter)?)s?\s+order\b`,String.raw`\bargs?\s+now\s+(?:given|passed|taken)\b`,String.raw`\b(?:standardi[sz]e|standardi[sz]ed)\s+(?:the\s+)?arg(?:ument)?s?\b`,String.raw`\barg(?:ument)?s?\s+(?:have\s+been\s+|were\s+|are\s+|been\s+)?(?:swapped|reordered|re-ordered)\b`,"\\b`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\s+(?:(?:to|of|from|in|for)\\s+`?[\\w$.]+`?\\s+)?(?:have\\s+|has\\s+|have\\s+been\\s+|has\\s+been\\s+|is\\s+|are\\s+|was\\s+|were\\s+|been\\s+)?(?:removed|added|dropped|changed)\\b",String.raw`\breturn\s+types?\s+(?:has\s+|have\s+|now\s+)?(?:changed|change[ds])\b`,String.raw`\bupdate\s+[\w$.()]+\s+to\s+return\b`,String.raw`\btype\s+changed\s+from\b`,"\\breplaced?\\s+[\\w$.()`]{0,30}?\\s+args?\\s+w(?:ith|/)\\b","\\b(?:removed?|dropped?|added?)\\s+(?:the\\s+|a\\s+|an\\s+)?(?:deprecated\\s+|new\\s+|optional\\s+|required\\s+)?`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\b",String.raw`\bno\s+longer\s+(?:accepts?|takes?|supports?|allows?|passes?)\b[^.\n]{0,45}?(?:arg(?:ument)?s?|param(?:eter)?s?|[Ss]elector|callbacks?|thisArg)\b`,String.raw`\bcall\s+pattern\s+is\s+no\s+longer\b`,String.raw`\bis\s+no\s+longer\s+(?:a\s+)?valid\s+call\b`,"\\b(?:`?thisArg`?|this\\s+argument)\\b[^.\\n]{0,40}?\\b(?:removed|no\\s+longer|default|undefined|dropped)\\b",String.raw`\b(?:requires?|required|takes?|needs?|accepts?|expects?)\s+(?:a\s+|an\s+|the\s+)?(?:new|additional|extra|second|third|fourth)\s+(?:constructor\s+)?(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\b(?:constructor|function|method)\s+(?:signature\s+)?(?:now\s+)?(?:requires?|takes?|accepts?|expects?|required)\b`,String.raw`\bis\s+no\s+longer\s+(?:the\s+)?(?:first|second|third|fourth|fifth|last|\d+(?:st|nd|rd|th))\s+(?:arg(?:ument)?|param(?:eter)?)\b`,String.raw`\bnow\s+(?:have|has)\s+(?:two|three|multiple|several)\s+(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\bnow\s+(?:two|three)\s+param(?:eter)?s\b`,"\\b(?:use|using|takes?|expects?|switch(?:ed)?\\s+`?[\\w$.]+`?(?:\\s+setting)?\\s+to|switch(?:ed)?\\s+to|pass(?:ing)?|is\\s+now|are\\s+now|it\\s+is\\s+now)\\s+(?:an?\\s+|two\\s+|the\\s+)?(?:object\\s+options?|options?\\s+(?:object|hash)|config(?:uration)?\\s+(?:object|hash)|`?[\\w$.]+`?\\s+option\\b)",String.raw`\b(?:options?|config(?:uration)?)\s+(?:object|hash)\s+(?:as\b|instead\b|for\b)`,String.raw`\bparam(?:eter)?s?\s+(?:are|is)\s+no\s+longer\s+optional\b`,String.raw`\bformerly\s+a\s+config\s+object\b`].join("|"),"i"),symbolGroup:0,summarize:()=>"an argument list changed"},{id:"prose-async-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:make[s]?|made|turn(?:ed)?|change)\s+[\w`#.$()"\s]{1,40}?\s+(?:(?:in)?to\s+)?(?:be\s+)?(?:an?\s+)?a?sync(?:hronous)?(?:\s+function)?\b|\b(?:is|are|be)\s+(?:now\s+|an?\s+)*a?sync(?:hronous)?(?:\s+function|\s+now)?\b|\bnow\s+a?sync(?:hronous)?\b|\ba?sync\s+now\b|\basync\b[^.\n]{0,40}?\b(?:callback|promise|await|sync)\b|\b(?:callback|promise|sync)s?\b[^.\n]{0,40}?\basync\b|\bpromises?\s+instead\s+of\s+(?:using\s+)?callbacks?\b|\bnow\s+returns?\s+(?:a\s+|an\s+)?(?:promise|observable|thenable|query)\b|\bnow\s+return\s+promises\b|\breturns?\s+[\w"']+,?\s+not\s+(?:a\s+)?(?:promise|callback|query)\b|\b(?:needs?|has|have|dosnt\s+wait|doesn'?t\s+wait)\s+to\s+be\s+awaited\b|\bmust\s+(?:now\s+)?be\s+awaited\b|\b(?:update|change|updated)\s+(?:the\s+)?return\s+types?\b|\bdrop(?:ped|s)?\s+(?:support\s+for\s+)?callbacks?\b|\bremove[d]?\s+callback\s+support\b|\bno\s+(?:longer\s+)?(?:takes?|accepts?|using)\s+(?:a\s+|the\s+)?callbacks?\b/i,symbolGroup:0,summarize:()=>"a callback/return signature changed"},{id:"prose-symbol-now-required",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:is|are|becomes?|became)\s+now\s+(?:required|mandatory|non-optional)\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now required`},{id:"prose-is-now",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+(?:is|are|must)\s+now\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now ${e[2]?.trim()}`},{id:"prose-moved",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has\s+)?moved\s+to\s+`([\w$./@-]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` moved to \`${e[2]}\``},...ZQ.filter(e=>e.id.startsWith("prose-min-runtime")),{id:"prose-esm-only",kind:"module-system-change",pattern:/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b/i,symbolGroup:0,summarize:()=>"The package is now ESM-only and no longer supports `require()`",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-dropped-commonjs",kind:"module-system-change",pattern:/\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,symbolGroup:0,summarize:()=>"CommonJS support was dropped",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-breaking-change-footer",kind:"behaviour-change",pattern:/^BREAKING[ -]CHANGES?:\s*(.{3,160}?)(?:[.;]|$)/i,symbolGroup:0,summarize:e=>`Declared as a breaking change: ${e[1]?.trim()}`},{id:"prose-breaking-change-marker",kind:"unknown",pattern:/^BREAKING[ -]CHANGES?\b\s*:?\s*(?:none|n\/a)?\s*$/i,symbolGroup:0,summarize:()=>"Declared as a breaking change (no detail given)"}];function QQ(e){for(let t of e.split(` +`)){let n=t.replace(/\r$/,"").replace(/^\s*[-*>]+\s+/,"").replace(/\*{1,3}([^*\n]+?)\*{1,3}/g,"$1").replace(/\s*[-*=]{2,}\s*$/,"").trim();if(/^BREAKING[ -]CHANGES?\b[ \t]*(?::|[-–—][ \t]|$)/i.test(n)||/^#{1,6}[ \t].*\bbreaking\s+changes?\b/i.test(n))return!0}return!1}function XQ(e,t={}){let n=[],r=e.replace(/^[-*+]\s+/,"").trim();if(!r)return n;for(let i of dDe){let o=i.pattern.exec(r);if(!o)continue;let s=i.symbolGroup===0?null:o[i.symbolGroup];if(i.symbolGroup!==0&&!s)continue;let a=i.kind==="runtime-requirement"?pDe(o,i.id):void 0;if(i.kind==="runtime-requirement"&&!a)continue;let c=i.replacementGroup?o[i.replacementGroup]:void 0;n.push({ruleId:i.id,kind:i.kind,summary:a?a.kind==="minimum-runtime"?a.requirement.includes("||")?`Supported ${a.runtime} versions are now ${a.requirement}`:`Minimum ${a.runtime} version is now ${a.requirement}`:`${a.runtime} ${a.requirement} is no longer supported`:i.summarize(o),symbols:s?[s]:[],...a?{runtime:a}:{},replacementSymbols:c?[c]:[],...i.moduleSystem?{moduleSystem:{...i.moduleSystem,incompatibleUsage:[...i.moduleSystem.incompatibleUsage]}}:{},...i.refinement?{refinement:!0}:{},passage:r})}return t.anchored||n.some(i=>!i.refinement)?n:n.filter(i=>!i.refinement)}function pDe(e,t){let n=e[1]?.toLowerCase().replace(/\.js$/,""),r=e[2]?.trim();if(!n||!r||!["node","python","go","ruby","java","rust"].includes(n))return null;if(r.includes("||"))return mDe(n,r,e[0].trim(),t);let i=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(r);if(!i)return null;let o=i[1]??"",s=i[2],a=r.replace(/v?(\d+(?:\.\d+){0,3})/gi,(p,f)=>n==="java"?f.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):f),c=e[0].trim(),l=FM(n,o),u=l.status,d=a.replace(/^\s*[<>=^~]*\s*/,l.operator||">=");if(t.startsWith("prose-dropped-runtime")){if(o===""){let p=s.split(".");return{kind:"unsupported-runtime-range",runtime:n,requirement:r.includes(",")||/\s+[<>=^~]/.test(r)?d:p.length<3?`${s}.x`:s,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"unsupported-runtime-range",runtime:n,requirement:d,...o==="<"?{derivedMinimum:`>=${s}`}:{},...o==="<="?{derivedMinimum:`>${s}`}:{},sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"minimum-runtime",runtime:n,requirement:d,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}function fDe(e){let t=/^v?(\d+(?:\.\d+){0,3})$/i.exec(e.trim());if(!t)return e;let n=t[1];return n.split(".").length<3?`${n}.x`:n}function mDe(e,t,n,r){let i=t.split("||").map(c=>c.trim()).filter(Boolean);if(i.length<2)return null;let o=LM[e].supportsDisjunction?"parsed":"unknown",s=[];for(let c of i){let l=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(c);if(!l)return null;let u=l[1]??"",d=FM(e,u);d.status==="unknown"&&(o="unknown");let p=c.replace(/v?(\d+(?:\.\d+){0,3})/gi,(f,m)=>e==="java"?m.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):m);s.push(u===""?fDe(p):p.replace(/^\s*[<>=^~]*\s*/,d.operator))}let a={runtime:e,requirement:s.join(" || "),sourceText:n,...o==="unknown"?{rangeParseStatus:"unknown"}:{}};return r.startsWith("prose-dropped-runtime")?{kind:"unsupported-runtime-range",...a}:{kind:"minimum-runtime",...a}}function eX(e,t){let n=e.symbols[0]??"the affected API",r=e.replacementSymbols[0];switch(e.kind){case"removed-export":return`\`${n}\` was removed from \`${t}\`. Replace every usage. Verify against the installed version's actual exports before choosing a replacement \u2014 the changelog may be incomplete.`;case"renamed-export":return r?`Replace every usage of \`${n}\` with \`${r}\`, checking that the new API's signature matches before assuming it is a drop-in rename.`:`\`${n}\` was replaced. Migrate every usage to the documented successor.`;case"signature-change":return`The way \`${n}\` is called changed: ${e.summary}. Update every call site and confirm against the installed type declarations.`;case"type-change":return`The type produced by \`${n}\` changed: ${e.summary}. Update consumers of its return value, including any local type declarations.`;case"behaviour-change":return`Behaviour changed: ${e.summary}. Review call sites for assumptions that no longer hold. Prefer making the assumption explicit over silently adapting to the new behaviour.`;case"runtime-requirement":return e.runtime?.kind==="unsupported-runtime-range"?e.runtime.derivedMinimum?`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported. That unambiguously means a floor of ${e.runtime.derivedMinimum}; update the runtime version declared in CI workflows, engine fields, and container images accordingly.`:`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported, but the release note does not establish a replacement minimum. Review the project's declared runtime against authoritative upstream compatibility guidance rather than inventing one.`:`${e.summary}. Update the runtime version declared in CI workflows, engine fields, and container images. Do not change application logic for this.`;case"module-system-change":return`\`${t}\` no longer exposes a CommonJS-compatible entry point. Update each localized \`require('${t}')\` site to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import('${t}')\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`;case"config-change":return`Configuration must change: ${e.summary}.`;default:return`Review usages of \`${n}\` and update them: ${e.summary}`}}var gDe=["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"],hDe=["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"],yDe=["symbol","type","module","package","dependency-cohort","runtime","ecosystem"],bDe=["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"];var vDe={"export-removed":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["direct"]},"member-removed":{nature:"api-shape",detectability:["compile-time"],scope:"symbol",visibility:["direct"]},"signature-changed":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["direct"]},"kind-changed":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"member-now-required":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"entry-point-moved":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"package-removed":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"commonjs-entry-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"exports-require-condition-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"package-type-changed":{nature:"packaging",detectability:["manifest","link-or-import","compile-time"],scope:"package",visibility:["direct"]},"constant-value-changed":{nature:"behaviour",detectability:["static-semantic","runtime-only"],scope:"symbol",visibility:["direct"]},...wDe()};function wDe(){let e={};for(let t of Gc)for(let[n,r]of Object.entries(t.codes))e[n]=r.taxonomy;return e}var kDe={"removed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"renamed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"moved-export":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"module",visibility:["unknown"]},"signature-change":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["unknown"]},"type-change":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["unknown"]},"behaviour-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"default-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"removed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},"changed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},"required-field-added":{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"type",visibility:["unknown"]},"config-change":{nature:"configuration",detectability:["static-semantic","runtime-only"],scope:"module",visibility:["unknown"]},"module-system-change":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"runtime-requirement":{nature:"runtime-environment",detectability:["manifest","runtime-only"],scope:"runtime",visibility:["direct"]},unknown:{nature:"behaviour",detectability:["runtime-only"],scope:"module",visibility:["unknown"]}};function Gd(e,t){let n=t?vDe[t]:void 0;if(n)return{...tX(n),origin:"computed"};let r=kDe[e];return{...tX(r),origin:e==="unknown"?"default":"rule"}}function tX(e){return{nature:e.nature,detectability:[...e.detectability],scope:e.scope,visibility:[...e.visibility]}}function Nr(e){return e.taxonomy??Gd(e.kind)}function iX(e,t){if(!e||typeof e!="object")return t;let n=e,r=nX(n.nature,gDe),i=nX(n.scope,yDe),o=rX(n.detectability,hDe),s=rX(n.visibility,bDe);return!r||!i?t:{nature:r,scope:i,detectability:o.length>0?o:[...t.detectability],visibility:s.length>0?s:["unknown"],origin:"llm-normalized"}}function nX(e,t){return typeof e=="string"&&t.includes(e)?e:null}function rX(e,t){if(!Array.isArray(e))return[];let n=new Set;for(let r of e)typeof r=="string"&&t.includes(r)&&n.add(r);return t.filter(r=>n.has(r))}function P$(e){let t=["manifest","link-or-import","compile-time","static-semantic"];return!e.detectability.some(n=>t.includes(n))}var DFe={type:"object",properties:{changes:{type:"array",items:{type:"object",properties:{summary:{type:"string",description:"One sentence stating what changed upstream and why it breaks consumers."},remediation:{type:"string",description:"Imperative instructions for fixing affected call sites."},symbols:{type:"array",items:{type:"string"},description:"Exact identifiers to search for in consumer code: export names, method names, option keys, endpoint paths. Empty if the evidence names none."},kind:{type:"string",enum:["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement","unknown"]},evidenceId:{type:"string",description:"The id of the evidence excerpt this was extracted from."},taxonomy:{type:"object",properties:{nature:{type:"string",enum:["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"]},detectability:{type:"array",items:{type:"string",enum:["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"]},description:"What would have to run to notice this. Be honest: a change that only shows up at runtime must not be listed as compile-time."},scope:{type:"string",enum:["symbol","type","module","package","dependency-cohort","runtime","ecosystem"]},visibility:{type:"array",items:{type:"string",enum:["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"]},description:"Use `unknown` when the evidence does not say. Do not guess `direct`."}},required:["nature","detectability","scope","visibility"],additionalProperties:!1}},required:["summary","remediation","symbols","kind","evidenceId"],additionalProperties:!1}}},required:["changes"],additionalProperties:!1},OFe=`You extract breaking changes from dependency release notes for an automated refactoring tool. Rules you must follow: @@ -1416,70 +1394,70 @@ Rules you must follow: 3. \`symbols\` must be identifiers that would literally appear in consumer source code. Never put prose, descriptions, or package names there. If the evidence describes a change without naming an identifier, return an empty \`symbols\` array rather than inventing one. 4. \`evidenceId\` must be copied exactly from the evidence block the finding came from. 5. Do not restate a change that is already listed under "Already found" \u2014 those are handled. -6. Write \`remediation\` as instructions to an engineer, describing what to change. Do not speculate about replacements the evidence does not mention; say the replacement is unknown instead.`;async function h7(e,t,n,i){let{config:r,logger:o}=i,s=i.client??await RF(r,o);if(!s)return[];let a=t.filter(l=>!l.findings?.length&&l.source!=="semver-heuristic"&&l.source!=="registry-metadata");if(a.length===0)return[];let c=[];for(let l of e){let u=a.filter(d=>d.dependency===l.name&&d.workspace===l.workspace);if(u.length!==0)try{let d=await FOe(s,r,l,u,n,o);c.push(...UOe(d,l.name,l.workspace,u))}catch(d){o.warn(`LLM extraction failed for ${l.name}: ${d.message}`)}}return c}async function RF(e,t){let n=process.env[e.llm.apiKeyEnv];return n?LOe(n,t):(t.warn(`llm.enabled is true but ${e.llm.apiKeyEnv} is not set; skipping LLM extraction. The rule-based analyser still ran.`),null)}async function LOe(e,t){try{let n=await Promise.resolve().then(()=>(VM(),m7));return new n.default({apiKey:e})}catch{return t.warn("llm.enabled is true but @anthropic-ai/sdk is not installed. Run `npm install @anthropic-ai/sdk` or set llm.enabled: false."),null}}async function FOe(e,t,n,i,r,o){let s=r.filter(p=>p.dependency===n.name&&p.workspace===n.workspace).map(p=>`- ${p.summary}`).join(` -`),a=i.map(p=>` -${GOe(p.content,6e3)} +6. Write \`remediation\` as instructions to an engineer, describing what to change. Do not speculate about replacements the evidence does not mention; say the replacement is unknown instead.`;async function $te(e,t,n,r){let{config:i,logger:o}=r,s=r.client??await _j(i,o);if(!s)return[];let a=t.filter(l=>!l.findings?.length&&l.source!=="semver-heuristic"&&l.source!=="registry-metadata");if(a.length===0)return[];let c=[];for(let l of e){let u=a.filter(d=>d.dependency===l.name&&d.workspace===l.workspace);if(u.length!==0)try{let d=await LFe(s,i,l,u,n,o);c.push(...FFe(d,l.name,l.workspace,u))}catch(d){o.warn(`LLM extraction failed for ${l.name}: ${d.message}`)}}return c}async function _j(e,t){let n=process.env[e.llm.apiKeyEnv];return n?MFe(n,t):(t.warn(`llm.enabled is true but ${e.llm.apiKeyEnv} is not set; skipping LLM extraction. The rule-based analyser still ran.`),null)}async function MFe(e,t){try{let n=await Promise.resolve().then(()=>(kte(),wte));return new n.default({apiKey:e})}catch{return t.warn("llm.enabled is true but @anthropic-ai/sdk is not installed. Run `npm install @anthropic-ai/sdk` or set llm.enabled: false."),null}}async function LFe(e,t,n,r,i,o){let s=i.filter(p=>p.dependency===n.name&&p.workspace===n.workspace).map(p=>`- ${p.summary}`).join(` +`),a=r.map(p=>` +${zFe(p.content,6e3)} `).join(` `),c=[`Dependency: ${n.name} (${n.ecosystem})`,`Version change: ${n.from} \u2192 ${n.to} (${n.bump})`,"",s?`Already found by deterministic rules \u2014 do not repeat these: ${s} `:"","Evidence:",a].filter(Boolean).join(` -`),l=await e.messages.create({model:t.llm.model,max_tokens:16e3,system:MOe,thinking:{type:"adaptive"},output_config:{effort:t.llm.effort,format:{type:"json_schema",schema:OOe}},messages:[{role:"user",content:c}]});if(l.stop_reason==="refusal")return o.warn(`The model declined to analyse the prose for ${n.name}, so nothing was extracted from it. The rule-based analyser still ran.`),[];let u=l.content.find(p=>p.type==="text")?.text;if(!u)return o.warn(`The model returned no text for ${n.name}${l.stop_reason?` (stop reason: ${l.stop_reason})`:""}, so nothing was extracted from its prose.`),[];let d;try{d=JSON.parse(u)}catch(p){return o.warn(`The model's answer for ${n.name} was not readable as JSON (${p.message}), so nothing was extracted from its prose.`),[]}return Array.isArray(d.changes)?d.changes:(o.warn(`The model's answer for ${n.name} carried no \`changes\` array, so nothing was extracted from its prose.`),[])}function UOe(e,t,n,i){let r=new Set(i.map(o=>o.id));return e.filter(o=>r.has(o.evidenceId)).filter(o=>o.summary?.trim()).map(o=>({id:St("bc",t,n,"llm",o.summary),dependency:t,workspace:n,kind:g7(o.kind),summary:o.summary.trim(),remediation:o.remediation?.trim()||`Review usages of ${t} and update them.`,symbols:(o.symbols??[]).filter(jOe),confidence:"medium",taxonomy:p5(o.taxonomy,sp(g7(o.kind))),citations:[o.evidenceId]}))}function jOe(e){let t=e.trim();return!t||t.length>80||/\s/.test(t)&&!t.startsWith("/")?!1:/^[/@]?[\w$][\w$./{}-]*$/.test(t)}var zOe=new Set(["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement"]);function g7(e){return zOe.has(e)?e:"unknown"}function GOe(e,t){return e.length<=t?e:`${e.slice(0,t)} -\u2026(truncated)`}function VOe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var k7=require("node:crypto");var BOe=[{band:"high",min:.8},{band:"medium",min:.5},{band:"low",min:.2},{band:"none",min:0}];function NF(e){for(let t of BOe)if(e>=t.min)return t.band;return"none"}var y7={high:"Very confident",medium:"Fairly confident",low:"Not very confident",none:"Not enough evidence to say"};var Ql="drift-confidence-1",qOe={"type-surface-diff":"computed-artifact",...d8,changelog:"maintainer-narrative","github-release":"maintainer-narrative","migration-guide":"maintainer-guide","behavioural-diff":"dynamic-observation","registry-metadata":"registry","semver-heuristic":"heuristic"},WOe={"computed-artifact":.9,"maintainer-guide":.7,"maintainer-narrative":.6,"dynamic-observation":.5,registry:.4,heuristic:.2},b7=new WeakMap;function PF(e){let{change:t,evidence:n}=e,i=n.filter(d=>t.citations.includes(d.id)),r=[],o=[];if(i.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"no-citations",detail:"No evidence record backs this finding.",delta:0}],calibration:Ql};let s=HOe(i),a=0,c="";for(let d of s.keys()){let p=WOe[d]??.3;p>a&&(a=p,c=d)}r.push({code:`origin:${c}`,detail:`Strongest evidence class is ${CF(c)}.`,delta:a});let l=a,u=s.size-1;if(u>0){let d=Math.min(.15,.08*u);l+=d,r.push({code:"corroborated",detail:`Corroborated by ${u} other independent source class(es): ${[...s.keys()].filter(p=>p!==c).map(CF).join(", ")}.`,delta:d})}else i.length>1&&o.push({code:"single-origin",detail:`All ${i.length} citations trace to one source class (${CF(c)}), so they do not corroborate each other.`,delta:0});return s.size===1&&c==="heuristic"&&(l+=-.1,o.push({code:"heuristic-only",detail:"Only a semver heuristic supports this; no changelog, release note, or API diff was retrieved.",delta:-.1})),OF(l,r,o)}function HOe(e){let t=new Map,n=new Set;for(let i of e){let r=b7.get(i);if(r===void 0&&(r=(0,k7.createHash)("sha256").update(i.content.replace(/\s+/g," ").trim().toLowerCase()).digest("hex"),b7.set(i,r)),n.has(r))continue;n.add(r);let o=qOe[i.source]??"unknown",s=t.get(o);s?s.push(i):t.set(o,[i])}return t}function CF(e){switch(e){case"computed-artifact":return"a computed diff of the shipped artifact";case"maintainer-guide":return"a migration guide";case"maintainer-narrative":return"release notes or a changelog";case"registry":return"registry metadata";case"heuristic":return"a semver heuristic";default:return e}}function KOe(e){let{taxonomy:t,sites:n,localizationRan:i}=e,r=[],o=[];if(!i)return{score:0,band:"none",evidence:[],penalties:[{code:"localization-unavailable",detail:"No checkout was available, so Drift could not search this repository. This is not evidence that the change is unused.",delta:0}],calibration:Ql};if(t.scope==="runtime"&&e.runtimeState==="compatible")return{score:.85,band:"high",evidence:[{code:"runtime-compatible",detail:"The repository runtime declaration satisfies the requirement.",delta:.85}],penalties:[],calibration:Ql};if(n.length===0){let d=u_(t),p=e.localizationComplete===!1,f=t.scope==="runtime";return{score:0,band:"none",evidence:[],penalties:[{code:f?"runtime-compatibility-unresolved":p?"localization-incomplete":d?"not-locally-checkable":"no-usage-found",detail:f?"This is a requirement on the runtime this repository builds and deploys on, not on any code it calls. No source search can answer it; the repository's own declared runtime version is what decides.":p?"Drift searched the indexed source subset, but the file limit prevented an exhaustive absence claim.":d?"This change is only observable at runtime, so a source search cannot establish whether this repository is affected.":"Drift searched the files that import this dependency and found no usage of the affected symbols.",delta:0}],calibration:Ql}}let s=n.reduce((d,p)=>w7(p.confidence)>w7(d.confidence)?p:d),a=s.confidence==="high"?.85:s.confidence==="medium"?.6:.3;r.push({code:`site:${s.confidence}`,detail:s.confidence==="high"?`\`${s.matchedSymbol}\` is bound from an import of this dependency in ${s.file}.`:s.confidence==="medium"?`${s.file} imports this dependency and uses \`${s.matchedSymbol}\`, but the symbol was not traced to the import.`:`\`${s.matchedSymbol}\` appears in ${s.file}, but no import of this dependency was established \u2014 the match may be coincidental.`,delta:a});let c=a;if(n.length>1){let d=Math.min(.05,.01*(n.length-1));c+=d,r.push({code:"multiple-sites",detail:`${n.length} affected locations across ${new Set(n.map(p=>p.file)).size} file(s).`,delta:d})}let l=n.filter(d=>JOe(d.file));return l.length===n.length?(c+=-.25,o.push({code:"generated-only",detail:`Every affected location is in generated code (${l[0].file}). Editing it is usually wrong; the generator is the real site.`,delta:-.25})):l.length>0&&(c+=-.05,o.push({code:"some-generated",detail:`${l.length} affected location(s) are in generated code.`,delta:-.05})),t.visibility.includes("reflection-or-dynamic")&&(c+=-.2,o.push({code:"dynamic-access",detail:"Dynamic or reflective access was detected, so the affected set cannot be enumerated by search.",delta:-.2})),t.visibility.includes("wrapper-mediated")&&(c+=-.1,o.push({code:"wrapper-mediated",detail:"Usage is mediated by a local wrapper, so downstream callers of the wrapper are not enumerated here.",delta:-.1})),n.every(d=>d.confidence==="low")&&(c+=-.1,o.push({code:"textual-only",detail:"Every match is textual \u2014 no import edge was established for any of them.",delta:-.1})),OF(c,r,o)}function JOe(e){let t=e.toLowerCase();return/(^|\/)(generated|__generated__|gen|dist|build|out|vendor|node_modules)\//.test(t)||/\.(g|generated)\.[a-z]+$/.test(t)||/\.pb\.(go|ts|js|py)$/.test(t)||/_pb2?\.py$/.test(t)||/\.d\.ts$/.test(t)}function ZOe(e){let{outcomes:t,affectedFiles:n,taxonomy:i}=e;if(t.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"nothing-ran",detail:"No checks were run against this finding, so nothing confirms the change was understood correctly.",delta:0}],calibration:Ql};let r=[],o=[],s=t.filter(p=>p.status==="passed"),a=t.filter(p=>p.status==="failed"),c=t.filter(p=>p.status==="skipped"||p.status==="unavailable"||p.status==="timed-out");if(a.length>0)return{score:0,band:"none",evidence:[],penalties:[{code:"checks-failed",detail:`${a.length} check(s) failed: ${a.map(p=>p.name).join(", ")}.`,delta:0}],calibration:Ql};let l=0,u=i.detectability.some(p=>p==="compile-time"||p==="link-or-import"||p==="manifest");for(let p of s){let f=/type|compile|build|lint/i.test(p.name),g=/test|spec/i.test(p.name)?.45:f?u?.4:.15:.1;l+=g,r.push({code:`passed:${p.name}`,detail:f&&!u?`\`${p.name}\` passed, but this change is not detectable at compile time \u2014 it does not confirm the behaviour is right.`:`\`${p.name}\` passed.`,delta:g})}for(let p of c)o.push({code:`did-not-run:${p.name}`,detail:`\`${p.name}\` was ${p.status} and proves nothing.`,delta:0});let d=new Set(s.flatMap(p=>p.covers??[]));return d.size>0&&n.length>0?n.filter(f=>d.has(f)).length===0&&(l+=-.2,o.push({code:"no-coverage",detail:"The checks that passed do not cover any of the affected files.",delta:-.2})):n.length>0&&o.push({code:"coverage-unknown",detail:"Which code paths the passing checks cover could not be established.",delta:0}),OF(l,r,o)}function $7(e){let t=PF({change:e.change,evidence:e.evidence}),n=KOe({change:e.change,taxonomy:e.taxonomy,sites:e.sites,localizationRan:e.localizationRan,localizationComplete:e.localizationComplete,runtimeState:e.runtimeState}),i=ZOe({outcomes:e.outcomes??[],affectedFiles:[...new Set(e.sites.map(a=>a.file))],taxonomy:e.taxonomy}),r=[...e.gaps??[]],o=[];t.band==="high"&&n.band==="none"&&o.push({code:"upstream-only",detail:"The upstream change is well established, but nothing in this repository was shown to be affected. High upstream confidence is not a reason to edit code.",delta:0});let s=t.band==="high"&&(n.band==="high"||n.band==="medium")&&!r.some(a=>a.automaticExecution==="blocks");return{upstream:t,localImpact:n,verification:i,automaticExecutionEligible:s,reasons:o,checkedSurfaces:[...e.checkedSurfaces??[]],gaps:r}}function DF(e){let{upstream:t,localImpact:n,verification:i}=e,r=n.band==="none"?Math.min(t.score,.55):Math.min(t.score,n.score),o=i.score>0?Math.min(.1,i.score*.15):0,s=Math.round(Math.max(0,Math.min(1,r+o))*100),a=NF(s/100);return{score:s,band:a,label:y7[a]}}function _7(e){let t=e.upstream.band,n=e.localImpact.band;return n==="none"?t==="high"?"medium":v7(t):v7(YOe(t,n))}function v7(e){return e==="high"?"high":e==="medium"?"medium":"low"}function YOe(e,t){let n=["none","low","medium","high"];return n.indexOf(e)<=n.indexOf(t)?e:t}function w7(e){return e==="high"?2:e==="medium"?1:0}function OF(e,t,n){let i=Math.round(Math.max(0,Math.min(1,e))*100)/100;return{score:i,band:NF(i),evidence:t,penalties:n,calibration:Ql}}async function BS(e,t,n){let{config:i,logger:r}=n,o=QOe(t),s=[];for(let a of e){let c=o.get(zc(a))??[];s.push(...XOe(a.name,a.workspace,c))}for(let a of t)a8(a.source)&&s.push(...E7(a));if(i.llm.enabled){let a=await h7(e,t,s,{config:i,logger:r});s.push(...a)}return iMe(sMe(s),t)}function QOe(e){let t=new Map;for(let n of e){let i=zc({name:n.dependency,workspace:n.workspace}),r=t.get(i);r?r.push(n):t.set(i,[n])}return t}function XOe(e,t,n){let i=[];for(let r of n){if(r.findings?.length){i.push(...E7(r));continue}if(r.source!=="semver-heuristic"){if(r.source==="registry-metadata"){i.push(...x7(r,e,t).filter(o=>o.kind==="runtime-requirement"));continue}i.push(...x7(r,e,t))}}return i}function eMe(e,t){return e.replace(/`default\.([\w$]+)`/g,`\`${t}.$1\``).replace(/`default` is no longer exported/g,`\`${t}\` no longer has a default export`).replace(/`default`/g,`the default export of \`${t}\``)}function E7(e){return(e.findings??[]).map(t=>{let n=l_(t.code),i=n==="module-system-change"?t.moduleSystem??{from:"dual",to:"esm",incompatibleUsage:["require"]}:void 0;return{id:St("bc",e.dependency,e.workspace,t.code,t.symbol,i?.affectedSpecifiers?.join(",")??"",i?.affectedSpecifierPatterns?.join(",")??""),dependency:e.dependency,workspace:e.workspace,kind:n==="removed-export"&&t.replacement?"renamed-export":n,summary:eMe(t.detail,e.dependency),...t.replacement?{replacementSymbols:[t.replacement]}:{},...n==="runtime-requirement"&&t.after?{runtime:{kind:"minimum-runtime",runtime:"java",requirement:`>=${t.after}`,sourceText:t.detail}}:{},before:t.before,after:t.after,...t.fromKind?{fromKind:t.fromKind}:{},...t.toKind?{toKind:t.toKind}:{},remediation:o5(t,e.dependency),symbols:tMe(t),...i?{moduleSystem:{...i,incompatibleUsage:[...i.incompatibleUsage],...i.affectedSpecifiers?{affectedSpecifiers:[...i.affectedSpecifiers]}:{},...i.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...i.affectedSpecifierPatterns]}:{}}}:{},confidence:"high",taxonomy:sp(n,t.code),citations:[e.id]}})}function tMe(e){if(l_(e.code)==="module-system-change")return[];let t=new Set([e.symbol]);if(e.symbol.includes(".")&&!/\s/.test(e.symbol)){let i=e.symbol.split("."),r=i[i.length-1];if(r&&!S7(r)&&t.add(r),i.length>2){let o=i[i.length-2];o&&t.add(`${o}.${r}`)}if(i.length>=2&&l_(e.code)==="required-field-added"){let o=i[i.length-2];o&&!S7(o)&&t.add(o)}}let n=/^[A-Z]+\s+(\/\S*)$/.exec(e.symbol);if(n?.[1]){t.add(n[1]);let i=n[1].split("{")[0]?.replace(/\/$/,"");i&&i.length>1&&t.add(i)}return[...t]}function S7(e){return/^__\w+__$/.test(e)?!0:nMe.has(e.toLowerCase())}var nMe=new Set(["add","all","any","append","apply","build","call","check","clear","clone","close","connect","copy","count","create","define","delete","each","emit","end","execute","exists","extend","fetch","filter","find","first","flush","format","get","handle","has","index","init","insert","is","items","iter","join","keys","last","length","list","load","log","main","map","match","new","next","open","parse","pop","push","put","query","read","remove","render","reset","resolve","run","save","send","set","size","sort","split","start","stop","update","wait","write","args","body","config","content","context","data","error","file","header","headers","host","id","key","name","options","params","path","port","result","root","status","text","type","url","value","values","and","or","not","if","elif","else","for","while","do","in","of","as","with","from","to","try","catch","finally","throw","raise","except","switch","case","break","continue","return","yield","class","def","function","lambda","const","let","var","this","self","super","null","nil","none","true","false","async","await","typeof","instanceof","void","enum","interface","extends","implements","export","import","static","public","private","protected","default","pass","then"]);function x7(e,t,n){let i=[],r=new Set,o=s5(e.content);for(let s of e.content.split(` -`))for(let a of a5(s,{anchored:o})){let c=`${a.kind}:${a.symbols.join(",")}`;if(r.has(c))continue;r.add(c);let l=a.symbols.length>0||a.kind==="module-system-change"?a.symbols:[t];i.push({id:St("bc",t,n,a.ruleId,a.symbols.join(",")),dependency:t,workspace:n,kind:a.kind,summary:a.summary,remediation:c5(a,t),symbols:l,...a.runtime?{runtime:a.runtime}:{},replacementSymbols:a.replacementSymbols.length?a.replacementSymbols:void 0,...a.moduleSystem?{moduleSystem:a.moduleSystem}:{},confidence:rMe(e),taxonomy:sp(a.kind),citations:[e.id]})}return i}function rMe(e){return e.weight>=.95?"high":e.weight>=.6?"medium":"low"}function iMe(e,t){return e.map(n=>{let i=PF({change:n,evidence:t});return{...n,confidence:oMe(i.band)}})}function oMe(e){return e==="high"?"high":e==="medium"?"medium":"low"}function sMe(e){let t=new Map;for(let i of e){let r=aMe(i),o=t.get(r);if(!o){t.set(r,{...i,citations:[...new Set(i.citations)]});continue}t.set(r,{...o,summary:o.summary.length>=i.summary.length?o.summary:i.summary,symbols:[...new Set([...o.symbols,...i.symbols])],replacementSymbols:[...new Set([...o.replacementSymbols??[],...i.replacementSymbols??[]])].filter(Boolean).length?[...new Set([...o.replacementSymbols??[],...i.replacementSymbols??[]])]:void 0,moduleSystem:cMe(o.moduleSystem,i.moduleSystem),confidence:uMe(o.confidence,i.confidence),taxonomy:lMe(Or(o),Or(i)),citations:[...new Set([...o.citations,...i.citations])]})}let n={high:0,medium:1,low:2};return[...t.values()].sort((i,r)=>n[i.confidence]-n[r.confidence]||i.dependency.localeCompare(r.dependency))}function aMe(e){let t=zc({name:e.dependency,workspace:e.workspace});return e.kind==="module-system-change"?[t,e.kind,[...e.moduleSystem?.incompatibleUsage??[]].sort().join(","),e.moduleSystem?.affectedSpecifiers?.length?[...e.moduleSystem.affectedSpecifiers].sort().join(","):"*",e.moduleSystem?.affectedSpecifierPatterns?.length?[...e.moduleSystem.affectedSpecifierPatterns].sort().join(","):"*"].join("|"):`${t}|${e.kind}|${[...e.symbols].sort().join(",")}`}function cMe(e,t){if(!e)return t;if(!t)return e;let n=[...new Set([...e.incompatibleUsage,...t.incompatibleUsage])],i=e.affectedSpecifiers||t.affectedSpecifiers?[...new Set([...e.affectedSpecifiers??[],...t.affectedSpecifiers??[]])]:void 0,r=e.affectedSpecifierPatterns||t.affectedSpecifierPatterns?[...new Set([...e.affectedSpecifierPatterns??[],...t.affectedSpecifierPatterns??[]])]:void 0;return{from:e.from??t.from,to:e.to??t.to,incompatibleUsage:n,...i?{affectedSpecifiers:i}:{},...r?{affectedSpecifierPatterns:r}:{}}}function lMe(e,t){let n={computed:3,rule:2,"llm-normalized":1,default:0};return n[e.origin]>=n[t.origin]?e:t}function uMe(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]?e:t}function MF(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]}function qS(e){return e.keys??[e.packageName]}function _f(e){let t=[],n=new Map,i=new Set(e.map(s=>s.path));for(let s of e){let a=dMe(s),c=VMe(s);t.push({path:s.path,language:s.language,lineCount:s.lineCount,imports:a,localImports:pMe(s),units:c,summary:JMe(s,c,a)});for(let l of new Set(a.flatMap(qS))){let u=n.get(l);u?u.push(s.path):n.set(l,[s.path])}}let r=new Map,o=hMe(i);for(let s of t)for(let a of s.localImports){let c=yMe(s.path,a.specifier,i,o);if(!c||c===s.path)continue;let l=r.get(c),u={from:s.path,bindings:a.bindings,reExport:a.reExport,line:a.line};l?l.push(u):r.set(c,[u])}return{files:t,importers:n,localImporters:r,stats:{fileCount:t.length,unitCount:t.reduce((s,a)=>s+a.units.length,0),totalLines:t.reduce((s,a)=>s+a.lineCount,0)}}}function FF(e,t){let n;for(let i of e.units)ti.endLine||(!n||i.endLine-i.startLine]+)>|"([^"]+)")/.exec(n[i]),o=r?.[1]??r?.[2];o&&t.push({specifier:o,line:i+1,bindings:[],reExport:!0})}return t}function hMe(e){let t=new Map,n=(i,r)=>{let o=t.get(i);o?o.push(r):t.set(i,[r])};for(let i of e){let r=i.split("/").pop()??i;n(r.toLowerCase(),i)}return t}var T7=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".py"];function yMe(e,t,n,i){if(t.startsWith(".")){let s=e.split("/").slice(0,-1),a=bMe([...s,...t.split("/")]);if(a===void 0)return;let l=/^\.+$/.test(t)||!t.includes("/")&&t.startsWith(".")?[`${I7(e,t)}.py`,`${I7(e,t)}/__init__.py`]:[a,...T7.map(u=>a+u),...T7.map(u=>`${a}/index${u}`),`${a}/__init__.py`];for(let u of l)if(u&&n.has(u))return u;return}let r=(t.split("/").pop()??t).toLowerCase(),o=(i.get(r)??[]).filter(s=>s.toLowerCase().endsWith(t.toLowerCase()));return o.length===1?o[0]:void 0}function bMe(e){let t=[];for(let n of e)if(!(n===""||n===".")){if(n===".."){if(t.length===0)return;t.pop();continue}t.push(n)}return t.join("/")}function I7(e,t){let n=/^\.+/.exec(t)?.[0].length??1,i=t.slice(n).split(".").filter(Boolean);return[...e.split("/").slice(0,-n),...i].join("/")}function vMe(e){let t=[],n=e.split(` -`);for(let i=0;i]+)>|"([^"]+)")/.exec(n[i]),o=r?.[1]??r?.[2];o&&(o.startsWith(".")||t.push({specifier:o,packageName:wMe(o),bindings:[],line:i+1,reExport:!0}))}return t}function wMe(e){return(e.split("/")[0]??e).replace(/\.(h|hpp|hh|hxx|inl|tpp|h\+\+)$/i,"").toLowerCase()}function kMe(e){let t=gO(e),n=[],i=P7(t),r=d=>D7(i,d),o=/\bimport\s+(?!\()(?:(?:type\s+)?([\w$]+)\s*,\s*)?(?:type\s+)?(?:\{([^}]+)\}|\*\s+as\s+([\w$]+)|([\w$]+))\s+from\s+['"]([^'"]+)['"]|\bimport\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(o)){let p=d[5]??d[6];if(!p||wf(p))continue;let f=LF(d[1],d[2],d[3],d[4]),m=d[1]??d[4];n.push({specifier:p,packageName:kf(p),bindings:f,...m?{defaultBinding:m}:{},line:r(d.index??0),loadStyle:"esm-static"})}let s=/\b(?:const|let|var)\s+(\{[^}]+\}|[\w$]+)\s*=\s*require\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(s)){let p=d[2];if(wf(p))continue;let f=d[1],m=f.startsWith("{")?void 0:f;n.push({specifier:p,packageName:kf(p),bindings:$Me(f),...m?{defaultBinding:m}:{},line:r(d.index??0),loadStyle:"commonjs-require"})}let a=/\bimport\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(a)){let p=d[1];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:[],line:r(d.index??0),loadStyle:"esm-dynamic"})}let c=/\bexport\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(c)){let p=d[2];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:LF(void 0,d[1],void 0,void 0),line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}let l=/\bexport\s+\*\s+as\s+([\w$]+)\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(l)){let p=d[2];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:["*",d[1]],line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}let u=/\bexport\s+\*\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(u)){let p=d[1];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:["*"],line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}return n.sort((d,p)=>d.line-p.line||d.specifier.localeCompare(p.specifier))}function LF(e,t,n,i){let r=[];if(e&&r.push(e),i&&r.push(i),n&&r.push("*",n),t)for(let o of t.split(",")){let s=o.replace(/\btype\s+/g,"").trim();if(!s)continue;let[a,c]=s.split(/\s+as\s+/).map(l=>l.trim());a&&r.push(c||a,a)}return[...new Set(r)]}function $Me(e){let t=e.trim();return t.startsWith("{")?t.replace(/[{}]/g,"").split(",").flatMap(n=>{let[i,r]=n.split(":").map(o=>o.trim());return[i,r].filter(o=>!!o)}):[t]}function _Me(e,t){let n=[],i=e.split(` -`),r=t.endsWith("/__init__.py")||t==="__init__.py";for(let o=0;o{let n=/^\s*(\w+)(?:\s+as\s+(\w+))?/.exec(t);return n?[n[1],n[2]].filter(Boolean):[]}).flat()}function SMe(e){let t=[],n=e.split(` -`),i=!1;for(let r=0;r{let r=i.trim();if(!r)return;let o=r.indexOf("{");if(o!==-1){let c=r.lastIndexOf("}"),l=r.slice(o+1,c===-1?void 0:c);for(let u of TMe(l))n(u);return}let s=/\bas\s+([\w*]+)\s*$/.exec(r);if(s?.[1]){t.push(s[1]);return}let a=r.split("::").pop()?.trim();if(a&&(t.push(a==="*"?"*":a),a==="self")){let c=r.split("::").slice(-2,-1)[0]?.trim();c&&t.push(c)}};return n(e),[...new Set(t.filter(i=>i!=="self"))]}function TMe(e){let t=[],n=0,i="";for(let r of e){if(r==="{"?n+=1:r==="}"&&(n-=1),r===","&&n===0){t.push(i),i="";continue}i+=r}return t.push(i),t}function IMe(e){let t=[],n=e.split(` -`);for(let i=0;io.slice(0,a+1).join("\\")).reverse()}}function DMe(e){let t=[],n=new Set,i=e.split(` -`),r=(s,a,c,l=!1)=>{let u=s.split(".")[0];if(!/^[A-Z]/.test(u)||OMe.has(u)||n.has(s))return;n.add(s);let d=s.split(".");t.push({specifier:s,packageName:u,bindings:[...new Set([a,s])],line:c,keys:d.map((p,f)=>d.slice(0,f+1).join(".")).reverse(),...l?{synthetic:!0}:{}})},o=!1;for(let s=0;s{zMe.has(l)||n.has(l)||(n.add(l),t.push({specifier:l,packageName:l,bindings:[l],line:r+1,...u?{synthetic:!0}:{}}))},a=/^\s*open\s+([A-Z][\w']*)/.exec(o);if(a?.[1]){s(a[1]);continue}let c=/^\s*module\s+[A-Z][\w']*\s*=\s*([A-Z][\w']*)/.exec(o);if(c?.[1]){s(c[1]);continue}for(let l of o.matchAll(/\b([A-Z][\w']*)\.[a-z_]/g))s(l[1],!0)}return t}var zMe=new Set(["Stdlib","List","Array","String","Bytes","Char","Int","Int32","Int64","Float","Bool","Option","Result","Hashtbl","Map","Set","Buffer","Printf","Format","Sys","Unix","Filename","Sort","Queue","Stack","Lazy","Seq","Fun","Either","Printexc","Random","Digest","Obj"]);function GMe(e){let t=e.trim();if(!t)return["*"];let n=[],i=/\bshow\s+([\w\s,]+)/.exec(t);i?.[1]&&n.push(...i[1].split(",").map(o=>o.trim()).filter(Boolean));let r=/\bas\s+(\w+)/.exec(t);return r?.[1]&&n.push(r[1]),n.length===0&&n.push("*"),[...new Set(n)]}function wf(e){return e.startsWith(".")||e.startsWith("/")||e.startsWith("#")}function kf(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function VMe(e){return e.language==="typescript"||e.language==="javascript"?BMe(e.content,e.path):HMe(e.content,e.language)}function BMe(e,t){let n=[],i=e.split(` -`),r=WMe(i),o=(s,a,c,l,u,d)=>{n.push({name:s,kind:a,startLine:c,endLine:l,summary:L7(u),exported:d})};for(let s=0;s|^\s*=\s*(?:async\s*)?function\b/.test(h);o(m[1],b?"function":"variable",s+1,R7(i,s)+1,`${b?"const fn":"const"} ${m[1]}`,l);continue}let g=/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([\w$]+)/.exec(c);g&&o(g[1],"module",s+1,$f(i,s)+1,`module ${g[1]}`,l)}return n}function qMe(e,t,n,i,r){let o=0;for(let s=t;s{let a=r.slice(s+1).find(c=>c.indent<=o.indent);return{name:o.name,kind:o.kind,startLine:o.line,endLine:a?a.line-1:i.length,summary:o.summary,exported:!0}})}var KMe={python:[{pattern:/^(?:async\s+)?def\s+(\w+)\s*\(/,kind:"function"},{pattern:/^class\s+(\w+)\s*[(:]/,kind:"class"}],go:[{pattern:/^func\s+(?:\([^)]*\)\s*)?(\w+)\s*[[(]/,kind:"function"},{pattern:/^type\s+(\w+)\s+(?:struct|interface)\s*\{/,kind:"type"}],rust:[{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?fn\s+(\w+)/,kind:"function"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+(\w+)/,kind:"class"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:enum|trait)\s+(\w+)/,kind:"type"},{pattern:/^impl(?:<[^>]*>)?\s+(?:\w+\s+for\s+)?(\w+)/,kind:"class"}],java:[{pattern:/^(?:public|private|protected|abstract|final|static|\s)*(?:class|interface|enum|record)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|static|final|synchronized|abstract|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],ruby:[{pattern:/^def\s+(?:self\.)?(\w+[?!=]?)/,kind:"method"},{pattern:/^(?:class|module)\s+([\w:]+)/,kind:"class"}],dotnet:[{pattern:/^(?:public|private|protected|internal|sealed|abstract|static|partial|\s)*(?:class|interface|struct|record|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|internal|static|virtual|override|async|sealed|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],php:[{pattern:/^(?:abstract\s+|final\s+|readonly\s+)*(?:class|interface|trait|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|private\s+|protected\s+|static\s+|abstract\s+|final\s+)*function\s+&?(\w+)\s*\(/,kind:"function"}],elixir:[{pattern:/^\s*defmodule\s+([A-Z][\w.]*)/,kind:"module"},{pattern:/^\s*(?:def|defp|defmacro|defmacrop|defguard|defdelegate)\s+([a-z_]\w*[!?]?)/,kind:"function"},{pattern:/^\s*(?:defstruct|defexception|defprotocol|defimpl)\s+([A-Z][\w.]*)?/,kind:"type"}],erlang:[{pattern:/^([a-z]\w*)\s*\(.*\)\s*(?:when\b.*)?->/,kind:"function"},{pattern:/^-record\(\s*(\w+)/,kind:"type"}],swift:[{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|final\s+|@\w+\s+)*(?:class|struct|enum|protocol|actor|extension)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|static\s+|final\s+|override\s+|mutating\s+|@\w+\s+)*func\s+(\w+)/,kind:"function"}],dart:[{pattern:/^(?:abstract\s+|base\s+|final\s+|sealed\s+|interface\s+)*(?:class|mixin|enum|extension)\s+(\w+)/,kind:"class"},{pattern:/^typedef\s+(\w+)/,kind:"type"}],ocaml:[{pattern:/^let\s+(?:rec\s+)?([a-z_]\w*)/,kind:"function"},{pattern:/^(?:module|module\s+type)\s+([A-Z]\w*)/,kind:"module"},{pattern:/^type\s+(?:'\w+\s+)?([a-z_]\w*)/,kind:"type"}],c:N7(),cpp:[{pattern:/^(?:template\s*<[^>]*>\s*)?(?:class|struct)\s+(?:\w+_API\s+|\w+_EXPORT\s+)?(\w+)\s*(?::|\{|$)/,kind:"class"},{pattern:/^namespace\s+(\w+)/,kind:"module"},...N7()]};function N7(){return[{pattern:/^typedef\s+(?:struct|union|enum)?\s*[\w\s*]*?(\w+)\s*;/,kind:"type"},{pattern:/^(?:typedef\s+)?(?:struct|union|enum)\s+(\w+)\s*\{?\s*$/,kind:"class"},{pattern:/^(?!(?:return|if|while|for|switch|case|else|do|sizeof|typeof|delete|throw|catch|assert)\b)(?:(?:static|extern|inline|const|constexpr|virtual|explicit|friend|unsigned|signed|struct|enum|class|\w+_API|\w+_EXPORT)\s+)*[\w:<>,\s]*?[\w>]\s*[*&\s]\s*(\w+)\s*\([^;]*\)\s*(?:const\s*)?(?:noexcept\s*)?[{;]?\s*$/,kind:"function"},{pattern:/^#\s*define\s+(\w+)\s*\(/,kind:"function"}]}function JMe(e,t,n){let i=t.filter(a=>a.exported).map(a=>a.name),r=i.slice(0,8),o=[...new Set(n.map(a=>a.packageName))].slice(0,6),s=[`${e.path} (${e.language}, ${e.lineCount} lines)`];return r.length&&s.push(`defines ${r.join(", ")}${i.length>r.length?`, +${i.length-r.length} more`:""}`),o.length&&s.push(`imports ${o.join(", ")}`),s.join(" \u2014 ")}function L7(e){return e.replace(/\s+/g," ").trim().slice(0,200)}function GF(e,t){return`${e}|${t}`}var ZMe=2e4;async function WS(e,t){let n=new Map;for(let s of e){if(!zF[s.ecosystem])continue;let a=GF(s.ecosystem,s.name);n.has(a)||n.set(a,s)}let i=new Map;if(n.size===0)return i;let r=[...n.entries()],o=await qn(r,t.concurrency??6,async([s,a])=>{let c=a.to??a.from;if(!c)return[s,void 0];try{let l=await aLe(`${s}|${c}`,()=>zF[a.ecosystem](a.name,c,{timeoutMs:t.timeoutMs??ZMe}));return[s,l]}catch(l){return t.logger.debug(`Module map failed for ${s}: ${l.message}`),[s,void 0]}});for(let[s,a]of o)a&&a.names.length>0&&i.set(s,a);return t.logger.debug(`Resolved ${i.size} of ${n.size} module map(s) from published artefacts`),i}var YMe=async(e,t,{timeoutMs:n})=>{let r=(await $e(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{timeoutMs:n,immutable:!0}))?.urls?.find(l=>l.packagetype==="bdist_wheel"&&l.url);if(!r?.url)return;let o=await Ty(r.url,n);if(!o)return;let s=o.find(l=>/(^|\/)[^/]+\.dist-info\/top_level\.txt$/.test(l.path));if(s){let l=Ey(s).split(` -`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));if(l.length>0)return{names:[...new Set(l)],source:`${r.filename??"wheel"} top_level.txt`}}let a=o.find(l=>/(^|\/)[^/]+\.dist-info\/RECORD$/.test(l.path));if(!a)return;let c=new Set;for(let l of Ey(a).split(` -`)){let u=l.split(",")[0]?.trim();if(!u)continue;let d=u.split("/")[0];!d||d.startsWith(".")||/\.(dist-info|data)$/.test(d)||c.add(d.endsWith(".py")?d.slice(0,-3):d)}return c.delete(""),c.size>0?{names:[...c],source:`${r.filename??"wheel"} RECORD`}:void 0},QMe=async(e,t,{timeoutMs:n})=>{let[i,r]=e.split(":");if(!i||!r)return;let s=`https://repo1.maven.org/maven2/${i.replace(/\./g,"/")}/${r}/${t}/${r}-${t}.jar`,a=await Ty(s,n);if(!a)return;let c=new Set;for(let l of a){if(!l.path.endsWith(".class")||l.path.startsWith("META-INF/"))continue;let u=l.path.split("/").slice(0,-1);u.length!==0&&c.add(u.join("."))}return c.size>0?{names:[...c],source:`${r}-${t}.jar`}:void 0},XMe=async(e,t,{timeoutMs:n})=>{let i=e.toLowerCase(),r=t.toLowerCase(),o=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(i)}/${encodeURIComponent(r)}/${encodeURIComponent(i)}.${encodeURIComponent(r)}.nupkg`,s=await Ty(o,n);if(!s)return;let{readAssembly:a}=await Promise.resolve().then(()=>(MO(),$9)),c=new Set;for(let l of s){if(!/^lib\/.+\.dll$/i.test(l.path)&&!/^ref\/.+\.dll$/i.test(l.path))continue;let u;try{u=a(l.read())}catch{continue}for(let d of u??[]){let p=d.fullName.lastIndexOf(".");p>0&&c.add(d.fullName.slice(0,p))}if(c.size>0)break}return c.size>0?{names:[...c],source:`${e} ${t} assembly metadata`}:void 0},eLe=async(e,t,{timeoutMs:n})=>{let r=(await $e(`https://repo.packagist.org/p2/${e.toLowerCase()}.json`,{timeoutMs:n}))?.packages?.[e.toLowerCase()];if(!r?.length)return;let o=Gk(r),a=(Vk(o,t)??o[0])?.autoload??void 0,c=new Set;for(let l of[a?.["psr-4"],a?.["psr-0"]])for(let u of Object.keys(l??{})){let d=u.replace(/\\+$/,"");d&&c.add(d)}return c.size>0?{names:[...c],source:`${e} composer.json autoload`}:void 0},tLe=async(e,t,{timeoutMs:n})=>{let i=await Ty(`https://repo.hex.pm/tarballs/${encodeURIComponent(e)}-${encodeURIComponent(t)}.tar`,n);if(!i)return;let r=i.find(c=>c.path==="contents.tar.gz"||c.path.endsWith("/contents.tar.gz"));if(!r)return;let o;try{o=Fn(r.read())}catch{return}let s=new Set;for(let c of o)if(/^(lib|src)\//.test(c.path)){if(/\.(ex|exs)$/.test(c.path)){for(let l of nLe(Ey(c)))s.add(l);continue}if(/\.erl$/.test(c.path)){let l=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(Ey(c));l?.[1]&&s.add(l[1])}}if(s.size===0)return;let a=new Set;for(let c of s)a.add(c.split(".")[0]);return{names:[...new Set([...s,...a])],source:`${e} ${t} hex tarball`}};function nLe(e){let t=[],n=[],i=!1;for(let r of e.split(` -`)){let o=(r.match(/"""/g)??[]).length;if(i){o%2===1&&(i=!1);continue}if(o%2===1){i=!0;continue}let s=/^(\s*)defmodule\s+([A-Z][\w.]*)/.exec(r);if(!s)continue;let a=s[1].length;for(;n.length>0&&n[n.length-1].indent>=a;)n.pop();let c=n[n.length-1]?.name,l=c?`${c}.${s[2]}`:s[2];n.push({indent:a,name:l}),t.push(l)}return t}var rLe=async(e,t,{timeoutMs:n})=>{let i=await Ty(`https://rubygems.org/downloads/${encodeURIComponent(e)}-${encodeURIComponent(t)}.gem`,n);if(!i)return;let r=i.find(c=>c.path==="data.tar.gz"||c.path.endsWith("/data.tar.gz"));if(!r)return;let o;try{o=Fn(r.read())}catch{return}let s=new Set,a=new Set;for(let c of o){let l=/^lib\/(.+)\.rb$/.exec(c.path);if(l?.[1]&&(s.add(l[1]),s.add(l[1].split("/")[0]),!(l[1].split("/").length>2)))for(let u of Ey(c).matchAll(/^(?:module|class)\s+([A-Z][\w:]*)/gm))a.add(u[1].split("::")[0])}if(!(s.size===0&&a.size===0))return{names:[...new Set([...s,...a])],source:`${e}-${t}.gem`}},iLe=async(e,t,{timeoutMs:n})=>{let[i,r]=e.split("/");if(!(!i||!r))for(let o of[t,`v${t}`]){let s=await rt(`https://raw.githubusercontent.com/${i}/${r}/${encodeURIComponent(o)}/Package.swift`,{timeoutMs:n,immutable:!0});if(!s)continue;let a=new Set;for(let c of s.matchAll(/\.(?:library|target|executableTarget)\s*\(\s*name:\s*"([^"]+)"/g))a.add(c[1]);for(let c of s.matchAll(/targets:\s*\[([^\]]*)\]/g))for(let l of c[1].matchAll(/"([^"]+)"/g))a.add(l[1]);if(a.size>0)return{names:[...a],source:`${e}@${o} Package.swift`}}},oLe=async(e,t,{timeoutMs:n})=>{let i=await jk(e,t,{timeoutMs:n});if(!i)return;let r=i.moduleName??(i.name??e).replace(/[-.]/g,"_");return{names:[...new Set([r,e])],source:`${e} ${t} podspec`}},zF={pypi:YMe,maven:QMe,nuget:XMe,packagist:eLe,hex:tLe,rubygems:rLe,swift:iLe,cocoapods:oLe},oyt=Object.keys(zF),sLe=64*1024*1024;async function Ty(e,t){try{let n=await Bt(e,{timeoutMs:t,retries:0,maxBytes:sLe});return n.ok?Fn(n.bytes):void 0}catch{return}}var UF=new Map,jF=new Map;function aLe(e,t){let n=UF.get(e);if(n!==void 0)return Promise.resolve(n??void 0);let i=jF.get(e);if(i)return i;let r=t().then(o=>(UF.set(e,o??null),o)).catch(()=>{UF.set(e,null)}).finally(()=>jF.delete(e));return jF.set(e,r),r}function Ey(e){try{return e.read().toString("utf8")}catch{return""}}var _s=gt(Dc(),1),_n=gt(gc(),1);function cLe(e){return e.split(".").map(t=>Number.parseInt(t,10))}function Sf(e,t){let n=Math.max(e.length,t.length);for(let i=0;i0}}function U7(e,t){if(!e)return t;if(!t)return e;let n=Sf(e.value,t.value);return n!==0?n>0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function j7(e,t){if(!e)return t;if(!t)return e;let n=Sf(e.value,t.value);return n!==0?n<0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function HS(e,t){return U7(e,t)}function Iy(e,t){return j7(e,t)}function z7(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);if(t.length===0)return{min:null,max:null,imprecise:!1};let n=null,i=null,r=!1;for(let o of t){let s=/^(===|~=|==|!=|<=|>=|<|>)?\s*v?(\d[\w.*]*)$/.exec(o);if(!s){r=!0;continue}let[,a,c]=s,l=!a,u=a??"==",d=lLe(c);if(d.imprecise){r=!0;continue}let{release:p,wildcard:f}=d;if(f&&u!=="=="&&u!=="!="){r=!0;continue}if(u==="~="&&p.length<2){r=!0;continue}let m=l||f;switch(u){case">=":n=HS(n,{value:p,inclusive:!0});break;case">":n=HS(n,{value:p,inclusive:!1});break;case"<=":i=Iy(i,{value:p,inclusive:!0});break;case"<":i=Iy(i,{value:p,inclusive:!1});break;case"==":n=HS(n,{value:p,inclusive:!0}),i=m?Iy(i,{value:F7(p),inclusive:!1}):Iy(i,{value:p,inclusive:!0});break;case"===":r=!0;break;case"~=":n=HS(n,{value:p,inclusive:!0}),i=Iy(i,{value:F7(p.slice(0,-1)),inclusive:!1});break;case"!=":r=!0;break;default:r=!0}}return!r&&uLe(n,i)?{min:n,max:i,imprecise:!0}:{min:n,max:i,imprecise:r}}function uLe(e,t){if(!e||!t)return!1;let n=Sf(e.value,t.value);return n>0?!0:n<0?!1:!(e.inclusive&&t.inclusive)}function dLe(e,t){if(!t)return!0;if(!e)return!1;let n=Sf(e.value,t.value);return n!==0?n>0:!(e.inclusive&&!t.inclusive)}function pLe(e,t){if(!t)return!0;if(!e)return!1;let n=Sf(e.value,t.value);return n!==0?n<0:!(e.inclusive&&!t.inclusive)}function VF(e,t){return e.imprecise||t.imprecise?!1:dLe(e.min,t.min)&&pLe(e.max,t.max)}function BF(e,t){if(e.imprecise||t.imprecise)return!0;let n=U7(e.min,t.min),i=j7(e.max,t.max);if(!n||!i)return!0;let r=Sf(n.value,i.value);return r!==0?r<0:n.inclusive&&i.inclusive}var B7=gt(Dc(),1);var fLe=/^nightly-(\d{4}-\d{2}-\d{2})$/,mLe=/^beta-(\d{4}-\d{2}-\d{2})$/;function JS(e){let t=e.trim().replace(/^rust-/i,"");if(!t)return{kind:"unknown"};let n=fLe.exec(G7(t,"nightly"));if(n)return{kind:"dated-nightly",date:n[1]};if(mLe.test(G7(t,"beta")))return{kind:"moving-beta"};if(/^stable$/i.test(t)||/^stable-/i.test(t))return{kind:"moving-stable"};if(/^beta$/i.test(t)||/^beta-/i.test(t))return{kind:"moving-beta"};if(/^nightly$/i.test(t)||/^nightly-/i.test(t))return{kind:"moving-nightly"};let i=gLe(t);return i?{kind:"exact",version:i}:{kind:"unknown"}}function G7(e,t){let n=new RegExp(`^(${t}(?:-\\d{4}-\\d{2}-\\d{2})?)`).exec(e);return n?n[1]:e}function gLe(e){let t=e.split(/-(?=[a-z])/i)[0].trim();return B7.default.valid(t)?t:/^\d+\.\d+$/.test(t)?`${t}.0`:null}var KS=new Map,hLe=e=>`https://static.rust-lang.org/dist/${e}/channel-rust-nightly.toml`,V7=e=>`rust-nightly-version:v1:${e}`;async function q7(e){let t=KS.get(e);if(t)return t;let n=await Na(V7(e));if(n?.version)return KS.set(e,n.version),n.version;let i=null;try{i=await rt(hLe(e),{immutable:!0,retries:1})}catch{i=null}let r=i?yLe(i):null;return r&&(KS.set(e,r),await Ca(V7(e),{version:r})),r}function W7(e){return KS.get(e)??null}function yLe(e){let t=/\[pkg\.rust\]([\s\S]*?)(?:\n\[|$)/.exec(e);if(!t)return null;let n=/(?:^|\n)\s*version\s*=\s*"([^"]+)"/.exec(t[1]);if(!n)return null;let i=/^\d+\.\d+\.\d+/.exec(n[1].trim());return i?i[0]:null}async function qF(e){let t=new Set;for(let n of e){let i=JS(n);i.kind==="dated-nightly"&&t.add(i.date)}await Promise.all([...t].map(n=>q7(n)))}function KF(e,t,n,i){return Ef(e,t,n,i).resolved}function Ef(e,t,n,i){let r=KLe(e,n,i),o={resolved:[],unresolved:[]};for(let{path:s,content:a}of r){if(!AP(s))continue;let c=(s.split("/").pop()??"").toLowerCase();if(bLe[t].includes(c)){vLe(s,c,a,t,o);continue}if(c===".tool-versions"){$Le(s,a,t,o);continue}if(c.startsWith("dockerfile")||c.startsWith("containerfile")){_Le(s,a,t,o);continue}if(t==="node"&&c==="package.json"){xLe(s,a,o);continue}if(t==="python"&&["pyproject.toml","setup.cfg","setup.py"].includes(c)){ELe(s,c,a,o);continue}if(t==="ruby")c==="gemfile"?TLe(s,a,o,r):c.endsWith(".gemspec")&&ILe(s,a,o);else if(t==="go"&&c==="go.mod")ALe(s,a,o);else if(t==="java")c==="pom.xml"?RLe(s,a,o):(c==="build.gradle"||c==="build.gradle.kts")&&CLe(s,a,o);else if(t==="rust"&&c==="cargo.toml"){let l=PLe(a,"rust-version");l&&tr(o,t,s,l.line,l.requirement,"manifest",l.requirement)}WF(s)&&LLe(s,a,t,o,n,i)}if(n!==void 0&&(i?.length??0)>1){for(let s of o.resolved)!s.scope&&!WF(s.file)&&(s.scope=K7(s.file,n,i));for(let s of o.unresolved)!s.scope&&!WF(s.file)&&(s.scope=K7(s.file,n,i))}if(n!==void 0&&(i?.length??0)>1){let s=c=>c==="member"?2:c==="ambiguous"?0:1,a=Math.max(0,...o.resolved.map(c=>s(c.scope)),...o.unresolved.map(c=>s(c.scope)));o.resolved=o.resolved.filter(c=>s(c.scope)===a),o.unresolved=o.unresolved.filter(c=>s(c.scope)===a)}return o.resolved=BLe(o.resolved),o.unresolved=qLe(o.unresolved),o}var bLe={node:[".nvmrc",".node-version"],python:[".python-version","runtime.txt"],ruby:[".ruby-version"],rust:["rust-toolchain","rust-toolchain.toml"],go:[],java:[]};function tr(e,t,n,i,r,o,s,a){s?e.resolved.push({file:n,line:i,requirement:s,...a?{scope:a}:{}}):e.unresolved.push({runtime:t,file:n,line:i,rawText:r,source:o,...a?{scope:a}:{}})}function ic(e){return/[$`%]|\{\{|\}\}/.test(e)}function vLe(e,t,n,i,r){if(t==="rust-toolchain.toml"){let a=VLe(n,/^\s*channel\s*=\s*['"]([^'"]+)['"]/);if(!a)return;tr(r,i,e,a.line,a.requirement,"version-file",rc(a.requirement));return}if(t===".python-version"){for(let[a,c]of n.split(` -`).entries()){let l=c.trim();if(!(!l||l.startsWith("#")))for(let u of l.split(/\s+/))tr(r,i,e,a+1,u,"version-file",rc(u))}return}let o=n.trim().split(` -`)[0]?.trim();if(!o)return;let s=t==="runtime.txt"?o.replace(/^python-/i,"").trim():o.replace(/^(?:ruby-|go|rust-)?v?/i,"").trim();s&&tr(r,i,e,1,o,"version-file",rc(s))}function rc(e){return ic(e)?null:e}function JF(e,t,n){if(e==="node")return X7(t,n);if(e==="python")return eee(t,n);let i=[],r=XS(YS(e,n).text);for(let o of t){let s=YS(e,o.requirement),a=XS(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!r){i.push({...o,...c,verdict:"unknown"});continue}let l;try{_s.default.subset(a,r,{loose:!0})?l="compatible":_s.default.intersects(a,r,{loose:!0})?l="partial":l="incompatible"}catch{l="unknown"}i.push({...o,...c,verdict:l})}return i}function YS(e,t){if(e==="java")return{text:ex(t)??t};if(e==="rust"){let n=JS(t);if(n.kind==="exact")return{text:n.version,resolved:n.version};if(n.kind==="dated-nightly"){let i=W7(n.date);return i?{text:i,resolved:i}:{text:"\0unresolved-nightly"}}return n.kind!=="unknown"?{text:"\0moving-channel"}:{text:t}}return{text:t}}function J7(e,t,n){if(e==="python")return wLe(t,n);let i=XS(YS(e,n).text),r=[];for(let o of t){let s=YS(e,o.requirement),a=XS(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!i){r.push({...o,...c,verdict:"unknown"});continue}let l;try{_s.default.subset(a,i,{loose:!0})?l="incompatible":_s.default.intersects(a,i,{loose:!0})?l="partial":l="compatible"}catch{l="unknown"}r.push({...o,...c,verdict:l})}return r}function xf(e,t="minimum"){let n=t==="unsupported"?e.replace(/\.x$/i,".*"):e;if(/^\s*(?:\^|~(?![=>]))/.test(n))return{status:"unknown",reason:"unsupported-grammar"};let i=z7(n);return i.imprecise||i.min===null&&i.max===null?{status:"unknown",reason:"unparseable"}:{status:"parsed",value:i}}function wLe(e,t){let n=xf(t,"unsupported"),i=[];for(let r of e){let o=xf(r.requirement),s;n.status==="unknown"||o.status==="unknown"?s="unknown":VF(o.value,n.value)?s="incompatible":BF(o.value,n.value)?s="partial":s="compatible",i.push({...r,verdict:s})}return i}var kLe={node:["node","nodejs"],python:["python","python3"],go:["go","golang"],ruby:["ruby"],java:["java"],rust:["rust"]};function $Le(e,t,n,i){for(let[r,o]of t.split(` -`).entries()){let s=/^\s*([\w-]+)\s+([^\s#]+)/.exec(o);if(!s||!kLe[n].includes(s[1].toLowerCase()))continue;let a=o.slice(s.index+s[0].length-s[2].length).split("#",1)[0].split(/\s+/).filter(Boolean);for(let c of a){let l=ic(c)||/^(?:system|path:|ref:)/i.test(c)?null:n==="java"?ex(c):c;tr(i,n,e,r+1,c,"tool-versions",l)}}}function _Le(e,t,n,i){for(let[r,o]of t.split(` -`).entries()){let s=/^\s*FROM\s+(?:--platform=\S+\s+)?(\S+)/i.exec(o)?.[1];s&&Z7(i,n,e,r+1,s,"container")}}function Z7(e,t,n,i,r,o,s){let a=Y7(r);if(!a||a.runtime!==t)return;let c=a.version;tr(e,t,n,i,r,o,c&&!ic(c)?QS(c):null,s)}var SLe={node:"node",python:"python",ruby:"ruby",golang:"go",openjdk:"java","eclipse-temurin":"java",amazoncorretto:"java",rust:"rust"};function Y7(e){let t=e.trim().replace(/^['"]|['"]$/g,"");if(!t||t.startsWith("$"))return null;let n=t.split("@",1)[0],i=n.lastIndexOf("/"),r=n.lastIndexOf(":"),o=r>i,s=(o?n.slice(0,r):n).split("/").at(-1)?.toLowerCase();if(!s)return null;let a=SLe[s];if(!a)return null;let c=o?n.slice(r+1):void 0;return c?{runtime:a,version:c}:{runtime:a}}function xLe(e,t,n){let i=JLe(t);i&&tr(n,"node",e,HF(t,/"node"\s*:/),i.raw,"manifest",i.requirement)}function ELe(e,t,n,i){if(t==="setup.py"){let o=QLe(n);o&&tr(i,"python",e,o.line,o.raw,"manifest",o.requirement);return}let r=t==="pyproject.toml"?ZLe(n):t==="setup.cfg"?nFe(n):null;r&&tr(i,"python",e,r.line,r.requirement,"manifest",rc(r.requirement))}function TLe(e,t,n,i){for(let[r,o]of t.split(` -`).entries()){let s=/^\s*ruby\s+(.+?)\s*(?:#.*)?$/.exec(o)?.[1]?.trim();if(!s)continue;let a=/^(['"])([^'"]+)\1/.exec(s)?.[2],c=/^file\s*:\s*(['"])([^'"]+)\1/.exec(s)?.[2];if(c){let l=i.find(u=>u.path===c||u.path.endsWith(`/${c}`));if(l){let u=l.content.trim().split(/\s+/)[0];if(u&&!ic(u))continue}}tr(n,"ruby",e,r+1,s,"manifest",a?rc(a):null)}}function ILe(e,t,n){for(let[i,r]of t.split(` -`).entries()){let o=/\.required_ruby_version\s*=\s*(.+?)\s*(?:#.*)?$/.exec(r)?.[1]?.trim();if(!o)continue;let s=/^(['"])([^'"]+)\1/.exec(o)?.[2];tr(n,"ruby",e,i+1,o,"manifest",s?rc(s):null)}}function ALe(e,t,n){for(let[i,r]of t.split(` -`).entries()){let o=/^\s*(go|toolchain)\s+(?:go)?(\d+(?:\.\d+){0,3})\s*(?:\/\/.*)?$/.exec(r);o?.[2]&&tr(n,"go",e,i+1,o[2],"manifest",o[2])}}function RLe(e,t,n){let i=[],r=/\s*([^<]+?)\s*<\//g;for(let s of t.matchAll(r))i.push({line:t.slice(0,s.index).split(` -`).length,raw:s[1]});let o=NLe(t);for(let{line:s,raw:a}of i){if(/^\s*\$\{[^}]+\}\s*$/.test(a)&&H7(t,a))continue;let c=H7(t,a),l=c?ex(c):null;tr(n,"java",e,s,a,"manifest",o?l:null)}}function NLe(e){return/\s*maven-toolchains?-plugin\s*<\/artifactId>/i.test(e)?/[\s\S]*?\s*\$\{java\.version\}\s*<\/version>[\s\S]*?<\/jdk>/i.test(e):!1}function H7(e,t){let n=/^\$\{([^}]+)\}$/.exec(t.trim())?.[1];if(!n)return ic(t)?null:t;let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<${i}>\\s*([^<]+?)\\s*`).exec(e)?.[1];return r&&!ic(r)?r:null}function CLe(e,t,n){let i=[/JavaLanguageVersion\.of\(\s*([^)]+?)\s*\)/];for(let[r,o]of t.split(` -`).entries())for(let s of i){let a=s.exec(o)?.[1];a&&tr(n,"java",e,r+1,a,"build-config",ic(a)?null:ex(a))}}function ex(e){let t=QS(e.replace(/_/g,"."));return t?.startsWith("1.")?t.slice(2):t}function PLe(e,t){let n=!1;for(let[i,r]of e.split(` -`).entries()){let o=/^\s*\[([^\]]+)\]\s*$/.exec(r);if(o){n=o[1]==="package";continue}if(!n)continue;let s=new RegExp(`^\\s*${t.replace("-","\\-")}\\s*=\\s*['"]([^'"]+)['"]`).exec(r);if(s?.[1])return{line:i+1,requirement:s[1]}}return null}function WF(e){return/^\.github\/workflows\/.+\.ya?ml$/i.test(e)||/^\.(?:gitlab-ci|circleci)(?:\/|\.|$)/i.test(e)}var DLe={node:"node-version",python:"python-version",ruby:"ruby-version",go:"go-version",java:"java-version",rust:"toolchain"};function OLe(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`^\\s*(?:-\\s*)?${n}\\s*:\\s*(.*?)\\s*$`,"i").exec(e);if(!i)return null;let r=i[1].replace(/\\s+#.*$/,"").trim();return{raw:/^(['"])(.*?)\1$/.exec(r)?.[2]??r}}function MLe(e){let t=Array.from({length:e.length},()=>!0),n=null,i=/(?:^\s*-\s*|:\s*)[>|](?:(?:[+-]?\d)|(?:\d[+-]?))?\s*(?:#.*)?$/;for(let[r,o]of e.entries()){let s=o.trim(),a=/^\s*/.exec(o)[0].length;if(n!==null){if(!s||a>n){t[r]=!1;continue}n=null}i.test(o)&&(n=a)}return t}function LLe(e,t,n,i,r,o){let s=t.split(` -`),a=MLe(s),{allowed:c,ambiguous:l,repositoryWide:u}=GLe(s,r,o),d=m=>l[m-1]?"ambiguous":u[m-1]?"repository":"member",p=/^\.github\/workflows\/.+\.ya?ml$/i.test(e)?jLe(t,s):null,f=(m,g,h,b)=>{tr(i,n,e,m,g,h,l[m-1]?null:b,d(m))};for(let[m,g]of s.entries()){if(!a[m]||!c[m]||p?.insideMatrix(m))continue;let h=OLe(g,DLe[n]);if(h){let w=h.raw,k=p&&ULe(w),_=p&&k?p.resolve(m,k):null;if(_?.ok)for(let S of _.values)f(S.line,S.value,"ci",QS(S.value));else f(m+1,w,"ci",ic(w)?null:QS(w))}if(/^\.github\/workflows\//i.test(e)){let w=/^\s*container\s*:\s*['"]?([^'"\s#]+)/i.exec(g)?.[1];if(w&&ZS(i,n,e,m+1,w,"ci",l,d(m+1)),/^\s*container\s*:\s*$/i.test(g)){let k=/^\s*/.exec(g)[0].length;for(let _=m+1;_/^[ \t]*/.exec(l)[0].length,n=l=>!l.trim()||/^\s*#/.test(l),i=e.findIndex(l=>/^[ \t]*jobs:\s*(#.*)?$/.test(l));if(i===-1)return null;let r=t(e[i]),o=null,s=[],a=[],c=e.length;for(let l=i+1;l({name:a[u],start:l,end:u+10||!(0,_n.isMap)(n.contents))return null;let i=Q7(t);if(!i)return null;let r=[];for(let a of i){let c=n.getIn(["jobs",a.name,"strategy","matrix"],!0);c?.range&&r.push([e.slice(0,c.range[0]).split(` +`),l=await e.messages.create({model:t.llm.model,max_tokens:16e3,system:OFe,thinking:{type:"adaptive"},output_config:{effort:t.llm.effort,format:{type:"json_schema",schema:DFe}},messages:[{role:"user",content:c}]});if(l.stop_reason==="refusal")return o.warn(`The model declined to analyse the prose for ${n.name}, so nothing was extracted from it. The rule-based analyser still ran.`),[];let u=l.content.find(p=>p.type==="text")?.text;if(!u)return o.warn(`The model returned no text for ${n.name}${l.stop_reason?` (stop reason: ${l.stop_reason})`:""}, so nothing was extracted from its prose.`),[];let d;try{d=JSON.parse(u)}catch(p){return o.warn(`The model's answer for ${n.name} was not readable as JSON (${p.message}), so nothing was extracted from its prose.`),[]}return Array.isArray(d.changes)?d.changes:(o.warn(`The model's answer for ${n.name} carried no \`changes\` array, so nothing was extracted from its prose.`),[])}function FFe(e,t,n,r){let i=new Set(r.map(o=>o.id));return e.filter(o=>i.has(o.evidenceId)).filter(o=>o.summary?.trim()).map(o=>({id:xt("bc",t,n,"llm",o.summary),dependency:t,workspace:n,kind:_te(o.kind),summary:o.summary.trim(),remediation:o.remediation?.trim()||`Review usages of ${t} and update them.`,symbols:(o.symbols??[]).filter(jFe),confidence:"medium",taxonomy:iX(o.taxonomy,Gd(_te(o.kind))),citations:[o.evidenceId]}))}function jFe(e){let t=e.trim();return!t||t.length>80||/\s/.test(t)&&!t.startsWith("/")?!1:/^[/@]?[\w$][\w$./{}-]*$/.test(t)}var UFe=new Set(["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement"]);function _te(e){return UFe.has(e)?e:"unknown"}function zFe(e,t){return e.length<=t?e:`${e.slice(0,t)} +\u2026(truncated)`}function GFe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var Ite=require("node:crypto");var BFe=[{band:"high",min:.8},{band:"medium",min:.5},{band:"low",min:.2},{band:"none",min:0}];function $j(e){for(let t of BFe)if(e>=t.min)return t.band;return"none"}var Ste={high:"Very confident",medium:"Fairly confident",low:"Not very confident",none:"Not enough evidence to say"};var Dl="drift-confidence-1",VFe={"type-surface-diff":"computed-artifact",...r9,changelog:"maintainer-narrative","github-release":"maintainer-narrative","migration-guide":"maintainer-guide","behavioural-diff":"dynamic-observation","registry-metadata":"registry","semver-heuristic":"heuristic"},qFe={"computed-artifact":.9,"maintainer-guide":.7,"maintainer-narrative":.6,"dynamic-observation":.5,registry:.4,heuristic:.2},xte=new WeakMap;function xj(e){let{change:t,evidence:n}=e,r=n.filter(d=>t.citations.includes(d.id)),i=[],o=[];if(r.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"no-citations",detail:"No evidence record backs this finding.",delta:0}],calibration:Dl};let s=WFe(r),a=0,c="";for(let d of s.keys()){let p=qFe[d]??.3;p>a&&(a=p,c=d)}i.push({code:`origin:${c}`,detail:`Strongest evidence class is ${Sj(c)}.`,delta:a});let l=a,u=s.size-1;if(u>0){let d=Math.min(.15,.08*u);l+=d,i.push({code:"corroborated",detail:`Corroborated by ${u} other independent source class(es): ${[...s.keys()].filter(p=>p!==c).map(Sj).join(", ")}.`,delta:d})}else r.length>1&&o.push({code:"single-origin",detail:`All ${r.length} citations trace to one source class (${Sj(c)}), so they do not corroborate each other.`,delta:0});return s.size===1&&c==="heuristic"&&(l+=-.1,o.push({code:"heuristic-only",detail:"Only a semver heuristic supports this; no changelog, release note, or API diff was retrieved.",delta:-.1})),Tj(l,i,o)}function WFe(e){let t=new Map,n=new Set;for(let r of e){let i=xte.get(r);if(i===void 0&&(i=(0,Ite.createHash)("sha256").update(r.content.replace(/\s+/g," ").trim().toLowerCase()).digest("hex"),xte.set(r,i)),n.has(i))continue;n.add(i);let o=VFe[r.source]??"unknown",s=t.get(o);s?s.push(r):t.set(o,[r])}return t}function Sj(e){switch(e){case"computed-artifact":return"a computed diff of the shipped artifact";case"maintainer-guide":return"a migration guide";case"maintainer-narrative":return"release notes or a changelog";case"registry":return"registry metadata";case"heuristic":return"a semver heuristic";default:return e}}function HFe(e){let{taxonomy:t,sites:n,localizationRan:r}=e,i=[],o=[];if(!r)return{score:0,band:"none",evidence:[],penalties:[{code:"localization-unavailable",detail:"No checkout was available, so Drift could not search this repository. This is not evidence that the change is unused.",delta:0}],calibration:Dl};if(t.scope==="runtime"&&e.runtimeState==="compatible")return{score:.85,band:"high",evidence:[{code:"runtime-compatible",detail:"The repository runtime declaration satisfies the requirement.",delta:.85}],penalties:[],calibration:Dl};if(n.length===0){let d=P$(t),p=e.localizationComplete===!1,f=t.scope==="runtime";return{score:0,band:"none",evidence:[],penalties:[{code:f?"runtime-compatibility-unresolved":p?"localization-incomplete":d?"not-locally-checkable":"no-usage-found",detail:f?"This is a requirement on the runtime this repository builds and deploys on, not on any code it calls. No source search can answer it; the repository's own declared runtime version is what decides.":p?"Drift searched the indexed source subset, but the file limit prevented an exhaustive absence claim.":d?"This change is only observable at runtime, so a source search cannot establish whether this repository is affected.":"Drift searched the files that import this dependency and found no usage of the affected symbols.",delta:0}],calibration:Dl}}let s=n.reduce((d,p)=>Tte(p.confidence)>Tte(d.confidence)?p:d),a=s.confidence==="high"?.85:s.confidence==="medium"?.6:.3;i.push({code:`site:${s.confidence}`,detail:s.confidence==="high"?`\`${s.matchedSymbol}\` is bound from an import of this dependency in ${s.file}.`:s.confidence==="medium"?`${s.file} imports this dependency and uses \`${s.matchedSymbol}\`, but the symbol was not traced to the import.`:`\`${s.matchedSymbol}\` appears in ${s.file}, but no import of this dependency was established \u2014 the match may be coincidental.`,delta:a});let c=a;if(n.length>1){let d=Math.min(.05,.01*(n.length-1));c+=d,i.push({code:"multiple-sites",detail:`${n.length} affected locations across ${new Set(n.map(p=>p.file)).size} file(s).`,delta:d})}let l=n.filter(d=>KFe(d.file));return l.length===n.length?(c+=-.25,o.push({code:"generated-only",detail:`Every affected location is in generated code (${l[0].file}). Editing it is usually wrong; the generator is the real site.`,delta:-.25})):l.length>0&&(c+=-.05,o.push({code:"some-generated",detail:`${l.length} affected location(s) are in generated code.`,delta:-.05})),t.visibility.includes("reflection-or-dynamic")&&(c+=-.2,o.push({code:"dynamic-access",detail:"Dynamic or reflective access was detected, so the affected set cannot be enumerated by search.",delta:-.2})),t.visibility.includes("wrapper-mediated")&&(c+=-.1,o.push({code:"wrapper-mediated",detail:"Usage is mediated by a local wrapper, so downstream callers of the wrapper are not enumerated here.",delta:-.1})),n.every(d=>d.confidence==="low")&&(c+=-.1,o.push({code:"textual-only",detail:"Every match is textual \u2014 no import edge was established for any of them.",delta:-.1})),Tj(c,i,o)}function KFe(e){let t=e.toLowerCase();return/(^|\/)(generated|__generated__|gen|dist|build|out|vendor|node_modules)\//.test(t)||/\.(g|generated)\.[a-z]+$/.test(t)||/\.pb\.(go|ts|js|py)$/.test(t)||/_pb2?\.py$/.test(t)||/\.d\.ts$/.test(t)}function JFe(e){let{outcomes:t,affectedFiles:n,taxonomy:r}=e;if(t.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"nothing-ran",detail:"No checks were run against this finding, so nothing confirms the change was understood correctly.",delta:0}],calibration:Dl};let i=[],o=[],s=t.filter(p=>p.status==="passed"),a=t.filter(p=>p.status==="failed"),c=t.filter(p=>p.status==="skipped"||p.status==="unavailable"||p.status==="timed-out");if(a.length>0)return{score:0,band:"none",evidence:[],penalties:[{code:"checks-failed",detail:`${a.length} check(s) failed: ${a.map(p=>p.name).join(", ")}.`,delta:0}],calibration:Dl};let l=0,u=r.detectability.some(p=>p==="compile-time"||p==="link-or-import"||p==="manifest");for(let p of s){let f=/type|compile|build|lint/i.test(p.name),g=/test|spec/i.test(p.name)?.45:f?u?.4:.15:.1;l+=g,i.push({code:`passed:${p.name}`,detail:f&&!u?`\`${p.name}\` passed, but this change is not detectable at compile time \u2014 it does not confirm the behaviour is right.`:`\`${p.name}\` passed.`,delta:g})}for(let p of c)o.push({code:`did-not-run:${p.name}`,detail:`\`${p.name}\` was ${p.status} and proves nothing.`,delta:0});let d=new Set(s.flatMap(p=>p.covers??[]));return d.size>0&&n.length>0?n.filter(f=>d.has(f)).length===0&&(l+=-.2,o.push({code:"no-coverage",detail:"The checks that passed do not cover any of the affected files.",delta:-.2})):n.length>0&&o.push({code:"coverage-unknown",detail:"Which code paths the passing checks cover could not be established.",delta:0}),Tj(l,i,o)}function Ate(e){let t=xj({change:e.change,evidence:e.evidence}),n=HFe({change:e.change,taxonomy:e.taxonomy,sites:e.sites,localizationRan:e.localizationRan,localizationComplete:e.localizationComplete,runtimeState:e.runtimeState}),r=JFe({outcomes:e.outcomes??[],affectedFiles:[...new Set(e.sites.map(a=>a.file))],taxonomy:e.taxonomy}),i=[...e.gaps??[]],o=[];t.band==="high"&&n.band==="none"&&o.push({code:"upstream-only",detail:"The upstream change is well established, but nothing in this repository was shown to be affected. High upstream confidence is not a reason to edit code.",delta:0});let s=t.band==="high"&&(n.band==="high"||n.band==="medium")&&!i.some(a=>a.automaticExecution==="blocks");return{upstream:t,localImpact:n,verification:r,automaticExecutionEligible:s,reasons:o,checkedSurfaces:[...e.checkedSurfaces??[]],gaps:i}}function Ej(e){let{upstream:t,localImpact:n,verification:r}=e,i=n.band==="none"?Math.min(t.score,.55):Math.min(t.score,n.score),o=r.score>0?Math.min(.1,r.score*.15):0,s=Math.round(Math.max(0,Math.min(1,i+o))*100),a=$j(s/100);return{score:s,band:a,label:Ste[a]}}function Rte(e){let t=e.upstream.band,n=e.localImpact.band;return n==="none"?t==="high"?"medium":Ete(t):Ete(ZFe(t,n))}function Ete(e){return e==="high"?"high":e==="medium"?"medium":"low"}function ZFe(e,t){let n=["none","low","medium","high"];return n.indexOf(e)<=n.indexOf(t)?e:t}function Tte(e){return e==="high"?2:e==="medium"?1:0}function Tj(e,t,n){let r=Math.round(Math.max(0,Math.min(1,e))*100)/100;return{score:r,band:$j(r),evidence:t,penalties:n,calibration:Dl}}async function zx(e,t,n){let{config:r,logger:i}=n,o=YFe(t),s=[];for(let a of e){let c=o.get(Ac(a))??[];s.push(...QFe(a.name,a.workspace,c))}for(let a of t)XY(a.source)&&s.push(...Nte(a));if(r.llm.enabled){let a=await $te(e,t,s,{config:r,logger:i});s.push(...a)}return r1e(o1e(s),t)}function YFe(e){let t=new Map;for(let n of e){let r=Ac({name:n.dependency,workspace:n.workspace}),i=t.get(r);i?i.push(n):t.set(r,[n])}return t}function QFe(e,t,n){let r=[];for(let i of n){if(i.findings?.length){r.push(...Nte(i));continue}if(i.source!=="semver-heuristic"){if(i.source==="registry-metadata"){r.push(...Cte(i,e,t).filter(o=>o.kind==="runtime-requirement"));continue}r.push(...Cte(i,e,t))}}return r}function XFe(e,t){return e.replace(/`default\.([\w$]+)`/g,`\`${t}.$1\``).replace(/`default` is no longer exported/g,`\`${t}\` no longer has a default export`).replace(/`default`/g,`the default export of \`${t}\``)}function Nte(e){return(e.findings??[]).map(t=>{let n=R$(t.code),r=n==="module-system-change"?t.moduleSystem??{from:"dual",to:"esm",incompatibleUsage:["require"]}:void 0;return{id:xt("bc",e.dependency,e.workspace,t.code,t.symbol,r?.affectedSpecifiers?.join(",")??"",r?.affectedSpecifierPatterns?.join(",")??""),dependency:e.dependency,workspace:e.workspace,kind:n==="removed-export"&&t.replacement?"renamed-export":n,summary:XFe(t.detail,e.dependency),...t.replacement?{replacementSymbols:[t.replacement]}:{},...n==="runtime-requirement"&&t.after?{runtime:{kind:"minimum-runtime",runtime:"java",requirement:`>=${t.after}`,sourceText:t.detail}}:{},before:t.before,after:t.after,...t.fromKind?{fromKind:t.fromKind}:{},...t.toKind?{toKind:t.toKind}:{},remediation:YQ(t,e.dependency),symbols:e1e(t),...r?{moduleSystem:{...r,incompatibleUsage:[...r.incompatibleUsage],...r.affectedSpecifiers?{affectedSpecifiers:[...r.affectedSpecifiers]}:{},...r.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...r.affectedSpecifierPatterns]}:{}}}:{},confidence:"high",taxonomy:Gd(n,t.code),citations:[e.id]}})}function e1e(e){if(R$(e.code)==="module-system-change")return[];let t=new Set([e.symbol]);if(e.symbol.includes(".")&&!/\s/.test(e.symbol)){let r=e.symbol.split("."),i=r[r.length-1];if(i&&!Pte(i)&&t.add(i),r.length>2){let o=r[r.length-2];o&&t.add(`${o}.${i}`)}if(r.length>=2&&R$(e.code)==="required-field-added"){let o=r[r.length-2];o&&!Pte(o)&&t.add(o)}}let n=/^[A-Z]+\s+(\/\S*)$/.exec(e.symbol);if(n?.[1]){t.add(n[1]);let r=n[1].split("{")[0]?.replace(/\/$/,"");r&&r.length>1&&t.add(r)}return[...t]}function Pte(e){return/^__\w+__$/.test(e)?!0:t1e.has(e.toLowerCase())}var t1e=new Set(["add","all","any","append","apply","build","call","check","clear","clone","close","connect","copy","count","create","define","delete","each","emit","end","execute","exists","extend","fetch","filter","find","first","flush","format","get","handle","has","index","init","insert","is","items","iter","join","keys","last","length","list","load","log","main","map","match","new","next","open","parse","pop","push","put","query","read","remove","render","reset","resolve","run","save","send","set","size","sort","split","start","stop","update","wait","write","args","body","config","content","context","data","error","file","header","headers","host","id","key","name","options","params","path","port","result","root","status","text","type","url","value","values","and","or","not","if","elif","else","for","while","do","in","of","as","with","from","to","try","catch","finally","throw","raise","except","switch","case","break","continue","return","yield","class","def","function","lambda","const","let","var","this","self","super","null","nil","none","true","false","async","await","typeof","instanceof","void","enum","interface","extends","implements","export","import","static","public","private","protected","default","pass","then"]);function Cte(e,t,n){let r=[],i=new Set,o=QQ(e.content);for(let s of e.content.split(` +`))for(let a of XQ(s,{anchored:o})){let c=`${a.kind}:${a.symbols.join(",")}`;if(i.has(c))continue;i.add(c);let l=a.symbols.length>0||a.kind==="module-system-change"?a.symbols:[t];r.push({id:xt("bc",t,n,a.ruleId,a.symbols.join(",")),dependency:t,workspace:n,kind:a.kind,summary:a.summary,remediation:eX(a,t),symbols:l,...a.runtime?{runtime:a.runtime}:{},replacementSymbols:a.replacementSymbols.length?a.replacementSymbols:void 0,...a.moduleSystem?{moduleSystem:a.moduleSystem}:{},confidence:n1e(e),taxonomy:Gd(a.kind),citations:[e.id]})}return r}function n1e(e){return e.weight>=.95?"high":e.weight>=.6?"medium":"low"}function r1e(e,t){return e.map(n=>{let r=xj({change:n,evidence:t});return{...n,confidence:i1e(r.band)}})}function i1e(e){return e==="high"?"high":e==="medium"?"medium":"low"}function o1e(e){let t=new Map;for(let r of e){let i=s1e(r),o=t.get(i);if(!o){t.set(i,{...r,citations:[...new Set(r.citations)]});continue}t.set(i,{...o,summary:o.summary.length>=r.summary.length?o.summary:r.summary,symbols:[...new Set([...o.symbols,...r.symbols])],replacementSymbols:[...new Set([...o.replacementSymbols??[],...r.replacementSymbols??[]])].filter(Boolean).length?[...new Set([...o.replacementSymbols??[],...r.replacementSymbols??[]])]:void 0,moduleSystem:a1e(o.moduleSystem,r.moduleSystem),confidence:l1e(o.confidence,r.confidence),taxonomy:c1e(Nr(o),Nr(r)),citations:[...new Set([...o.citations,...r.citations])]})}let n={high:0,medium:1,low:2};return[...t.values()].sort((r,i)=>n[r.confidence]-n[i.confidence]||r.dependency.localeCompare(i.dependency))}function s1e(e){let t=Ac({name:e.dependency,workspace:e.workspace});return e.kind==="module-system-change"?[t,e.kind,[...e.moduleSystem?.incompatibleUsage??[]].sort().join(","),e.moduleSystem?.affectedSpecifiers?.length?[...e.moduleSystem.affectedSpecifiers].sort().join(","):"*",e.moduleSystem?.affectedSpecifierPatterns?.length?[...e.moduleSystem.affectedSpecifierPatterns].sort().join(","):"*"].join("|"):`${t}|${e.kind}|${[...e.symbols].sort().join(",")}`}function a1e(e,t){if(!e)return t;if(!t)return e;let n=[...new Set([...e.incompatibleUsage,...t.incompatibleUsage])],r=e.affectedSpecifiers||t.affectedSpecifiers?[...new Set([...e.affectedSpecifiers??[],...t.affectedSpecifiers??[]])]:void 0,i=e.affectedSpecifierPatterns||t.affectedSpecifierPatterns?[...new Set([...e.affectedSpecifierPatterns??[],...t.affectedSpecifierPatterns??[]])]:void 0;return{from:e.from??t.from,to:e.to??t.to,incompatibleUsage:n,...r?{affectedSpecifiers:r}:{},...i?{affectedSpecifierPatterns:i}:{}}}function c1e(e,t){let n={computed:3,rule:2,"llm-normalized":1,default:0};return n[e.origin]>=n[t.origin]?e:t}function l1e(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]?e:t}function Ij(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]}function Gx(e){return e.keys??[e.packageName]}function Uf(e){let t=[],n=new Map,r=new Set(e.map(s=>s.path));for(let s of e){let a=u1e(s),c=G1e(s);t.push({path:s.path,language:s.language,lineCount:s.lineCount,imports:a,localImports:d1e(s),units:c,summary:K1e(s,c,a)});for(let l of new Set(a.flatMap(Gx))){let u=n.get(l);u?u.push(s.path):n.set(l,[s.path])}}let i=new Map,o=g1e(r);for(let s of t)for(let a of s.localImports){let c=h1e(s.path,a.specifier,r,o);if(!c||c===s.path)continue;let l=i.get(c),u={from:s.path,bindings:a.bindings,reExport:a.reExport,line:a.line};l?l.push(u):i.set(c,[u])}return{files:t,importers:n,localImporters:i,stats:{fileCount:t.length,unitCount:t.reduce((s,a)=>s+a.units.length,0),totalLines:t.reduce((s,a)=>s+a.lineCount,0)}}}function Rj(e,t){let n;for(let r of e.units)tr.endLine||(!n||r.endLine-r.startLine]+)>|"([^"]+)")/.exec(n[r]),o=i?.[1]??i?.[2];o&&t.push({specifier:o,line:r+1,bindings:[],reExport:!0})}return t}function g1e(e){let t=new Map,n=(r,i)=>{let o=t.get(r);o?o.push(i):t.set(r,[i])};for(let r of e){let i=r.split("/").pop()??r;n(i.toLowerCase(),r)}return t}var Dte=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".py"];function h1e(e,t,n,r){if(t.startsWith(".")){let s=e.split("/").slice(0,-1),a=y1e([...s,...t.split("/")]);if(a===void 0)return;let l=/^\.+$/.test(t)||!t.includes("/")&&t.startsWith(".")?[`${Ote(e,t)}.py`,`${Ote(e,t)}/__init__.py`]:[a,...Dte.map(u=>a+u),...Dte.map(u=>`${a}/index${u}`),`${a}/__init__.py`];for(let u of l)if(u&&n.has(u))return u;return}let i=(t.split("/").pop()??t).toLowerCase(),o=(r.get(i)??[]).filter(s=>s.toLowerCase().endsWith(t.toLowerCase()));return o.length===1?o[0]:void 0}function y1e(e){let t=[];for(let n of e)if(!(n===""||n===".")){if(n===".."){if(t.length===0)return;t.pop();continue}t.push(n)}return t.join("/")}function Ote(e,t){let n=/^\.+/.exec(t)?.[0].length??1,r=t.slice(n).split(".").filter(Boolean);return[...e.split("/").slice(0,-n),...r].join("/")}function b1e(e){let t=[],n=e.split(` +`);for(let r=0;r]+)>|"([^"]+)")/.exec(n[r]),o=i?.[1]??i?.[2];o&&(o.startsWith(".")||t.push({specifier:o,packageName:v1e(o),bindings:[],line:r+1,reExport:!0}))}return t}function v1e(e){return(e.split("/")[0]??e).replace(/\.(h|hpp|hh|hxx|inl|tpp|h\+\+)$/i,"").toLowerCase()}function w1e(e){let t=pM(e),n=[],r=Ute(t),i=d=>zte(r,d),o=/\bimport\s+(?!\()(?:(?:type\s+)?([\w$]+)\s*,\s*)?(?:type\s+)?(?:\{([^}]+)\}|\*\s+as\s+([\w$]+)|([\w$]+))\s+from\s+['"]([^'"]+)['"]|\bimport\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(o)){let p=d[5]??d[6];if(!p||Lf(p))continue;let f=Aj(d[1],d[2],d[3],d[4]),m=d[1]??d[4];n.push({specifier:p,packageName:Ff(p),bindings:f,...m?{defaultBinding:m}:{},line:i(d.index??0),loadStyle:"esm-static"})}let s=/\b(?:const|let|var)\s+(\{[^}]+\}|[\w$]+)\s*=\s*require\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(s)){let p=d[2];if(Lf(p))continue;let f=d[1],m=f.startsWith("{")?void 0:f;n.push({specifier:p,packageName:Ff(p),bindings:k1e(f),...m?{defaultBinding:m}:{},line:i(d.index??0),loadStyle:"commonjs-require"})}let a=/\bimport\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(a)){let p=d[1];Lf(p)||n.push({specifier:p,packageName:Ff(p),bindings:[],line:i(d.index??0),loadStyle:"esm-dynamic"})}let c=/\bexport\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(c)){let p=d[2];Lf(p)||n.push({specifier:p,packageName:Ff(p),bindings:Aj(void 0,d[1],void 0,void 0),line:i(d.index??0),reExport:!0,loadStyle:"re-export"})}let l=/\bexport\s+\*\s+as\s+([\w$]+)\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(l)){let p=d[2];Lf(p)||n.push({specifier:p,packageName:Ff(p),bindings:["*",d[1]],line:i(d.index??0),reExport:!0,loadStyle:"re-export"})}let u=/\bexport\s+\*\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(u)){let p=d[1];Lf(p)||n.push({specifier:p,packageName:Ff(p),bindings:["*"],line:i(d.index??0),reExport:!0,loadStyle:"re-export"})}return n.sort((d,p)=>d.line-p.line||d.specifier.localeCompare(p.specifier))}function Aj(e,t,n,r){let i=[];if(e&&i.push(e),r&&i.push(r),n&&i.push("*",n),t)for(let o of t.split(",")){let s=o.replace(/\btype\s+/g,"").trim();if(!s)continue;let[a,c]=s.split(/\s+as\s+/).map(l=>l.trim());a&&i.push(c||a,a)}return[...new Set(i)]}function k1e(e){let t=e.trim();return t.startsWith("{")?t.replace(/[{}]/g,"").split(",").flatMap(n=>{let[r,i]=n.split(":").map(o=>o.trim());return[r,i].filter(o=>!!o)}):[t]}function _1e(e,t){let n=[],r=e.split(` +`),i=t.endsWith("/__init__.py")||t==="__init__.py";for(let o=0;o{let n=/^\s*(\w+)(?:\s+as\s+(\w+))?/.exec(t);return n?[n[1],n[2]].filter(Boolean):[]}).flat()}function $1e(e){let t=[],n=e.split(` +`),r=!1;for(let i=0;i{let i=r.trim();if(!i)return;let o=i.indexOf("{");if(o!==-1){let c=i.lastIndexOf("}"),l=i.slice(o+1,c===-1?void 0:c);for(let u of E1e(l))n(u);return}let s=/\bas\s+([\w*]+)\s*$/.exec(i);if(s?.[1]){t.push(s[1]);return}let a=i.split("::").pop()?.trim();if(a&&(t.push(a==="*"?"*":a),a==="self")){let c=i.split("::").slice(-2,-1)[0]?.trim();c&&t.push(c)}};return n(e),[...new Set(t.filter(r=>r!=="self"))]}function E1e(e){let t=[],n=0,r="";for(let i of e){if(i==="{"?n+=1:i==="}"&&(n-=1),i===","&&n===0){t.push(r),r="";continue}r+=i}return t.push(r),t}function T1e(e){let t=[],n=e.split(` +`);for(let r=0;ro.slice(0,a+1).join("\\")).reverse()}}function N1e(e){let t=[],n=new Set,r=e.split(` +`),i=(s,a,c,l=!1)=>{let u=s.split(".")[0];if(!/^[A-Z]/.test(u)||D1e.has(u)||n.has(s))return;n.add(s);let d=s.split(".");t.push({specifier:s,packageName:u,bindings:[...new Set([a,s])],line:c,keys:d.map((p,f)=>d.slice(0,f+1).join(".")).reverse(),...l?{synthetic:!0}:{}})},o=!1;for(let s=0;s{U1e.has(l)||n.has(l)||(n.add(l),t.push({specifier:l,packageName:l,bindings:[l],line:i+1,...u?{synthetic:!0}:{}}))},a=/^\s*open\s+([A-Z][\w']*)/.exec(o);if(a?.[1]){s(a[1]);continue}let c=/^\s*module\s+[A-Z][\w']*\s*=\s*([A-Z][\w']*)/.exec(o);if(c?.[1]){s(c[1]);continue}for(let l of o.matchAll(/\b([A-Z][\w']*)\.[a-z_]/g))s(l[1],!0)}return t}var U1e=new Set(["Stdlib","List","Array","String","Bytes","Char","Int","Int32","Int64","Float","Bool","Option","Result","Hashtbl","Map","Set","Buffer","Printf","Format","Sys","Unix","Filename","Sort","Queue","Stack","Lazy","Seq","Fun","Either","Printexc","Random","Digest","Obj"]);function z1e(e){let t=e.trim();if(!t)return["*"];let n=[],r=/\bshow\s+([\w\s,]+)/.exec(t);r?.[1]&&n.push(...r[1].split(",").map(o=>o.trim()).filter(Boolean));let i=/\bas\s+(\w+)/.exec(t);return i?.[1]&&n.push(i[1]),n.length===0&&n.push("*"),[...new Set(n)]}function Lf(e){return e.startsWith(".")||e.startsWith("/")||e.startsWith("#")}function Ff(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function G1e(e){return e.language==="typescript"||e.language==="javascript"?B1e(e.content,e.path):W1e(e.content,e.language)}function B1e(e,t){let n=[],r=e.split(` +`),i=q1e(r),o=(s,a,c,l,u,d)=>{n.push({name:s,kind:a,startLine:c,endLine:l,summary:Vte(u),exported:d})};for(let s=0;s|^\s*=\s*(?:async\s*)?function\b/.test(h);o(m[1],v?"function":"variable",s+1,Lte(r,s)+1,`${v?"const fn":"const"} ${m[1]}`,l);continue}let g=/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([\w$]+)/.exec(c);g&&o(g[1],"module",s+1,jf(r,s)+1,`module ${g[1]}`,l)}return n}function V1e(e,t,n,r,i){let o=0;for(let s=t;s{let a=i.slice(s+1).find(c=>c.indent<=o.indent);return{name:o.name,kind:o.kind,startLine:o.line,endLine:a?a.line-1:r.length,summary:o.summary,exported:!0}})}var H1e={python:[{pattern:/^(?:async\s+)?def\s+(\w+)\s*\(/,kind:"function"},{pattern:/^class\s+(\w+)\s*[(:]/,kind:"class"}],go:[{pattern:/^func\s+(?:\([^)]*\)\s*)?(\w+)\s*[[(]/,kind:"function"},{pattern:/^type\s+(\w+)\s+(?:struct|interface)\s*\{/,kind:"type"}],rust:[{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?fn\s+(\w+)/,kind:"function"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+(\w+)/,kind:"class"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:enum|trait)\s+(\w+)/,kind:"type"},{pattern:/^impl(?:<[^>]*>)?\s+(?:\w+\s+for\s+)?(\w+)/,kind:"class"}],java:[{pattern:/^(?:public|private|protected|abstract|final|static|\s)*(?:class|interface|enum|record)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|static|final|synchronized|abstract|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],ruby:[{pattern:/^def\s+(?:self\.)?(\w+[?!=]?)/,kind:"method"},{pattern:/^(?:class|module)\s+([\w:]+)/,kind:"class"}],dotnet:[{pattern:/^(?:public|private|protected|internal|sealed|abstract|static|partial|\s)*(?:class|interface|struct|record|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|internal|static|virtual|override|async|sealed|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],php:[{pattern:/^(?:abstract\s+|final\s+|readonly\s+)*(?:class|interface|trait|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|private\s+|protected\s+|static\s+|abstract\s+|final\s+)*function\s+&?(\w+)\s*\(/,kind:"function"}],elixir:[{pattern:/^\s*defmodule\s+([A-Z][\w.]*)/,kind:"module"},{pattern:/^\s*(?:def|defp|defmacro|defmacrop|defguard|defdelegate)\s+([a-z_]\w*[!?]?)/,kind:"function"},{pattern:/^\s*(?:defstruct|defexception|defprotocol|defimpl)\s+([A-Z][\w.]*)?/,kind:"type"}],erlang:[{pattern:/^([a-z]\w*)\s*\(.*\)\s*(?:when\b.*)?->/,kind:"function"},{pattern:/^-record\(\s*(\w+)/,kind:"type"}],swift:[{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|final\s+|@\w+\s+)*(?:class|struct|enum|protocol|actor|extension)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|static\s+|final\s+|override\s+|mutating\s+|@\w+\s+)*func\s+(\w+)/,kind:"function"}],dart:[{pattern:/^(?:abstract\s+|base\s+|final\s+|sealed\s+|interface\s+)*(?:class|mixin|enum|extension)\s+(\w+)/,kind:"class"},{pattern:/^typedef\s+(\w+)/,kind:"type"}],ocaml:[{pattern:/^let\s+(?:rec\s+)?([a-z_]\w*)/,kind:"function"},{pattern:/^(?:module|module\s+type)\s+([A-Z]\w*)/,kind:"module"},{pattern:/^type\s+(?:'\w+\s+)?([a-z_]\w*)/,kind:"type"}],c:Fte(),cpp:[{pattern:/^(?:template\s*<[^>]*>\s*)?(?:class|struct)\s+(?:\w+_API\s+|\w+_EXPORT\s+)?(\w+)\s*(?::|\{|$)/,kind:"class"},{pattern:/^namespace\s+(\w+)/,kind:"module"},...Fte()]};function Fte(){return[{pattern:/^typedef\s+(?:struct|union|enum)?\s*[\w\s*]*?(\w+)\s*;/,kind:"type"},{pattern:/^(?:typedef\s+)?(?:struct|union|enum)\s+(\w+)\s*\{?\s*$/,kind:"class"},{pattern:/^(?!(?:return|if|while|for|switch|case|else|do|sizeof|typeof|delete|throw|catch|assert)\b)(?:(?:static|extern|inline|const|constexpr|virtual|explicit|friend|unsigned|signed|struct|enum|class|\w+_API|\w+_EXPORT)\s+)*[\w:<>,\s]*?[\w>]\s*[*&\s]\s*(\w+)\s*\([^;]*\)\s*(?:const\s*)?(?:noexcept\s*)?[{;]?\s*$/,kind:"function"},{pattern:/^#\s*define\s+(\w+)\s*\(/,kind:"function"}]}function K1e(e,t,n){let r=t.filter(a=>a.exported).map(a=>a.name),i=r.slice(0,8),o=[...new Set(n.map(a=>a.packageName))].slice(0,6),s=[`${e.path} (${e.language}, ${e.lineCount} lines)`];return i.length&&s.push(`defines ${i.join(", ")}${r.length>i.length?`, +${r.length-i.length} more`:""}`),o.length&&s.push(`imports ${o.join(", ")}`),s.join(" \u2014 ")}function Vte(e){return e.replace(/\s+/g," ").trim().slice(0,200)}function Dj(e,t){return`${e}|${t}`}var J1e=2e4;async function Bx(e,t){let n=new Map;for(let s of e){if(!Nj[s.ecosystem])continue;let a=Dj(s.ecosystem,s.name);n.has(a)||n.set(a,s)}let r=new Map;if(n.size===0)return r;let i=[...n.entries()],o=await qn(i,t.concurrency??6,async([s,a])=>{let c=a.to??a.from;if(!c)return[s,void 0];try{let l=await sje(`${s}|${c}`,()=>Nj[a.ecosystem](a.name,c,{timeoutMs:t.timeoutMs??J1e}));return[s,l]}catch(l){return t.logger.debug(`Module map failed for ${s}: ${l.message}`),[s,void 0]}});for(let[s,a]of o)a&&a.names.length>0&&r.set(s,a);return t.logger.debug(`Resolved ${r.size} of ${n.size} module map(s) from published artefacts`),r}var Z1e=async(e,t,{timeoutMs:n})=>{let i=(await xe(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{timeoutMs:n,immutable:!0}))?.urls?.find(l=>l.packagetype==="bdist_wheel"&&l.url);if(!i?.url)return;let o=await Ky(i.url,n);if(!o)return;let s=o.find(l=>/(^|\/)[^/]+\.dist-info\/top_level\.txt$/.test(l.path));if(s){let l=Hy(s).split(` +`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));if(l.length>0)return{names:[...new Set(l)],source:`${i.filename??"wheel"} top_level.txt`}}let a=o.find(l=>/(^|\/)[^/]+\.dist-info\/RECORD$/.test(l.path));if(!a)return;let c=new Set;for(let l of Hy(a).split(` +`)){let u=l.split(",")[0]?.trim();if(!u)continue;let d=u.split("/")[0];!d||d.startsWith(".")||/\.(dist-info|data)$/.test(d)||c.add(d.endsWith(".py")?d.slice(0,-3):d)}return c.delete(""),c.size>0?{names:[...c],source:`${i.filename??"wheel"} RECORD`}:void 0},Y1e=async(e,t,{timeoutMs:n})=>{let[r,i]=e.split(":");if(!r||!i)return;let s=`https://repo1.maven.org/maven2/${r.replace(/\./g,"/")}/${i}/${t}/${i}-${t}.jar`,a=await Ky(s,n);if(!a)return;let c=new Set;for(let l of a){if(!l.path.endsWith(".class")||l.path.startsWith("META-INF/"))continue;let u=l.path.split("/").slice(0,-1);u.length!==0&&c.add(u.join("."))}return c.size>0?{names:[...c],source:`${i}-${t}.jar`}:void 0},Q1e=async(e,t,{timeoutMs:n})=>{let r=e.toLowerCase(),i=t.toLowerCase(),o=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(r)}/${encodeURIComponent(i)}/${encodeURIComponent(r)}.${encodeURIComponent(i)}.nupkg`,s=await Ky(o,n);if(!s)return;let{readAssembly:a}=await Promise.resolve().then(()=>(NM(),mQ)),c=new Set;for(let l of s){if(!/^lib\/.+\.dll$/i.test(l.path)&&!/^ref\/.+\.dll$/i.test(l.path))continue;let u;try{u=a(l.read())}catch{continue}for(let d of u??[]){let p=d.fullName.lastIndexOf(".");p>0&&c.add(d.fullName.slice(0,p))}if(c.size>0)break}return c.size>0?{names:[...c],source:`${e} ${t} assembly metadata`}:void 0},X1e=async(e,t,{timeoutMs:n})=>{let i=(await xe(`https://repo.packagist.org/p2/${e.toLowerCase()}.json`,{timeoutMs:n}))?.packages?.[e.toLowerCase()];if(!i?.length)return;let o=l_(i),a=(u_(o,t)??o[0])?.autoload??void 0,c=new Set;for(let l of[a?.["psr-4"],a?.["psr-0"]])for(let u of Object.keys(l??{})){let d=u.replace(/\\+$/,"");d&&c.add(d)}return c.size>0?{names:[...c],source:`${e} composer.json autoload`}:void 0},eje=async(e,t,{timeoutMs:n})=>{let r=await Ky(`https://repo.hex.pm/tarballs/${encodeURIComponent(e)}-${encodeURIComponent(t)}.tar`,n);if(!r)return;let i=r.find(c=>c.path==="contents.tar.gz"||c.path.endsWith("/contents.tar.gz"));if(!i)return;let o;try{o=Ln(i.read())}catch{return}let s=new Set;for(let c of o)if(/^(lib|src)\//.test(c.path)){if(/\.(ex|exs)$/.test(c.path)){for(let l of tje(Hy(c)))s.add(l);continue}if(/\.erl$/.test(c.path)){let l=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(Hy(c));l?.[1]&&s.add(l[1])}}if(s.size===0)return;let a=new Set;for(let c of s)a.add(c.split(".")[0]);return{names:[...new Set([...s,...a])],source:`${e} ${t} hex tarball`}};function tje(e){let t=[],n=[],r=!1;for(let i of e.split(` +`)){let o=(i.match(/"""/g)??[]).length;if(r){o%2===1&&(r=!1);continue}if(o%2===1){r=!0;continue}let s=/^(\s*)defmodule\s+([A-Z][\w.]*)/.exec(i);if(!s)continue;let a=s[1].length;for(;n.length>0&&n[n.length-1].indent>=a;)n.pop();let c=n[n.length-1]?.name,l=c?`${c}.${s[2]}`:s[2];n.push({indent:a,name:l}),t.push(l)}return t}var nje=async(e,t,{timeoutMs:n})=>{let r=await Ky(`https://rubygems.org/downloads/${encodeURIComponent(e)}-${encodeURIComponent(t)}.gem`,n);if(!r)return;let i=r.find(c=>c.path==="data.tar.gz"||c.path.endsWith("/data.tar.gz"));if(!i)return;let o;try{o=Ln(i.read())}catch{return}let s=new Set,a=new Set;for(let c of o){let l=/^lib\/(.+)\.rb$/.exec(c.path);if(l?.[1]&&(s.add(l[1]),s.add(l[1].split("/")[0]),!(l[1].split("/").length>2)))for(let u of Hy(c).matchAll(/^(?:module|class)\s+([A-Z][\w:]*)/gm))a.add(u[1].split("::")[0])}if(!(s.size===0&&a.size===0))return{names:[...new Set([...s,...a])],source:`${e}-${t}.gem`}},rje=async(e,t,{timeoutMs:n})=>{let[r,i]=e.split("/");if(!(!r||!i))for(let o of[t,`v${t}`]){let s=await nt(`https://raw.githubusercontent.com/${r}/${i}/${encodeURIComponent(o)}/Package.swift`,{timeoutMs:n,immutable:!0});if(!s)continue;let a=new Set;for(let c of s.matchAll(/\.(?:library|target|executableTarget)\s*\(\s*name:\s*"([^"]+)"/g))a.add(c[1]);for(let c of s.matchAll(/targets:\s*\[([^\]]*)\]/g))for(let l of c[1].matchAll(/"([^"]+)"/g))a.add(l[1]);if(a.size>0)return{names:[...a],source:`${e}@${o} Package.swift`}}},ije=async(e,t,{timeoutMs:n})=>{let r=await a_(e,t,{timeoutMs:n});if(!r)return;let i=r.moduleName??(r.name??e).replace(/[-.]/g,"_");return{names:[...new Set([i,e])],source:`${e} ${t} podspec`}},Nj={pypi:Z1e,maven:Y1e,nuget:Q1e,packagist:X1e,hex:eje,rubygems:nje,swift:rje,cocoapods:ije},Z_t=Object.keys(Nj),oje=64*1024*1024;async function Ky(e,t){try{let n=await qt(e,{timeoutMs:t,retries:0,maxBytes:oje});return n.ok?Ln(n.bytes):void 0}catch{return}}var Pj=new Map,Cj=new Map;function sje(e,t){let n=Pj.get(e);if(n!==void 0)return Promise.resolve(n??void 0);let r=Cj.get(e);if(r)return r;let i=t().then(o=>(Pj.set(e,o??null),o)).catch(()=>{Pj.set(e,null)}).finally(()=>Cj.delete(e));return Cj.set(e,i),i}function Hy(e){try{return e.read().toString("utf8")}catch{return""}}var ws=gt(_c(),1),_n=gt(rc(),1);function aje(e){return e.split(".").map(t=>Number.parseInt(t,10))}function zf(e,t){let n=Math.max(e.length,t.length);for(let r=0;r0}}function Wte(e,t){if(!e)return t;if(!t)return e;let n=zf(e.value,t.value);return n!==0?n>0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function Hte(e,t){if(!e)return t;if(!t)return e;let n=zf(e.value,t.value);return n!==0?n<0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function Vx(e,t){return Wte(e,t)}function Jy(e,t){return Hte(e,t)}function Kte(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);if(t.length===0)return{min:null,max:null,imprecise:!1};let n=null,r=null,i=!1;for(let o of t){let s=/^(===|~=|==|!=|<=|>=|<|>)?\s*v?(\d[\w.*]*)$/.exec(o);if(!s){i=!0;continue}let[,a,c]=s,l=!a,u=a??"==",d=cje(c);if(d.imprecise){i=!0;continue}let{release:p,wildcard:f}=d;if(f&&u!=="=="&&u!=="!="){i=!0;continue}if(u==="~="&&p.length<2){i=!0;continue}let m=l||f;switch(u){case">=":n=Vx(n,{value:p,inclusive:!0});break;case">":n=Vx(n,{value:p,inclusive:!1});break;case"<=":r=Jy(r,{value:p,inclusive:!0});break;case"<":r=Jy(r,{value:p,inclusive:!1});break;case"==":n=Vx(n,{value:p,inclusive:!0}),r=m?Jy(r,{value:qte(p),inclusive:!1}):Jy(r,{value:p,inclusive:!0});break;case"===":i=!0;break;case"~=":n=Vx(n,{value:p,inclusive:!0}),r=Jy(r,{value:qte(p.slice(0,-1)),inclusive:!1});break;case"!=":i=!0;break;default:i=!0}}return!i&&lje(n,r)?{min:n,max:r,imprecise:!0}:{min:n,max:r,imprecise:i}}function lje(e,t){if(!e||!t)return!1;let n=zf(e.value,t.value);return n>0?!0:n<0?!1:!(e.inclusive&&t.inclusive)}function uje(e,t){if(!t)return!0;if(!e)return!1;let n=zf(e.value,t.value);return n!==0?n>0:!(e.inclusive&&!t.inclusive)}function dje(e,t){if(!t)return!0;if(!e)return!1;let n=zf(e.value,t.value);return n!==0?n<0:!(e.inclusive&&!t.inclusive)}function Oj(e,t){return e.imprecise||t.imprecise?!1:uje(e.min,t.min)&&dje(e.max,t.max)}function Mj(e,t){if(e.imprecise||t.imprecise)return!0;let n=Wte(e.min,t.min),r=Hte(e.max,t.max);if(!n||!r)return!0;let i=zf(n.value,r.value);return i!==0?i<0:n.inclusive&&r.inclusive}var Yte=gt(_c(),1);var pje=/^nightly-(\d{4}-\d{2}-\d{2})$/,fje=/^beta-(\d{4}-\d{2}-\d{2})$/;function Wx(e){let t=e.trim().replace(/^rust-/i,"");if(!t)return{kind:"unknown"};let n=pje.exec(Jte(t,"nightly"));if(n)return{kind:"dated-nightly",date:n[1]};if(fje.test(Jte(t,"beta")))return{kind:"moving-beta"};if(/^stable$/i.test(t)||/^stable-/i.test(t))return{kind:"moving-stable"};if(/^beta$/i.test(t)||/^beta-/i.test(t))return{kind:"moving-beta"};if(/^nightly$/i.test(t)||/^nightly-/i.test(t))return{kind:"moving-nightly"};let r=mje(t);return r?{kind:"exact",version:r}:{kind:"unknown"}}function Jte(e,t){let n=new RegExp(`^(${t}(?:-\\d{4}-\\d{2}-\\d{2})?)`).exec(e);return n?n[1]:e}function mje(e){let t=e.split(/-(?=[a-z])/i)[0].trim();return Yte.default.valid(t)?t:/^\d+\.\d+$/.test(t)?`${t}.0`:null}var qx=new Map,gje=e=>`https://static.rust-lang.org/dist/${e}/channel-rust-nightly.toml`,Zte=e=>`rust-nightly-version:v1:${e}`;async function Qte(e){let t=qx.get(e);if(t)return t;let n=await Ia(Zte(e));if(n?.version)return qx.set(e,n.version),n.version;let r=null;try{r=await nt(gje(e),{immutable:!0,retries:1})}catch{r=null}let i=r?hje(r):null;return i&&(qx.set(e,i),await Aa(Zte(e),{version:i})),i}function Xte(e){return qx.get(e)??null}function hje(e){let t=/\[pkg\.rust\]([\s\S]*?)(?:\n\[|$)/.exec(e);if(!t)return null;let n=/(?:^|\n)\s*version\s*=\s*"([^"]+)"/.exec(t[1]);if(!n)return null;let r=/^\d+\.\d+\.\d+/.exec(n[1].trim());return r?r[0]:null}async function Lj(e){let t=new Set;for(let n of e){let r=Wx(n);r.kind==="dated-nightly"&&t.add(r.date)}await Promise.all([...t].map(n=>Qte(n)))}function Uj(e,t,n,r){return Bf(e,t,n,r).resolved}function Bf(e,t,n,r){let i=Hje(e,n,r),o={resolved:[],unresolved:[]};for(let{path:s,content:a}of i){if(!ED(s))continue;let c=(s.split("/").pop()??"").toLowerCase();if(yje[t].includes(c)){bje(s,c,a,t,o);continue}if(c===".tool-versions"){kje(s,a,t,o);continue}if(c.startsWith("dockerfile")||c.startsWith("containerfile")){_je(s,a,t,o);continue}if(t==="node"&&c==="package.json"){Sje(s,a,o);continue}if(t==="python"&&["pyproject.toml","setup.cfg","setup.py"].includes(c)){xje(s,c,a,o);continue}if(t==="ruby")c==="gemfile"?Eje(s,a,o,i):c.endsWith(".gemspec")&&Tje(s,a,o);else if(t==="go"&&c==="go.mod")Ije(s,a,o);else if(t==="java")c==="pom.xml"?Aje(s,a,o):(c==="build.gradle"||c==="build.gradle.kts")&&Pje(s,a,o);else if(t==="rust"&&c==="cargo.toml"){let l=Cje(a,"rust-version");l&&nr(o,t,s,l.line,l.requirement,"manifest",l.requirement)}Fj(s)&&Mje(s,a,t,o,n,r)}if(n!==void 0&&(r?.length??0)>1){for(let s of o.resolved)!s.scope&&!Fj(s.file)&&(s.scope=tne(s.file,n,r));for(let s of o.unresolved)!s.scope&&!Fj(s.file)&&(s.scope=tne(s.file,n,r))}if(n!==void 0&&(r?.length??0)>1){let s=c=>c==="member"?2:c==="ambiguous"?0:1,a=Math.max(0,...o.resolved.map(c=>s(c.scope)),...o.unresolved.map(c=>s(c.scope)));o.resolved=o.resolved.filter(c=>s(c.scope)===a),o.unresolved=o.unresolved.filter(c=>s(c.scope)===a)}return o.resolved=Bje(o.resolved),o.unresolved=Vje(o.unresolved),o}var yje={node:[".nvmrc",".node-version"],python:[".python-version","runtime.txt"],ruby:[".ruby-version"],rust:["rust-toolchain","rust-toolchain.toml"],go:[],java:[]};function nr(e,t,n,r,i,o,s,a){s?e.resolved.push({file:n,line:r,requirement:s,...a?{scope:a}:{}}):e.unresolved.push({runtime:t,file:n,line:r,rawText:i,source:o,...a?{scope:a}:{}})}function Wa(e){return/[$`%]|\{\{|\}\}/.test(e)}function bje(e,t,n,r,i){if(t==="rust-toolchain.toml"){let a=Gje(n,/^\s*channel\s*=\s*['"]([^'"]+)['"]/);if(!a)return;nr(i,r,e,a.line,a.requirement,"version-file",qa(a.requirement));return}if(t===".python-version"){for(let[a,c]of n.split(` +`).entries()){let l=c.trim();if(!(!l||l.startsWith("#")))for(let u of l.split(/\s+/))nr(i,r,e,a+1,u,"version-file",qa(u))}return}let o=n.trim().split(` +`)[0]?.trim();if(!o)return;let s=t==="runtime.txt"?o.replace(/^python-/i,"").trim():o.replace(/^(?:ruby-|go|rust-)?v?/i,"").trim();s&&nr(i,r,e,1,o,"version-file",qa(s))}function qa(e){return Wa(e)?null:e}function zj(e,t,n){if(e==="node")return sne(t,n);if(e==="python")return ane(t,n);let r=[],i=Zx(Kx(e,n).text);for(let o of t){let s=Kx(e,o.requirement),a=Zx(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!i){r.push({...o,...c,verdict:"unknown"});continue}let l;try{ws.default.subset(a,i,{loose:!0})?l="compatible":ws.default.intersects(a,i,{loose:!0})?l="partial":l="incompatible"}catch{l="unknown"}r.push({...o,...c,verdict:l})}return r}function Kx(e,t){if(e==="java")return{text:Yx(t)??t};if(e==="rust"){let n=Wx(t);if(n.kind==="exact")return{text:n.version,resolved:n.version};if(n.kind==="dated-nightly"){let r=Xte(n.date);return r?{text:r,resolved:r}:{text:"\0unresolved-nightly"}}return n.kind!=="unknown"?{text:"\0moving-channel"}:{text:t}}return{text:t}}function nne(e,t,n){if(e==="python")return vje(t,n);let r=Zx(Kx(e,n).text),i=[];for(let o of t){let s=Kx(e,o.requirement),a=Zx(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!r){i.push({...o,...c,verdict:"unknown"});continue}let l;try{ws.default.subset(a,r,{loose:!0})?l="incompatible":ws.default.intersects(a,r,{loose:!0})?l="partial":l="compatible"}catch{l="unknown"}i.push({...o,...c,verdict:l})}return i}function Gf(e,t="minimum"){let n=t==="unsupported"?e.replace(/\.x$/i,".*"):e;if(/^\s*(?:\^|~(?![=>]))/.test(n))return{status:"unknown",reason:"unsupported-grammar"};let r=Kte(n);return r.imprecise||r.min===null&&r.max===null?{status:"unknown",reason:"unparseable"}:{status:"parsed",value:r}}function vje(e,t){let n=Gf(t,"unsupported"),r=[];for(let i of e){let o=Gf(i.requirement),s;n.status==="unknown"||o.status==="unknown"?s="unknown":Oj(o.value,n.value)?s="incompatible":Mj(o.value,n.value)?s="partial":s="compatible",r.push({...i,verdict:s})}return r}var wje={node:["node","nodejs"],python:["python","python3"],go:["go","golang"],ruby:["ruby"],java:["java"],rust:["rust"]};function kje(e,t,n,r){for(let[i,o]of t.split(` +`).entries()){let s=/^\s*([\w-]+)\s+([^\s#]+)/.exec(o);if(!s||!wje[n].includes(s[1].toLowerCase()))continue;let a=o.slice(s.index+s[0].length-s[2].length).split("#",1)[0].split(/\s+/).filter(Boolean);for(let c of a){let l=Wa(c)||/^(?:system|path:|ref:)/i.test(c)?null:n==="java"?Yx(c):c;nr(r,n,e,i+1,c,"tool-versions",l)}}}function _je(e,t,n,r){for(let[i,o]of t.split(` +`).entries()){let s=/^\s*FROM\s+(?:--platform=\S+\s+)?(\S+)/i.exec(o)?.[1];s&&rne(r,n,e,i+1,s,"container")}}function rne(e,t,n,r,i,o,s){let a=ine(i);if(!a||a.runtime!==t)return;let c=a.version;nr(e,t,n,r,i,o,c&&!Wa(c)?Jx(c):null,s)}var $je={node:"node",python:"python",ruby:"ruby",golang:"go",openjdk:"java","eclipse-temurin":"java",amazoncorretto:"java",rust:"rust"};function ine(e){let t=e.trim().replace(/^['"]|['"]$/g,"");if(!t||t.startsWith("$"))return null;let n=t.split("@",1)[0],r=n.lastIndexOf("/"),i=n.lastIndexOf(":"),o=i>r,s=(o?n.slice(0,i):n).split("/").at(-1)?.toLowerCase();if(!s)return null;let a=$je[s];if(!a)return null;let c=o?n.slice(i+1):void 0;return c?{runtime:a,version:c}:{runtime:a}}function Sje(e,t,n){let r=Kje(t);r&&nr(n,"node",e,jj(t,/"node"\s*:/),r.raw,"manifest",r.requirement)}function xje(e,t,n,r){if(t==="setup.py"){let o=Yje(n);o&&nr(r,"python",e,o.line,o.raw,"manifest",o.requirement);return}let i=t==="pyproject.toml"?Jje(n):t==="setup.cfg"?tUe(n):null;i&&nr(r,"python",e,i.line,i.requirement,"manifest",qa(i.requirement))}function Eje(e,t,n,r){for(let[i,o]of t.split(` +`).entries()){let s=/^\s*ruby\s+(.+?)\s*(?:#.*)?$/.exec(o)?.[1]?.trim();if(!s)continue;let a=/^(['"])([^'"]+)\1/.exec(s)?.[2],c=/^file\s*:\s*(['"])([^'"]+)\1/.exec(s)?.[2];if(c){let l=r.find(u=>u.path===c||u.path.endsWith(`/${c}`));if(l){let u=l.content.trim().split(/\s+/)[0];if(u&&!Wa(u))continue}}nr(n,"ruby",e,i+1,s,"manifest",a?qa(a):null)}}function Tje(e,t,n){for(let[r,i]of t.split(` +`).entries()){let o=/\.required_ruby_version\s*=\s*(.+?)\s*(?:#.*)?$/.exec(i)?.[1]?.trim();if(!o)continue;let s=/^(['"])([^'"]+)\1/.exec(o)?.[2];nr(n,"ruby",e,r+1,o,"manifest",s?qa(s):null)}}function Ije(e,t,n){for(let[r,i]of t.split(` +`).entries()){let o=/^\s*(go|toolchain)\s+(?:go)?(\d+(?:\.\d+){0,3})\s*(?:\/\/.*)?$/.exec(i);o?.[2]&&nr(n,"go",e,r+1,o[2],"manifest",o[2])}}function Aje(e,t,n){let r=[],i=/\s*([^<]+?)\s*<\//g;for(let s of t.matchAll(i))r.push({line:t.slice(0,s.index).split(` +`).length,raw:s[1]});let o=Rje(t);for(let{line:s,raw:a}of r){if(/^\s*\$\{[^}]+\}\s*$/.test(a)&&ene(t,a))continue;let c=ene(t,a),l=c?Yx(c):null;nr(n,"java",e,s,a,"manifest",o?l:null)}}function Rje(e){return/\s*maven-toolchains?-plugin\s*<\/artifactId>/i.test(e)?/[\s\S]*?\s*\$\{java\.version\}\s*<\/version>[\s\S]*?<\/jdk>/i.test(e):!1}function ene(e,t){let n=/^\$\{([^}]+)\}$/.exec(t.trim())?.[1];if(!n)return Wa(t)?null:t;let r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`<${r}>\\s*([^<]+?)\\s*`).exec(e)?.[1];return i&&!Wa(i)?i:null}function Pje(e,t,n){let r=[/JavaLanguageVersion\.of\(\s*([^)]+?)\s*\)/];for(let[i,o]of t.split(` +`).entries())for(let s of r){let a=s.exec(o)?.[1];a&&nr(n,"java",e,i+1,a,"build-config",Wa(a)?null:Yx(a))}}function Yx(e){let t=Jx(e.replace(/_/g,"."));return t?.startsWith("1.")?t.slice(2):t}function Cje(e,t){let n=!1;for(let[r,i]of e.split(` +`).entries()){let o=/^\s*\[([^\]]+)\]\s*$/.exec(i);if(o){n=o[1]==="package";continue}if(!n)continue;let s=new RegExp(`^\\s*${t.replace("-","\\-")}\\s*=\\s*['"]([^'"]+)['"]`).exec(i);if(s?.[1])return{line:r+1,requirement:s[1]}}return null}function Fj(e){return/^\.github\/workflows\/.+\.ya?ml$/i.test(e)||/^\.(?:gitlab-ci|circleci)(?:\/|\.|$)/i.test(e)}var Nje={node:"node-version",python:"python-version",ruby:"ruby-version",go:"go-version",java:"java-version",rust:"toolchain"};function Dje(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`^\\s*(?:-\\s*)?${n}\\s*:\\s*(.*?)\\s*$`,"i").exec(e);if(!r)return null;let i=r[1].replace(/\\s+#.*$/,"").trim();return{raw:/^(['"])(.*?)\1$/.exec(i)?.[2]??i}}function Oje(e){let t=Array.from({length:e.length},()=>!0),n=null,r=/(?:^\s*-\s*|:\s*)[>|](?:(?:[+-]?\d)|(?:\d[+-]?))?\s*(?:#.*)?$/;for(let[i,o]of e.entries()){let s=o.trim(),a=/^\s*/.exec(o)[0].length;if(n!==null){if(!s||a>n){t[i]=!1;continue}n=null}r.test(o)&&(n=a)}return t}function Mje(e,t,n,r,i,o){let s=t.split(` +`),a=Oje(s),{allowed:c,ambiguous:l,repositoryWide:u}=zje(s,i,o),d=m=>l[m-1]?"ambiguous":u[m-1]?"repository":"member",p=/^\.github\/workflows\/.+\.ya?ml$/i.test(e)?jje(t,s):null,f=(m,g,h,v)=>{nr(r,n,e,m,g,h,l[m-1]?null:v,d(m))};for(let[m,g]of s.entries()){if(!a[m]||!c[m]||p?.insideMatrix(m))continue;let h=Dje(g,Nje[n]);if(h){let w=h.raw,k=p&&Fje(w),$=p&&k?p.resolve(m,k):null;if($?.ok)for(let S of $.values)f(S.line,S.value,"ci",Jx(S.value));else f(m+1,w,"ci",Wa(w)?null:Jx(w))}if(/^\.github\/workflows\//i.test(e)){let w=/^\s*container\s*:\s*['"]?([^'"\s#]+)/i.exec(g)?.[1];if(w&&Hx(r,n,e,m+1,w,"ci",l,d(m+1)),/^\s*container\s*:\s*$/i.test(g)){let k=/^\s*/.exec(g)[0].length;for(let $=m+1;$/^[ \t]*/.exec(l)[0].length,n=l=>!l.trim()||/^\s*#/.test(l),r=e.findIndex(l=>/^[ \t]*jobs:\s*(#.*)?$/.test(l));if(r===-1)return null;let i=t(e[r]),o=null,s=[],a=[],c=e.length;for(let l=r+1;l({name:a[u],start:l,end:u+10||!(0,_n.isMap)(n.contents))return null;let r=one(t);if(!r)return null;let i=[];for(let a of r){let c=n.getIn(["jobs",a.name,"strategy","matrix"],!0);c?.range&&i.push([e.slice(0,c.range[0]).split(` `).length,e.slice(0,c.range[2]).split(` -`).length])}let o=new Map;return{resolve:(a,c)=>{let l=i.find(p=>a>=p.start&&a{let c=a+1;return r.some(([l,u])=>c>=l&&c<=u)}}}function zLe(e,t,n,i){let r=e.getIn(["jobs",n,"strategy","matrix"],!0);if(!(0,_n.isMap)(r))return{ok:!1};let o=g=>{let h=g?.range;return h?t.slice(0,h[0]).split(` -`).length:1},s=g=>{if(!(0,_n.isScalar)(g))return null;let h=g.value;if(typeof h!="string"&&typeof h!="number"&&typeof h!="boolean")return null;let b=String(h);return/\$\{\{/.test(b)?null:{value:b,line:o(g)}},a=[],c=new Map;for(let g of r.items){let h=(0,_n.isScalar)(g.key)?String(g.key.value):null;if(h===null||h==="include"||h==="exclude")continue;if(a.push(h),(0,_n.isScalar)(g.value)){let y=s(g.value);if(!y)return{ok:!1};c.set(h,[y]);continue}if(!(0,_n.isSeq)(g.value))return{ok:!1};let b=[];for(let y of g.value.items){let w=s(y);if(!w)return{ok:!1};b.push(w)}c.set(h,b)}let l=a.length>0?[new Map]:[];for(let g of a){let h=[];for(let b of l)for(let y of c.get(g)??[]){let w=new Map(b);w.set(g,y),h.push(w)}l=h}let u=new Set(a),d=r.get("exclude",!0);if(r.has("exclude")&&!(0,_n.isSeq)(d))return{ok:!1};if((0,_n.isSeq)(d))for(let g of d.items){if(!(0,_n.isMap)(g))return{ok:!1};let h=[];for(let b of g.items){let y=(0,_n.isScalar)(b.key)?String(b.key.value):null,w=s(b.value);if(y===null||!w)return{ok:!1};h.push({k:y,value:w.value})}l=l.filter(b=>!h.every(y=>b.get(y.k)?.value===y.value))}let p=r.get("include",!0);if(r.has("include")&&!(0,_n.isSeq)(p))return{ok:!1};if((0,_n.isSeq)(p)){let g=l.slice();for(let h of p.items){if(!(0,_n.isMap)(h))return{ok:!1};let b=[];for(let w of h.items){let k=(0,_n.isScalar)(w.key)?String(w.key.value):null;if(k===null)return{ok:!1};let _=s(w.value);if(!_){if(k===i||u.has(k))return{ok:!1};continue}b.push({k,value:_.value,line:_.line})}let y=!1;for(let w of g)if(!b.some(_=>u.has(_.k)&&w.has(_.k)&&w.get(_.k).value!==_.value)){for(let _ of b)w.set(_.k,{value:_.value,line:_.line});y=!0}y||l.push(new Map(b.map(w=>[w.k,{value:w.value,line:w.line}])))}}if(l.length===0)return{ok:!1};let f=[],m=new Set;for(let g of l){let h=g.get(i);if(!h)return{ok:!1};m.has(h.value)||(m.add(h.value),f.push({value:h.value,line:h.line}))}return{ok:!0,values:f}}function GLe(e,t,n){let i=Array.from({length:e.length},()=>!0),r=Array.from({length:e.length},()=>!1),o=Array.from({length:e.length},()=>!0);if(t===void 0)return{allowed:i,ambiguous:r,repositoryWide:o};let s=(n?.length??0)>1,a=()=>(s&&(r.fill(!0),o.fill(!1)),{allowed:i,ambiguous:r,repositoryWide:o}),c=T=>/^[ \t]*/.exec(T)[0].length,l=Q7(e);if(!l)return a();o.fill(!1);let u=t.replace(/\\/g,"/"),d=0,p=u.length;for(;dd&&u[p-1]==="/";)p--;let f=u.slice(d,p),m=f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=f?new RegExp(m,"i"):null,h=/(?:working-directory\s*:|paths(?!-ignore)\s*:)/i,b=/paths-ignore\s*:/i,y=f?new RegExp(`(?:working-directory|paths(?!-ignore)|run)\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,w=f?new RegExp(`paths-ignore\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,k=/^([ \t]*)(?:-\s*)?paths(?!-ignore)\s*:\s*(#.*)?$/i,_=/^([ \t]*)(?:-\s*)?paths-ignore\s*:\s*(#.*)?$/i,S=(T,A)=>{if(!g)return!1;let L=T.split(` -`);for(let F=0;F(y?.test(T)??!1)||S(T,k),E=T=>(w?.test(T)??!1)||S(T,_);i.fill(!1);for(let T of l){let A=e.slice(T.start,T.end).join(` -`);if(!(b.test(A)&&E(A))){if(h.test(A)){if(x(A))for(let L=T.start;L{let i=`${n.file}:${n.line}:${n.requirement}`;return t.has(i)?!1:(t.add(i),!0)})}function qLe(e){let t=new Set;return e.filter(n=>{let i=`${n.file}:${n.line}:${n.rawText}`;return t.has(i)?!1:(t.add(i),!0)})}function Tf(e,t,n){return KF(e,"node",t,n)}var WLe=new Set(["package.json","pyproject.toml","setup.cfg","setup.py","gemfile","go.mod","pom.xml","build.gradle","build.gradle.kts","cargo.toml"]),HLe=new Set([".nvmrc",".node-version",".ruby-version",".python-version","runtime.txt",".tool-versions","rust-toolchain","rust-toolchain.toml"]);function K7(e,t,n){return t===void 0||(n?.length??0)<=1?"repository":Fc(e,n??[])===t?"member":"repository"}function KLe(e,t,n){if(t===void 0)return e;let i=n??[],r=s=>(s.split("/").pop()??"").toLowerCase(),o=new Set(e.filter(s=>HLe.has(r(s.path))&&Fc(s.path,i)===t).map(s=>r(s.path)));return e.filter(s=>{let a=Fc(s.path,i);if(a===t)return!0;let c=r(s.path);return o.has(c)?!1:a===null?!0:a===""?!WLe.has(c)&&!c.endsWith(".gemspec"):!1})}function JLe(e){try{let t=JSON.parse(e);if(!t.engines||!Object.prototype.hasOwnProperty.call(t.engines,"node"))return null;let n=t.engines.node;return typeof n=="string"?{raw:n,requirement:rc(n)}:{raw:JSON.stringify(n),requirement:null}}catch{return null}}function HF(e,t){let n=e.split(` -`).findIndex(i=>t.test(i));return n>=0?n+1:1}function X7(e,t){let n=[];for(let i of e){if(!_s.default.validRange(i.requirement,{loose:!0})){n.push({...i,verdict:"unknown"});continue}let r;try{_s.default.subset(i.requirement,t,{loose:!0})?r="compatible":_s.default.intersects(i.requirement,t,{loose:!0})?r="partial":r="incompatible"}catch{r="unknown"}n.push({...i,verdict:r})}return n}function If(e,t,n){return KF(e,"python",t,n)}function ZLe(e){let t=e.split(` -`),n=!1;for(let i=0;i{let l=r.find(p=>a>=p.start&&a{let c=a+1;return i.some(([l,u])=>c>=l&&c<=u)}}}function Uje(e,t,n,r){let i=e.getIn(["jobs",n,"strategy","matrix"],!0);if(!(0,_n.isMap)(i))return{ok:!1};let o=g=>{let h=g?.range;return h?t.slice(0,h[0]).split(` +`).length:1},s=g=>{if(!(0,_n.isScalar)(g))return null;let h=g.value;if(typeof h!="string"&&typeof h!="number"&&typeof h!="boolean")return null;let v=String(h);return/\$\{\{/.test(v)?null:{value:v,line:o(g)}},a=[],c=new Map;for(let g of i.items){let h=(0,_n.isScalar)(g.key)?String(g.key.value):null;if(h===null||h==="include"||h==="exclude")continue;if(a.push(h),(0,_n.isScalar)(g.value)){let b=s(g.value);if(!b)return{ok:!1};c.set(h,[b]);continue}if(!(0,_n.isSeq)(g.value))return{ok:!1};let v=[];for(let b of g.value.items){let w=s(b);if(!w)return{ok:!1};v.push(w)}c.set(h,v)}let l=a.length>0?[new Map]:[];for(let g of a){let h=[];for(let v of l)for(let b of c.get(g)??[]){let w=new Map(v);w.set(g,b),h.push(w)}l=h}let u=new Set(a),d=i.get("exclude",!0);if(i.has("exclude")&&!(0,_n.isSeq)(d))return{ok:!1};if((0,_n.isSeq)(d))for(let g of d.items){if(!(0,_n.isMap)(g))return{ok:!1};let h=[];for(let v of g.items){let b=(0,_n.isScalar)(v.key)?String(v.key.value):null,w=s(v.value);if(b===null||!w)return{ok:!1};h.push({k:b,value:w.value})}l=l.filter(v=>!h.every(b=>v.get(b.k)?.value===b.value))}let p=i.get("include",!0);if(i.has("include")&&!(0,_n.isSeq)(p))return{ok:!1};if((0,_n.isSeq)(p)){let g=l.slice();for(let h of p.items){if(!(0,_n.isMap)(h))return{ok:!1};let v=[];for(let w of h.items){let k=(0,_n.isScalar)(w.key)?String(w.key.value):null;if(k===null)return{ok:!1};let $=s(w.value);if(!$){if(k===r||u.has(k))return{ok:!1};continue}v.push({k,value:$.value,line:$.line})}let b=!1;for(let w of g)if(!v.some($=>u.has($.k)&&w.has($.k)&&w.get($.k).value!==$.value)){for(let $ of v)w.set($.k,{value:$.value,line:$.line});b=!0}b||l.push(new Map(v.map(w=>[w.k,{value:w.value,line:w.line}])))}}if(l.length===0)return{ok:!1};let f=[],m=new Set;for(let g of l){let h=g.get(r);if(!h)return{ok:!1};m.has(h.value)||(m.add(h.value),f.push({value:h.value,line:h.line}))}return{ok:!0,values:f}}function zje(e,t,n){let r=Array.from({length:e.length},()=>!0),i=Array.from({length:e.length},()=>!1),o=Array.from({length:e.length},()=>!0);if(t===void 0)return{allowed:r,ambiguous:i,repositoryWide:o};let s=(n?.length??0)>1,a=()=>(s&&(i.fill(!0),o.fill(!1)),{allowed:r,ambiguous:i,repositoryWide:o}),c=A=>/^[ \t]*/.exec(A)[0].length,l=one(e);if(!l)return a();o.fill(!1);let u=t.replace(/\\/g,"/"),d=0,p=u.length;for(;dd&&u[p-1]==="/";)p--;let f=u.slice(d,p),m=f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=f?new RegExp(m,"i"):null,h=/(?:working-directory\s*:|paths(?!-ignore)\s*:)/i,v=/paths-ignore\s*:/i,b=f?new RegExp(`(?:working-directory|paths(?!-ignore)|run)\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,w=f?new RegExp(`paths-ignore\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,k=/^([ \t]*)(?:-\s*)?paths(?!-ignore)\s*:\s*(#.*)?$/i,$=/^([ \t]*)(?:-\s*)?paths-ignore\s*:\s*(#.*)?$/i,S=(A,R)=>{if(!g)return!1;let j=A.split(` +`);for(let U=0;U(b?.test(A)??!1)||S(A,k),T=A=>(w?.test(A)??!1)||S(A,$);r.fill(!1);for(let A of l){let R=e.slice(A.start,A.end).join(` +`);if(!(v.test(R)&&T(R))){if(h.test(R)){if(E(R))for(let j=A.start;j{let r=`${n.file}:${n.line}:${n.requirement}`;return t.has(r)?!1:(t.add(r),!0)})}function Vje(e){let t=new Set;return e.filter(n=>{let r=`${n.file}:${n.line}:${n.rawText}`;return t.has(r)?!1:(t.add(r),!0)})}function Vf(e,t,n){return Uj(e,"node",t,n)}var qje=new Set(["package.json","pyproject.toml","setup.cfg","setup.py","gemfile","go.mod","pom.xml","build.gradle","build.gradle.kts","cargo.toml"]),Wje=new Set([".nvmrc",".node-version",".ruby-version",".python-version","runtime.txt",".tool-versions","rust-toolchain","rust-toolchain.toml"]);function tne(e,t,n){return t===void 0||(n?.length??0)<=1?"repository":Ec(e,n??[])===t?"member":"repository"}function Hje(e,t,n){if(t===void 0)return e;let r=n??[],i=s=>(s.split("/").pop()??"").toLowerCase(),o=new Set(e.filter(s=>Wje.has(i(s.path))&&Ec(s.path,r)===t).map(s=>i(s.path)));return e.filter(s=>{let a=Ec(s.path,r);if(a===t)return!0;let c=i(s.path);return o.has(c)?!1:a===null?!0:a===""?!qje.has(c)&&!c.endsWith(".gemspec"):!1})}function Kje(e){try{let t=JSON.parse(e);if(!t.engines||!Object.prototype.hasOwnProperty.call(t.engines,"node"))return null;let n=t.engines.node;return typeof n=="string"?{raw:n,requirement:qa(n)}:{raw:JSON.stringify(n),requirement:null}}catch{return null}}function jj(e,t){let n=e.split(` +`).findIndex(r=>t.test(r));return n>=0?n+1:1}function sne(e,t){let n=[];for(let r of e){if(!ws.default.validRange(r.requirement,{loose:!0})){n.push({...r,verdict:"unknown"});continue}let i;try{ws.default.subset(r.requirement,t,{loose:!0})?i="compatible":ws.default.intersects(r.requirement,t,{loose:!0})?i="partial":i="incompatible"}catch{i="unknown"}n.push({...r,verdict:i})}return n}function qf(e,t,n){return Uj(e,"python",t,n)}function Jje(e){let t=e.split(` +`),n=!1;for(let r=0;r/^\s*#/.test(s)?"":s).join(` -`),i=[...t.matchAll(YLe)].at(-1);if(!i)return null;let r=i.index+i[0].length-1,o=eFe(t,r);return o===null?null:t.slice(r,o+1)}function eFe(e,t){let n=0,i=t;for(;io.kind==="runtime-requirement"&&o.runtime?.runtime),i=new Set(n.map(o=>o.id)),r=new Map;for(let o of t){if(!i.has(o.changeId))continue;let s=r.get(o.changeId);s?s.push(o):r.set(o.changeId,[o])}return n.map(o=>{let s=r.get(o.id)??[];if(s.length===1&&s[0].runtime===o.runtime?.runtime)return s[0];let a=o.runtime?.runtime;return a?{changeId:o.id,runtime:a,requirement:o.runtime?.requirement??"",state:"unknown",reason:"not-analyzed",declarations:[],unresolved:[],sites:[],statement:`Drift could not complete runtime compatibility analysis for this ${a} requirement.`}:s[0]})}function ZF(e,t,n,i){let r=e.runtime;if(!r?.runtime||!r.requirement)return null;let o=r.runtime,s=o==="python"?xf(r.requirement,r.kind==="unsupported-runtime-range"?"unsupported":"minimum"):null;if(r.rangeParseStatus==="unknown"||s?.status==="unknown")return{changeId:e.id,runtime:o,requirement:r.requirement,state:"unknown",reason:"unparseable",declarations:[],unresolved:[],sites:[],statement:`${nee(r)}; Drift could not interpret that version range for ${YF[o]}, so it could not determine compatibility.`};let a=Ef(t,o,n,i),c=r.kind==="unsupported-runtime-range"?J7(o,a.resolved,r.requirement):JF(o,a.resolved,r.requirement),l=rFe(c,a.unresolved),u=iFe(l,c,a.unresolved);return{changeId:e.id,runtime:o,requirement:r.requirement,state:l,reason:u,declarations:c,unresolved:a.unresolved,sites:oFe(e,o,c,a.unresolved,t),statement:sFe(r,o,l,u,c,a.unresolved)}}function rFe(e,t){return e.some(n=>n.verdict==="incompatible")?"incompatible":e.some(n=>n.verdict==="partial")?"partial":e.some(n=>n.verdict==="unknown")||t.length>0?"unknown":e.length>0?"compatible":"unknown"}function iFe(e,t,n){return e==="incompatible"?"violates":e==="partial"?"overlaps":e==="compatible"?"satisfies":t.some(i=>i.verdict==="unknown")?"unparseable":n.length>0?"dynamic":"no-declaration"}function oFe(e,t,n,i,r){let o=(c,l)=>r.find(u=>u.path===c)?.content.split(` -`)[l-1]?.trim().slice(0,200)??"",s=new Map,a=c=>{let l=`${c.file}:${c.line}`,u=s.get(l);(!u||tee(c.runtimeVerdict)>tee(u.runtimeVerdict))&&s.set(l,c)};for(let c of n)c.verdict!=="compatible"&&a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:c.verdict==="unknown"?"low":"high",runtimeVerdict:c.verdict,siteKind:"runtime-declaration"});for(let c of i)a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:"low",runtimeVerdict:"unknown",siteKind:"runtime-declaration"});return[...s.values()]}function tee(e){return e==="incompatible"?3:e==="partial"?2:1}var YF={node:"Node",python:"Python",ruby:"Ruby",go:"Go",java:"Java",rust:"Rust"};function nee(e){let t=YF[e.runtime];return e.kind==="minimum-runtime"?`Upstream requires ${t} ${e.requirement}`:`Upstream no longer supports ${t} ${e.requirement}`}function sFe(e,t,n,i,r,o){let s=YF[t],a=nee(e),c=l=>[...new Set(l.map(u=>`${u.requirement} in ${u.file}`))].join(", ");if(n==="compatible")return`${a}; this repository declares ${s} ${c(r)}, which satisfies it.`;if(n==="incompatible"){let l=r.filter(u=>u.verdict==="incompatible");return`${a}; this repository declares ${s} ${c(l)}.`}if(n==="partial"){let l=r.filter(u=>u.verdict==="partial");return`${a}; this repository allows ${c(l)}, so its declared range includes versions this requirement rejects.`}if(i==="dynamic")return`${a}; ${cFe(o)} ${o.length===1?"declares":"declare"} ${s} through a dynamic value, so Drift could not determine compatibility.`;if(i==="unparseable"){let l=r.filter(u=>u.verdict==="unknown");return`${a}; this repository's ${s} declaration (${c(l)}) is not a version range Drift could evaluate, so it could not determine compatibility.`}return i==="not-analyzed"?`${a}; Drift did not complete localization, so runtime compatibility remains unknown.`:`${a}; Drift could not find an authoritative ${s} version declaration for this workspace.`}var aFe={"version-file":"a version file",manifest:"the package manifest",container:"a container image",ci:"CI configuration","tool-versions":"`.tool-versions`","build-config":"the build configuration"};function cFe(e){let t=[...new Set(e.map(n=>`${aFe[n.source]} (${n.file})`))];return t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`}function QF(e){return!e||e.length===0?void 0:["incompatible","partial","unknown","compatible"].find(n=>e.some(i=>i.state===n))}function XF(e){return e==="unknown"||e==="partial"}function nx(e,t,n,i,r){let{logger:o,maxSitesPerChange:s=100,member:a,members:c,moduleMaps:l,maxReExportDepth:u=3}=r,d=new Map(i.map(w=>[w.path,w.content])),p=new Map(n.files.map(w=>[w.path,w])),f=new Map;for(let w of t){let k=f.get(w.name);k?k.includes(w.ecosystem)||k.push(w.ecosystem):f.set(w.name,[w.ecosystem])}let m=[],g=[],h=new Map,b=(w,k)=>{let _=h.get(w.dependency)??{dependency:w.dependency,ecosystem:(f.get(w.dependency)??[])[0]??"npm",importerCandidateFiles:0,changesSearched:0,sitesFound:0};k.importerCandidateFiles!==void 0&&(_.importerCandidateFiles=Math.max(_.importerCandidateFiles,k.importerCandidateFiles)),k.searched&&(_.changesSearched+=1),k.sitesFound&&(_.sitesFound+=k.sitesFound),_.importerCandidateFiles=Math.max(_.importerCandidateFiles,_.sitesFound),h.set(w.dependency,_)},y=new Map;for(let w of e){if(w.kind==="runtime-requirement"){let L=mFe(w,d,a,c);L&&(g.push(L),m.push(...L.sites));continue}if(w.kind==="module-system-change"){let L=fFe(lFe(w,n,d,f.get(w.dependency)??[],l),a);m.push(...L),b(w,{searched:!0,sitesFound:L.length});continue}let k=w.kind==="removed-endpoint"||w.kind==="changed-endpoint",_=k?void 0:y.get(w.dependency),{files:S,names:x,reach:E}=_??hFe(w,n,f.get(w.dependency)??[],l,u,p);!k&&!_&&y.set(w.dependency,{files:S,names:x,reach:E});let T=S.filter(L=>a===void 0||xP(L.path,a));if(b(w,{importerCandidateFiles:T.length,searched:!0}),T.length===0){o.debug(`No importers found for ${w.dependency}; ${w.id} has no impact sites`);continue}let A=_Fe(w,T,d,p,s,x,E);m.push(...A),b(w,{sitesFound:A.length}),A.length>=s&&o.warn(`${w.dependency}: ${w.summary} matched at least ${s} locations; the plan lists the first ${s}.`)}return{sites:m,runtimeAnalyses:g,diagnostics:[...h.values()]}}function lFe(e,t,n,i,r){let o=e.moduleSystem?.incompatibleUsage??[];if(o.length===0)return[];let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,{names:c,exact:l}=lee(e.dependency,i,r),u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(eu(p,c))for(let m of f)u.add(m)}let d=[];for(let p of t.files){if(!u.has(p.path))continue;let f=n.get(p.path);if(!f)continue;let m=f.split(` -`);for(let g of p.imports){if(!eu(g,c)||!uFe(g.specifier,s,a)||!pFe(g,o))continue;let h=m[g.line-1]??"",b=FF(p,g.line),y=h.indexOf(g.specifier);d.push({breakingChangeId:e.id,file:p.path,line:g.line,excerpt:h.trim().slice(0,200),enclosingSymbol:b?.name,matchedSymbol:g.loadStyle==="commonjs-require"?"require":g.specifier,...y>=0?{column:y,matchedText:g.specifier}:{},confidence:"high"})}}return gee(d)}function uFe(e,t,n){return!t?.length&&!n?.length||t?.includes(e)?!0:n?.some(i=>dFe(e,i))??!1}function dFe(e,t){if([...t.matchAll(/\*/g)].length!==1)return!1;let[i,r]=t.split("*");return!e.startsWith(i)||!e.endsWith(r)?!1:e.length>i.length+r.length}function pFe(e,t){switch(e.loadStyle){case"commonjs-require":return t.includes("require");case"esm-static":return t.includes("static-import");case"esm-dynamic":return t.includes("dynamic-import");case"re-export":return t.includes("re-export");default:return!1}}function fFe(e,t){return t===void 0?[...e]:e.filter(n=>xP(n.file,t))}function mFe(e,t,n,i){let r=[...t].map(([o,s])=>({path:o,content:s}));return ZF(e,r,n,i)}function gFe(e){let t=new Set;for(let n of e){let i=n.trim(),r=i.search(/[(<]/),o=r===-1?i:i.slice(0,r);if(!o.includes("."))continue;let s=o.split(".").filter(Boolean),a=-1;for(let c=s.length-1;c>=0;c--)if(/^[A-Z]/.test(s[c])){a=c;break}a<1||(t.add(s.slice(0,a+1).join(".")),t.add(s.slice(0,a).join(".")))}return[...t].filter(Boolean)}function hFe(e,t,n,i,r,o){if(e.kind==="removed-endpoint"||e.kind==="changed-endpoint")return{files:t.files,names:[],reach:new Map};let a=lee(e.dependency,n,i),c=n.includes("maven")?[...new Set([...a.names,...gFe(e.symbols)])]:a.names,l=a.exact,u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(eu(p,c))for(let m of f)u.add(m)}let d=new Map;for(let p of u)d.set(p,{direct:!0,inherited:new Set});return r>0&&yFe(t,c,d,r,o),{files:t.files.filter(p=>d.has(p.path)),names:c,reach:d}}function lee(e,t,n){let i=new Set;for(let o of t){let s=n?.get(GF(o,e));for(let a of s?.names??[])i.add(a)}return i.size>0?{names:[...new Set([...i,e])],exact:!0}:{names:t.length>0?[...new Set(t.flatMap(o=>iee(e,o)))]:iee(e,void 0),exact:!1}}function yFe(e,t,n,i,r){let o=[...n.keys()].filter(s=>vFe(r.get(s),t));for(let s=0;s0;s++){let a=[];for(let c of o)for(let l of e.localImporters.get(c)??[]){if(n.size>=bFe)return;let u=n.get(l.from);if(u){for(let d of l.bindings)u.inherited.add(d);continue}n.set(l.from,{direct:!1,inherited:new Set(l.bindings)}),l.reExport&&a.push(l.from)}o=a}}var bFe=400;function vFe(e,t){return e?e.imports.some(n=>n.reExport===!0&&(t.length===0||eu(n,t))):!1}function eu(e,t){return(typeof e=="string"?[e]:qS(e)).some(i=>t.some(r=>ree(i,r)||ree(r,i)))}function ree(e,t){if(e===t)return!0;if(!e.startsWith(t))return!1;let n=e[t.length];return n==="/"||n==="."||n===":"||n==="\\"}function iee(e,t){let n=new Set([e]);switch(t){case"pypi":{let i=e.toLowerCase().replace(/-/g,"_");n.add(i);let r=kFe[e.toLowerCase()];r&&n.add(r);break}case"maven":{let[i]=e.split(":");i&&n.add(i);break}case"cargo":n.add(e.replace(/-/g,"_"));break;case"conan":case"vcpkg":case"arduino":{let i=e.toLowerCase();n.add(i),n.add(i.replace(/[-_]/g,"")),n.add(i.replace(/[-_]/g,"/"));let r=wFe[i];r&&n.add(r),i.startsWith("lib")&&i.length>4&&n.add(i.slice(3));break}case"packagist":{let[i,r]=e.split("/");i&&r&&(n.add(`${Xl(i)}\\${Xl(r)}`),n.add(Xl(i)));break}case"hex":{n.add(Xl(e)),n.add(e.toLowerCase());break}case"swift":{let i=e.split("/").pop()??e;n.add(i),n.add(Xl(i)),i.toLowerCase().startsWith("swift-")&&n.add(Xl(i.slice(6)));break}case"cocoapods":n.add(e.replace(/[-.]/g,"_"));break;case"opam":n.add(Xl(e.replace(/\./g,"_"))),n.add(uee(e.replace(/\./g,"_")));break;default:break}return[...n]}function Xl(e){return e.split(/[-_.]/).filter(Boolean).map(t=>uee(t)).join("")}function uee(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}var wFe={nlohmann_json:"nlohmann","libjpeg-turbo":"jpeglib",libxml2:"libxml",sdl:"sdl2",protobuf:"google",grpc:"grpcpp",abseil:"absl","ms-gsl":"gsl",gtest:"gtest"},kFe={beautifulsoup4:"bs4",pillow:"PIL",pyyaml:"yaml","python-dateutil":"dateutil","msgpack-python":"msgpack",attrs:"attr","scikit-learn":"sklearn","opencv-python":"cv2","python-dotenv":"dotenv",protobuf:"google","google-cloud-storage":"google","psycopg2-binary":"psycopg2",mysqlclient:"MySQLdb","django-cors-headers":"corsheaders",djangorestframework:"rest_framework","pytest-cov":"pytest_cov","typing-extensions":"typing_extensions"},oee=new WeakMap;function $Fe(e,t){let n=oee.get(e);if(n)return n;let i=t.split(` -`),r,o,s={lines:i,withStrings:()=>r??=cee(i,{blankStrings:!1}),withoutStrings:()=>o??=cee(i,{blankStrings:!0})};return oee.set(e,s),s}function _Fe(e,t,n,i,r,o,s){let a=[];for(let c of t){if(a.length>=r)break;let l=n.get(c.path);if(!l)continue;let u=i.get(c.path),d=o.length===0?c.imports:c.imports.filter(A=>eu(A,o)),p=new Set(d.flatMap(A=>A.bindings)),f=d.length>0,m=s.get(c.path),g=m!==void 0&&!m.direct,h=new Set(c.imports.filter(A=>!eu(A,o)).flatMap(A=>A.bindings).filter(A=>A!=="*")),b=new Set(c.units.filter(A=>A.kind!=="method").map(A=>A.name)),y=new Set(c.units.filter(A=>A.kind==="method").map(A=>A.name.split(".").pop()??A.name)),w=new Map;for(let A of c.units){if(A.kind==="variable")continue;let L=A.name.split(".").pop()??A.name,F=w.get(A.startLine)??new Set;F.add(A.name),F.add(L),w.set(A.startLine,F)}let k=FFe.has(c.language)&&f&&!g&&d.every(A=>A.synthetic!==!0&&!A.bindings.includes("*")),_=new Set(c.imports.filter(A=>A.synthetic!==!0).map(A=>A.line)),S=SFe(e.kind),x=xFe(e.kind)&&EFe(c.language),E=$Fe(c,l),{lines:T}=E;for(let A of e.symbols){let L=zFe(e,A),F=L?BFe(L,d,l,m?.inherited):new Set,K=L?qFe(l,F):new Set,te=new Set([...F,...K]),D=L?GFe(e,A,d):p.has(A),X=L?VFe(e,A,o):!1,re=x?IFe(A):pee(A);if(!re||jFe(A,p,h)||WFe(A,p,b))continue;let ie=see(A),ke=ie?E.withStrings():E.withoutStrings(),We=S||ie;for(let ye=0;yeF.has(sn)));if(!Mt&&!vt)continue;zn=vt}if(!Ci&&Cn!==void 0&&LFe.has(Cn)||!Ci&&Cn!==void 0&&y.has(A)||w.get(ye+1)?.has(A))continue;let Pi=p.has(A)||p.has(A.split(".")[0]??A)||p.has("*"),fe=!A.includes(".")&&!see(A);if(k&&fe&&!Pi&&!Ci&&!zn||x&&AFe(e,ke,ye,pt))continue;let ae=u?FF(u,ye+1):void 0,be=Cn!==void 0&&!Ci&&!zn;a.push({breakingChangeId:e.id,file:c.path,line:ye+1,excerpt:xt.trim().slice(0,200),enclosingSymbol:ae?.name,matchedSymbol:A,...pt?{column:pt.index,matchedText:pt[0]}:{},confidence:HFe(A,p,f,g,m?.inherited,be,zn)})}}}return gee(a)}function SFe(e){return e==="removed-export"||e==="renamed-export"||e==="moved-export"||e==="unknown"}function xFe(e){return e==="signature-change"}function EFe(e){return!TFe.has(e)}var TFe=new Set(["ruby","elixir","erlang","ocaml","other","config"]);function IFe(e){let t=e.trim();if(!t||t.length<2)return null;if(t.startsWith("/")||t.startsWith("@"))return pee(t);let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)"),i=/^\w/.test(t)?"\\b":"(?)?";return new RegExp(`(?:new\\s+)?${i}${n}${r}\\s*\\(|(?1&&(o=!0);continue}if(l===")"||l==="]"||l==="}"){if(i-=1,i<0)return null;if(i===0)return l!==")"?null:o?r+1:0;continue}if(i===1&&l===","){r+=1,o=!0;continue}if(l==="`")return null;/\s/.test(l)||(o=!0)}}return null}var NFe=200;function CFe(e,t,n){if(n===void 0||!/^\s*\(/.test(n))return!1;let i=e.trim(),r=i.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&"),o=/^\w/.test(i)?"\\b":"(?)\s*$/:/([A-Za-z_$][\w$]*)\s*(?:\.|::)\s*$/,r=[],o=e.slice(0,t);for(let s=0;s<8;s++){let a=i.exec(o);if(!a)break;r.unshift(a[1]),o=o.slice(0,a.index)}return r.length>0?r:void 0}function MFe(e,t,n){if(n!=="c"&&n!=="cpp")return!1;let i=e.slice(0,t).trim(),r=e.slice(t);return!i||!/^\w+\s*\(/.test(r)||/(?:\.|::|->)\s*$/.test(i)||/^(?:return|co_return|throw|case|delete|new)$/.test(i)?!1:/^(?:(?:virtual|static|inline|constexpr|consteval|constinit|explicit|friend|extern)\s+)*(?:const\s+)?(?:(?:unsigned|signed|long|short)\s+)*[\w:<>]+(?:\s*[*&])?$/.test(i)}var LFe=new Set(["this","$this","self","Self","super","cls","me"]),FFe=new Set(["typescript","javascript","python","go","rust","java"]);function UFe(e,t,n){return n!=="elixir"&&n!=="erlang"&&n!=="ruby"?!1:e[t-1]===":"&&e[t-2]!==":"}function jFe(e,t,n){let i=e.split(".")[0]??e;return t.has(e)||t.has(i)||t.has("*")?!1:n.has(e)||n.has(i)}function pee(e){let t=e.trim();if(!t||t.length<2)return null;let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)");if(t.startsWith("/"))return new RegExp(n);let i=/^\w/.test(t)?"\\b":"(?=2)return i.at(-2)}}function mee(e,t){return e.symbols.filter(n=>n===t||!n.includes(".")&&!n.includes("::")?!1:n.split(/[.:]+/).filter(Boolean).at(-1)===t)}function Ay(e){return e.replace(/^@/,"").replace(/::|[\\/]/g,".").replace(/\.+/g,".").replace(/^\.|\.$/g,"").toLowerCase()}function GFe(e,t,n){for(let i of mee(e,t)){let r=i.split(/[.:]+/).filter(Boolean),o=Ay(r.slice(0,-1).join("."));if(o)for(let s of n){if(!s.bindings.includes(t))continue;if(new Set([s.specifier,s.packageName,...qS(s)].map(Ay)).has(o))return!0;for(let c of[Ay(s.specifier)]){if(!o.startsWith(`${c}.`))continue;if(o.slice(c.length+1).split(".").every(u=>/^[a-z_][a-z0-9_]*$/.test(u)))return!0}}}return!1}function VFe(e,t,n){let i=new Set(n.map(Ay));return mee(e,t).some(r=>{let o=r.split(/[.:]+/).filter(Boolean);return i.has(Ay(o.slice(0,-1).join(".")))})}function BFe(e,t,n,i){let r=new Set;i?.has(e)&&r.add(e);let o=n.split(` -`);for(let s of t){(s.bindings.includes(e)||s.bindings.includes("*"))&&r.add(e),e==="default"&&s.defaultBinding&&r.add(s.defaultBinding);let a=e.includes("."),c=e.split(".").pop();a&&c&&(s.specifier===e&&r.add(c),s.bindings.includes("*")&&e.startsWith(`${s.specifier}.`)&&r.add(c));let l=o[s.line-1]??"",u=new RegExp(`\\b${fee(e)}\\s+as\\s+([A-Za-z_$][\\w$]*)`).exec(l)?.[1];u&&r.add(u)}return r}function qFe(e,t){let n=new Set;for(let i of t){let r=fee(i),o=[new RegExp(`\\b(?:const|let|var|val|final|auto|let(?:\\s+mut)?)\\s+([A-Za-z_$][\\w$]*)\\s*(?::\\s*[^=]+)?=\\s*(?:new\\s+)?${r}(?:::new)?\\s*[({]`,"g"),new RegExp(`\\b(?:new\\s+)?${r}\\s*\\(.*?\\)\\s*as\\s+([A-Za-z_$][\\w$]*)`,"g"),new RegExp(`^\\s*([A-Za-z_$][\\w$]*)\\s*=\\s*${r}\\s*\\(`,"gm"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${r}\\s*\\(`,"g"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*${r}::new\\s*\\(`,"g"),new RegExp(`(?)?(?:\\s*\\[\\])?\\s+([A-Za-z_$][\\w$]*)\\s*(?:[({;=,)]|:(?!:))`,"g"),new RegExp(`([A-Za-z_$][\\w$]*)\\s*:\\s*(?:readonly\\s+)?${r}\\b(?!\\s*\\.)`,"g")];for(let s of o)for(let a of e.matchAll(s))a[1]&&n.add(a[1])}return n}function see(e){let t=e.trim();return t.startsWith("/")||t.startsWith("@")||t.includes("/")}function WFe(e,t,n){if(t.has(e)||t.has("*"))return!1;let i=e.split(".")[0]??e;return t.has(i)?!1:n.has(e)||e!==i&&n.has(i)}function HFe(e,t,n,i,r,o,s=!1){let a=e.split(".")[0]??e;return i?r&&(r.has(e)||r.has(a))?"medium":"low":t.has(e)||t.has(a)||t.has("*")||s?"high":o?"low":n?"medium":"low"}function gee(e){let t=new Map;for(let n of e){let i=`${n.breakingChangeId}|${n.file}|${n.line}`,r=t.get(i);(!r||aee(n.confidence)>aee(r.confidence))&&t.set(i,n)}return[...t.values()].sort((n,i)=>n.file.localeCompare(i.file)||n.line-i.line)}function aee(e){return e==="high"?2:e==="medium"?1:0}function KFe(e){let t=e.trim();return t.startsWith("#")?!JFe.test(t):t.startsWith("%")||t.startsWith("(*")?!0:t.startsWith("//")||t.startsWith("*")||t.startsWith("/*")}var JFe=/^#\s*(include|define|undef|if|ifdef|ifndef|elif|else|endif|pragma|error|warning|line)\b/;function cee(e,t){let n=[],i=!1,r=null;for(let o of e){let s="",a=0,c=null;for(;ah.has(b.line-1)).length)}return c.length===0?null:{transform:{ruleId:"rename-identifier",from:r,to:o,anchors:l},edits:c,sitesResolved:u}}function YFe(e,t,n){let i=e.replacementSymbols?.[0];if(!i||!rx.test(i))return null;let o=e.symbols.find(d=>/^[\w$]+\.[\w$]+$/.test(d))?.split(".")[1];if(!o||!rx.test(o)||o===i)return null;let s=e.dependency,a=[],c=[],l=0,u=new Map;for(let d of t)u.set(d.file,[...u.get(d.file)??[],d]);for(let[d,p]of u){let f=n.get(d);if(f===void 0)continue;let m=yee(f,s,o,i);if(m){a.push({file:d,before:f,after:m.content});for(let g of m.touched)c.push({file:d,line:g.text,lineNumber:g.number});l+=p.filter(g=>m.touched.some(h=>h.number===g.line)).length}}return a.length===0||l===0?null:{transform:{ruleId:"namespace-member-to-named-import",from:o,to:i,packageName:s,anchors:c},edits:a,sitesResolved:l}}var QFe=e=>{let t=ro(e);return[new RegExp(`^(\\s*)import\\s+(?:\\*\\s+as\\s+)?([A-Za-z_$][\\w$]*)\\s+from\\s+(['"\`])${t}\\3(\\s*;?)\\s*$`),new RegExp(`^(\\s*)(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\(\\s*(['"\`])${t}\\3\\s*\\)(\\s*;?)\\s*$`)]};function yee(e,t,n,i){let r=e.split(` -`),o=QFe(t),s=-1,a="",c="";for(let[f,m]of r.entries()){for(let[g,h]of o.entries()){let b=h.exec(m);if(!b)continue;s=f,a=b[2];let[y,,,w,k]=[b[1],b[2],"",b[3],b[4]??""];c=g===0?`${y}import { ${i} } from ${w}${t}${w}${k}`:`${y}const { ${i} } = require(${w}${t}${w})${k}`;break}if(s>=0)break}if(s<0||!a)return null;let l=new RegExp(`(?r.file===n))return e;let i=yee(e,t.packageName,t.from,t.to);return i?i.content:e}default:return e}}function XFe(e,t,n,i,r){let o=i.filter(u=>u.file===r);if(o.length===0)return e;let s=e.split(` -`),a=new Map;for(let u of s)a.set(u,(a.get(u)??0)+1);let c=new Set;for(let u of o){let d=u.lineNumber-1;if(s[d]===u.line){c.add(d);continue}if((a.get(u.line)??0)===1){let p=s.indexOf(u.line);p!==-1&&c.add(p)}}if(c.size===0)return e;let l=new RegExp(`(?c.has(d)?vee(u,l,n):u).join(` -`)}function vee(e,t,n){return t1(e,t,n)}function wee(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return"proven";case"insert-argument":case"wrap-call":return"checked"}}var e1e={type:"array",minItems:1,maxItems:8,items:{type:"object",oneOf:[{type:"object",properties:{kind:{const:"rename-identifier"},from:{type:"string",description:"The old bare identifier, exactly as it appears in code."},to:{type:"string",description:"The new bare identifier."}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"rename-member"},from:{type:"string",description:"The old member name, without the dot or the receiver."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"replace-import-path"},from:{type:"string",description:"The old module specifier, exactly as written between the quotes."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"insert-argument"},callee:{type:"string",description:"The function being called, e.g. `connect` or `client.connect`."},index:{type:"integer",minimum:0,maximum:8,description:"0-based position in the argument list."},text:{type:"string",description:"A literal only: a quoted string, a number, a boolean, null, or a flat object literal. Never a function call or an expression."}},required:["kind","callee","index","text"],additionalProperties:!1},{type:"object",properties:{kind:{const:"wrap-call"},callee:{type:"string"},wrapper:{type:"string",enum:["await","new"]}},required:["kind","callee","wrapper"],additionalProperties:!1}]}},t1e={type:"object",properties:{applicable:{type:"boolean",description:"False when this migration cannot be expressed as the listed operations. Answering false is correct and common."},migration:{type:"string",description:"One sentence stating the migration, for a human reviewer."},rationale:{type:"string",description:"Why this is the correct fix, quoting the evidence. Two sentences at most."},citations:{type:"array",items:{type:"string"},description:"Ids of the evidence blocks that state this replacement. Copy them exactly."},ops:e1e},required:["applicable","migration","rationale","citations","ops"],additionalProperties:!1},n1e=`You write migration rules for an automated refactoring tool. +`),r=[...t.matchAll(Zje)].at(-1);if(!r)return null;let i=r.index+r[0].length-1,o=Xje(t,i);return o===null?null:t.slice(i,o+1)}function Xje(e,t){let n=0,r=t;for(;ro.kind==="runtime-requirement"&&o.runtime?.runtime),r=new Set(n.map(o=>o.id)),i=new Map;for(let o of t){if(!r.has(o.changeId))continue;let s=i.get(o.changeId);s?s.push(o):i.set(o.changeId,[o])}return n.map(o=>{let s=i.get(o.id)??[];if(s.length===1&&s[0].runtime===o.runtime?.runtime)return s[0];let a=o.runtime?.runtime;return a?{changeId:o.id,runtime:a,requirement:o.runtime?.requirement??"",state:"unknown",reason:"not-analyzed",declarations:[],unresolved:[],sites:[],statement:`Drift could not complete runtime compatibility analysis for this ${a} requirement.`}:s[0]})}function Gj(e,t,n,r){let i=e.runtime;if(!i?.runtime||!i.requirement)return null;let o=i.runtime,s=o==="python"?Gf(i.requirement,i.kind==="unsupported-runtime-range"?"unsupported":"minimum"):null;if(i.rangeParseStatus==="unknown"||s?.status==="unknown")return{changeId:e.id,runtime:o,requirement:i.requirement,state:"unknown",reason:"unparseable",declarations:[],unresolved:[],sites:[],statement:`${lne(i)}; Drift could not interpret that version range for ${Bj[o]}, so it could not determine compatibility.`};let a=Bf(t,o,n,r),c=i.kind==="unsupported-runtime-range"?nne(o,a.resolved,i.requirement):zj(o,a.resolved,i.requirement),l=nUe(c,a.unresolved),u=rUe(l,c,a.unresolved);return{changeId:e.id,runtime:o,requirement:i.requirement,state:l,reason:u,declarations:c,unresolved:a.unresolved,sites:iUe(e,o,c,a.unresolved,t),statement:oUe(i,o,l,u,c,a.unresolved)}}function nUe(e,t){return e.some(n=>n.verdict==="incompatible")?"incompatible":e.some(n=>n.verdict==="partial")?"partial":e.some(n=>n.verdict==="unknown")||t.length>0?"unknown":e.length>0?"compatible":"unknown"}function rUe(e,t,n){return e==="incompatible"?"violates":e==="partial"?"overlaps":e==="compatible"?"satisfies":t.some(r=>r.verdict==="unknown")?"unparseable":n.length>0?"dynamic":"no-declaration"}function iUe(e,t,n,r,i){let o=(c,l)=>i.find(u=>u.path===c)?.content.split(` +`)[l-1]?.trim().slice(0,200)??"",s=new Map,a=c=>{let l=`${c.file}:${c.line}`,u=s.get(l);(!u||cne(c.runtimeVerdict)>cne(u.runtimeVerdict))&&s.set(l,c)};for(let c of n)c.verdict!=="compatible"&&a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:c.verdict==="unknown"?"low":"high",runtimeVerdict:c.verdict,siteKind:"runtime-declaration"});for(let c of r)a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:"low",runtimeVerdict:"unknown",siteKind:"runtime-declaration"});return[...s.values()]}function cne(e){return e==="incompatible"?3:e==="partial"?2:1}var Bj={node:"Node",python:"Python",ruby:"Ruby",go:"Go",java:"Java",rust:"Rust"};function lne(e){let t=Bj[e.runtime];return e.kind==="minimum-runtime"?`Upstream requires ${t} ${e.requirement}`:`Upstream no longer supports ${t} ${e.requirement}`}function oUe(e,t,n,r,i,o){let s=Bj[t],a=lne(e),c=l=>[...new Set(l.map(u=>`${u.requirement} in ${u.file}`))].join(", ");if(n==="compatible")return`${a}; this repository declares ${s} ${c(i)}, which satisfies it.`;if(n==="incompatible"){let l=i.filter(u=>u.verdict==="incompatible");return`${a}; this repository declares ${s} ${c(l)}.`}if(n==="partial"){let l=i.filter(u=>u.verdict==="partial");return`${a}; this repository allows ${c(l)}, so its declared range includes versions this requirement rejects.`}if(r==="dynamic")return`${a}; ${aUe(o)} ${o.length===1?"declares":"declare"} ${s} through a dynamic value, so Drift could not determine compatibility.`;if(r==="unparseable"){let l=i.filter(u=>u.verdict==="unknown");return`${a}; this repository's ${s} declaration (${c(l)}) is not a version range Drift could evaluate, so it could not determine compatibility.`}return r==="not-analyzed"?`${a}; Drift did not complete localization, so runtime compatibility remains unknown.`:`${a}; Drift could not find an authoritative ${s} version declaration for this workspace.`}var sUe={"version-file":"a version file",manifest:"the package manifest",container:"a container image",ci:"CI configuration","tool-versions":"`.tool-versions`","build-config":"the build configuration"};function aUe(e){let t=[...new Set(e.map(n=>`${sUe[n.source]} (${n.file})`))];return t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`}function Vj(e){return!e||e.length===0?void 0:["incompatible","partial","unknown","compatible"].find(n=>e.some(r=>r.state===n))}function qj(e){return e==="unknown"||e==="partial"}function Xx(e,t,n,r,i){let{logger:o,maxSitesPerChange:s=100,member:a,members:c,moduleMaps:l,maxReExportDepth:u=3}=i,d=new Map(r.map(w=>[w.path,w.content])),p=new Map(n.files.map(w=>[w.path,w])),f=new Map;for(let w of t){let k=f.get(w.name);k?k.includes(w.ecosystem)||k.push(w.ecosystem):f.set(w.name,[w.ecosystem])}let m=[],g=[],h=new Map,v=(w,k)=>{let $=h.get(w.dependency)??{dependency:w.dependency,ecosystem:(f.get(w.dependency)??[])[0]??"npm",importerCandidateFiles:0,changesSearched:0,sitesFound:0};k.importerCandidateFiles!==void 0&&($.importerCandidateFiles=Math.max($.importerCandidateFiles,k.importerCandidateFiles)),k.searched&&($.changesSearched+=1),k.sitesFound&&($.sitesFound+=k.sitesFound),$.importerCandidateFiles=Math.max($.importerCandidateFiles,$.sitesFound),h.set(w.dependency,$)},b=new Map;for(let w of e){if(w.kind==="runtime-requirement"){let j=fUe(w,d,a,c);j&&(g.push(j),m.push(...j.sites));continue}if(w.kind==="module-system-change"){let j=pUe(cUe(w,n,d,f.get(w.dependency)??[],l),a);m.push(...j),v(w,{searched:!0,sitesFound:j.length});continue}let k=w.kind==="removed-endpoint"||w.kind==="changed-endpoint",$=k?void 0:b.get(w.dependency),{files:S,names:E,reach:T}=$??gUe(w,n,f.get(w.dependency)??[],l,u,p);!k&&!$&&b.set(w.dependency,{files:S,names:E,reach:T});let A=S.filter(j=>a===void 0||_D(j.path,a));if(v(w,{importerCandidateFiles:A.length,searched:!0}),A.length===0){o.debug(`No importers found for ${w.dependency}; ${w.id} has no impact sites`);continue}let R=_Ue(w,A,d,p,s,E,T);m.push(...R),v(w,{sitesFound:R.length}),R.length>=s&&o.warn(`${w.dependency}: ${w.summary} matched at least ${s} locations; the plan lists the first ${s}.`)}return{sites:m,runtimeAnalyses:g,diagnostics:[...h.values()]}}function cUe(e,t,n,r,i){let o=e.moduleSystem?.incompatibleUsage??[];if(o.length===0)return[];let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,{names:c,exact:l}=hne(e.dependency,r,i),u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(Ml(p,c))for(let m of f)u.add(m)}let d=[];for(let p of t.files){if(!u.has(p.path))continue;let f=n.get(p.path);if(!f)continue;let m=f.split(` +`);for(let g of p.imports){if(!Ml(g,c)||!lUe(g.specifier,s,a)||!dUe(g,o))continue;let h=m[g.line-1]??"",v=Rj(p,g.line),b=h.indexOf(g.specifier);d.push({breakingChangeId:e.id,file:p.path,line:g.line,excerpt:h.trim().slice(0,200),enclosingSymbol:v?.name,matchedSymbol:g.loadStyle==="commonjs-require"?"require":g.specifier,...b>=0?{column:b,matchedText:g.specifier}:{},confidence:"high"})}}return _ne(d)}function lUe(e,t,n){return!t?.length&&!n?.length||t?.includes(e)?!0:n?.some(r=>uUe(e,r))??!1}function uUe(e,t){if([...t.matchAll(/\*/g)].length!==1)return!1;let[r,i]=t.split("*");return!e.startsWith(r)||!e.endsWith(i)?!1:e.length>r.length+i.length}function dUe(e,t){switch(e.loadStyle){case"commonjs-require":return t.includes("require");case"esm-static":return t.includes("static-import");case"esm-dynamic":return t.includes("dynamic-import");case"re-export":return t.includes("re-export");default:return!1}}function pUe(e,t){return t===void 0?[...e]:e.filter(n=>_D(n.file,t))}function fUe(e,t,n,r){let i=[...t].map(([o,s])=>({path:o,content:s}));return Gj(e,i,n,r)}function mUe(e){let t=new Set;for(let n of e){let r=n.trim(),i=r.search(/[(<]/),o=i===-1?r:r.slice(0,i);if(!o.includes("."))continue;let s=o.split(".").filter(Boolean),a=-1;for(let c=s.length-1;c>=0;c--)if(/^[A-Z]/.test(s[c])){a=c;break}a<1||(t.add(s.slice(0,a+1).join(".")),t.add(s.slice(0,a).join(".")))}return[...t].filter(Boolean)}function gUe(e,t,n,r,i,o){if(e.kind==="removed-endpoint"||e.kind==="changed-endpoint")return{files:t.files,names:[],reach:new Map};let a=hne(e.dependency,n,r),c=n.includes("maven")?[...new Set([...a.names,...mUe(e.symbols)])]:a.names,l=a.exact,u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(Ml(p,c))for(let m of f)u.add(m)}let d=new Map;for(let p of u)d.set(p,{direct:!0,inherited:new Set});return i>0&&hUe(t,c,d,i,o),{files:t.files.filter(p=>d.has(p.path)),names:c,reach:d}}function hne(e,t,n){let r=new Set;for(let o of t){let s=n?.get(Dj(o,e));for(let a of s?.names??[])r.add(a)}return r.size>0?{names:[...new Set([...r,e])],exact:!0}:{names:t.length>0?[...new Set(t.flatMap(o=>dne(e,o)))]:dne(e,void 0),exact:!1}}function hUe(e,t,n,r,i){let o=[...n.keys()].filter(s=>bUe(i.get(s),t));for(let s=0;s0;s++){let a=[];for(let c of o)for(let l of e.localImporters.get(c)??[]){if(n.size>=yUe)return;let u=n.get(l.from);if(u){for(let d of l.bindings)u.inherited.add(d);continue}n.set(l.from,{direct:!1,inherited:new Set(l.bindings)}),l.reExport&&a.push(l.from)}o=a}}var yUe=400;function bUe(e,t){return e?e.imports.some(n=>n.reExport===!0&&(t.length===0||Ml(n,t))):!1}function Ml(e,t){return(typeof e=="string"?[e]:Gx(e)).some(r=>t.some(i=>une(r,i)||une(i,r)))}function une(e,t){if(e===t)return!0;if(!e.startsWith(t))return!1;let n=e[t.length];return n==="/"||n==="."||n===":"||n==="\\"}function dne(e,t){let n=new Set([e]);switch(t){case"pypi":{let r=e.toLowerCase().replace(/-/g,"_");n.add(r);let i=wUe[e.toLowerCase()];i&&n.add(i);break}case"maven":{let[r]=e.split(":");r&&n.add(r);break}case"cargo":n.add(e.replace(/-/g,"_"));break;case"conan":case"vcpkg":case"arduino":{let r=e.toLowerCase();n.add(r),n.add(r.replace(/[-_]/g,"")),n.add(r.replace(/[-_]/g,"/"));let i=vUe[r];i&&n.add(i),r.startsWith("lib")&&r.length>4&&n.add(r.slice(3));break}case"packagist":{let[r,i]=e.split("/");r&&i&&(n.add(`${Ol(r)}\\${Ol(i)}`),n.add(Ol(r)));break}case"hex":{n.add(Ol(e)),n.add(e.toLowerCase());break}case"swift":{let r=e.split("/").pop()??e;n.add(r),n.add(Ol(r)),r.toLowerCase().startsWith("swift-")&&n.add(Ol(r.slice(6)));break}case"cocoapods":n.add(e.replace(/[-.]/g,"_"));break;case"opam":n.add(Ol(e.replace(/\./g,"_"))),n.add(yne(e.replace(/\./g,"_")));break;default:break}return[...n]}function Ol(e){return e.split(/[-_.]/).filter(Boolean).map(t=>yne(t)).join("")}function yne(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}var vUe={nlohmann_json:"nlohmann","libjpeg-turbo":"jpeglib",libxml2:"libxml",sdl:"sdl2",protobuf:"google",grpc:"grpcpp",abseil:"absl","ms-gsl":"gsl",gtest:"gtest"},wUe={beautifulsoup4:"bs4",pillow:"PIL",pyyaml:"yaml","python-dateutil":"dateutil","msgpack-python":"msgpack",attrs:"attr","scikit-learn":"sklearn","opencv-python":"cv2","python-dotenv":"dotenv",protobuf:"google","google-cloud-storage":"google","psycopg2-binary":"psycopg2",mysqlclient:"MySQLdb","django-cors-headers":"corsheaders",djangorestframework:"rest_framework","pytest-cov":"pytest_cov","typing-extensions":"typing_extensions"},pne=new WeakMap;function kUe(e,t){let n=pne.get(e);if(n)return n;let r=t.split(` +`),i,o,s={lines:r,withStrings:()=>i??=gne(r,{blankStrings:!1}),withoutStrings:()=>o??=gne(r,{blankStrings:!0})};return pne.set(e,s),s}function _Ue(e,t,n,r,i,o,s){let a=[];for(let c of t){if(a.length>=i)break;let l=n.get(c.path);if(!l)continue;let u=r.get(c.path),d=o.length===0?c.imports:c.imports.filter(R=>Ml(R,o)),p=new Set(d.flatMap(R=>R.bindings)),f=d.length>0,m=s.get(c.path),g=m!==void 0&&!m.direct,h=new Set(c.imports.filter(R=>!Ml(R,o)).flatMap(R=>R.bindings).filter(R=>R!=="*")),v=new Set(c.units.filter(R=>R.kind!=="method").map(R=>R.name)),b=new Set(c.units.filter(R=>R.kind==="method").map(R=>R.name.split(".").pop()??R.name)),w=new Map;for(let R of c.units){if(R.kind==="variable")continue;let j=R.name.split(".").pop()??R.name,U=w.get(R.startLine)??new Set;U.add(R.name),U.add(j),w.set(R.startLine,U)}let k=LUe.has(c.language)&&f&&!g&&d.every(R=>R.synthetic!==!0&&!R.bindings.includes("*")),$=new Set(c.imports.filter(R=>R.synthetic!==!0).map(R=>R.line)),S=$Ue(e.kind),E=SUe(e.kind)&&xUe(c.language),T=kUe(c,l),{lines:A}=T;for(let R of e.symbols){let j=UUe(e,R),U=j?BUe(j,d,l,m?.inherited):new Set,Z=j?VUe(l,U):new Set,re=new Set([...U,...Z]),L=j?zUe(e,R,d):p.has(R),te=j?GUe(e,R,o):!1,se=E?TUe(R):vne(R);if(!se||jUe(R,p,h)||qUe(R,p,v))continue;let ae=fne(R),Se=ae?T.withStrings():T.withoutStrings(),We=S||ae;for(let we=0;weU.has(sn)));if(!Ft&&!wt)continue;zn=wt}if(!Di&&Pn!==void 0&&MUe.has(Pn)||!Di&&Pn!==void 0&&b.has(R)||w.get(we+1)?.has(R))continue;let Oi=p.has(R)||p.has(R.split(".")[0]??R)||p.has("*"),he=!R.includes(".")&&!fne(R);if(k&&he&&!Oi&&!Di&&!zn||E&&IUe(e,Se,we,pt))continue;let ue=u?Rj(u,we+1):void 0,ke=Pn!==void 0&&!Di&&!zn;a.push({breakingChangeId:e.id,file:c.path,line:we+1,excerpt:Et.trim().slice(0,200),enclosingSymbol:ue?.name,matchedSymbol:R,...pt?{column:pt.index,matchedText:pt[0]}:{},confidence:WUe(R,p,f,g,m?.inherited,ke,zn)})}}}return _ne(a)}function $Ue(e){return e==="removed-export"||e==="renamed-export"||e==="moved-export"||e==="unknown"}function SUe(e){return e==="signature-change"}function xUe(e){return!EUe.has(e)}var EUe=new Set(["ruby","elixir","erlang","ocaml","other","config"]);function TUe(e){let t=e.trim();if(!t||t.length<2)return null;if(t.startsWith("/")||t.startsWith("@"))return vne(t);let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)"),r=/^\w/.test(t)?"\\b":"(?)?";return new RegExp(`(?:new\\s+)?${r}${n}${i}\\s*\\(|(?1&&(o=!0);continue}if(l===")"||l==="]"||l==="}"){if(r-=1,r<0)return null;if(r===0)return l!==")"?null:o?i+1:0;continue}if(r===1&&l===","){i+=1,o=!0;continue}if(l==="`")return null;/\s/.test(l)||(o=!0)}}return null}var RUe=200;function PUe(e,t,n){if(n===void 0||!/^\s*\(/.test(n))return!1;let r=e.trim(),i=r.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&"),o=/^\w/.test(r)?"\\b":"(?)\s*$/:/([A-Za-z_$][\w$]*)\s*(?:\.|::)\s*$/,i=[],o=e.slice(0,t);for(let s=0;s<8;s++){let a=r.exec(o);if(!a)break;i.unshift(a[1]),o=o.slice(0,a.index)}return i.length>0?i:void 0}function OUe(e,t,n){if(n!=="c"&&n!=="cpp")return!1;let r=e.slice(0,t).trim(),i=e.slice(t);return!r||!/^\w+\s*\(/.test(i)||/(?:\.|::|->)\s*$/.test(r)||/^(?:return|co_return|throw|case|delete|new)$/.test(r)?!1:/^(?:(?:virtual|static|inline|constexpr|consteval|constinit|explicit|friend|extern)\s+)*(?:const\s+)?(?:(?:unsigned|signed|long|short)\s+)*[\w:<>]+(?:\s*[*&])?$/.test(r)}var MUe=new Set(["this","$this","self","Self","super","cls","me"]),LUe=new Set(["typescript","javascript","python","go","rust","java"]);function FUe(e,t,n){return n!=="elixir"&&n!=="erlang"&&n!=="ruby"?!1:e[t-1]===":"&&e[t-2]!==":"}function jUe(e,t,n){let r=e.split(".")[0]??e;return t.has(e)||t.has(r)||t.has("*")?!1:n.has(e)||n.has(r)}function vne(e){let t=e.trim();if(!t||t.length<2)return null;let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)");if(t.startsWith("/"))return new RegExp(n);let r=/^\w/.test(t)?"\\b":"(?=2)return r.at(-2)}}function kne(e,t){return e.symbols.filter(n=>n===t||!n.includes(".")&&!n.includes("::")?!1:n.split(/[.:]+/).filter(Boolean).at(-1)===t)}function Zy(e){return e.replace(/^@/,"").replace(/::|[\\/]/g,".").replace(/\.+/g,".").replace(/^\.|\.$/g,"").toLowerCase()}function zUe(e,t,n){for(let r of kne(e,t)){let i=r.split(/[.:]+/).filter(Boolean),o=Zy(i.slice(0,-1).join("."));if(o)for(let s of n){if(!s.bindings.includes(t))continue;if(new Set([s.specifier,s.packageName,...Gx(s)].map(Zy)).has(o))return!0;for(let c of[Zy(s.specifier)]){if(!o.startsWith(`${c}.`))continue;if(o.slice(c.length+1).split(".").every(u=>/^[a-z_][a-z0-9_]*$/.test(u)))return!0}}}return!1}function GUe(e,t,n){let r=new Set(n.map(Zy));return kne(e,t).some(i=>{let o=i.split(/[.:]+/).filter(Boolean);return r.has(Zy(o.slice(0,-1).join(".")))})}function BUe(e,t,n,r){let i=new Set;r?.has(e)&&i.add(e);let o=n.split(` +`);for(let s of t){(s.bindings.includes(e)||s.bindings.includes("*"))&&i.add(e),e==="default"&&s.defaultBinding&&i.add(s.defaultBinding);let a=e.includes("."),c=e.split(".").pop();a&&c&&(s.specifier===e&&i.add(c),s.bindings.includes("*")&&e.startsWith(`${s.specifier}.`)&&i.add(c));let l=o[s.line-1]??"",u=new RegExp(`\\b${wne(e)}\\s+as\\s+([A-Za-z_$][\\w$]*)`).exec(l)?.[1];u&&i.add(u)}return i}function VUe(e,t){let n=new Set;for(let r of t){let i=wne(r),o=[new RegExp(`\\b(?:const|let|var|val|final|auto|let(?:\\s+mut)?)\\s+([A-Za-z_$][\\w$]*)\\s*(?::\\s*[^=]+)?=\\s*(?:new\\s+)?${i}(?:::new)?\\s*[({]`,"g"),new RegExp(`\\b(?:new\\s+)?${i}\\s*\\(.*?\\)\\s*as\\s+([A-Za-z_$][\\w$]*)`,"g"),new RegExp(`^\\s*([A-Za-z_$][\\w$]*)\\s*=\\s*${i}\\s*\\(`,"gm"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${i}\\s*\\(`,"g"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*${i}::new\\s*\\(`,"g"),new RegExp(`(?)?(?:\\s*\\[\\])?\\s+([A-Za-z_$][\\w$]*)\\s*(?:[({;=,)]|:(?!:))`,"g"),new RegExp(`([A-Za-z_$][\\w$]*)\\s*:\\s*(?:readonly\\s+)?${i}\\b(?!\\s*\\.)`,"g")];for(let s of o)for(let a of e.matchAll(s))a[1]&&n.add(a[1])}return n}function fne(e){let t=e.trim();return t.startsWith("/")||t.startsWith("@")||t.includes("/")}function qUe(e,t,n){if(t.has(e)||t.has("*"))return!1;let r=e.split(".")[0]??e;return t.has(r)?!1:n.has(e)||e!==r&&n.has(r)}function WUe(e,t,n,r,i,o,s=!1){let a=e.split(".")[0]??e;return r?i&&(i.has(e)||i.has(a))?"medium":"low":t.has(e)||t.has(a)||t.has("*")||s?"high":o?"low":n?"medium":"low"}function _ne(e){let t=new Map;for(let n of e){let r=`${n.breakingChangeId}|${n.file}|${n.line}`,i=t.get(r);(!i||mne(n.confidence)>mne(i.confidence))&&t.set(r,n)}return[...t.values()].sort((n,r)=>n.file.localeCompare(r.file)||n.line-r.line)}function mne(e){return e==="high"?2:e==="medium"?1:0}function HUe(e){let t=e.trim();return t.startsWith("#")?!KUe.test(t):t.startsWith("%")||t.startsWith("(*")?!0:t.startsWith("//")||t.startsWith("*")||t.startsWith("/*")}var KUe=/^#\s*(include|define|undef|if|ifdef|ifndef|elif|else|endif|pragma|error|warning|line)\b/;function gne(e,t){let n=[],r=!1,i=null;for(let o of e){let s="",a=0,c=null;for(;ah.has(v.line-1)).length)}return c.length===0?null:{transform:{ruleId:"rename-identifier",from:i,to:o,anchors:l},edits:c,sitesResolved:u}}function ZUe(e,t,n){let r=e.replacementSymbols?.[0];if(!r||!eE.test(r))return null;let o=e.symbols.find(d=>/^[\w$]+\.[\w$]+$/.test(d))?.split(".")[1];if(!o||!eE.test(o)||o===r)return null;let s=e.dependency,a=[],c=[],l=0,u=new Map;for(let d of t)u.set(d.file,[...u.get(d.file)??[],d]);for(let[d,p]of u){let f=n.get(d);if(f===void 0)continue;let m=Sne(f,s,o,r);if(m){a.push({file:d,before:f,after:m.content});for(let g of m.touched)c.push({file:d,line:g.text,lineNumber:g.number});l+=p.filter(g=>m.touched.some(h=>h.number===g.line)).length}}return a.length===0||l===0?null:{transform:{ruleId:"namespace-member-to-named-import",from:o,to:r,packageName:s,anchors:c},edits:a,sitesResolved:l}}var YUe=e=>{let t=no(e);return[new RegExp(`^(\\s*)import\\s+(?:\\*\\s+as\\s+)?([A-Za-z_$][\\w$]*)\\s+from\\s+(['"\`])${t}\\3(\\s*;?)\\s*$`),new RegExp(`^(\\s*)(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\(\\s*(['"\`])${t}\\3\\s*\\)(\\s*;?)\\s*$`)]};function Sne(e,t,n,r){let i=e.split(` +`),o=YUe(t),s=-1,a="",c="";for(let[f,m]of i.entries()){for(let[g,h]of o.entries()){let v=h.exec(m);if(!v)continue;s=f,a=v[2];let[b,,,w,k]=[v[1],v[2],"",v[3],v[4]??""];c=g===0?`${b}import { ${r} } from ${w}${t}${w}${k}`:`${b}const { ${r} } = require(${w}${t}${w})${k}`;break}if(s>=0)break}if(s<0||!a)return null;let l=new RegExp(`(?i.file===n))return e;let r=Sne(e,t.packageName,t.from,t.to);return r?r.content:e}default:return e}}function QUe(e,t,n,r,i){let o=r.filter(u=>u.file===i);if(o.length===0)return e;let s=e.split(` +`),a=new Map;for(let u of s)a.set(u,(a.get(u)??0)+1);let c=new Set;for(let u of o){let d=u.lineNumber-1;if(s[d]===u.line){c.add(d);continue}if((a.get(u.line)??0)===1){let p=s.indexOf(u.line);p!==-1&&c.add(p)}}if(c.size===0)return e;let l=new RegExp(`(?c.has(d)?Ene(u,l,n):u).join(` +`)}function Ene(e,t,n){return Hj(e,t,n)}function Tne(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return"proven";case"insert-argument":case"wrap-call":return"checked"}}var XUe={type:"array",minItems:1,maxItems:8,items:{type:"object",oneOf:[{type:"object",properties:{kind:{const:"rename-identifier"},from:{type:"string",description:"The old bare identifier, exactly as it appears in code."},to:{type:"string",description:"The new bare identifier."}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"rename-member"},from:{type:"string",description:"The old member name, without the dot or the receiver."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"replace-import-path"},from:{type:"string",description:"The old module specifier, exactly as written between the quotes."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"insert-argument"},callee:{type:"string",description:"The function being called, e.g. `connect` or `client.connect`."},index:{type:"integer",minimum:0,maximum:8,description:"0-based position in the argument list."},text:{type:"string",description:"A literal only: a quoted string, a number, a boolean, null, or a flat object literal. Never a function call or an expression."}},required:["kind","callee","index","text"],additionalProperties:!1},{type:"object",properties:{kind:{const:"wrap-call"},callee:{type:"string"},wrapper:{type:"string",enum:["await","new"]}},required:["kind","callee","wrapper"],additionalProperties:!1}]}},eze={type:"object",properties:{applicable:{type:"boolean",description:"False when this migration cannot be expressed as the listed operations. Answering false is correct and common."},migration:{type:"string",description:"One sentence stating the migration, for a human reviewer."},rationale:{type:"string",description:"Why this is the correct fix, quoting the evidence. Two sentences at most."},citations:{type:"array",items:{type:"string"},description:"Ids of the evidence blocks that state this replacement. Copy them exactly."},ops:XUe},required:["applicable","migration","rationale","citations","ops"],additionalProperties:!1},tze=`You write migration rules for an automated refactoring tool. You are given one breaking change in a dependency, the evidence that documents it, and a sample of the real lines in a repository that use the affected API. You return a small set of mechanical operations that, applied to those lines, complete the migration. @@ -1493,230 +1471,230 @@ Rules you must follow: 4. \`rename-identifier\` matches bare identifiers only and never a member after a dot. \`rename-member\` matches members after a dot only. Choose based on how the sample lines actually read; if both forms appear, return both operations. 5. \`insert-argument\` text must be a literal. Never a function call, never an expression, never a lambda. 6. Operations are applied in the order you list them, to each line, and must converge: applying them twice must give the same result as applying them once. -7. Prefer fewer operations. A migration needing more than about three is usually not mechanical, and \`applicable: false\` is the better answer.`,r1e=24;async function kee(e){let{change:t,evidence:n,sites:i,fileContents:r,config:o,logger:s}=e,a=e.client;if(!a)return null;let c=o1e(t,i,r);if(c.length===0)return s.debug(`No readable call sites for ${t.id}; not authoring a fix plan.`),null;let l=n.filter(m=>t.citations.includes(m.id));if(l.length===0)return s.debug(`${t.id} cites no retrievable evidence; not authoring a fix plan.`),null;let u;try{u=await a.messages.create({model:o.llm.model,max_tokens:8e3,system:n1e,thinking:{type:"adaptive"},output_config:{effort:o.llm.effort,format:{type:"json_schema",schema:t1e}},messages:[{role:"user",content:s1e(t,e.dependencyChange,l,c)}]})}catch(m){return s.warn(`Could not author a fix plan for ${t.dependency}: ${m.message}`),null}if(u.stop_reason==="refusal")return s.warn(`The model declined to author a fix plan for ${t.dependency}.`),null;let d=u.content.find(m=>m.type==="text")?.text;if(!d)return s.warn(`The model returned no text when asked for a fix plan for ${t.dependency}${u.stop_reason?` (stop reason: ${u.stop_reason})`:""}.`),null;let p;try{p=JSON.parse(d)}catch(m){return s.warn(`The model's fix plan for ${t.dependency} was not readable as JSON (${m.message}).`),null}if(p.applicable===!1)return s.info(`No mechanical fix plan for ${t.dependency}: ${p.rationale?.trim()||"the model judged this migration not expressible as a rule"}. Falling back to a per-site agent.`),null;let f=i1e(p.ops??[]);return f.length===0?(s.info(`The model proposed no usable operations for ${t.dependency}; falling back to a per-site agent.`),null):n1({change:t,dependencyChange:e.dependencyChange,migration:p.migration?.trim()||t.summary,rationale:p.rationale?.trim()||"",citations:(p.citations??[]).filter(m=>typeof m=="string"),ops:f,provenance:{author:"model",model:o.llm.model,authoredAt:new Date().toISOString()}})}function n1(e){let{change:t,dependencyChange:n,ops:i}=e,r=n?.from??null,o=n?.to??null;return{schemaVersion:2,id:St("fp",t.dependency,r??"",o??"",t.kind,[...t.symbols].sort().join(","),JSON.stringify(i)),breakingChangeId:t.id,dependency:t.dependency,fromVersion:r,toVersion:o,changeKind:t.kind,migration:e.migration,rationale:e.rationale,ops:i,citations:e.citations,provenance:e.provenance}}function i1e(e){let t=[];for(let n of e){if(typeof n!="object"||n===null)continue;let i=n;switch(i.kind){case"rename-identifier":case"rename-member":case"replace-import-path":typeof i.from=="string"&&typeof i.to=="string"&&t.push({kind:i.kind,from:i.from.trim(),to:i.to.trim()});break;case"insert-argument":typeof i.callee=="string"&&typeof i.text=="string"&&Number.isInteger(i.index)&&t.push({kind:"insert-argument",callee:i.callee.trim(),index:i.index,text:i.text.trim()});break;case"wrap-call":typeof i.callee=="string"&&(i.wrapper==="await"||i.wrapper==="new")&&t.push({kind:"wrap-call",callee:i.callee.trim(),wrapper:i.wrapper});break;default:break}}return t}function o1e(e,t,n){let i=new Set,r=[];for(let o of t){if(o.breakingChangeId!==e.id)continue;if(r.length>=r1e)break;let s=n.get(o.file);if(s===void 0)continue;let a=s.split(` -`)[o.line-1];if(a===void 0)continue;let c=a.trim();!c||i.has(c)||(i.add(c),r.push({file:o.file,line:o.line,text:a}))}return r}function s1e(e,t,n,i){let r=n.map(s=>` -${a1e(s.content,4e3)} +7. Prefer fewer operations. A migration needing more than about three is usually not mechanical, and \`applicable: false\` is the better answer.`,nze=24;async function Ine(e){let{change:t,evidence:n,sites:r,fileContents:i,config:o,logger:s}=e,a=e.client;if(!a)return null;let c=ize(t,r,i);if(c.length===0)return s.debug(`No readable call sites for ${t.id}; not authoring a fix plan.`),null;let l=n.filter(m=>t.citations.includes(m.id));if(l.length===0)return s.debug(`${t.id} cites no retrievable evidence; not authoring a fix plan.`),null;let u;try{u=await a.messages.create({model:o.llm.model,max_tokens:8e3,system:tze,thinking:{type:"adaptive"},output_config:{effort:o.llm.effort,format:{type:"json_schema",schema:eze}},messages:[{role:"user",content:oze(t,e.dependencyChange,l,c)}]})}catch(m){return s.warn(`Could not author a fix plan for ${t.dependency}: ${m.message}`),null}if(u.stop_reason==="refusal")return s.warn(`The model declined to author a fix plan for ${t.dependency}.`),null;let d=u.content.find(m=>m.type==="text")?.text;if(!d)return s.warn(`The model returned no text when asked for a fix plan for ${t.dependency}${u.stop_reason?` (stop reason: ${u.stop_reason})`:""}.`),null;let p;try{p=JSON.parse(d)}catch(m){return s.warn(`The model's fix plan for ${t.dependency} was not readable as JSON (${m.message}).`),null}if(p.applicable===!1)return s.info(`No mechanical fix plan for ${t.dependency}: ${p.rationale?.trim()||"the model judged this migration not expressible as a rule"}. Falling back to a per-site agent.`),null;let f=rze(p.ops??[]);return f.length===0?(s.info(`The model proposed no usable operations for ${t.dependency}; falling back to a per-site agent.`),null):Kj({change:t,dependencyChange:e.dependencyChange,migration:p.migration?.trim()||t.summary,rationale:p.rationale?.trim()||"",citations:(p.citations??[]).filter(m=>typeof m=="string"),ops:f,provenance:{author:"model",model:o.llm.model,authoredAt:new Date().toISOString()}})}function Kj(e){let{change:t,dependencyChange:n,ops:r}=e,i=n?.from??null,o=n?.to??null;return{schemaVersion:2,id:xt("fp",t.dependency,i??"",o??"",t.kind,[...t.symbols].sort().join(","),JSON.stringify(r)),breakingChangeId:t.id,dependency:t.dependency,fromVersion:i,toVersion:o,changeKind:t.kind,migration:e.migration,rationale:e.rationale,ops:r,citations:e.citations,provenance:e.provenance}}function rze(e){let t=[];for(let n of e){if(typeof n!="object"||n===null)continue;let r=n;switch(r.kind){case"rename-identifier":case"rename-member":case"replace-import-path":typeof r.from=="string"&&typeof r.to=="string"&&t.push({kind:r.kind,from:r.from.trim(),to:r.to.trim()});break;case"insert-argument":typeof r.callee=="string"&&typeof r.text=="string"&&Number.isInteger(r.index)&&t.push({kind:"insert-argument",callee:r.callee.trim(),index:r.index,text:r.text.trim()});break;case"wrap-call":typeof r.callee=="string"&&(r.wrapper==="await"||r.wrapper==="new")&&t.push({kind:"wrap-call",callee:r.callee.trim(),wrapper:r.wrapper});break;default:break}}return t}function ize(e,t,n){let r=new Set,i=[];for(let o of t){if(o.breakingChangeId!==e.id)continue;if(i.length>=nze)break;let s=n.get(o.file);if(s===void 0)continue;let a=s.split(` +`)[o.line-1];if(a===void 0)continue;let c=a.trim();!c||r.has(c)||(r.add(c),i.push({file:o.file,line:o.line,text:a}))}return i}function oze(e,t,n,r){let i=n.map(s=>` +${sze(s.content,4e3)} `).join(` -`),o=i.map(s=>`${s.file}:${s.line} +`),o=r.map(s=>`${s.file}:${s.line} ${s.text}`).join(` -`);return[`Dependency: ${e.dependency}`,t?`Version change: ${t.from} \u2192 ${t.to}`:"",`Breaking change (${e.kind}): ${e.summary}`,e.before?`Declaration before: ${e.before}`:"",e.after?`Declaration after: ${e.after}`:"",e.symbols.length?`Affected symbols: ${e.symbols.join(", ")}`:"",e.replacementSymbols?.length?`Known replacements: ${e.replacementSymbols.join(", ")}`:"","","Evidence:",r,"",`Real lines in this repository that use the affected API (${i.length} distinct shapes):`,o].filter(Boolean).join(` -`)}function a1e(e,t){return e.length<=t?e:`${e.slice(0,t)} -\u2026(truncated)`}function c1e(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var Ss=require("node:fs/promises"),$ee=require("node:os"),Af=require("node:path");function _ee(e,t){return St("mig",String(2),e.dependency,t?.from??"",t?.to??"",e.kind,[...e.symbols].sort().join(","))}function r1(){if(process.env.DRIFT_NO_CACHE==="1")return null;let e=process.env.DRIFT_CACHE_DIR||(0,Af.join)((0,$ee.homedir)(),".drift","cache");return(0,Af.join)(e,"fixplans")}function See(e){return{async get(t){try{let n=await(0,Ss.readFile)((0,Af.join)(e,`${t}.json`),"utf8"),i=JSON.parse(n);return i.schemaVersion!==2?null:i}catch{return null}},async put(t,n){try{await(0,Ss.mkdir)(e,{recursive:!0}),await(0,Ss.writeFile)((0,Af.join)(e,`${t}.json`),`${JSON.stringify(n,null,2)} -`,"utf8")}catch{}},async all(){try{let t=await(0,Ss.readdir)(e),n=[];for(let i of t)if(i.endsWith(".json"))try{let r=JSON.parse(await(0,Ss.readFile)((0,Af.join)(e,i),"utf8"));r.schemaVersion===2&&n.push(r)}catch{}return n.sort((i,r)=>i.dependency.localeCompare(r.dependency)||i.id.localeCompare(r.id))}catch{return[]}}}}function Cy(){return{async get(){return null},async put(){},async all(){return[]}}}function xee(e){return{...e,provenance:{...e.provenance,author:"cache",sourceId:e.id}}}function Tee(e,t,n){let i=n.column,r=i+n.matchedText.length;if(i<0||r>e.length||e.slice(i,r)!==n.matchedText)return null;switch(t.kind){case"rename-identifier":return Eee(e,t.from,t.to,i,r,"bare");case"rename-member":return Eee(e,t.from,t.to,i,r,"member");case"replace-import-path":return u1e(e,t.from,t.to,i,r);case"insert-argument":return p1e(e,t.callee,t.index,t.text,i,r);case"wrap-call":return f1e(e,t.callee,t.wrapper,i,r)}}function Eee(e,t,n,i,r,o){let s=Ry(e),a=new RegExp(`(?r||l1e(s,l.index)===(o==="member")&&c.push(l.index);return c.length!==1?null:{start:c[0],end:c[0]+t.length,text:n}}function l1e(e,t){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n-=1;return n>=0&&e[n]==="."}function u1e(e,t,n,i,r){if(!d1e.test(e))return null;let o=e1(e).filter(c=>c.content===t);if(o.length===0)return null;let s=o.filter(c=>c.start=r),a=s.length===1?s[0]:o.length===1?o[0]:null;return a?{start:a.start+1,end:a.end,text:n}:null}var d1e=/(^|[^\w$])(import|export|require|from|use|include|using|open|extern|source|load)([^\w$]|$)/;function p1e(e,t,n,i,r,o){let s=Ry(e),a=Iee(s,t,r,o);if(!a)return null;let c=g1e(s,a.open,a.close);if(c===null||n>c.length)return null;let l=c[n];if(l&&s.slice(l.start,l.end).trim()===i.trim())return null;if(c.length===0)return{start:a.open+1,end:a.open+1,text:i};if(n===c.length){let u=c[c.length-1];return{start:u.end,end:u.end,text:`, ${i}`}}return{start:c[n].start,end:c[n].start,text:`${i}, `}}function f1e(e,t,n,i,r){let o=Ry(e),s=Iee(o,t,i,r);return!s||new RegExp(`\\b${n}\\s+$`).test(o.slice(0,s.start))?null:{start:s.start,end:s.start,text:`${n} `}}function Iee(e,t,n,i){let r=new RegExp(`(?=i)continue;let a=s.index+s[0].length-1,c=m1e(e,a);c!==-1&&o.push({start:s.index,open:a,close:c})}return o.length===1?o[0]:null}function m1e(e,t){let n=0;for(let i=t;ie[o]===t.line&&e[o].slice(t.column,t.column+t.matchedText.length)===t.matchedText,i=t.lineNumber-1;if(i>=0&&ia.file===i);if(r.length===0)return e;let o=e.split(` -`),s=new Map;for(let a of r){let c=h1e(o,a);if(c===null)continue;let l=ix(o[c],t,{column:a.column,matchedText:a.matchedText});if(!l)continue;let u=s.get(c);u?u.push(l.edit):s.set(c,[l.edit])}for(let[a,c]of s){let l=o[a],u=[...c].sort((p,f)=>f.start-p.start),d=Number.POSITIVE_INFINITY;for(let p of u)p.end>d||(l=l.slice(0,p.start)+p.text+l.slice(p.end),d=p.start);o[a]=l}return o.join(` -`)}function y1e(e){let t=[];for(let n of e.matchAll(/[A-Za-z_$][\w$]*/g)){t.push({column:n.index,matchedText:n[0]});let i=e.slice(n.index+n[0].length),r=/^\s*\(/.exec(i);r&&t.push({column:n.index,matchedText:n[0]+r[0]})}for(let n of e1(e))t.push({column:n.start+1,matchedText:n.content});return t}function Ree(e,t){for(let n of y1e(e)){let i=Tee(e,t,n);if(!i)continue;let r=e.slice(0,i.start)+i.text+e.slice(i.end);if(r!==e)return r}return e}var Nee=/^[A-Za-z_$][\w$]*$/,Cee=/^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*)*$/,Pee=/^[\w@.][\w@.:/+-]*$/,b1e=/^(?!.*=>)(?!.*\blambda\b)(?!.*\bfunction\b)[\w$]*\s*[:=]?\s*(?:"[^"\\]*"|'[^'\\]*'|-?\d+(?:\.\d+)?|true|false|True|False|null|None|nil|nullptr|undefined|\{[^{}()`]*\}|\[[^\[\]()`]*\])$/,i1=8;function Dee(e){let{plan:t,change:n,sites:i,fileContents:r,evidence:o}=e,s=[];if(t.schemaVersion!==2)return s.push(`The plan declares schema version ${t.schemaVersion}; this build of Drift reads version ${2}.`),Rf(t,s);if(t.ops.length===0)return s.push("The plan contains no operations, so there is nothing it could deterministically change."),Rf(t,s);if(t.ops.length>i1)return s.push(`The plan contains ${t.ops.length} operations; ${i1} is the most Drift will apply as a single migration. A migration needing more than that is not one rule, and should be split into separate findings.`),Rf(t,s);for(let g of t.ops){let h=w1e(g);h&&s.push(h)}for(let g of t.ops){let h=k1e(g,n);h&&s.push(h)}let a=o.filter(g=>t.citations.includes(g.id)),c=t.citations.filter(g=>!o.some(h=>h.id===g));c.length>0&&s.push(`The plan cites evidence Drift did not gather (${c.join(", ")}), so its provenance cannot be checked.`),t.provenance.author==="recipe"&&!t.provenance.recipe&&s.push("The plan claims to come from a community recipe but names none, so there is nothing to audit it against."),t.provenance.author==="model"&&a.length===0&&s.push("The plan cites no retrievable evidence. A migration Drift cannot trace back to something it actually read is not one it will apply to every call site.");let l=S1e(n,a,t);for(let g of t.ops)for(let h of $1e(g))x1e(l,h)||s.push(`Nothing in the cited evidence mentions \`${h}\`, which this plan would introduce at every call site. Drift will not apply a replacement it cannot find stated upstream.`);if(s.length>0)return Rf(t,s);let u=v1e(t.ops,n,i,r),d=u.map(g=>g.outcome);for(let{outcome:g,anchor:h}of u){if(g.status!=="covered"||g.after===void 0||!h)continue;if(g.after.includes(` -`)){s.push(`Applying this plan to ${g.file}:${g.line} would split one line into several. Every operation Drift executes is line-preserving, so this plan cannot be one of Drift's.`);continue}ix(g.after,t.ops,{column:h.column,matchedText:h.matchedText})&&s.push(`Applying this plan twice to ${g.file}:${g.line} does not give the same result as applying it once. A rule that keeps changing its own output cannot be safely re-applied, and Drift re-applies every rule against live file contents rather than a snapshot.`)}if(s.length>0)return Rf(t,s);let p=u.filter(g=>g.outcome.status==="covered");if(p.length===0)return s.push("No operation in the plan matched any of the call sites Drift localized for this finding. The plan may be correct about the upstream change and wrong about how this repository uses it."),Rf(t,s);let f=new Set(p.map(g=>g.outcome.op)),m=t.ops.some(g=>f.has(g.kind)&&wee(g)==="checked")?"checked":"proven";return{plan:t,verdict:p.length===d.length?"accepted":"partial",assurance:m,sites:d,covered:p.length,residual:d.length-p.length,rejections:[],anchors:p.map(g=>g.anchor)}}function v1e(e,t,n,i){let r=[],o=new Set;for(let s of n){if(s.breakingChangeId!==t.id)continue;let a=`${s.file}\0${s.line}\0${s.column??"line"}`;if(o.has(a))continue;o.add(a);let c=(m,g)=>r.push({outcome:{file:s.file,line:s.line,before:m,status:"residual",reason:g}}),l=i.get(s.file);if(l===void 0){c(s.excerpt,"Drift no longer has this file\u2019s contents, so it could not check the rule against the real line.");continue}let u=l.split(` -`)[s.line-1];if(u===void 0){c(s.excerpt,"The file no longer has a line here.");continue}if(Ny(u)){c(u,"This line is a comment. Drift does not rewrite prose, even prose that names the changed symbol.");continue}if(s.column===void 0||s.matchedText===void 0){c(u,"Drift matched this line but not a specific occurrence on it, so there is no exact position a deterministic rule could edit. An agent can read the surrounding code; a line-based rule cannot.");continue}let d={column:s.column,matchedText:s.matchedText};if(u.slice(d.column,d.column+d.matchedText.length)!==d.matchedText){c(u,"The line no longer reads the way it did when this occurrence was localized, so Drift cannot confirm it would edit the right one.");continue}let p=ix(u,e,d);if(!p){c(u,"No operation in the plan applies at the exact occurrence Drift localized, so this call site is shaped differently from the ones the plan describes.");continue}let f=u.slice(0,p.edit.start)+p.edit.text+u.slice(p.edit.end);r.push({outcome:{file:s.file,line:s.line,before:u,after:f,status:"covered",op:p.op},anchor:{file:s.file,line:u,lineNumber:s.line,column:d.column,matchedText:d.matchedText}})}return r}function w1e(e){switch(e.kind){case"rename-identifier":case"rename-member":return Nee.test(e.from)?Nee.test(e.to)?e.from===e.to?`\`${e.kind}\` was given the same name on both sides, which would change nothing.`:null:`\`${e.to}\` is not a plain identifier, so \`${e.kind}\` cannot produce it.`:`\`${e.from}\` is not a plain identifier, so \`${e.kind}\` cannot act on it.`;case"replace-import-path":return Pee.test(e.from)?Pee.test(e.to)?e.from===e.to?"The import path rule was given the same path on both sides, which would change nothing.":null:`\`${e.to}\` is not a module path Drift can write.`:`\`${e.from}\` is not a module path Drift can match on.`;case"insert-argument":return Cee.test(e.callee)?!Number.isInteger(e.index)||e.index<0||e.index>i1?`Argument position ${e.index} is out of range.`:b1e.test(e.text.trim())?null:`\`${e.text}\` is not a literal. Drift only inserts literal arguments, because an expression could call something and a rule whose effect depends on running code is not a rule Drift can state in advance.`:`\`${e.callee}\` is not a callable name Drift can locate.`;case"wrap-call":return Cee.test(e.callee)?null:`\`${e.callee}\` is not a callable name Drift can locate.`}}function k1e(e,t){let n=new Set;for(let o of t.symbols){n.add(o);for(let s of o.split(/[./]/))s&&n.add(s)}let i=e.kind==="insert-argument"||e.kind==="wrap-call"?e.callee:(e.kind==="replace-import-path",e.from);if(e.kind==="replace-import-path")return i===t.dependency||i.startsWith(`${t.dependency}/`)||n.has(i)?null:`The plan rewrites imports of \`${i}\`, which is neither \`${t.dependency}\` nor a symbol this finding names.`;let r=i.split(".");return n.has(i)||r.some(o=>n.has(o))?null:`The plan acts on \`${i}\`, which this finding never mentions. Drift will not apply a rule about one symbol to sites localized for another.`}function $1e(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];case"insert-argument":return(e.text.match(/[A-Za-z_$][\w$]*/g)??[]).filter(n=>!_1e.has(n));case"wrap-call":return[]}}var _1e=new Set(["true","false","True","False","null","None","nil","nullptr","undefined"]);function S1e(e,t,n){return[...e.replacementSymbols??[],e.before??"",e.after??"",e.summary,e.remediation,...t.map(i=>`${i.title} -${i.content}`),...t.flatMap(i=>(i.findings??[]).map(r=>`${r.symbol} ${r.detail} ${r.before??""} ${r.after??""}`)),n.provenance.recipe?`${n.provenance.recipe.name} +`);return[`Dependency: ${e.dependency}`,t?`Version change: ${t.from} \u2192 ${t.to}`:"",`Breaking change (${e.kind}): ${e.summary}`,e.before?`Declaration before: ${e.before}`:"",e.after?`Declaration after: ${e.after}`:"",e.symbols.length?`Affected symbols: ${e.symbols.join(", ")}`:"",e.replacementSymbols?.length?`Known replacements: ${e.replacementSymbols.join(", ")}`:"","","Evidence:",i,"",`Real lines in this repository that use the affected API (${r.length} distinct shapes):`,o].filter(Boolean).join(` +`)}function sze(e,t){return e.length<=t?e:`${e.slice(0,t)} +\u2026(truncated)`}function aze(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var ks=require("node:fs/promises"),Ane=require("node:os"),Wf=require("node:path");function Rne(e,t){return xt("mig",String(2),e.dependency,t?.from??"",t?.to??"",e.kind,[...e.symbols].sort().join(","))}function Jj(){if(process.env.DRIFT_NO_CACHE==="1")return null;let e=process.env.DRIFT_CACHE_DIR||(0,Wf.join)((0,Ane.homedir)(),".drift","cache");return(0,Wf.join)(e,"fixplans")}function Pne(e){return{async get(t){try{let n=await(0,ks.readFile)((0,Wf.join)(e,`${t}.json`),"utf8"),r=JSON.parse(n);return r.schemaVersion!==2?null:r}catch{return null}},async put(t,n){try{await(0,ks.mkdir)(e,{recursive:!0}),await(0,ks.writeFile)((0,Wf.join)(e,`${t}.json`),`${JSON.stringify(n,null,2)} +`,"utf8")}catch{}},async all(){try{let t=await(0,ks.readdir)(e),n=[];for(let r of t)if(r.endsWith(".json"))try{let i=JSON.parse(await(0,ks.readFile)((0,Wf.join)(e,r),"utf8"));i.schemaVersion===2&&n.push(i)}catch{}return n.sort((r,i)=>r.dependency.localeCompare(i.dependency)||r.id.localeCompare(i.id))}catch{return[]}}}}function Xy(){return{async get(){return null},async put(){},async all(){return[]}}}function Cne(e){return{...e,provenance:{...e.provenance,author:"cache",sourceId:e.id}}}function Dne(e,t,n){let r=n.column,i=r+n.matchedText.length;if(r<0||i>e.length||e.slice(r,i)!==n.matchedText)return null;switch(t.kind){case"rename-identifier":return Nne(e,t.from,t.to,r,i,"bare");case"rename-member":return Nne(e,t.from,t.to,r,i,"member");case"replace-import-path":return lze(e,t.from,t.to,r,i);case"insert-argument":return dze(e,t.callee,t.index,t.text,r,i);case"wrap-call":return pze(e,t.callee,t.wrapper,r,i)}}function Nne(e,t,n,r,i,o){let s=Yy(e),a=new RegExp(`(?i||cze(s,l.index)===(o==="member")&&c.push(l.index);return c.length!==1?null:{start:c[0],end:c[0]+t.length,text:n}}function cze(e,t){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n-=1;return n>=0&&e[n]==="."}function lze(e,t,n,r,i){if(!uze.test(e))return null;let o=Wj(e).filter(c=>c.content===t);if(o.length===0)return null;let s=o.filter(c=>c.start=i),a=s.length===1?s[0]:o.length===1?o[0]:null;return a?{start:a.start+1,end:a.end,text:n}:null}var uze=/(^|[^\w$])(import|export|require|from|use|include|using|open|extern|source|load)([^\w$]|$)/;function dze(e,t,n,r,i,o){let s=Yy(e),a=One(s,t,i,o);if(!a)return null;let c=mze(s,a.open,a.close);if(c===null||n>c.length)return null;let l=c[n];if(l&&s.slice(l.start,l.end).trim()===r.trim())return null;if(c.length===0)return{start:a.open+1,end:a.open+1,text:r};if(n===c.length){let u=c[c.length-1];return{start:u.end,end:u.end,text:`, ${r}`}}return{start:c[n].start,end:c[n].start,text:`${r}, `}}function pze(e,t,n,r,i){let o=Yy(e),s=One(o,t,r,i);return!s||new RegExp(`\\b${n}\\s+$`).test(o.slice(0,s.start))?null:{start:s.start,end:s.start,text:`${n} `}}function One(e,t,n,r){let i=new RegExp(`(?=r)continue;let a=s.index+s[0].length-1,c=fze(e,a);c!==-1&&o.push({start:s.index,open:a,close:c})}return o.length===1?o[0]:null}function fze(e,t){let n=0;for(let r=t;re[o]===t.line&&e[o].slice(t.column,t.column+t.matchedText.length)===t.matchedText,r=t.lineNumber-1;if(r>=0&&ra.file===r);if(i.length===0)return e;let o=e.split(` +`),s=new Map;for(let a of i){let c=gze(o,a);if(c===null)continue;let l=tE(o[c],t,{column:a.column,matchedText:a.matchedText});if(!l)continue;let u=s.get(c);u?u.push(l.edit):s.set(c,[l.edit])}for(let[a,c]of s){let l=o[a],u=[...c].sort((p,f)=>f.start-p.start),d=Number.POSITIVE_INFINITY;for(let p of u)p.end>d||(l=l.slice(0,p.start)+p.text+l.slice(p.end),d=p.start);o[a]=l}return o.join(` +`)}function hze(e){let t=[];for(let n of e.matchAll(/[A-Za-z_$][\w$]*/g)){t.push({column:n.index,matchedText:n[0]});let r=e.slice(n.index+n[0].length),i=/^\s*\(/.exec(r);i&&t.push({column:n.index,matchedText:n[0]+i[0]})}for(let n of Wj(e))t.push({column:n.start+1,matchedText:n.content});return t}function Lne(e,t){for(let n of hze(e)){let r=Dne(e,t,n);if(!r)continue;let i=e.slice(0,r.start)+r.text+e.slice(r.end);if(i!==e)return i}return e}var Fne=/^[A-Za-z_$][\w$]*$/,jne=/^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*)*$/,Une=/^[\w@.][\w@.:/+-]*$/,yze=/^(?!.*=>)(?!.*\blambda\b)(?!.*\bfunction\b)[\w$]*\s*[:=]?\s*(?:"[^"\\]*"|'[^'\\]*'|-?\d+(?:\.\d+)?|true|false|True|False|null|None|nil|nullptr|undefined|\{[^{}()`]*\}|\[[^\[\]()`]*\])$/,Zj=8;function zne(e){let{plan:t,change:n,sites:r,fileContents:i,evidence:o}=e,s=[];if(t.schemaVersion!==2)return s.push(`The plan declares schema version ${t.schemaVersion}; this build of Drift reads version ${2}.`),Hf(t,s);if(t.ops.length===0)return s.push("The plan contains no operations, so there is nothing it could deterministically change."),Hf(t,s);if(t.ops.length>Zj)return s.push(`The plan contains ${t.ops.length} operations; ${Zj} is the most Drift will apply as a single migration. A migration needing more than that is not one rule, and should be split into separate findings.`),Hf(t,s);for(let g of t.ops){let h=vze(g);h&&s.push(h)}for(let g of t.ops){let h=wze(g,n);h&&s.push(h)}let a=o.filter(g=>t.citations.includes(g.id)),c=t.citations.filter(g=>!o.some(h=>h.id===g));c.length>0&&s.push(`The plan cites evidence Drift did not gather (${c.join(", ")}), so its provenance cannot be checked.`),t.provenance.author==="recipe"&&!t.provenance.recipe&&s.push("The plan claims to come from a community recipe but names none, so there is nothing to audit it against."),t.provenance.author==="model"&&a.length===0&&s.push("The plan cites no retrievable evidence. A migration Drift cannot trace back to something it actually read is not one it will apply to every call site.");let l=$ze(n,a,t);for(let g of t.ops)for(let h of kze(g))Sze(l,h)||s.push(`Nothing in the cited evidence mentions \`${h}\`, which this plan would introduce at every call site. Drift will not apply a replacement it cannot find stated upstream.`);if(s.length>0)return Hf(t,s);let u=bze(t.ops,n,r,i),d=u.map(g=>g.outcome);for(let{outcome:g,anchor:h}of u){if(g.status!=="covered"||g.after===void 0||!h)continue;if(g.after.includes(` +`)){s.push(`Applying this plan to ${g.file}:${g.line} would split one line into several. Every operation Drift executes is line-preserving, so this plan cannot be one of Drift's.`);continue}tE(g.after,t.ops,{column:h.column,matchedText:h.matchedText})&&s.push(`Applying this plan twice to ${g.file}:${g.line} does not give the same result as applying it once. A rule that keeps changing its own output cannot be safely re-applied, and Drift re-applies every rule against live file contents rather than a snapshot.`)}if(s.length>0)return Hf(t,s);let p=u.filter(g=>g.outcome.status==="covered");if(p.length===0)return s.push("No operation in the plan matched any of the call sites Drift localized for this finding. The plan may be correct about the upstream change and wrong about how this repository uses it."),Hf(t,s);let f=new Set(p.map(g=>g.outcome.op)),m=t.ops.some(g=>f.has(g.kind)&&Tne(g)==="checked")?"checked":"proven";return{plan:t,verdict:p.length===d.length?"accepted":"partial",assurance:m,sites:d,covered:p.length,residual:d.length-p.length,rejections:[],anchors:p.map(g=>g.anchor)}}function bze(e,t,n,r){let i=[],o=new Set;for(let s of n){if(s.breakingChangeId!==t.id)continue;let a=`${s.file}\0${s.line}\0${s.column??"line"}`;if(o.has(a))continue;o.add(a);let c=(m,g)=>i.push({outcome:{file:s.file,line:s.line,before:m,status:"residual",reason:g}}),l=r.get(s.file);if(l===void 0){c(s.excerpt,"Drift no longer has this file\u2019s contents, so it could not check the rule against the real line.");continue}let u=l.split(` +`)[s.line-1];if(u===void 0){c(s.excerpt,"The file no longer has a line here.");continue}if(Qy(u)){c(u,"This line is a comment. Drift does not rewrite prose, even prose that names the changed symbol.");continue}if(s.column===void 0||s.matchedText===void 0){c(u,"Drift matched this line but not a specific occurrence on it, so there is no exact position a deterministic rule could edit. An agent can read the surrounding code; a line-based rule cannot.");continue}let d={column:s.column,matchedText:s.matchedText};if(u.slice(d.column,d.column+d.matchedText.length)!==d.matchedText){c(u,"The line no longer reads the way it did when this occurrence was localized, so Drift cannot confirm it would edit the right one.");continue}let p=tE(u,e,d);if(!p){c(u,"No operation in the plan applies at the exact occurrence Drift localized, so this call site is shaped differently from the ones the plan describes.");continue}let f=u.slice(0,p.edit.start)+p.edit.text+u.slice(p.edit.end);i.push({outcome:{file:s.file,line:s.line,before:u,after:f,status:"covered",op:p.op},anchor:{file:s.file,line:u,lineNumber:s.line,column:d.column,matchedText:d.matchedText}})}return i}function vze(e){switch(e.kind){case"rename-identifier":case"rename-member":return Fne.test(e.from)?Fne.test(e.to)?e.from===e.to?`\`${e.kind}\` was given the same name on both sides, which would change nothing.`:null:`\`${e.to}\` is not a plain identifier, so \`${e.kind}\` cannot produce it.`:`\`${e.from}\` is not a plain identifier, so \`${e.kind}\` cannot act on it.`;case"replace-import-path":return Une.test(e.from)?Une.test(e.to)?e.from===e.to?"The import path rule was given the same path on both sides, which would change nothing.":null:`\`${e.to}\` is not a module path Drift can write.`:`\`${e.from}\` is not a module path Drift can match on.`;case"insert-argument":return jne.test(e.callee)?!Number.isInteger(e.index)||e.index<0||e.index>Zj?`Argument position ${e.index} is out of range.`:yze.test(e.text.trim())?null:`\`${e.text}\` is not a literal. Drift only inserts literal arguments, because an expression could call something and a rule whose effect depends on running code is not a rule Drift can state in advance.`:`\`${e.callee}\` is not a callable name Drift can locate.`;case"wrap-call":return jne.test(e.callee)?null:`\`${e.callee}\` is not a callable name Drift can locate.`}}function wze(e,t){let n=new Set;for(let o of t.symbols){n.add(o);for(let s of o.split(/[./]/))s&&n.add(s)}let r=e.kind==="insert-argument"||e.kind==="wrap-call"?e.callee:(e.kind==="replace-import-path",e.from);if(e.kind==="replace-import-path")return r===t.dependency||r.startsWith(`${t.dependency}/`)||n.has(r)?null:`The plan rewrites imports of \`${r}\`, which is neither \`${t.dependency}\` nor a symbol this finding names.`;let i=r.split(".");return n.has(r)||i.some(o=>n.has(o))?null:`The plan acts on \`${r}\`, which this finding never mentions. Drift will not apply a rule about one symbol to sites localized for another.`}function kze(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];case"insert-argument":return(e.text.match(/[A-Za-z_$][\w$]*/g)??[]).filter(n=>!_ze.has(n));case"wrap-call":return[]}}var _ze=new Set(["true","false","True","False","null","None","nil","nullptr","undefined"]);function $ze(e,t,n){return[...e.replacementSymbols??[],e.before??"",e.after??"",e.summary,e.remediation,...t.map(r=>`${r.title} +${r.content}`),...t.flatMap(r=>(r.findings??[]).map(i=>`${i.symbol} ${i.detail} ${i.before??""} ${i.after??""}`)),n.provenance.recipe?`${n.provenance.recipe.name} ${n.migration}`:""].join(` -`)}function x1e(e,t){return new RegExp(`(^|[^\\w$])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}([^\\w$]|$)`).test(e)}function Rf(e,t){return{plan:e,verdict:"rejected",assurance:"checked",sites:[],covered:0,residual:0,rejections:t,anchors:[]}}async function Oee(e){let{changes:t,sites:n,evidence:i,config:r,logger:o}=e,s=e.cache??Cy(),a=new Map,c=new Map,l=new Map;for(let d of n){let p=l.get(d.breakingChangeId);p?p.push(d):l.set(d.breakingChangeId,[d])}let u=new Map(e.dependencyChanges.map(d=>[`${d.workspace??""}::${d.name}`,d]));for(let d of t){let p=l.get(d.id);if(!p||p.length===0)continue;let f=u.get(`${d.workspace??""}::${d.dependency}`),m=_ee(d,f),g=null;for(let h of E1e(e,d,f,m,s)){let b=await h();if(!b)continue;let y=Dee({plan:b,change:d,sites:p,fileContents:e.fileContents,evidence:i});if(y.verdict==="rejected"){o.info(`Rejected a ${b.provenance.author}-proposed fix plan for ${d.dependency}: ${y.rejections[0]}`),g=y;continue}let w=y.covered+y.residual,k=w===0?0:y.covered/w;if(k0||c.size>0)&&o.info(`Fix plans: ${a.size} accepted, ${c.size} rejected. ${r.remediation.fixPlans.enabled?"":"(authoring disabled)"}`.trim()),{accepted:a,rejected:c}}function E1e(e,t,n,i,r){let o=[];return o.push(async()=>{let s=await r.get(i);return s?xee(s):null}),e.proposeFromRecipe&&o.push(()=>e.proposeFromRecipe(t)),e.client&&o.push(()=>kee({change:t,dependencyChange:n,evidence:e.evidence,sites:e.sites,fileContents:e.fileContents,config:e.config,logger:e.logger,client:e.client})),o}var on=require("node:fs/promises"),Nn=require("node:path"),s1=require("node:os"),Nf=require("node:crypto");async function ax(e,t,n={}){let i=n.exec??Xe,r=n.env??process.env,o=n.at??"HEAD",s=await i("git",["rev-parse","--git-common-dir"],{cwd:e,env:r});if(s.code!==0){if(n.at!==void 0&&n.at!=="HEAD")throw new Error(`\`${e}\` is not a git repository, so \`${n.at}\` cannot be checked out to test an upgrade.`);return A1e(e,t,n.runId??Lee)}let a=s.stdout.trim()||".git",c=(0,Nn.isAbsolute)(a)?a:(0,Nn.join)(e,a),l=n.runId??Lee,u=(0,Nn.join)((0,s1.tmpdir)(),"drift-worktrees",(0,Nf.createHash)("sha256").update(c).digest("hex").slice(0,12)),d=(0,Nn.join)(u,sx(l),sx(t));I1e(u),await Mee(e,d,i,r);let p=await i("git",["worktree","add","--detach",d,o],{cwd:e,env:r});if(p.code!==0)throw new Error(`Could not create a worktree to test upgrades in: ${p.stderr.trim()||p.stdout.trim()||"git failed"}`);let{copied:f,oversized:m,secrets:g}=n.copyIgnoredFiles===!1?{copied:[],oversized:[],secrets:[]}:await D1e(e,d,i,r,void 0,n.allowedGlobs),[h,b,y]=await Promise.all([o1(e,f,i,r),o1(e,m,i,r),o1(e,g,i,r)]),w=!1;return{path:d,copiedFiles:f,copiedRules:h,oversizedFiles:m,oversizedRules:b,skippedSecrets:g,skippedSecretRules:y,async dispose(){w||(w=!0,await Mee(e,d,i,r))}}}async function Mee(e,t,n,i){let r=`${t}.trash-${(0,Nf.randomUUID)().slice(0,8)}`;await(0,on.rename)(t,r).then(()=>!0,()=>!1)?T1e(r):await(0,on.rm)(t,{recursive:!0,force:!0}).then(()=>!0,()=>!1)||await n("git",["worktree","remove","--force",t],{cwd:e,env:i}).catch(()=>{}),await n("git",["worktree","prune"],{cwd:e,env:i}).catch(()=>{})}var ox=new Set;function T1e(e){let t=(0,on.rm)(e,{recursive:!0,force:!0}).catch(()=>{}).then(()=>{ox.delete(t)});ox.add(t)}async function a1(){for(;ox.size>0;)await Promise.all([...ox])}function I1e(e){(0,on.readdir)(e,{withFileTypes:!0}).then(t=>Promise.all(t.filter(n=>n.isDirectory()).map(n=>(0,on.readdir)((0,Nn.join)(e,n.name),{withFileTypes:!0}).then(i=>Promise.all(i.filter(r=>r.name.includes(".trash-")).map(r=>(0,on.rm)((0,Nn.join)(e,n.name,r.name),{recursive:!0,force:!0}).catch(()=>{}))),()=>{})))).catch(()=>{})}async function A1e(e,t,n){let i=(0,Nn.join)((0,s1.tmpdir)(),"drift-worktrees",sx(n),sx(t));await(0,on.rm)(i,{recursive:!0,force:!0}).catch(()=>{}),await(0,on.mkdir)(i,{recursive:!0});let r=[];try{await(0,on.cp)(e,i,{recursive:!0,filter:s=>{let a=(0,Nn.relative)(e,s);if(a==="")return!0;let c=a.split(Nn.sep).join("/");return a.split(Nn.sep).some(l=>jee.has(l))?!1:zee(c)?(r.push(c),!1):!0}})}catch(s){throw await(0,on.rm)(i,{recursive:!0,force:!0}).catch(()=>{}),new Error(`Could not copy \`${e}\` into a temp checkout to test an upgrade: ${s instanceof Error?s.message:String(s)}`)}let o=!1;return{path:i,copiedFiles:[],copiedRules:[],oversizedFiles:[],oversizedRules:[],skippedSecrets:r.sort(),skippedSecretRules:[],async dispose(){o||(o=!0,await(0,on.rm)(i,{recursive:!0,force:!0}).catch(()=>{}))}}}var Lee=`${process.pid}-${(0,Nf.randomBytes)(4).toString("hex")}`;async function Uee(e,t,n,i={}){let r=await ax(e,t,i);try{return await n(r)}finally{await r.dispose()}}var jee=new Set(["node_modules",".git","dist","build","out",".next",".nuxt",".output",".svelte-kit",".cache",".parcel-cache",".turbo",".angular","coverage","target","vendor",".venv","venv","__pycache__",".pytest_cache",".gradle",".idea",".vscode","tmp",".tmp"]),R1e=25*1024*1024,N1e=[/(^|\/)\.env(\..*)?$/i,/(^|\/)\.npmrc$/i,/(^|\/)\.yarnrc(\.yml)?$/i,/(^|\/)\.netrc$/i,/(^|\/)\.pgpass$/i,/(^|\/)\.git-credentials$/i,/(^|\/)\.dockercfg$/i,/(^|\/)\.docker\/config\.json$/i,/(^|\/)id_(rsa|dsa|ecdsa|ed25519)(\.pub)?$/i,/\.(pem|key|p12|pfx|jks|keystore|ppk)$/i,/(^|\/)(\.aws\/credentials|\.aws\/config)$/i,/(^|\/)application_default_credentials\.json$/i,/(service[-_]?account|credentials?|secrets?)[^/]*\.(json|ya?ml|txt)$/i];function zee(e){return N1e.some(t=>t.test(e))}function C1e(e){let t="";for(let n=0;nC1e(n).test(e))}async function D1e(e,t,n,i,r=R1e,o){let s=await n("git",["ls-files","--others","--ignored","--exclude-standard","-z"],{cwd:e,env:i});if(s.code!==0||!s.stdout)return{copied:[],oversized:[],secrets:[]};let a=s.stdout.split("\0").filter(d=>d.length>0&&!d.split("/").some(p=>jee.has(p))),c=[],l=[],u=[];for(let d of a){if(zee(d)){u.push(d);continue}if(o&&o.length>0&&!P1e(d,o))continue;let p=(0,Nn.join)(e,d),f=await(0,on.stat)(p).catch(()=>null);if(!f||!f.isFile())continue;if(f.size>r){l.push(d);continue}let m=(0,Nn.join)(t,d);await(0,on.mkdir)((0,Nn.dirname)(m),{recursive:!0}),await(0,on.copyFile)(p,m).catch(()=>{}),c.push(d)}return{copied:c,oversized:l,secrets:u}}var Fee=200;async function o1(e,t,n,i){if(t.length===0)return[];let r=new Set;for(let o=0;o0?t.slice(0,80):"probe"}var Zee=require("node:fs/promises"),Yee=require("node:path");async function Vee(e,t,n={}){let i=n.exec??Xe,r=await i("git",["status","--porcelain"],{cwd:t});if(r.failure)return{status:"failed",changedFiles:[],message:"Could not inspect the worktree before running the recipe."};let o=Bee(r.stdout||""),s=await qee(t,[...o.keys()],i),a=M1e(e);if(!a)return{status:"failed",changedFiles:[],message:`Drift does not know how to run a "${e.provider}" recipe.`};n.logger?.info(`Running community recipe ${e.name}@${e.version} (${e.provider})`);let c=await i(a.bin,a.args,{cwd:t,timeoutMs:3e5});if(c.failure||c.code!==0){let u=c.failure==="not-found"?`${a.bin} is not installed`:c.stderr.trim()||c.stdout.trim();return{status:"failed",changedFiles:await Gee(t,o,s,i),message:`Recipe ${e.name}@${e.version} failed: ${u||`exit code ${c.code}`}`.trim()}}let l=await Gee(t,o,s,i);return l.length===0?{status:"no-changes",changedFiles:[],message:`Recipe ${e.name}@${e.version} made no changes here.`}:{status:"applied",changedFiles:l,message:`Applied community recipe ${e.name}@${e.version} from ${e.publisher} \u2014 no agent call was made.`}}function Bee(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trimEnd();if(!i.trim())continue;let r=i.slice(0,2),o=i.slice(2).trim(),s=o.indexOf(" -> ");s!==-1&&(o=o.slice(s+4).trim()),o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),o&&t.set(o,r)}return t}async function qee(e,t,n){let i=new Map;for(let r of t){let o=await n("git",["hash-object","--",r],{cwd:e});!o.failure&&o.code===0&&i.set(r,o.stdout.trim())}return i}async function Gee(e,t,n,i){let r=await i("git",["status","--porcelain"],{cwd:e}),o=Bee(r.stdout||""),s=new Set,a=[];for(let[l,u]of o)t.get(l)!==u?s.add(l):a.push(l);let c=await qee(e,a,i);for(let l of a)n.get(l)!==c.get(l)&&s.add(l);return[...s]}function M1e(e){switch(e.provider){case"codemod.com":return{bin:"npx",args:["--yes","codemod@latest","run",`${e.name}@${e.version}`]};case"openrewrite":return{bin:"mvn",args:["-q","org.openrewrite.maven:rewrite-maven-plugin:run",`-Drewrite.activeRecipes=${e.name}`,`-Drewrite.recipeArtifactCoordinates=${e.source}:${e.version}`]};default:return null}}var L1e=8;function Jee(e){let t=e.filter(r=>r.before!==r.after);if(t.length===0)return{ops:[],unexplained:[]};let n=[];for(;n.lengthcx(n,a.before)!==a.after);if(r.length===0)break;let o=new Map;for(let a of r){let c=cx(n,a.before);for(let l of F1e({...a,before:c}))o.set(JSON.stringify(l),l)}let s=null;for(let[a,c]of o){let l=[...n,c],u=r.filter(d=>cx(l,d.before)===d.after).length;u!==0&&(!s||u>s.score||u===s.score&&acx(n,r.before)!==r.after);return{ops:n,unexplained:i}}function cx(e,t){let n=t;for(let i of e)n=Ree(n,i);return n}function F1e(e){let t=[],n=Wee(e.before),i=Wee(e.after),r=n.filter(c=>!i.includes(c)),o=i.filter(c=>!n.includes(c));for(let c of new Set(r))for(let l of new Set(o))t.push({kind:"rename-identifier",from:c,to:l}),t.push({kind:"rename-member",from:c,to:l}),t.push({kind:"replace-import-path",from:c,to:l});let s=Hee(e.before),a=Hee(e.after);for(let c of s.filter(l=>!a.includes(l)))for(let l of a.filter(u=>!s.includes(u)))t.push({kind:"replace-import-path",from:c,to:l});for(let c of["await","new"])if(!(e.before.includes(`${c} `)||!e.after.includes(`${c} `)))for(let l of Kee(e.after))t.push({kind:"wrap-call",callee:l,wrapper:c});for(let c of Kee(e.before))for(let l of U1e(e.before,e.after))for(let u=0;u<=4;u++)t.push({kind:"insert-argument",callee:c,index:u,text:l});return t}function Wee(e){return e.match(/[A-Za-z_$][\w$]*/g)??[]}function Hee(e){return[...e.matchAll(/"([^"\\]*)"|'([^'\\]*)'/g)].map(t=>t[1]??t[2]??"")}function Kee(e){return[...e.matchAll(/([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g)].map(t=>t[1])}function U1e(e,t){let n=[...t.match(/\{[^{}]*\}/g)??[],...t.match(/"[^"\\]*"|'[^'\\]*'/g)??[],...t.match(/\b(?:true|false|null|None|nil)\b/g)??[]];return[...new Set(n.filter(i=>!e.includes(i)))]}async function Qee(e){let{candidate:t,change:n,sandbox:i,relevantFiles:r,logger:o}=e,s=e.exec??Xe,a=await Vee(t,i,{exec:s,logger:o});if(a.status!=="applied"||a.changedFiles.length===0)return o.debug(`${t.name}@${t.version} changed nothing Drift could learn a rule from.`),null;let c=[],l=!1;for(let d of a.changedFiles){if(!r.has(d)){l=!0;continue}let p=await j1e(i,d,s);if(!p){l=!0;continue}let f=p.before.split(` +`)}function Sze(e,t){return new RegExp(`(^|[^\\w$])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}([^\\w$]|$)`).test(e)}function Hf(e,t){return{plan:e,verdict:"rejected",assurance:"checked",sites:[],covered:0,residual:0,rejections:t,anchors:[]}}async function Gne(e){let{changes:t,sites:n,evidence:r,config:i,logger:o}=e,s=e.cache??Xy(),a=new Map,c=new Map,l=new Map;for(let d of n){let p=l.get(d.breakingChangeId);p?p.push(d):l.set(d.breakingChangeId,[d])}let u=new Map(e.dependencyChanges.map(d=>[`${d.workspace??""}::${d.name}`,d]));for(let d of t){let p=l.get(d.id);if(!p||p.length===0)continue;let f=u.get(`${d.workspace??""}::${d.dependency}`),m=Rne(d,f),g=null;for(let h of xze(e,d,f,m,s)){let v=await h();if(!v)continue;let b=zne({plan:v,change:d,sites:p,fileContents:e.fileContents,evidence:r});if(b.verdict==="rejected"){o.info(`Rejected a ${v.provenance.author}-proposed fix plan for ${d.dependency}: ${b.rejections[0]}`),g=b;continue}let w=b.covered+b.residual,k=w===0?0:b.covered/w;if(k0||c.size>0)&&o.info(`Fix plans: ${a.size} accepted, ${c.size} rejected. ${i.remediation.fixPlans.enabled?"":"(authoring disabled)"}`.trim()),{accepted:a,rejected:c}}function xze(e,t,n,r,i){let o=[];return o.push(async()=>{let s=await i.get(r);return s?Cne(s):null}),e.proposeFromRecipe&&o.push(()=>e.proposeFromRecipe(t)),e.client&&o.push(()=>Ine({change:t,dependencyChange:n,evidence:e.evidence,sites:e.sites,fileContents:e.fileContents,config:e.config,logger:e.logger,client:e.client})),o}var on=require("node:fs/promises"),Rn=require("node:path"),Qj=require("node:os"),Kf=require("node:crypto");async function iE(e,t,n={}){let r=n.exec??Qe,i=n.env??process.env,o=n.at??"HEAD",s=await r("git",["rev-parse","--git-common-dir"],{cwd:e,env:i});if(s.code!==0){if(n.at!==void 0&&n.at!=="HEAD")throw new Error(`\`${e}\` is not a git repository, so \`${n.at}\` cannot be checked out to test an upgrade.`);return Ize(e,t,n.runId??Vne)}let a=s.stdout.trim()||".git",c=(0,Rn.isAbsolute)(a)?a:(0,Rn.join)(e,a),l=n.runId??Vne,u=(0,Rn.join)((0,Qj.tmpdir)(),"drift-worktrees",(0,Kf.createHash)("sha256").update(c).digest("hex").slice(0,12)),d=(0,Rn.join)(u,rE(l),rE(t));Tze(u),await Bne(e,d,r,i);let p=await r("git",["worktree","add","--detach",d,o],{cwd:e,env:i});if(p.code!==0)throw new Error(`Could not create a worktree to test upgrades in: ${p.stderr.trim()||p.stdout.trim()||"git failed"}`);let{copied:f,oversized:m,secrets:g}=n.copyIgnoredFiles===!1?{copied:[],oversized:[],secrets:[]}:await Nze(e,d,r,i,void 0,n.allowedGlobs),[h,v,b]=await Promise.all([Yj(e,f,r,i),Yj(e,m,r,i),Yj(e,g,r,i)]),w=!1;return{path:d,copiedFiles:f,copiedRules:h,oversizedFiles:m,oversizedRules:v,skippedSecrets:g,skippedSecretRules:b,async dispose(){w||(w=!0,await Bne(e,d,r,i))}}}async function Bne(e,t,n,r){let i=`${t}.trash-${(0,Kf.randomUUID)().slice(0,8)}`;await(0,on.rename)(t,i).then(()=>!0,()=>!1)?Eze(i):await(0,on.rm)(t,{recursive:!0,force:!0}).then(()=>!0,()=>!1)||await n("git",["worktree","remove","--force",t],{cwd:e,env:r}).catch(()=>{}),await n("git",["worktree","prune"],{cwd:e,env:r}).catch(()=>{})}var nE=new Set;function Eze(e){let t=(0,on.rm)(e,{recursive:!0,force:!0}).catch(()=>{}).then(()=>{nE.delete(t)});nE.add(t)}async function Xj(){for(;nE.size>0;)await Promise.all([...nE])}function Tze(e){(0,on.readdir)(e,{withFileTypes:!0}).then(t=>Promise.all(t.filter(n=>n.isDirectory()).map(n=>(0,on.readdir)((0,Rn.join)(e,n.name),{withFileTypes:!0}).then(r=>Promise.all(r.filter(i=>i.name.includes(".trash-")).map(i=>(0,on.rm)((0,Rn.join)(e,n.name,i.name),{recursive:!0,force:!0}).catch(()=>{}))),()=>{})))).catch(()=>{})}async function Ize(e,t,n){let r=(0,Rn.join)((0,Qj.tmpdir)(),"drift-worktrees",rE(n),rE(t));await(0,on.rm)(r,{recursive:!0,force:!0}).catch(()=>{}),await(0,on.mkdir)(r,{recursive:!0});let i=[];try{await(0,on.cp)(e,r,{recursive:!0,filter:s=>{let a=(0,Rn.relative)(e,s);if(a==="")return!0;let c=a.split(Rn.sep).join("/");return a.split(Rn.sep).some(l=>Hne.has(l))?!1:Kne(c)?(i.push(c),!1):!0}})}catch(s){throw await(0,on.rm)(r,{recursive:!0,force:!0}).catch(()=>{}),new Error(`Could not copy \`${e}\` into a temp checkout to test an upgrade: ${s instanceof Error?s.message:String(s)}`)}let o=!1;return{path:r,copiedFiles:[],copiedRules:[],oversizedFiles:[],oversizedRules:[],skippedSecrets:i.sort(),skippedSecretRules:[],async dispose(){o||(o=!0,await(0,on.rm)(r,{recursive:!0,force:!0}).catch(()=>{}))}}}var Vne=`${process.pid}-${(0,Kf.randomBytes)(4).toString("hex")}`;async function Wne(e,t,n,r={}){let i=await iE(e,t,r);try{return await n(i)}finally{await i.dispose()}}var Hne=new Set(["node_modules",".git","dist","build","out",".next",".nuxt",".output",".svelte-kit",".cache",".parcel-cache",".turbo",".angular","coverage","target","vendor",".venv","venv","__pycache__",".pytest_cache",".gradle",".idea",".vscode","tmp",".tmp"]),Aze=25*1024*1024,Rze=[/(^|\/)\.env(\..*)?$/i,/(^|\/)\.npmrc$/i,/(^|\/)\.yarnrc(\.yml)?$/i,/(^|\/)\.netrc$/i,/(^|\/)\.pgpass$/i,/(^|\/)\.git-credentials$/i,/(^|\/)\.dockercfg$/i,/(^|\/)\.docker\/config\.json$/i,/(^|\/)id_(rsa|dsa|ecdsa|ed25519)(\.pub)?$/i,/\.(pem|key|p12|pfx|jks|keystore|ppk)$/i,/(^|\/)(\.aws\/credentials|\.aws\/config)$/i,/(^|\/)application_default_credentials\.json$/i,/(service[-_]?account|credentials?|secrets?)[^/]*\.(json|ya?ml|txt)$/i];function Kne(e){return Rze.some(t=>t.test(e))}function Pze(e){let t="";for(let n=0;nPze(n).test(e))}async function Nze(e,t,n,r,i=Aze,o){let s=await n("git",["ls-files","--others","--ignored","--exclude-standard","-z"],{cwd:e,env:r});if(s.code!==0||!s.stdout)return{copied:[],oversized:[],secrets:[]};let a=s.stdout.split("\0").filter(d=>d.length>0&&!d.split("/").some(p=>Hne.has(p))),c=[],l=[],u=[];for(let d of a){if(Kne(d)){u.push(d);continue}if(o&&o.length>0&&!Cze(d,o))continue;let p=(0,Rn.join)(e,d),f=await(0,on.stat)(p).catch(()=>null);if(!f||!f.isFile())continue;if(f.size>i){l.push(d);continue}let m=(0,Rn.join)(t,d);await(0,on.mkdir)((0,Rn.dirname)(m),{recursive:!0}),await(0,on.copyFile)(p,m).catch(()=>{}),c.push(d)}return{copied:c,oversized:l,secrets:u}}var qne=200;async function Yj(e,t,n,r){if(t.length===0)return[];let i=new Set;for(let o=0;o0?t.slice(0,80):"probe"}var rre=require("node:fs/promises"),ire=require("node:path");async function Zne(e,t,n={}){let r=n.exec??Qe,i=await r("git",["status","--porcelain"],{cwd:t});if(i.failure)return{status:"failed",changedFiles:[],message:"Could not inspect the worktree before running the recipe."};let o=Yne(i.stdout||""),s=await Qne(t,[...o.keys()],r),a=Oze(e);if(!a)return{status:"failed",changedFiles:[],message:`Drift does not know how to run a "${e.provider}" recipe.`};n.logger?.info(`Running community recipe ${e.name}@${e.version} (${e.provider})`);let c=await r(a.bin,a.args,{cwd:t,timeoutMs:3e5});if(c.failure||c.code!==0){let u=c.failure==="not-found"?`${a.bin} is not installed`:c.stderr.trim()||c.stdout.trim();return{status:"failed",changedFiles:await Jne(t,o,s,r),message:`Recipe ${e.name}@${e.version} failed: ${u||`exit code ${c.code}`}`.trim()}}let l=await Jne(t,o,s,r);return l.length===0?{status:"no-changes",changedFiles:[],message:`Recipe ${e.name}@${e.version} made no changes here.`}:{status:"applied",changedFiles:l,message:`Applied community recipe ${e.name}@${e.version} from ${e.publisher} \u2014 no agent call was made.`}}function Yne(e){let t=new Map;for(let n of e.split(` +`)){let r=n.trimEnd();if(!r.trim())continue;let i=r.slice(0,2),o=r.slice(2).trim(),s=o.indexOf(" -> ");s!==-1&&(o=o.slice(s+4).trim()),o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),o&&t.set(o,i)}return t}async function Qne(e,t,n){let r=new Map;for(let i of t){let o=await n("git",["hash-object","--",i],{cwd:e});!o.failure&&o.code===0&&r.set(i,o.stdout.trim())}return r}async function Jne(e,t,n,r){let i=await r("git",["status","--porcelain"],{cwd:e}),o=Yne(i.stdout||""),s=new Set,a=[];for(let[l,u]of o)t.get(l)!==u?s.add(l):a.push(l);let c=await Qne(e,a,r);for(let l of a)n.get(l)!==c.get(l)&&s.add(l);return[...s]}function Oze(e){switch(e.provider){case"codemod.com":return{bin:"npx",args:["--yes","codemod@latest","run",`${e.name}@${e.version}`]};case"openrewrite":return{bin:"mvn",args:["-q","org.openrewrite.maven:rewrite-maven-plugin:run",`-Drewrite.activeRecipes=${e.name}`,`-Drewrite.recipeArtifactCoordinates=${e.source}:${e.version}`]};default:return null}}var Mze=8;function nre(e){let t=e.filter(i=>i.before!==i.after);if(t.length===0)return{ops:[],unexplained:[]};let n=[];for(;n.lengthoE(n,a.before)!==a.after);if(i.length===0)break;let o=new Map;for(let a of i){let c=oE(n,a.before);for(let l of Lze({...a,before:c}))o.set(JSON.stringify(l),l)}let s=null;for(let[a,c]of o){let l=[...n,c],u=i.filter(d=>oE(l,d.before)===d.after).length;u!==0&&(!s||u>s.score||u===s.score&&aoE(n,i.before)!==i.after);return{ops:n,unexplained:r}}function oE(e,t){let n=t;for(let r of e)n=Lne(n,r);return n}function Lze(e){let t=[],n=Xne(e.before),r=Xne(e.after),i=n.filter(c=>!r.includes(c)),o=r.filter(c=>!n.includes(c));for(let c of new Set(i))for(let l of new Set(o))t.push({kind:"rename-identifier",from:c,to:l}),t.push({kind:"rename-member",from:c,to:l}),t.push({kind:"replace-import-path",from:c,to:l});let s=ere(e.before),a=ere(e.after);for(let c of s.filter(l=>!a.includes(l)))for(let l of a.filter(u=>!s.includes(u)))t.push({kind:"replace-import-path",from:c,to:l});for(let c of["await","new"])if(!(e.before.includes(`${c} `)||!e.after.includes(`${c} `)))for(let l of tre(e.after))t.push({kind:"wrap-call",callee:l,wrapper:c});for(let c of tre(e.before))for(let l of Fze(e.before,e.after))for(let u=0;u<=4;u++)t.push({kind:"insert-argument",callee:c,index:u,text:l});return t}function Xne(e){return e.match(/[A-Za-z_$][\w$]*/g)??[]}function ere(e){return[...e.matchAll(/"([^"\\]*)"|'([^'\\]*)'/g)].map(t=>t[1]??t[2]??"")}function tre(e){return[...e.matchAll(/([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g)].map(t=>t[1])}function Fze(e,t){let n=[...t.match(/\{[^{}]*\}/g)??[],...t.match(/"[^"\\]*"|'[^'\\]*'/g)??[],...t.match(/\b(?:true|false|null|None|nil)\b/g)??[]];return[...new Set(n.filter(r=>!e.includes(r)))]}async function ore(e){let{candidate:t,change:n,sandbox:r,relevantFiles:i,logger:o}=e,s=e.exec??Qe,a=await Zne(t,r,{exec:s,logger:o});if(a.status!=="applied"||a.changedFiles.length===0)return o.debug(`${t.name}@${t.version} changed nothing Drift could learn a rule from.`),null;let c=[],l=!1;for(let d of a.changedFiles){if(!i.has(d)){l=!0;continue}let p=await jze(r,d,s);if(!p){l=!0;continue}let f=p.before.split(` `),m=p.after.split(` -`);if(f.length!==m.length)return o.debug(`${t.name} changed the line count of ${d}; that is not expressible as a Drift operation.`),null;for(let g=0;g0?(o.info(`Drift could not re-derive what ${t.name}@${t.version} did to ${u.unexplained.length||c.length} line(s), so it will not apply it. This finding falls through to an agent.`),null):(l&&o.info(`${t.name}@${t.version} also changed files outside this finding's call sites; those edits were not learned from and will not be applied.`),n1({change:n,dependencyChange:e.dependencyChange,migration:t.migration,rationale:`Inferred from ${c.length} edit(s) made by ${t.name}@${t.version} in an isolated worktree, then re-derived as Drift operations. The recipe's own output was discarded.`,citations:[],ops:u.ops,provenance:{author:"recipe",recipe:{name:t.name,version:t.version,publisher:t.publisher,source:t.source},authoredAt:new Date().toISOString()}}))}async function j1e(e,t,n){let i=await n("git",["show",`HEAD:${t}`],{cwd:e});if(i.code!==0)return null;try{return{before:i.stdout,after:await(0,Zee.readFile)((0,Yee.join)(e,t),"utf8")}}catch{return null}}async function Xee(e){let{change:t,candidate:n,sites:i,workspace:r,headSha:o,logger:s}=e;if(!n)return null;let a=new Set(i.filter(c=>c.breakingChangeId===t.id).map(c=>c.file));if(a.size===0)return null;try{return await Uee(r,`fixplan-${n.provider}`,c=>Qee({candidate:n,change:t,dependencyChange:e.dependencyChange,sandbox:c.path,relevantFiles:a,logger:s}),{at:o,...e.env?{env:e.env}:{},copyIgnoredFiles:!1})}catch(c){return s.warn(`Could not observe ${n.name}@${n.version} in an isolated worktree (${c.message}); this finding gets no recipe-derived fix plan.`),null}}var z1e="https://api.codemod.com",l1="https://search.maven.org",u1=6e3;async function tte(e,t){if(!t)return null;let n=rte(t.name),i=t.name.toLowerCase(),r=`${z1e}/registry?search=${encodeURIComponent(n)}`,o=await $e(r,{timeoutMs:u1,cacheTtlMs:3600*1e3});if(!o)return null;let s=Array.isArray(o)?o:o.entries??o.results??o.data??[];if(!Array.isArray(s))return null;let a=s.map(p=>({entry:p,confidence:G1e(p,i,n)})).filter(p=>p.confidence!=="none");if(a.length===0)return null;let c={exact:2,"base-name":1,text:0};a.sort((p,f)=>c[f.confidence]-c[p.confidence]||Number(c1(f.entry))-Number(c1(p.entry)));let l=a[0].entry,u=l.slug??l.name,d=l.version??l.latestVersion;return!u||!d?null:{provider:"codemod.com",name:u,version:d,publisher:l.owner?.name??l.author??l.publisher??"Codemod.com",source:`https://app.codemod.com/registry/${encodeURIComponent(l.slug??u)}`,migration:l.description??l.summary??`Migrates ${t.name} usages.`,official:c1(l)}}function G1e(e,t,n){let i=e.applicability?.flatMap(s=>s.packages??[])??[];if(i.some(s=>s.toLowerCase()===t))return"exact";if(i.some(s=>!s.includes("/")&&s.toLowerCase()===n))return"base-name";let r=`${e.slug??""} ${e.name??""} ${e.description??""} ${e.summary??""}`.toLowerCase(),o=new RegExp(`(?:^|[^a-z0-9])${V1e(n)}(?:$|[^a-z0-9])`);return n&&o.test(r)?"text":"none"}function V1e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function c1(e){if(e.verified||e.official)return!0;let t=(e.owner?.name??e.owner?.slug??e.author??e.publisher??"").toLowerCase();return t==="codemod"||t==="codemod.com"}var B1e=/\borg\.openrewrite\.[a-zA-Z0-9_.]*[A-Z][a-zA-Z0-9_]*\b/;async function nte(e,t){if(!t||t.ecosystem!=="maven")return null;let n=rte(t.name).replace(/[^a-z0-9]/g,"-"),i=await ete(`rewrite-${n}`)??await ete(n);if(!i?.latestVersion)return null;let r=await q1e(i.g,i.a,i.latestVersion),o=r?B1e.exec(r)?.[0]:void 0;return o?{provider:"openrewrite",name:o,version:i.latestVersion,publisher:"OpenRewrite",source:`${l1}/artifact/${i.g}/${i.a}/${i.latestVersion}`,migration:r??`Runs ${o} from ${i.g}:${i.a}.`,official:!0}:null}async function ete(e){let t=encodeURIComponent(`g:org.openrewrite.recipe AND a:${e}`),n=`${l1}/solrsearch/select?q=${t}&core=gav&rows=1&wt=json`,r=(await $e(n,{timeoutMs:u1,cacheTtlMs:3600*1e3}))?.response?.docs?.[0];return r?.g==="org.openrewrite.recipe"?r:null}async function q1e(e,t,n){let i=e.replace(/\./g,"/"),r=`${l1}/remotecontent?filepath=${i}/${t}/${n}/${t}-${n}.pom`,o=await rt(r,{timeoutMs:u1,cacheTtlMs:1440*60*1e3,immutable:!0});if(!o)return null;let s=/([\s\S]*?)<\/description>/.exec(o);return s?s[1].trim():null}function rte(e){return e.replace(/^@[^/]+\//,"").toLowerCase()}var W1e=[tte,nte];async function ite(e,t,n=W1e){let r=(await Promise.all(n.map(o=>o(e,t).catch(()=>null)))).filter(o=>o!==null);return r.length===0?null:(r.sort((o,s)=>Number(s.official)-Number(o.official)),r[0])}var ste={branch:"{prefix}upgrade-{summary}-{date}",title:"chore(deps): upgrade {summary}",prefix:"drift/"};function ate(e,t){let{changes:n}=e,i=e.now??new Date,r=n[0],o=r?n.length===1?`${r.name}-${r.from??"unknown"}-to-${r.to??"unknown"}`:`${n.length}-packages`:"dependencies",s=r?n.length===1?`${r.name} to ${r.to??"a new version"}`:`${n.length} packages`:"dependencies";return{prefix:t,summary:o,"summary-text":s,name:r?.name??"dependencies",from:r?.from??"",to:r?.to??"",count:String(n.length),date:i.toISOString().slice(0,10)}}function cte(e,t){return e.replace(/\{([a-z-]+)\}/g,(n,i)=>t[i]??n)}function ote(e){return(e.toLowerCase().replace(/[^a-z0-9/_.-]+/g,"-").replace(/(?<=[^/])\/(?=[^/])/g,"-").replace(/\.{2,}/g,".").replace(/-{2,}/g,"-").replace(/^[-./]+|[-./]+$/g,"").replace(/\.lock$/,"-lock")||"drift-upgrade").slice(0,200).replace(/[-./]+$/,"")}function lte(e,t={}){let n={...ste,...t},i=n.prefix?`${n.prefix.replace(/\/+$/,"")}/`:"",r=cte(n.branch,ate(e,i));return r.startsWith(i)&&i?`${i}${ote(r.slice(i.length))}`:ote(r)}function ute(e,t={}){let n={...ste,...t},i=ate(e,n.prefix);return cte(n.title,{...i,summary:i["summary-text"]}).trim()}var dte={"runtime-requirement":0,"config-change":1,"module-system-change":1,"moved-export":1,"removed-export":2,"renamed-export":2,"removed-endpoint":3,"changed-endpoint":3,"signature-change":4,"type-change":4,"required-field-added":5,"default-change":5,"behaviour-change":6,unknown:7};function H1e(e){switch(e){case"runtime-requirement":case"config-change":case"module-system-change":return"build";case"behaviour-change":case"default-change":return"fix";default:return"refactor"}}function hte({breakingChanges:e,impactSites:t,dispositions:n,config:i,changes:r=[],codemods:o,recipes:s,fixPlans:a}){let c=K1e(t),l=new Map((n??[]).map(k=>[k.changeId,k.actionableSites])),u=new Map(n?.map(k=>[k.changeId,k])),d=e.filter(k=>{let _=u.get(k.id);return _?_.state==="actionable"&&_.actionableSites.length>0:(c.get(k.id)??[]).some(S=>S.confidence==="high"&&S.runtimeVerdict===void 0)});if(d.length===0)return{commits:[],edges:[],cohorts:mte(r),blockers:[]};let f=[...i.remediation.commitGranularity==="single"?[d]:i.remediation.commitGranularity==="per-dependency"?J1e(d):d.map(k=>[k])].sort(Z1e),m=mte(r),g=new Map;for(let k of m)for(let _ of k.dependencies)g.set(_,k);let h=f.map((k,_)=>Y1e(k,_+1,l,f.length,o,s,a)),b=tUe(h,e,t,g),y=oUe(h,b),w=y.cycle.length>0?sUe(y.cycle,b):void 0;return{commits:y.commits,edges:b,cohorts:m,blockers:w?[w]:[]}}function K1e(e){let t=new Map;for(let n of e){let i=t.get(n.breakingChangeId);i?i.push(n):t.set(n.breakingChangeId,[n])}return t}function J1e(e){let t=new Map;for(let n of e){let i=t.get(n.dependency);i?i.push(n):t.set(n.dependency,[n])}return[...t.values()]}function Z1e(e,t){let n=Math.min(...e.map(s=>dte[s.kind])),i=Math.min(...t.map(s=>dte[s.kind]));if(n!==i)return n-i;let r=e[0]?.dependency??"",o=t[0]?.dependency??"";return r.localeCompare(o)}function Y1e(e,t,n,i,r,o,s){let a=e.flatMap(f=>n.get(f.id)??[]),c=[...new Set(a.map(f=>f.file))].sort(),l=e[0],u=r?eUe(e,n,r):void 0,d=!u&&s?Q1e(e,n,s):void 0,p=!u&&o?X1e(e,o):void 0;return{id:St("unit",e.map(f=>f.id).sort().join(","),c.join(","),l.dependency,l.kind),order:t,message:dUe(e,c.length),body:mUe(e,a,u,p),breakingChangeIds:e.map(f=>f.id),files:c,allowedFiles:c,allowedSymbols:[...new Set(e.flatMap(f=>f.symbols))].sort(),instructions:gUe(e,a,t,i),dependsOn:[],dependencyReasons:[],executionLayer:0,expectedChecks:aUe(e,c),invalidationTriggers:cUe(e,c),...u?{codemod:u}:{},...d?{fixPlan:d}:{},...p?{recipe:p}:{}}}function Q1e(e,t,n){let i=e.map(a=>n.get(a.id)).filter(a=>!!a);if(i.length===0)return;let r=e.filter(a=>!n.has(a.id)).flatMap(a=>(t.get(a.id)??[]).map(c=>({file:c.file,line:c.line,reason:`No fix plan was accepted for "${a.summary}", so this site needs an agent.`}))),o=i[0],s=i.flatMap(a=>a.anchors);return{plan:o.plan,assurance:i.some(a=>a.assurance==="checked")?"checked":"proven",files:[...new Set(s.map(a=>a.file))].sort(),anchors:s,covered:i.reduce((a,c)=>a+c.covered,0),residual:i.reduce((a,c)=>a+c.residual,0)+r.length,residualSites:[...i.flatMap(a=>a.sites.filter(c=>c.status==="residual").map(c=>({file:c.file,line:c.line,reason:c.reason??"No rule matched."}))),...r]}}function X1e(e,t){let n=[];for(let i of e){let r=t.get(i.id);if(!r)return;n.push(r)}return n.length>0?n:void 0}function eUe(e,t,n){let i=new Set,r=[];for(let o of e){let s=t.get(o.id)??[],a=n.get(o.id);if(!a||a.sitesResolvedl.file))];if(c.some(l=>i.has(l)))return;for(let l of c)i.add(l);r.push({...a.transform,files:c})}return r.length>0?r:void 0}function tUe(e,t,n,i){let r=new Map,o=new Map(t.map(c=>[c.id,c])),s=new Map;for(let c of n){let l=s.get(c.file);l?l.push(c):s.set(c.file,[c])}let a=(c,l,u,d)=>{if(c.id===l.id)return;let p=`${c.id}\0${l.id}\0${u}`;r.has(p)||r.set(p,{from:c.id,to:l.id,reason:u,evidence:[...new Set(d)].sort()})};for(let c=0;cf.dependency)),p=new Set(l.allowedFiles);for(let f=c+1;fk.dependency)),b=m.allowedFiles.filter(k=>p.has(k));b.length>0&&a(l,m,"same-file-conflict",b),u.some(k=>k.kind==="runtime-requirement")&&a(l,m,"runtime-prerequisite",u.map(k=>k.summary)),u.some(k=>k.kind==="config-change"||k.kind==="module-system-change")&&g.some(k=>d.has(k.dependency))&&a(l,m,"configuration-prerequisite",u.map(k=>k.summary)),u.some(k=>k.kind==="moved-export")&&rUe(u,g)&&a(l,m,"import-prerequisite",u.flatMap(k=>k.symbols)),l.allowedFiles.some(d1)&&!m.allowedFiles.every(d1)&&nUe(d,h)&&a(l,m,"generated-output",l.allowedFiles.filter(d1));let y=[...d].map(k=>i.get(k)).filter(k=>!!k).filter(k=>g.some(_=>k.dependencies.includes(_.dependency)));for(let k of y)a(l,m,"package-cohort",[`${k.id}: ${k.reason}`]);let w=iUe(l,m,s);w.length>0&&a(l,m,"symbol-dependency",w)}}return[...r.values()].sort(yte)}function pte(e,t){return e.breakingChangeIds.map(n=>t.get(n)).filter(n=>!!n)}function nUe(e,t){for(let n of e)if(t.has(n))return!0;return!1}function rUe(e,t){let n=e.filter(i=>i.kind==="moved-export");if(n.length===0)return!1;for(let i of n){let r=new Set([...i.symbols,...i.replacementSymbols??[]]);if(t.some(o=>o.dependency===i.dependency&&o.symbols.some(s=>r.has(s))))return!0}return!1}function d1(e){return/(^|\/)(__generated__|generated|gen)\//i.test(e)||/\.(generated|gen)\./i.test(e)}function iUe(e,t,n){let i=new Set(e.allowedSymbols??[]);if(i.size===0)return[];let r=[];for(let o of t.allowedFiles)for(let s of n.get(o)??[])s.enclosingSymbol&&i.has(s.enclosingSymbol)&&r.push(`${o}:${s.line} is inside ${s.enclosingSymbol}`);return r}function yte(e,t){return e.from.localeCompare(t.from)||e.to.localeCompare(t.to)||e.reason.localeCompare(t.reason)||e.evidence.join("\0").localeCompare(t.evidence.join("\0"))}function oUe(e,t){let n=new Map(e.map(a=>[a.id,a])),i=new Map;for(let a of e)i.set(a.id,new Set);for(let a of t)!n.has(a.from)||!n.has(a.to)||i.get(a.to).add(a.from);let r=new Set(e.map(a=>a.id)),o=new Map,s=0;for(;r.size>0;){let a=[...r].filter(c=>[...i.get(c)??[]].every(l=>!r.has(l))).map(c=>n.get(c)).sort((c,l)=>c.order-l.order||c.id.localeCompare(l.id));if(a.length===0)return{commits:fte(e,t,o),cycle:[...r].sort()};for(let c of a)o.set(c.id,s),r.delete(c.id);s+=1}return{commits:fte(e,t,o),cycle:[]}}function fte(e,t,n){let i=new Map;for(let r of t){let o=i.get(r.to);o?o.push(r):i.set(r.to,[r])}return e.map(r=>{let o=[...i.get(r.id)??[]].sort(yte);return{...r,dependsOn:o.map(s=>s.from).sort(),dependencyReasons:o,executionLayer:n.get(r.id)??0}}).sort((r,o)=>r.executionLayer-o.executionLayer||r.order-o.order||r.id.localeCompare(o.id)).map((r,o)=>({...r,order:o+1}))}function sUe(e,t){let n=t.filter(i=>e.includes(i.from)&&e.includes(i.to)).slice(0,5).map(i=>`${i.from} -> ${i.to} (${i.reason})`).join("; ");return`The remediation graph contains a dependency cycle across ${e.length} commit unit(s): ${n}. Drift cannot automatically execute this plan until the inseparable work is combined or reviewed manually.`}function aUe(e,t){let n=[];return e.some(i=>i.kind==="signature-change"||i.kind==="type-change"||i.kind==="removed-export"||i.kind==="renamed-export"||i.kind==="moved-export")&&n.push({id:St("check","typecheck",e.map(i=>i.id).sort().join(",")),kind:"typecheck",reason:"API-shape and type-contract migrations should be checked by the repository type checker when available."}),e.some(i=>i.kind==="behaviour-change"||i.kind==="default-change")&&n.push({id:St("check","test",e.map(i=>i.id).sort().join(",")),kind:"test",reason:"Behavioural and default changes need tests because compilation can still succeed with wrong behaviour."}),t.some(i=>/(^|\/)(package\.json|tsconfig\.json|vite\.config|webpack\.config|rollup\.config)/.test(i))&&n.push({id:St("check","build",t.join(",")),kind:"build",reason:"Configuration and package-entry changes can alter the build graph."}),n}function cUe(e,t){let n=[...t.map(i=>`file:${i}`),...e.flatMap(i=>i.symbols.map(r=>`symbol:${r}`)),...e.map(i=>`dependency:${i.dependency}`)];return[...new Set(n)].sort()}function mte(e){let t=[],n=new Map;for(let i of e){let r=n.get(i.ecosystem);r?r.push(i):n.set(i.ecosystem,[i])}for(let[i,r]of n)for(let o of lUe(r)){if(o.length<2)continue;let s=o.map(a=>a.name).sort();t.push({id:St("cohort",i,s.join(",")),ecosystem:o[0].ecosystem,dependencies:s,constraints:o.map(a=>({dependency:a.name,ecosystem:a.ecosystem,range:a.rawTo??a.to??"*",source:"workspace-family"})),candidatePaths:[...new Set(o.map(a=>a.manifestPath))].sort(),reason:`These ${i} packages appear to be part of the same ${uUe(o[0].name)} upgrade family and should be reviewed together.`})}return t.sort((i,r)=>i.id.localeCompare(r.id))}function lUe(e){let t=new Map;for(let n of e){let i=bte(n.name);if(!i)continue;let r=t.get(i);r?r.push(n):t.set(i,[n])}return[...t.values()]}function bte(e){let t=[/^(@angular)\//,/^(@babel)\//,/^(@nestjs)\//,/^(@types)\//,/^(@vue)\//,/^(react)(?:$|-)/,/^(next)(?:$|-)/,/^(eslint)(?:$|-)/,/^(jest)(?:$|-)/,/^(webpack)(?:$|-)/,/^(vite)(?:$|-)/];for(let n of t){let i=n.exec(e);if(i?.[1])return i[1]}if(e.startsWith("@")){let n=e.split("/")[0];return n&&n!==e?n:null}return null}function uUe(e){return pK(bte(e)??e,32)}function dUe(e,t){let n=e[0],i=H1e(n.kind),r=fUe(e);return e.length===1?gte(`${i}(${r}): ${pUe(n)}`):gte(`${i}(${r}): update ${e.length} usages for the new ${n.dependency} API`)}function pUe(e){let t=e.symbols[0],n=e.replacementSymbols?.[0];switch(e.kind){case"removed-export":return t?`replace removed \`${t}\``:"replace removed API";case"renamed-export":return t&&n?`migrate \`${t}\` to \`${n}\``:`migrate renamed \`${t??"API"}\``;case"moved-export":return`import ${t?`\`${t}\``:"the API"} from its new entry point`;case"signature-change":return t?`update \`${t}\` call sites for the new signature`:"update call sites for new signatures";case"type-change":return t?`adapt to the new \`${t}\` type`:"adapt to changed types";case"removed-endpoint":return t?`migrate calls to removed endpoint \`${t}\``:"migrate removed endpoint calls";case"changed-endpoint":return t?`update requests to \`${t}\``:"update API requests";case"required-field-added":return t?`supply now-required \`${t}\``:"supply newly-required fields";case"default-change":return t?`pin previous default for \`${t}\``:"account for changed defaults";case"runtime-requirement":return e.summary.toLowerCase().startsWith("minimum")?e.summary.charAt(0).toLowerCase()+e.summary.slice(1):"raise the minimum runtime version";case"config-change":return"update configuration for the new version";case"module-system-change":return/commonjs/i.test(e.summary)?"replace dropped CommonJS usage":"migrate incompatible module loading";case"behaviour-change":return t?`handle changed \`${t}\` behaviour`:"handle changed behaviour";default:return`update usage of \`${e.dependency}\``}}function fUe(e){let t=[...new Set(e.map(n=>n.dependency))];if(t.length===1){let n=t[0];return n.startsWith("@")?n.split("/")[1]??n:n.split(":").pop()??n}return"deps"}function gte(e){return e.length<=72?e:`${e.slice(0,69)}...`}function mUe(e,t,n,i){let r=[];for(let s of e)r.push(s.summary),r.push(""),r.push(s.remediation),r.push("");let o=[...new Set(t.map(s=>s.file))];if(r.push(`Affects ${t.length} location(s) across ${o.length} file(s).`),r.push(""),n){let s=new Set(n.flatMap(a=>a.files)).size;r.push(`Resolved deterministically by Drift's codemod engine across ${s} file(s) \u2014 no model call was made for this commit.`)}else if(i&&i.length>0){let s=[...new Map(i.map(c=>[`${c.provider}:${c.name}@${c.version}`,c])).values()],a=s.map(c=>`${c.name}@${c.version} (${c.provider}, published by ${c.publisher})`).join(", ");r.push(`Community recipe available: ${a}. Not applied without an explicit choice \u2014 see ${s[0].source}.`)}else r.push("Identified by Drift from upstream evidence; see the pull request"),r.push("description for the citations behind this change.");return r.join(` -`).trim()}function gUe(e,t,n,i){let r=[];r.push(`## Commit ${n} of ${i}`),r.push("");for(let o of e){r.push(`### ${o.summary}`),r.push(""),r.push(`- Dependency: \`${o.dependency}\``),r.push(`- Change type: ${o.kind}`),r.push(`- Confidence: ${o.confidence}`),r.push(""),r.push(o.remediation),r.push("");let s=t.filter(a=>a.breakingChangeId===o.id);if(s.length>0){r.push("Known locations (verify each; there may be others):"),r.push("");for(let a of s.slice(0,40)){let c=a.enclosingSymbol?` in \`${a.enclosingSymbol}\``:"";r.push(`- \`${a.file}:${a.line}\`${c} \u2014 \`${a.excerpt}\``)}s.length>40&&r.push(`- \u2026and ${s.length-40} more matches of the same symbols`),r.push("")}}return r.join(` -`).trim()}var vte=["detect","evidence","surface","static-analysis","upgrade-discovery","upgrade-install","verify","fix","pull-request"],m1={detect:"Detect",evidence:"Evidence",surface:"API surface","static-analysis":"Static analysis","upgrade-discovery":"Find upgrades","upgrade-install":"Install a version",verify:"Verify",fix:"Fix","pull-request":"Automated PR"},ge=()=>({level:"full"}),he=(e,t)=>({level:"partial",note:e,...t?{requires:t}:{}}),tu=e=>({level:"none",note:e}),sc="Resolves imports against the module names the published package declares, follows re-exports inside your repository, and matches references to symbols named in the evidence. Cannot see through reflection, dynamic dispatch, or generated code.",hUe="Matches imports and references to symbols named in the evidence, using the ecosystem's own module-naming convention where no published module list exists. Cannot see through reflection, dynamic dispatch, or generated code.",p1="Compares the declarations in both versions' public headers, which is what a consumer compiles against. Declarations behind preprocessor conditionals are read as written, not per build configuration.",f1="Matches `#include` directives and references to symbols named in the evidence, following includes through your own headers so a library reached indirectly still counts. A macro-generated call site is invisible.",yUe={npm:{ecosystem:"npm",localizationBasis:"declared",label:"JavaScript / TypeScript",files:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","npm-shrinkwrap.json"],managers:["npm","pnpm","Yarn (classic)","Yarn (berry)","Bun"],support:{detect:ge(),evidence:ge(),surface:he("Diffs published TypeScript declarations. A package that ships no declarations of its own falls back to prose evidence rather than reporting a clean comparison."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs the typecheck, test, and build scripts the project's package.json actually declares."),fix:ge(),"pull-request":ge()}},pypi:{ecosystem:"pypi",localizationBasis:"published",label:"Python",files:["pyproject.toml","requirements.in","requirements.txt","setup.py","poetry.lock","uv.lock","Pipfile"],managers:["pip","Poetry","uv"],support:{detect:ge(),evidence:ge(),surface:he("Compares the public surface reconstructed from published type stubs. Packages without stubs fall back to prose evidence.","a local Python interpreter"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs mypy/pyright and pytest when the project declares them."),fix:ge(),"pull-request":ge()}},go:{ecosystem:"go",localizationBasis:"declared",label:"Go",files:["go.mod","go.sum"],managers:["Go modules"],support:{detect:ge(),evidence:ge(),surface:he("Compares the exported API of both module versions.","the Go toolchain"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `go vet`, `go test`, and `go build`.","the Go toolchain"),fix:ge(),"pull-request":ge()}},cargo:{ecosystem:"cargo",localizationBasis:"declared",label:"Rust",files:["Cargo.toml","Cargo.lock"],managers:["Cargo"],support:{detect:ge(),evidence:ge(),surface:he("Compares the public API of both crate versions.","cargo-public-api"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `cargo check`, `cargo test`, and `cargo build`.","the Rust toolchain"),fix:ge(),"pull-request":ge()}},maven:{ecosystem:"maven",localizationBasis:"published",label:"Java / Kotlin / Scala",files:["pom.xml","build.gradle","build.gradle.kts","gradle/libs.versions.toml","build.sbt"],managers:["Maven","Gradle","sbt"],support:{detect:he("Reads pom.xml, Gradle build files and version catalogs, and sbt coordinates. Gradle versions computed at configuration time are not visible without running Gradle."),evidence:ge(),surface:he("Compares both published JARs.","japicmp"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs Maven or Gradle. sbt projects verify through sbt when it is installed."),fix:he("Maven and sbt are edited through the build file; Gradle versions declared outside a version catalog may need a manual edit."),"pull-request":ge()}},rubygems:{ecosystem:"rubygems",localizationBasis:"published",label:"Ruby",files:["Gemfile","Gemfile.lock","*.gemspec"],managers:["Bundler"],support:{detect:ge(),evidence:ge(),surface:tu("Ruby has no static public API surface to compare, so upgrades rest on release notes, changelogs, and advisories."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs RSpec or Rake when the Gemfile declares them.","Bundler"),fix:ge(),"pull-request":ge()}},nuget:{ecosystem:"nuget",localizationBasis:"published",label:".NET",files:["*.csproj","*.fsproj","*.vbproj","Directory.Packages.props","packages.lock.json"],managers:["NuGet"],support:{detect:ge(),evidence:he("Registry metadata, published versions, deprecation, and OSV advisories. Release notes depend on the package declaring a GitHub repository."),surface:he("Compares the public types and member signatures in both versions' published assemblies, preferring the reference assembly and a common target framework. A package that ships only native binaries, analyzers, or nothing at all has no surface to compare."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `dotnet build` and `dotnet test`.","the .NET SDK"),fix:ge(),"pull-request":ge()}},packagist:{ecosystem:"packagist",localizationBasis:"published",label:"PHP",files:["composer.json","composer.lock"],managers:["Composer"],support:{detect:ge(),evidence:he("Registry metadata, published versions, abandonment notices, and OSV advisories. Release notes depend on the package declaring a source repository."),surface:tu("PHP publishes no machine-comparable API artefact; upgrades rest on release notes, changelogs, and advisories."),"static-analysis":he("Resolves `use` statements against the PSR-4 and PSR-0 roots the package declares in its own composer.json, read from Packagist. A package that autoloads only by classmap declares no namespace root and is not localized."),"upgrade-discovery":ge(),verify:he("Runs PHPUnit when composer.json declares it.","Composer"),fix:ge(),"pull-request":ge()}},hex:{ecosystem:"hex",localizationBasis:"published",label:"Elixir / Erlang",files:["mix.exs","mix.lock"],managers:["Mix"],support:{detect:ge(),evidence:he("Registry metadata, published versions, retirement notices, and OSV advisories."),surface:he("Compares the public modules and their functions, by name and arity, in both versions' published sources \u2014 `def` and `defmacro` in Elixir, `-export` in Erlang. A function a macro generates at compile time is not visible without compiling."),"static-analysis":he("Resolves module references against every module the released tarball defines, so a fully qualified call needs no `alias` to be found. Cannot see through `apply/3` or a module name computed at runtime."),"upgrade-discovery":ge(),verify:he("Runs `mix compile --warnings-as-errors` and `mix test`.","Elixir and Mix"),fix:ge(),"pull-request":ge()}},pub:{ecosystem:"pub",localizationBasis:"declared",label:"Dart / Flutter",files:["pubspec.yaml","pubspec.lock"],managers:["Dart pub","Flutter"],support:{detect:ge(),evidence:he("Registry metadata, published versions, retraction, and OSV advisories. Release notes depend on the package declaring a repository."),surface:he("Compares the public declarations of both versions' published libraries, following each `export` out of the private `lib/src` tree the way a consumer's import does. Read from source rather than from a compiled artefact."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `dart analyze` and `dart test`, or their Flutter equivalents.","the Dart or Flutter SDK"),fix:ge(),"pull-request":ge()}},swift:{ecosystem:"swift",localizationBasis:"published",label:"Swift",files:["Package.swift","Package.resolved"],managers:["Swift Package Manager"],support:{detect:he("Reads literal `.package(...)` declarations and Package.resolved. Versions computed by Swift code at manifest-evaluation time are not visible without running SwiftPM."),evidence:he("Source repository, releases, and changelogs, because SwiftPM identifies packages by git URL. There is no central registry to query for deprecation."),surface:tu("Comparing two Swift module interfaces needs a local toolchain and a built artefact Drift does not produce; upgrades rest on prose evidence."),"static-analysis":he("Resolves `import` statements against the library and target names declared in the dependency's own Package.swift at the resolved version. A module name a manifest computes at evaluation time is not visible without running SwiftPM."),"upgrade-discovery":he("Versions are git tags, since SwiftPM has no package registry to ask. Drift lists them for packages hosted on GitHub; anything on another git host is reported as unchecked rather than up to date."),verify:he("Runs `swift build` and `swift test`.","the Swift toolchain"),fix:ge(),"pull-request":ge()}},cocoapods:{ecosystem:"cocoapods",localizationBasis:"published",label:"CocoaPods",files:["Podfile","Podfile.lock","*.podspec"],managers:["CocoaPods"],support:{detect:ge(),evidence:he("Release notes and changelogs when the pod declares a GitHub source. CocoaPods publishes no queryable metadata API, so there is no deprecation or advisory signal."),surface:tu("Drift does not compare compiled iOS frameworks; upgrades rest on prose evidence."),"static-analysis":he("Resolves `import` statements against the `module_name` the pod declares in its podspec, read from the CocoaPods CDN. A pod that builds its module name in Ruby at podspec-evaluation time is not visible without running CocoaPods."),"upgrade-discovery":ge(),verify:tu("Building an iOS target needs Xcode and a scheme Drift cannot infer; verification stays with the developer."),fix:ge(),"pull-request":ge()}},opam:{ecosystem:"opam",localizationBasis:"convention",label:"OCaml",files:["*.opam","dune-project","*.opam.locked"],managers:["opam"],support:{detect:ge(),evidence:he("Release notes and changelogs when the package declares a GitHub source. opam has no JSON metadata API, so there is no registry deprecation signal."),surface:tu("Comparing two OCaml module interfaces needs a built switch Drift does not create; upgrades rest on prose evidence."),"static-analysis":he(hUe),"upgrade-discovery":he("opam publishes no version API, so releases are read from the package directories in the opam-repository index. A package published only in a custom repository is reported as unchecked rather than up to date."),verify:he("Runs `dune build` and `dune runtest`.","opam and dune"),fix:ge(),"pull-request":ge()}},conan:{ecosystem:"conan",localizationBasis:"convention",label:"C / C++ (Conan)",files:["conanfile.txt","conanfile.py","conan.lock"],managers:["Conan"],support:{detect:he("Reads conanfile.txt, conan.lock, and the literal `requires` declarations in conanfile.py. A reference a recipe builds at evaluation time is not visible without running Python."),evidence:he("Versions from the ConanCenter recipe index, and releases and changelogs from the upstream project the recipe builds \u2014 not from the recipe itself. ConanCenter publishes no deprecation signal, and OSV has no Conan ecosystem."),surface:he(p1),"static-analysis":he(f1),"upgrade-discovery":he("Conan version schemes are package-defined, so Drift can analyze exact version changes but does not invent an ordering to select a newer release automatically."),verify:he("Runs `conan build`, which is the compiler \u2014 in C and C++ an incompatible header change is a build failure rather than a runtime surprise.","Conan"),fix:ge(),"pull-request":ge()}},vcpkg:{ecosystem:"vcpkg",localizationBasis:"convention",label:"C / C++ (vcpkg)",files:["vcpkg.json","vcpkg-configuration.json"],managers:["vcpkg"],support:{detect:he("Reads declared dependencies, `version>=` floors, and `overrides`. A registry baseline moving changes every unpinned version at once; Drift reports the baseline move rather than resolving it to versions."),evidence:he("Versions from the vcpkg versions database, and releases and changelogs from the port's upstream project. vcpkg publishes no deprecation signal, and OSV has no vcpkg ecosystem."),surface:he(p1),"static-analysis":he(f1),"upgrade-discovery":he("vcpkg versions are port-defined and baseline resolution can change every dependency, so Drift analyzes exact overrides but does not invent an ordering or resolve baseline moves automatically."),verify:he("Runs the project's CMake build, which is where an incompatible header change surfaces.","CMake"),fix:ge(),"pull-request":ge()}},arduino:{ecosystem:"arduino",localizationBasis:"convention",label:"Arduino / PlatformIO",files:["library.properties","platformio.ini"],managers:["Arduino CLI","PlatformIO"],support:{detect:ge(),evidence:he("Versions and repositories from the Arduino Library Manager index, plus releases and changelogs from the library's own repository. A library published only to PlatformIO has metadata but no version history, because that registry serves only the current release."),surface:he(p1),"static-analysis":he(f1),"upgrade-discovery":ge(),verify:he("Runs `arduino-cli compile` or `pio run`, and `pio test` where the project has tests.","Arduino CLI or PlatformIO"),fix:ge(),"pull-request":ge()}}};function bUe(e){let t=ua.filter(s=>s.ecosystem===e),n={name:"example",version:"1.0.0",kind:"runtime"},i=t.filter(s=>s.upgrade(n)!==null),r=t.filter(s=>s.upgrade(n)===null);if(r.length===0)return ge();let o=s=>s.map(a=>a.label).join(", ");return i.length===0?tu(`${o(r)} ${r.length===1?"has":"have"} no command that pins a version \u2014 the coordinate lives in a build file the tool will not rewrite. Drift reports the version to set and where, and leaves the edit to you.`):he(`${o(i)} can install a chosen version directly. ${o(r)} cannot: the version lives in a build file the tool will not rewrite, so Drift tells you what to change instead of running something that silently changes nothing.`)}var vUe=Object.values(yUe).map(e=>({...e,support:{...e.support,"upgrade-install":bUe(e.ecosystem)}})),wUe=Object.fromEntries(vUe.map(e=>[e.ecosystem,e]));function wte(e){return wUe[e]}var g1=require("node:crypto");var Cf=3,h1=[Cf];function ri(e){return e===null||typeof e!="object"?JSON.stringify(e??null)??"null":Array.isArray(e)?`[${e.map(n=>ri(n)).join(",")}]`:`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>ni?1:0).map(([n,i])=>`${JSON.stringify(n)}:${ri(i)}`).join(",")}}`}function kUe(e){return{id:e.id,source:e.source,dependency:e.dependency,url:e.url??null,locator:e.locator??null,title:e.title,contentHash:(0,g1.createHash)("sha256").update(e.content).digest("hex"),weight:e.weight,findings:(e.findings??[]).map(t=>({code:t.code,symbol:t.symbol,detail:t.detail,before:t.before??null,after:t.after??null}))}}function $Ue(e){return{nature:e.nature,detectability:[...e.detectability].sort(),scope:e.scope,visibility:[...e.visibility].sort(),origin:e.origin}}function _Ue(e){return{schemaVersion:Cf,id:e.id,baseBranch:e.baseBranch,headSha:e.headSha,risk:e.risk,blockers:[...e.blockers],warnings:[...e.warnings],changes:e.changes.map(t=>({name:t.name,ecosystem:t.ecosystem,from:t.from,to:t.to,kind:t.kind,bump:t.bump,manifestPath:t.manifestPath,workspace:t.workspace??null})),breakingChanges:e.breakingChanges.map(t=>({id:t.id,dependency:t.dependency,kind:t.kind,summary:t.summary,remediation:t.remediation,symbols:[...t.symbols].sort(),replacementSymbols:[...t.replacementSymbols??[]].sort(),confidence:t.confidence,taxonomy:$Ue(Or(t)),assessment:t.assessment?{upstream:t.assessment.upstream.score,localImpact:t.assessment.localImpact.score,verification:t.assessment.verification.score,automaticExecutionEligible:t.assessment.automaticExecutionEligible,calibration:t.assessment.upstream.calibration}:null,citations:[...t.citations].sort()})),impactSites:e.impactSites.map(t=>({breakingChangeId:t.breakingChangeId,file:t.file,line:t.line,matchedSymbol:t.matchedSymbol,enclosingSymbol:t.enclosingSymbol??null,confidence:t.confidence})),commits:e.commits.map(t=>({id:t.id,order:t.order,message:t.message,body:t.body,breakingChangeIds:[...t.breakingChangeIds].sort(),files:[...t.files].sort(),allowedFiles:[...t.allowedFiles].sort(),allowedSymbols:[...t.allowedSymbols??[]].sort(),instructions:t.instructions,dependsOn:[...t.dependsOn].sort(),dependencyReasons:[...t.dependencyReasons].map(n=>({from:n.from,to:n.to,reason:n.reason,evidence:[...n.evidence].sort()})).sort((n,i)=>ri(n).localeCompare(ri(i))),executionLayer:t.executionLayer,expectedChecks:[...t.expectedChecks].map(n=>({id:n.id,kind:n.kind,command:n.command??null,reason:n.reason})).sort((n,i)=>ri(n).localeCompare(ri(i))),invalidationTriggers:[...t.invalidationTriggers].sort()})),planEdges:[...e.planEdges].map(t=>({from:t.from,to:t.to,reason:t.reason,evidence:[...t.evidence].sort()})).sort((t,n)=>ri(t).localeCompare(ri(n))),upgradeCohorts:[...e.upgradeCohorts].map(t=>({id:t.id,ecosystem:t.ecosystem,dependencies:[...t.dependencies].sort(),constraints:[...t.constraints].map(n=>({dependency:n.dependency,ecosystem:n.ecosystem,range:n.range,source:n.source})).sort((n,i)=>ri(n).localeCompare(ri(i))),candidatePaths:[...t.candidatePaths].sort(),reason:t.reason})).sort((t,n)=>t.id.localeCompare(n.id)),evidence:e.evidence.map(kUe),gaps:[...e.gaps].map(t=>({stage:t.stage,dependency:t.dependency??null,ecosystem:t.ecosystem??null,surface:t.surface,severity:t.severity,automaticExecution:t.automaticExecution})).sort((t,n)=>ri(t).localeCompare(ri(n)))}}function lx(e){return(0,g1.createHash)("sha256").update(ri(_Ue(e))).digest("hex")}function SUe(e,t,n){return t.breakingChangeId!==e.id||t.confidence!=="high"?!1:e.kind!=="runtime-requirement"?!0:n?.changeId===e.id&&n.state==="incompatible"&&t.runtimeVerdict==="incompatible"}function xUe(e){let t=new Set,n=[];for(let i of e){let r=`${i.file}:${i.line}:${i.column??""}:${i.matchedSymbol??""}`;t.has(r)||(t.add(r),n.push(i))}return n}function Pf(e,t,n,i,r=!0){let o=new Map;for(let s of n){let a=o.get(s.changeId);a?a.push(s):o.set(s.changeId,[s])}return e.map(s=>{let a=xUe(t.filter(d=>d.breakingChangeId===s.id)),c=o.get(s.id)??[],l=c.length===1?c[0]:void 0,u=a.filter(d=>SUe(s,d,l));if(s.kind==="runtime-requirement"){if(!l)return{changeId:s.id,state:"unknown",reason:"not-localized",sites:a,actionableSites:u};let d={changeId:s.id,sites:a,actionableSites:u,runtimeAnalysis:{runtime:l.runtime,state:l.state,reason:l.reason}};return l.state==="incompatible"?{...d,state:"actionable",reason:"runtime-incompatible"}:l.state==="partial"?{...d,state:"review-only",reason:"runtime-partial"}:l.state==="unknown"?{...d,state:"review-only",reason:"runtime-unknown"}:{...d,state:"unaffected",reason:"runtime-compatible"}}return u.length>0?{changeId:s.id,state:"actionable",reason:"high-confidence-impact",sites:a,actionableSites:u}:a.length>0?{changeId:s.id,state:"review-only",reason:"low-confidence-impact",sites:a,actionableSites:u}:i?r?{changeId:s.id,state:"unknown",reason:"impact-unresolved",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"localization-incomplete",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"not-localized",sites:[],actionableSites:[]}})}function kte(e){return e.assessment?_7(e.assessment):e.confidence}function ux(e){let{repo:t,config:n,changes:i,evidence:r,impactSites:o}=e,s=EUe(e),a=Pf(s,o,e.runtimeAnalyses??e.rationale?.flatMap(m=>m.runtimeAnalyses??[])??[],e.localizationRan??!0,e.localizationComplete??!0),c=hte({breakingChanges:s,impactSites:o,dispositions:a,config:n,changes:i,codemods:e.codemods,recipes:e.recipes,fixPlans:e.fixPlans}),l=c.commits,u=y1(i,s,o,(e.rationale??[]).map(m=>m.assessment.runtimeCompatibility),a),d=TUe(e,s,l),{blockers:p,warnings:f}=RUe(e,s,l,u,d);return{schemaVersion:Cf,id:St("plan",t.owner,t.repo,t.afterSha),branchName:AUe(n,i,t.afterSha),baseBranch:t.baseBranch,headSha:t.afterSha,changes:[...i],evidence:[...r],breakingChanges:s,upstreamBreakingCount:s.length,impactSites:[...o],dispositions:a,localizationRan:e.localizationRan??!0,localizationComplete:e.localizationComplete??!0,runtimeConfigComplete:e.runtimeConfigComplete??!0,commits:l,planEdges:c.edges,upgradeCohorts:c.cohorts,...e.rationale?{rationale:[...e.rationale]}:{},risk:u,gaps:d,checkedSurfaces:[...e.checkedSurfaces??[]],confirmedRegressions:[...e.confirmedRegressions??[]],blockers:[...c.blockers,...p],warnings:f,createdAt:new Date().toISOString()}}function EUe(e){let{evidence:t,breakingChanges:n,impactSites:i}=e,r=e.localizationRan??!0,o=e.localizationComplete??!0;return n.map(s=>{let a=i.filter(p=>p.breakingChangeId===s.id),c=Or(s),l=(e.runtimeAnalyses??[]).find(p=>p.changeId===s.id)?.state,u=(e.verification??[]).filter(p=>p.breakingChangeIds!==void 0?p.breakingChangeIds.includes(s.id):p.dependency===void 0?!0:p.dependency===s.dependency&&p.workspace===s.workspace),d=$7({change:s,taxonomy:c,evidence:t,sites:a,localizationRan:r,localizationComplete:o,runtimeState:l,outcomes:u,checkedSurfaces:e.checkedSurfaces??[],gaps:[]});return{...s,taxonomy:c,assessment:d}})}function TUe(e,t,n){let{changes:i,evidence:r,impactSites:o,config:s}=e,a=[],c=e.localizationRan??!0;c&&e.localizationComplete===!1&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:e.runtimeConfigComplete===!1?"Source localization was incomplete, and at least one authoritative runtime configuration file could not be indexed. Zero local API sites is not an exhaustive absence claim.":"Source localization reached its file limit. Runtime configuration was indexed completely, but zero local API sites is not an exhaustive absence claim.",severity:"blocking",automaticExecution:"blocks",remediation:"Raise the source indexing limit or narrow the scan to the relevant workspace."}),!c&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:'No checkout was available, so Drift could not search this repository for affected code. Zero impact sites here means "not searched", not "not affected".',severity:"blocking",automaticExecution:"blocks",remediation:"Run Drift as a GitHub Action or from the CLI in a checkout. The webhook runner cannot localize \u2014 see docs/deployment.md."});for(let u of i)r.filter(f=>f.dependency===u.name&&f.workspace===u.workspace).filter(f=>f.source!=="semver-heuristic"&&f.source!=="registry-metadata").length===0&&a.push({stage:"evidence",ecosystem:u.ecosystem,dependency:u.name,surface:"upstream release evidence",reason:`No changelog, release notes, migration guide, or API diff could be retrieved for ${u.name}. Drift will not dispatch a fix based on a version number alone.`,severity:"significant",automaticExecution:s.guardrails.requireEvidence&&t.length>0?"blocks":"degrades",remediation:"Check the package publishes release notes Drift can reach, or review this upgrade by hand."});for(let u of t)o.filter(p=>p.breakingChangeId===u.id).length>0||u_(Or(u))&&a.push({stage:"localize",dependency:u.dependency,surface:`reachability of ${u.symbols.slice(0,3).join(", ")||u.dependency}`,reason:`${u.summary} is only observable at runtime, so searching the source cannot establish whether this repository is affected.`,severity:"significant",automaticExecution:"degrades",remediation:"Confirm by exercising the affected paths, or review the upstream notes directly."});(e.verification??[]).filter(u=>!u.name.startsWith("behavioural:")).length===0&&n.length>0&&a.push({stage:"verify",surface:"build, typecheck, and test",reason:"No checks were run against this plan, so nothing confirms the findings were understood correctly or that a fix would compile.",severity:"significant",automaticExecution:"degrades",remediation:"Configure the repository checks Drift should run, or review the resulting pull request against CI before merging."});for(let u of[...new Set(i.map(d=>d.ecosystem))].sort()){let d=wte(u);for(let p of vte)d.support[p].level==="none"&&a.push({stage:IUe(p),ecosystem:u,surface:m1[p],reason:d.support[p].note??`${m1[p]} does not run for ${u}.`,severity:"significant",automaticExecution:"degrades",remediation:`Drift cannot run this stage for ${u}; review this surface by hand.`})}return a}function IUe(e){switch(e){case"detect":return"detect";case"evidence":case"surface":return"evidence";case"static-analysis":return"localize";case"verify":return"verify";default:return"plan"}}function AUe(e,t,n){return lte({changes:t},{branch:e.pullRequest.branchTemplate,prefix:e.remediation.branchPrefix})}function y1(e,t,n,i=[],r){let o=i.some(p=>p==="unknown"||p==="partial"),s=r?.some(p=>p.state==="review-only"||p.state==="unknown")??!1,a=r?r.flatMap(p=>p.actionableSites):n;if(t.length===0||a.length===0)return o||s?"low":"none";let c="low",l=p=>{N2(p,c)>0&&(c=p)},u=new Set(a.map(p=>p.file)).size;(u>5||a.length>20)&&l("medium"),(u>20||a.length>75)&&l("high");let d=new Set((r??[]).filter(p=>p.state!=="unaffected").map(p=>p.changeId));for(let p of t.filter(f=>d.size===0||d.has(f.id)))(p.kind==="behaviour-change"||p.kind==="default-change")&&l("high"),p.kind==="unknown"&&l("medium"),p.confidence==="low"&&l("medium");for(let p of e)p.bump==="major"&&l("medium"),Tg(p.from,p.to,p.ecosystem)&&l("high");return a.some(p=>$te(p.file))&&l("medium"),c}function RUe(e,t,n,i,r){let{config:o,changes:s,impactSites:a,skipped:c=[]}=e,l=o.guardrails,u=[],d=[],p=[...new Set(n.flatMap(_=>_.files))];p.length>l.maxFilesChanged&&u.push(`This plan would touch ${p.length} files, above the \`maxFilesChanged\` limit of ${l.maxFilesChanged}. A change this wide should be read by a person before an agent starts editing.`),s.length>l.maxDependenciesPerRun&&u.push(`${s.length} dependencies moved in one commit, above the \`maxDependenciesPerRun\` limit of ${l.maxDependenciesPerRun}. Batched upgrades make it hard to attribute a regression to the dependency that caused it.`);let f=p.filter(_=>Yo(l.protectedPaths,_));f.length>0&&u.push(`Impact sites fall inside protected paths: ${f.slice(0,5).join(", ")}${f.length>5?`, +${f.length-5} more`:""}. Drift will not direct an agent to edit these.`);let m=s.filter(_=>Yo(o.alwaysApprove,_.name));m.length>0&&u.push(`${m.map(_=>_.name).join(", ")} matched \`alwaysApprove\` in drift.yml.`);let g=new Set(n.flatMap(_=>_.breakingChangeIds)),h=t.filter(_=>g.has(_.id)&&!MF(kte(_),l.minConfidence));if(h.length>0){let _=h.slice(0,3).map(S=>`\`${S.dependency}\`: ${S.summary}`).join("; ");l.experimentalDispatchBelowMinConfidence?d.push(`${h.length} finding(s) are below the \`minConfidence\` threshold of \`${l.minConfidence}\` but \`experimentalDispatchBelowMinConfidence\` is on, so Drift will dispatch anyway. ${_}.`):u.push(`${h.length} finding(s) Drift planned commits for are below the \`minConfidence\` threshold of \`${l.minConfidence}\`: ${_}. The plan is filed for review rather than dispatched.`)}let b=t.filter(_=>!g.has(_.id)&&!MF(kte(_),l.minConfidence));b.length>0&&d.push(`${b.length} finding(s) are below the \`minConfidence\` threshold and no commit was planned for them. They are listed for awareness.`);let y=r.filter(_=>_.automaticExecution==="blocks");for(let _ of y)u.push(`${_.reason} ${_.remediation}`);mC(i,o.maxAutoRisk)||u.push(`Assessed risk is \`${i}\`, above the \`maxAutoRisk\` ceiling of \`${o.maxAutoRisk}\`.`);let w=a.filter(_=>$te(_.file));w.length>0&&d.push(`${w.length} impact site(s) are in test files. Confirm the fix updates tests to match the new API rather than weakening what they assert.`);let k=t.filter(_=>!a.some(S=>S.breakingChangeId===_.id));k.length>0&&d.push(`${k.length} breaking change(s) were identified upstream but no usage was found in this repository. They are listed for awareness and no commit was planned for them.`);for(let _ of c)d.push(`Skipped \`${_.change.name}\`: ${_.reason}.`);return{blockers:u,warnings:d}}function $te(e){let t=e.toLowerCase();return/(^|\/)(tests?|__tests__|spec|specs|e2e|integration_tests)\//.test(t)||/\.(test|spec)\.[jt]sx?$/.test(t)||/(^|\/)test_[^/]+\.py$/.test(t)||/_test\.(py|go|rb)$/.test(t)||/_spec\.rb$/.test(t)||/Test\.java$/.test(e)||/Tests?\.kt$/.test(e)}function _te(e,t){return t.mode!=="auto"||e.blockers.length>0||e.commits.length===0?!1:mC(e.risk,t.maxAutoRisk)}var Py=require("node:fs/promises"),io=require("node:path");async function Ste(e,t,n){let i=n.replace(/\\/g,"/").trim();if(!i||/[\n\r\0]/.test(i))return null;let r;try{r=await(0,Py.realpath)(e)}catch{return null}let o=(0,io.isAbsolute)(i)||/^[A-Za-z]:\//.test(i)?[i]:[...new Set([t?(0,io.join)(r,t,i):null,(0,io.join)(r,i)].filter(s=>s!==null))];for(let s of o){let a;try{if(a=await(0,Py.realpath)(s),!(await(0,Py.stat)(a)).isFile())continue}catch{continue}let c=(0,io.relative)(r,a);if(!(!c||c.startsWith("..")||(0,io.isAbsolute)(c))&&!c.split(io.sep).includes(".git"))return c.split(io.sep).join("/")}return null}var xte="https://api.osv.dev/v1/query",NUe="https://api.osv.dev/v1/querybatch",CUe="https://api.osv.dev/v1/vulns",Rte={npm:"npm",pypi:"PyPI",go:"Go",cargo:"crates.io",maven:"Maven",rubygems:"RubyGems",nuget:"NuGet",packagist:"Packagist",hex:"Hex",pub:"Pub",swift:"SwiftURL",cocoapods:null,opam:null,conan:null,vcpkg:null,arduino:null};async function Dy(e,t,n,i,r={}){let o=Rte[t];if(!o)return Uo(`OSV has no advisory coverage for ${t} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`);let s=r.fetch??jUe,[a,c]=await Promise.all([s(xte,dx(e,o,n)),s(xte,dx(e,o,i))]);return Nte(a,c,n,i,t)}async function Oy(e,t={}){let n=new Map,i=[];for(let a of e){let c=Rte[a.ecosystem];c?i.push({lookup:a,osvEcosystem:c}):n.set(a,Uo(`OSV has no advisory coverage for ${a.ecosystem} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`))}if(i.length===0)return n;if(i.length===1&&!t.batchFetch){let{lookup:a}=i[0];return n.set(a,await Dy(a.name,a.ecosystem,a.from,a.to,t)),n}if(t.fetch&&!t.batchFetch){let a=await Promise.all(i.map(({lookup:c})=>Dy(c.name,c.ecosystem,c.from,c.to,t)));return i.forEach(({lookup:c},l)=>n.set(c,a[l])),n}let r=i.flatMap(({lookup:a,osvEcosystem:c})=>[dx(a.name,c,a.from),dx(a.name,c,a.to)]),s=await(t.batchFetch??zUe)(r);if(nu(s)){for(let{lookup:a}of i)n.set(a,Uo(`${s.osvFailure}, so this upgrade's effect on known vulnerabilities is unknown.`));return n}for(let a=0;a!b1(d,a)),l=a.filter(d=>!b1(d,s)),u=s.filter(d=>b1(d,a));return{checked:!0,current:s,target:a,resolved:c,introduced:l,carried:u,direction:PUe(c,l)}}function dx(e,t,n){return{version:n,package:{name:e,ecosystem:t}}}function b1(e,t){let n=new Set([e.id,...e.aliases]);return t.some(i=>n.has(i.id)||i.aliases.some(r=>n.has(r)))}function PUe(e,t){return e.length>0&&t.length>0?"mixed":e.length>0?"improves":t.length>0?"worsens":"preserves"}function Uo(e){return{checked:!1,...e?{reason:e}:{},current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"}}function Ete(e,t,n="npm"){let i=e?.vulns;if(!Array.isArray(i))return[];let r=[];for(let o of i)!o.id||o.withdrawn||r.push({id:o.id,aliases:(o.aliases??[]).filter(s=>typeof s=="string"),summary:FUe(o.summary||o.details||"No summary published."),severity:OUe(o),url:LUe(o),fixedIn:MUe(o,t,n)});return Cte(r,n).sort((o,s)=>Tte[o.severity]-Tte[s.severity])}function Cte(e,t="npm"){let n=new Map,i=[];for(let r of e){let o=[r.id,...r.aliases],a=o.map(c=>n.get(c)).find(c=>c!==void 0)??i.push([])-1;i[a].push(r);for(let c of o)n.set(c,a)}return i.filter(r=>r.length>0).map(r=>{let o=r.find(a=>a.severity!=="unknown")??r[0],s=new Set(r.flatMap(a=>[a.id,...a.aliases]));return s.delete(o.id),{...o,aliases:[...s].sort(),fixedIn:DUe(r.map(a=>a.fixedIn),t),summary:r.find(a=>a.summary!=="No summary published.")?.summary??o.summary}})}function DUe(e,t){return e.filter(i=>!!i).map(i=>({raw:i,parsed:Te(i,t)})).filter(i=>i.parsed!==null).sort((i,r)=>Qe(i.parsed,r.parsed)??0)[0]?.raw??e.find(i=>!!i)??null}var Tte={critical:0,high:1,medium:2,low:3,unknown:4};function OUe(e){let t=e.database_specific?.severity??e.affected?.find(r=>r.database_specific?.severity)?.database_specific?.severity??e.affected?.find(r=>r.ecosystem_specific?.severity)?.ecosystem_specific?.severity;if(t){let r=t.toLowerCase();if(r==="critical")return"critical";if(r==="high")return"high";if(r==="moderate"||r==="medium")return"medium";if(r==="low")return"low"}let n=e.severity?.find(r=>r.score)?.score,i=n?Pte(n):null;return i===null?"unknown":i>=9?"critical":i>=7?"high":i>=4?"medium":"low"}function Pte(e){if(!/^CVSS:3\.[01]\//.test(e))return null;let t=new Map;for(let w of e.split("/").slice(1)){let[k,_]=w.split(":");k&&_&&t.set(k,_)}let n={N:.85,A:.62,L:.55,P:.2},i={L:.77,H:.44},r={N:.85,R:.62},o={H:.56,L:.22,N:0},s=t.get("S")==="C",a=s?{N:.85,L:.68,H:.5}:{N:.85,L:.62,H:.27},c=n[t.get("AV")??""],l=i[t.get("AC")??""],u=a[t.get("PR")??""],d=r[t.get("UI")??""],p=o[t.get("C")??""],f=o[t.get("I")??""],m=o[t.get("A")??""];if([c,l,u,d,p,f,m].some(w=>w===void 0))return null;let g=1-(1-p)*(1-f)*(1-m),h=s?7.52*(g-.029)-3.25*(g-.02)**15:6.42*g;if(h<=0)return 0;let b=8.22*c*l*u*d,y=Math.min(s?1.08*(h+b):h+b,10);return Math.ceil(y*10)/10}function MUe(e,t,n="npm"){let i=Te(t,n),r=[];for(let a of e.affected??[])for(let c of a.ranges??[])for(let l of c.events??[])l.fixed&&r.push(l.fixed);if(r.length===0)return null;let o=r.map(a=>({raw:a,parsed:Te(a,n)})).filter(a=>a.parsed!==null);return!i||o.length===0?r[0]??null:(o.filter(a=>(Qe(a.parsed,i)??-1)>0).sort((a,c)=>Qe(a.parsed,c.parsed)??0)[0]??o.sort((a,c)=>Qe(a.parsed,c.parsed)??0)[0])?.raw??null}function LUe(e){return e.references?.find(n=>n.type==="ADVISORY"&&n.url)?.url??`https://osv.dev/vulnerability/${e.id}`}function FUe(e){let t=e.replace(/\s+/g," ").trim(),n=t.search(/\.\s|\.$/),i=n>0?t.slice(0,n+1):t;return i.length>300?`${i.slice(0,299)}\u2026`:i}var Ite=1e4,Ate=2,UUe=200;function nu(e){return typeof e=="object"&&e!==null&&"osvFailure"in e}var jUe=async(e,t)=>Dte(e,t),zUe=async e=>{let t=Array.from({length:e.length},()=>({vulns:[]})),n=e.map((r,o)=>({query:r,index:o}));for(;n.length>0;){let r=await Dte(NUe,{queries:n.map(a=>a.query)});if(nu(r))return r;let o=r?.results;if(!Array.isArray(o)||o.length!==n.length)return{osvFailure:"OSV returned a malformed batch response"};let s=[];for(let a=0;a!!u?.id)),l.next_page_token&&s.push({index:c.index,query:{...c.query,page_token:l.next_page_token}})}n=s}let i=await GUe(t.flatMap(r=>r.vulns));return nu(i)?i:t.map(r=>({vulns:r.vulns.map(o=>i.get(o.id)??o)}))};async function GUe(e){let t=[...new Set(e.map(r=>r.id).filter(r=>!!r))],n=await Promise.all(t.map(async r=>{let o=await VUe(`${CUe}/${encodeURIComponent(r)}`);return nu(o)?o:[r,o]})),i=n.find(nu);return i||new Map(n)}async function Dte(e,t){return Ote(e,{method:"POST",body:JSON.stringify(t)})}async function VUe(e){return Ote(e,{method:"GET"})}async function Ote(e,t){let n=null;for(let i=0;i<=Ate;i+=1){let r=await BUe(e,t);if(!nu(r)||!r.transient||i===Ate)return r;n=r,await HUe(UUe*2**i)}return n??{osvFailure:"OSV could not be reached (network error)"}}async function BUe(e,t){let n=new AbortController,i=setTimeout(()=>n.abort(),Ite);try{let r=await fetch(e,{method:t.method,signal:n.signal,headers:{"Content-Type":"application/json","User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"},...t.method==="POST"?{body:t.body}:{}});return r.ok?await r.json():{osvFailure:r.status===429?"OSV rate-limited this scan (HTTP 429). Lowering `drift.analysis.concurrency` will fetch fewer advisories at once.":`OSV answered HTTP ${r.status} ${r.statusText}`.trim(),transient:r.status===408||r.status===429||r.status>=500}}catch(r){let o=r;return{osvFailure:o?.name==="AbortError"||o?.name==="TimeoutError"?`OSV did not answer within ${Ite/1e3}s${Mte(o)}`:`OSV could not be reached (${qUe(o)})`,transient:!0}}finally{clearTimeout(i)}}function qUe(e){return`${e?.message||"network error"}${Mte(e)}`}function Mte(e){let t=e?.cause;return t==null?"":`; cause: ${WUe(t)}`}function WUe(e){if(e instanceof Error)return e.message||e.name;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function HUe(e){return new Promise(t=>setTimeout(t,e))}var KUe=gt(Dc(),1);function w1(e){let{name:t,registry:n,repository:i,currentVersion:r,targetVersion:o}=e,s=e.now??new Date,a=[],c=o?.withdrawn??n?.deprecated??void 0;c&&a.push({statement:`The maintainer has withdrawn ${t} ${e.to}: ${c}`,url:n?.homepage??void 0,concerning:!0,polarity:"blocks"}),i?.archived?a.push({statement:"The upstream repository is archived. It will not receive further fixes.",url:i.url,concerning:!0,polarity:"blocks"}):i?.pushedAt&&a.push({statement:`The repository was last pushed to ${v1(i.pushedAt,s)}.`,url:i.url}),r?.withdrawn&&!c&&a.push({statement:`The version currently installed, ${e.from}, has been withdrawn: ${r.withdrawn}`,concerning:!0,polarity:"favors"});let l=YUe(n?.versions??[],e.ecosystem);if(l){let p=Te(e.to,e.ecosystem),f=Te(l,e.ecosystem),m=p&&f?Qe(f,p):null;m===0?a.push({statement:`${e.to} is the latest stable release.`}):m!==null&&m>0&&a.push({statement:`${e.to} is not the latest release; ${l} is also available.`})}o?.releasedAt&&a.push({statement:`The target version was released ${v1(o.releasedAt,s)}.`});let u=JUe(r,o);u&&a.push(u);let d=ZUe(e,l);return d&&a.push(d),{facts:a,...c?{deprecated:c}:{},...i?.archived?{archived:!0}:{},...l?{latestStable:l}:{},...o?.releasedAt?{targetReleasedAt:o.releasedAt}:{}}}function JUe(e,t){let n=e?.runtime,i=t?.runtime;return!i||n&&n.requirement===i.requirement?null:{statement:!n?`The target version requires ${i.name} ${i.requirement}.`:`The required ${i.name} version changed from ${n.requirement} to ${i.requirement}.`,concerning:!1,polarity:"context"}}function ZUe(e,t){let n=Te(e.from,e.ecosystem),i=t?Te(t,e.ecosystem):null;if(!n?.release||!i?.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let r=(i.release[0]??0)-(n.release[0]??0);return r<1?null:{statement:`The installed version ${e.from} is ${r} major version${r===1?"":"s"} behind the latest release, ${t}. Maintainers rarely backport fixes that far.`}}function YUe(e,t){return e.map(i=>Te(i,t)).filter(i=>i!==null&&!i.prerelease).sort((i,r)=>-(Qe(i,r)??0))[0]?.raw??null}function v1(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return`on ${e}`;let i=Math.floor((t.getTime()-n.getTime())/864e5);if(i<0)return`on ${n.toISOString().slice(0,10)}`;if(i===0)return"today";if(i===1)return"yesterday";if(i<60)return`${i} days ago`;let r=Math.round(i/30.44);return r<24?`about ${r} months ago`:`about ${Math.round(i/365.25)} years ago`}var QUe=12;async function $1(e){let{name:t,currentVersion:n,targetVersion:i,repository:r,policy:o}=e,s=n?.license??null,a=i?.license??r?.license??null,c=o.enabled?await XUe(e):[],l=p=>_1(p,o),u=c.filter(p=>!p.allowed),d=()=>`This upgrade newly introduces ${u.map(p=>`${p.name} (${p.license??"no declared license"})`).join(", ")}, which the repository policy does not permit.`;if(!a&&!s){if(!l(a)||u.length>0){let p=[];return l(a)||p.push(`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read. The repository policy requires a declared license.`),u.length>0&&p.push(d()),p.push(`The policy permits ${px(o)}.`),{verdict:"policy-violation",statement:p.join(" "),introduced:c}}return{verdict:o.enabled?"unknown":"ok",statement:o.enabled?`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read, so this upgrade's licensing position could not be checked.`:"No license metadata was published for either version.",introduced:c}}if(s&&a&&!tje(s,a)){let p=!l(a);if(p||u.length>0){let f=[];return f.push(p?`The declared license changed from ${s} to ${a}, which the repository policy does not permit.`:`The declared license changed from ${s} to ${a}.`),u.length>0&&f.push(d()),f.push(`The policy permits ${px(o)}.`),{verdict:"policy-violation",from:s,to:a,statement:f.join(" "),introduced:c}}return{verdict:"changed",from:s,to:a,statement:`The declared license changed from ${s} to ${a}. It remains within this repository's configured policy.`,introduced:c}}return l(a)?u.length>0?{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:`${d()} The policy permits ${px(o)}.`,introduced:c}:a?{verdict:"ok",...s?{from:s}:{},to:a,statement:`The license is unchanged at ${a}.`,introduced:c}:{verdict:"unknown",...s?{from:s}:{},statement:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}.`,introduced:c}:{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:a?`${t} is licensed ${a}, which the repository policy does not permit. The policy permits ${px(o)}.`:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}. The repository policy requires a declared license.`,introduced:c}}async function XUe(e){let{currentVersion:t,targetVersion:n,ecosystem:i,policy:r}=e;if(!t||!n)return[];let o=new Set(t.dependencies),s=n.dependencies.filter(c=>!o.has(c)).slice(0,QUe);return s.length===0?[]:await Promise.all(s.map(async c=>{let u=(await ca(c,i,"latest").catch(()=>null))?.license??null;return{name:c,license:u,allowed:_1(u,r)}}))}function _1(e,t){if(!t.enabled)return!0;if(!e)return!t.requireDeclared;let n=eje(e);return t.deny.length>0&&n.some(i=>k1(i,t.deny))?!1:t.allow.length===0?!0:e.includes(" OR ")?n.some(i=>k1(i,t.allow)):n.every(i=>k1(i,t.allow))}function eje(e){return e.replace(/[()]/g," ").split(/\s+(?:OR|AND|WITH)\s+/i).map(t=>t.trim()).filter(Boolean)}function k1(e,t){let n=e.toLowerCase().replace(/\+$/,"");return t.some(i=>i.toLowerCase().replace(/\+$/,"")===n)}function tje(e,t){let n=i=>i.toLowerCase().replace(/[\s._]/g,"-").replace(/-+/g,"-");return n(e)===n(t)}function px(e){return e.allow.length>0?e.allow.join(", "):e.deny.length>0?`anything except ${e.deny.join(", ")}`:"no licenses in particular"}var nje=[{category:"security",pattern:/\b(CVE-\d{4}-\d+|GHSA-[\w-]+|GO-\d{4}-\d+|security fix|vulnerabilit|XSS|CSRF|SSRF|remote code execution|prototype pollution|path traversal|SQL injection|denial of service|ReDoS)\b/i},{category:"breaking",pattern:/\b(BREAKING|breaking change|no longer|has been removed|was removed|is removed|removed entirely|removed support|dropped support|drop support|renamed to|has been renamed|is now required|must now|now (?:requires?|returns?|expects?|accepts?|takes?)|migrate to|migration guide|incompatible)\b/i},{category:"performance",pattern:/\b(faster|speed ?up|sped up|reduces? (?:the )?(?:allocation|memory|latency)|allocation|throughput|optimi[sz]|performance (?:improvement|gain|boost|work|regression)|improv(?:e|es|ed|ing) performance)\b/i},{category:"fix",pattern:/^\s*(?:fix(?:e[sd])?|bugfix|resolve[sd]?|correct(?:s|ed)?)\b/i}];function S1(e){let{dependency:t,evidence:n,breakingChanges:i,impactSites:r}=e,o=new Map;for(let u of r)o.set(u.breakingChangeId,(o.get(u.breakingChangeId)??0)+1);let s=[],a=new Set;for(let u of i){if(u.dependency!==t)continue;let d=o.get(u.id)??0,p=Ute(u.summary);a.has(p)||(a.add(p),s.push({category:"breaking",text:u.summary,...d>0?{affectedSites:d}:{},...Fte(u,n)?{url:Fte(u,n)}:{},...u.citations[0]?{citation:u.citations[0]}:{}}))}let c=0,l=new Map;for(let u of n)if(u.dependency===t&&!(u.source==="semver-heuristic"||u.source==="type-surface-diff"))for(let d of jte(u.content)){let p=Ute(d);if(!p||a.has(p))continue;a.add(p);let f=T1(d);if(f==="breaking"&&s.some(g=>ije(g.text,d)))continue;let m=l.get(f)??0;if(m>=6){c++;continue}l.set(f,m+1),s.push({category:f,text:d,...u.url?{url:u.url}:{},citation:u.id})}return{changes:rje(s),unrelated:c}}function x1(e){return e.changes.filter(t=>t.category==="performance").map(t=>({statement:t.text,...t.url?{url:t.url}:{},...t.citation?{citation:t.citation}:{}}))}function E1(e,t){if(e.length===0)return null;let n=e.filter(o=>o.kind==="package-added").length,i=e.length-n,r=[];return n>0&&r.push(`${n} new package${n===1?"":"s"}`),i>0&&r.push(`${i} new exported symbol${i===1?"":"s"}`),r.length===0?null:{statement:`The target version adds ${r.join(" and ")}, none of which can break existing code. Computed from ${t}.`}}function T1(e){for(let{category:t,pattern:n}of nje)if(n.test(e))return t;return"improvement"}var Lte={breaking:0,security:1,fix:2,performance:3,improvement:4};function rje(e){return[...e].sort((t,n)=>{let i=Lte[t.category]-Lte[n.category];return i!==0?i:(n.affectedSites??0)-(t.affectedSites??0)})}function jte(e){let t=[],n=null;for(let i of e.split(` -`)){let r=i.trim();if(!r||/^[-=]{3,}$/.test(r))continue;if(r.startsWith("#")){n=null;continue}let o=/^[-*+]\s+/.test(r)||/^\d+\.\s+/.test(r),s=r.replace(/^[-*+]\s+/,"").replace(/^\d+\.\s+/,"").trim();if(!(s.length<12)&&!/^(?:by\s+@|thanks|co-authored-by|https?:\/\/\S+$)/i.test(s)){if(!o&&/:\s*$/.test(s)&&T1(s)==="breaking"){n=s;continue}t.push(oje(n&&o?`${n} ${s}`:s,240)),!o&&!/:\s*$/.test(s)&&(n=null)}}return t}function Fte(e,t){for(let n of e.citations){let i=t.find(r=>r.id===n)?.url;if(i)return i}}function ije(e,t){let n=r=>new Set(r.match(/`([^`]+)`/g)??[]),i=n(e);return i.size===0?!1:[...n(t)].some(r=>i.has(r))}function Ute(e){return e.toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}function oje(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var zte={critical:0,high:1,medium:2,low:3,unknown:4};function I1(e,t){return zte[e]-zte[t]}function A1(e){return e.reduce((t,n)=>I1(n.severity,t)<0?n.severity:t,"unknown")}var sje=new Set(["behaviour-change","signature-change","default-change","moved-export","runtime-requirement"]);function My(e){let t=[],{security:n,maintenance:i,license:r,impactSites:o}=e,s=o.length,a=new Set(o.map(F=>F.file)).size,c=new Map(e.breakingChanges.map(F=>[F.id,F])),l=o.filter(F=>c.get(F.breakingChangeId)?.kind!=="runtime-requirement"),u=new Set(l.map(F=>F.file)).size,d=o.filter(F=>c.get(F.breakingChangeId)?.kind==="runtime-requirement"),p=e.breakingChanges.filter(F=>F.kind==="runtime-requirement"&&F.runtime?.runtime),f=tx(e.breakingChanges,e.runtimeAnalyses??[]),m=QF(f),g=p.length>0&&XF(m??"unknown"),h=p.length>0?m??"unknown":void 0,b=Pf(e.breakingChanges,o,f,e.localizationRan??!0,e.localizationComplete??!0),y=new Set(b.filter(F=>F.state==="actionable").map(F=>F.changeId)),w=e.breakingChanges.filter(F=>y.has(F.id)),k=new Set(b.flatMap(F=>F.actionableSites.map(K=>`${K.breakingChangeId}:${K.file}:${K.line}`))),_=l.filter(F=>!k.has(`${F.breakingChangeId}:${F.file}:${F.line}`)),S=w.filter(F=>sje.has(F.kind)),x=w.length-S.length,E=Df(e.breakingChanges);n.checked&&(n.resolved.length>0&&t.push(`Fixes ${n.resolved.length} known ${wr(n.resolved.length,"vulnerability","vulnerabilities")} (worst: ${A1(n.resolved)}).`),n.introduced.length>0&&t.push(`Introduces ${n.introduced.length} known ${wr(n.introduced.length,"vulnerability","vulnerabilities")} not present in the installed version (worst: ${A1(n.introduced)}).`),n.carried.length>0&&t.push(`${n.carried.length} known ${wr(n.carried.length,"vulnerability affects","vulnerabilities affect")} both versions; this upgrade does not address ${n.carried.length===1?"it":"them"}.`),n.resolved.length===0&&n.target.length===0&&t.push("No known vulnerabilities were found for the target version."));let T=l.filter(F=>k.has(`${F.breakingChangeId}:${F.file}:${F.line}`));T.length>0&&t.push(E?`${T.length} ${wr(T.length,"place","places")} in ${new Set(T.map(F=>F.file)).size} ${wr(new Set(T.map(F=>F.file)).size,"file","files")} match${T.length===1?"es":""} ${E} entries this upgrade changes.`:`${T.length} ${wr(T.length,"place","places")} in ${new Set(T.map(F=>F.file)).size} ${wr(new Set(T.map(F=>F.file)).size,"file","files")} use${T.length===1?"s":""} an API this upgrade changes.`),_.length>0&&t.push(`${_.length} local API match${_.length===1?"":"es"} require review; Drift did not establish a safe edit.`);for(let F of f)t.push(F.statement);if(d.length>0&&f.length===0&&t.push(...uje(d)),s>0)x>0&&t.push(`${x} of the locally affected changes can be applied mechanically.`),S.length>0&&t.push(`${S.length} locally affected ${wr(S.length,"change requires","changes require")} a developer decision rather than a substitution.`);else if(e.breakingChanges.some(F=>F.kind!=="runtime-requirement")&&!g){let F=e.breakingChanges.filter(K=>K.kind!=="runtime-requirement").length;t.push(E?`${F} published ${E} ${wr(F,"change","changes")} require review; these package-role contracts are assessed independently of source call signatures.`:`${F} upstream API breaking ${wr(F,"change","changes")}; no usage of the changed parts was located in this repository \u2014 review before upgrading.`)}for(let F of i.facts)F.concerning&&t.push(F.statement);r.verdict==="policy-violation"&&t.push(r.statement);let A=aje(e,{affected:s,decisions:S.length,actionable:w.length>0,runtimeUnresolved:g,localizationUnresolved:b.some(F=>F.reason==="localization-incomplete"||F.reason==="impact-unresolved"),roleContractChanged:E!==null}),L=cje(e);return e.gaps.length>0&&t.push(...e.gaps),{recommendation:A,reasons:t,confidence:L.level,confidenceBasis:L.basis,...h?{runtimeCompatibility:h}:{}}}function aje(e,t){let{security:n,maintenance:i,license:r}=e;if(n.checked&&n.introduced.length>0||i.deprecated||r.verdict==="policy-violation"||i.facts.some(a=>a.polarity==="blocks"))return"do-not-upgrade-yet";if(t.affected>0)return t.actionable&&t.decisions>0?"manual-migration-required":"upgrade-after-review";if(t.runtimeUnresolved||t.localizationUnresolved||t.roleContractChanged)return"upgrade-after-review";let o=n.checked&&n.resolved.length>0,s=i.facts.some(a=>a.polarity==="favors");return e.breakingChanges.length===0&&!R1(e)?o||s?"upgrade-recommended":"insufficient-evidence":o||s?"upgrade-recommended":"safe-to-upgrade"}function R1(e){return e.surfaceCompared||(e.proseRead??0)>0||Vte(e).length>0}function Vte(e){return e.evidence.filter(t=>t.dependency===e.dependency&&t.workspace===e.workspace&&(t.source==="github-release"||t.source==="changelog"||t.source==="migration-guide"))}function cje(e){let t=Math.max(Vte(e).length,e.proseRead??0),n=[];if(e.surfaceCompared){let r=Df(e.breakingChanges);n.push(r?`the computed ${r} diff`:"the computed API diff")}return t>0&&n.push(t===1?"release notes":"release notes and changelog"),e.security.checked&&n.push("the OSV advisory database"),n.length===0?{level:"low",basis:"Nothing but the version numbers could be read for this dependency."}:{level:e.surfaceCompared||n.length>=2?"high":"medium",basis:n.length===1?`${Gte(n[0])} is the available evidence.`:`${Gte(lje(n))} agree.`}}function Df(e){let t=e.filter(n=>n.kind!=="runtime-requirement");return t.length===0?null:t.every(n=>n.symbols.some(i=>i.startsWith("pom:")))?"Maven POM contract":t.every(n=>n.symbols.some(i=>i.startsWith("nuget:")))?"NuGet package contract":t.every(n=>n.symbols.some(i=>i.startsWith("pub:")))?"Pub package contract":null}function lje(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function Gte(e){return e.charAt(0).toUpperCase()+e.slice(1)}function uje(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),i=e.filter(o=>o.runtimeVerdict==="partial"),r=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime ${wr(o,"declaration","declarations")} in this repository ${wr(o,"does not satisfy","do not satisfy")} this upgrade's runtime requirement.`)}if(i.length>0){let o=i.length;t.push(`${o} runtime ${wr(o,"declaration allows","declarations allow")} versions this upgrade's runtime requirement rejects.`)}if(r.length>0){let o=r.length;t.push(`${o} runtime ${wr(o,"declaration is","declarations are")} dynamically defined; Drift could not determine whether ${wr(o,"it satisfies","they satisfy")} this upgrade's runtime requirement.`)}return t}function wr(e,t,n){return e===1?t:n}var ru={"safe-to-upgrade":"Safe to upgrade","upgrade-recommended":"Upgrade recommended","upgrade-after-review":"Upgrade after review","manual-migration-required":"Migration required","insufficient-evidence":"Insufficient evidence","do-not-upgrade-yet":"Do not upgrade yet"};var dje={"rate-limited":"rate limited","server-error":"server error","network-error":"network error"};async function N1(e,t){return Br("rationale.prepare",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to},async()=>{let{config:n}=t,i=e.from,r=e.to,o=h=>t.onProgress?.(h);o("Checking package metadata");let s=Wn(e.name,e.ecosystem,r),a=ca(e.name,e.ecosystem,i).catch(()=>null),c=ca(e.name,e.ecosystem,r).catch(()=>null),l=n.rationale.security?(t.securityLookup??Promise.resolve(t.security).then(h=>h?.get(e)).then(h=>h??Dy(e.name,e.ecosystem,i,r,t.osv??{}))).catch(h=>Uo(`Advisory lookup failed unexpectedly (${h instanceof Error?h.message:String(h)}), so this upgrade's effect on known vulnerabilities is unknown.`)):Promise.resolve(Uo("Advisory lookup is switched off for this repository (`rationale.security`), so this upgrade\u2019s effect on known vulnerabilities was not checked.")),u=await s;o("Checking repository status");let d=u?.githubRepo?await YH(u.githubRepo,t.githubToken,(h,b)=>o(`Checking repository status (${dje[b]}, retrying \u2014 attempt ${h})`)).catch(()=>null):null;o("Checking security advisories");let[p,f,m]=await Promise.all([a,c,l]);o("Checking license");let g=await $1({name:e.name,ecosystem:e.ecosystem,from:i,to:r,currentVersion:p,targetVersion:f,repository:d,policy:n.licenses});return{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}})}async function fx(e,t){let n=e.changes.filter(s=>s.from&&s.to),i=n.filter(s=>!t.preparedFacts?.has(s)),r=i.map(s=>({name:s.name,ecosystem:s.ecosystem,from:s.from,to:s.to})),o=t.config.rationale.security?Oy(r,t.osv??{}).then(s=>new Map(i.map((a,c)=>[a,s.get(r[c])]))):void 0;return qn(n,4,async s=>{try{return await pje(s,e,{...t,security:o})}catch(a){return t.logger.debug(`Rationale failed for ${s.name}: ${a.message}`),bje(s,`Drift could not assemble an upgrade rationale for ${s.name}.`)}})}async function pje(e,t,n){let i=s=>n.onProgress?.(e,s),r=n.preparedFacts?.get(e),o=await(r??N1(e,{config:n.config,...n.githubToken?{githubToken:n.githubToken}:{},...n.osv?{osv:n.osv}:{},...n.security?{security:n.security}:{},onProgress:i}));return fje(e,t,o,n,{shared:r!==void 0})}async function fje(e,t,n,i,r){return Br("rationale.finalize",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to,shared:r?.shared??i.preparedFacts?.has(e)??!1},async()=>{let{config:o,logger:s}=i,a=e.from,c=e.to,l=D=>i.onProgress?.(e,D),{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}=n,h=t.breakingChanges.filter(D=>D.dependency===e.name&&D.workspace===e.workspace),b=new Set(h.map(D=>D.id)),y=t.impactSites.filter(D=>b.has(D.breakingChangeId)),w=(t.runtimeAnalyses??[]).filter(D=>b.has(D.changeId));l("Checking maintenance signals");let k=o.rationale.maintenance?w1({name:e.name,ecosystem:e.ecosystem,from:a,to:c,registry:u,repository:d,currentVersion:p,targetVersion:f,repoRuntime:(e.workspace!==void 0?i.repoRuntimeByWorkspace?.get(e.workspace):void 0)??i.repoRuntime,pythonRuntime:(e.workspace!==void 0?i.pythonRuntimeByWorkspace?.get(e.workspace):void 0)??i.pythonRuntime,analyzedRuntimeRequirements:w.map(D=>({runtime:D.runtime,requirement:D.requirement}))}):{facts:[]},_=cn(e),S=i.additions?.get(_),x=i.surfaceCompared?.has(_)??S!==void 0,E=o.rationale.summary?S1({dependency:e.name,evidence:t.evidence,breakingChanges:h,impactSites:y,additions:S?.additions}):{changes:[],unrelated:0},T=[...x1(E)],A=S?E1(S.additions,S.locator):null;A&&T.push(A);let L=i.prose?.get(_)??i.prose?.get(e.name)??[],F=mje(e,{surfaceCompared:x,surfaceGap:i.surfaceGaps?.get(_),security:m,registry:u,evidence:t.evidence,prose:L,licenseUnknown:g.verdict==="unknown"}),K={dependency:e.name,workspace:e.workspace,breakingChanges:h,impactSites:y,evidence:t.evidence,security:m,maintenance:k,license:g,gaps:F,surfaceCompared:x,proseRead:L.length,runtimeAnalyses:w,localizationRan:t.localizationRan,localizationComplete:t.localizationComplete},te=My(K);return s.debug(`${e.name} ${a} \u2192 ${c}: ${te.recommendation}`),{dependency:e.name,from:a,to:c,security:m,maintenance:k,improvements:T,license:g,summary:E,assessment:te,runtimeAnalyses:w.map(({changeId:D,runtime:X,requirement:re,state:ie,reason:ke,statement:We})=>({changeId:D,runtime:X,requirement:re,state:ie,reason:ke,statement:We})),gaps:F,hasCompatibilityEvidence:R1(K)}})}function mje(e,t){let n=[],i=t.evidence.filter(s=>s.dependency===e.name&&s.workspace===e.workspace&&(s.source==="github-release"||s.source==="changelog"||s.source==="migration-guide")),r=t.surfaceGap,o=i.length>0?null:t.prose.length>0?t.surfaceCompared?null:`Drift read ${hje(t.prose)} for ${e.name} ${e.to} and found nothing in ${t.prose.length===1?"it":"them"} that announces a breaking change. That is weaker than a clean API comparison: it means nothing was flagged, not that nothing broke.`:`No release notes, changelog, or migration guide was reachable for ${e.name} ${e.to}${t.registry?.githubRepo?"":", and no source repository could be resolved for it"}.`;return r&&o?n.push(`${qte(r.detail)}. ${o}${r.remedy?` ${r.remedy}`:""}`):r?n.push(`${qte(r.detail)}.${r.remedy?` ${r.remedy}`:""}`):o&&n.push(o),t.security.checked||n.push(t.security.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."),yje(n)}var gje={"github-release":{one:"the release notes",many:"sets of release notes"},changelog:{one:"the changelog",many:"changelog files"},"migration-guide":{one:"the migration guide",many:"migration guides"}};function hje(e){let t=i=>e.filter(r=>r.kind===i),n=[];for(let i of["github-release","changelog","migration-guide"]){let r=t(i);if(r.length===0)continue;let o=gje[i];if(r.length===1){n.push(`${o.one} (${Bte(r[0])})`);continue}n.push(`${r.length} ${o.many} (${r.map(Bte).join(", ")})`)}return n.length===0?"the published release prose":n.length===1?n[0]:`${n.slice(0,-1).join(", ")} and ${n.at(-1)}`}function Bte(e){return`[${e.label}](${e.url})`}function yje(e){let t=new Set,n=[];for(let i of e){let r=i.toLowerCase().replace(/[^a-z0-9]+/g," ").trim();t.has(r)||(t.add(r),n.push(i))}return n}function qte(e){return e.replace(/\.\s*$/,"")}function bje(e,t){return{dependency:e.name,from:e.from??"",to:e.to??"",security:{checked:!1,current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"},maintenance:{facts:[]},improvements:[],license:{verdict:"unknown",statement:"Not checked.",introduced:[]},summary:{changes:[],unrelated:0},hasCompatibilityEvidence:!1,assessment:{recommendation:"insufficient-evidence",reasons:[t],confidence:"low",confidenceBasis:t},gaps:[t]}}var Kte=require("node:crypto"),Ni=require("node:fs/promises"),gx=require("node:os"),iu=require("node:path"),Jte=require("node:url"),Zte=require("node:child_process");var Aje={},Yte="behavioural-diff-npm-ts-v1",vje=new Set(["behaviour-change","default-change","type-change","signature-change","required-field-added"]);function wje(e,t){let n=t.verification.behavioural;if(!n.enabled)return[];let i=[];for(let r of e.breakingChanges){if(!vje.has(r.kind))continue;let o=e.impactSites.filter(a=>a.breakingChangeId===r.id);if(o.length===0)continue;let s=Or(r);if(!(!s.nature.includes("behaviour")&&s.nature!=="type-contract"&&r.kind!=="default-change"))for(let a of r.symbols.slice(0,n.maxSymbols-i.length)){let c=_je(r),l=[{id:"default",args:[],contracts:c}],u=new Set;for(let d of o){if(l.length>=n.maxCasesPerSymbol)break;if(d.matchedSymbol!==a)continue;let p=kje(d.excerpt,a);if(!p)continue;let f=JSON.stringify(p);u.has(f)||(u.add(f),l.push({id:`site-${l.length}`,args:p,contracts:c}))}if(i.push({dependency:r.dependency,workspace:r.workspace,symbol:a,modulePath:"",exportName:a,cases:l}),i.length>=n.maxSymbols)return i}}return i}function kje(e,t){let i=new RegExp(`\\b${$je(t)}\\s*\\(([^;]*)\\)`).exec(e);if(!i)return null;let r=i[1].trim();if(r==="")return[];let o=`[${r}]`.replace(/'/g,'"').replace(/([{,]\s*)([A-Za-z_$][\w$]*)\s*:/g,'$1"$2":');try{let s=JSON.parse(o);return Array.isArray(s)?s:null}catch{return null}}function $je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _je(e){switch(e.kind){case"default-change":return["configured-defaults","return-shape"];case"type-change":case"signature-change":case"required-field-added":return["return-shape","thrown-error","argument-mutation","promise-state"];case"behaviour-change":return["return-shape","thrown-error","argument-mutation","promise-state","serialization-output"];default:return["return-shape"]}}async function Sje(e){let{config:t,oldEnvironment:n,newEnvironment:i}=e,r=e.probes.slice(0,t.maxSymbols),o=[],s=[];if(!t.enabled)return{evidence:[],observations:[],gaps:["behavioural probing disabled"]};if(t.sandbox!=="required")return{evidence:[],observations:[],gaps:["behavioural probing requires a sandbox"]};for(let a of r){let c=a.cases.slice(0,t.maxCasesPerSymbol);for(let l of c){let u=await mx(t,n,a,l),d=await mx(t,n,a,l),p=await mx(t,i,a,l),f=await mx(t,i,a,l),m=!C1(u,d)||!C1(p,f);o.push({dependency:a.dependency,workspace:a.workspace,symbol:a.symbol,caseId:l.id,generatedInput:l.args,oldResult:u,newResult:p,observedDifference:m?"nondeterministic result; no compatibility conclusion drawn":Eje(u,p),nondeterministic:m,limitations:Tje(t,l.contracts)})}}return{observations:o,gaps:s,evidence:o.map(Qte)}}async function xje(){return typeof __dirname<"u"?(0,iu.join)(__dirname,"behavioural-worker.js"):(0,Jte.fileURLToPath)(new URL("./behavioural-worker.js",Aje.url))}async function mx(e,t,n,i){let r=await(0,Ni.mkdtemp)((0,iu.join)((0,gx.tmpdir)(),"drift-behavioural-")),o=await(0,Ni.realpath)(r),s=(0,iu.join)(r,"case.json"),a=await(0,Ni.realpath)(await xje()),c=(0,iu.resolve)(t.modulePath||n.modulePath),l=await(0,Ni.realpath)(c),u=(0,iu.resolve)(t.packageRoot);await(0,Ni.writeFile)(s,JSON.stringify({modulePath:l,exportName:n.exportName,args:i.args,network:e.network}));let d=[a,u,await(0,Ni.realpath)(u),c,l,s,await(0,Ni.realpath)(s)],p=[Number(process.versions.node.split(".")[0])>=24?"--permission":"--experimental-permission",...[...new Set(d)].map(f=>`--allow-fs-read=${f}`),`--max-old-space-size=${e.memoryMb}`,a,s];try{return await new Promise(f=>{let m=(0,Zte.spawn)(process.execPath,p,{stdio:["ignore","pipe","pipe"],env:{PATH:process.env.PATH??"",HOME:o,TMPDIR:o,DRIFT_BEHAVIOURAL_SANDBOX:"1"}});if(m.pid&&e.cpuLimit<1)try{(0,gx.setPriority)(m.pid,Math.round(10*(1-e.cpuLimit)))}catch{}let g="",h="",b=64*1024,y=setTimeout(()=>{m.kill("SIGKILL")},e.timeoutSeconds*1e3);m.stdout.on("data",w=>{g=(g+w.toString("utf8")).slice(-b)}),m.stderr.on("data",w=>{h=(h+w.toString("utf8")).slice(-b)}),m.on("close",(w,k)=>{if(clearTimeout(y),k){f({status:"timed-out",signal:k,stdoutDigest:Ly(g),stderrDigest:Ly(h)});return}let _=g.trim().split(` -`).at(-1)??"",S=Ije(_);f(S??{status:"worker-failed",stdoutDigest:Ly(g),stderrDigest:Ly(h)})}),m.on("error",w=>{clearTimeout(y),f({status:"worker-failed",error:{name:w.name,messageCategory:"spawn"}})})})}finally{e.retainArtifacts||await(0,Ni.rm)(r,{recursive:!0,force:!0}).catch(()=>{})}}function C1(e,t){return JSON.stringify(Wte(e))===JSON.stringify(Wte(t))}function Wte(e){return{status:e.status,value:e.value??null,error:e.error??null,mutations:e.mutations??[]}}var Hte=new Set(["worker-failed","timed-out"]);function Eje(e,t){return Hte.has(e.status)&&Hte.has(t.status)?`probe unavailable: neither version could be observed (${e.status})`:C1(e,t)?"no observed difference for this contract and generated input domain":e.status!==t.status?`status changed from ${e.status} to ${t.status}`:JSON.stringify(e.value??null)!==JSON.stringify(t.value??null)?"returned value changed":JSON.stringify(e.error??null)!==JSON.stringify(t.error??null)?"thrown error changed":JSON.stringify(e.mutations??[])!==JSON.stringify(t.mutations??[])?"argument mutation changed":"observable result changed"}function Tje(e,t){let n=[`Harness ${Yte}; bounded to ${t.join(", ")||"return-shape"} contracts.`,"No observed difference is not proof of behavioural compatibility outside these generated inputs.",`CPU limit requested: ${e.cpuLimit} (best-effort process priority; no OS-level quota). Node subprocess enforces wall-clock, memory, output, filesystem, and network policy, and cannot spawn its own children or threads \u2014 the wall-clock timeout is the actual hard bound on CPU consumption.`];return e.network||n.push("Network APIs were disabled for the probe."),n}function Qte(e){let t=JSON.stringify({generatedInput:e.generatedInput,normalizedOldResult:e.oldResult,normalizedNewResult:e.newResult,observedDifference:e.observedDifference,testHarnessVersion:Yte,nondeterminismHandling:e.nondeterministic?"Repeated runs disagreed, so Drift records the observation but draws no compatibility conclusion.":"Old and new observations were repeated once and matched within each version.",limitations:e.limitations},null,2);return{id:`ev_behaviour_${Ly(`${e.workspace??""}:${e.dependency}:${e.symbol}:${e.caseId}`).slice(0,12)}`,source:"behavioural-diff",dependency:e.dependency,...e.workspace!==void 0?{workspace:e.workspace}:{},locator:`${e.symbol}:${e.caseId}`,title:`Behavioural differential probe for ${e.symbol}`,content:t,weight:e.observedDifference.startsWith("probe unavailable")?0:e.observedDifference.startsWith("no observed difference")?.25:.8,findings:[{code:"behavioural-observation",symbol:e.symbol,detail:e.observedDifference}]}}async function Xte(e){let t=e.config.verification.behavioural,n=[],i=new Map,r=[];if(!t.enabled)return{evidence:n,citationsByChangeId:i,gaps:r};let o=wje({breakingChanges:e.breakingChanges,impactSites:e.impactSites},e.config);if(o.length===0)return{evidence:n,citationsByChangeId:i,gaps:r};let s=new Map;for(let a of o){let c=zc({name:a.dependency,workspace:a.workspace}),l=s.get(c);l?l.probes.push(a):s.set(c,{dependency:a.dependency,workspace:a.workspace,probes:[a]})}for(let{dependency:a,workspace:c,probes:l}of s.values()){let u=e.dependencyChanges.find(f=>f.name===a&&f.workspace===c&&f.ecosystem==="npm");if(!u?.from||!u.to){r.push(`${a}: behavioural probing needs both a resolved old and new version; skipped.`);continue}let d=await e.resolveEnvironments(u);if(!d){r.push(`${a}: could not resolve ${u.from} and ${u.to} to executable code for behavioural probing; skipped.`);continue}let p=await Sje({config:t,probes:l,oldEnvironment:d.oldEnvironment,newEnvironment:d.newEnvironment});r.push(...p.gaps);for(let f of p.observations){let m=Qte(f);n.push(m);for(let g of e.breakingChanges){if(g.dependency!==a||g.workspace!==c||!g.symbols.includes(f.symbol))continue;let h=i.get(g.id);h?h.push(m.id):i.set(g.id,[m.id])}}}return{evidence:n,citationsByChangeId:i,gaps:r}}function ene(e){return e.startsWith("probe unavailable")?"probe-unavailable":e.startsWith("no observed difference")?"no-difference":e.includes("returned value changed")?"return-value":e.startsWith("status changed")?"thrown-error":e.includes("argument mutation")?"argument-mutation":"behaviour"}function Ije(e){try{return JSON.parse(e)}catch{return null}}function Ly(e){return(0,Kte.createHash)("sha256").update(e).digest("hex")}var oo=require("node:fs/promises"),nne=require("node:os"),ou=require("node:path");function Rje(e){return Nje(e.exports)??e.module??e.main??"index.js"}function Nje(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e,n="."in t?t["."]:t,i=(r,o)=>{if(o>6||r==null)return null;if(typeof r=="string")return r;if(typeof r!="object")return null;let s=r;for(let a of["import","require","default","node"]){if(!(a in s))continue;let c=i(s[a],o+1);if(c)return c}return null};return i(n,0)}var tne="https://cdn.jsdelivr.net/npm";async function P1(e,t,n){let i=await $e(`${tne}/${t}@${n}/package.json`);if(!i)return null;let r=Rje(i).replace(/^\.\//,""),o=await rt(`${tne}/${t}@${n}/${r}`);if(o===null)return null;let s=await(0,oo.mkdtemp)((0,ou.join)((0,nne.tmpdir)(),"drift-behavioural-env-")),a=(0,ou.join)(s,r);return await(0,oo.mkdir)((0,ou.dirname)(a),{recursive:!0}),await(0,oo.writeFile)(a,o),await(0,oo.writeFile)((0,ou.join)(s,"package.json"),JSON.stringify(i)),{label:e,packageRoot:await(0,oo.realpath)(s),modulePath:await(0,oo.realpath)(a)}}var Tx=require("node:path");function D1(){return{probes:new Map}}function Cje(e,t,n,i){let r=Pje(t,n),o=i?.probes.get(r);if(o)return o;let s=e(t,["--version"],{timeoutMs:2e4,...n?{env:n}:{}}).then(a=>a.failure!=="not-found").catch(()=>!0);return i?.probes.set(r,s),s}async function rne(e,t,n,i){let r=[...new Set(t)],o=await Promise.all(r.map(s=>Cje(e,s,n,i)));return new Map(r.map((s,a)=>[s,o[a]]))}function Pje(e,t){let n=t??process.env,i=n.PATH??n.Path??n.path??"",r=n.PATHEXT??n.PathExt??"";return JSON.stringify([e,i,r,process.platform])}var hx=require("node:os");function yx(){try{return Math.max(1,(0,hx.availableParallelism)())}catch{return 4}}function Dje(){try{return Math.max(2,Math.floor((0,hx.totalmem)()/(512*1024*1024)))}catch{return 8}}function O1(e,t,n){return Math.max(t,Math.min(n,Math.floor(e)))}function M1(e,t){let n=t[e];if(!n)return;let i=Number(n);return Number.isFinite(i)&&i>=1?Math.floor(i):void 0}function bx(e=process.env){return M1("DRIFT_NETWORK_CONCURRENCY",e)??O1(yx()*4,8,32)}function L1(e=process.env){return M1("DRIFT_CONCURRENCY",e)??O1(Math.min(yx()*2,Dje()),4,16)}function vx(e=process.env){return M1("DRIFT_LOCAL_CONCURRENCY",e)??O1(yx()/4,2,6)}function ine(e=process.env){return`${yx()} cores \xB7 ${bx(e)} network, ${L1(e)} analysis, ${vx(e)} local`}var F1=require("node:crypto");var Oje=1,wvt=10080*60*1e3;function one(e){let t=(0,F1.createHash)("sha256");t.update(`v${Oje} +`);if(f.length!==m.length)return o.debug(`${t.name} changed the line count of ${d}; that is not expressible as a Drift operation.`),null;for(let g=0;g0?(o.info(`Drift could not re-derive what ${t.name}@${t.version} did to ${u.unexplained.length||c.length} line(s), so it will not apply it. This finding falls through to an agent.`),null):(l&&o.info(`${t.name}@${t.version} also changed files outside this finding's call sites; those edits were not learned from and will not be applied.`),Kj({change:n,dependencyChange:e.dependencyChange,migration:t.migration,rationale:`Inferred from ${c.length} edit(s) made by ${t.name}@${t.version} in an isolated worktree, then re-derived as Drift operations. The recipe's own output was discarded.`,citations:[],ops:u.ops,provenance:{author:"recipe",recipe:{name:t.name,version:t.version,publisher:t.publisher,source:t.source},authoredAt:new Date().toISOString()}}))}async function jze(e,t,n){let r=await n("git",["show",`HEAD:${t}`],{cwd:e});if(r.code!==0)return null;try{return{before:r.stdout,after:await(0,rre.readFile)((0,ire.join)(e,t),"utf8")}}catch{return null}}async function sre(e){let{change:t,candidate:n,sites:r,workspace:i,headSha:o,logger:s}=e;if(!n)return null;let a=new Set(r.filter(c=>c.breakingChangeId===t.id).map(c=>c.file));if(a.size===0)return null;try{return await Wne(i,`fixplan-${n.provider}`,c=>ore({candidate:n,change:t,dependencyChange:e.dependencyChange,sandbox:c.path,relevantFiles:a,logger:s}),{at:o,...e.env?{env:e.env}:{},copyIgnoredFiles:!1})}catch(c){return s.warn(`Could not observe ${n.name}@${n.version} in an isolated worktree (${c.message}); this finding gets no recipe-derived fix plan.`),null}}var Uze="https://api.codemod.com",tU="https://search.maven.org",nU=6e3;async function cre(e,t){if(!t)return null;let n=ure(t.name),r=t.name.toLowerCase(),i=`${Uze}/registry?search=${encodeURIComponent(n)}`,o=await xe(i,{timeoutMs:nU,cacheTtlMs:3600*1e3});if(!o)return null;let s=Array.isArray(o)?o:o.entries??o.results??o.data??[];if(!Array.isArray(s))return null;let a=s.map(p=>({entry:p,confidence:zze(p,r,n)})).filter(p=>p.confidence!=="none");if(a.length===0)return null;let c={exact:2,"base-name":1,text:0};a.sort((p,f)=>c[f.confidence]-c[p.confidence]||Number(eU(f.entry))-Number(eU(p.entry)));let l=a[0].entry,u=l.slug??l.name,d=l.version??l.latestVersion;return!u||!d?null:{provider:"codemod.com",name:u,version:d,publisher:l.owner?.name??l.author??l.publisher??"Codemod.com",source:`https://app.codemod.com/registry/${encodeURIComponent(l.slug??u)}`,migration:l.description??l.summary??`Migrates ${t.name} usages.`,official:eU(l)}}function zze(e,t,n){let r=e.applicability?.flatMap(s=>s.packages??[])??[];if(r.some(s=>s.toLowerCase()===t))return"exact";if(r.some(s=>!s.includes("/")&&s.toLowerCase()===n))return"base-name";let i=`${e.slug??""} ${e.name??""} ${e.description??""} ${e.summary??""}`.toLowerCase(),o=new RegExp(`(?:^|[^a-z0-9])${Gze(n)}(?:$|[^a-z0-9])`);return n&&o.test(i)?"text":"none"}function Gze(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eU(e){if(e.verified||e.official)return!0;let t=(e.owner?.name??e.owner?.slug??e.author??e.publisher??"").toLowerCase();return t==="codemod"||t==="codemod.com"}var Bze=/\borg\.openrewrite\.[a-zA-Z0-9_.]*[A-Z][a-zA-Z0-9_]*\b/;async function lre(e,t){if(!t||t.ecosystem!=="maven")return null;let n=ure(t.name).replace(/[^a-z0-9]/g,"-"),r=await are(`rewrite-${n}`)??await are(n);if(!r?.latestVersion)return null;let i=await Vze(r.g,r.a,r.latestVersion),o=i?Bze.exec(i)?.[0]:void 0;return o?{provider:"openrewrite",name:o,version:r.latestVersion,publisher:"OpenRewrite",source:`${tU}/artifact/${r.g}/${r.a}/${r.latestVersion}`,migration:i??`Runs ${o} from ${r.g}:${r.a}.`,official:!0}:null}async function are(e){let t=encodeURIComponent(`g:org.openrewrite.recipe AND a:${e}`),n=`${tU}/solrsearch/select?q=${t}&core=gav&rows=1&wt=json`,i=(await xe(n,{timeoutMs:nU,cacheTtlMs:3600*1e3}))?.response?.docs?.[0];return i?.g==="org.openrewrite.recipe"?i:null}async function Vze(e,t,n){let r=e.replace(/\./g,"/"),i=`${tU}/remotecontent?filepath=${r}/${t}/${n}/${t}-${n}.pom`,o=await nt(i,{timeoutMs:nU,cacheTtlMs:1440*60*1e3,immutable:!0});if(!o)return null;let s=/([\s\S]*?)<\/description>/.exec(o);return s?s[1].trim():null}function ure(e){return e.replace(/^@[^/]+\//,"").toLowerCase()}var qze=[cre,lre];async function dre(e,t,n=qze){let i=(await Promise.all(n.map(o=>o(e,t).catch(()=>null)))).filter(o=>o!==null);return i.length===0?null:(i.sort((o,s)=>Number(s.official)-Number(o.official)),i[0])}var fre={branch:"{prefix}upgrade-{summary}-{date}",title:"chore(deps): upgrade {summary}",prefix:"drift/"};function mre(e,t){let{changes:n}=e,r=e.now??new Date,i=n[0],o=i?n.length===1?`${i.name}-${i.from??"unknown"}-to-${i.to??"unknown"}`:`${n.length}-packages`:"dependencies",s=i?n.length===1?`${i.name} to ${i.to??"a new version"}`:`${n.length} packages`:"dependencies";return{prefix:t,summary:o,"summary-text":s,name:i?.name??"dependencies",from:i?.from??"",to:i?.to??"",count:String(n.length),date:r.toISOString().slice(0,10)}}function gre(e,t){return e.replace(/\{([a-z-]+)\}/g,(n,r)=>t[r]??n)}function pre(e){return(e.toLowerCase().replace(/[^a-z0-9/_.-]+/g,"-").replace(/(?<=[^/])\/(?=[^/])/g,"-").replace(/\.{2,}/g,".").replace(/-{2,}/g,"-").replace(/^[-./]+|[-./]+$/g,"").replace(/\.lock$/,"-lock")||"drift-upgrade").slice(0,200).replace(/[-./]+$/,"")}function hre(e,t={}){let n={...fre,...t},r=n.prefix?`${n.prefix.replace(/\/+$/,"")}/`:"",i=gre(n.branch,mre(e,r));return i.startsWith(r)&&r?`${r}${pre(i.slice(r.length))}`:pre(i)}function yre(e,t={}){let n={...fre,...t},r=mre(e,n.prefix);return gre(n.title,{...r,summary:r["summary-text"]}).trim()}var bre={"runtime-requirement":0,"config-change":1,"module-system-change":1,"moved-export":1,"removed-export":2,"renamed-export":2,"removed-endpoint":3,"changed-endpoint":3,"signature-change":4,"type-change":4,"required-field-added":5,"default-change":5,"behaviour-change":6,unknown:7};function Wze(e){switch(e){case"runtime-requirement":case"config-change":case"module-system-change":return"build";case"behaviour-change":case"default-change":return"fix";default:return"refactor"}}function $re({breakingChanges:e,impactSites:t,dispositions:n,config:r,changes:i=[],codemods:o,recipes:s,fixPlans:a}){let c=Hze(t),l=new Map((n??[]).map(k=>[k.changeId,k.actionableSites])),u=new Map(n?.map(k=>[k.changeId,k])),d=e.filter(k=>{let $=u.get(k.id);return $?$.state==="actionable"&&$.actionableSites.length>0:(c.get(k.id)??[]).some(S=>S.confidence==="high"&&S.runtimeVerdict===void 0)});if(d.length===0)return{commits:[],edges:[],cohorts:kre(i),blockers:[]};let f=[...r.remediation.commitGranularity==="single"?[d]:r.remediation.commitGranularity==="per-dependency"?Kze(d):d.map(k=>[k])].sort(Jze),m=kre(i),g=new Map;for(let k of m)for(let $ of k.dependencies)g.set($,k);let h=f.map((k,$)=>Zze(k,$+1,l,f.length,o,s,a)),v=eGe(h,e,t,g),b=iGe(h,v),w=b.cycle.length>0?oGe(b.cycle,v):void 0;return{commits:b.commits,edges:v,cohorts:m,blockers:w?[w]:[]}}function Hze(e){let t=new Map;for(let n of e){let r=t.get(n.breakingChangeId);r?r.push(n):t.set(n.breakingChangeId,[n])}return t}function Kze(e){let t=new Map;for(let n of e){let r=t.get(n.dependency);r?r.push(n):t.set(n.dependency,[n])}return[...t.values()]}function Jze(e,t){let n=Math.min(...e.map(s=>bre[s.kind])),r=Math.min(...t.map(s=>bre[s.kind]));if(n!==r)return n-r;let i=e[0]?.dependency??"",o=t[0]?.dependency??"";return i.localeCompare(o)}function Zze(e,t,n,r,i,o,s){let a=e.flatMap(f=>n.get(f.id)??[]),c=[...new Set(a.map(f=>f.file))].sort(),l=e[0],u=i?Xze(e,n,i):void 0,d=!u&&s?Yze(e,n,s):void 0,p=!u&&o?Qze(e,o):void 0;return{id:xt("unit",e.map(f=>f.id).sort().join(","),c.join(","),l.dependency,l.kind),order:t,message:uGe(e,c.length),body:fGe(e,a,u,p),breakingChangeIds:e.map(f=>f.id),files:c,allowedFiles:c,allowedSymbols:[...new Set(e.flatMap(f=>f.symbols))].sort(),instructions:mGe(e,a,t,r),dependsOn:[],dependencyReasons:[],executionLayer:0,expectedChecks:sGe(e,c),invalidationTriggers:aGe(e,c),...u?{codemod:u}:{},...d?{fixPlan:d}:{},...p?{recipe:p}:{}}}function Yze(e,t,n){let r=e.map(a=>n.get(a.id)).filter(a=>!!a);if(r.length===0)return;let i=e.filter(a=>!n.has(a.id)).flatMap(a=>(t.get(a.id)??[]).map(c=>({file:c.file,line:c.line,reason:`No fix plan was accepted for "${a.summary}", so this site needs an agent.`}))),o=r[0],s=r.flatMap(a=>a.anchors);return{plan:o.plan,assurance:r.some(a=>a.assurance==="checked")?"checked":"proven",files:[...new Set(s.map(a=>a.file))].sort(),anchors:s,covered:r.reduce((a,c)=>a+c.covered,0),residual:r.reduce((a,c)=>a+c.residual,0)+i.length,residualSites:[...r.flatMap(a=>a.sites.filter(c=>c.status==="residual").map(c=>({file:c.file,line:c.line,reason:c.reason??"No rule matched."}))),...i]}}function Qze(e,t){let n=[];for(let r of e){let i=t.get(r.id);if(!i)return;n.push(i)}return n.length>0?n:void 0}function Xze(e,t,n){let r=new Set,i=[];for(let o of e){let s=t.get(o.id)??[],a=n.get(o.id);if(!a||a.sitesResolvedl.file))];if(c.some(l=>r.has(l)))return;for(let l of c)r.add(l);i.push({...a.transform,files:c})}return i.length>0?i:void 0}function eGe(e,t,n,r){let i=new Map,o=new Map(t.map(c=>[c.id,c])),s=new Map;for(let c of n){let l=s.get(c.file);l?l.push(c):s.set(c.file,[c])}let a=(c,l,u,d)=>{if(c.id===l.id)return;let p=`${c.id}\0${l.id}\0${u}`;i.has(p)||i.set(p,{from:c.id,to:l.id,reason:u,evidence:[...new Set(d)].sort()})};for(let c=0;cf.dependency)),p=new Set(l.allowedFiles);for(let f=c+1;fk.dependency)),v=m.allowedFiles.filter(k=>p.has(k));v.length>0&&a(l,m,"same-file-conflict",v),u.some(k=>k.kind==="runtime-requirement")&&a(l,m,"runtime-prerequisite",u.map(k=>k.summary)),u.some(k=>k.kind==="config-change"||k.kind==="module-system-change")&&g.some(k=>d.has(k.dependency))&&a(l,m,"configuration-prerequisite",u.map(k=>k.summary)),u.some(k=>k.kind==="moved-export")&&nGe(u,g)&&a(l,m,"import-prerequisite",u.flatMap(k=>k.symbols)),l.allowedFiles.some(rU)&&!m.allowedFiles.every(rU)&&tGe(d,h)&&a(l,m,"generated-output",l.allowedFiles.filter(rU));let b=[...d].map(k=>r.get(k)).filter(k=>!!k).filter(k=>g.some($=>k.dependencies.includes($.dependency)));for(let k of b)a(l,m,"package-cohort",[`${k.id}: ${k.reason}`]);let w=rGe(l,m,s);w.length>0&&a(l,m,"symbol-dependency",w)}}return[...i.values()].sort(Sre)}function vre(e,t){return e.breakingChangeIds.map(n=>t.get(n)).filter(n=>!!n)}function tGe(e,t){for(let n of e)if(t.has(n))return!0;return!1}function nGe(e,t){let n=e.filter(r=>r.kind==="moved-export");if(n.length===0)return!1;for(let r of n){let i=new Set([...r.symbols,...r.replacementSymbols??[]]);if(t.some(o=>o.dependency===r.dependency&&o.symbols.some(s=>i.has(s))))return!0}return!1}function rU(e){return/(^|\/)(__generated__|generated|gen)\//i.test(e)||/\.(generated|gen)\./i.test(e)}function rGe(e,t,n){let r=new Set(e.allowedSymbols??[]);if(r.size===0)return[];let i=[];for(let o of t.allowedFiles)for(let s of n.get(o)??[])s.enclosingSymbol&&r.has(s.enclosingSymbol)&&i.push(`${o}:${s.line} is inside ${s.enclosingSymbol}`);return i}function Sre(e,t){return e.from.localeCompare(t.from)||e.to.localeCompare(t.to)||e.reason.localeCompare(t.reason)||e.evidence.join("\0").localeCompare(t.evidence.join("\0"))}function iGe(e,t){let n=new Map(e.map(a=>[a.id,a])),r=new Map;for(let a of e)r.set(a.id,new Set);for(let a of t)!n.has(a.from)||!n.has(a.to)||r.get(a.to).add(a.from);let i=new Set(e.map(a=>a.id)),o=new Map,s=0;for(;i.size>0;){let a=[...i].filter(c=>[...r.get(c)??[]].every(l=>!i.has(l))).map(c=>n.get(c)).sort((c,l)=>c.order-l.order||c.id.localeCompare(l.id));if(a.length===0)return{commits:wre(e,t,o),cycle:[...i].sort()};for(let c of a)o.set(c.id,s),i.delete(c.id);s+=1}return{commits:wre(e,t,o),cycle:[]}}function wre(e,t,n){let r=new Map;for(let i of t){let o=r.get(i.to);o?o.push(i):r.set(i.to,[i])}return e.map(i=>{let o=[...r.get(i.id)??[]].sort(Sre);return{...i,dependsOn:o.map(s=>s.from).sort(),dependencyReasons:o,executionLayer:n.get(i.id)??0}}).sort((i,o)=>i.executionLayer-o.executionLayer||i.order-o.order||i.id.localeCompare(o.id)).map((i,o)=>({...i,order:o+1}))}function oGe(e,t){let n=t.filter(r=>e.includes(r.from)&&e.includes(r.to)).slice(0,5).map(r=>`${r.from} -> ${r.to} (${r.reason})`).join("; ");return`The remediation graph contains a dependency cycle across ${e.length} commit unit(s): ${n}. Drift cannot automatically execute this plan until the inseparable work is combined or reviewed manually.`}function sGe(e,t){let n=[];return e.some(r=>r.kind==="signature-change"||r.kind==="type-change"||r.kind==="removed-export"||r.kind==="renamed-export"||r.kind==="moved-export")&&n.push({id:xt("check","typecheck",e.map(r=>r.id).sort().join(",")),kind:"typecheck",reason:"API-shape and type-contract migrations should be checked by the repository type checker when available."}),e.some(r=>r.kind==="behaviour-change"||r.kind==="default-change")&&n.push({id:xt("check","test",e.map(r=>r.id).sort().join(",")),kind:"test",reason:"Behavioural and default changes need tests because compilation can still succeed with wrong behaviour."}),t.some(r=>/(^|\/)(package\.json|tsconfig\.json|vite\.config|webpack\.config|rollup\.config)/.test(r))&&n.push({id:xt("check","build",t.join(",")),kind:"build",reason:"Configuration and package-entry changes can alter the build graph."}),n}function aGe(e,t){let n=[...t.map(r=>`file:${r}`),...e.flatMap(r=>r.symbols.map(i=>`symbol:${i}`)),...e.map(r=>`dependency:${r.dependency}`)];return[...new Set(n)].sort()}function kre(e){let t=[],n=new Map;for(let r of e){let i=n.get(r.ecosystem);i?i.push(r):n.set(r.ecosystem,[r])}for(let[r,i]of n)for(let o of cGe(i)){if(o.length<2)continue;let s=o.map(a=>a.name).sort();t.push({id:xt("cohort",r,s.join(",")),ecosystem:o[0].ecosystem,dependencies:s,constraints:o.map(a=>({dependency:a.name,ecosystem:a.ecosystem,range:a.rawTo??a.to??"*",source:"workspace-family"})),candidatePaths:[...new Set(o.map(a=>a.manifestPath))].sort(),reason:`These ${r} packages appear to be part of the same ${lGe(o[0].name)} upgrade family and should be reviewed together.`})}return t.sort((r,i)=>r.id.localeCompare(i.id))}function cGe(e){let t=new Map;for(let n of e){let r=xre(n.name);if(!r)continue;let i=t.get(r);i?i.push(n):t.set(r,[n])}return[...t.values()]}function xre(e){let t=[/^(@angular)\//,/^(@babel)\//,/^(@nestjs)\//,/^(@types)\//,/^(@vue)\//,/^(react)(?:$|-)/,/^(next)(?:$|-)/,/^(eslint)(?:$|-)/,/^(jest)(?:$|-)/,/^(webpack)(?:$|-)/,/^(vite)(?:$|-)/];for(let n of t){let r=n.exec(e);if(r?.[1])return r[1]}if(e.startsWith("@")){let n=e.split("/")[0];return n&&n!==e?n:null}return null}function lGe(e){return iZ(xre(e)??e,32)}function uGe(e,t){let n=e[0],r=Wze(n.kind),i=pGe(e);return e.length===1?_re(`${r}(${i}): ${dGe(n)}`):_re(`${r}(${i}): update ${e.length} usages for the new ${n.dependency} API`)}function dGe(e){let t=e.symbols[0],n=e.replacementSymbols?.[0];switch(e.kind){case"removed-export":return t?`replace removed \`${t}\``:"replace removed API";case"renamed-export":return t&&n?`migrate \`${t}\` to \`${n}\``:`migrate renamed \`${t??"API"}\``;case"moved-export":return`import ${t?`\`${t}\``:"the API"} from its new entry point`;case"signature-change":return t?`update \`${t}\` call sites for the new signature`:"update call sites for new signatures";case"type-change":return t?`adapt to the new \`${t}\` type`:"adapt to changed types";case"removed-endpoint":return t?`migrate calls to removed endpoint \`${t}\``:"migrate removed endpoint calls";case"changed-endpoint":return t?`update requests to \`${t}\``:"update API requests";case"required-field-added":return t?`supply now-required \`${t}\``:"supply newly-required fields";case"default-change":return t?`pin previous default for \`${t}\``:"account for changed defaults";case"runtime-requirement":return e.summary.toLowerCase().startsWith("minimum")?e.summary.charAt(0).toLowerCase()+e.summary.slice(1):"raise the minimum runtime version";case"config-change":return"update configuration for the new version";case"module-system-change":return/commonjs/i.test(e.summary)?"replace dropped CommonJS usage":"migrate incompatible module loading";case"behaviour-change":return t?`handle changed \`${t}\` behaviour`:"handle changed behaviour";default:return`update usage of \`${e.dependency}\``}}function pGe(e){let t=[...new Set(e.map(n=>n.dependency))];if(t.length===1){let n=t[0];return n.startsWith("@")?n.split("/")[1]??n:n.split(":").pop()??n}return"deps"}function _re(e){return e.length<=72?e:`${e.slice(0,69)}...`}function fGe(e,t,n,r){let i=[];for(let s of e)i.push(s.summary),i.push(""),i.push(s.remediation),i.push("");let o=[...new Set(t.map(s=>s.file))];if(i.push(`Affects ${t.length} location(s) across ${o.length} file(s).`),i.push(""),n){let s=new Set(n.flatMap(a=>a.files)).size;i.push(`Resolved deterministically by Drift's codemod engine across ${s} file(s) \u2014 no model call was made for this commit.`)}else if(r&&r.length>0){let s=[...new Map(r.map(c=>[`${c.provider}:${c.name}@${c.version}`,c])).values()],a=s.map(c=>`${c.name}@${c.version} (${c.provider}, published by ${c.publisher})`).join(", ");i.push(`Community recipe available: ${a}. Not applied without an explicit choice \u2014 see ${s[0].source}.`)}else i.push("Identified by Drift from upstream evidence; see the pull request"),i.push("description for the citations behind this change.");return i.join(` +`).trim()}function mGe(e,t,n,r){let i=[];i.push(`## Commit ${n} of ${r}`),i.push("");for(let o of e){i.push(`### ${o.summary}`),i.push(""),i.push(`- Dependency: \`${o.dependency}\``),i.push(`- Change type: ${o.kind}`),i.push(`- Confidence: ${o.confidence}`),i.push(""),i.push(o.remediation),i.push("");let s=t.filter(a=>a.breakingChangeId===o.id);if(s.length>0){i.push("Known locations (verify each; there may be others):"),i.push("");for(let a of s.slice(0,40)){let c=a.enclosingSymbol?` in \`${a.enclosingSymbol}\``:"";i.push(`- \`${a.file}:${a.line}\`${c} \u2014 \`${a.excerpt}\``)}s.length>40&&i.push(`- \u2026and ${s.length-40} more matches of the same symbols`),i.push("")}}return i.join(` +`).trim()}var Ere=["detect","evidence","surface","static-analysis","upgrade-discovery","upgrade-install","verify","fix","pull-request"],sU={detect:"Detect",evidence:"Evidence",surface:"API surface","static-analysis":"Static analysis","upgrade-discovery":"Find upgrades","upgrade-install":"Install a version",verify:"Verify",fix:"Fix","pull-request":"Automated PR"},be=()=>({level:"full"}),ve=(e,t)=>({level:"partial",note:e,...t?{requires:t}:{}}),Ll=e=>({level:"none",note:e}),Ka="Resolves imports against the module names the published package declares, follows re-exports inside your repository, and matches references to symbols named in the evidence. Cannot see through reflection, dynamic dispatch, or generated code.",gGe="Matches imports and references to symbols named in the evidence, using the ecosystem's own module-naming convention where no published module list exists. Cannot see through reflection, dynamic dispatch, or generated code.",iU="Compares the declarations in both versions' public headers, which is what a consumer compiles against. Declarations behind preprocessor conditionals are read as written, not per build configuration.",oU="Matches `#include` directives and references to symbols named in the evidence, following includes through your own headers so a library reached indirectly still counts. A macro-generated call site is invisible.",hGe={npm:{ecosystem:"npm",localizationBasis:"declared",label:"JavaScript / TypeScript",files:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","npm-shrinkwrap.json"],managers:["npm","pnpm","Yarn (classic)","Yarn (berry)","Bun"],support:{detect:be(),evidence:be(),surface:ve("Diffs published TypeScript declarations. A package that ships no declarations of its own falls back to prose evidence rather than reporting a clean comparison."),"static-analysis":ve(Ka),"upgrade-discovery":be(),verify:ve("Runs the typecheck, test, and build scripts the project's package.json actually declares."),fix:be(),"pull-request":be()}},pypi:{ecosystem:"pypi",localizationBasis:"published",label:"Python",files:["pyproject.toml","requirements.in","requirements.txt","setup.py","poetry.lock","uv.lock","Pipfile"],managers:["pip","Poetry","uv"],support:{detect:be(),evidence:be(),surface:ve("Compares the public surface reconstructed from published type stubs. Packages without stubs fall back to prose evidence.","a local Python interpreter"),"static-analysis":ve(Ka),"upgrade-discovery":be(),verify:ve("Runs mypy/pyright and pytest when the project declares them."),fix:be(),"pull-request":be()}},go:{ecosystem:"go",localizationBasis:"declared",label:"Go",files:["go.mod","go.sum"],managers:["Go modules"],support:{detect:be(),evidence:be(),surface:ve("Compares the exported API of both module versions.","the Go toolchain"),"static-analysis":ve(Ka),"upgrade-discovery":be(),verify:ve("Runs `go vet`, `go test`, and `go build`.","the Go toolchain"),fix:be(),"pull-request":be()}},cargo:{ecosystem:"cargo",localizationBasis:"declared",label:"Rust",files:["Cargo.toml","Cargo.lock"],managers:["Cargo"],support:{detect:be(),evidence:be(),surface:ve("Compares the public API of both crate versions.","cargo-public-api"),"static-analysis":ve(Ka),"upgrade-discovery":be(),verify:ve("Runs `cargo check`, `cargo test`, and `cargo build`.","the Rust toolchain"),fix:be(),"pull-request":be()}},maven:{ecosystem:"maven",localizationBasis:"published",label:"Java / Kotlin / Scala",files:["pom.xml","build.gradle","build.gradle.kts","gradle/libs.versions.toml","build.sbt"],managers:["Maven","Gradle","sbt"],support:{detect:ve("Reads pom.xml, Gradle build files and version catalogs, and sbt coordinates. Gradle versions computed at configuration time are not visible without running Gradle."),evidence:be(),surface:ve("Compares both published JARs.","japicmp"),"static-analysis":ve(Ka),"upgrade-discovery":be(),verify:ve("Runs Maven or Gradle. sbt projects verify through sbt when it is installed."),fix:ve("Maven and sbt are edited through the build file; Gradle versions declared outside a version catalog may need a manual edit."),"pull-request":be()}},rubygems:{ecosystem:"rubygems",localizationBasis:"published",label:"Ruby",files:["Gemfile","Gemfile.lock","*.gemspec"],managers:["Bundler"],support:{detect:be(),evidence:be(),surface:Ll("Ruby has no static public API surface to compare, so upgrades rest on release notes, changelogs, and advisories."),"static-analysis":ve(Ka),"upgrade-discovery":be(),verify:ve("Runs RSpec or Rake when the Gemfile declares them.","Bundler"),fix:be(),"pull-request":be()}},nuget:{ecosystem:"nuget",localizationBasis:"published",label:".NET",files:["*.csproj","*.fsproj","*.vbproj","Directory.Packages.props","packages.lock.json"],managers:["NuGet"],support:{detect:be(),evidence:ve("Registry metadata, published versions, deprecation, and OSV advisories. Release notes depend on the package declaring a GitHub repository."),surface:ve("Compares the public types and member signatures in both versions' published assemblies, preferring the reference assembly and a common target framework. A package that ships only native binaries, analyzers, or nothing at all has no surface to compare."),"static-analysis":ve(Ka),"upgrade-discovery":be(),verify:ve("Runs `dotnet build` and `dotnet test`.","the .NET SDK"),fix:be(),"pull-request":be()}},packagist:{ecosystem:"packagist",localizationBasis:"published",label:"PHP",files:["composer.json","composer.lock"],managers:["Composer"],support:{detect:be(),evidence:ve("Registry metadata, published versions, abandonment notices, and OSV advisories. Release notes depend on the package declaring a source repository."),surface:Ll("PHP publishes no machine-comparable API artefact; upgrades rest on release notes, changelogs, and advisories."),"static-analysis":ve("Resolves `use` statements against the PSR-4 and PSR-0 roots the package declares in its own composer.json, read from Packagist. A package that autoloads only by classmap declares no namespace root and is not localized."),"upgrade-discovery":be(),verify:ve("Runs PHPUnit when composer.json declares it.","Composer"),fix:be(),"pull-request":be()}},hex:{ecosystem:"hex",localizationBasis:"published",label:"Elixir / Erlang",files:["mix.exs","mix.lock"],managers:["Mix"],support:{detect:be(),evidence:ve("Registry metadata, published versions, retirement notices, and OSV advisories."),surface:ve("Compares the public modules and their functions, by name and arity, in both versions' published sources \u2014 `def` and `defmacro` in Elixir, `-export` in Erlang. A function a macro generates at compile time is not visible without compiling."),"static-analysis":ve("Resolves module references against every module the released tarball defines, so a fully qualified call needs no `alias` to be found. Cannot see through `apply/3` or a module name computed at runtime."),"upgrade-discovery":be(),verify:ve("Runs `mix compile --warnings-as-errors` and `mix test`.","Elixir and Mix"),fix:be(),"pull-request":be()}},pub:{ecosystem:"pub",localizationBasis:"declared",label:"Dart / Flutter",files:["pubspec.yaml","pubspec.lock"],managers:["Dart pub","Flutter"],support:{detect:be(),evidence:ve("Registry metadata, published versions, retraction, and OSV advisories. Release notes depend on the package declaring a repository."),surface:ve("Compares the public declarations of both versions' published libraries, following each `export` out of the private `lib/src` tree the way a consumer's import does. Read from source rather than from a compiled artefact."),"static-analysis":ve(Ka),"upgrade-discovery":be(),verify:ve("Runs `dart analyze` and `dart test`, or their Flutter equivalents.","the Dart or Flutter SDK"),fix:be(),"pull-request":be()}},swift:{ecosystem:"swift",localizationBasis:"published",label:"Swift",files:["Package.swift","Package.resolved"],managers:["Swift Package Manager"],support:{detect:ve("Reads literal `.package(...)` declarations and Package.resolved. Versions computed by Swift code at manifest-evaluation time are not visible without running SwiftPM."),evidence:ve("Source repository, releases, and changelogs, because SwiftPM identifies packages by git URL. There is no central registry to query for deprecation."),surface:Ll("Comparing two Swift module interfaces needs a local toolchain and a built artefact Drift does not produce; upgrades rest on prose evidence."),"static-analysis":ve("Resolves `import` statements against the library and target names declared in the dependency's own Package.swift at the resolved version. A module name a manifest computes at evaluation time is not visible without running SwiftPM."),"upgrade-discovery":ve("Versions are git tags, since SwiftPM has no package registry to ask. Drift lists them for packages hosted on GitHub; anything on another git host is reported as unchecked rather than up to date."),verify:ve("Runs `swift build` and `swift test`.","the Swift toolchain"),fix:be(),"pull-request":be()}},cocoapods:{ecosystem:"cocoapods",localizationBasis:"published",label:"CocoaPods",files:["Podfile","Podfile.lock","*.podspec"],managers:["CocoaPods"],support:{detect:be(),evidence:ve("Release notes and changelogs when the pod declares a GitHub source. CocoaPods publishes no queryable metadata API, so there is no deprecation or advisory signal."),surface:Ll("Drift does not compare compiled iOS frameworks; upgrades rest on prose evidence."),"static-analysis":ve("Resolves `import` statements against the `module_name` the pod declares in its podspec, read from the CocoaPods CDN. A pod that builds its module name in Ruby at podspec-evaluation time is not visible without running CocoaPods."),"upgrade-discovery":be(),verify:Ll("Building an iOS target needs Xcode and a scheme Drift cannot infer; verification stays with the developer."),fix:be(),"pull-request":be()}},opam:{ecosystem:"opam",localizationBasis:"convention",label:"OCaml",files:["*.opam","dune-project","*.opam.locked"],managers:["opam"],support:{detect:be(),evidence:ve("Release notes and changelogs when the package declares a GitHub source. opam has no JSON metadata API, so there is no registry deprecation signal."),surface:Ll("Comparing two OCaml module interfaces needs a built switch Drift does not create; upgrades rest on prose evidence."),"static-analysis":ve(gGe),"upgrade-discovery":ve("opam publishes no version API, so releases are read from the package directories in the opam-repository index. A package published only in a custom repository is reported as unchecked rather than up to date."),verify:ve("Runs `dune build` and `dune runtest`.","opam and dune"),fix:be(),"pull-request":be()}},conan:{ecosystem:"conan",localizationBasis:"convention",label:"C / C++ (Conan)",files:["conanfile.txt","conanfile.py","conan.lock"],managers:["Conan"],support:{detect:ve("Reads conanfile.txt, conan.lock, and the literal `requires` declarations in conanfile.py. A reference a recipe builds at evaluation time is not visible without running Python."),evidence:ve("Versions from the ConanCenter recipe index, and releases and changelogs from the upstream project the recipe builds \u2014 not from the recipe itself. ConanCenter publishes no deprecation signal, and OSV has no Conan ecosystem."),surface:ve(iU),"static-analysis":ve(oU),"upgrade-discovery":ve("Conan version schemes are package-defined, so Drift can analyze exact version changes but does not invent an ordering to select a newer release automatically."),verify:ve("Runs `conan build`, which is the compiler \u2014 in C and C++ an incompatible header change is a build failure rather than a runtime surprise.","Conan"),fix:be(),"pull-request":be()}},vcpkg:{ecosystem:"vcpkg",localizationBasis:"convention",label:"C / C++ (vcpkg)",files:["vcpkg.json","vcpkg-configuration.json"],managers:["vcpkg"],support:{detect:ve("Reads declared dependencies, `version>=` floors, and `overrides`. A registry baseline moving changes every unpinned version at once; Drift reports the baseline move rather than resolving it to versions."),evidence:ve("Versions from the vcpkg versions database, and releases and changelogs from the port's upstream project. vcpkg publishes no deprecation signal, and OSV has no vcpkg ecosystem."),surface:ve(iU),"static-analysis":ve(oU),"upgrade-discovery":ve("vcpkg versions are port-defined and baseline resolution can change every dependency, so Drift analyzes exact overrides but does not invent an ordering or resolve baseline moves automatically."),verify:ve("Runs the project's CMake build, which is where an incompatible header change surfaces.","CMake"),fix:be(),"pull-request":be()}},arduino:{ecosystem:"arduino",localizationBasis:"convention",label:"Arduino / PlatformIO",files:["library.properties","platformio.ini"],managers:["Arduino CLI","PlatformIO"],support:{detect:be(),evidence:ve("Versions and repositories from the Arduino Library Manager index, plus releases and changelogs from the library's own repository. A library published only to PlatformIO has metadata but no version history, because that registry serves only the current release."),surface:ve(iU),"static-analysis":ve(oU),"upgrade-discovery":be(),verify:ve("Runs `arduino-cli compile` or `pio run`, and `pio test` where the project has tests.","Arduino CLI or PlatformIO"),fix:be(),"pull-request":be()}}};function yGe(e){let t=aa.filter(s=>s.ecosystem===e),n={name:"example",version:"1.0.0",kind:"runtime"},r=t.filter(s=>s.upgrade(n)!==null),i=t.filter(s=>s.upgrade(n)===null);if(i.length===0)return be();let o=s=>s.map(a=>a.label).join(", ");return r.length===0?Ll(`${o(i)} ${i.length===1?"has":"have"} no command that pins a version \u2014 the coordinate lives in a build file the tool will not rewrite. Drift reports the version to set and where, and leaves the edit to you.`):ve(`${o(r)} can install a chosen version directly. ${o(i)} cannot: the version lives in a build file the tool will not rewrite, so Drift tells you what to change instead of running something that silently changes nothing.`)}var bGe=Object.values(hGe).map(e=>({...e,support:{...e.support,"upgrade-install":yGe(e.ecosystem)}})),vGe=Object.fromEntries(bGe.map(e=>[e.ecosystem,e]));function Tre(e){return vGe[e]}var aU=require("node:crypto");var Jf=3,cU=[Jf];function ni(e){return e===null||typeof e!="object"?JSON.stringify(e??null)??"null":Array.isArray(e)?`[${e.map(n=>ni(n)).join(",")}]`:`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[r])=>nr?1:0).map(([n,r])=>`${JSON.stringify(n)}:${ni(r)}`).join(",")}}`}function wGe(e){return{id:e.id,source:e.source,dependency:e.dependency,url:e.url??null,locator:e.locator??null,title:e.title,contentHash:(0,aU.createHash)("sha256").update(e.content).digest("hex"),weight:e.weight,findings:(e.findings??[]).map(t=>({code:t.code,symbol:t.symbol,detail:t.detail,before:t.before??null,after:t.after??null}))}}function kGe(e){return{nature:e.nature,detectability:[...e.detectability].sort(),scope:e.scope,visibility:[...e.visibility].sort(),origin:e.origin}}function _Ge(e){return{schemaVersion:Jf,id:e.id,baseBranch:e.baseBranch,headSha:e.headSha,risk:e.risk,blockers:[...e.blockers],warnings:[...e.warnings],changes:e.changes.map(t=>({name:t.name,ecosystem:t.ecosystem,from:t.from,to:t.to,kind:t.kind,bump:t.bump,manifestPath:t.manifestPath,workspace:t.workspace??null})),breakingChanges:e.breakingChanges.map(t=>({id:t.id,dependency:t.dependency,kind:t.kind,summary:t.summary,remediation:t.remediation,symbols:[...t.symbols].sort(),replacementSymbols:[...t.replacementSymbols??[]].sort(),confidence:t.confidence,taxonomy:kGe(Nr(t)),assessment:t.assessment?{upstream:t.assessment.upstream.score,localImpact:t.assessment.localImpact.score,verification:t.assessment.verification.score,automaticExecutionEligible:t.assessment.automaticExecutionEligible,calibration:t.assessment.upstream.calibration}:null,citations:[...t.citations].sort()})),impactSites:e.impactSites.map(t=>({breakingChangeId:t.breakingChangeId,file:t.file,line:t.line,matchedSymbol:t.matchedSymbol,enclosingSymbol:t.enclosingSymbol??null,confidence:t.confidence})),commits:e.commits.map(t=>({id:t.id,order:t.order,message:t.message,body:t.body,breakingChangeIds:[...t.breakingChangeIds].sort(),files:[...t.files].sort(),allowedFiles:[...t.allowedFiles].sort(),allowedSymbols:[...t.allowedSymbols??[]].sort(),instructions:t.instructions,dependsOn:[...t.dependsOn].sort(),dependencyReasons:[...t.dependencyReasons].map(n=>({from:n.from,to:n.to,reason:n.reason,evidence:[...n.evidence].sort()})).sort((n,r)=>ni(n).localeCompare(ni(r))),executionLayer:t.executionLayer,expectedChecks:[...t.expectedChecks].map(n=>({id:n.id,kind:n.kind,command:n.command??null,reason:n.reason})).sort((n,r)=>ni(n).localeCompare(ni(r))),invalidationTriggers:[...t.invalidationTriggers].sort()})),planEdges:[...e.planEdges].map(t=>({from:t.from,to:t.to,reason:t.reason,evidence:[...t.evidence].sort()})).sort((t,n)=>ni(t).localeCompare(ni(n))),upgradeCohorts:[...e.upgradeCohorts].map(t=>({id:t.id,ecosystem:t.ecosystem,dependencies:[...t.dependencies].sort(),constraints:[...t.constraints].map(n=>({dependency:n.dependency,ecosystem:n.ecosystem,range:n.range,source:n.source})).sort((n,r)=>ni(n).localeCompare(ni(r))),candidatePaths:[...t.candidatePaths].sort(),reason:t.reason})).sort((t,n)=>t.id.localeCompare(n.id)),evidence:e.evidence.map(wGe),gaps:[...e.gaps].map(t=>({stage:t.stage,dependency:t.dependency??null,ecosystem:t.ecosystem??null,surface:t.surface,severity:t.severity,automaticExecution:t.automaticExecution})).sort((t,n)=>ni(t).localeCompare(ni(n)))}}function sE(e){return(0,aU.createHash)("sha256").update(ni(_Ge(e))).digest("hex")}function $Ge(e,t,n){return t.breakingChangeId!==e.id||t.confidence!=="high"?!1:e.kind!=="runtime-requirement"?!0:n?.changeId===e.id&&n.state==="incompatible"&&t.runtimeVerdict==="incompatible"}function SGe(e){let t=new Set,n=[];for(let r of e){let i=`${r.file}:${r.line}:${r.column??""}:${r.matchedSymbol??""}`;t.has(i)||(t.add(i),n.push(r))}return n}function Zf(e,t,n,r,i=!0){let o=new Map;for(let s of n){let a=o.get(s.changeId);a?a.push(s):o.set(s.changeId,[s])}return e.map(s=>{let a=SGe(t.filter(d=>d.breakingChangeId===s.id)),c=o.get(s.id)??[],l=c.length===1?c[0]:void 0,u=a.filter(d=>$Ge(s,d,l));if(s.kind==="runtime-requirement"){if(!l)return{changeId:s.id,state:"unknown",reason:"not-localized",sites:a,actionableSites:u};let d={changeId:s.id,sites:a,actionableSites:u,runtimeAnalysis:{runtime:l.runtime,state:l.state,reason:l.reason}};return l.state==="incompatible"?{...d,state:"actionable",reason:"runtime-incompatible"}:l.state==="partial"?{...d,state:"review-only",reason:"runtime-partial"}:l.state==="unknown"?{...d,state:"review-only",reason:"runtime-unknown"}:{...d,state:"unaffected",reason:"runtime-compatible"}}return u.length>0?{changeId:s.id,state:"actionable",reason:"high-confidence-impact",sites:a,actionableSites:u}:a.length>0?{changeId:s.id,state:"review-only",reason:"low-confidence-impact",sites:a,actionableSites:u}:r?i?{changeId:s.id,state:"unknown",reason:"impact-unresolved",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"localization-incomplete",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"not-localized",sites:[],actionableSites:[]}})}function Ire(e){return e.assessment?Rte(e.assessment):e.confidence}function aE(e){let{repo:t,config:n,changes:r,evidence:i,impactSites:o}=e,s=xGe(e),a=Zf(s,o,e.runtimeAnalyses??e.rationale?.flatMap(m=>m.runtimeAnalyses??[])??[],e.localizationRan??!0,e.localizationComplete??!0),c=$re({breakingChanges:s,impactSites:o,dispositions:a,config:n,changes:r,codemods:e.codemods,recipes:e.recipes,fixPlans:e.fixPlans}),l=c.commits,u=lU(r,s,o,(e.rationale??[]).map(m=>m.assessment.runtimeCompatibility),a),d=EGe(e,s,l),{blockers:p,warnings:f}=AGe(e,s,l,u,d);return{schemaVersion:Jf,id:xt("plan",t.owner,t.repo,t.afterSha),branchName:IGe(n,r,t.afterSha),baseBranch:t.baseBranch,headSha:t.afterSha,changes:[...r],evidence:[...i],breakingChanges:s,upstreamBreakingCount:s.length,impactSites:[...o],dispositions:a,localizationRan:e.localizationRan??!0,localizationComplete:e.localizationComplete??!0,runtimeConfigComplete:e.runtimeConfigComplete??!0,commits:l,planEdges:c.edges,upgradeCohorts:c.cohorts,...e.rationale?{rationale:[...e.rationale]}:{},risk:u,gaps:d,checkedSurfaces:[...e.checkedSurfaces??[]],confirmedRegressions:[...e.confirmedRegressions??[]],blockers:[...c.blockers,...p],warnings:f,createdAt:new Date().toISOString()}}function xGe(e){let{evidence:t,breakingChanges:n,impactSites:r}=e,i=e.localizationRan??!0,o=e.localizationComplete??!0;return n.map(s=>{let a=r.filter(p=>p.breakingChangeId===s.id),c=Nr(s),l=(e.runtimeAnalyses??[]).find(p=>p.changeId===s.id)?.state,u=(e.verification??[]).filter(p=>p.breakingChangeIds!==void 0?p.breakingChangeIds.includes(s.id):p.dependency===void 0?!0:p.dependency===s.dependency&&p.workspace===s.workspace),d=Ate({change:s,taxonomy:c,evidence:t,sites:a,localizationRan:i,localizationComplete:o,runtimeState:l,outcomes:u,checkedSurfaces:e.checkedSurfaces??[],gaps:[]});return{...s,taxonomy:c,assessment:d}})}function EGe(e,t,n){let{changes:r,evidence:i,impactSites:o,config:s}=e,a=[],c=e.localizationRan??!0;c&&e.localizationComplete===!1&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:e.runtimeConfigComplete===!1?"Source localization was incomplete, and at least one authoritative runtime configuration file could not be indexed. Zero local API sites is not an exhaustive absence claim.":"Source localization reached its file limit. Runtime configuration was indexed completely, but zero local API sites is not an exhaustive absence claim.",severity:"blocking",automaticExecution:"blocks",remediation:"Raise the source indexing limit or narrow the scan to the relevant workspace."}),!c&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:'No checkout was available, so Drift could not search this repository for affected code. Zero impact sites here means "not searched", not "not affected".',severity:"blocking",automaticExecution:"blocks",remediation:"Run Drift as a GitHub Action or from the CLI in a checkout. The webhook runner cannot localize \u2014 see docs/deployment.md."});for(let u of r)i.filter(f=>f.dependency===u.name&&f.workspace===u.workspace).filter(f=>f.source!=="semver-heuristic"&&f.source!=="registry-metadata").length===0&&a.push({stage:"evidence",ecosystem:u.ecosystem,dependency:u.name,surface:"upstream release evidence",reason:`No changelog, release notes, migration guide, or API diff could be retrieved for ${u.name}. Drift will not dispatch a fix based on a version number alone.`,severity:"significant",automaticExecution:s.guardrails.requireEvidence&&t.length>0?"blocks":"degrades",remediation:"Check the package publishes release notes Drift can reach, or review this upgrade by hand."});for(let u of t)o.filter(p=>p.breakingChangeId===u.id).length>0||P$(Nr(u))&&a.push({stage:"localize",dependency:u.dependency,surface:`reachability of ${u.symbols.slice(0,3).join(", ")||u.dependency}`,reason:`${u.summary} is only observable at runtime, so searching the source cannot establish whether this repository is affected.`,severity:"significant",automaticExecution:"degrades",remediation:"Confirm by exercising the affected paths, or review the upstream notes directly."});(e.verification??[]).filter(u=>!u.name.startsWith("behavioural:")).length===0&&n.length>0&&a.push({stage:"verify",surface:"build, typecheck, and test",reason:"No checks were run against this plan, so nothing confirms the findings were understood correctly or that a fix would compile.",severity:"significant",automaticExecution:"degrades",remediation:"Configure the repository checks Drift should run, or review the resulting pull request against CI before merging."});for(let u of[...new Set(r.map(d=>d.ecosystem))].sort()){let d=Tre(u);for(let p of Ere)d.support[p].level==="none"&&a.push({stage:TGe(p),ecosystem:u,surface:sU[p],reason:d.support[p].note??`${sU[p]} does not run for ${u}.`,severity:"significant",automaticExecution:"degrades",remediation:`Drift cannot run this stage for ${u}; review this surface by hand.`})}return a}function TGe(e){switch(e){case"detect":return"detect";case"evidence":case"surface":return"evidence";case"static-analysis":return"localize";case"verify":return"verify";default:return"plan"}}function IGe(e,t,n){return hre({changes:t},{branch:e.pullRequest.branchTemplate,prefix:e.remediation.branchPrefix})}function lU(e,t,n,r=[],i){let o=r.some(p=>p==="unknown"||p==="partial"),s=i?.some(p=>p.state==="review-only"||p.state==="unknown")??!1,a=i?i.flatMap(p=>p.actionableSites):n;if(t.length===0||a.length===0)return o||s?"low":"none";let c="low",l=p=>{$6(p,c)>0&&(c=p)},u=new Set(a.map(p=>p.file)).size;(u>5||a.length>20)&&l("medium"),(u>20||a.length>75)&&l("high");let d=new Set((i??[]).filter(p=>p.state!=="unaffected").map(p=>p.changeId));for(let p of t.filter(f=>d.size===0||d.has(f.id)))(p.kind==="behaviour-change"||p.kind==="default-change")&&l("high"),p.kind==="unknown"&&l("medium"),p.confidence==="low"&&l("medium");for(let p of e)p.bump==="major"&&l("medium"),Vg(p.from,p.to,p.ecosystem)&&l("high");return a.some(p=>Are(p.file))&&l("medium"),c}function AGe(e,t,n,r,i){let{config:o,changes:s,impactSites:a,skipped:c=[]}=e,l=o.guardrails,u=[],d=[],p=[...new Set(n.flatMap($=>$.files))];p.length>l.maxFilesChanged&&u.push(`This plan would touch ${p.length} files, above the \`maxFilesChanged\` limit of ${l.maxFilesChanged}. A change this wide should be read by a person before an agent starts editing.`),s.length>l.maxDependenciesPerRun&&u.push(`${s.length} dependencies moved in one commit, above the \`maxDependenciesPerRun\` limit of ${l.maxDependenciesPerRun}. Batched upgrades make it hard to attribute a regression to the dependency that caused it.`);let f=p.filter($=>Qo(l.protectedPaths,$));f.length>0&&u.push(`Impact sites fall inside protected paths: ${f.slice(0,5).join(", ")}${f.length>5?`, +${f.length-5} more`:""}. Drift will not direct an agent to edit these.`);let m=s.filter($=>Qo(o.alwaysApprove,$.name));m.length>0&&u.push(`${m.map($=>$.name).join(", ")} matched \`alwaysApprove\` in drift.yml.`);let g=new Set(n.flatMap($=>$.breakingChangeIds)),h=t.filter($=>g.has($.id)&&!Ij(Ire($),l.minConfidence));if(h.length>0){let $=h.slice(0,3).map(S=>`\`${S.dependency}\`: ${S.summary}`).join("; ");l.experimentalDispatchBelowMinConfidence?d.push(`${h.length} finding(s) are below the \`minConfidence\` threshold of \`${l.minConfidence}\` but \`experimentalDispatchBelowMinConfidence\` is on, so Drift will dispatch anyway. ${$}.`):u.push(`${h.length} finding(s) Drift planned commits for are below the \`minConfidence\` threshold of \`${l.minConfidence}\`: ${$}. The plan is filed for review rather than dispatched.`)}let v=t.filter($=>!g.has($.id)&&!Ij(Ire($),l.minConfidence));v.length>0&&d.push(`${v.length} finding(s) are below the \`minConfidence\` threshold and no commit was planned for them. They are listed for awareness.`);let b=i.filter($=>$.automaticExecution==="blocks");for(let $ of b)u.push(`${$.reason} ${$.remediation}`);dN(r,o.maxAutoRisk)||u.push(`Assessed risk is \`${r}\`, above the \`maxAutoRisk\` ceiling of \`${o.maxAutoRisk}\`.`);let w=a.filter($=>Are($.file));w.length>0&&d.push(`${w.length} impact site(s) are in test files. Confirm the fix updates tests to match the new API rather than weakening what they assert.`);let k=t.filter($=>!a.some(S=>S.breakingChangeId===$.id));k.length>0&&d.push(`${k.length} breaking change(s) were identified upstream but no usage was found in this repository. They are listed for awareness and no commit was planned for them.`);for(let $ of c)d.push(`Skipped \`${$.change.name}\`: ${$.reason}.`);return{blockers:u,warnings:d}}function Are(e){let t=e.toLowerCase();return/(^|\/)(tests?|__tests__|spec|specs|e2e|integration_tests)\//.test(t)||/\.(test|spec)\.[jt]sx?$/.test(t)||/(^|\/)test_[^/]+\.py$/.test(t)||/_test\.(py|go|rb)$/.test(t)||/_spec\.rb$/.test(t)||/Test\.java$/.test(e)||/Tests?\.kt$/.test(e)}function Rre(e,t){return t.mode!=="auto"||e.blockers.length>0||e.commits.length===0?!1:dN(e.risk,t.maxAutoRisk)}var eb=require("node:fs/promises"),ro=require("node:path");async function Pre(e,t,n){let r=n.replace(/\\/g,"/").trim();if(!r||/[\n\r\0]/.test(r))return null;let i;try{i=await(0,eb.realpath)(e)}catch{return null}let o=(0,ro.isAbsolute)(r)||/^[A-Za-z]:\//.test(r)?[r]:[...new Set([t?(0,ro.join)(i,t,r):null,(0,ro.join)(i,r)].filter(s=>s!==null))];for(let s of o){let a;try{if(a=await(0,eb.realpath)(s),!(await(0,eb.stat)(a)).isFile())continue}catch{continue}let c=(0,ro.relative)(i,a);if(!(!c||c.startsWith("..")||(0,ro.isAbsolute)(c))&&!c.split(ro.sep).includes(".git"))return c.split(ro.sep).join("/")}return null}var Cre="https://api.osv.dev/v1/query",RGe="https://api.osv.dev/v1/querybatch",PGe="https://api.osv.dev/v1/vulns",Lre={npm:"npm",pypi:"PyPI",go:"Go",cargo:"crates.io",maven:"Maven",rubygems:"RubyGems",nuget:"NuGet",packagist:"Packagist",hex:"Hex",pub:"Pub",swift:"SwiftURL",cocoapods:null,opam:null,conan:null,vcpkg:null,arduino:null};async function tb(e,t,n,r,i={}){let o=Lre[t];if(!o)return Uo(`OSV has no advisory coverage for ${t} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`);let s=i.fetch??jGe,[a,c]=await Promise.all([s(Cre,cE(e,o,n)),s(Cre,cE(e,o,r))]);return Fre(a,c,n,r,t)}async function nb(e,t={}){let n=new Map,r=[];for(let a of e){let c=Lre[a.ecosystem];c?r.push({lookup:a,osvEcosystem:c}):n.set(a,Uo(`OSV has no advisory coverage for ${a.ecosystem} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`))}if(r.length===0)return n;if(r.length===1&&!t.batchFetch){let{lookup:a}=r[0];return n.set(a,await tb(a.name,a.ecosystem,a.from,a.to,t)),n}if(t.fetch&&!t.batchFetch){let a=await Promise.all(r.map(({lookup:c})=>tb(c.name,c.ecosystem,c.from,c.to,t)));return r.forEach(({lookup:c},l)=>n.set(c,a[l])),n}let i=r.flatMap(({lookup:a,osvEcosystem:c})=>[cE(a.name,c,a.from),cE(a.name,c,a.to)]),s=await(t.batchFetch??UGe)(i);if(Fl(s)){for(let{lookup:a}of r)n.set(a,Uo(`${s.osvFailure}, so this upgrade's effect on known vulnerabilities is unknown.`));return n}for(let a=0;a!uU(d,a)),l=a.filter(d=>!uU(d,s)),u=s.filter(d=>uU(d,a));return{checked:!0,current:s,target:a,resolved:c,introduced:l,carried:u,direction:CGe(c,l)}}function cE(e,t,n){return{version:n,package:{name:e,ecosystem:t}}}function uU(e,t){let n=new Set([e.id,...e.aliases]);return t.some(r=>n.has(r.id)||r.aliases.some(i=>n.has(i)))}function CGe(e,t){return e.length>0&&t.length>0?"mixed":e.length>0?"improves":t.length>0?"worsens":"preserves"}function Uo(e){return{checked:!1,...e?{reason:e}:{},current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"}}function Nre(e,t,n="npm"){let r=e?.vulns;if(!Array.isArray(r))return[];let i=[];for(let o of r)!o.id||o.withdrawn||i.push({id:o.id,aliases:(o.aliases??[]).filter(s=>typeof s=="string"),summary:LGe(o.summary||o.details||"No summary published."),severity:DGe(o),url:MGe(o),fixedIn:OGe(o,t,n)});return jre(i,n).sort((o,s)=>Dre[o.severity]-Dre[s.severity])}function jre(e,t="npm"){let n=new Map,r=[];for(let i of e){let o=[i.id,...i.aliases],a=o.map(c=>n.get(c)).find(c=>c!==void 0)??r.push([])-1;r[a].push(i);for(let c of o)n.set(c,a)}return r.filter(i=>i.length>0).map(i=>{let o=i.find(a=>a.severity!=="unknown")??i[0],s=new Set(i.flatMap(a=>[a.id,...a.aliases]));return s.delete(o.id),{...o,aliases:[...s].sort(),fixedIn:NGe(i.map(a=>a.fixedIn),t),summary:i.find(a=>a.summary!=="No summary published.")?.summary??o.summary}})}function NGe(e,t){return e.filter(r=>!!r).map(r=>({raw:r,parsed:Re(r,t)})).filter(r=>r.parsed!==null).sort((r,i)=>Ye(r.parsed,i.parsed)??0)[0]?.raw??e.find(r=>!!r)??null}var Dre={critical:0,high:1,medium:2,low:3,unknown:4};function DGe(e){let t=e.database_specific?.severity??e.affected?.find(i=>i.database_specific?.severity)?.database_specific?.severity??e.affected?.find(i=>i.ecosystem_specific?.severity)?.ecosystem_specific?.severity;if(t){let i=t.toLowerCase();if(i==="critical")return"critical";if(i==="high")return"high";if(i==="moderate"||i==="medium")return"medium";if(i==="low")return"low"}let n=e.severity?.find(i=>i.score)?.score,r=n?Ure(n):null;return r===null?"unknown":r>=9?"critical":r>=7?"high":r>=4?"medium":"low"}function Ure(e){if(!/^CVSS:3\.[01]\//.test(e))return null;let t=new Map;for(let w of e.split("/").slice(1)){let[k,$]=w.split(":");k&&$&&t.set(k,$)}let n={N:.85,A:.62,L:.55,P:.2},r={L:.77,H:.44},i={N:.85,R:.62},o={H:.56,L:.22,N:0},s=t.get("S")==="C",a=s?{N:.85,L:.68,H:.5}:{N:.85,L:.62,H:.27},c=n[t.get("AV")??""],l=r[t.get("AC")??""],u=a[t.get("PR")??""],d=i[t.get("UI")??""],p=o[t.get("C")??""],f=o[t.get("I")??""],m=o[t.get("A")??""];if([c,l,u,d,p,f,m].some(w=>w===void 0))return null;let g=1-(1-p)*(1-f)*(1-m),h=s?7.52*(g-.029)-3.25*(g-.02)**15:6.42*g;if(h<=0)return 0;let v=8.22*c*l*u*d,b=Math.min(s?1.08*(h+v):h+v,10);return Math.ceil(b*10)/10}function OGe(e,t,n="npm"){let r=Re(t,n),i=[];for(let a of e.affected??[])for(let c of a.ranges??[])for(let l of c.events??[])l.fixed&&i.push(l.fixed);if(i.length===0)return null;let o=i.map(a=>({raw:a,parsed:Re(a,n)})).filter(a=>a.parsed!==null);return!r||o.length===0?i[0]??null:(o.filter(a=>(Ye(a.parsed,r)??-1)>0).sort((a,c)=>Ye(a.parsed,c.parsed)??0)[0]??o.sort((a,c)=>Ye(a.parsed,c.parsed)??0)[0])?.raw??null}function MGe(e){return e.references?.find(n=>n.type==="ADVISORY"&&n.url)?.url??`https://osv.dev/vulnerability/${e.id}`}function LGe(e){let t=e.replace(/\s+/g," ").trim(),n=t.search(/\.\s|\.$/),r=n>0?t.slice(0,n+1):t;return r.length>300?`${r.slice(0,299)}\u2026`:r}var Ore=1e4,Mre=2,FGe=200;function Fl(e){return typeof e=="object"&&e!==null&&"osvFailure"in e}var jGe=async(e,t)=>zre(e,t),UGe=async e=>{let t=Array.from({length:e.length},()=>({vulns:[]})),n=e.map((i,o)=>({query:i,index:o}));for(;n.length>0;){let i=await zre(RGe,{queries:n.map(a=>a.query)});if(Fl(i))return i;let o=i?.results;if(!Array.isArray(o)||o.length!==n.length)return{osvFailure:"OSV returned a malformed batch response"};let s=[];for(let a=0;a!!u?.id)),l.next_page_token&&s.push({index:c.index,query:{...c.query,page_token:l.next_page_token}})}n=s}let r=await zGe(t.flatMap(i=>i.vulns));return Fl(r)?r:t.map(i=>({vulns:i.vulns.map(o=>r.get(o.id)??o)}))};async function zGe(e){let t=[...new Set(e.map(i=>i.id).filter(i=>!!i))],n=await Promise.all(t.map(async i=>{let o=await GGe(`${PGe}/${encodeURIComponent(i)}`);return Fl(o)?o:[i,o]})),r=n.find(Fl);return r||new Map(n)}async function zre(e,t){return Gre(e,{method:"POST",body:JSON.stringify(t)})}async function GGe(e){return Gre(e,{method:"GET"})}async function Gre(e,t){let n=null;for(let r=0;r<=Mre;r+=1){let i=await BGe(e,t);if(!Fl(i)||!i.transient||r===Mre)return i;n=i,await WGe(FGe*2**r)}return n??{osvFailure:"OSV could not be reached (network error)"}}async function BGe(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),Ore);try{let i=await fetch(e,{method:t.method,signal:n.signal,headers:{"Content-Type":"application/json","User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"},...t.method==="POST"?{body:t.body}:{}});return i.ok?await i.json():{osvFailure:i.status===429?"OSV rate-limited this scan (HTTP 429). Lowering `drift.analysis.concurrency` will fetch fewer advisories at once.":`OSV answered HTTP ${i.status} ${i.statusText}`.trim(),transient:i.status===408||i.status===429||i.status>=500}}catch(i){let o=i;return{osvFailure:o?.name==="AbortError"||o?.name==="TimeoutError"?`OSV did not answer within ${Ore/1e3}s${Bre(o)}`:`OSV could not be reached (${VGe(o)})`,transient:!0}}finally{clearTimeout(r)}}function VGe(e){return`${e?.message||"network error"}${Bre(e)}`}function Bre(e){let t=e?.cause;return t==null?"":`; cause: ${qGe(t)}`}function qGe(e){if(e instanceof Error)return e.message||e.name;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function WGe(e){return new Promise(t=>setTimeout(t,e))}var HGe=gt(_c(),1);function pU(e){let{name:t,registry:n,repository:r,currentVersion:i,targetVersion:o}=e,s=e.now??new Date,a=[],c=o?.withdrawn??n?.deprecated??void 0;c&&a.push({statement:`The maintainer has withdrawn ${t} ${e.to}: ${c}`,url:n?.homepage??void 0,concerning:!0,polarity:"blocks"}),r?.archived?a.push({statement:"The upstream repository is archived. It will not receive further fixes.",url:r.url,concerning:!0,polarity:"blocks"}):r?.pushedAt&&a.push({statement:`The repository was last pushed to ${dU(r.pushedAt,s)}.`,url:r.url}),i?.withdrawn&&!c&&a.push({statement:`The version currently installed, ${e.from}, has been withdrawn: ${i.withdrawn}`,concerning:!0,polarity:"favors"});let l=ZGe(n?.versions??[],e.ecosystem);if(l){let p=Re(e.to,e.ecosystem),f=Re(l,e.ecosystem),m=p&&f?Ye(f,p):null;m===0?a.push({statement:`${e.to} is the latest stable release.`}):m!==null&&m>0&&a.push({statement:`${e.to} is not the latest release; ${l} is also available.`})}o?.releasedAt&&a.push({statement:`The target version was released ${dU(o.releasedAt,s)}.`});let u=KGe(i,o);u&&a.push(u);let d=JGe(e,l);return d&&a.push(d),{facts:a,...c?{deprecated:c}:{},...r?.archived?{archived:!0}:{},...l?{latestStable:l}:{},...o?.releasedAt?{targetReleasedAt:o.releasedAt}:{}}}function KGe(e,t){let n=e?.runtime,r=t?.runtime;return!r||n&&n.requirement===r.requirement?null:{statement:!n?`The target version requires ${r.name} ${r.requirement}.`:`The required ${r.name} version changed from ${n.requirement} to ${r.requirement}.`,concerning:!1,polarity:"context"}}function JGe(e,t){let n=Re(e.from,e.ecosystem),r=t?Re(t,e.ecosystem):null;if(!n?.release||!r?.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let i=(r.release[0]??0)-(n.release[0]??0);return i<1?null:{statement:`The installed version ${e.from} is ${i} major version${i===1?"":"s"} behind the latest release, ${t}. Maintainers rarely backport fixes that far.`}}function ZGe(e,t){return e.map(r=>Re(r,t)).filter(r=>r!==null&&!r.prerelease).sort((r,i)=>-(Ye(r,i)??0))[0]?.raw??null}function dU(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return`on ${e}`;let r=Math.floor((t.getTime()-n.getTime())/864e5);if(r<0)return`on ${n.toISOString().slice(0,10)}`;if(r===0)return"today";if(r===1)return"yesterday";if(r<60)return`${r} days ago`;let i=Math.round(r/30.44);return i<24?`about ${i} months ago`:`about ${Math.round(r/365.25)} years ago`}var YGe=12;async function mU(e){let{name:t,currentVersion:n,targetVersion:r,repository:i,policy:o}=e,s=n?.license??null,a=r?.license??i?.license??null,c=o.enabled?await QGe(e):[],l=p=>gU(p,o),u=c.filter(p=>!p.allowed),d=()=>`This upgrade newly introduces ${u.map(p=>`${p.name} (${p.license??"no declared license"})`).join(", ")}, which the repository policy does not permit.`;if(!a&&!s){if(!l(a)||u.length>0){let p=[];return l(a)||p.push(`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read. The repository policy requires a declared license.`),u.length>0&&p.push(d()),p.push(`The policy permits ${lE(o)}.`),{verdict:"policy-violation",statement:p.join(" "),introduced:c}}return{verdict:o.enabled?"unknown":"ok",statement:o.enabled?`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read, so this upgrade's licensing position could not be checked.`:"No license metadata was published for either version.",introduced:c}}if(s&&a&&!eBe(s,a)){let p=!l(a);if(p||u.length>0){let f=[];return f.push(p?`The declared license changed from ${s} to ${a}, which the repository policy does not permit.`:`The declared license changed from ${s} to ${a}.`),u.length>0&&f.push(d()),f.push(`The policy permits ${lE(o)}.`),{verdict:"policy-violation",from:s,to:a,statement:f.join(" "),introduced:c}}return{verdict:"changed",from:s,to:a,statement:`The declared license changed from ${s} to ${a}. It remains within this repository's configured policy.`,introduced:c}}return l(a)?u.length>0?{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:`${d()} The policy permits ${lE(o)}.`,introduced:c}:a?{verdict:"ok",...s?{from:s}:{},to:a,statement:`The license is unchanged at ${a}.`,introduced:c}:{verdict:"unknown",...s?{from:s}:{},statement:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}.`,introduced:c}:{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:a?`${t} is licensed ${a}, which the repository policy does not permit. The policy permits ${lE(o)}.`:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}. The repository policy requires a declared license.`,introduced:c}}async function QGe(e){let{currentVersion:t,targetVersion:n,ecosystem:r,policy:i}=e;if(!t||!n)return[];let o=new Set(t.dependencies),s=n.dependencies.filter(c=>!o.has(c)).slice(0,YGe);return s.length===0?[]:await Promise.all(s.map(async c=>{let u=(await oa(c,r,"latest").catch(()=>null))?.license??null;return{name:c,license:u,allowed:gU(u,i)}}))}function gU(e,t){if(!t.enabled)return!0;if(!e)return!t.requireDeclared;let n=XGe(e);return t.deny.length>0&&n.some(r=>fU(r,t.deny))?!1:t.allow.length===0?!0:e.includes(" OR ")?n.some(r=>fU(r,t.allow)):n.every(r=>fU(r,t.allow))}function XGe(e){return e.replace(/[()]/g," ").split(/\s+(?:OR|AND|WITH)\s+/i).map(t=>t.trim()).filter(Boolean)}function fU(e,t){let n=e.toLowerCase().replace(/\+$/,"");return t.some(r=>r.toLowerCase().replace(/\+$/,"")===n)}function eBe(e,t){let n=r=>r.toLowerCase().replace(/[\s._]/g,"-").replace(/-+/g,"-");return n(e)===n(t)}function lE(e){return e.allow.length>0?e.allow.join(", "):e.deny.length>0?`anything except ${e.deny.join(", ")}`:"no licenses in particular"}var tBe=[{category:"security",pattern:/\b(CVE-\d{4}-\d+|GHSA-[\w-]+|GO-\d{4}-\d+|security fix|vulnerabilit|XSS|CSRF|SSRF|remote code execution|prototype pollution|path traversal|SQL injection|denial of service|ReDoS)\b/i},{category:"breaking",pattern:/\b(BREAKING|breaking change|no longer|has been removed|was removed|is removed|removed entirely|removed support|dropped support|drop support|renamed to|has been renamed|is now required|must now|now (?:requires?|returns?|expects?|accepts?|takes?)|migrate to|migration guide|incompatible)\b/i},{category:"performance",pattern:/\b(faster|speed ?up|sped up|reduces? (?:the )?(?:allocation|memory|latency)|allocation|throughput|optimi[sz]|performance (?:improvement|gain|boost|work|regression)|improv(?:e|es|ed|ing) performance)\b/i},{category:"fix",pattern:/^\s*(?:fix(?:e[sd])?|bugfix|resolve[sd]?|correct(?:s|ed)?)\b/i}];function hU(e){let{dependency:t,evidence:n,breakingChanges:r,impactSites:i}=e,o=new Map;for(let u of i)o.set(u.breakingChangeId,(o.get(u.breakingChangeId)??0)+1);let s=[],a=new Set;for(let u of r){if(u.dependency!==t)continue;let d=o.get(u.id)??0,p=Wre(u.summary);a.has(p)||(a.add(p),s.push({category:"breaking",text:u.summary,...d>0?{affectedSites:d}:{},...qre(u,n)?{url:qre(u,n)}:{},...u.citations[0]?{citation:u.citations[0]}:{}}))}let c=0,l=new Map;for(let u of n)if(u.dependency===t&&!(u.source==="semver-heuristic"||u.source==="type-surface-diff"))for(let d of Hre(u.content)){let p=Wre(d);if(!p||a.has(p))continue;a.add(p);let f=vU(d);if(f==="breaking"&&s.some(g=>rBe(g.text,d)))continue;let m=l.get(f)??0;if(m>=6){c++;continue}l.set(f,m+1),s.push({category:f,text:d,...u.url?{url:u.url}:{},citation:u.id})}return{changes:nBe(s),unrelated:c}}function yU(e){return e.changes.filter(t=>t.category==="performance").map(t=>({statement:t.text,...t.url?{url:t.url}:{},...t.citation?{citation:t.citation}:{}}))}function bU(e,t){if(e.length===0)return null;let n=e.filter(o=>o.kind==="package-added").length,r=e.length-n,i=[];return n>0&&i.push(`${n} new package${n===1?"":"s"}`),r>0&&i.push(`${r} new exported symbol${r===1?"":"s"}`),i.length===0?null:{statement:`The target version adds ${i.join(" and ")}, none of which can break existing code. Computed from ${t}.`}}function vU(e){for(let{category:t,pattern:n}of tBe)if(n.test(e))return t;return"improvement"}var Vre={breaking:0,security:1,fix:2,performance:3,improvement:4};function nBe(e){return[...e].sort((t,n)=>{let r=Vre[t.category]-Vre[n.category];return r!==0?r:(n.affectedSites??0)-(t.affectedSites??0)})}function Hre(e){let t=[],n=null;for(let r of e.split(` +`)){let i=r.trim();if(!i||/^[-=]{3,}$/.test(i))continue;if(i.startsWith("#")){n=null;continue}let o=/^[-*+]\s+/.test(i)||/^\d+\.\s+/.test(i),s=i.replace(/^[-*+]\s+/,"").replace(/^\d+\.\s+/,"").trim();if(!(s.length<12)&&!/^(?:by\s+@|thanks|co-authored-by|https?:\/\/\S+$)/i.test(s)){if(!o&&/:\s*$/.test(s)&&vU(s)==="breaking"){n=s;continue}t.push(iBe(n&&o?`${n} ${s}`:s,240)),!o&&!/:\s*$/.test(s)&&(n=null)}}return t}function qre(e,t){for(let n of e.citations){let r=t.find(i=>i.id===n)?.url;if(r)return r}}function rBe(e,t){let n=i=>new Set(i.match(/`([^`]+)`/g)??[]),r=n(e);return r.size===0?!1:[...n(t)].some(i=>r.has(i))}function Wre(e){return e.toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}function iBe(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var Kre={critical:0,high:1,medium:2,low:3,unknown:4};function wU(e,t){return Kre[e]-Kre[t]}function kU(e){return e.reduce((t,n)=>wU(n.severity,t)<0?n.severity:t,"unknown")}var oBe=new Set(["behaviour-change","signature-change","default-change","moved-export","runtime-requirement"]);function rb(e){let t=[],{security:n,maintenance:r,license:i,impactSites:o}=e,s=o.length,a=new Set(o.map(U=>U.file)).size,c=new Map(e.breakingChanges.map(U=>[U.id,U])),l=o.filter(U=>c.get(U.breakingChangeId)?.kind!=="runtime-requirement"),u=new Set(l.map(U=>U.file)).size,d=o.filter(U=>c.get(U.breakingChangeId)?.kind==="runtime-requirement"),p=e.breakingChanges.filter(U=>U.kind==="runtime-requirement"&&U.runtime?.runtime),f=Qx(e.breakingChanges,e.runtimeAnalyses??[]),m=Vj(f),g=p.length>0&&qj(m??"unknown"),h=p.length>0?m??"unknown":void 0,v=Zf(e.breakingChanges,o,f,e.localizationRan??!0,e.localizationComplete??!0),b=new Set(v.filter(U=>U.state==="actionable").map(U=>U.changeId)),w=e.breakingChanges.filter(U=>b.has(U.id)),k=new Set(v.flatMap(U=>U.actionableSites.map(Z=>`${Z.breakingChangeId}:${Z.file}:${Z.line}`))),$=l.filter(U=>!k.has(`${U.breakingChangeId}:${U.file}:${U.line}`)),S=w.filter(U=>oBe.has(U.kind)),E=w.length-S.length,T=Yf(e.breakingChanges);n.checked&&(n.resolved.length>0&&t.push(`Fixes ${n.resolved.length} known ${br(n.resolved.length,"vulnerability","vulnerabilities")} (worst: ${kU(n.resolved)}).`),n.introduced.length>0&&t.push(`Introduces ${n.introduced.length} known ${br(n.introduced.length,"vulnerability","vulnerabilities")} not present in the installed version (worst: ${kU(n.introduced)}).`),n.carried.length>0&&t.push(`${n.carried.length} known ${br(n.carried.length,"vulnerability affects","vulnerabilities affect")} both versions; this upgrade does not address ${n.carried.length===1?"it":"them"}.`),n.resolved.length===0&&n.target.length===0&&t.push("No known vulnerabilities were found for the target version."));let A=l.filter(U=>k.has(`${U.breakingChangeId}:${U.file}:${U.line}`));A.length>0&&t.push(T?`${A.length} ${br(A.length,"place","places")} in ${new Set(A.map(U=>U.file)).size} ${br(new Set(A.map(U=>U.file)).size,"file","files")} match${A.length===1?"es":""} ${T} entries this upgrade changes.`:`${A.length} ${br(A.length,"place","places")} in ${new Set(A.map(U=>U.file)).size} ${br(new Set(A.map(U=>U.file)).size,"file","files")} use${A.length===1?"s":""} an API this upgrade changes.`),$.length>0&&t.push(`${$.length} local API match${$.length===1?"":"es"} require review; Drift did not establish a safe edit.`);for(let U of f)t.push(U.statement);if(d.length>0&&f.length===0&&t.push(...lBe(d)),s>0)E>0&&t.push(`${E} of the locally affected changes can be applied mechanically.`),S.length>0&&t.push(`${S.length} locally affected ${br(S.length,"change requires","changes require")} a developer decision rather than a substitution.`);else if(e.breakingChanges.some(U=>U.kind!=="runtime-requirement")&&!g){let U=e.breakingChanges.filter(Z=>Z.kind!=="runtime-requirement").length;t.push(T?`${U} published ${T} ${br(U,"change","changes")} require review; these package-role contracts are assessed independently of source call signatures.`:`${U} upstream API breaking ${br(U,"change","changes")}; no usage of the changed parts was located in this repository \u2014 review before upgrading.`)}for(let U of r.facts)U.concerning&&t.push(U.statement);i.verdict==="policy-violation"&&t.push(i.statement);let R=sBe(e,{affected:s,decisions:S.length,actionable:w.length>0,runtimeUnresolved:g,localizationUnresolved:v.some(U=>U.reason==="localization-incomplete"||U.reason==="impact-unresolved"),roleContractChanged:T!==null}),j=aBe(e);return e.gaps.length>0&&t.push(...e.gaps),{recommendation:R,reasons:t,confidence:j.level,confidenceBasis:j.basis,...h?{runtimeCompatibility:h}:{}}}function sBe(e,t){let{security:n,maintenance:r,license:i}=e;if(n.checked&&n.introduced.length>0||r.deprecated||i.verdict==="policy-violation"||r.facts.some(a=>a.polarity==="blocks"))return"do-not-upgrade-yet";if(t.affected>0)return t.actionable&&t.decisions>0?"manual-migration-required":"upgrade-after-review";if(t.runtimeUnresolved||t.localizationUnresolved||t.roleContractChanged)return"upgrade-after-review";let o=n.checked&&n.resolved.length>0,s=r.facts.some(a=>a.polarity==="favors");return e.breakingChanges.length===0&&!_U(e)?o||s?"upgrade-recommended":"insufficient-evidence":o||s?"upgrade-recommended":"safe-to-upgrade"}function _U(e){return e.surfaceCompared||(e.proseRead??0)>0||Zre(e).length>0}function Zre(e){return e.evidence.filter(t=>t.dependency===e.dependency&&t.workspace===e.workspace&&(t.source==="github-release"||t.source==="changelog"||t.source==="migration-guide"))}function aBe(e){let t=Math.max(Zre(e).length,e.proseRead??0),n=[];if(e.surfaceCompared){let i=Yf(e.breakingChanges);n.push(i?`the computed ${i} diff`:"the computed API diff")}return t>0&&n.push(t===1?"release notes":"release notes and changelog"),e.security.checked&&n.push("the OSV advisory database"),n.length===0?{level:"low",basis:"Nothing but the version numbers could be read for this dependency."}:{level:e.surfaceCompared||n.length>=2?"high":"medium",basis:n.length===1?`${Jre(n[0])} is the available evidence.`:`${Jre(cBe(n))} agree.`}}function Yf(e){let t=e.filter(n=>n.kind!=="runtime-requirement");return t.length===0?null:t.every(n=>n.symbols.some(r=>r.startsWith("pom:")))?"Maven POM contract":t.every(n=>n.symbols.some(r=>r.startsWith("nuget:")))?"NuGet package contract":t.every(n=>n.symbols.some(r=>r.startsWith("pub:")))?"Pub package contract":null}function cBe(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function Jre(e){return e.charAt(0).toUpperCase()+e.slice(1)}function lBe(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),r=e.filter(o=>o.runtimeVerdict==="partial"),i=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime ${br(o,"declaration","declarations")} in this repository ${br(o,"does not satisfy","do not satisfy")} this upgrade's runtime requirement.`)}if(r.length>0){let o=r.length;t.push(`${o} runtime ${br(o,"declaration allows","declarations allow")} versions this upgrade's runtime requirement rejects.`)}if(i.length>0){let o=i.length;t.push(`${o} runtime ${br(o,"declaration is","declarations are")} dynamically defined; Drift could not determine whether ${br(o,"it satisfies","they satisfy")} this upgrade's runtime requirement.`)}return t}function br(e,t,n){return e===1?t:n}var jl={"safe-to-upgrade":"Safe to upgrade","upgrade-recommended":"Upgrade recommended","upgrade-after-review":"Upgrade after review","manual-migration-required":"Migration required","insufficient-evidence":"Insufficient evidence","do-not-upgrade-yet":"Do not upgrade yet"};var uBe={"rate-limited":"rate limited","server-error":"server error","network-error":"network error"};async function $U(e,t){return Gr("rationale.prepare",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to},async()=>{let{config:n}=t,r=e.from,i=e.to,o=h=>t.onProgress?.(h);o("Checking package metadata");let s=Wn(e.name,e.ecosystem,i),a=oa(e.name,e.ecosystem,r).catch(()=>null),c=oa(e.name,e.ecosystem,i).catch(()=>null),l=n.rationale.security?(t.securityLookup??Promise.resolve(t.security).then(h=>h?.get(e)).then(h=>h??tb(e.name,e.ecosystem,r,i,t.osv??{}))).catch(h=>Uo(`Advisory lookup failed unexpectedly (${h instanceof Error?h.message:String(h)}), so this upgrade's effect on known vulnerabilities is unknown.`)):Promise.resolve(Uo("Advisory lookup is switched off for this repository (`rationale.security`), so this upgrade\u2019s effect on known vulnerabilities was not checked.")),u=await s;o("Checking repository status");let d=u?.githubRepo?await BJ(u.githubRepo,t.githubToken,(h,v)=>o(`Checking repository status (${uBe[v]}, retrying \u2014 attempt ${h})`)).catch(()=>null):null;o("Checking security advisories");let[p,f,m]=await Promise.all([a,c,l]);o("Checking license");let g=await mU({name:e.name,ecosystem:e.ecosystem,from:r,to:i,currentVersion:p,targetVersion:f,repository:d,policy:n.licenses});return{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}})}async function uE(e,t){let n=e.changes.filter(s=>s.from&&s.to),r=n.filter(s=>!t.preparedFacts?.has(s)),i=r.map(s=>({name:s.name,ecosystem:s.ecosystem,from:s.from,to:s.to})),o=t.config.rationale.security?nb(i,t.osv??{}).then(s=>new Map(r.map((a,c)=>[a,s.get(i[c])]))):void 0;return qn(n,4,async s=>{try{return await dBe(s,e,{...t,security:o})}catch(a){return t.logger.debug(`Rationale failed for ${s.name}: ${a.message}`),yBe(s,`Drift could not assemble an upgrade rationale for ${s.name}.`)}})}async function dBe(e,t,n){let r=s=>n.onProgress?.(e,s),i=n.preparedFacts?.get(e),o=await(i??$U(e,{config:n.config,...n.githubToken?{githubToken:n.githubToken}:{},...n.osv?{osv:n.osv}:{},...n.security?{security:n.security}:{},onProgress:r}));return pBe(e,t,o,n,{shared:i!==void 0})}async function pBe(e,t,n,r,i){return Gr("rationale.finalize",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to,shared:i?.shared??r.preparedFacts?.has(e)??!1},async()=>{let{config:o,logger:s}=r,a=e.from,c=e.to,l=L=>r.onProgress?.(e,L),{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}=n,h=t.breakingChanges.filter(L=>L.dependency===e.name&&L.workspace===e.workspace),v=new Set(h.map(L=>L.id)),b=t.impactSites.filter(L=>v.has(L.breakingChangeId)),w=(t.runtimeAnalyses??[]).filter(L=>v.has(L.changeId));l("Checking maintenance signals");let k=o.rationale.maintenance?pU({name:e.name,ecosystem:e.ecosystem,from:a,to:c,registry:u,repository:d,currentVersion:p,targetVersion:f,repoRuntime:(e.workspace!==void 0?r.repoRuntimeByWorkspace?.get(e.workspace):void 0)??r.repoRuntime,pythonRuntime:(e.workspace!==void 0?r.pythonRuntimeByWorkspace?.get(e.workspace):void 0)??r.pythonRuntime,analyzedRuntimeRequirements:w.map(L=>({runtime:L.runtime,requirement:L.requirement}))}):{facts:[]},$=cn(e),S=r.additions?.get($),E=r.surfaceCompared?.has($)??S!==void 0,T=o.rationale.summary?hU({dependency:e.name,evidence:t.evidence,breakingChanges:h,impactSites:b,additions:S?.additions}):{changes:[],unrelated:0},A=[...yU(T)],R=S?bU(S.additions,S.locator):null;R&&A.push(R);let j=r.prose?.get($)??r.prose?.get(e.name)??[],U=fBe(e,{surfaceCompared:E,surfaceGap:r.surfaceGaps?.get($),security:m,registry:u,evidence:t.evidence,prose:j,licenseUnknown:g.verdict==="unknown"}),Z={dependency:e.name,workspace:e.workspace,breakingChanges:h,impactSites:b,evidence:t.evidence,security:m,maintenance:k,license:g,gaps:U,surfaceCompared:E,proseRead:j.length,runtimeAnalyses:w,localizationRan:t.localizationRan,localizationComplete:t.localizationComplete},re=rb(Z);return s.debug(`${e.name} ${a} \u2192 ${c}: ${re.recommendation}`),{dependency:e.name,from:a,to:c,security:m,maintenance:k,improvements:A,license:g,summary:T,assessment:re,runtimeAnalyses:w.map(({changeId:L,runtime:te,requirement:se,state:ae,reason:Se,statement:We})=>({changeId:L,runtime:te,requirement:se,state:ae,reason:Se,statement:We})),gaps:U,hasCompatibilityEvidence:_U(Z)}})}function fBe(e,t){let n=[],r=t.evidence.filter(s=>s.dependency===e.name&&s.workspace===e.workspace&&(s.source==="github-release"||s.source==="changelog"||s.source==="migration-guide")),i=t.surfaceGap,o=r.length>0?null:t.prose.length>0?t.surfaceCompared?null:`Drift read ${gBe(t.prose)} for ${e.name} ${e.to} and found nothing in ${t.prose.length===1?"it":"them"} that announces a breaking change. That is weaker than a clean API comparison: it means nothing was flagged, not that nothing broke.`:`No release notes, changelog, or migration guide was reachable for ${e.name} ${e.to}${t.registry?.githubRepo?"":", and no source repository could be resolved for it"}.`;return i&&o?n.push(`${Qre(i.detail)}. ${o}${i.remedy?` ${i.remedy}`:""}`):i?n.push(`${Qre(i.detail)}.${i.remedy?` ${i.remedy}`:""}`):o&&n.push(o),t.security.checked||n.push(t.security.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."),hBe(n)}var mBe={"github-release":{one:"the release notes",many:"sets of release notes"},changelog:{one:"the changelog",many:"changelog files"},"migration-guide":{one:"the migration guide",many:"migration guides"}};function gBe(e){let t=r=>e.filter(i=>i.kind===r),n=[];for(let r of["github-release","changelog","migration-guide"]){let i=t(r);if(i.length===0)continue;let o=mBe[r];if(i.length===1){n.push(`${o.one} (${Yre(i[0])})`);continue}n.push(`${i.length} ${o.many} (${i.map(Yre).join(", ")})`)}return n.length===0?"the published release prose":n.length===1?n[0]:`${n.slice(0,-1).join(", ")} and ${n.at(-1)}`}function Yre(e){return`[${e.label}](${e.url})`}function hBe(e){let t=new Set,n=[];for(let r of e){let i=r.toLowerCase().replace(/[^a-z0-9]+/g," ").trim();t.has(i)||(t.add(i),n.push(r))}return n}function Qre(e){return e.replace(/\.\s*$/,"")}function yBe(e,t){return{dependency:e.name,from:e.from??"",to:e.to??"",security:{checked:!1,current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"},maintenance:{facts:[]},improvements:[],license:{verdict:"unknown",statement:"Not checked.",introduced:[]},summary:{changes:[],unrelated:0},hasCompatibilityEvidence:!1,assessment:{recommendation:"insufficient-evidence",reasons:[t],confidence:"low",confidenceBasis:t},gaps:[t]}}var tie=require("node:crypto"),Ni=require("node:fs/promises"),pE=require("node:os"),Ul=require("node:path"),nie=require("node:url"),rie=require("node:child_process");var IBe={},iie="behavioural-diff-npm-ts-v1",bBe=new Set(["behaviour-change","default-change","type-change","signature-change","required-field-added"]);function vBe(e,t){let n=t.verification.behavioural;if(!n.enabled)return[];let r=[];for(let i of e.breakingChanges){if(!bBe.has(i.kind))continue;let o=e.impactSites.filter(a=>a.breakingChangeId===i.id);if(o.length===0)continue;let s=Nr(i);if(!(!s.nature.includes("behaviour")&&s.nature!=="type-contract"&&i.kind!=="default-change"))for(let a of i.symbols.slice(0,n.maxSymbols-r.length)){let c=_Be(i),l=[{id:"default",args:[],contracts:c}],u=new Set;for(let d of o){if(l.length>=n.maxCasesPerSymbol)break;if(d.matchedSymbol!==a)continue;let p=wBe(d.excerpt,a);if(!p)continue;let f=JSON.stringify(p);u.has(f)||(u.add(f),l.push({id:`site-${l.length}`,args:p,contracts:c}))}if(r.push({dependency:i.dependency,workspace:i.workspace,symbol:a,modulePath:"",exportName:a,cases:l}),r.length>=n.maxSymbols)return r}}return r}function wBe(e,t){let r=new RegExp(`\\b${kBe(t)}\\s*\\(([^;]*)\\)`).exec(e);if(!r)return null;let i=r[1].trim();if(i==="")return[];let o=`[${i}]`.replace(/'/g,'"').replace(/([{,]\s*)([A-Za-z_$][\w$]*)\s*:/g,'$1"$2":');try{let s=JSON.parse(o);return Array.isArray(s)?s:null}catch{return null}}function kBe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _Be(e){switch(e.kind){case"default-change":return["configured-defaults","return-shape"];case"type-change":case"signature-change":case"required-field-added":return["return-shape","thrown-error","argument-mutation","promise-state"];case"behaviour-change":return["return-shape","thrown-error","argument-mutation","promise-state","serialization-output"];default:return["return-shape"]}}async function $Be(e){let{config:t,oldEnvironment:n,newEnvironment:r}=e,i=e.probes.slice(0,t.maxSymbols),o=[],s=[];if(!t.enabled)return{evidence:[],observations:[],gaps:["behavioural probing disabled"]};if(t.sandbox!=="required")return{evidence:[],observations:[],gaps:["behavioural probing requires a sandbox"]};for(let a of i){let c=a.cases.slice(0,t.maxCasesPerSymbol);for(let l of c){let u=await dE(t,n,a,l),d=await dE(t,n,a,l),p=await dE(t,r,a,l),f=await dE(t,r,a,l),m=!SU(u,d)||!SU(p,f);o.push({dependency:a.dependency,workspace:a.workspace,symbol:a.symbol,caseId:l.id,generatedInput:l.args,oldResult:u,newResult:p,observedDifference:m?"nondeterministic result; no compatibility conclusion drawn":xBe(u,p),nondeterministic:m,limitations:EBe(t,l.contracts)})}}return{observations:o,gaps:s,evidence:o.map(oie)}}async function SBe(){return typeof __dirname<"u"?(0,Ul.join)(__dirname,"behavioural-worker.js"):(0,nie.fileURLToPath)(new URL("./behavioural-worker.js",IBe.url))}async function dE(e,t,n,r){let i=await(0,Ni.mkdtemp)((0,Ul.join)((0,pE.tmpdir)(),"drift-behavioural-")),o=await(0,Ni.realpath)(i),s=(0,Ul.join)(i,"case.json"),a=await(0,Ni.realpath)(await SBe()),c=(0,Ul.resolve)(t.modulePath||n.modulePath),l=await(0,Ni.realpath)(c),u=(0,Ul.resolve)(t.packageRoot);await(0,Ni.writeFile)(s,JSON.stringify({modulePath:l,exportName:n.exportName,args:r.args,network:e.network}));let d=[a,u,await(0,Ni.realpath)(u),c,l,s,await(0,Ni.realpath)(s)],p=[Number(process.versions.node.split(".")[0])>=24?"--permission":"--experimental-permission",...[...new Set(d)].map(f=>`--allow-fs-read=${f}`),`--max-old-space-size=${e.memoryMb}`,a,s];try{return await new Promise(f=>{let m=(0,rie.spawn)(process.execPath,p,{stdio:["ignore","pipe","pipe"],env:{PATH:process.env.PATH??"",HOME:o,TMPDIR:o,DRIFT_BEHAVIOURAL_SANDBOX:"1"}});if(m.pid&&e.cpuLimit<1)try{(0,pE.setPriority)(m.pid,Math.round(10*(1-e.cpuLimit)))}catch{}let g="",h="",v=64*1024,b=setTimeout(()=>{m.kill("SIGKILL")},e.timeoutSeconds*1e3);m.stdout.on("data",w=>{g=(g+w.toString("utf8")).slice(-v)}),m.stderr.on("data",w=>{h=(h+w.toString("utf8")).slice(-v)}),m.on("close",(w,k)=>{if(clearTimeout(b),k){f({status:"timed-out",signal:k,stdoutDigest:ib(g),stderrDigest:ib(h)});return}let $=g.trim().split(` +`).at(-1)??"",S=TBe($);f(S??{status:"worker-failed",stdoutDigest:ib(g),stderrDigest:ib(h)})}),m.on("error",w=>{clearTimeout(b),f({status:"worker-failed",error:{name:w.name,messageCategory:"spawn"}})})})}finally{e.retainArtifacts||await(0,Ni.rm)(i,{recursive:!0,force:!0}).catch(()=>{})}}function SU(e,t){return JSON.stringify(Xre(e))===JSON.stringify(Xre(t))}function Xre(e){return{status:e.status,value:e.value??null,error:e.error??null,mutations:e.mutations??[]}}var eie=new Set(["worker-failed","timed-out"]);function xBe(e,t){return eie.has(e.status)&&eie.has(t.status)?`probe unavailable: neither version could be observed (${e.status})`:SU(e,t)?"no observed difference for this contract and generated input domain":e.status!==t.status?`status changed from ${e.status} to ${t.status}`:JSON.stringify(e.value??null)!==JSON.stringify(t.value??null)?"returned value changed":JSON.stringify(e.error??null)!==JSON.stringify(t.error??null)?"thrown error changed":JSON.stringify(e.mutations??[])!==JSON.stringify(t.mutations??[])?"argument mutation changed":"observable result changed"}function EBe(e,t){let n=[`Harness ${iie}; bounded to ${t.join(", ")||"return-shape"} contracts.`,"No observed difference is not proof of behavioural compatibility outside these generated inputs.",`CPU limit requested: ${e.cpuLimit} (best-effort process priority; no OS-level quota). Node subprocess enforces wall-clock, memory, output, filesystem, and network policy, and cannot spawn its own children or threads \u2014 the wall-clock timeout is the actual hard bound on CPU consumption.`];return e.network||n.push("Network APIs were disabled for the probe."),n}function oie(e){let t=JSON.stringify({generatedInput:e.generatedInput,normalizedOldResult:e.oldResult,normalizedNewResult:e.newResult,observedDifference:e.observedDifference,testHarnessVersion:iie,nondeterminismHandling:e.nondeterministic?"Repeated runs disagreed, so Drift records the observation but draws no compatibility conclusion.":"Old and new observations were repeated once and matched within each version.",limitations:e.limitations},null,2);return{id:`ev_behaviour_${ib(`${e.workspace??""}:${e.dependency}:${e.symbol}:${e.caseId}`).slice(0,12)}`,source:"behavioural-diff",dependency:e.dependency,...e.workspace!==void 0?{workspace:e.workspace}:{},locator:`${e.symbol}:${e.caseId}`,title:`Behavioural differential probe for ${e.symbol}`,content:t,weight:e.observedDifference.startsWith("probe unavailable")?0:e.observedDifference.startsWith("no observed difference")?.25:.8,findings:[{code:"behavioural-observation",symbol:e.symbol,detail:e.observedDifference}]}}async function sie(e){let t=e.config.verification.behavioural,n=[],r=new Map,i=[];if(!t.enabled)return{evidence:n,citationsByChangeId:r,gaps:i};let o=vBe({breakingChanges:e.breakingChanges,impactSites:e.impactSites},e.config);if(o.length===0)return{evidence:n,citationsByChangeId:r,gaps:i};let s=new Map;for(let a of o){let c=Ac({name:a.dependency,workspace:a.workspace}),l=s.get(c);l?l.probes.push(a):s.set(c,{dependency:a.dependency,workspace:a.workspace,probes:[a]})}for(let{dependency:a,workspace:c,probes:l}of s.values()){let u=e.dependencyChanges.find(f=>f.name===a&&f.workspace===c&&f.ecosystem==="npm");if(!u?.from||!u.to){i.push(`${a}: behavioural probing needs both a resolved old and new version; skipped.`);continue}let d=await e.resolveEnvironments(u);if(!d){i.push(`${a}: could not resolve ${u.from} and ${u.to} to executable code for behavioural probing; skipped.`);continue}let p=await $Be({config:t,probes:l,oldEnvironment:d.oldEnvironment,newEnvironment:d.newEnvironment});i.push(...p.gaps);for(let f of p.observations){let m=oie(f);n.push(m);for(let g of e.breakingChanges){if(g.dependency!==a||g.workspace!==c||!g.symbols.includes(f.symbol))continue;let h=r.get(g.id);h?h.push(m.id):r.set(g.id,[m.id])}}}return{evidence:n,citationsByChangeId:r,gaps:i}}function aie(e){return e.startsWith("probe unavailable")?"probe-unavailable":e.startsWith("no observed difference")?"no-difference":e.includes("returned value changed")?"return-value":e.startsWith("status changed")?"thrown-error":e.includes("argument mutation")?"argument-mutation":"behaviour"}function TBe(e){try{return JSON.parse(e)}catch{return null}}function ib(e){return(0,tie.createHash)("sha256").update(e).digest("hex")}var io=require("node:fs/promises"),lie=require("node:os"),zl=require("node:path");function ABe(e){return RBe(e.exports)??e.module??e.main??"index.js"}function RBe(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e,n="."in t?t["."]:t,r=(i,o)=>{if(o>6||i==null)return null;if(typeof i=="string")return i;if(typeof i!="object")return null;let s=i;for(let a of["import","require","default","node"]){if(!(a in s))continue;let c=r(s[a],o+1);if(c)return c}return null};return r(n,0)}var cie="https://cdn.jsdelivr.net/npm";async function xU(e,t,n){let r=await xe(`${cie}/${t}@${n}/package.json`);if(!r)return null;let i=ABe(r).replace(/^\.\//,""),o=await nt(`${cie}/${t}@${n}/${i}`);if(o===null)return null;let s=await(0,io.mkdtemp)((0,zl.join)((0,lie.tmpdir)(),"drift-behavioural-env-")),a=(0,zl.join)(s,i);return await(0,io.mkdir)((0,zl.dirname)(a),{recursive:!0}),await(0,io.writeFile)(a,o),await(0,io.writeFile)((0,zl.join)(s,"package.json"),JSON.stringify(r)),{label:e,packageRoot:await(0,io.realpath)(s),modulePath:await(0,io.realpath)(a)}}var SE=require("node:path");function EU(){return{probes:new Map}}function PBe(e,t,n,r){let i=CBe(t,n),o=r?.probes.get(i);if(o)return o;let s=e(t,["--version"],{timeoutMs:2e4,...n?{env:n}:{}}).then(a=>a.failure!=="not-found").catch(()=>!0);return r?.probes.set(i,s),s}async function uie(e,t,n,r){let i=[...new Set(t)],o=await Promise.all(i.map(s=>PBe(e,s,n,r)));return new Map(i.map((s,a)=>[s,o[a]]))}function CBe(e,t){let n=t??process.env,r=n.PATH??n.Path??n.path??"",i=n.PATHEXT??n.PathExt??"";return JSON.stringify([e,r,i,process.platform])}var fE=require("node:os");function mE(){try{return Math.max(1,(0,fE.availableParallelism)())}catch{return 4}}function NBe(){try{return Math.max(2,Math.floor((0,fE.totalmem)()/(512*1024*1024)))}catch{return 8}}function TU(e,t,n){return Math.max(t,Math.min(n,Math.floor(e)))}function IU(e,t){let n=t[e];if(!n)return;let r=Number(n);return Number.isFinite(r)&&r>=1?Math.floor(r):void 0}function gE(e=process.env){return IU("DRIFT_NETWORK_CONCURRENCY",e)??TU(mE()*4,8,32)}function AU(e=process.env){return IU("DRIFT_CONCURRENCY",e)??TU(Math.min(mE()*2,NBe()),4,16)}function hE(e=process.env){return IU("DRIFT_LOCAL_CONCURRENCY",e)??TU(mE()/4,2,6)}function die(e=process.env){return`${mE()} cores \xB7 ${gE(e)} network, ${AU(e)} analysis, ${hE(e)} local`}var RU=require("node:crypto");var DBe=1,dxt=10080*60*1e3;function pie(e){let t=(0,RU.createHash)("sha256");t.update(`v${DBe} `),t.update(`${e.head} `),t.update(`${e.dir} `),t.update(`${e.packageManager} `),t.update(`${[...e.kinds].sort().join(",")} `),t.update(`${e.runtime} -`);for(let n of[...e.files].sort((i,r)=>i.path.localeCompare(r.path)))t.update(`${n.path} -`),t.update((0,F1.createHash)("sha256").update(n.content).digest("hex")),t.update(` -`);return t.digest("hex")}var Mje={async read(){return null},async write(){}};function U1(){return Mje}var _x=require("node:path");var sne=["typecheck","test","build"],Lje={typecheck:["typecheck","type-check","types","check-types","tsc","check"],test:["test","tests","test:unit"],build:["build","compile"]};function kx(e,t){let n=Fje(e,t);return sne.flatMap(i=>n.filter(r=>r.kind===i))}function Fje(e,t){switch(e){case"npm":case"pnpm":case"yarn":case"yarn-berry":case"bun":return jje(e,t);case"cargo":return[Oe("typecheck",{command:"cargo",args:["check"]},"the Cargo toolchain"),Oe("test",{command:"cargo",args:["test"]},"the Cargo toolchain"),Oe("build",{command:"cargo",args:["build"]},"the Cargo toolchain",!0)];case"go":return[Oe("typecheck",{command:"go",args:["vet","./..."]},"the Go toolchain"),Oe("test",{command:"go",args:["test","./..."]},"the Go toolchain"),Oe("build",{command:"go",args:["build","./..."]},"the Go toolchain",!0)];case"poetry":case"uv":case"pip":return Vje(e,t);case"bundler":return Bje(t);case"maven":return[Oe("typecheck",{command:"mvn",args:["-q","test-compile"]},"Maven"),Oe("test",{command:"mvn",args:["-q","test"]},"Maven"),Oe("build",{command:"mvn",args:["-q","package","-DskipTests"]},"Maven",!0)];case"gradle":return[Oe("typecheck",{command:"gradle",args:["compileTestJava"]},"Gradle"),Oe("test",{command:"gradle",args:["test"]},"Gradle"),Oe("build",{command:"gradle",args:["build","-x","test"]},"Gradle",!0)];case"sbt":return[Oe("typecheck",{command:"sbt",args:["Test/compile"]},"sbt"),Oe("test",{command:"sbt",args:["test"]},"sbt"),Oe("build",{command:"sbt",args:["package"]},"sbt",!0)];case"dotnet":return[Oe("typecheck",{command:"dotnet",args:["build","--nologo"]},"the .NET SDK"),Oe("test",{command:"dotnet",args:["test","--nologo"]},"the .NET SDK"),Oe("build",{command:"dotnet",args:["publish","--nologo"]},"the .NET SDK",!0)];case"composer":return Uje(t);case"mix":return[Oe("typecheck",{command:"mix",args:["compile","--warnings-as-errors"]},"Mix"),Oe("test",{command:"mix",args:["test"]},"Mix"),Oe("build",{command:"mix",args:["compile"]},"Mix",!0)];case"rebar":return[Oe("typecheck",{command:"rebar3",args:["compile"]},"Rebar3"),Oe("test",{command:"rebar3",args:["eunit"]},"Rebar3")];case"dart":return[Oe("typecheck",{command:"dart",args:["analyze"]},"the Dart SDK"),Oe("test",{command:"dart",args:["test"]},"the Dart SDK")];case"flutter":return[Oe("typecheck",{command:"flutter",args:["analyze"]},"the Flutter SDK"),Oe("test",{command:"flutter",args:["test"]},"the Flutter SDK")];case"swiftpm":return[Oe("typecheck",{command:"swift",args:["build"]},"the Swift toolchain"),Oe("test",{command:"swift",args:["test"]},"the Swift toolchain")];case"cocoapods":return[];case"opam":return[Oe("typecheck",{command:"dune",args:["build","@check"]},"dune"),Oe("test",{command:"dune",args:["runtest"]},"dune"),Oe("build",{command:"dune",args:["build"]},"dune",!0)];case"conan":case"vcpkg":return[Oe("build",e==="conan"?{command:"conan",args:["build","."]}:{command:"cmake",args:["--build","build"]},e==="conan"?"Conan":"CMake",!0)];case"arduino-cli":return[Oe("build",{command:"arduino-cli",args:["compile","--warnings","all"]},"Arduino CLI",!0)];case"platformio":return[Oe("build",{command:"pio",args:["run"]},"PlatformIO",!0),Oe("test",{command:"pio",args:["test"]},"PlatformIO")]}}function Uje(e){let t=Gt(e??""),n=[];if(t?.scripts&&"test"in t.scripts)return n.push(Oe("test",{command:"composer",args:["run","test"]},"`scripts.test` in composer.json")),n;let i=t?.["require-dev"]??{};return"phpunit/phpunit"in i?n.push(Oe("test",{command:"vendor/bin/phpunit",args:[]},"phpunit, declared in composer.json",!1,wx("composer"))):"pestphp/pest"in i&&n.push(Oe("test",{command:"vendor/bin/pest",args:[]},"pest, declared in composer.json",!1,wx("composer"))),"phpstan/phpstan"in i?n.push(Oe("typecheck",{command:"vendor/bin/phpstan",args:["analyse"]},"phpstan, declared in composer.json",!0,wx("composer"))):"vimeo/psalm"in i&&n.push(Oe("typecheck",{command:"vendor/bin/psalm",args:[]},"psalm, declared in composer.json",!0,wx("composer"))),n}function jje(e,t){let n=Gt(t??"")?.scripts;if(!n)return[];let i=e==="yarn"||e==="yarn-berry"?"yarn":e,r=[];for(let o of sne){let s=Lje[o].find(c=>typeof n[c]=="string");if(!s)continue;let a=s==="test"&&e!=="yarn"&&e!=="yarn-berry"?["test"]:i==="yarn"?[s]:["run",s];r.push(Oe(o,{command:i,args:a},`\`scripts.${s}\` in package.json`,o!=="test"&&Gje(n[s])))}return r}var zje=new Set(["tsc","vue-tsc","svelte-check"]);function Gje(e){return e.split(/&&|\|\||;/).some(t=>{let n=t.trim().split(/\s+/).filter(Boolean),i=0;for(;n[i]&&/^[\w.]+=/.test(n[i]);)i+=1;return n[i]==="npx"&&(i+=1),n[i]!==void 0&&zje.has(n[i])})}function Vje(e,t){let n=t??"",i=pi(n),r=l=>i.some(u=>u.header===l||u.header.startsWith(`${l}.`)),o=l=>new RegExp(`["']${l}\\b`,"i").test(n),s=e==="poetry"?["poetry","run"]:e==="uv"?["uv","run"]:null,a=(l,u)=>s?{command:s[0],args:[...s.slice(1),l,...u]}:{command:l,args:u},c=[];return r("tool.mypy")||o("mypy")?c.push(Oe("typecheck",a("mypy",["."]),"mypy, declared in pyproject.toml")):(r("tool.pyright")||o("pyright"))&&c.push(Oe("typecheck",a("pyright",[]),"pyright, declared in pyproject.toml")),(r("tool.pytest")||r("tool.pytest.ini_options")||o("pytest"))&&c.push(Oe("test",a("pytest",[]),"pytest, declared in pyproject.toml")),c}function Bje(e){let t=e??"",n=[];return/gem\s+["']rspec/.test(t)?n.push(Oe("test",{command:"bundle",args:["exec","rspec"]},"rspec, declared in the Gemfile")):/gem\s+["'](minitest|rake)/.test(t)&&n.push(Oe("test",{command:"bundle",args:["exec","rake","test"]},"rake, declared in the Gemfile")),n}function Oe(e,t,n,i=e==="typecheck",r={kind:"host",command:t.command}){return{kind:e,label:[t.command,...t.args].join(" "),command:t,source:n,commandOrigin:r,compileCapable:i}}function wx(...e){return{kind:"post-install",requiredHostCommands:e}}var qje=40,Wje=10*6e4;async function Sx(e,t="",n=Hn(),i){let r=t?(0,_x.join)(e,t):e,o=await n.readDirectory(r);if(o.length===0)return[];let s=da({entries:o}),a=i?s.find(u=>u.manager.id===i):void 0,c=a?[a,...s.filter(u=>u.manager.ecosystem!==a.manager.ecosystem)]:s,l=[];for(let{manager:u}of c){let d=u.manifests.find(f=>o.includes(f)),p=d?await n.readFile((0,_x.join)(r,d)):null;for(let f of kx(u.id,p))l.some(m=>m.label===f.label)||l.push(f)}return l}async function xx(e){let t=e.dir?(0,_x.join)(e.root,e.dir):e.root,n=e.exec??Xe,i=e.env??process.env,r=[],o=e.checks.length,s=!1;for(let[a,c]of e.checks.entries()){if(s){r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:0,output:"",reason:"An earlier check already failed, so this one was not run."}));continue}if(e.token?.isCancellationRequested){r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"cancelled",durationMs:0,output:"",reason:"Cancelled before this check ran."}));continue}e.onProgress?.(c,a,o);let l=Date.now(),u=await n(c.command.command,c.command.args,{cwd:t,env:i,timeoutMs:e.timeoutMs??Wje,...e.signal?{signal:e.signal}:{},...e.onOutput?{onOutput:p=>e.onOutput(c,p)}:{}}),d=Date.now()-l;if(u.failure==="not-found"){r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:d,output:"",reason:e.notFoundReason?.(c.command.command)??`\`${c.command.command}\` was not found on PATH, so this check could not run.`}));continue}u.code!==0&&e.stopOnFirstFailure&&(s=!0),r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:u.code===0?"passed":"failed",durationMs:d,output:Hje(`${u.stdout} +`);for(let n of[...e.files].sort((r,i)=>r.path.localeCompare(i.path)))t.update(`${n.path} +`),t.update((0,RU.createHash)("sha256").update(n.content).digest("hex")),t.update(` +`);return t.digest("hex")}var OBe={async read(){return null},async write(){}};function PU(){return OBe}var wE=require("node:path");var fie=["typecheck","test","build"],MBe={typecheck:["typecheck","type-check","types","check-types","tsc","check"],test:["test","tests","test:unit"],build:["build","compile"]};function bE(e,t){let n=LBe(e,t);return fie.flatMap(r=>n.filter(i=>i.kind===r))}function LBe(e,t){switch(e){case"npm":case"pnpm":case"yarn":case"yarn-berry":case"bun":return jBe(e,t);case"cargo":return[Oe("typecheck",{command:"cargo",args:["check"]},"the Cargo toolchain"),Oe("test",{command:"cargo",args:["test"]},"the Cargo toolchain"),Oe("build",{command:"cargo",args:["build"]},"the Cargo toolchain",!0)];case"go":return[Oe("typecheck",{command:"go",args:["vet","./..."]},"the Go toolchain"),Oe("test",{command:"go",args:["test","./..."]},"the Go toolchain"),Oe("build",{command:"go",args:["build","./..."]},"the Go toolchain",!0)];case"poetry":case"uv":case"pip":return GBe(e,t);case"bundler":return BBe(t);case"maven":return[Oe("typecheck",{command:"mvn",args:["-q","test-compile"]},"Maven"),Oe("test",{command:"mvn",args:["-q","test"]},"Maven"),Oe("build",{command:"mvn",args:["-q","package","-DskipTests"]},"Maven",!0)];case"gradle":return[Oe("typecheck",{command:"gradle",args:["compileTestJava"]},"Gradle"),Oe("test",{command:"gradle",args:["test"]},"Gradle"),Oe("build",{command:"gradle",args:["build","-x","test"]},"Gradle",!0)];case"sbt":return[Oe("typecheck",{command:"sbt",args:["Test/compile"]},"sbt"),Oe("test",{command:"sbt",args:["test"]},"sbt"),Oe("build",{command:"sbt",args:["package"]},"sbt",!0)];case"dotnet":return[Oe("typecheck",{command:"dotnet",args:["build","--nologo"]},"the .NET SDK"),Oe("test",{command:"dotnet",args:["test","--nologo"]},"the .NET SDK"),Oe("build",{command:"dotnet",args:["publish","--nologo"]},"the .NET SDK",!0)];case"composer":return FBe(t);case"mix":return[Oe("typecheck",{command:"mix",args:["compile","--warnings-as-errors"]},"Mix"),Oe("test",{command:"mix",args:["test"]},"Mix"),Oe("build",{command:"mix",args:["compile"]},"Mix",!0)];case"rebar":return[Oe("typecheck",{command:"rebar3",args:["compile"]},"Rebar3"),Oe("test",{command:"rebar3",args:["eunit"]},"Rebar3")];case"dart":return[Oe("typecheck",{command:"dart",args:["analyze"]},"the Dart SDK"),Oe("test",{command:"dart",args:["test"]},"the Dart SDK")];case"flutter":return[Oe("typecheck",{command:"flutter",args:["analyze"]},"the Flutter SDK"),Oe("test",{command:"flutter",args:["test"]},"the Flutter SDK")];case"swiftpm":return[Oe("typecheck",{command:"swift",args:["build"]},"the Swift toolchain"),Oe("test",{command:"swift",args:["test"]},"the Swift toolchain")];case"cocoapods":return[];case"opam":return[Oe("typecheck",{command:"dune",args:["build","@check"]},"dune"),Oe("test",{command:"dune",args:["runtest"]},"dune"),Oe("build",{command:"dune",args:["build"]},"dune",!0)];case"conan":case"vcpkg":return[Oe("build",e==="conan"?{command:"conan",args:["build","."]}:{command:"cmake",args:["--build","build"]},e==="conan"?"Conan":"CMake",!0)];case"arduino-cli":return[Oe("build",{command:"arduino-cli",args:["compile","--warnings","all"]},"Arduino CLI",!0)];case"platformio":return[Oe("build",{command:"pio",args:["run"]},"PlatformIO",!0),Oe("test",{command:"pio",args:["test"]},"PlatformIO")]}}function FBe(e){let t=Bt(e??""),n=[];if(t?.scripts&&"test"in t.scripts)return n.push(Oe("test",{command:"composer",args:["run","test"]},"`scripts.test` in composer.json")),n;let r=t?.["require-dev"]??{};return"phpunit/phpunit"in r?n.push(Oe("test",{command:"vendor/bin/phpunit",args:[]},"phpunit, declared in composer.json",!1,yE("composer"))):"pestphp/pest"in r&&n.push(Oe("test",{command:"vendor/bin/pest",args:[]},"pest, declared in composer.json",!1,yE("composer"))),"phpstan/phpstan"in r?n.push(Oe("typecheck",{command:"vendor/bin/phpstan",args:["analyse"]},"phpstan, declared in composer.json",!0,yE("composer"))):"vimeo/psalm"in r&&n.push(Oe("typecheck",{command:"vendor/bin/psalm",args:[]},"psalm, declared in composer.json",!0,yE("composer"))),n}function jBe(e,t){let n=Bt(t??"")?.scripts;if(!n)return[];let r=e==="yarn"||e==="yarn-berry"?"yarn":e,i=[];for(let o of fie){let s=MBe[o].find(c=>typeof n[c]=="string");if(!s)continue;let a=s==="test"&&e!=="yarn"&&e!=="yarn-berry"?["test"]:r==="yarn"?[s]:["run",s];i.push(Oe(o,{command:r,args:a},`\`scripts.${s}\` in package.json`,o!=="test"&&zBe(n[s])))}return i}var UBe=new Set(["tsc","vue-tsc","svelte-check"]);function zBe(e){return e.split(/&&|\|\||;/).some(t=>{let n=t.trim().split(/\s+/).filter(Boolean),r=0;for(;n[r]&&/^[\w.]+=/.test(n[r]);)r+=1;return n[r]==="npx"&&(r+=1),n[r]!==void 0&&UBe.has(n[r])})}function GBe(e,t){let n=t??"",r=di(n),i=l=>r.some(u=>u.header===l||u.header.startsWith(`${l}.`)),o=l=>new RegExp(`["']${l}\\b`,"i").test(n),s=e==="poetry"?["poetry","run"]:e==="uv"?["uv","run"]:null,a=(l,u)=>s?{command:s[0],args:[...s.slice(1),l,...u]}:{command:l,args:u},c=[];return i("tool.mypy")||o("mypy")?c.push(Oe("typecheck",a("mypy",["."]),"mypy, declared in pyproject.toml")):(i("tool.pyright")||o("pyright"))&&c.push(Oe("typecheck",a("pyright",[]),"pyright, declared in pyproject.toml")),(i("tool.pytest")||i("tool.pytest.ini_options")||o("pytest"))&&c.push(Oe("test",a("pytest",[]),"pytest, declared in pyproject.toml")),c}function BBe(e){let t=e??"",n=[];return/gem\s+["']rspec/.test(t)?n.push(Oe("test",{command:"bundle",args:["exec","rspec"]},"rspec, declared in the Gemfile")):/gem\s+["'](minitest|rake)/.test(t)&&n.push(Oe("test",{command:"bundle",args:["exec","rake","test"]},"rake, declared in the Gemfile")),n}function Oe(e,t,n,r=e==="typecheck",i={kind:"host",command:t.command}){return{kind:e,label:[t.command,...t.args].join(" "),command:t,source:n,commandOrigin:i,compileCapable:r}}function yE(...e){return{kind:"post-install",requiredHostCommands:e}}var VBe=40,qBe=10*6e4;async function kE(e,t="",n=Hn(),r){let i=t?(0,wE.join)(e,t):e,o=await n.readDirectory(i);if(o.length===0)return[];let s=ca({entries:o}),a=r?s.find(u=>u.manager.id===r):void 0,c=a?[a,...s.filter(u=>u.manager.ecosystem!==a.manager.ecosystem)]:s,l=[];for(let{manager:u}of c){let d=u.manifests.find(f=>o.includes(f)),p=d?await n.readFile((0,wE.join)(i,d)):null;for(let f of bE(u.id,p))l.some(m=>m.label===f.label)||l.push(f)}return l}async function _E(e){let t=e.dir?(0,wE.join)(e.root,e.dir):e.root,n=e.exec??Qe,r=e.env??process.env,i=[],o=e.checks.length,s=!1;for(let[a,c]of e.checks.entries()){if(s){i.push(vE(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:0,output:"",reason:"An earlier check already failed, so this one was not run."}));continue}if(e.token?.isCancellationRequested){i.push(vE(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"cancelled",durationMs:0,output:"",reason:"Cancelled before this check ran."}));continue}e.onProgress?.(c,a,o);let l=Date.now(),u=await n(c.command.command,c.command.args,{cwd:t,env:r,timeoutMs:e.timeoutMs??qBe,...e.signal?{signal:e.signal}:{},...e.onOutput?{onOutput:p=>e.onOutput(c,p)}:{}}),d=Date.now()-l;if(u.failure==="not-found"){i.push(vE(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:d,output:"",reason:e.notFoundReason?.(c.command.command)??`\`${c.command.command}\` was not found on PATH, so this check could not run.`}));continue}u.code!==0&&e.stopOnFirstFailure&&(s=!0),i.push(vE(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:u.code===0?"passed":"failed",durationMs:d,output:WBe(`${u.stdout} ${u.stderr}`),fullOutput:`${u.stdout} -${u.stderr}`,...u.failure==="timeout"?{reason:"Timed out."}:{}}))}return r}function $x(e,t,n){return e.onResult?.(n,t,e.checks.length),n}function Hje(e){let t=e.split(` -`).filter(i=>i.trim().length>0),n=t.slice(-qje);return n.lengthr.trim().length>0),n=t.slice(-VBe);return n.length]+\((\w[\w$]*\.(?:java|kt|scala)):(\d+)\)/;function Of(e){return e.replace(/\x1b\[[0-9;]*m/g,"").trim().slice(0,300)}function Ex(e,t){let n=e.replace(/\\/g,"/").replace(/^\.\//,"");if(t){let i=t.replace(/\\/g,"/").replace(/\/+$/,"");if(n===i)return n;n.startsWith(`${i}/`)&&(n=n.slice(i.length+1))}return n}function cne(e,t){let n=[],i=new Set,r=s=>{let a=`${s.file}|${s.line}|${s.column??""}|${s.code??""}|${s.message}`;i.has(a)||(i.add(a),n.push(s))},o=null;for(let s of e.split(` -`)){let a=s.replace(/\x1b\[[0-9;]*m/g,""),c=Xje.exec(a);if(c){o={testClass:c[2]??c[3],testName:c[1]??c[4],message:null,frames:0};continue}if(o){let f=eze.exec(a);if(f){let g=f[1].split("$")[0];if(g===o.testClass.split("$")[0]&&o.frames<3){o.frames++;let h=g.includes(".")?`${g.slice(0,g.lastIndexOf(".")).replace(/\./g,"/")}/`:"";r({file:`${h}${f[2]}`,line:Number(f[3]),message:Of(o.message??`${o.testName} failed`),severity:"error",origin:"stack-frame"})}continue}o.message===null&&a.trim().length>0&&(o.message=Of(a))}let l=Kje.exec(a);if(l){let f=Number(l[2]??l[4]),m=Number(l[3]??l[5]);r({file:Ex(l[1],t),line:f,...Number.isFinite(m)&&m>0?{column:m-1}:{},code:l[7].toUpperCase(),message:Of(l[8]??""),severity:(l[6]??"error").toLowerCase()==="warning"?"warning":"error"});continue}let u=Jje.exec(a);if(u){let f=Number(u[3]);r({file:Ex(u[1],t),line:Number(u[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:Of(u[4]??""),severity:/^\s*\[WARNING\]/.test(a)?"warning":"error"});continue}let d=Zje.exec(a);if(d){r({file:Ex(d[1],t),line:Number(d[2]),message:Of(d[4]??""),severity:(d[3]??"error").toLowerCase()==="warning"?"warning":"error"});continue}if(Yje.test(a))continue;let p=Qje.exec(a);if(p){let f=Number(p[3]),m=Of(p[4]??"");if(m.length===0)continue;r({file:Ex(p[1],t),line:Number(p[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:m,severity:/warning/i.test(m)?"warning":"error"})}}return n}function ane(e){let t=e.message.toLowerCase().replace(/['"`].*?['"`]/g,"\u2039\u203A").replace(/\s+/g," ").slice(0,80);return`${e.file}|${e.code??""}|${t}`}function lne(e,t){let n=new Set(t.map(ane));return e.filter(i=>i.severity==="error"&&!n.has(ane(i)))}var hne=["typecheck","build","test"];async function yne(e){let t={...e,toolAvailability:D1()},n=new Map,i=(a,c)=>{n.set(a.id,c),t.onVerified?.(a,c)};if(t.targets.length===0)return n;let r=[...fze(t.targets)],o=0,s=t.targets.length;return await qn(r,Math.max(1,t.concurrency??vx()),async([a,c])=>{if(t.token?.isCancellationRequested){for(let u of c)i(u,B1());return}let l=mze(a);await tze(t,l,c,{report:(u,d,p)=>t.onProgress?.({phase:u,detail:d,done:o,total:s,...p?{targets:p.map(f=>f.id)}:{}}),output:u=>t.onProgress?.({phase:"",detail:"",done:o,total:s,output:u}),settle:(u,d)=>{o+=1,i(u,d)}})}),await a1(),n}async function tze(e,t,n,i){let r=e.exec??Xe,o=au(e.env??process.env),s=wne(e.root,t),a=await(e.warm?.take(t,n[0].packageManager)??bne(e,t,n[0].packageManager,i));if(!a.ok){for(let d of n)i.settle(d,jo(a.reason));return}let{worktree:c,usable:l,manager:u}=a;for(let d of a.notes)i.report(`Preparing a test checkout of ${s}`,d);try{let d={exec:r,env:o,dir:t,root:c.path,usable:l,install:u?.install,...e.installTogether?{installTogether:e.installTogether}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{},...e.token?{token:e.token}:{}};await G1(d,n,i)}finally{await c.dispose()}}var nze=4;async function G1(e,t,n){if(e.token?.isCancellationRequested){for(let c of t)n.settle(c,B1());return!0}let i=t.length===1?t[0]:void 0;if(i)return une(e,i,n);let r=await aze(e,t,n);if(r!=="inconclusive")return r==="settled";if(t.length<=nze){for(let[c,l]of t.entries()){if(e.token?.isCancellationRequested){n.settle(l,B1());continue}if(!await une(e,l,n))return gne(t,c+1,n),!1}return!0}let o=Math.ceil(t.length/2),s=t.slice(0,o),a=t.slice(o);return await G1(e,s,n)?G1(e,a,n):(gne(a,0,n),!1)}async function une(e,t,n){let i=`Testing ${t.name}@${t.selected}`;n.report(i,"installing into the test checkout",[t]);try{await t.install(e.root)}catch(r){return n.settle(t,jo(`${t.name}@${t.selected} could not be installed, so it could not be tested. ${Ix(r)}`)),V1(e)}return n.report(i,e.usable.map(r=>r.label).join(", "),[t]),n.settle(t,W1(await kne(e,n,i,[t]),e.root)),V1(e)}async function dne(e,t,n,i){let r=[...new Set(t.flatMap(pne))];if(r.length===0)return{usable:t,missing:[]};let o=await rne(e,r,n,i),s=c=>pne(c).every(l=>o.get(l)===!0);return{usable:t.filter(s),missing:r.filter(c=>o.get(c)===!1)}}function pne(e){return e.commandOrigin.kind==="host"?[e.commandOrigin.command]:[...e.commandOrigin.requiredHostCommands]}function rze(e,t,n){let i=e.install?[{kind:"build",label:`${e.install.command} ${e.install.args.join(" ")}`.trim(),command:e.install,source:`${e.label} install`,commandOrigin:{kind:"host",command:e.install.command},compileCapable:!1}]:[],r=kx(e.id,null).filter(s=>n.includes(s.kind)),o=i.length>0?t.filter(s=>n.includes(s.kind)):[];return ize([...i,...r,...o])}function ize(e){let t=[];for(let n of e)t.some(i=>i.label===n.label)||t.push(n);return t}function fne(e){return e.length===1?`\`${e[0]}\` is`:`${e.slice(0,-1).map(t=>`\`${t}\``).join(", ")} and \`${e.at(-1)}\` are`}async function bne(e,t,n,i){let r=e.exec??Xe,o=au(e.env??process.env),s=e.kinds??hne,a=wne(e.root,t),c=Uc(n),l=c?await Sx(e.root,t,e.fs??Hn(),n).catch(()=>[]):[],u=c?rze(c,l,s):[];if(u.length>0){let E=await dne(r,u,o,e.toolAvailability);if(E.usable.length===0)return nt("verify.skipped.noTool"),{ok:!1,reason:`${fne(E.missing)} not installed, so ${a} could not be built or tested against the upgrade.`}}i.report(`Preparing a test checkout of ${a}`,"checking out a clean copy");let d,p=It("verify","worktree",{project:a});try{d=await ax(e.root,`probe-${t||"root"}`,{exec:r,env:o,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}}),p.end()}catch(E){return p.end({failed:!0}),{ok:!1,reason:Ix(E)}}let f=[];d.copiedFiles.length>0&&f.push(`carried over ${j1(d.copiedFiles,d.copiedRules)} not tracked by git`),d.oversizedFiles.length>0&&f.push(`skipped ${j1(d.oversizedFiles,d.oversizedRules)} \u2014 too large to carry over automatically, which may make a check fail for a reason unrelated to this upgrade`),d.skippedSecrets.length>0&&f.push(`never copied ${j1(d.skippedSecrets,d.skippedSecretRules)} \u2014 ${d.skippedSecrets.length===1?"it looked":"they looked"} like credentials, which may make a check fail for a reason unrelated to this upgrade; see \`verify.generatedSourceGlobs\` if the project genuinely needs ${d.skippedSecrets.length===1?"it":"one of them"}`);let m=async E=>(await d.dispose(),{ok:!1,reason:E}),g=(await Sx(d.path,t,e.fs??Hn(),n)).filter(E=>s.includes(E.kind));if(g.length===0)return m("This project declares no typecheck or build that Drift could run against the upgrade.");let h=await dne(r,g,o,e.toolAvailability),b=h.usable;if(b.length===0)return m(h.missing.length>0?`${fne(h.missing)} not installed, so ${a} could not be built or tested against the upgrade.`:"This project declares checks, but none of them could run in the current environment.");let y=c?.install;if(y){i.report(`Installing ${a}'s dependencies`,`\`${y.command} ${y.args.join(" ")}\``),nt("verify.install");let E=await En("verify","install",()=>r(y.command,y.args,{cwd:t?`${d.path}/${t}`:d.path,env:o,timeoutMs:e.timeoutMs??q1,...e.signal?{signal:e.signal}:{},onOutput:i.output}),{project:a,manager:y.command});if(E.code!==0){let T=(E.stderr||E.stdout).trim().split(` -`).slice(-3).join(" ");return m(`\`${y.command} ${y.args.join(" ")}\` failed in a clean checkout, so there was nothing to test the upgrade against. ${T}`.trim())}}if(e.token?.isCancellationRequested)return m("Cancelled before this upgrade could be tested.");let w=e.baselineCache??U1(),k=await oze(e,d.path,t,n,b),_=k?await w.read(k):null,S;if(_)nt("verify.baseline.cached"),i.report(`Checking ${a} as it is`,`reusing the baseline measured earlier for this commit (${_.filter(E=>E.status==="passed").length} of ${_.length} checks green)`),S=_;else{nt("verify.baseline.measured");let E=It("verify","baseline",{project:a,checks:b.length});i.report(`Checking ${a} as it is`,`${b.map(A=>A.label).join(", ")}`);let T=await xx({root:d.path,dir:t,checks:b,env:o,exec:r,onProgress:A=>i.report(`Checking ${a} as it is`,`\`${A.label}\``),onOutput:(A,L)=>i.output(L),...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}});E.end(),S=T,k&&!e.token?.isCancellationRequested&&await w.write(k,T)}let x=b.filter(E=>S.some(T=>T.label===E.label&&T.status==="passed"));return x.length===0?m(pze(S)):{ok:!0,worktree:d,usable:x,manager:c,notes:f}}async function oze(e,t,n,i,r){if(!e.baselineCache)return null;let o=e.exec??Xe,s=au(e.env??process.env),a=await o("git",["rev-parse","HEAD"],{cwd:t,env:s}).catch(()=>null);if(!a||a.code!==0)return null;let c=e.fs??Hn(),l=n?`${t}/${n}`:t,d=(await c.readDirectory(l).catch(()=>[])).filter(f=>sze.test(f)||Oc(f)).sort();if(d.length===0)return null;let p=[];for(let f of d){let m=await c.readFile(`${l}/${f}`).catch(()=>null);if(m===null)return null;p.push({path:f,content:m})}return one({head:a.stdout.trim(),dir:n,packageManager:i,kinds:r.map(f=>f.kind),files:p,runtime:`${process.version}/${process.platform}/${process.arch}`})}var sze=/^(package\.json|package-lock\.json|npm-shrinkwrap\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb?|pyproject\.toml|setup\.py|setup\.cfg|poetry\.lock|uv\.lock|Pipfile(\.lock)?|go\.mod|go\.sum|Cargo\.(toml|lock)|Gemfile(\.lock)?|[^/]*\.gemspec|pom\.xml|build\.gradle(\.kts)?|gradle\.lockfile|build\.sbt|composer\.(json|lock)|mix\.(exs|lock)|pubspec\.(yaml|lock)|Package\.(swift|resolved)|Podfile(\.lock)?|[^/]*\.opam|conanfile\.(txt|py)|conan\.lock|vcpkg\.json|platformio\.ini|library\.properties|.*\.csproj|.*\.fsproj|packages\.lock\.json)$/i;function vne(e,t,n){let i={...e,toolAvailability:D1()},r=new Map,o={report:(u,d)=>n?.({phase:u,detail:d,done:0,total:0}),output:u=>n?.({phase:"",detail:"",done:0,total:0,output:u})},s=Math.max(1,i.concurrency??vx()),a=0,c=[],l=async u=>{a>=s&&await new Promise(d=>c.push(d)),a+=1;try{return await u()}finally{a-=1,c.shift()?.()}};for(let{dir:u,packageManager:d}of t)r.has(u)||r.set(u,{packageManager:d,prepared:l(()=>bne(i,u,d,o)).catch(p=>({ok:!1,reason:Ix(p)}))});return{take(u,d){let p=r.get(u);if(p&&p.packageManager===d)return r.delete(u),p.prepared},async dispose(){let u=[...r.values()];r.clear(),await Promise.all(u.map(({prepared:d})=>d.then(p=>p.ok?p.worktree.dispose():void 0,()=>{}))),await a1()}}}function wne(e,t){return t||(0,Tx.basename)(e)||"the repository"}async function aze(e,t,n){n.report(`Testing ${t.length} upgrades together`,t.map(a=>`${a.name}@${a.selected}`).join(", "),t);let r=await cze(e,t)&&!e.token?.isCancellationRequested?await kne(e,n,`Testing ${t.length} upgrades together`,t,{stopOnFirstFailure:!0}):[],o=r.length>0&&r.every(a=>a.status==="passed"),s=await V1(e);if(o){for(let a of t)n.settle(a,{...W1(r,e.root),measuredWith:t.length});return"settled"}if(!s){for(let a of t)n.settle(a,jo("The test checkout could not be reset to a clean state after testing these upgrades together, so they could not be attributed individually."));return"contaminated"}return"inconclusive"}async function cze(e,t){if(e.token?.isCancellationRequested)return!1;nt("verify.install");let n=It("verify","install",{packages:t.length});try{return await lze(e,t)}finally{n.end()}}async function lze(e,t){if(e.installTogether)try{if(await e.installTogether(e.root,t))return!0}catch{return!1}for(let n of t){if(e.token?.isCancellationRequested)return!1;try{await n.install(e.root)}catch{return!1}}return!0}function kne(e,t,n,i,r){return nt("verify.checkPass"),En("verify","checks",()=>xx({root:e.root,dir:e.dir,checks:e.usable,env:e.env,exec:e.exec,...r?.stopOnFirstFailure?{stopOnFirstFailure:!0}:{},...t&&n?{onProgress:o=>t.report(n,`\`${o.label}\``,i)}:{},...t?{onOutput:(o,s)=>t.output(s)}:{},...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}))}var q1=15*6e4;async function $ne(e){let t=e.exec??Xe,n=au(e.env??process.env),i=await mne(e,e.afterSha,t,n,"with the change");if(i.status!=="failed"||!e.beforeSha)return i;let r=await mne(e,e.beforeSha,t,n,"without it");return uze(i,r,e.beforeSha)}function uze(e,t,n){if(t.checks.length===0)return jo(`The project could not be checked at ${su(n)}, so there is nothing to compare the failure against.`);let i=new Map(t.checks.map(a=>[a.label,a])),r=e.checks.filter(a=>a.status==="failed"&&i.get(a.label)?.status==="passed");if(r.length===0){let a=[...new Set(e.checks.filter(c=>c.status==="failed").map(c=>i.get(c.label)?`\`${c.label}\` already failed at ${su(n)}`:`\`${c.label}\` has no baseline at ${su(n)} to compare against`))];return jo(`${a.join("; ")}, so the failure afterwards proves nothing about this dependency.`)}let o=r.map(a=>`$ ${a.label} +`)}var HBe=/^\s*(?:\x1b\[[0-9;]*m)*([^\s()][^()]*?)(?:\((\d+),(\d+)\)|:(\d+):(\d+))\s*[-:]?\s*(error|warning)\s+(TS\d+)\s*:\s*(.*)$/i,KBe=/^\s*(?:\[(?:ERROR|WARNING)\]\s*)?(\/?[^\s:]+\.(?:java|kt|scala)):\[(\d+),(\d+)\]\s*(.*)$/,JBe=/^\s*(?:\[(?:ERROR|WARNING)\]\s*)?(\/?[^\s:]+\.(?:java|kt|scala)):(\d+):\s*(error|warning)\s*:\s*(.*)$/i,ZBe=/^\s*at\s+(?:.*?\((?:[A-Za-z]:)?[^()]+:\d+:\d+\)|(?:[A-Za-z]:)?\S+:\d+:\d+)\s*$/,YBe=/^\s*([^\s:][^:]*\.\w+):(\d+)(?::(\d+))?:\s*(.*)$/,QBe=/^\s*(?:\[ERROR\]\s*)?(?:(\w+)\((\S+?)\)|([\w.$]+)\.(\w+))\s+Time elapsed:.*<<<\s*(FAILURE|ERROR)!/,XBe=/^\s*at\s+([\w.$]+)\.[\w$<>]+\((\w[\w$]*\.(?:java|kt|scala)):(\d+)\)/;function Qf(e){return e.replace(/\x1b\[[0-9;]*m/g,"").trim().slice(0,300)}function $E(e,t){let n=e.replace(/\\/g,"/").replace(/^\.\//,"");if(t){let r=t.replace(/\\/g,"/").replace(/\/+$/,"");if(n===r)return n;n.startsWith(`${r}/`)&&(n=n.slice(r.length+1))}return n}function gie(e,t){let n=[],r=new Set,i=s=>{let a=`${s.file}|${s.line}|${s.column??""}|${s.code??""}|${s.message}`;r.has(a)||(r.add(a),n.push(s))},o=null;for(let s of e.split(` +`)){let a=s.replace(/\x1b\[[0-9;]*m/g,""),c=QBe.exec(a);if(c){o={testClass:c[2]??c[3],testName:c[1]??c[4],message:null,frames:0};continue}if(o){let f=XBe.exec(a);if(f){let g=f[1].split("$")[0];if(g===o.testClass.split("$")[0]&&o.frames<3){o.frames++;let h=g.includes(".")?`${g.slice(0,g.lastIndexOf(".")).replace(/\./g,"/")}/`:"";i({file:`${h}${f[2]}`,line:Number(f[3]),message:Qf(o.message??`${o.testName} failed`),severity:"error",origin:"stack-frame"})}continue}o.message===null&&a.trim().length>0&&(o.message=Qf(a))}let l=HBe.exec(a);if(l){let f=Number(l[2]??l[4]),m=Number(l[3]??l[5]);i({file:$E(l[1],t),line:f,...Number.isFinite(m)&&m>0?{column:m-1}:{},code:l[7].toUpperCase(),message:Qf(l[8]??""),severity:(l[6]??"error").toLowerCase()==="warning"?"warning":"error"});continue}let u=KBe.exec(a);if(u){let f=Number(u[3]);i({file:$E(u[1],t),line:Number(u[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:Qf(u[4]??""),severity:/^\s*\[WARNING\]/.test(a)?"warning":"error"});continue}let d=JBe.exec(a);if(d){i({file:$E(d[1],t),line:Number(d[2]),message:Qf(d[4]??""),severity:(d[3]??"error").toLowerCase()==="warning"?"warning":"error"});continue}if(ZBe.test(a))continue;let p=YBe.exec(a);if(p){let f=Number(p[3]),m=Qf(p[4]??"");if(m.length===0)continue;i({file:$E(p[1],t),line:Number(p[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:m,severity:/warning/i.test(m)?"warning":"error"})}}return n}function mie(e){let t=e.message.toLowerCase().replace(/['"`].*?['"`]/g,"\u2039\u203A").replace(/\s+/g," ").slice(0,80);return`${e.file}|${e.code??""}|${t}`}function hie(e,t){let n=new Set(t.map(mie));return e.filter(r=>r.severity==="error"&&!n.has(mie(r)))}var $ie=["typecheck","build","test"];async function Sie(e){let t={...e,toolAvailability:EU()},n=new Map,r=(a,c)=>{n.set(a.id,c),t.onVerified?.(a,c)};if(t.targets.length===0)return n;let i=[...pVe(t.targets)],o=0,s=t.targets.length;return await qn(i,Math.max(1,t.concurrency??hE()),async([a,c])=>{if(t.token?.isCancellationRequested){for(let u of c)r(u,MU());return}let l=fVe(a);await eVe(t,l,c,{report:(u,d,p)=>t.onProgress?.({phase:u,detail:d,done:o,total:s,...p?{targets:p.map(f=>f.id)}:{}}),output:u=>t.onProgress?.({phase:"",detail:"",done:o,total:s,output:u}),settle:(u,d)=>{o+=1,r(u,d)}})}),await Xj(),n}async function eVe(e,t,n,r){let i=e.exec??Qe,o=Bl(e.env??process.env),s=Tie(e.root,t),a=await(e.warm?.take(t,n[0].packageManager)??xie(e,t,n[0].packageManager,r));if(!a.ok){for(let d of n)r.settle(d,zo(a.reason));return}let{worktree:c,usable:l,manager:u}=a;for(let d of a.notes)r.report(`Preparing a test checkout of ${s}`,d);try{let d={exec:i,env:o,dir:t,root:c.path,usable:l,install:u?.install,...e.installTogether?{installTogether:e.installTogether}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{},...e.token?{token:e.token}:{}};await DU(d,n,r)}finally{await c.dispose()}}var tVe=4;async function DU(e,t,n){if(e.token?.isCancellationRequested){for(let c of t)n.settle(c,MU());return!0}let r=t.length===1?t[0]:void 0;if(r)return yie(e,r,n);let i=await sVe(e,t,n);if(i!=="inconclusive")return i==="settled";if(t.length<=tVe){for(let[c,l]of t.entries()){if(e.token?.isCancellationRequested){n.settle(l,MU());continue}if(!await yie(e,l,n))return _ie(t,c+1,n),!1}return!0}let o=Math.ceil(t.length/2),s=t.slice(0,o),a=t.slice(o);return await DU(e,s,n)?DU(e,a,n):(_ie(a,0,n),!1)}async function yie(e,t,n){let r=`Testing ${t.name}@${t.selected}`;n.report(r,"installing into the test checkout",[t]);try{await t.install(e.root)}catch(i){return n.settle(t,zo(`${t.name}@${t.selected} could not be installed, so it could not be tested. ${xE(i)}`)),OU(e)}return n.report(r,e.usable.map(i=>i.label).join(", "),[t]),n.settle(t,FU(await Iie(e,n,r,[t]),e.root)),OU(e)}async function bie(e,t,n,r){let i=[...new Set(t.flatMap(vie))];if(i.length===0)return{usable:t,missing:[]};let o=await uie(e,i,n,r),s=c=>vie(c).every(l=>o.get(l)===!0);return{usable:t.filter(s),missing:i.filter(c=>o.get(c)===!1)}}function vie(e){return e.commandOrigin.kind==="host"?[e.commandOrigin.command]:[...e.commandOrigin.requiredHostCommands]}function nVe(e,t,n){let r=e.install?[{kind:"build",label:`${e.install.command} ${e.install.args.join(" ")}`.trim(),command:e.install,source:`${e.label} install`,commandOrigin:{kind:"host",command:e.install.command},compileCapable:!1}]:[],i=bE(e.id,null).filter(s=>n.includes(s.kind)),o=r.length>0?t.filter(s=>n.includes(s.kind)):[];return rVe([...r,...i,...o])}function rVe(e){let t=[];for(let n of e)t.some(r=>r.label===n.label)||t.push(n);return t}function wie(e){return e.length===1?`\`${e[0]}\` is`:`${e.slice(0,-1).map(t=>`\`${t}\``).join(", ")} and \`${e.at(-1)}\` are`}async function xie(e,t,n,r){let i=e.exec??Qe,o=Bl(e.env??process.env),s=e.kinds??$ie,a=Tie(e.root,t),c=Tc(n),l=c?await kE(e.root,t,e.fs??Hn(),n).catch(()=>[]):[],u=c?nVe(c,l,s):[];if(u.length>0){let T=await bie(i,u,o,e.toolAvailability);if(T.usable.length===0)return tt("verify.skipped.noTool"),{ok:!1,reason:`${wie(T.missing)} not installed, so ${a} could not be built or tested against the upgrade.`}}r.report(`Preparing a test checkout of ${a}`,"checking out a clean copy");let d,p=At("verify","worktree",{project:a});try{d=await iE(e.root,`probe-${t||"root"}`,{exec:i,env:o,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}}),p.end()}catch(T){return p.end({failed:!0}),{ok:!1,reason:xE(T)}}let f=[];d.copiedFiles.length>0&&f.push(`carried over ${CU(d.copiedFiles,d.copiedRules)} not tracked by git`),d.oversizedFiles.length>0&&f.push(`skipped ${CU(d.oversizedFiles,d.oversizedRules)} \u2014 too large to carry over automatically, which may make a check fail for a reason unrelated to this upgrade`),d.skippedSecrets.length>0&&f.push(`never copied ${CU(d.skippedSecrets,d.skippedSecretRules)} \u2014 ${d.skippedSecrets.length===1?"it looked":"they looked"} like credentials, which may make a check fail for a reason unrelated to this upgrade; see \`verify.generatedSourceGlobs\` if the project genuinely needs ${d.skippedSecrets.length===1?"it":"one of them"}`);let m=async T=>(await d.dispose(),{ok:!1,reason:T}),g=(await kE(d.path,t,e.fs??Hn(),n)).filter(T=>s.includes(T.kind));if(g.length===0)return m("This project declares no typecheck or build that Drift could run against the upgrade.");let h=await bie(i,g,o,e.toolAvailability),v=h.usable;if(v.length===0)return m(h.missing.length>0?`${wie(h.missing)} not installed, so ${a} could not be built or tested against the upgrade.`:"This project declares checks, but none of them could run in the current environment.");let b=c?.install;if(b){r.report(`Installing ${a}'s dependencies`,`\`${b.command} ${b.args.join(" ")}\``),tt("verify.install");let T=await xn("verify","install",()=>i(b.command,b.args,{cwd:t?`${d.path}/${t}`:d.path,env:o,timeoutMs:e.timeoutMs??LU,...e.signal?{signal:e.signal}:{},onOutput:r.output}),{project:a,manager:b.command});if(T.code!==0){let A=(T.stderr||T.stdout).trim().split(` +`).slice(-3).join(" ");return m(`\`${b.command} ${b.args.join(" ")}\` failed in a clean checkout, so there was nothing to test the upgrade against. ${A}`.trim())}}if(e.token?.isCancellationRequested)return m("Cancelled before this upgrade could be tested.");let w=e.baselineCache??PU(),k=await iVe(e,d.path,t,n,v),$=k?await w.read(k):null,S;if($)tt("verify.baseline.cached"),r.report(`Checking ${a} as it is`,`reusing the baseline measured earlier for this commit (${$.filter(T=>T.status==="passed").length} of ${$.length} checks green)`),S=$;else{tt("verify.baseline.measured");let T=At("verify","baseline",{project:a,checks:v.length});r.report(`Checking ${a} as it is`,`${v.map(R=>R.label).join(", ")}`);let A=await _E({root:d.path,dir:t,checks:v,env:o,exec:i,onProgress:R=>r.report(`Checking ${a} as it is`,`\`${R.label}\``),onOutput:(R,j)=>r.output(j),...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}});T.end(),S=A,k&&!e.token?.isCancellationRequested&&await w.write(k,A)}let E=v.filter(T=>S.some(A=>A.label===T.label&&A.status==="passed"));return E.length===0?m(dVe(S)):{ok:!0,worktree:d,usable:E,manager:c,notes:f}}async function iVe(e,t,n,r,i){if(!e.baselineCache)return null;let o=e.exec??Qe,s=Bl(e.env??process.env),a=await o("git",["rev-parse","HEAD"],{cwd:t,env:s}).catch(()=>null);if(!a||a.code!==0)return null;let c=e.fs??Hn(),l=n?`${t}/${n}`:t,d=(await c.readDirectory(l).catch(()=>[])).filter(f=>oVe.test(f)||$c(f)).sort();if(d.length===0)return null;let p=[];for(let f of d){let m=await c.readFile(`${l}/${f}`).catch(()=>null);if(m===null)return null;p.push({path:f,content:m})}return pie({head:a.stdout.trim(),dir:n,packageManager:r,kinds:i.map(f=>f.kind),files:p,runtime:`${process.version}/${process.platform}/${process.arch}`})}var oVe=/^(package\.json|package-lock\.json|npm-shrinkwrap\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb?|pyproject\.toml|setup\.py|setup\.cfg|poetry\.lock|uv\.lock|Pipfile(\.lock)?|go\.mod|go\.sum|Cargo\.(toml|lock)|Gemfile(\.lock)?|[^/]*\.gemspec|pom\.xml|build\.gradle(\.kts)?|gradle\.lockfile|build\.sbt|composer\.(json|lock)|mix\.(exs|lock)|pubspec\.(yaml|lock)|Package\.(swift|resolved)|Podfile(\.lock)?|[^/]*\.opam|conanfile\.(txt|py)|conan\.lock|vcpkg\.json|platformio\.ini|library\.properties|.*\.csproj|.*\.fsproj|packages\.lock\.json)$/i;function Eie(e,t,n){let r={...e,toolAvailability:EU()},i=new Map,o={report:(u,d)=>n?.({phase:u,detail:d,done:0,total:0}),output:u=>n?.({phase:"",detail:"",done:0,total:0,output:u})},s=Math.max(1,r.concurrency??hE()),a=0,c=[],l=async u=>{a>=s&&await new Promise(d=>c.push(d)),a+=1;try{return await u()}finally{a-=1,c.shift()?.()}};for(let{dir:u,packageManager:d}of t)i.has(u)||i.set(u,{packageManager:d,prepared:l(()=>xie(r,u,d,o)).catch(p=>({ok:!1,reason:xE(p)}))});return{take(u,d){let p=i.get(u);if(p&&p.packageManager===d)return i.delete(u),p.prepared},async dispose(){let u=[...i.values()];i.clear(),await Promise.all(u.map(({prepared:d})=>d.then(p=>p.ok?p.worktree.dispose():void 0,()=>{}))),await Xj()}}}function Tie(e,t){return t||(0,SE.basename)(e)||"the repository"}async function sVe(e,t,n){n.report(`Testing ${t.length} upgrades together`,t.map(a=>`${a.name}@${a.selected}`).join(", "),t);let i=await aVe(e,t)&&!e.token?.isCancellationRequested?await Iie(e,n,`Testing ${t.length} upgrades together`,t,{stopOnFirstFailure:!0}):[],o=i.length>0&&i.every(a=>a.status==="passed"),s=await OU(e);if(o){for(let a of t)n.settle(a,{...FU(i,e.root),measuredWith:t.length});return"settled"}if(!s){for(let a of t)n.settle(a,zo("The test checkout could not be reset to a clean state after testing these upgrades together, so they could not be attributed individually."));return"contaminated"}return"inconclusive"}async function aVe(e,t){if(e.token?.isCancellationRequested)return!1;tt("verify.install");let n=At("verify","install",{packages:t.length});try{return await cVe(e,t)}finally{n.end()}}async function cVe(e,t){if(e.installTogether)try{if(await e.installTogether(e.root,t))return!0}catch{return!1}for(let n of t){if(e.token?.isCancellationRequested)return!1;try{await n.install(e.root)}catch{return!1}}return!0}function Iie(e,t,n,r,i){return tt("verify.checkPass"),xn("verify","checks",()=>_E({root:e.root,dir:e.dir,checks:e.usable,env:e.env,exec:e.exec,...i?.stopOnFirstFailure?{stopOnFirstFailure:!0}:{},...t&&n?{onProgress:o=>t.report(n,`\`${o.label}\``,r)}:{},...t?{onOutput:(o,s)=>t.output(s)}:{},...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}))}var LU=15*6e4;async function Aie(e){let t=e.exec??Qe,n=Bl(e.env??process.env),r=await kie(e,e.afterSha,t,n,"with the change");if(r.status!=="failed"||!e.beforeSha)return r;let i=await kie(e,e.beforeSha,t,n,"without it");return lVe(r,i,e.beforeSha)}function lVe(e,t,n){if(t.checks.length===0)return zo(`The project could not be checked at ${Gl(n)}, so there is nothing to compare the failure against.`);let r=new Map(t.checks.map(a=>[a.label,a])),i=e.checks.filter(a=>a.status==="failed"&&r.get(a.label)?.status==="passed");if(i.length===0){let a=[...new Set(e.checks.filter(c=>c.status==="failed").map(c=>r.get(c.label)?`\`${c.label}\` already failed at ${Gl(n)}`:`\`${c.label}\` has no baseline at ${Gl(n)} to compare against`))];return zo(`${a.join("; ")}, so the failure afterwards proves nothing about this dependency.`)}let o=i.map(a=>`$ ${a.label} ${a.fullOutput??a.output}`).join(` -`),s=lne(e.parsedDiagnostics??[],t.parsedDiagnostics??[]);return{status:"failed",checks:e.checks,diagnostics:o,failedFiles:_ne(o),...s.length>0?{introducedDiagnostics:s}:{}}}async function mne(e,t,n,i,r){let o=e.dir??"",s=e.kinds??hne;e.onProgress?.({phase:`Checking the project ${r}`,detail:su(t),done:0,total:1});let a;try{a=await ax(e.workspace,`change-${su(t)}`,{at:t,exec:n,env:i,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}})}catch(c){return jo(Ix(c))}try{let c=(await Sx(a.path,o,e.fs??Hn(),e.packageManager)).filter(u=>s.includes(u.kind));if(c.length===0)return jo(`This project declares no typecheck or build at ${su(t)} that Drift could run.`);let l=Uc(e.packageManager);if(l?.install){let u=await n(l.install.command,l.install.args,{cwd:o?`${a.path}/${o}`:a.path,env:i,timeoutMs:e.timeoutMs??q1,...e.signal?{signal:e.signal}:{}});if(u.code!==0){let d=(u.stderr||u.stdout).trim().split(` -`).slice(-3).join(" ");return jo(`\`${l.install.command} ${l.install.args.join(" ")}\` failed at ${su(t)}, so the project could not be checked ${r}. ${d}`.trim())}}return W1(await xx({root:a.path,dir:o,checks:c,env:i,exec:n,...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}),a.path)}finally{await a.dispose()}}function su(e){return/^[0-9a-f]{7,40}$/i.test(e)?e.slice(0,7):e}async function V1(e){nt("verify.reset");let t=It("verify","reset");try{return await dze(e)}finally{t.end()}}async function dze(e){return(await e.exec("git",["checkout","--","."],{cwd:e.root,env:e.env}).catch(()=>({code:1}))).code!==0?!1:e.install?(await e.exec(e.install.command,e.install.args,{cwd:e.dir?`${e.root}/${e.dir}`:e.root,env:e.env,timeoutMs:e.timeoutMs??q1,...e.signal?{signal:e.signal}:{}}).catch(()=>({code:1}))).code===0:!0}function gne(e,t,n){for(let i of e.slice(t))n.settle(i,jo("The test checkout could not be reset to a clean state after testing an earlier upgrade in this group, so testing stopped rather than risk attributing one candidate\u2019s breakage to another."))}function W1(e,t){let n=e.filter(o=>o.status==="failed");if(n.length>0){let o=n.map(a=>`$ ${a.label} +`),s=hie(e.parsedDiagnostics??[],t.parsedDiagnostics??[]);return{status:"failed",checks:e.checks,diagnostics:o,failedFiles:Rie(o),...s.length>0?{introducedDiagnostics:s}:{}}}async function kie(e,t,n,r,i){let o=e.dir??"",s=e.kinds??$ie;e.onProgress?.({phase:`Checking the project ${i}`,detail:Gl(t),done:0,total:1});let a;try{a=await iE(e.workspace,`change-${Gl(t)}`,{at:t,exec:n,env:r,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}})}catch(c){return zo(xE(c))}try{let c=(await kE(a.path,o,e.fs??Hn(),e.packageManager)).filter(u=>s.includes(u.kind));if(c.length===0)return zo(`This project declares no typecheck or build at ${Gl(t)} that Drift could run.`);let l=Tc(e.packageManager);if(l?.install){let u=await n(l.install.command,l.install.args,{cwd:o?`${a.path}/${o}`:a.path,env:r,timeoutMs:e.timeoutMs??LU,...e.signal?{signal:e.signal}:{}});if(u.code!==0){let d=(u.stderr||u.stdout).trim().split(` +`).slice(-3).join(" ");return zo(`\`${l.install.command} ${l.install.args.join(" ")}\` failed at ${Gl(t)}, so the project could not be checked ${i}. ${d}`.trim())}}return FU(await _E({root:a.path,dir:o,checks:c,env:r,exec:n,...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}),a.path)}finally{await a.dispose()}}function Gl(e){return/^[0-9a-f]{7,40}$/i.test(e)?e.slice(0,7):e}async function OU(e){tt("verify.reset");let t=At("verify","reset");try{return await uVe(e)}finally{t.end()}}async function uVe(e){return(await e.exec("git",["checkout","--","."],{cwd:e.root,env:e.env}).catch(()=>({code:1}))).code!==0?!1:e.install?(await e.exec(e.install.command,e.install.args,{cwd:e.dir?`${e.root}/${e.dir}`:e.root,env:e.env,timeoutMs:e.timeoutMs??LU,...e.signal?{signal:e.signal}:{}}).catch(()=>({code:1}))).code===0:!0}function _ie(e,t,n){for(let r of e.slice(t))n.settle(r,zo("The test checkout could not be reset to a clean state after testing an earlier upgrade in this group, so testing stopped rather than risk attributing one candidate\u2019s breakage to another."))}function FU(e,t){let n=e.filter(o=>o.status==="failed");if(n.length>0){let o=n.map(a=>`$ ${a.label} ${a.fullOutput??a.output}`).join(` -`),s=cne(o,t).filter(a=>a.severity==="error");return{status:"failed",checks:[...e],diagnostics:o,failedFiles:_ne(o),...s.length>0?{parsedDiagnostics:s}:{}}}let i=e.filter(o=>o.status==="not-run"||o.status==="cancelled");return i.length>0?{status:"skipped",reason:i.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":i.find(o=>o.reason)?.reason??"One or more project checks could not run against this upgrade.",checks:[...e],failedFiles:[]}:e.filter(o=>o.status==="passed").length===0?{status:"skipped",reason:e.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":"None of the project\u2019s checks could run against this upgrade.",checks:[...e],failedFiles:[]}:{status:"passed",checks:[...e],failedFiles:[]}}function pze(e){let t=e.filter(i=>i.status==="failed");if(t.length>0){let i=t.map(o=>o.label),r=t.map(o=>`$ ${o.label} +`),s=gie(o,t).filter(a=>a.severity==="error");return{status:"failed",checks:[...e],diagnostics:o,failedFiles:Rie(o),...s.length>0?{parsedDiagnostics:s}:{}}}let r=e.filter(o=>o.status==="not-run"||o.status==="cancelled");return r.length>0?{status:"skipped",reason:r.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":r.find(o=>o.reason)?.reason??"One or more project checks could not run against this upgrade.",checks:[...e],failedFiles:[]}:e.filter(o=>o.status==="passed").length===0?{status:"skipped",reason:e.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":"None of the project\u2019s checks could run against this upgrade.",checks:[...e],failedFiles:[]}:{status:"passed",checks:[...e],failedFiles:[]}}function dVe(e){let t=e.filter(r=>r.status==="failed");if(t.length>0){let r=t.map(o=>o.label),i=t.map(o=>`$ ${o.label} ${(o.output??o.reason??"").trim()||"(no output captured)"}`).join(` -`);return`\`${i.join("`, `")}\` already fails on this commit before any upgrade is applied, so a failure afterwards would prove nothing. +`);return`\`${r.join("`, `")}\` already fails on this commit before any upgrade is applied, so a failure afterwards would prove nothing. -${r}`}return e.find(i=>i.reason)?.reason??"None of the project\u2019s checks could be run in a clean checkout."}function _ne(e){let t=new Set;for(let n of e.split(` -`)){let r=/^\s*(?:[A-Za-z]:)?([\w./\\@+-]+\.\w+)(?:\((\d+),\d+\)|:(\d+):\d+)/.exec(n)?.[1];r&&t.add(r.replace(/\\/g,"/").replace(/^\.\//,""))}return[...t]}function fze(e){let t=new Map;for(let n of e){let i=t.get(n.manifestPath);i?i.push(n):t.set(n.manifestPath,[n])}return t}function j1(e,t){let n=`${e.length} gitignored file${e.length===1?"":"s"}`;if(e.length===0)return n;if(e.length<=z1)return`${n} (${e.join(", ")})`;let i=e.slice(0,z1).join(", "),r=t.length>0?`, matching: ${t.join(", ")}`:"";return`${n} (${i}, and ${e.length-z1} more${r})`}var z1=4;function mze(e){let t=(0,Tx.dirname)(e);return t==="."||t==="/"?"":t}function jo(e){return{status:"skipped",reason:e,checks:[],failedFiles:[]}}function B1(){return jo("Cancelled before this upgrade could be tested.")}function Ix(e){return e instanceof Error?e.message:String(e)}function au(e){let t=/token|secret|password|passwd|credential|api[_-]?key|private[_-]?key|_key$/i,n={};for(let[i,r]of Object.entries(e))i.startsWith("INPUT_")||i==="GITHUB_TOKEN"||t.test(i)||(n[i]=r);return n}function H1(e){return Or(e).detectability.some(t=>t==="compile-time"||t==="link-or-import")}function Fy(e){if(e.status!=="skipped")return e.measuredWith&&e.measuredWith>1?"batch":"isolated"}function Ax(e,t,n){return K1(hze(e,t,n))}var gze="build, typecheck, and test";function K1(e){let t=e.gaps.findIndex(c=>c.stage==="verify"&&c.surface===gze),n=e.verification;if(t===-1||!n)return e;let i=n.checks.filter(c=>c.status==="passed"||c.status==="failed"),r=i.map(c=>c.label).join(", "),o,s;if(n.status==="failed")o=`This project's checks (${r||"the configured checks"}) ran with the upgrade installed and failed where they passed before: a measured regression. No fix has been checked against them yet.`,s="Fix the measured failures, then run the same checks again before merging.";else if(n.status==="passed"&&i.length>0)o=`This project's checks (${r}) passed with the upgrade installed, before any fix. They confirm only what they exercise; findings on code they do not reach remain unconfirmed.`,s="Review the findings the checks do not exercise, and run the checks again after any fix.";else{let c=n.reason?.replace(/\s+/g," ").trim();o=`Verification did not run the project's checks${c?`: ${c.length>200?`${c.slice(0,199)}\u2026`:c}`:""}. Nothing measured confirms or refutes the findings.`,s="Resolve what stopped verification, or review the resulting pull request against CI before merging."}let a=[...e.gaps];return a[t]={...a[t],reason:o,remediation:s},{...e,gaps:a}}function hze(e,t,n){if(t.status!=="passed")return{...e,verification:t};if(!t.checks.some(o=>o.status==="passed"&&o.compileCapable))return{...e,verification:t};if(Fy(t)==="batch")return{...e,verification:t};let i=o=>n===void 0||(o.workspace??"")===n,r=new Set(e.breakingChanges.filter(o=>i(o)&&H1(o)).map(o=>o.id));return r.size===0?{...e,verification:t}:yze(e,r,t)}function yze(e,t,n){let i=e.breakingChanges.filter(l=>!t.has(l.id)),r=e.impactSites.filter(l=>!t.has(l.breakingChangeId)),o=e.dispositions?.filter(l=>!t.has(l.changeId)),s=e.commits.map(l=>({...l,breakingChangeIds:l.breakingChangeIds.filter(u=>!t.has(u))})).filter(l=>l.breakingChangeIds.length>0),a=new Set(s.map(l=>l.id)),c={...e,breakingChanges:i,impactSites:r,...o?{dispositions:o}:{},verification:n,planEdges:e.planEdges.filter(l=>a.has(l.from)&&a.has(l.to)),commits:s.map(l=>({...l,dependsOn:l.dependsOn.filter(u=>a.has(u)),dependencyReasons:l.dependencyReasons.filter(u=>a.has(u.from)&&a.has(u.to))}))};return bze(c)}function bze(e){let t=new Map;for(let s of e.rationale??[])for(let a of s.runtimeAnalyses??[])t.set(a.changeId,{changeId:a.changeId,runtime:a.runtime,requirement:a.requirement??"",state:a.state,reason:a.reason,declarations:[],unresolved:[],sites:e.impactSites.filter(c=>c.breakingChangeId===a.changeId),statement:a.statement??""});let n=[...t.values()].filter(s=>e.breakingChanges.some(a=>a.id===s.changeId)),i=Pf(e.breakingChanges,e.impactSites,n,e.localizationRan??!0),r=(e.rationale??[]).map(s=>{let a=e.changes.find(d=>d.name===s.dependency)?.workspace,c=e.breakingChanges.filter(d=>d.dependency===s.dependency&&(a===void 0||d.workspace===a)),l=new Set(c.map(d=>d.id)),u=My({dependency:s.dependency,...a!==void 0?{workspace:a}:{},breakingChanges:c,impactSites:e.impactSites.filter(d=>l.has(d.breakingChangeId)),evidence:e.evidence,security:s.security,maintenance:s.maintenance,license:s.license,gaps:s.gaps,surfaceCompared:s.hasCompatibilityEvidence,runtimeAnalyses:n.filter(d=>l.has(d.changeId)),localizationRan:e.localizationRan??!0});return{...s,assessment:{...u,confidence:s.assessment.confidence,confidenceBasis:s.assessment.confidenceBasis}}}),o=y1(e.changes,e.breakingChanges,e.impactSites,r.map(s=>s.assessment.runtimeCompatibility),i);return{...e,dispositions:i,risk:o,...e.rationale?{rationale:r}:{}}}function Sne(e){if(e.length===0||e.every(o=>!o))return;let t=e.filter(o=>!!o),n=t.flatMap(o=>o.checks),i=t.filter(o=>o.status==="failed");if(i.length>0){let o=i.flatMap(c=>c.introducedDiagnostics??[]),s=[],a=new Set;for(let c of o){let l=`${c.file}|${c.line}|${c.column??""}|${c.code??""}`;a.has(l)||(a.add(l),s.push(c))}return{status:"failed",checks:n,diagnostics:i.map(c=>c.diagnostics).filter(c=>!!c).join(` +${i}`}return e.find(r=>r.reason)?.reason??"None of the project\u2019s checks could be run in a clean checkout."}function Rie(e){let t=new Set;for(let n of e.split(` +`)){let i=/^\s*(?:[A-Za-z]:)?([\w./\\@+-]+\.\w+)(?:\((\d+),\d+\)|:(\d+):\d+)/.exec(n)?.[1];i&&t.add(i.replace(/\\/g,"/").replace(/^\.\//,""))}return[...t]}function pVe(e){let t=new Map;for(let n of e){let r=t.get(n.manifestPath);r?r.push(n):t.set(n.manifestPath,[n])}return t}function CU(e,t){let n=`${e.length} gitignored file${e.length===1?"":"s"}`;if(e.length===0)return n;if(e.length<=NU)return`${n} (${e.join(", ")})`;let r=e.slice(0,NU).join(", "),i=t.length>0?`, matching: ${t.join(", ")}`:"";return`${n} (${r}, and ${e.length-NU} more${i})`}var NU=4;function fVe(e){let t=(0,SE.dirname)(e);return t==="."||t==="/"?"":t}function zo(e){return{status:"skipped",reason:e,checks:[],failedFiles:[]}}function MU(){return zo("Cancelled before this upgrade could be tested.")}function xE(e){return e instanceof Error?e.message:String(e)}function Bl(e){let t=/token|secret|password|passwd|credential|api[_-]?key|private[_-]?key|_key$/i,n={};for(let[r,i]of Object.entries(e))r.startsWith("INPUT_")||r==="GITHUB_TOKEN"||t.test(r)||(n[r]=i);return n}function jU(e){return Nr(e).detectability.some(t=>t==="compile-time"||t==="link-or-import")}function ob(e){if(e.status!=="skipped")return e.measuredWith&&e.measuredWith>1?"batch":"isolated"}function EE(e,t,n){return UU(gVe(e,t,n))}var mVe="build, typecheck, and test";function UU(e){let t=e.gaps.findIndex(c=>c.stage==="verify"&&c.surface===mVe),n=e.verification;if(t===-1||!n)return e;let r=n.checks.filter(c=>c.status==="passed"||c.status==="failed"),i=r.map(c=>c.label).join(", "),o,s;if(n.status==="failed")o=`This project's checks (${i||"the configured checks"}) ran with the upgrade installed and failed where they passed before: a measured regression. No fix has been checked against them yet.`,s="Fix the measured failures, then run the same checks again before merging.";else if(n.status==="passed"&&r.length>0)o=`This project's checks (${i}) passed with the upgrade installed, before any fix. They confirm only what they exercise; findings on code they do not reach remain unconfirmed.`,s="Review the findings the checks do not exercise, and run the checks again after any fix.";else{let c=n.reason?.replace(/\s+/g," ").trim();o=`Verification did not run the project's checks${c?`: ${c.length>200?`${c.slice(0,199)}\u2026`:c}`:""}. Nothing measured confirms or refutes the findings.`,s="Resolve what stopped verification, or review the resulting pull request against CI before merging."}let a=[...e.gaps];return a[t]={...a[t],reason:o,remediation:s},{...e,gaps:a}}function gVe(e,t,n){if(t.status!=="passed")return{...e,verification:t};if(!t.checks.some(o=>o.status==="passed"&&o.compileCapable))return{...e,verification:t};if(ob(t)==="batch")return{...e,verification:t};let r=o=>n===void 0||(o.workspace??"")===n,i=new Set(e.breakingChanges.filter(o=>r(o)&&jU(o)).map(o=>o.id));return i.size===0?{...e,verification:t}:hVe(e,i,t)}function hVe(e,t,n){let r=e.breakingChanges.filter(l=>!t.has(l.id)),i=e.impactSites.filter(l=>!t.has(l.breakingChangeId)),o=e.dispositions?.filter(l=>!t.has(l.changeId)),s=e.commits.map(l=>({...l,breakingChangeIds:l.breakingChangeIds.filter(u=>!t.has(u))})).filter(l=>l.breakingChangeIds.length>0),a=new Set(s.map(l=>l.id)),c={...e,breakingChanges:r,impactSites:i,...o?{dispositions:o}:{},verification:n,planEdges:e.planEdges.filter(l=>a.has(l.from)&&a.has(l.to)),commits:s.map(l=>({...l,dependsOn:l.dependsOn.filter(u=>a.has(u)),dependencyReasons:l.dependencyReasons.filter(u=>a.has(u.from)&&a.has(u.to))}))};return yVe(c)}function yVe(e){let t=new Map;for(let s of e.rationale??[])for(let a of s.runtimeAnalyses??[])t.set(a.changeId,{changeId:a.changeId,runtime:a.runtime,requirement:a.requirement??"",state:a.state,reason:a.reason,declarations:[],unresolved:[],sites:e.impactSites.filter(c=>c.breakingChangeId===a.changeId),statement:a.statement??""});let n=[...t.values()].filter(s=>e.breakingChanges.some(a=>a.id===s.changeId)),r=Zf(e.breakingChanges,e.impactSites,n,e.localizationRan??!0),i=(e.rationale??[]).map(s=>{let a=e.changes.find(d=>d.name===s.dependency)?.workspace,c=e.breakingChanges.filter(d=>d.dependency===s.dependency&&(a===void 0||d.workspace===a)),l=new Set(c.map(d=>d.id)),u=rb({dependency:s.dependency,...a!==void 0?{workspace:a}:{},breakingChanges:c,impactSites:e.impactSites.filter(d=>l.has(d.breakingChangeId)),evidence:e.evidence,security:s.security,maintenance:s.maintenance,license:s.license,gaps:s.gaps,surfaceCompared:s.hasCompatibilityEvidence,runtimeAnalyses:n.filter(d=>l.has(d.changeId)),localizationRan:e.localizationRan??!0});return{...s,assessment:{...u,confidence:s.assessment.confidence,confidenceBasis:s.assessment.confidenceBasis}}}),o=lU(e.changes,e.breakingChanges,e.impactSites,i.map(s=>s.assessment.runtimeCompatibility),r);return{...e,dispositions:r,risk:o,...e.rationale?{rationale:i}:{}}}function Pie(e){if(e.length===0||e.every(o=>!o))return;let t=e.filter(o=>!!o),n=t.flatMap(o=>o.checks),r=t.filter(o=>o.status==="failed");if(r.length>0){let o=r.flatMap(c=>c.introducedDiagnostics??[]),s=[],a=new Set;for(let c of o){let l=`${c.file}|${c.line}|${c.column??""}|${c.code??""}`;a.has(l)||(a.add(l),s.push(c))}return{status:"failed",checks:n,diagnostics:r.map(c=>c.diagnostics).filter(c=>!!c).join(` -`),failedFiles:[...new Set(i.flatMap(c=>c.failedFiles))],...s.length>0?{introducedDiagnostics:s}:{}}}let r=e.filter(o=>!o||o.status==="skipped");return r.length>0?{status:"skipped",reason:[...new Set(r.map(s=>s?.reason??"One of these upgrades was not tested, and no reason was recorded."))].join(" "),checks:n,failedFiles:[]}:{status:"passed",checks:n,failedFiles:[]}}function Uy(e){let t=e.checks.filter(n=>n.status==="passed"||n.status==="failed").map(n=>`\`${n.label}\``);if(e.status==="passed"){let n=Fy(e)==="batch"?` (measured with ${e.measuredWith-1} other upgrade${e.measuredWith===2?"":"s"} from the same manifest installed alongside it)`:"";return t.length>0?`${t.join(", ")} ${t.length===1?"passes":"pass"} with this upgrade installed${n}.`:`This upgrade was installed and the project still checks out clean${n}.`}if(e.status==="failed"){let n=e.checks.filter(a=>a.status==="failed"),i=n.map(a=>`\`${a.label}\``),r=e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:"",o=`${i.join(", ")} fails with this upgrade installed${r} \u2014 measured, not predicted.`,s=n.map(a=>`$ ${a.label} +`),failedFiles:[...new Set(r.flatMap(c=>c.failedFiles))],...s.length>0?{introducedDiagnostics:s}:{}}}let i=e.filter(o=>!o||o.status==="skipped");return i.length>0?{status:"skipped",reason:[...new Set(i.map(s=>s?.reason??"One of these upgrades was not tested, and no reason was recorded."))].join(" "),checks:n,failedFiles:[]}:{status:"passed",checks:n,failedFiles:[]}}function sb(e){let t=e.checks.filter(n=>n.status==="passed"||n.status==="failed").map(n=>`\`${n.label}\``);if(e.status==="passed"){let n=ob(e)==="batch"?` (measured with ${e.measuredWith-1} other upgrade${e.measuredWith===2?"":"s"} from the same manifest installed alongside it)`:"";return t.length>0?`${t.join(", ")} ${t.length===1?"passes":"pass"} with this upgrade installed${n}.`:`This upgrade was installed and the project still checks out clean${n}.`}if(e.status==="failed"){let n=e.checks.filter(a=>a.status==="failed"),r=n.map(a=>`\`${a.label}\``),i=e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:"",o=`${r.join(", ")} fails with this upgrade installed${i} \u2014 measured, not predicted.`,s=n.map(a=>`$ ${a.label} ${a.output.trim()||"(no output captured)"}`).join(` `);return s?`${o} -${s}`:o}return e.reason??"This upgrade was not tested."}var Tne={"no-incompatible-change-in-checked-surfaces":"No incompatible change detected in the surfaces that were checked","detected-not-locally-reachable":"Breaking change detected upstream \u2014 Drift could not establish whether this repository is affected; review before upgrading","locally-affected":"This repository is affected","insufficient-evidence":"Insufficient evidence to say","verification-incomplete":"Verification incomplete"};function Ine(e,t){return e==="locally-affected"&&t&&t.localImpact.band!=="high"?"This repository may be affected":Tne[e]}function Y1(e){let t=e.assessment;return!t||t.upstream.band==="none"||t.upstream.band==="low"?"insufficient-evidence":t.localImpact.band==="none"?Df([e])||t.localImpact.penalties.some(i=>i.code==="localization-unavailable"||i.code==="not-locally-checkable")?"verification-incomplete":"detected-not-locally-reachable":"locally-affected"}var xne=new Set(["no-incompatible-change-in-checked-surfaces"]);var vze=new Set(["no-incompatible-change-in-checked-surfaces","detected-not-locally-reachable"]);function wze(e,t,n){if(t){if(e.length>0)return e[0];let r=n.some(s=>s.surface==="api-surface"&&s.status==="checked"),o=n.some(s=>s.surface==="localization"&&s.status==="checked");return r&&o?"no-incompatible-change-in-checked-surfaces":"insufficient-evidence"}return["locally-affected","insufficient-evidence","verification-incomplete","detected-not-locally-reachable","no-incompatible-change-in-checked-surfaces"].find(r=>e.includes(r))??e[0]??"insufficient-evidence"}function kze(e){let t=e.breakingChanges.map(i=>Y1(i)),n=wze(t,e.breakingChanges.length===0,e.checkedSurfaces);return e.confirmedRegressions.length>0&&vze.has(n)?"locally-affected":(xne.has(n)||n==="detected-not-locally-reachable")&&!Sze(e)||xne.has(n)&&$ze(e)&&!_ze(e)?"insufficient-evidence":n}function $ze(e){return e.checkedSurfaces.some(t=>t.surface==="api-surface"&&t.status==="checked"&&(t.unruledChanges??0)>0)}function _ze(e){return e.verification?.status==="passed"&&(e.verification.checks??[]).some(t=>t.compileCapable&&t.status==="passed")}function Sze(e){let t=new Set(e.checkedSurfaces.filter(n=>n.surface==="api-surface"&&n.status==="checked").map(n=>Ene(n.dependency,n.ecosystem,n.workspace)));return e.changes.every(n=>t.has(Ene(n.name,n.ecosystem,n.workspace)))}function Ene(e,t,n){return cn({name:e??"",ecosystem:t,workspace:n})}var Q1="The project's own checks failed after this change was applied in ";function Lf(e){let t=kze(e);if(e.confirmedRegressions.length>0){let n=e.blockers.find(r=>r.startsWith(Q1)),i=e.impactSites.filter(r=>r.breakingChangeId.startsWith("measured:"));if(i.length>0){let r=i.slice(0,3).map(s=>`${s.file}:${s.line}`).join(", "),o=i.length>3?`, +${i.length-3} more`:"";return`Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, at ${r}${o}.`}return n?`Drift confirmed this repository is affected, even though static analysis found nothing to point at: ${n}`:"Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, even though static analysis found nothing to point at."}return t!=="locally-affected"&&e.blockers.length>0?`Could not establish whether this repository is affected: ${e.blockers[0]}`:Tne[t]}var xze={high:"\u{1F7E2}",medium:"\u{1F7E1}",low:"\u{1F7E0}",none:"\u26AA"};function Eze(e){return xze[e]??"\u26AA"}function J1(e){return`${Eze(e.band)} ${e.band} (${e.score.toFixed(2)})`}function Ane(e){return e>=.9?"very strong source":e>=.7?"strong source":e>=.5?"moderate source":e>=.3?"weak source":"very weak source"}function Tze(e){let t=DF(e);return`${t.score}/100 \u2014 ${t.label}`}function Rx(e){if(e.assessment){let t=DF(e.assessment);return{text:Tze(e.assessment),band:t.band,score:t.score,label:t.label}}return{text:"Confidence unavailable",band:"none",score:null,label:"Confidence unavailable"}}function Rne(e){return["| Dimension | Confidence | Why |","|---|---|---|",`| Upstream \u2014 did this change happen? | ${J1(e.upstream)} | ${Z1(e.upstream)} |`,`| Local impact \u2014 does it reach this repo? | ${J1(e.localImpact)} | ${Z1(e.localImpact)} |`,`| Verification \u2014 did anything run? | ${J1(e.verification)} | ${Z1(e.verification)} |`].join(` -`)}function Z1(e){let t=e.penalties[0];if(t)return Mf(t.detail);let n=[...e.evidence].sort((i,r)=>r.delta-i.delta)[0];return n?Mf(n.detail):"\u2014"}function Mf(e){return e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\n+/g," ")}function Nne(e){let t=Or(e),n=[`**Nature:** ${t.nature}`,`**Scope:** ${t.scope}`,`**Detectable at:** ${t.detectability.join(", ")}`,`**Reached via:** ${t.visibility.join(", ")}`],r=!t.detectability.some(o=>["manifest","link-or-import","compile-time","static-semantic"].includes(o))?` +${s}`:o}return e.reason??"This upgrade was not tested."}var Die={"no-incompatible-change-in-checked-surfaces":"No incompatible change detected in the surfaces that were checked","detected-not-locally-reachable":"Breaking change detected upstream \u2014 Drift could not establish whether this repository is affected; review before upgrading","locally-affected":"This repository is affected","insufficient-evidence":"Insufficient evidence to say","verification-incomplete":"Verification incomplete"};function Oie(e,t){return e==="locally-affected"&&t&&t.localImpact.band!=="high"?"This repository may be affected":Die[e]}function BU(e){let t=e.assessment;return!t||t.upstream.band==="none"||t.upstream.band==="low"?"insufficient-evidence":t.localImpact.band==="none"?Yf([e])||t.localImpact.penalties.some(r=>r.code==="localization-unavailable"||r.code==="not-locally-checkable")?"verification-incomplete":"detected-not-locally-reachable":"locally-affected"}var Cie=new Set(["no-incompatible-change-in-checked-surfaces"]);var bVe=new Set(["no-incompatible-change-in-checked-surfaces","detected-not-locally-reachable"]);function vVe(e,t,n){if(t){if(e.length>0)return e[0];let i=n.some(s=>s.surface==="api-surface"&&s.status==="checked"),o=n.some(s=>s.surface==="localization"&&s.status==="checked");return i&&o?"no-incompatible-change-in-checked-surfaces":"insufficient-evidence"}return["locally-affected","insufficient-evidence","verification-incomplete","detected-not-locally-reachable","no-incompatible-change-in-checked-surfaces"].find(i=>e.includes(i))??e[0]??"insufficient-evidence"}function wVe(e){let t=e.breakingChanges.map(r=>BU(r)),n=vVe(t,e.breakingChanges.length===0,e.checkedSurfaces);return e.confirmedRegressions.length>0&&bVe.has(n)?"locally-affected":(Cie.has(n)||n==="detected-not-locally-reachable")&&!$Ve(e)||Cie.has(n)&&kVe(e)&&!_Ve(e)?"insufficient-evidence":n}function kVe(e){return e.checkedSurfaces.some(t=>t.surface==="api-surface"&&t.status==="checked"&&(t.unruledChanges??0)>0)}function _Ve(e){return e.verification?.status==="passed"&&(e.verification.checks??[]).some(t=>t.compileCapable&&t.status==="passed")}function $Ve(e){let t=new Set(e.checkedSurfaces.filter(n=>n.surface==="api-surface"&&n.status==="checked").map(n=>Nie(n.dependency,n.ecosystem,n.workspace)));return e.changes.every(n=>t.has(Nie(n.name,n.ecosystem,n.workspace)))}function Nie(e,t,n){return cn({name:e??"",ecosystem:t,workspace:n})}var VU="The project's own checks failed after this change was applied in ";function em(e){let t=wVe(e);if(e.confirmedRegressions.length>0){let n=e.blockers.find(i=>i.startsWith(VU)),r=e.impactSites.filter(i=>i.breakingChangeId.startsWith("measured:"));if(r.length>0){let i=r.slice(0,3).map(s=>`${s.file}:${s.line}`).join(", "),o=r.length>3?`, +${r.length-3} more`:"";return`Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, at ${i}${o}.`}return n?`Drift confirmed this repository is affected, even though static analysis found nothing to point at: ${n}`:"Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, even though static analysis found nothing to point at."}return t!=="locally-affected"&&e.blockers.length>0?`Could not establish whether this repository is affected: ${e.blockers[0]}`:Die[t]}var SVe={high:"\u{1F7E2}",medium:"\u{1F7E1}",low:"\u{1F7E0}",none:"\u26AA"};function xVe(e){return SVe[e]??"\u26AA"}function zU(e){return`${xVe(e.band)} ${e.band} (${e.score.toFixed(2)})`}function Mie(e){return e>=.9?"very strong source":e>=.7?"strong source":e>=.5?"moderate source":e>=.3?"weak source":"very weak source"}function EVe(e){let t=Ej(e);return`${t.score}/100 \u2014 ${t.label}`}function TE(e){if(e.assessment){let t=Ej(e.assessment);return{text:EVe(e.assessment),band:t.band,score:t.score,label:t.label}}return{text:"Confidence unavailable",band:"none",score:null,label:"Confidence unavailable"}}function Lie(e){return["| Dimension | Confidence | Why |","|---|---|---|",`| Upstream \u2014 did this change happen? | ${zU(e.upstream)} | ${GU(e.upstream)} |`,`| Local impact \u2014 does it reach this repo? | ${zU(e.localImpact)} | ${GU(e.localImpact)} |`,`| Verification \u2014 did anything run? | ${zU(e.verification)} | ${GU(e.verification)} |`].join(` +`)}function GU(e){let t=e.penalties[0];if(t)return Xf(t.detail);let n=[...e.evidence].sort((r,i)=>i.delta-r.delta)[0];return n?Xf(n.detail):"\u2014"}function Xf(e){return e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\n+/g," ")}function Fie(e){let t=Nr(e),n=[`**Nature:** ${t.nature}`,`**Scope:** ${t.scope}`,`**Detectable at:** ${t.detectability.join(", ")}`,`**Reached via:** ${t.visibility.join(", ")}`],i=!t.detectability.some(o=>["manifest","link-or-import","compile-time","static-semantic"].includes(o))?` -> This change is only observable when the code runs. Neither a compiler nor a source search can confirm whether this repository is affected.`:"";return`${n.join(" \xB7 ")}${r}`}function X1(e){if(e.length===0)return"";let t=["## What Drift could not check","","These are surfaces Drift did not establish. A limit of the tool is not a finding","about the upgrade \u2014 an absence here is not evidence that nothing is wrong.","","| Stage | Surface | Why it matters | What to do |","|---|---|---|---|"];for(let n of e){let i=n.automaticExecution==="blocks"?"**blocks automatic execution**":n.automaticExecution==="degrades"?"lowers confidence":"noted",r=n.dependency?`${n.surface} (\`${n.dependency}\`)`:n.surface;t.push(`| ${n.stage} | ${Mf(r)} | ${Mf(n.reason)} \u2014 ${i} | ${Mf(n.remediation)} |`)}return t.join(` -`)}function eU(e){if(e.checkedSurfaces.length===0)return"";let t=["## What Drift checked","","| Surface | Dependency | Result |","|---|---|---|"];for(let n of e.checkedSurfaces){let i=n.status==="checked"?"\u2705 checked":n.status==="skipped"?"\u23ED\uFE0F skipped":"\u26A0\uFE0F unavailable";t.push(`| ${n.surface} | ${n.dependency?`\`${n.dependency}\``:"\u2014"} | ${i} \u2014 ${Mf(n.detail)} |`)}return t.join(` -`)}function Cne(e){if(e.automaticExecutionEligible)return"**Automatic execution:** eligible \u2014 upstream evidence and local impact are both established.";let t=[];e.upstream.band!=="high"&&t.push("upstream evidence is not conclusive"),e.localImpact.band==="none"?t.push("no local impact was established"):e.localImpact.band==="low"&&t.push("local impact is weakly established");for(let n of e.gaps)n.automaticExecution==="blocks"&&t.push(n.surface);return`**Automatic execution:** not eligible \u2014 ${t.join("; ")||"insufficient evidence"}.`}async function jy(e){let{repo:t,config:n,logger:i,provider:r,githubToken:o,onProgress:s}=e,a=e.workspace??t.workspace,c=Date.now(),l=(fe,ae)=>{let be=Date.now();i.debug(`${fe} (+${be-c}ms): ${ae}`),c=be,s?.(fe,ae)};l("detect","Reading manifest changes");let u=await Lze(r,t,i);if(u.length===0)return tU("No dependency manifest changed in this range.");let d=a?await Ed(a,Hn()):[],p=a?(await Kk(a,Hn(),Td(d))).map(fe=>({kind:"undeclared-nested",ecosystem:fe.ecosystem,declaredIn:fe.manifestPath,members:[{dir:fe.dir,name:null,ecosystem:fe.ecosystem}]})):[],f=[...d,...p];if(f.length>0){let fe=new Map;for(let ae of f){let be=fe.get(ae.kind)??{layouts:0,members:0};fe.set(ae.kind,{layouts:be.layouts+1,members:be.members+ae.members.length})}i.info(`Workspace: ${[...fe].map(([ae,{layouts:be,members:Mt}])=>be===1?`${ae} (${Mt} member(s))`:`${ae} \xD7${be} (${Mt} member(s))`).join(", ")}`)}let m=nK(yH(u),f);if(m.length===0)return tU("Manifests changed, but no dependency versions moved.");let g=await XH(m,{logger:i});i.info(`Detected ${g.length} dependency change(s)`);let{actionable:h,skipped:b}=bH(g,n);for(let fe of b)i.info(` - ${fe.change.name}: skipped \u2014 ${fe.reason}`);if(h.length===0)return tU(g.length===1?"The 1 dependency change found doesn't match the analysis criteria in drift.yml (see reason above).":`None of the ${g.length} dependency changes found match the analysis criteria in drift.yml (see reasons above).`);l("triage",`${h.length} change(s) to analyse`),l("evidence",`Gathering evidence for ${h.map(fe=>fe.name).join(", ")}`);let y=new Map,w=new Map,k=new Map,_=new Set,S=new Map,x=[],E=await t5(h,{config:n,logger:i,githubToken:o,...e.env?{env:e.env}:{},readRepoFile:(fe,ae)=>r.readFile(fe,ae),...r.listFiles?{listRepoFiles:fe=>r.listFiles(fe)}:{},beforeSha:t.beforeSha,afterSha:t.afterSha,...a?{workspaceRoot:a}:{},onSurfaceComputed:(fe,ae)=>{let be=cn(fe);ae.weight>=.8&&_.add(be),ae.sourceIncompatibleCount&&S.set(be,ae.sourceIncompatibleCount),y.set(be,{additions:ae.additions??[],locator:ae.locator})},onUnavailableSurface:(fe,ae)=>w.set(cn(fe),ae),onProseConsulted:(fe,ae)=>{let be=cn(fe);k.set(be,[...k.get(be)??[],ae])},onSpecComputed:(fe,ae)=>x.push({surface:"contract-document",dependency:fe,status:"checked",detail:`${fe} was compared between the two commits by ${ae.tool}.`}),onUnavailableSpec:(fe,ae)=>x.push({surface:"contract-document",dependency:fe,status:"unavailable",detail:ae.remedy?`${ae.detail} ${ae.remedy}`:ae.detail})});i.info(`Gathered ${E.length} evidence record(s)`),l("analyze","Identifying breaking changes");let T=await BS(h,E,{config:n,logger:i});i.info(`Identified ${T.length} breaking change(s)`);let A=[],L=[],F=[],K=[],te=[],D,X,re=!!a,ie=new Map,ke=new Map,We=new Map,ye=new Map;if(a){let fe=Td(f),ae=await Ad(a,{members:fe});if(K=Tf(ae),te=If(ae),f.length>0&&(D=new Map(fe.map(be=>[be,Tf(ae,be,fe)])),X=new Map(fe.map(be=>[be,If(ae,be,fe)]))),T.some(be=>be.kind==="runtime-requirement"&&be.runtime?.runtime==="rust")&&await qF([...Ef(ae,"rust",void 0,fe).resolved.map(be=>be.requirement),...T.flatMap(be=>be.kind==="runtime-requirement"&&be.runtime?.runtime==="rust"&&be.runtime.requirement?[be.runtime.requirement]:[])]),T.length>0){l("localize","Searching for affected code");let be=_f(ae),Mt=await WS(h,{logger:i});for(let[_t,tt]of Mze(h)){let Gn=new Set(tt.map(Vn=>Vn.name)),tb=T.filter(Vn=>Gn.has(Vn.dependency)&&Vn.workspace===_t);if(tb.length===0)continue;let Ts=nx(tb,tt,be,ae,{logger:i,member:_t,members:fe,moduleMaps:Mt});A.push(...Ts.sites),L.push(...Ts.runtimeAnalyses);for(let Vn of Ts.diagnostics){let Go=F.find(fu=>fu.dependency===Vn.dependency&&fu.ecosystem===Vn.ecosystem);Go?(Go.importerCandidateFiles+=Vn.importerCandidateFiles,Go.changesSearched+=Vn.changesSearched,Go.sitesFound+=Vn.sitesFound):F.push({...Vn})}}i.info(`Found ${A.length} impact site(s)`);let vt=new Map;for(let _t of A){let tt=vt.get(_t.breakingChangeId);tt?tt.push(_t):vt.set(_t.breakingChangeId,[_t])}let sn=new Map(ae.map(_t=>[_t.path,_t.content])),oi=new Map(h.map(_t=>[`${_t.workspace??""}::${_t.name}`,_t])),so=[];for(let _t of T){let tt=vt.get(_t.id);if(!tt||tt.length===0)continue;let Gn=hee(_t,tt,sn);Gn?ie.set(_t.id,Gn):so.push(_t)}if(n.remediation.communityRecipes&&so.length>0){let _t=await qn(so,4,async tt=>{let Gn=oi.get(`${tt.workspace??""}::${tt.dependency}`);return[tt.id,await ite(tt,Gn)]});for(let[tt,Gn]of _t)Gn&&ke.set(tt,Gn)}if(so.length>0){l("plan","Resolving deterministic fix plans");let _t=await Oee({changes:so,sites:A,evidence:E,dependencyChanges:h,fileContents:sn,config:n,logger:i,cache:n.remediation.fixPlans.cache?r1()?See(r1()):Cy():Cy(),client:n.remediation.fixPlans.enabled&&n.llm.enabled?await RF(n,i)??void 0:void 0,proposeFromRecipe:n.remediation.communityRecipes&&a?tt=>Xee({change:tt,candidate:ke.get(tt.id),dependencyChange:oi.get(`${tt.workspace??""}::${tt.dependency}`),sites:A,workspace:a,headSha:t.afterSha,env:e.env,logger:i}):void 0});for(let[tt,Gn]of _t.accepted)We.set(tt,Gn);for(let[tt,Gn]of _t.rejected)ye.set(tt,Gn)}}}else T.length>0&&i.warn("No local checkout available; affected code cannot be located.");let xt=[],bt=[],pt=!1;if(n.verification.behavioural.enabled&&T.length>0&&A.length>0){l("verify","Probing dependency behaviour for reachable findings"),pt=!0;let fe=await Xte({config:n,breakingChanges:T,dependencyChanges:h,impactSites:A,resolveEnvironments:async ae=>{if(!ae.from||!ae.to)return null;let[be,Mt]=await Promise.all([P1("old",ae.name,ae.from),P1("new",ae.name,ae.to)]);return be&&Mt?{oldEnvironment:be,newEnvironment:Mt}:null}});for(let ae of fe.gaps)xt.push({stage:"verify",surface:"behavioural-diff",reason:ae,severity:"minor",automaticExecution:"none",remediation:"Behavioural probing is experimental; see `verification.behavioural` in drift.yml."});if(fe.evidence.length>0){E=[...E,...fe.evidence],T=T.map(be=>{let Mt=fe.citationsByChangeId.get(be.id);return Mt?.length?{...be,citations:[...be.citations,...Mt]}:be}),i.info(`Behavioural probing added ${fe.evidence.length} observation(s) of evidence`);let ae=new Map;for(let[be,Mt]of fe.citationsByChangeId)for(let vt of Mt){let sn=ae.get(vt);sn?sn.push(be):ae.set(vt,[be])}for(let be of fe.evidence){let Mt=be.findings?.[0]?.detail??"",vt=ene(Mt);bt.push({name:`behavioural:${be.dependency}`,command:"drift verify --behavioural (bounded differential probe)",status:vt==="probe-unavailable"?"unavailable":"passed",detail:Mt,dependency:be.dependency,workspace:be.workspace,breakingChangeIds:ae.get(be.id)??[]})}}}let ft=[...x];n.verification.behavioural.enabled&&ft.push({surface:"behavioural-diff",status:pt?"checked":"skipped",detail:pt?"Old and new dependency code were run against generated and observed inputs and compared.":"No breaking change had a local impact site to probe, so behavioural probing did not run."});for(let fe of h){let ae=cn(fe),be=E.filter(oi=>oi.dependency===fe.name&&oi.workspace===fe.workspace),Mt=w.get(ae),vt=_.has(ae)||be.some(oi=>oi.findings?.length);ft.push({surface:"api-surface",dependency:fe.name,ecosystem:fe.ecosystem,workspace:fe.workspace,status:Mt?"unavailable":vt?"checked":"unavailable",...S.get(ae)?{unruledChanges:S.get(ae)}:{},detail:Mt?Mt.reason:vt?"A computed diff of the published API surface was produced.":"No computed API diff was available for this ecosystem or version pair."});let sn=k.get(ae)?.filter(oi=>oi.kind==="changelog"||oi.kind==="github-release");ft.push({surface:"release-notes",dependency:fe.name,ecosystem:fe.ecosystem,workspace:fe.workspace,status:sn&&sn.length>0?"checked":"unavailable",detail:sn&&sn.length>0?`${sn.length} release note or changelog section(s) retrieved.`:"No changelog or release notes could be retrieved."})}ft.push({surface:"localization",status:re?"checked":"skipped",detail:re?`Searched the files importing each changed dependency; ${A.length} affected location(s).`:"No checkout was available, so this repository was not searched."});let Cn=tx(T,L);l("rationale","Weighing what each upgrade is worth");let Ci=await fx({changes:h,evidence:E,breakingChanges:T,impactSites:A,runtimeAnalyses:Cn,localizationRan:re},{config:n,logger:i,githubToken:o,additions:y,surfaceCompared:_,surfaceGaps:w,prose:k,repoRuntime:K,pythonRuntime:te,repoRuntimeByWorkspace:D,pythonRuntimeByWorkspace:X});l("plan","Building the remediation plan");let zn=ux({repo:t,config:n,changes:h,evidence:E,breakingChanges:T,impactSites:A,runtimeAnalyses:Cn,rationale:Ci,skipped:b,localizationRan:re,verification:bt,checkedSurfaces:ft,codemods:ie,recipes:ke,fixPlans:We});l("done","Analysis complete");let Pi=xt.length>0?{...zn,gaps:[...zn.gaps,...xt]}:zn;return{plan:Pi,summary:Pne(Pi),...re?{localizationDiagnostics:F}:{}}}function Pne(e){return e.commits.length>0?`${e.breakingChanges.length} breaking change(s), ${new Set(e.impactSites.map(t=>t.file)).size} file(s) affected`:Lf(e)}async function nU(e,t){if(!e.plan)return e;let n=t.workspace??t.repo.workspace,i=Date.now(),r=(s,a)=>{let c=Date.now();t.logger.debug(`${s} (+${c-i}ms): ${a}`),i=c,t.onProgress?.(s,a)},o=await Ize(e.plan,{...t,...n?{workspace:n}:{},progress:r});return o===e.plan?e:{plan:o,summary:Pne(o),...e.localizationDiagnostics?{localizationDiagnostics:e.localizationDiagnostics}:{}}}async function Ize(e,t){let{repo:n,config:i,workspace:r}=t;if(!i.verify.enabled||!r||e.changes.length===0)return e;let o=new Map;for(let p of e.changes){let f=p.workspace??"",m=o.get(f);m?m.push(p):o.set(f,[p])}let s=e,a=[],c=[],l=[],u=[];for(let[p,f]of o){let m=await Oze(r,p,f[0].ecosystem);if(!m)continue;t.progress("verify",`Installing the change in ${p||"the repository root"} and running ${i.verify.checks.join(", ")}`);let g=await $ne({workspace:r,dir:p,packageManager:m,afterSha:n.afterSha,...n.beforeSha?{beforeSha:n.beforeSha}:{},kinds:i.verify.checks,timeoutMs:i.verify.timeoutMs,...t.signal?{signal:t.signal,token:{get isCancellationRequested(){return t.signal.aborted}}}:{},...i.verify.generatedSourceGlobs.length>0?{allowedGlobs:i.verify.generatedSourceGlobs}:{},logger:t.logger,...t.env?{env:t.env}:{},onProgress:({phase:h,detail:b})=>t.progress("verify",`${h}: ${b}`)});if(t.logger.info(`Verification (${p||"root"}): ${Uy(g)}`),a.push(g),g.status==="failed"&&(c.push(p||"the repository root"),f.length===1)){let h=cn(f[0]);l.push(h);let b=await Pze(g.introducedDiagnostics??[],h,f[0].name,p,r);if(u.push(...b),b.length===0){let y=await Cze(r,f[0],h);y&&u.push(y)}}s=Ax(s,g,p)}let d=Sne(a);if(d&&(s=K1({...s,verification:d})),c.length>0&&(s={...s,blockers:[...s.blockers,`${Q1}${c.join(", ")}, which static analysis did not predict. See the verification output for what broke.`]}),l.length>0&&(s={...s,confirmedRegressions:[...s.confirmedRegressions,...l]}),u.length>0){let p=new Set(s.impactSites.map(m=>`${m.file}:${m.line}`)),f=u.filter(m=>!p.has(`${m.file}:${m.line}`));f.length>0&&(s={...s,impactSites:[...s.impactSites,...f]})}return s}var Aze=["","src/test/java/","src/main/java/","src/test/kotlin/","src/main/kotlin/","src/test/scala/","src/main/scala/"];async function Rze(e,t,n,i){for(let r of[t,...i])for(let o of Aze){let s=[r,o+n].filter(Boolean).join("/").replace(/\/{2,}/g,"/");try{if((await(0,Ff.stat)((0,Cx.join)(e,s))).isFile())return s}catch{}}}async function Nze(e,t,n){let i;try{i=await(0,Ff.readFile)((0,Cx.join)(e,t),"utf8")}catch{return}let o=(n.includes(":")?n.slice(n.indexOf(":")+1):n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=[new RegExp(`\\s*${o}\\s*`),new RegExp(`["'\`]${o}["'\`]\\s*[:=]`),new RegExp(`(^|\\s)${o}\\s*(==|>=|<=|~=|=|:|$)`)],a=i.split(` -`);for(let c of s){let l=a.findIndex(u=>c.test(u));if(l!==-1)return{line:l+1,excerpt:a[l].trim().slice(0,200)}}}async function Cze(e,t,n){let i=await Nze(e,t.manifestPath,t.name);if(i)return{breakingChangeId:`measured:${n}`,file:t.manifestPath,line:i.line,excerpt:i.excerpt,matchedSymbol:t.name,confidence:"high",siteKind:"manifest"}}async function Pze(e,t,n,i,r){let o=[],s=new Set,a,c=async()=>{if(a)return a;try{a=(await(0,Ff.readdir)(r,{withFileTypes:!0})).filter(u=>u.isDirectory()&&!u.name.startsWith(".")&&u.name!=="target").map(u=>u.name)}catch{a=[]}return a};for(let l of e){if(/(^|\/)(node_modules|\.venv|venv|site-packages|target\/|dist\/|build\/)/.test(l.file))continue;let u;if(l.origin==="stack-frame"){let p=await Rze(r,i,l.file,await c());if(!p)continue;u=p}else{let p=await Ste(r,i,l.file);if(!p)continue;u=p}let d=`${u}:${l.line}:${l.column??""}`;s.has(d)||(s.add(d),o.push({breakingChangeId:`measured:${t}`,file:u,line:l.line,...l.column!==void 0?{column:l.column}:{},excerpt:(l.code?`${l.code}: ${l.message}`:l.message).slice(0,200),matchedSymbol:l.code??Dze(l.message)??n,confidence:"high"}))}return o}function Dze(e){return/[`'"]([A-Za-z_$][\w$.]*)[`'"]/.exec(e)?.[1]}async function Oze(e,t,n){let i=Hn(),r=await i.readDirectory(t?(0,Cx.join)(e,t):e);if(r.length===0)return null;let o=da({entries:r}).filter(a=>a.manager.ecosystem===n),s=o.find(a=>a.fromLockfile);if(s)return s.manager.id;if(t){let a=await i.readDirectory(e),c=da({entries:a}).find(l=>l.manager.ecosystem===n&&l.fromLockfile);if(c)return c.manager.id}return o[0]?.manager.id??null}function Mze(e){let t=new Map;for(let n of e){let i=n.workspace,r=t.get(i)??[];r.push(n),t.set(i,r)}return[...t.entries()]}async function Lze(e,t,n){let r=(await e.changedFiles()).filter(hH);return r.length===0?[]:(n.debug(`Changed manifests: ${r.join(", ")}`),(await Promise.all(r.map(async s=>{let[a,c]=await Promise.all([e.readFile(s,t.beforeSha),e.readFile(s,t.afterSha)]);return{path:s,before:a,after:c}}))).filter(s=>s.before!==null||s.after!==null))}function tU(e){return{plan:null,summary:e}}var Fze={critical:"\u{1F534} critical",high:"\u{1F7E0} high",medium:"\u{1F7E1} medium",low:"\u{1F535} low",unknown:"\u26AA severity not stated"},Uze={high:"\u{1F7E2} High",medium:"\u{1F7E1} Medium",low:"\u{1F7E0} Low"},jze=8;function iU(e){let t=e.rationale??[];if(t.length===0)return"";let n=t.map(zze).filter(Boolean);return n.length===0?"":["## Upgrade assessment","",n.join(` +> This change is only observable when the code runs. Neither a compiler nor a source search can confirm whether this repository is affected.`:"";return`${n.join(" \xB7 ")}${i}`}function qU(e){if(e.length===0)return"";let t=["## What Drift could not check","","These are surfaces Drift did not establish. A limit of the tool is not a finding","about the upgrade \u2014 an absence here is not evidence that nothing is wrong.","","| Stage | Surface | Why it matters | What to do |","|---|---|---|---|"];for(let n of e){let r=n.automaticExecution==="blocks"?"**blocks automatic execution**":n.automaticExecution==="degrades"?"lowers confidence":"noted",i=n.dependency?`${n.surface} (\`${n.dependency}\`)`:n.surface;t.push(`| ${n.stage} | ${Xf(i)} | ${Xf(n.reason)} \u2014 ${r} | ${Xf(n.remediation)} |`)}return t.join(` +`)}function WU(e){if(e.checkedSurfaces.length===0)return"";let t=["## What Drift checked","","| Surface | Dependency | Result |","|---|---|---|"];for(let n of e.checkedSurfaces){let r=n.status==="checked"?"\u2705 checked":n.status==="skipped"?"\u23ED\uFE0F skipped":"\u26A0\uFE0F unavailable";t.push(`| ${n.surface} | ${n.dependency?`\`${n.dependency}\``:"\u2014"} | ${r} \u2014 ${Xf(n.detail)} |`)}return t.join(` +`)}function jie(e){if(e.automaticExecutionEligible)return"**Automatic execution:** eligible \u2014 upstream evidence and local impact are both established.";let t=[];e.upstream.band!=="high"&&t.push("upstream evidence is not conclusive"),e.localImpact.band==="none"?t.push("no local impact was established"):e.localImpact.band==="low"&&t.push("local impact is weakly established");for(let n of e.gaps)n.automaticExecution==="blocks"&&t.push(n.surface);return`**Automatic execution:** not eligible \u2014 ${t.join("; ")||"insufficient evidence"}.`}async function ab(e){let{repo:t,config:n,logger:r,provider:i,githubToken:o,onProgress:s}=e,a=e.workspace??t.workspace,c=Date.now(),l=(he,ue)=>{let ke=Date.now();r.debug(`${he} (+${ke-c}ms): ${ue}`),c=ke,s?.(he,ue)};l("detect","Reading manifest changes");let u=await MVe(i,t,r);if(u.length===0)return HU("No dependency manifest changed in this range.");let d=a?await cd(a,Hn()):[],p=a?(await g_(a,Hn(),ld(d))).map(he=>({kind:"undeclared-nested",ecosystem:he.ecosystem,declaredIn:he.manifestPath,members:[{dir:he.dir,name:null,ecosystem:he.ecosystem}]})):[],f=[...d,...p];if(f.length>0){let he=new Map;for(let ue of f){let ke=he.get(ue.kind)??{layouts:0,members:0};he.set(ue.kind,{layouts:ke.layouts+1,members:ke.members+ue.members.length})}r.info(`Workspace: ${[...he].map(([ue,{layouts:ke,members:Ft}])=>ke===1?`${ue} (${Ft} member(s))`:`${ue} \xD7${ke} (${Ft} member(s))`).join(", ")}`)}let m=KJ(lJ(u),f);if(m.length===0)return HU("Manifests changed, but no dependency versions moved.");let g=await qJ(m,{logger:r});r.info(`Detected ${g.length} dependency change(s)`);let{actionable:h,skipped:v}=uJ(g,n);for(let he of v)r.info(` - ${he.change.name}: skipped \u2014 ${he.reason}`);if(h.length===0)return HU(g.length===1?"The 1 dependency change found doesn't match the analysis criteria in drift.yml (see reason above).":`None of the ${g.length} dependency changes found match the analysis criteria in drift.yml (see reasons above).`);l("triage",`${h.length} change(s) to analyse`),l("evidence",`Gathering evidence for ${h.map(he=>he.name).join(", ")}`);let b=new Map,w=new Map,k=new Map,$=new Set,S=new Map,E=[],T=await HQ(h,{config:n,logger:r,githubToken:o,...e.env?{env:e.env}:{},readRepoFile:(he,ue)=>i.readFile(he,ue),...i.listFiles?{listRepoFiles:he=>i.listFiles(he)}:{},beforeSha:t.beforeSha,afterSha:t.afterSha,...a?{workspaceRoot:a}:{},onSurfaceComputed:(he,ue)=>{let ke=cn(he);ue.weight>=.8&&$.add(ke),ue.sourceIncompatibleCount&&S.set(ke,ue.sourceIncompatibleCount),b.set(ke,{additions:ue.additions??[],locator:ue.locator})},onUnavailableSurface:(he,ue)=>w.set(cn(he),ue),onProseConsulted:(he,ue)=>{let ke=cn(he);k.set(ke,[...k.get(ke)??[],ue])},onSpecComputed:(he,ue)=>E.push({surface:"contract-document",dependency:he,status:"checked",detail:`${he} was compared between the two commits by ${ue.tool}.`}),onUnavailableSpec:(he,ue)=>E.push({surface:"contract-document",dependency:he,status:"unavailable",detail:ue.remedy?`${ue.detail} ${ue.remedy}`:ue.detail})});r.info(`Gathered ${T.length} evidence record(s)`),l("analyze","Identifying breaking changes");let A=await zx(h,T,{config:n,logger:r});r.info(`Identified ${A.length} breaking change(s)`);let R=[],j=[],U=[],Z=[],re=[],L,te,se=!!a,ae=new Map,Se=new Map,We=new Map,we=new Map;if(a){let he=ld(f),ue=await dd(a,{members:he});if(Z=Vf(ue),re=qf(ue),f.length>0&&(L=new Map(he.map(ke=>[ke,Vf(ue,ke,he)])),te=new Map(he.map(ke=>[ke,qf(ue,ke,he)]))),A.some(ke=>ke.kind==="runtime-requirement"&&ke.runtime?.runtime==="rust")&&await Lj([...Bf(ue,"rust",void 0,he).resolved.map(ke=>ke.requirement),...A.flatMap(ke=>ke.kind==="runtime-requirement"&&ke.runtime?.runtime==="rust"&&ke.runtime.requirement?[ke.runtime.requirement]:[])]),A.length>0){l("localize","Searching for affected code");let ke=Uf(ue),Ft=await Bx(h,{logger:r});for(let[St,et]of OVe(h)){let Gn=new Set(et.map(Bn=>Bn.name)),_b=A.filter(Bn=>Gn.has(Bn.dependency)&&Bn.workspace===St);if(_b.length===0)continue;let Ss=Xx(_b,et,ke,ue,{logger:r,member:St,members:he,moduleMaps:Ft});R.push(...Ss.sites),j.push(...Ss.runtimeAnalyses);for(let Bn of Ss.diagnostics){let Bo=U.find(Jl=>Jl.dependency===Bn.dependency&&Jl.ecosystem===Bn.ecosystem);Bo?(Bo.importerCandidateFiles+=Bn.importerCandidateFiles,Bo.changesSearched+=Bn.changesSearched,Bo.sitesFound+=Bn.sitesFound):U.push({...Bn})}}r.info(`Found ${R.length} impact site(s)`);let wt=new Map;for(let St of R){let et=wt.get(St.breakingChangeId);et?et.push(St):wt.set(St.breakingChangeId,[St])}let sn=new Map(ue.map(St=>[St.path,St.content])),ii=new Map(h.map(St=>[`${St.workspace??""}::${St.name}`,St])),oo=[];for(let St of A){let et=wt.get(St.id);if(!et||et.length===0)continue;let Gn=$ne(St,et,sn);Gn?ae.set(St.id,Gn):oo.push(St)}if(n.remediation.communityRecipes&&oo.length>0){let St=await qn(oo,4,async et=>{let Gn=ii.get(`${et.workspace??""}::${et.dependency}`);return[et.id,await dre(et,Gn)]});for(let[et,Gn]of St)Gn&&Se.set(et,Gn)}if(oo.length>0){l("plan","Resolving deterministic fix plans");let St=await Gne({changes:oo,sites:R,evidence:T,dependencyChanges:h,fileContents:sn,config:n,logger:r,cache:n.remediation.fixPlans.cache?Jj()?Pne(Jj()):Xy():Xy(),client:n.remediation.fixPlans.enabled&&n.llm.enabled?await _j(n,r)??void 0:void 0,proposeFromRecipe:n.remediation.communityRecipes&&a?et=>sre({change:et,candidate:Se.get(et.id),dependencyChange:ii.get(`${et.workspace??""}::${et.dependency}`),sites:R,workspace:a,headSha:t.afterSha,env:e.env,logger:r}):void 0});for(let[et,Gn]of St.accepted)We.set(et,Gn);for(let[et,Gn]of St.rejected)we.set(et,Gn)}}}else A.length>0&&r.warn("No local checkout available; affected code cannot be located.");let Et=[],vt=[],pt=!1;if(n.verification.behavioural.enabled&&A.length>0&&R.length>0){l("verify","Probing dependency behaviour for reachable findings"),pt=!0;let he=await sie({config:n,breakingChanges:A,dependencyChanges:h,impactSites:R,resolveEnvironments:async ue=>{if(!ue.from||!ue.to)return null;let[ke,Ft]=await Promise.all([xU("old",ue.name,ue.from),xU("new",ue.name,ue.to)]);return ke&&Ft?{oldEnvironment:ke,newEnvironment:Ft}:null}});for(let ue of he.gaps)Et.push({stage:"verify",surface:"behavioural-diff",reason:ue,severity:"minor",automaticExecution:"none",remediation:"Behavioural probing is experimental; see `verification.behavioural` in drift.yml."});if(he.evidence.length>0){T=[...T,...he.evidence],A=A.map(ke=>{let Ft=he.citationsByChangeId.get(ke.id);return Ft?.length?{...ke,citations:[...ke.citations,...Ft]}:ke}),r.info(`Behavioural probing added ${he.evidence.length} observation(s) of evidence`);let ue=new Map;for(let[ke,Ft]of he.citationsByChangeId)for(let wt of Ft){let sn=ue.get(wt);sn?sn.push(ke):ue.set(wt,[ke])}for(let ke of he.evidence){let Ft=ke.findings?.[0]?.detail??"",wt=aie(Ft);vt.push({name:`behavioural:${ke.dependency}`,command:"drift verify --behavioural (bounded differential probe)",status:wt==="probe-unavailable"?"unavailable":"passed",detail:Ft,dependency:ke.dependency,workspace:ke.workspace,breakingChangeIds:ue.get(ke.id)??[]})}}}let ft=[...E];n.verification.behavioural.enabled&&ft.push({surface:"behavioural-diff",status:pt?"checked":"skipped",detail:pt?"Old and new dependency code were run against generated and observed inputs and compared.":"No breaking change had a local impact site to probe, so behavioural probing did not run."});for(let he of h){let ue=cn(he),ke=T.filter(ii=>ii.dependency===he.name&&ii.workspace===he.workspace),Ft=w.get(ue),wt=$.has(ue)||ke.some(ii=>ii.findings?.length);ft.push({surface:"api-surface",dependency:he.name,ecosystem:he.ecosystem,workspace:he.workspace,status:Ft?"unavailable":wt?"checked":"unavailable",...S.get(ue)?{unruledChanges:S.get(ue)}:{},detail:Ft?Ft.reason:wt?"A computed diff of the published API surface was produced.":"No computed API diff was available for this ecosystem or version pair."});let sn=k.get(ue)?.filter(ii=>ii.kind==="changelog"||ii.kind==="github-release");ft.push({surface:"release-notes",dependency:he.name,ecosystem:he.ecosystem,workspace:he.workspace,status:sn&&sn.length>0?"checked":"unavailable",detail:sn&&sn.length>0?`${sn.length} release note or changelog section(s) retrieved.`:"No changelog or release notes could be retrieved."})}ft.push({surface:"localization",status:se?"checked":"skipped",detail:se?`Searched the files importing each changed dependency; ${R.length} affected location(s).`:"No checkout was available, so this repository was not searched."});let Pn=Qx(A,j);l("rationale","Weighing what each upgrade is worth");let Di=await uE({changes:h,evidence:T,breakingChanges:A,impactSites:R,runtimeAnalyses:Pn,localizationRan:se},{config:n,logger:r,githubToken:o,additions:b,surfaceCompared:$,surfaceGaps:w,prose:k,repoRuntime:Z,pythonRuntime:re,repoRuntimeByWorkspace:L,pythonRuntimeByWorkspace:te});l("plan","Building the remediation plan");let zn=aE({repo:t,config:n,changes:h,evidence:T,breakingChanges:A,impactSites:R,runtimeAnalyses:Pn,rationale:Di,skipped:v,localizationRan:se,verification:vt,checkedSurfaces:ft,codemods:ae,recipes:Se,fixPlans:We});l("done","Analysis complete");let Oi=Et.length>0?{...zn,gaps:[...zn.gaps,...Et]}:zn;return{plan:Oi,summary:Uie(Oi),...se?{localizationDiagnostics:U}:{}}}function Uie(e){return e.commits.length>0?`${e.breakingChanges.length} breaking change(s), ${new Set(e.impactSites.map(t=>t.file)).size} file(s) affected`:em(e)}async function KU(e,t){if(!e.plan)return e;let n=t.workspace??t.repo.workspace,r=Date.now(),i=(s,a)=>{let c=Date.now();t.logger.debug(`${s} (+${c-r}ms): ${a}`),r=c,t.onProgress?.(s,a)},o=await TVe(e.plan,{...t,...n?{workspace:n}:{},progress:i});return o===e.plan?e:{plan:o,summary:Uie(o),...e.localizationDiagnostics?{localizationDiagnostics:e.localizationDiagnostics}:{}}}async function TVe(e,t){let{repo:n,config:r,workspace:i}=t;if(!r.verify.enabled||!i||e.changes.length===0)return e;let o=new Map;for(let p of e.changes){let f=p.workspace??"",m=o.get(f);m?m.push(p):o.set(f,[p])}let s=e,a=[],c=[],l=[],u=[];for(let[p,f]of o){let m=await DVe(i,p,f[0].ecosystem);if(!m)continue;t.progress("verify",`Installing the change in ${p||"the repository root"} and running ${r.verify.checks.join(", ")}`);let g=await Aie({workspace:i,dir:p,packageManager:m,afterSha:n.afterSha,...n.beforeSha?{beforeSha:n.beforeSha}:{},kinds:r.verify.checks,timeoutMs:r.verify.timeoutMs,...t.signal?{signal:t.signal,token:{get isCancellationRequested(){return t.signal.aborted}}}:{},...r.verify.generatedSourceGlobs.length>0?{allowedGlobs:r.verify.generatedSourceGlobs}:{},logger:t.logger,...t.env?{env:t.env}:{},onProgress:({phase:h,detail:v})=>t.progress("verify",`${h}: ${v}`)});if(t.logger.info(`Verification (${p||"root"}): ${sb(g)}`),a.push(g),g.status==="failed"&&(c.push(p||"the repository root"),f.length===1)){let h=cn(f[0]);l.push(h);let v=await CVe(g.introducedDiagnostics??[],h,f[0].name,p,i);if(u.push(...v),v.length===0){let b=await PVe(i,f[0],h);b&&u.push(b)}}s=EE(s,g,p)}let d=Pie(a);if(d&&(s=UU({...s,verification:d})),c.length>0&&(s={...s,blockers:[...s.blockers,`${VU}${c.join(", ")}, which static analysis did not predict. See the verification output for what broke.`]}),l.length>0&&(s={...s,confirmedRegressions:[...s.confirmedRegressions,...l]}),u.length>0){let p=new Set(s.impactSites.map(m=>`${m.file}:${m.line}`)),f=u.filter(m=>!p.has(`${m.file}:${m.line}`));f.length>0&&(s={...s,impactSites:[...s.impactSites,...f]})}return s}var IVe=["","src/test/java/","src/main/java/","src/test/kotlin/","src/main/kotlin/","src/test/scala/","src/main/scala/"];async function AVe(e,t,n,r){for(let i of[t,...r])for(let o of IVe){let s=[i,o+n].filter(Boolean).join("/").replace(/\/{2,}/g,"/");try{if((await(0,tm.stat)((0,AE.join)(e,s))).isFile())return s}catch{}}}async function RVe(e,t,n){let r;try{r=await(0,tm.readFile)((0,AE.join)(e,t),"utf8")}catch{return}let o=(n.includes(":")?n.slice(n.indexOf(":")+1):n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=[new RegExp(`\\s*${o}\\s*`),new RegExp(`["'\`]${o}["'\`]\\s*[:=]`),new RegExp(`(^|\\s)${o}\\s*(==|>=|<=|~=|=|:|$)`)],a=r.split(` +`);for(let c of s){let l=a.findIndex(u=>c.test(u));if(l!==-1)return{line:l+1,excerpt:a[l].trim().slice(0,200)}}}async function PVe(e,t,n){let r=await RVe(e,t.manifestPath,t.name);if(r)return{breakingChangeId:`measured:${n}`,file:t.manifestPath,line:r.line,excerpt:r.excerpt,matchedSymbol:t.name,confidence:"high",siteKind:"manifest"}}async function CVe(e,t,n,r,i){let o=[],s=new Set,a,c=async()=>{if(a)return a;try{a=(await(0,tm.readdir)(i,{withFileTypes:!0})).filter(u=>u.isDirectory()&&!u.name.startsWith(".")&&u.name!=="target").map(u=>u.name)}catch{a=[]}return a};for(let l of e){if(/(^|\/)(node_modules|\.venv|venv|site-packages|target\/|dist\/|build\/)/.test(l.file))continue;let u;if(l.origin==="stack-frame"){let p=await AVe(i,r,l.file,await c());if(!p)continue;u=p}else{let p=await Pre(i,r,l.file);if(!p)continue;u=p}let d=`${u}:${l.line}:${l.column??""}`;s.has(d)||(s.add(d),o.push({breakingChangeId:`measured:${t}`,file:u,line:l.line,...l.column!==void 0?{column:l.column}:{},excerpt:(l.code?`${l.code}: ${l.message}`:l.message).slice(0,200),matchedSymbol:l.code??NVe(l.message)??n,confidence:"high"}))}return o}function NVe(e){return/[`'"]([A-Za-z_$][\w$.]*)[`'"]/.exec(e)?.[1]}async function DVe(e,t,n){let r=Hn(),i=await r.readDirectory(t?(0,AE.join)(e,t):e);if(i.length===0)return null;let o=ca({entries:i}).filter(a=>a.manager.ecosystem===n),s=o.find(a=>a.fromLockfile);if(s)return s.manager.id;if(t){let a=await r.readDirectory(e),c=ca({entries:a}).find(l=>l.manager.ecosystem===n&&l.fromLockfile);if(c)return c.manager.id}return o[0]?.manager.id??null}function OVe(e){let t=new Map;for(let n of e){let r=n.workspace,i=t.get(r)??[];i.push(n),t.set(r,i)}return[...t.entries()]}async function MVe(e,t,n){let i=(await e.changedFiles()).filter(cJ);return i.length===0?[]:(n.debug(`Changed manifests: ${i.join(", ")}`),(await Promise.all(i.map(async s=>{let[a,c]=await Promise.all([e.readFile(s,t.beforeSha),e.readFile(s,t.afterSha)]);return{path:s,before:a,after:c}}))).filter(s=>s.before!==null||s.after!==null))}function HU(e){return{plan:null,summary:e}}var LVe={critical:"\u{1F534} critical",high:"\u{1F7E0} high",medium:"\u{1F7E1} medium",low:"\u{1F535} low",unknown:"\u26AA severity not stated"},FVe={high:"\u{1F7E2} High",medium:"\u{1F7E1} Medium",low:"\u{1F7E0} Low"},jVe=8;function ZU(e){let t=e.rationale??[];if(t.length===0)return"";let n=t.map(UVe).filter(Boolean);return n.length===0?"":["## Upgrade assessment","",n.join(` --- `)].join(` -`)}function zze(e){let t=[`### \`${e.dependency}\` ${e.from} \u2192 ${e.to}`,"",`**Recommendation: ${ru[e.assessment.recommendation]}**`,""],n=Gze(e.security);n&&t.push(n,"");let i=Vze(e.maintenance);if(i&&t.push(i,""),e.improvements.length>0){t.push("**Other improvements**","");for(let s of e.improvements)t.push(`- ${s.statement}${s.url?` ([source](${s.url}))`:""}`);t.push("")}let r=Bze(e.license);r&&t.push(r,"");let o=qze(e.summary);if(o&&t.push(o,""),t.push(`**Evidence confidence:** ${Uze[e.assessment.confidence]} \u2014 ${e.assessment.confidenceBasis}`,""),e.assessment.reasons.length>0){t.push("
Why Drift concluded this","");for(let s of e.assessment.reasons)t.push(`- ${s}`);t.push("","
")}return t.join(` -`).trim()}function Gze(e){if(!e.checked)return`**Security** - -${e.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."}`;let t=["**Security**",""];return e.resolved.length>0&&(t.push(`Upgrading resolves ${zy(e.resolved.length,"known vulnerability","known vulnerabilities")}:`),t.push(...rU(e.resolved)),t.push("")),e.introduced.length>0&&(t.push(`The target version is affected by ${zy(e.introduced.length,"advisory","advisories")} that ${e.introduced.length===1?"does":"do"} not affect the installed version:`),t.push(...rU(e.introduced)),t.push("")),e.carried.length>0&&(t.push(`${zy(e.carried.length,"advisory affects","advisories affect")} both versions and ${e.carried.length===1?"is":"are"} not addressed by this upgrade:`),t.push(...rU(e.carried)),t.push("")),e.target.length===0&&t.push("No known vulnerabilities were found for the target version."),t.join(` -`).trim()}function rU(e){let t=e.slice(0,jze),n=t.map(i=>{let r=i.aliases.find(a=>a.startsWith("CVE-")),o=r&&r!==i.id?`${i.id} (${r})`:i.id,s=i.fixedIn?` \u2014 first fixed in ${i.fixedIn}`:" \u2014 no fixed version published";return`- [${o}](${i.url}) \u2014 ${Fze[i.severity]}${s}. ${i.summary}`});return e.length>t.length&&n.push(`- \u2026and ${e.length-t.length} more.`),n}function Vze(e){return e.facts.length===0?"":["**Maintenance**","",...[...e.facts].sort((n,i)=>Number(i.concerning??!1)-Number(n.concerning??!1)).map(n=>`- ${n.statement}${n.url?` ([source](${n.url}))`:""}`)].join(` -`)}function Bze(e){if(e.verdict==="ok"||e.verdict==="changed")return"";let n=[e.verdict==="policy-violation"?"**License review required**":"**License**","",e.statement],i=e.introduced.filter(r=>!r.allowed);if(i.length>0){n.push("","Newly introduced dependencies of this package:");for(let r of i)n.push(`- \`${r.name}\` \u2014 ${r.license??"no declared license"}`);n.push("","This covers the dependencies this package itself declares. Drift does not resolve the full transitive graph during analysis.")}return n.push("","_Drift reports what the metadata says and how it compares to your configured policy. It does not give legal advice._"),n.join(` -`)}function qze(e){if(e.changes.length===0)return"";let t=[["Breaking changes",e.changes.filter(i=>i.category==="breaking")],["Security",e.changes.filter(i=>i.category==="security")],["Improvements",e.changes.filter(i=>i.category==="performance"||i.category==="improvement")],["Fixes",e.changes.filter(i=>i.category==="fix")]],n=["
What changed upstream",""];for(let[i,r]of t)if(r.length!==0){n.push(`**${i}**`,"");for(let o of r){let s=o.affectedSites!==void 0?` Drift found ${zy(o.affectedSites,"affected call","affected calls")} in this repository.`:"";n.push(`- ${o.text}${s}${o.url?` ([source](${o.url}))`:""}`)}n.push("")}return e.unrelated>0&&n.push("**Unrelated changes**","",`- ${zy(e.unrelated,"further change","further changes")} were read and judged not to concern this repository.`,""),n.push("
"),n.join(` -`)}function zy(e,t,n){return`${e} ${e===1?t:n}`}var Wze=["drift-schema","drift-plan","drift-plan-digest","drift-commit","drift-base-branch"],Hze=/^[ \t]*[ \t]*$/gm,Kze=/^[0-9a-f]{40}$/,Jze=/^plan_[0-9a-f]{10}$/,Zze=/^[0-9a-f]{64}$/;function Yze(e){return!(!e||e.length>255||/[\x00-\x20~^:?*[\\]/.test(e)||e.includes("..")||e.includes("@{")||e.startsWith("/")||e.endsWith("/")||e.includes("//")||e.startsWith("-")||e.startsWith(".")||e.endsWith(".")||e.endsWith(".lock"))}function Dne(e){return[``,``,``,``,``].join(` -`)}function One(e){if(!e)return{ok:!1,reason:"the issue has no body"};let t=new Map;for(let l of e.matchAll(Hze)){let u=l[1],d=(l[2]??"").trim(),p=t.get(u);p?p.push(d):t.set(u,[d])}if(t.size===0)return{ok:!1,reason:"the issue has no Drift plan footer, so it is not a Drift approval issue"};for(let l of Wze){let u=t.get(l);if(!u)return{ok:!1,reason:`the plan footer is missing \`${l}\``};if(u.length>1)return{ok:!1,reason:`the plan footer declares \`${l}\` ${u.length} times; a Drift issue declares each key exactly once`};if(u[0]==="")return{ok:!1,reason:`the plan footer has an empty \`${l}\``}}let n=l=>t.get(l)[0],i=n("drift-schema");if(!/^\d+$/.test(i))return{ok:!1,reason:`\`drift-schema\` must be an integer, not \`${oU(i)}\``};let r=Number(i);if(!h1.includes(r))return{ok:!1,reason:`this issue records plan schema v${r}, which this version of Drift cannot verify (it supports v${h1.join(", v")}). Re-run Drift to generate a current plan.`};let o=n("drift-plan");if(!Jze.test(o))return{ok:!1,reason:`\`drift-plan\` is not a Drift plan id: \`${oU(o)}\``};let s=n("drift-plan-digest");if(!Zze.test(s))return{ok:!1,reason:"`drift-plan-digest` is not a 64-character SHA-256 digest"};let a=n("drift-commit");if(!Kze.test(a))return{ok:!1,reason:"`drift-commit` must be a full 40-character commit SHA; an abbreviated SHA does not name one commit unambiguously"};let c=n("drift-base-branch");return Yze(c)?{ok:!0,metadata:{schemaVersion:r,planId:o,planDigest:s,headSha:a,baseBranch:c}}:{ok:!1,reason:`\`drift-base-branch\` is not a valid branch name: \`${oU(c)}\``}}function Mne(e){let t=[``,``];return e.taskId&&t.push(``),e.pullRequestNumber!==void 0&&t.push(``),t.join(` -`)}function Lne(e,t){for(let n of e){if(!n.authorIsDrift||!n.body)continue;let i=//.exec(n.body)?.[1];if(i!==t)continue;let r=//.exec(n.body)?.[1]?.trim(),o=//.exec(n.body)?.[1]?.trim(),s=//.exec(n.body)?.[1];return{planDigest:i,...r?{branchName:r}:{},...o?{taskId:o}:{},...s?{pullRequestNumber:Number(s)}:{}}}return null}function oU(e){let t=e.replace(/[`\r\n]/g," ").trim();return t.length<=40?t:`${t.slice(0,40)}\u2026`}var hU=require("node:crypto");var kr=require("node:path");var Vne=require("node:fs"),zo=require("node:fs/promises"),Bne=require("node:child_process"),qne=require("node:util");function Qze(e){return e.verification?e.verification.status==="passed"?"passed":e.verification.status==="failed"?"failed":"skipped":"not-run"}function Gy(e){if(e.status==="pending")return"pending";if(e.status==="error")return"error";let t=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial";if((e.actionableImpactCount??(t?e.runtimeDeclarationSiteCount!==void 0?Math.max(0,e.impactCount-e.runtimeDeclarationSiteCount):e.impactConfidence==="high"?e.impactCount:0:e.impactConfidence==="low"||e.impactConfidence==="medium"?0:e.impactCount))>0)return"affected";if(e.verification?.status==="failed")return"verification-failed";let i=t?e.runtimeDeclarationSiteCount:0;if((i===void 0?t?0:e.impactCount:Math.max(0,e.impactCount-i))>0)return"review-required";if(e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial")return"runtime-unresolved";let o=e.runtimeAnalyses?.length??0,s=Math.max(0,e.breakingCount-o);return s>0&&(e.sourceCoverage?.localizationComplete===!1||e.sourceCoverage?.sourceTruncated)?"localization-incomplete":s>0?e.verifiedUnaffected===!0?"upstream-only":"review-required":e.breakingCount>0?"upstream-only":e.recommendation==="insufficient-evidence"?"evidence-missing":e.recommendation?"clean":e.gaps&&e.gaps.length>0?"evidence-missing":"clean"}function Une(e){let t=Qze(e),n=t==="not-run"?" \u2014 not deeply verified":t==="skipped"?" \u2014 deep verification did not complete":"",i=eGe(e);switch(Gy(e)){case"pending":return"Not checked yet";case"error":return"Could not check";case"affected":{let r=e.actionableImpactCount!==void 0,o=e.actionableImpactFiles??e.impactFiles,s=e.actionableImpactCount??e.impactCount,a=r?"actionable site":"site",c=e.impactConfidence&&e.impactConfidence!=="high"||e.runtimeCompatibility==="partial"?"May affect":"Affects",l=e.impactPendingIsolatedClearance?" \u2014 not yet confirmed alone: a batch check passed without testing this package in isolation":"",u=t==="failed"?" \u2014 and its own checks fail with this installed, measured not predicted":n,d=i?` \xB7 ${i}`:"";return`${c} your code \xB7 ${s} ${a}${s===1?"":"s"} in ${o} file${o===1?"":"s"}${d}${l}${u}`}case"verification-failed":{let r=(e.verification?.checks??[]).filter(o=>o.status==="failed").map(o=>o.label);return r.length>0?`Verified breaking \xB7 ${r.join(", ")} failed with this upgrade installed \u2014 measured, not predicted`:"Verified breaking \xB7 this upgrade broke the project's own checks \u2014 measured, not predicted"}case"upstream-only":{let r=`${e.breakingCount} upstream change${e.breakingCount===1?"":"s"}, none used here`;return e.verifiedUnaffected===!0?`Verified safe \xB7 ${r}, and your own checks pass`:`Safe for your code \xB7 ${r}`}case"review-required":{let r=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial"?e.runtimeDeclarationSiteCount??0:0;if(e.impactCount-r<=0){let a=e.breakingCount;return`Review Required \xB7 ${a} breaking change${a===1?"":"s"} upstream; Drift found no usage in this repository but could not prove none \u2014 verify before upgrading`+(i?` \xB7 ${i}`:"")}let o=Math.max(1,e.impactCount-r),s=i?` \xB7 ${i}`:"";return e.impactConfidence==="low"||e.impactConfidence==="medium"?`May affect your code \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm \u2014 Review required; check before upgrading${s}`:`Review Required \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm${s}`}case"runtime-unresolved":return i?`Runtime Unknown \xB7 ${i}`:"Runtime Unknown \xB7 Drift could not resolve this repository\u2019s runtime compatibility";case"localization-incomplete":return"Localization Incomplete \xB7 Drift searched the indexed source subset, but the file limit prevented proving the breaking API is unused";case"evidence-missing":return"Evidence Missing \xB7 Drift could not obtain enough upstream evidence to decide";case"clean":{let r=e.recommendation==="upgrade-recommended";return t==="passed"?r?"Verified worth taking \xB7 no breaking changes, it improves on what you have, and your own checks pass":"Verified safe \xB7 no breaking changes found, and your own checks pass":r?`Worth taking \xB7 no breaking changes, and it improves on what you have${n}`:`Safe for your code \xB7 no breaking changes found${n}`}}}function Fne(e){return{affected:0,"verification-failed":1,error:2,"review-required":3,"runtime-unresolved":4,"localization-incomplete":5,"evidence-missing":6,"upstream-only":7,pending:8,clean:9}[e]}function Xze(e,t){return Fne(e)-Fne(t)}function jne(e,t){return Xze(Gy(e),Gy(t))}function eGe(e){if(e.runtimeCompatibility!=="unknown"&&e.runtimeCompatibility!=="partial")return;let t=e.runtimeAnalyses?.find(i=>i.state==="unknown"||i.state==="partial");if(t?.statement)return t.statement;if(t?.reason==="config-incomplete")return"Drift could not index every authoritative runtime configuration file";let n=e.runtimeDeclarationSiteCount??0;return n>0?`${n} runtime declaration${n===1?"":"s"} to review`:"Drift could not resolve this repository\u2019s runtime compatibility"}function sU(e,t){return Te(e,t)}function ac(e,t){return Qe(e,t)??0}function Px(e){switch(e){case"npm":return"the npm registry";case"pypi":return"PyPI";case"cargo":return"crates.io";case"go":return"the Go module proxy";case"maven":return"Maven Central";case"rubygems":return"RubyGems";case"nuget":return"NuGet";case"packagist":return"Packagist";case"hex":return"Hex";case"pub":return"pub.dev";case"cocoapods":return"CocoaPods Trunk";case"conan":return"ConanCenter";case"vcpkg":return"the vcpkg registry";case"arduino":return"the Arduino Library Manager";case"swift":return"the package\u2019s git tags";case"opam":return"the opam repository"}}async function zne(e){try{return await tGe(e)}catch(t){return{outcome:"unchecked",reason:`Checking ${Px(e.ecosystem)} for ${e.name} failed: ${t.message}`}}}async function tGe(e){let{name:t,ecosystem:n,current:i,range:r}=e,o=Px(n),s=sU(i,n);if(!s)return{outcome:"unchecked",reason:`${t} is installed at \u201C${i}\u201D, which Drift cannot compare against published versions.`};let a=await cU(e);if(!a)return{outcome:"unchecked",reason:`Drift could not reach ${o} for ${t}.`};if(a.complete===!1)return{outcome:"unchecked",reason:`Drift could not enumerate all of ${o} for ${t}, so it cannot establish whether a newer compatible version exists.`};if(a.versions.length===0)return{outcome:"unchecked",reason:`${o} returned no versions for ${t}, so Drift has nothing to compare against.`};let l=(n==="swift"?a.versions.filter(y=>aU(y)===aU(i)):a.versions).map(y=>sU(y,n)).filter(y=>y!==null);if(l.length===0)return n==="swift"?{outcome:"unchecked",reason:`${o} returned no tags in the installed version's ${aU(i)} family for ${t}.`}:{outcome:"unchecked",reason:`Drift could not read any of the ${a.versions.length} version numbers ${o} published for ${t}.`};let d=(s.prerelease?l:l.filter(y=>!y.prerelease)).filter(y=>ac(y,s)>0).sort((y,w)=>ac(w,y)),p=a.latest?sU(a.latest,n):null,f=n==="swift"?d[0]:p&&(s.prerelease||!p.prerelease)?p:d[0];if(!f||ac(f,s)<=0)return{outcome:"up-to-date"};let m=lGe(d,s,r,n),g=d,h=cGe(g,s,n),b=[...new Map([f,...m?[m]:[],...h?[h]:[],...g.slice(0,18)].map(y=>[y.raw,y])).values()].filter(y=>ac(y,s)>0).sort((y,w)=>ac(w,y)).map(y=>y.raw);return{outcome:"upgrade",latest:f.raw,...m?{safeLatest:m.raw}:{},...h?{latestMinor:h.raw}:{},versions:b}}function aU(e){let t=e.trim().replace(/^[^\d]*/,"");return/^\d{4}[.-]\d{1,2}[.-]\d{1,2}(?:[.-]\d+)?(?:$|[-+])/.test(t)?"calendar":Te(e,"swift")?"semver":"unknown"}var nGe="https://repo1.maven.org/maven2";async function cU(e){switch(e.ecosystem){case"npm":return oGe(e.name);case"swift":return sGe(e.name,e.githubToken);case"opam":return aGe(e.name,e.githubToken);case"maven":return rGe(e.name);default:{let t=await Wn(e.name,e.ecosystem,null);return t?{latest:null,versions:t.versions}:null}}}async function rGe(e){let[t,n]=e.split(":");if(!t||!n)return null;let i=await rt(`${nGe}/${t.replace(/\./g,"/")}/${n}/maven-metadata.xml`);if(i===null){let s=await Wn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}let r=/([^<]+)<\/release>/.exec(i)?.[1]?.trim()??null,o=[...i.matchAll(/([^<]+)<\/version>/g)].map(s=>s[1].trim());if(o.length===0){let s=await Wn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}return{latest:r,versions:o}}var iGe="application/vnd.npm.install-v1+json, application/json";async function oGe(e){let t=await $e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`,{timeoutMs:12e3,headers:{Accept:iGe}});return t?{latest:t["dist-tags"]?.latest?.trim()??null,versions:Object.keys(t.versions??{})}:null}function Gne(e){return{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28",...e?{Authorization:`Bearer ${e}`}:{}}}async function sGe(e,t){if(!/^[\w.-]+\/[\w.-]+$/.test(e))return null;let n=100,i=20,r=[];for(let o=1;o<=i;o++){let s=await $e(`https://api.github.com/repos/${e}/tags?per_page=${n}&page=${o}`,{headers:Gne(t)});if(!s)return o===1?null:{latest:null,versions:[...new Set(r)],complete:!1};if(r.push(...s.map(a=>a.name).filter(a=>!!a)),s.lengthi.sameCompatibilityLine(t,r)===!0).sort((r,o)=>ac(o,r))[0]}function lGe(e,t,n,i){let r=Gi(i),s=e.filter(a=>ac(a,t)>0).map(a=>({version:a,satisfies:r.satisfies(a,n)}));if(!s.some(a=>a.satisfies===null))return s.filter(a=>a.satisfies).map(a=>a.version).sort((a,c)=>ac(c,a))[0]}function Dx(e,t,n,i,r){if(!r)return e>0?`${e} breaking change${e===1?"":"s"} found in ${i}.`:`No breaking changes found for this version of ${i}.`;let{assessment:o,security:s}=r,a=ru[o.recommendation],c=[],l=new Map(t.map(g=>[g.id,g])),u=n.filter(g=>l.get(g.breakingChangeId)?.kind!=="runtime-requirement"),d=n.filter(g=>l.get(g.breakingChangeId)?.kind==="runtime-requirement");u.length>0&&c.push(`${u.length} place${u.length===1?"":"s"} in this repository use${u.length===1?"s":""} an API that ${i} changed`),c.push(...uGe(d));let p=o.runtimeCompatibility,f=p==="unknown"||p==="partial";d.length===0&&p==="unknown"&&c.push("this upgrade's runtime requirement could not be checked against this repository");let m=t.filter(g=>g.kind!=="runtime-requirement").length;if(u.length===0&&d.length===0&&m>0&&!f){let g=Df(t);c.push(g?`${m} published ${g} change${m===1?"":"s"} ${m===1?"requires":"require"} review; ${m===1?"this package-role contract is":"these package-role contracts are"} assessed independently of source call signatures`:`${m} upstream API breaking change${m===1?"":"s"}, no usage of the changed parts located in this repository \u2014 review before upgrading`)}return s.checked&&s.resolved.length>0&&c.push(`fixes ${s.resolved.length} known ${s.resolved.length===1?"vulnerability":"vulnerabilities"}`),s.checked&&s.introduced.length>0&&c.push(`introduces ${s.introduced.length} known ${s.introduced.length===1?"vulnerability":"vulnerabilities"}`),c.length===0&&r.gaps.length>0?`${a}. ${r.gaps.join(" ")}`:c.length===0?`${a}. No breaking changes found for this version of ${i}.`:`${a}. ${dGe(c.join("; "))}.`}function uGe(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),i=e.filter(o=>o.runtimeVerdict==="partial"),r=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime declaration${o===1?"":"s"} in this repository do${o===1?"es":""} not satisfy this upgrade's runtime requirement`)}if(i.length>0){let o=i.length;t.push(`${o} runtime declaration${o===1?"":"s"} only partially satisf${o===1?"ies":"y"} this upgrade's runtime requirement`)}if(r.length>0){let o=r.length;t.push(`${o} runtime declaration${o===1?"":"s"} could not be resolved, so compatibility is unknown`)}return t}function dGe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ox(e,t){let n={...e,verification:t};if(!n.plan||(n.plan=Ax(n.plan,t),t.status==="skipped"))return n;n.breakingCount=n.plan.upstreamBreakingCount??n.plan.breakingChanges.length,n.impactCount=n.plan.impactSites.length,n.impactFiles=new Set(n.plan.impactSites.map(r=>r.file)).size;let i=n.plan.dispositions;return i&&(n.actionableImpactCount=i.reduce((r,o)=>r+o.actionableSites.length,0),n.actionableImpactFiles=new Set(i.flatMap(r=>r.actionableSites.map(o=>o.file))).size,n.runtimeDeclarationSiteCount=i.filter(r=>r.runtimeAnalysis!==void 0).reduce((r,o)=>r+o.sites.length,0)),n.rationale&&(n.rationale=n.plan.rationale?.find(r=>r.dependency===n.rationale.dependency)??n.plan.rationale?.[0]??n.rationale),n.risk=n.plan.risk,n.verifiedUnaffected=t.status==="passed"&&Fy(t)==="isolated"&&t.checks.some(r=>r.status==="passed"&&r.compileCapable)&&Array.isArray(n.plan.dispositions)&&n.plan.dispositions.every(r=>r.state==="unaffected")&&(n.plan.breakingChanges.length>0||(n.plan.upstreamBreakingCount??0)>0),n.impactPendingIsolatedClearance=Fy(t)==="batch"&&t.checks.some(r=>r.status==="passed"&&r.compileCapable)&&n.plan.impactSites.some(r=>{let o=n.plan.breakingChanges.find(s=>s.id===r.breakingChangeId);return o!==void 0&&H1(o)}),n.summary=Dx(n.breakingCount,n.plan.breakingChanges,n.plan.impactSites,n.name,n.rationale),n}var Wne=(0,qne.promisify)(Bne.execFile);function pGe(e,t){return t?[...e]:e.map(n=>n.state==="incompatible"||n.state==="partial"?n:{...n,state:"unknown",reason:"config-incomplete",statement:`${n.statement} Drift could not index every authoritative runtime configuration file, so this result is incomplete.`})}function Hne(e,t){return`${e}\0${t}`}var fGe={includeDev:!0,maxSites:40,maxPackages:0};function Kne(e){return{available:!1,reason:e.reason,inspection:e.reason==="no-public-surface"?"succeeded":e.reason==="artifact-type-unsupported"?"not-applicable":"failed",tool:e.tool,detail:e.detail,...e.packageRole?{packageRole:e.packageRole}:{},...e.diagnostic?{diagnostic:e.diagnostic}:{}}}async function dU(e,t=[""],n=new Map,i=Hn()){let r=[],o=[],s=await hGe(e,i);for(let a of t){let c=a?(0,kr.join)(e,a):e,l=await i.readDirectory(c);if(l.length===0)continue;let u=[...l,...await mGe(c,l,i)],d=da({entries:u,read:p=>tre((0,kr.join)(c,p))});if(d.length!==0){for(let p of oK(d))(n.get(Hne(a,p.ecosystem))??(a?s.get(p.ecosystem):void 0))||o.push({...p,dir:a});for(let p of gGe(d,a,n,s)){let f=p.manager.manifestPattern?u.filter(h=>p.manager.manifestPattern.test(h)):[],m=p.manager.manifests.find(h=>u.includes(h))??f.find(lP)??f[0];if(!m)continue;let g=p.manager.lockfiles.find(h=>u.includes(h))??null;if(p.manager.id==="pip"&&lP(m)){let h=m.replace(/\.in$/i,".txt");if(u.includes(h)){let b=await i.readFile((0,kr.join)(c,h));b&&Ok(b)&&(g=h)}}r.push({manager:p.manager,dir:a,manifestPath:a?`${a}/${m}`:m,lockfilePath:g?a?`${a}/${g}`:g:null})}}}return{targets:r,ambiguities:o}}async function mGe(e,t,n){let i=new Set;for(let o of ua)for(let s of[...o.manifests,...o.lockfiles])s.includes("/")&&i.add(s);let r=[];for(let o of i){if(t.includes(o))continue;let s=o.slice(0,o.indexOf("/"));t.includes(s)&&await n.readFile((0,kr.join)(e,o))!==null&&r.push(o)}return r}function gGe(e,t,n,i=new Map){let r=new Set,o=[];for(let s of new Set(e.map(a=>a.manager.ecosystem))){let a=e.filter(u=>u.manager.ecosystem===s),c=n.get(Hne(t,s)),l=a.find(u=>u.manager.id===c)??a.find(u=>u.manager.id===i.get(s))??a[0];r.has(s)||(r.add(s),o.push(l))}return o}async function hGe(e,t){let n=await t.readDirectory(e),i=da({entries:n,read:o=>tre((0,kr.join)(e,o))}),r=new Map;for(let o of i)o.fromLockfile&&r.set(o.manager.ecosystem,o.manager.id);return r}async function Jne(e){let{root:t,repo:n,config:i,logger:r,githubToken:o,onProgress:s,onCandidate:a,onDropped:c,onOutdated:l,token:u,repoLabel:d}=e,p=e.breadth??fGe,f=e.fs??Hn(),m=e.env??process.env,g=Math.max(1,Math.min(32,Math.floor(e.concurrency??L1(m))||1));r.debug(`Scan parallelism: ${ine(m)}`);let h={enabled:(e.verify?.enabled??!1)&&i.verify.enabled,checks:e.verify?.checks??i.verify.checks,timeoutMs:e.verify?.timeoutMs??i.verify.timeoutMs,generatedSourceGlobs:e.verify?.generatedSourceGlobs??i.verify.generatedSourceGlobs,baselineCache:e.verify?.baselineCache},b=Date.now(),y=(z,Y,Re=0,Ee=0)=>{let Ge=Date.now();r.debug(`${z} (+${Ge-b}ms): ${Y}`),b=Ge,s?.({phase:z,detail:Y,done:Re,total:Ee})},w=It("scan","total"),k=It("discover","manifests");y("Looking for manifests",t);let _=await Ed(t,f),S=Td(_),x=await Kk(t,f,S).catch(()=>[]),E=x.filter(z=>z.hasOwnGit),T=x.filter(z=>!z.hasOwnGit).map(z=>z.dir),A=[...S,...T],L=e.dirs??A;if(_.length>0||T.length>0){let z=[..._.map(Y=>Y.kind),...T.length>0?["undeclared"]:[]];y("Reading the workspace",`${L.length} package${L.length===1?"":"s"} \xB7 ${z.join(", ")}`)}let F=Mc("manifest.discovery"),{targets:K,ambiguities:te}=await dU(t,L,e.managers??new Map,f);if(K.length===0)return k.end({targets:0}),F.end({targets:0}),w.end({checked:0,candidates:0}),{candidates:[],checked:0,upToDate:0,unchecked:[],targets:K,workspaces:_,ambiguities:te,nestedGitRepos:E};let D=new Map;for(let z of _)for(let Y of z.members)Y.name&&D.set(Y.dir,Y.name);for(let z of K){if(D.has(z.dir))continue;let Y=z.manifestPath.includes("/")?z.manifestPath.slice(z.manifestPath.lastIndexOf("/")+1):z.manifestPath,Re=await Lg(t,f,z.dir,Y,z.manager.ecosystem).catch(()=>null);Re&&D.set(z.dir,Re)}k.end({targets:K.length}),F.end({targets:K.length,manifests:K.length});let X=new Set(i.ecosystems),re=A.length>1||new Set(K.map(z=>z.dir)).size>1,ie=new Set,ke=(z,Y)=>{ie.add(Lx(z,d?t:void 0)),a?.(ere({dep:z,member:re?z.target.dir:void 0,memberName:re?D.get(z.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,phase:Y}))},We=(z,Y)=>_Ge(z,Y,"Waiting to be checked",{...re?{member:z.target.dir}:{},...re&&D.get(z.target.dir)?{memberName:D.get(z.target.dir)}:{},...d?{repoRoot:t,repoLabel:d}:{}}),ye=()=>{for(let z of ae)ie.delete(z.id);for(let z of ie)c?.(z);ie.clear()},xt=z=>{let Y=Lx(z,d?t:void 0);ie.delete(Y),c?.(Y)},bt=[],pt=[];for(let z of K){if(!X.has(z.manager.ecosystem))continue;y("Reading manifest",z.manifestPath);let Y=await pU(t,z,p.includeDev,f),Re=p.maxPackages>0?Math.max(0,p.maxPackages-bt.length):Y.dependencies.length;for(let Ee of Y.dependencies.slice(0,Re))ke(Ee,"Waiting to be checked");bt.push(...Y.dependencies),pt.push(...Y.unresolved)}if(pt.length>0){let z=[];await lU(pt,bx(m),async Y=>{let Re=Y.ecosystem,Ee=Y.current==="unspecified"?"*":Y.current,Ge=K.find(ao=>ao.manifestPath===Y.manifestPath);if(!Ge){z.push(Y);return}let Di=((await cU({name:Y.name,ecosystem:Re,current:Ee,range:Ee,...o?{githubToken:o}:{}}).catch(()=>null))?.versions??[]).filter(ao=>xW(ao,Ee,Re)===!0).sort((ao,iE)=>Eg(iE,ao,Re)??0)[0];if(!Di){z.push(Y);return}let nb={name:Y.name,kind:Y.kind,current:Di,range:Ee,assumed:!0,target:Ge};ke(nb,"Waiting to be checked"),bt.push(nb)}),pt.length=0,pt.push(...z)}let ft=p.maxPackages>0?bt.slice(0,p.maxPackages):bt;y("Indexing your code","Walking source files",0,ft.length);let Cn=It("index","walk+build"),Ci=Ad(t,{members:L}).then(z=>{y("Indexing your code",`${z.length} file${z.length===1?"":"s"} indexed \xB7 ${ft.length} direct dependenc${ft.length===1?"y":"ies"} to check`,0,ft.length);let Y={files:z,index:_f(z)};return Cn.end({files:z.length}),Y});Ci.catch(()=>{});let zn=0,Pi=0,fe=0,ae=[],be=[...pt],Mt=z=>h.enabled&&z.size>0&&!u?.isCancellationRequested?vne({root:t,targets:[],kinds:h.checks,env:m,logger:r,timeoutMs:h.timeoutMs,...h.generatedSourceGlobs?{allowedGlobs:h.generatedSourceGlobs}:{},...h.baselineCache?{baselineCache:h.baselineCache}:{},...u?{token:u}:{}},[...new Map(K.filter(Y=>z.has(Y.dir)).map(Y=>[Y.dir,Y])).values()].map(Y=>({dir:Y.dir,packageManager:Y.manager.id})),Y=>Y.output!==void 0?s?.({phase:"",detail:"",done:0,total:0,output:Y.output}):y(Y.phase,Y.detail)):void 0;y("Checking registries",`${ft.length} direct dependenc${ft.length===1?"y":"ies"}`,0,ft.length);let vt=[],sn=new Map,oi=It("phase","version-discovery");await Br("version.discovery",{dependencies:ft.length},()=>lU(ft,bx(m),async z=>{if(u?.isCancellationRequested)return;let Y=Px(z.target.manager.ecosystem);ke(z,`Asking ${Y} what has been published`);let Re=Mc("registry.lookup",{package:z.name}),Ee=JSON.stringify([z.target.manager.ecosystem,z.name,z.current,z.range??null]),Ge=sn.get(Ee);Ge||(Ge=En("versions",z.target.manager.ecosystem,()=>zne({name:z.name,ecosystem:z.target.manager.ecosystem,current:z.current,range:z.range,...o?{githubToken:o}:{}})),sn.set(Ee,Ge),Ge.then(si=>{si.outcome==="unchecked"&&sn.get(Ee)===Ge&&sn.delete(Ee)},()=>{sn.get(Ee)===Ge&&sn.delete(Ee)}));let Et=await Ge;if(Re.end({outcome:Et.outcome}),Et.outcome==="up-to-date"){zn+=1,Pi+=1,xt(z),y("Up to date",`${z.name}@${z.current}`,Pi,ft.length);return}if(Et.outcome==="unchecked"){be.push({name:z.name,kind:z.kind,ecosystem:z.target.manager.ecosystem,packageManager:z.target.manager.id,manifestPath:z.target.manifestPath,current:z.current,reason:Et.reason}),Pi+=1,xt(z),y("Could not check",`${z.name}@${z.current} \xB7 ${Et.reason}`,Pi,ft.length);return}vt.push({dep:z,available:Et}),Pi+=1,a?.(We(z,Et)),y("Outdated",`${z.name} ${z.current} \u2192 ${Et.safeLatest??Et.latest}`,Pi,ft.length)})),oi.end({checked:ft.length,outdated:vt.length}),vt.sort((z,Y)=>z.dep.name.localeCompare(Y.dep.name));let so=Mt(new Set(vt.map(({dep:z})=>z.target.dir)));if(l?.({outdated:vt.map(({dep:z,available:Y})=>We(z,Y)),checked:ft.length,upToDate:zn,unchecked:[...be]}),u?.isCancellationRequested)return ye(),await so?.dispose(),w.end({cancelled:!0}),{candidates:[],checked:ft.length,upToDate:zn,unchecked:be,targets:K,workspaces:_,ambiguities:te,nestedGitRepos:E};let _t=It("phase","analysis"),tt=new Map;for(let{dep:z,available:Y}of vt){let Re=Y.safeLatest??Y.latest,Ee=NP({ecosystem:z.target.manager.ecosystem,name:z.name,from:z.current,to:Re});tt.has(Ee)||tt.set(Ee,{name:z.name,ecosystem:z.target.manager.ecosystem,from:z.current,to:Re})}let Gn=i.rationale.security&&tt.size>0?Br("security.batch",{upgrades:tt.size},async()=>{let z=[...tt.keys()],Y=[...tt.values()];try{let Re=await Oy(Y,{});return new Map(z.map((Ee,Ge)=>[Ee,Re.get(Y[Ge])??Uo("The OSV advisory batch lookup did not return a result for this upgrade, so its effect on known vulnerabilities is unknown.")]))}catch(Re){let Ee=`The OSV advisory batch lookup failed unexpectedly (${Re.message}), so this upgrade's effect on known vulnerabilities is unknown.`;return new Map(z.map(Ge=>[Ge,Uo(Ee)]))}}):void 0;Gn?.catch(()=>{});let tb=z=>Gn?.then(Y=>Y.get(z)),Ts=new Map,Vn=new Map,Go=new Map,fu=new Map,rE=(z,Y,Re)=>{fu.set(z,[Y,Re]);for(let Ee of Go.get(z)??[])Ee(Y,Re)},Pie=(z,Y)=>{let Re=Go.get(z);Re||(Re=new Set,Go.set(z,Re)),Re.add(Y);let Ee=fu.get(z);return Ee&&Y(Ee[0],Ee[1]),()=>{Re.delete(Y),Re.size===0&&(Go.delete(z),fu.delete(z))}},Die=(z,Y,Re)=>{let Ee={name:z.name,ecosystem:z.target.manager.ecosystem,from:z.current,to:Y,kind:z.kind,bump:ta(z.current,Y,z.target.manager.ecosystem),manifestPath:z.target.manifestPath,rawFrom:z.current,rawTo:Y},Ge=NP(Ee),Et=`${z.name} ${Ee.from} \u2192 ${Ee.to}`,si=Re?Pie(Ge,Re):void 0,Di=Ts.get(Ge),nb=Di!==void 0;if(!Di){let co=new Map,mu=new Map,jU=new Set,oE=new Map,sE=new Map;rE(Ge,"Reading release notes and changelog",Et);let rb=Br("upstream.analysis",{package:z.name,ecosystem:Ee.ecosystem,from:Ee.from,to:Ee.to,shared:!1},()=>UO(Ee,{config:i,logger:r,...o?{githubToken:o}:{},env:m,workspaceRoot:t,onSurfaceComputed:(cc,Oi)=>{let Vo=cn(cc);Oi.weight>=.8&&jU.add(Vo),oE.set(Vo,{available:!0,inspection:"succeeded",tool:Oi.tool,...Oi.packageRole?{packageRole:Oi.packageRole}:{}}),co.set(Vo,{additions:Oi.additions??[],locator:Oi.locator}),rE(Ge,"Comparing the public API surface",Et)},onUnavailableSurface:(cc,Oi)=>{let Vo=cn(cc);mu.set(Vo,Oi),oE.set(Vo,Kne(Oi))},onProseConsulted:(cc,Oi)=>{let Vo=cn(cc);sE.set(Vo,[...sE.get(Vo)??[],Oi])}}).then(cc=>({evidence:cc,additions:co,surfaceGaps:mu,surfaceCompared:jU,surfaceAssessments:oE,prose:sE})));Ts.set(Ge,rb),Di=rb,rb.catch(()=>{Ts.get(Ge)===rb&&Ts.delete(Ge)})}let ao=Vn.get(Ge),iE=ao!==void 0;if(!ao){let co=N1(Ee,{config:i,...o?{githubToken:o}:{},securityLookup:tb(Ge),onProgress:mu=>rE(Ge,mu,Et)});Vn.set(Ge,co),ao=co,co.catch(()=>{Vn.get(Ge)===co&&Vn.delete(Ge)})}let Oie=Di,UU=ao;return Br("upstream.wait",{package:z.name,ecosystem:Ee.ecosystem,from:Ee.from,to:Ee.to,evidenceShared:nb,rationaleShared:iE},async()=>{let[co,mu]=await Promise.allSettled([Oie,UU]);return si?.(),{evidence:co.status==="fulfilled"?co.value:void 0,rationaleFacts:mu.status==="fulfilled"?UU:void 0}})};try{await Br("analysis",{packages:vt.length},()=>lU(vt,g,async({dep:Y,available:Re})=>{if(u?.isCancellationRequested)return;let Ee=Re.safeLatest??Re.latest,Ge;try{Ge=await Die(Y,Ee,(si,Di)=>{y(si,Di,fe,vt.length),ke(Y,si)})}catch(si){r.debug(`Shared upstream analysis failed for ${Y.name} ${Y.current} \u2192 ${Ee}: ${si.message}. Falling back to independent analysis for this row.`)}let Et=await Br("package",{package:Y.name,ecosystem:Y.target.manager.ecosystem,from:Y.current,to:Ee},()=>wGe({dep:Y,selected:Ee,versions:Re.versions,latest:Re.latest,safeLatest:Re.safeLatest,latestMinor:Re.latestMinor,repo:n,config:i,githubToken:o,root:t,indexing:Ci,logger:r,env:m,maxSites:p.maxSites,member:re?Y.target.dir:void 0,allMembers:re?A:void 0,memberName:re?D.get(Y.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,prepared:Ge,onProgress:(si,Di)=>{y(si,Di,fe,vt.length),ke(Y,si)}}));ae.push(Et),a?.(h.enabled?{...Et,status:"checking",phase:"Waiting to be installed and tested"}:Et),fe+=1,y(Gy(Et)==="affected"?"Needs your attention":"Checked",`${Et.name} ${Et.current} \u2192 ${Et.selected} \xB7 ${Une(Et).toLowerCase()}`,fe,vt.length)})),_t.end({packages:vt.length});let z=It("phase","verification");try{h.enabled&&ae.length>0&&!u?.isCancellationRequested&&await Br("verification",{candidates:ae.length},()=>yGe({root:t,candidates:ae,checks:h.checks,timeoutMs:h.timeoutMs,generatedSourceGlobs:h.generatedSourceGlobs,...h.baselineCache?{baselineCache:h.baselineCache}:{},env:m,logger:r,...so?{warm:so}:{},...u?{token:u}:{},onProgress:Y=>{if(Y.output!==void 0){s?.({phase:"",detail:"",done:Y.done,total:Y.total,output:Y.output});return}y(Y.phase,Y.detail,Y.done,Y.total);for(let Re of Y.targets??[]){let Ee=ae.findIndex(Et=>Et.id===Re),Ge=Ee>=0?ae[Ee]:void 0;!Ge||Ge.verification||a?.({...Ge,status:"checking",phase:Y.detail?`${Y.phase} \xB7 ${Y.detail}`:Y.phase})}},onCandidate:a}))}finally{if(h.enabled)for(let[Y,Re]of ae.entries()){if(Re.verification)continue;let Ee=Ox(Re,{status:"skipped",reason:u?.isCancellationRequested?`The scan was stopped before ${Re.name} ${Re.selected} could be installed and checked, so the findings below are predictions.`:`${Re.name} ${Re.selected} was not installed and checked, so the findings below are predictions.`,checks:[],failedFiles:[]});ae[Y]=Ee,a?.(Ee)}await so?.dispose(),z.end({candidates:ae.length})}}finally{ye()}return w.end({checked:ft.length,candidates:ae.length}),{candidates:ae.sort(xGe),checked:ft.length,upToDate:zn,unchecked:be,targets:K,workspaces:_,ambiguities:te,nestedGitRepos:E}}async function yGe(e){let t=new Map(e.candidates.map(o=>[o.id,o])),n=e.candidates.filter(o=>o.rationale?.maintenance.deprecated);for(let o of n){let s=o.rationale?.maintenance.deprecated,a=Ox(o,{status:"skipped",reason:`${o.name} ${o.selected} has been withdrawn (${s}), so it cannot be installed to test.`,checks:[],failedFiles:[]}),c=e.candidates.indexOf(o);c>=0&&(e.candidates[c]=a),e.onCandidate?.(a)}let r=e.candidates.filter(o=>!n.includes(o)).map(o=>({id:o.id,name:o.name,current:o.current,selected:o.selected,manifestPath:o.manifestPath,packageManager:o.packageManager,install:s=>bGe(s,o,"safe",au(e.env))}));await yne({root:e.root,targets:r,installTogether:(o,s)=>vGe(o,s.map(a=>t.get(a.id)).filter(a=>a!==void 0),"safe",au(e.env)),kinds:e.checks,env:e.env,logger:e.logger,timeoutMs:e.timeoutMs,...e.generatedSourceGlobs?{allowedGlobs:e.generatedSourceGlobs}:{},...e.baselineCache?{baselineCache:e.baselineCache}:{},...e.warm?{warm:e.warm}:{},...e.token?{token:e.token}:{},onProgress:o=>e.onProgress?.({phase:o.phase,detail:o.detail,done:o.done,total:o.total,...o.targets?{targets:o.targets}:{},...o.output!==void 0?{output:o.output}:{}}),onVerified:(o,s)=>{let a=t.get(o.id);if(!a)return;let c=Ox(a,s),l=e.candidates.indexOf(a);l>=0&&(e.candidates[l]=c);let u=(a.plan?.breakingChanges.length??0)-(c.plan?.breakingChanges.length??0);e.logger.info(`${o.name}@${o.selected}: ${Uy(s)}`+(u>0?` ${u} predicted finding(s) dropped as disproved.`:"")),e.onCandidate?.(c)}})}async function lU(e,t,n){let i=0,r=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let o=i;i+=1;let s=e[o];if(s===void 0)return;await n(s)}});await Promise.all(r)}var uU=class extends Error{constructor(n){super(`${n.packageManager} cannot pin a version from the command line. Edit ${n.manifestPath} to require ${n.name} ${n.selected}, then re-run the scan.`);this.candidate=n}candidate};function Zne(e,t="safe"){let n=Yne(e,t);return n?sK(n):null}function Yne(e,t){let i=Uc(e.packageManager)?.upgrade(Mx(e));return i?t==="force"&&e.packageManager==="npm"?{...i,args:[...i.args,"--force"]}:i:null}function Mx(e){return{name:e.name,version:e.selected,kind:e.kind,...e.cargo?{cargo:e.cargo}:{}}}async function bGe(e,t,n="safe",i=process.env){let r=Yne(t,n);if(!r)throw new uU(t);let o=Uc(t.packageManager),s=(0,kr.join)(e,t.manifestPath),a=(0,kr.dirname)(s),c=await Qne([s,...(o?.lockfiles??[]).map(l=>(0,kr.join)(a,l))]);try{if(o?.rewriteManifest){let l=await(0,zo.readFile)(s,"utf8"),u=o.rewriteManifest(l,Mx(t),t.manifestPath);u!==l&&await(0,zo.writeFile)(s,u,"utf8")}await Wne(r.command,r.args,{cwd:a,env:i,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}catch(l){throw await Xne(c),l.code==="ENOENT"?new Error(`${r.command} was not found on PATH. Run \`command -v ${r.command}\` to check, and install it if it is genuinely missing.`):l}}async function vGe(e,t,n="safe",i=process.env){if(t.length===0)return!1;let r=t[0];if(!t.every(d=>d.manifestPath===r.manifestPath&&d.packageManager===r.packageManager))return!1;let s=Uc(r.packageManager);if(!s)return!1;let a=iK(s,t.map(Mx));if(!a)return!1;let c=(0,kr.join)(e,r.manifestPath),l=(0,kr.dirname)(c),u=await Qne([c,...(s.lockfiles??[]).map(d=>(0,kr.join)(l,d))]);try{if(s.rewriteManifest){let d=await(0,zo.readFile)(c,"utf8"),p=d;for(let f of t)p=s.rewriteManifest(p,Mx(f),f.manifestPath);p!==d&&await(0,zo.writeFile)(c,p,"utf8")}for(let d of a){let p=n==="force"&&r.packageManager==="npm"?[...d.args,"--force"]:d.args;await Wne(d.command,p,{cwd:l,env:i,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}}catch(d){throw await Xne(u),d.code==="ENOENT"?new Error(`${a[0].command} was not found on PATH. Run \`command -v ${a[0].command}\` to check, and install it if it is genuinely missing.`):d}return!0}async function Qne(e){return Promise.all(e.map(async t=>({path:t,content:await(0,zo.readFile)(t,"utf8").catch(()=>null)})))}async function Xne(e){await Promise.all(e.map(async({path:t,content:n})=>{try{n===null?await(0,zo.rm)(t,{force:!0}):await(0,zo.writeFile)(t,n,"utf8")}catch{}}))}async function wGe(e){let t=`${e.dep.name} ${e.dep.current} \u2192 ${e.selected}`,n=e.onProgress??(()=>{}),{target:i}=e.dep,r={name:e.dep.name,ecosystem:i.manager.ecosystem,from:e.dep.current,to:e.selected,kind:e.dep.kind,bump:ta(e.dep.current,e.selected,i.manager.ecosystem),manifestPath:i.manifestPath,rawFrom:e.dep.current,rawTo:e.selected,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{}},o={id:Lx(e.dep,e.repoRoot),name:e.dep.name,kind:e.dep.kind,ecosystem:i.manager.ecosystem,packageManager:i.manager.id,manifestPath:i.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},...e.allMembers?{allMembers:e.allMembers}:{},current:e.dep.current,...e.dep.assumed?{assumed:!0}:{},range:e.dep.range,safeLatest:e.safeLatest,latestMinor:e.latestMinor,selected:e.selected,latest:e.latest,versions:e.versions};try{n("Reading release notes and changelog",t);let s=new Map,a=new Map,c=new Set,l=new Map,u=new Map,d=e.prepared?.evidence?.evidence.map(T=>e.member===void 0?T:{...T,workspace:e.member})??await Br("evidence",{package:e.dep.name,ecosystem:i.manager.ecosystem},()=>En("evidence",i.manager.ecosystem,()=>UO(r,{config:e.config,logger:e.logger,githubToken:e.githubToken,env:e.env,workspaceRoot:e.root,onSurfaceComputed:(T,A)=>{let L=cn(T);A.weight>=.8&&c.add(L),l.set(L,{available:!0,inspection:"succeeded",tool:A.tool,...A.packageRole?{packageRole:A.packageRole}:{}}),s.set(L,{additions:A.additions??[],locator:A.locator})},onUnavailableSurface:(T,A)=>{let L=cn(T);a.set(L,A),l.set(L,Kne(A))},onProseConsulted:(T,A)=>{let L=cn(T);u.set(L,[...u.get(L)??[],A])}}),{package:e.dep.name}));if(e.prepared?.evidence){let T=cn(r),A=cn({...r,workspace:void 0}),L=e.prepared.evidence;s.clear();let F=L.additions.get(A);F&&s.set(T,F),a.clear();let K=L.surfaceGaps.get(A);K&&a.set(T,K),L.surfaceCompared.has(A)&&c.add(T),l.clear();let te=L.surfaceAssessments.get(A);te&&l.set(T,te),u.clear();let D=L.prose.get(A);D&&u.set(T,D)}n("Comparing the public API surface",`${t} \xB7 ${d.length} evidence source${d.length===1?"":"s"}`);let p=await Br("api.diff",{package:e.dep.name,evidenceSources:d.length},()=>En("analyze",i.manager.ecosystem,()=>BS([r],d,{config:e.config,logger:e.logger})));n(p.length>0?`Searching your code for ${p.length} breaking change${p.length===1?"":"s"}`:"No breaking changes to look for",t);let f=p.length>0?await En("module-maps",i.manager.ecosystem,()=>WS([r],{logger:e.logger})):void 0,m=It("index-wait",i.manager.ecosystem),{files:g,index:h}=await e.indexing;m.end();let b=It("localize",i.manager.ecosystem,{changes:p.length}),y=Mc("localization",{package:e.dep.name,changes:p.length,filesConsidered:g.length}),{sites:w,runtimeAnalyses:k}=nx(p,[r],h,g,{logger:e.logger,maxSitesPerChange:e.maxSites??40,member:e.member,members:e.allMembers,...f?{moduleMaps:f}:{}}),_=pGe(k,g.coverage.runtimeConfigComplete);b.end({sites:w.length}),y.end({sites:w.length}),n("Weighing what this upgrade is worth",t);let[S]=await En("rationale",i.manager.ecosystem,()=>fx({changes:[r],evidence:d,breakingChanges:p,impactSites:w,runtimeAnalyses:_,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated},{config:e.config,logger:e.logger,githubToken:e.githubToken,additions:s,surfaceCompared:c,surfaceGaps:a,prose:u,...e.prepared?.rationaleFacts?{preparedFacts:new Map([[r,e.prepared.rationaleFacts]])}:{},repoRuntime:Tf(g,e.member,e.allMembers),pythonRuntime:If(g,e.member,e.allMembers),onProgress:(T,A)=>n(A,t)})),x=ux({repo:e.repo,config:e.config,changes:[r],evidence:d,breakingChanges:p,impactSites:w,runtimeAnalyses:_,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated,runtimeConfigComplete:g.coverage.runtimeConfigComplete,...S?{rationale:[S]}:{}}),E=l.get(cn(r));return{...o,status:p.length>0?"ready":"clean",evidenceCount:d.length,breakingCount:p.length,impactCount:w.length,actionableImpactCount:(x.dispositions??[]).reduce((T,A)=>T+A.actionableSites.length,0),actionableImpactFiles:new Set((x.dispositions??[]).flatMap(T=>T.actionableSites.map(A=>A.file))).size,runtimeDeclarationSiteCount:(x.dispositions??[]).filter(T=>T.runtimeAnalysis!==void 0).reduce((T,A)=>T+A.sites.length,0),impactFiles:new Set(w.map(T=>T.file)).size,impactConfidence:kGe(w),sourceCoverage:g.coverage,...E?{surfaceAssessment:E}:{},risk:x.risk,summary:Dx(p.length,p,w,e.dep.name,S),gaps:S?.gaps??[],toolRequests:$Ge(a),...S?{rationale:S,recommendation:S.assessment.recommendation,...S.assessment.runtimeCompatibility?{runtimeCompatibility:S.assessment.runtimeCompatibility}:{},..._.length>0?{runtimeAnalyses:_.map(T=>({changeId:T.changeId,runtime:T.runtime,state:T.state,reason:T.reason,siteCount:T.sites.length,declarationCount:T.declarations.length,unresolvedCount:T.unresolved.length,statement:T.statement}))}:{}}:{},plan:x}}catch(s){return{...o,status:"error",evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"Could not inspect this upgrade",gaps:[],toolRequests:[],error:s.message}}}function kGe(e){return e.some(t=>t.confidence==="high")?"high":e.some(t=>t.confidence==="medium")?"medium":e.some(t=>t.confidence==="low")?"low":"none"}function $Ge(e){let t=new Set,n=[];for(let i of e.values())!i.install||t.has(i.install.id)||(t.add(i.install.id),n.push(i.install));return n}function Lx(e,t){return`${t?`${t}::`:""}${e.target.manifestPath}#${e.name}@${e.current}`}function ere(e){let{dep:t}=e;return{id:Lx(t,e.repoRoot),name:t.name,kind:t.kind,...t.cargo?{cargo:t.cargo}:{},ecosystem:t.target.manager.ecosystem,packageManager:t.target.manager.id,manifestPath:t.target.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},current:t.current,...t.assumed?{assumed:!0}:{},range:t.range,selected:t.current,latest:t.current,versions:[],status:"pending",phase:e.phase,evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"",gaps:[],toolRequests:[]}}function _Ge(e,t,n,i){return{...ere({dep:e,phase:n,...i?.member===void 0?{}:{member:i.member},...i?.memberName?{memberName:i.memberName}:{},...i?.repoRoot?{repoRoot:i.repoRoot}:{},...i?.repoLabel?{repoLabel:i.repoLabel}:{}}),selected:t.safeLatest??t.latest,latest:t.latest,...t.safeLatest?{safeLatest:t.safeLatest}:{},...t.latestMinor?{latestMinor:t.latestMinor}:{},versions:t.versions}}async function SGe(e){let t=new Map,n=new Map,i=c=>{let l=c;for(let u=0;u<4&&l.includes("${");u+=1)l=l.replace(/\$\{([^}]+)\}/g,(d,p)=>n.get(p)??d);return l},r=c=>{for(let[u,d]of c.properties)n.has(u)||n.set(u,d);let l=[];for(let[u,d]of c.dependencyManagement){let p=d.split("|"),f=p[0]??"";f&&(p.includes("import")?l.push(`${u}:${f}`):t.has(u)||t.set(u,f))}return l},o;try{o=IO(e)}catch{return t}let s=r(o);o.parent&&s.push(o.parent);let a=new Set;for(let c=0;c<8&&s.length>0;c+=1){let l=s.shift(),[u,d,p]=l.split(":");if(!u||!d||!p)continue;let f=i(p),m=`${u}:${d}:${f}`;if(a.has(m)||f.includes("${"))continue;a.add(m);let g=await i_({groupId:u,artifactId:d},f);if(g.ok){for(let h of r(g.contract))s.push(h);g.contract.parent&&s.push(g.contract.parent)}}for(let[c,l]of t)t.set(c,i(l));return t}async function pU(e,t,n,i){let r=Mk(t.manifestPath),o=await i.readFile((0,kr.join)(e,t.manifestPath));if(!r||o===null)return{dependencies:[],unresolved:[]};let s=r.parse(o,t.manifestPath),a=t.lockfilePath?await i.readFile((0,kr.join)(e,t.lockfilePath)):null,c=a!==null&&t.lockfilePath?Mk(t.lockfilePath)?.parse(a,t.lockfilePath):void 0,l=n?["runtime","dev","optional","peer"]:["runtime"],u=[],d=[];for(let[p,f]of s){if(!l.includes(f.kind))continue;let m=t.manager.ecosystem,g=c?.get(p)?.version??null,h=Gi(m),b=g?h.exactVersion(g)??h.parse(g)?.raw??null:h.exactVersion(f.version??"");if(!b){let y=f.version?.trim()??"";d.push({name:p,kind:f.kind,ecosystem:m,packageManager:t.manager.id,manifestPath:t.manifestPath,current:y||"unspecified",reason:y?`no lockfile entry, and "${y}" is a range rather than one version`:m==="maven"?"no version here and none in a lockfile \u2014 it is set by a parent POM or an imported BOM, which Drift does not fetch yet":"no version declared here, and no lockfile entry to resolve one from"});continue}u.push({name:p,kind:f.kind,...f.cargo?{cargo:f.cargo}:{},current:b,range:f.version??b,target:t})}if(d.length>0&&t.manager.ecosystem==="maven"&&t.manifestPath.endsWith("pom.xml")){let p=await SGe(o);if(p.size>0){let f=Gi("maven"),m=[];for(let g of d){let h=p.get(g.name),b=h?f.exactVersion(h):null;if(!b){m.push(g);continue}u.push({name:g.name,kind:g.kind,current:b,range:h??b,target:t})}d.length=0,d.push(...m)}}return{dependencies:u,unresolved:d}}function tre(e){try{return(0,Vne.readFileSync)(e,"utf8")}catch{return null}}function xGe(e,t){let n=jne(e,t);if(n!==0)return n;if(e.impactCount!==t.impactCount)return t.impactCount-e.impactCount;let i=e.name.localeCompare(t.name);return i!==0?i:e.manifestPath.localeCompare(t.manifestPath)}var EGe=12;async function nre(e,t){if(!t)return e;let n=e.breakingChanges.filter(s=>s.symbols.length>0&&e.impactSites.some(a=>a.breakingChangeId===s.id));if(n.length===0)return e;let i=new Map,r=new Map,o=0;for(let s of n){if(o>=EGe)break;let a=e.changes.find(u=>u.name===s.dependency&&(u.workspace??"")===(s.workspace??""));if(!a?.to||a.ecosystem!=="npm")continue;let c=i.get(a.name);if(c===void 0&&(c=(await Wn(a.name,a.ecosystem,a.to))?.githubRepo??null,i.set(a.name,c)),!c)continue;o++;let l=await TGe(c,a.to,s.symbols[0],t);l&&r.set(s.id,l.url)}return r.size===0?e:{...e,breakingChanges:e.breakingChanges.map(s=>r.has(s.id)?{...s,sourceUrl:r.get(s.id)}:s)}}async function TGe(e,t,n,i){let r={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};i&&(r.Authorization=`Bearer ${i}`);let o=await IGe(e,t,r);if(!o)return null;let s=await AGe(e,n,r);if(!s)return null;let a=await RGe(e,o,s,n);return a?{url:`https://github.com/${e}/blob/${o}/${s.split("/").map(encodeURIComponent).join("/")}#L${a}`,line:a}:null}async function IGe(e,t,n){return(await $e(`https://api.github.com/repos/${e}/tags?per_page=100`,{headers:n})??[]).find(o=>!!o.name&&Xd(o.name,t))?.name??null}async function AGe(e,t,n){let i=encodeURIComponent(`${t} repo:${e} language:TypeScript`);return((await $e(`https://api.github.com/search/code?q=${i}&per_page=5`,{headers:n}))?.items??[]).map(s=>s.path).find(s=>!!s&&!s.endsWith(".d.ts")&&!s.includes("node_modules/"))??null}async function RGe(e,t,n,i){let r=await rt(`https://raw.githubusercontent.com/${e}/${t}/${n}`);if(!r)return null;let o=new RegExp(`\\b(export\\s+)?(declare\\s+)?(default\\s+)?(function|const|class|interface|type|enum)\\s+${NGe(i)}\\b`),a=r.split(` -`).findIndex(c=>o.test(c));return a===-1?null:a+1}function NGe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var CGe="Drift",rre="https://github.com/trydrift/drift",mU=9;function lre(e,t){let n=new Map;for(let i of e)n.has(i.ruleId)||n.set(i.ruleId,{id:i.ruleId,name:i.ruleName,...i.helpUri?{helpUri:i.helpUri}:{}});return{$schema:"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",version:"2.1.0",runs:[{tool:{driver:{name:CGe,informationUri:rre,rules:[...n.values()].map(i=>({id:i.id,name:i.name,shortDescription:{text:i.name},fullDescription:{text:"A Drift finding: what changed, where it's used, and the fix \u2014 see the alert body."},helpUri:i.helpUri??rre,defaultConfiguration:{level:"warning"},properties:{tags:["dependencies","drift"]}}))}},...t?{automationDetails:{id:t}}:{},results:e.map(i=>({ruleId:i.ruleId,level:i.level,message:{text:PGe(i.message),markdown:i.message},locations:[ore(i.primaryLocation,i.snippetOk)],...i.relatedLocations.length>0?{relatedLocations:i.relatedLocations.map((r,o)=>({id:o+1,...ore(r)}))}:{},partialFingerprints:{primaryLocationLineHash:OGe(i)}}))}]}}function PGe(e){return e.replace(/\[([^\]]*)\]\(([^)]+)\)/g,"$1 ($2)").replace(/\*\*(.*?)\*\*/g,"$1").replace(/`([^`]*)`/g,"$1").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function ire(e){return e.replace(/&/g,"&").replace(//g,">")}function DGe(e,t,n){let i=n?`${n}/${e}#L${t}`:`${e}#L${t}`;return`[\`${e}:${t}\`](${i})`}function ore(e,t=!1){return{physicalLocation:{artifactLocation:{uri:e.file},region:{startLine:Math.max(1,e.line),...t&&e.excerpt?{snippet:{text:e.excerpt}}:{}}}}}function OGe(e){let t=`${e.ruleId}|${e.primaryLocation.file}|${(e.primaryLocation.excerpt??"").trim()}`;return(0,hU.createHash)("sha256").update(t).digest("hex").slice(0,40)}async function yU(e,t={}){let n=t.includeInformational??!1,i=t.granularity??"package",r=t.repoBlobUrl,o=[];e=await nre(e,t.githubToken);for(let s of e.changes){let a=e.breakingChanges.filter(g=>g.dependency===s.name&&(g.workspace??"")===(s.workspace??"")),c=e.rationale?.find(g=>g.dependency===s.name),l=[],u=0,d=[...a].sort((g,h)=>Ux(h.confidence)-Ux(g.confidence));for(let g of d){let h=e.impactSites.filter(b=>b.breakingChangeId===g.id);if(h.length===0){u++;continue}l.push({breaking:g,block:zGe(g,h,e.evidence)})}let p=[];if(LGe(c)&&p.push(BGe(c)),e.verification?.status==="failed"&&p.push(qGe(e.verification)),l.length===0&&p.length===0)if(u>0){if(!n)continue;p.push(HGe(s,u))}else{if(!n||!c)continue;p.push(WGe(s,c))}let f=e.commits.find(g=>a.some(h=>g.breakingChangeIds.includes(h.id))),m=t.fixOf?.(s)??YGe(f,e);if(i==="package"){let g=[...l.map(h=>h.block),...p];o.push(Fx({change:s,blocks:g,upstreamOnlyCount:u,fix:m,repoBlobUrl:r,ruleName:g.length===1&&g[0].ruleNameSuffix?`${s.name}: ${g[0].ruleNameSuffix}`:void 0}));continue}for(let{breaking:g,block:h}of l)if(i==="affectedSite"){let b=[h.primaryCandidate,...h.relatedCandidates].filter(y=>y!==void 0);for(let y of b)o.push(Fx({change:s,blocks:[{...h,primaryCandidate:y,relatedCandidates:[]}],upstreamOnlyCount:0,fix:m,ruleIdSuffix:`${g.id}/${MGe(y)}`,ruleName:sre(s,g),snippetOk:!0,repoBlobUrl:r}))}else o.push(Fx({change:s,blocks:[h],upstreamOnlyCount:0,fix:m,ruleIdSuffix:g.id,ruleName:sre(s,g),snippetOk:!0,repoBlobUrl:r}));for(let g of p)o.push(Fx({change:s,blocks:[g],upstreamOnlyCount:0,fix:m,ruleIdSuffix:"other",ruleName:g.ruleNameSuffix?`${s.name}: ${g.ruleNameSuffix}`:void 0,repoBlobUrl:r}))}return o}function MGe(e){return(0,hU.createHash)("sha256").update(`${e.file}|${(e.excerpt??"").trim()}`).digest("hex").slice(0,10)}function LGe(e){if(!e)return!1;let t=e.security;return t.checked&&(t.resolved.length>0||t.introduced.length>0||t.current.length>0)}async function ure(e,t={}){let n=[];for(let i of e){if(!i.plan)continue;let r=()=>{if(i.plan.commits.length>0)return;let o=Zne(i);if(o)return{description:i.verification?.status==="failed"?"The project's own checks failed with this upgrade installed \u2014 measured, not predicted. Do not treat this as safe to upgrade without investigating.":i.breakingCount>0?"The upstream API changed, but no code in this repository was found to use the affected parts. Review before upgrading.":"Safe to upgrade \u2014 no breaking changes found.",command:o}};n.push(...await yU(i.plan,{...t,fixOf:r}))}return n}var FGe={"removed-export":"Removed export used in this repository","renamed-export":"Renamed export used in this repository","moved-export":"Export moved to a different module","signature-change":"Call signature changed","type-change":"Type changed in a breaking way","behaviour-change":"Runtime behaviour changed","removed-endpoint":"API endpoint removed","changed-endpoint":"API endpoint changed","required-field-added":"New required field","default-change":"Default value changed","config-change":"Configuration shape changed","module-system-change":"Module loading compatibility changed","runtime-requirement":"Runtime requirement changed",unknown:"Unclassified breaking change"};function dre(e){return FGe[e]??"Breaking change"}function sre(e,t){let n=`${e.name}: ${dre(t.kind)}`;if(t.symbols.length===0)return n;let i=t.symbols.slice(0,2).join(", "),r=t.symbols.length>2?", \u2026":"";return`${n} (${i}${r})`}var Vy={runtime:"dependency",dev:"devDependency",peer:"peerDependency",optional:"optionalDependency",transitive:"transitive dependency"};function UGe(e){return Vy[e]??e}var are={error:2,warning:1,note:0};function jGe(e){return e.reduce((t,n)=>are[n]>are[t]?n:t,"note")}function zGe(e,t,n){let i=[...t].sort((d,p)=>Ux(p.confidence)-Ux(d.confidence)||d.file.localeCompare(p.file)||d.line-p.line),r=i[0],o=i.slice(1,1+mU),s=r.confidence,a=new Set(t.map(d=>d.file)),c=KGe(e,n),l=e.sourceUrl??(c?JGe(c,e):void 0),u=[`**${dre(e.kind)}:** ${GGe(e.summary,l)}`,"",`Upstream confidence: ${e.confidence}. Local confidence: ${s}`+(t.length>1?` (best of ${t.length} matches across ${a.size} file(s)).`:".")];return e.before&&e.after&&e.before!==e.after&&u.push("",`- \`${ire(gU(e.before,300))}\``,`+ \`${ire(gU(e.after,300))}\``),l&&u.push("",`${e.sourceUrl?"GitHub source":"Declaration source"}: ${l}`),{level:VGe(e.confidence,s),lines:u,primaryCandidate:{file:r.file,line:r.line,excerpt:r.excerpt},relatedCandidates:o.map(d=>({file:d.file,line:d.line,excerpt:d.excerpt})),helpUri:l}}function gU(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}function GGe(e,t){return t?e.replace(/`([^`]+)`/g,(n,i)=>`[\`${i}\`](${t})`):e}function VGe(e,t){return e==="high"&&t==="high"?"error":e==="high"||t==="high"||e==="medium"&&t==="medium"?"warning":"note"}function Ux(e){return e==="high"?2:e==="medium"?1:0}function BGe(e){let t=e.security,n,i,r=[];if(t.current.length>0){n=`Currently affected by ${t.current.length} known ${Uf(t.current.length,"advisory","advisories")}`;let s=cre(t.current);i=s==="critical"||s==="high"?"error":"warning",r.push(["**Currently affected:**",...t.current.map(a=>`- ${fU(a)}`)].join(` -`))}else if(t.introduced.length>0){n=`Upgrading would introduce ${t.introduced.length} new known ${Uf(t.introduced.length,"advisory","advisories")}`;let s=cre(t.introduced);i=s==="critical"||s==="high"?"error":"warning"}else n=`Resolves ${t.resolved.length} known ${Uf(t.resolved.length,"advisory","advisories")}`,i="note";t.introduced.length>0&&r.push(["**Would introduce:**",...t.introduced.map(s=>`- ${fU(s)}`)].join(` -`)),t.resolved.length>0&&r.push(["**Resolves:**",...t.resolved.map(s=>`- ${fU(s)}`)].join(` -`));let o=[`**${n}**`];for(let s of r)o.push("",s);o.push("",`Drift's assessment: **${ru[e.assessment.recommendation]}**.`);for(let s of e.assessment.reasons)o.push(`- ${s}`);return{level:i,lines:o,relatedCandidates:[],helpUri:t.current[0]?.url??t.introduced[0]?.url??t.resolved[0]?.url,ruleNameSuffix:n}}function qGe(e){let n=e.checks.filter(o=>o.status==="failed").map(o=>`\`${o.label}\``).join(", "),r=[`**The project's own checks fail with this upgrade installed${e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:""}** \u2014 measured, not predicted. Drift's static analysis found no specific call site to point at, but the upgrade should not be treated as safe.`];return n&&r.push("",`Failing: ${n}`),e.diagnostics&&r.push("",gU(e.diagnostics,4e3)),{level:"error",lines:r,relatedCandidates:[],ruleNameSuffix:"Project's own checks fail with this upgrade"}}function WGe(e,t){return{level:"note",lines:[`**Update available** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}), with no breaking changes or advisories found.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 safe to upgrade"}}function HGe(e,t){return{level:"warning",lines:[`**Breaking change detected upstream** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}). ${t} upstream breaking ${Uf(t,"change was","changes were")} found, and no code in this repository was found to use the affected parts \u2014 but a completed search is not proof the change cannot reach this repository. Review before upgrading.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 review before upgrading"}}function Fx(e){let{change:t,blocks:n,upstreamOnlyCount:i,fix:r,ruleIdSuffix:o,ruleName:s,snippetOk:a,repoBlobUrl:c}=e,l=qk(t),u=t.to?`${t.from??"none"} \u2192 ${t.to}`:"removed",d=n.some(k=>k.primaryCandidate),p=UGe(t.kind),f=[l?`**${t.name}** (${t.ecosystem} ${p}) ${u} \u2014 ${l}`:`**${t.name}** (${t.ecosystem} ${p}) ${u}`];i>0&&f.push("",`${i} additional upstream breaking ${Uf(i,"change does","changes do")} not reach code in this repository and ${Uf(i,"is","are")} omitted here.`);let m=a?n.find(k=>k.primaryCandidate)?.primaryCandidate??{file:t.manifestPath,line:1}:{file:t.manifestPath,line:1},g=new Set([`${m.file}:${m.line}`]),h=[];for(let k of n){let _=k.primaryCandidate?[k.primaryCandidate,...k.relatedCandidates]:k.relatedCandidates;for(let S of _){let x=`${S.file}:${S.line}`;if(!g.has(x)&&(g.add(x),h.push(S),h.length>=mU))break}if(h.length>=mU)break}let b=new Map(h.map((k,_)=>[`${k.file}:${k.line}`,_+1])),y=k=>{let _=b.get(`${k.file}:${k.line}`);return _!==void 0?`[\`${k.file}:${k.line}\`](${_})`:DGe(k.file,k.line,c)},w=[f.join(` +`)}function UVe(e){let t=[`### \`${e.dependency}\` ${e.from} \u2192 ${e.to}`,"",`**Recommendation: ${jl[e.assessment.recommendation]}**`,""],n=zVe(e.security);n&&t.push(n,"");let r=GVe(e.maintenance);if(r&&t.push(r,""),e.improvements.length>0){t.push("**Other improvements**","");for(let s of e.improvements)t.push(`- ${s.statement}${s.url?` ([source](${s.url}))`:""}`);t.push("")}let i=BVe(e.license);i&&t.push(i,"");let o=VVe(e.summary);if(o&&t.push(o,""),t.push(`**Evidence confidence:** ${FVe[e.assessment.confidence]} \u2014 ${e.assessment.confidenceBasis}`,""),e.assessment.reasons.length>0){t.push("
Why Drift concluded this","");for(let s of e.assessment.reasons)t.push(`- ${s}`);t.push("","
")}return t.join(` +`).trim()}function zVe(e){if(!e.checked)return`**Security** + +${e.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."}`;let t=["**Security**",""];return e.resolved.length>0&&(t.push(`Upgrading resolves ${cb(e.resolved.length,"known vulnerability","known vulnerabilities")}:`),t.push(...JU(e.resolved)),t.push("")),e.introduced.length>0&&(t.push(`The target version is affected by ${cb(e.introduced.length,"advisory","advisories")} that ${e.introduced.length===1?"does":"do"} not affect the installed version:`),t.push(...JU(e.introduced)),t.push("")),e.carried.length>0&&(t.push(`${cb(e.carried.length,"advisory affects","advisories affect")} both versions and ${e.carried.length===1?"is":"are"} not addressed by this upgrade:`),t.push(...JU(e.carried)),t.push("")),e.target.length===0&&t.push("No known vulnerabilities were found for the target version."),t.join(` +`).trim()}function JU(e){let t=e.slice(0,jVe),n=t.map(r=>{let i=r.aliases.find(a=>a.startsWith("CVE-")),o=i&&i!==r.id?`${r.id} (${i})`:r.id,s=r.fixedIn?` \u2014 first fixed in ${r.fixedIn}`:" \u2014 no fixed version published";return`- [${o}](${r.url}) \u2014 ${LVe[r.severity]}${s}. ${r.summary}`});return e.length>t.length&&n.push(`- \u2026and ${e.length-t.length} more.`),n}function GVe(e){return e.facts.length===0?"":["**Maintenance**","",...[...e.facts].sort((n,r)=>Number(r.concerning??!1)-Number(n.concerning??!1)).map(n=>`- ${n.statement}${n.url?` ([source](${n.url}))`:""}`)].join(` +`)}function BVe(e){if(e.verdict==="ok"||e.verdict==="changed")return"";let n=[e.verdict==="policy-violation"?"**License review required**":"**License**","",e.statement],r=e.introduced.filter(i=>!i.allowed);if(r.length>0){n.push("","Newly introduced dependencies of this package:");for(let i of r)n.push(`- \`${i.name}\` \u2014 ${i.license??"no declared license"}`);n.push("","This covers the dependencies this package itself declares. Drift does not resolve the full transitive graph during analysis.")}return n.push("","_Drift reports what the metadata says and how it compares to your configured policy. It does not give legal advice._"),n.join(` +`)}function VVe(e){if(e.changes.length===0)return"";let t=[["Breaking changes",e.changes.filter(r=>r.category==="breaking")],["Security",e.changes.filter(r=>r.category==="security")],["Improvements",e.changes.filter(r=>r.category==="performance"||r.category==="improvement")],["Fixes",e.changes.filter(r=>r.category==="fix")]],n=["
What changed upstream",""];for(let[r,i]of t)if(i.length!==0){n.push(`**${r}**`,"");for(let o of i){let s=o.affectedSites!==void 0?` Drift found ${cb(o.affectedSites,"affected call","affected calls")} in this repository.`:"";n.push(`- ${o.text}${s}${o.url?` ([source](${o.url}))`:""}`)}n.push("")}return e.unrelated>0&&n.push("**Unrelated changes**","",`- ${cb(e.unrelated,"further change","further changes")} were read and judged not to concern this repository.`,""),n.push("
"),n.join(` +`)}function cb(e,t,n){return`${e} ${e===1?t:n}`}var qVe=["drift-schema","drift-plan","drift-plan-digest","drift-commit","drift-base-branch"],WVe=/^[ \t]*[ \t]*$/gm,HVe=/^[0-9a-f]{40}$/,KVe=/^plan_[0-9a-f]{10}$/,JVe=/^[0-9a-f]{64}$/;function ZVe(e){return!(!e||e.length>255||/[\x00-\x20~^:?*[\\]/.test(e)||e.includes("..")||e.includes("@{")||e.startsWith("/")||e.endsWith("/")||e.includes("//")||e.startsWith("-")||e.startsWith(".")||e.endsWith(".")||e.endsWith(".lock"))}function zie(e){return[``,``,``,``,``].join(` +`)}function Gie(e){if(!e)return{ok:!1,reason:"the issue has no body"};let t=new Map;for(let l of e.matchAll(WVe)){let u=l[1],d=(l[2]??"").trim(),p=t.get(u);p?p.push(d):t.set(u,[d])}if(t.size===0)return{ok:!1,reason:"the issue has no Drift plan footer, so it is not a Drift approval issue"};for(let l of qVe){let u=t.get(l);if(!u)return{ok:!1,reason:`the plan footer is missing \`${l}\``};if(u.length>1)return{ok:!1,reason:`the plan footer declares \`${l}\` ${u.length} times; a Drift issue declares each key exactly once`};if(u[0]==="")return{ok:!1,reason:`the plan footer has an empty \`${l}\``}}let n=l=>t.get(l)[0],r=n("drift-schema");if(!/^\d+$/.test(r))return{ok:!1,reason:`\`drift-schema\` must be an integer, not \`${YU(r)}\``};let i=Number(r);if(!cU.includes(i))return{ok:!1,reason:`this issue records plan schema v${i}, which this version of Drift cannot verify (it supports v${cU.join(", v")}). Re-run Drift to generate a current plan.`};let o=n("drift-plan");if(!KVe.test(o))return{ok:!1,reason:`\`drift-plan\` is not a Drift plan id: \`${YU(o)}\``};let s=n("drift-plan-digest");if(!JVe.test(s))return{ok:!1,reason:"`drift-plan-digest` is not a 64-character SHA-256 digest"};let a=n("drift-commit");if(!HVe.test(a))return{ok:!1,reason:"`drift-commit` must be a full 40-character commit SHA; an abbreviated SHA does not name one commit unambiguously"};let c=n("drift-base-branch");return ZVe(c)?{ok:!0,metadata:{schemaVersion:i,planId:o,planDigest:s,headSha:a,baseBranch:c}}:{ok:!1,reason:`\`drift-base-branch\` is not a valid branch name: \`${YU(c)}\``}}function Bie(e){let t=[``,``];return e.taskId&&t.push(``),e.pullRequestNumber!==void 0&&t.push(``),t.join(` +`)}function Vie(e,t){for(let n of e){if(!n.authorIsDrift||!n.body)continue;let r=//.exec(n.body)?.[1];if(r!==t)continue;let i=//.exec(n.body)?.[1]?.trim(),o=//.exec(n.body)?.[1]?.trim(),s=//.exec(n.body)?.[1];return{planDigest:r,...i?{branchName:i}:{},...o?{taskId:o}:{},...s?{pullRequestNumber:Number(s)}:{}}}return null}function YU(e){let t=e.replace(/[`\r\n]/g," ").trim();return t.length<=40?t:`${t.slice(0,40)}\u2026`}var cz=require("node:crypto");var vr=require("node:path");var Zie=require("node:fs"),Go=require("node:fs/promises"),Yie=require("node:child_process"),Qie=require("node:util");function YVe(e){return e.verification?e.verification.status==="passed"?"passed":e.verification.status==="failed"?"failed":"skipped":"not-run"}function lb(e){if(e.status==="pending")return"pending";if(e.status==="error")return"error";let t=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial";if((e.actionableImpactCount??(t?e.runtimeDeclarationSiteCount!==void 0?Math.max(0,e.impactCount-e.runtimeDeclarationSiteCount):e.impactConfidence==="high"?e.impactCount:0:e.impactConfidence==="low"||e.impactConfidence==="medium"?0:e.impactCount))>0)return"affected";if(e.verification?.status==="failed")return"verification-failed";let r=t?e.runtimeDeclarationSiteCount:0;if((r===void 0?t?0:e.impactCount:Math.max(0,e.impactCount-r))>0)return"review-required";if(e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial")return"runtime-unresolved";let o=e.runtimeAnalyses?.length??0,s=Math.max(0,e.breakingCount-o);return s>0&&(e.sourceCoverage?.localizationComplete===!1||e.sourceCoverage?.sourceTruncated)?"localization-incomplete":s>0?e.verifiedUnaffected===!0?"upstream-only":"review-required":e.breakingCount>0?"upstream-only":e.recommendation==="insufficient-evidence"?"evidence-missing":e.recommendation?"clean":e.gaps&&e.gaps.length>0?"evidence-missing":"clean"}function Wie(e){let t=YVe(e),n=t==="not-run"?" \u2014 not deeply verified":t==="skipped"?" \u2014 deep verification did not complete":"",r=XVe(e);switch(lb(e)){case"pending":return"Not checked yet";case"error":return"Could not check";case"affected":{let i=e.actionableImpactCount!==void 0,o=e.actionableImpactFiles??e.impactFiles,s=e.actionableImpactCount??e.impactCount,a=i?"actionable site":"site",c=e.impactConfidence&&e.impactConfidence!=="high"||e.runtimeCompatibility==="partial"?"May affect":"Affects",l=e.impactPendingIsolatedClearance?" \u2014 not yet confirmed alone: a batch check passed without testing this package in isolation":"",u=t==="failed"?" \u2014 and its own checks fail with this installed, measured not predicted":n,d=r?` \xB7 ${r}`:"";return`${c} your code \xB7 ${s} ${a}${s===1?"":"s"} in ${o} file${o===1?"":"s"}${d}${l}${u}`}case"verification-failed":{let i=(e.verification?.checks??[]).filter(o=>o.status==="failed").map(o=>o.label);return i.length>0?`Verified breaking \xB7 ${i.join(", ")} failed with this upgrade installed \u2014 measured, not predicted`:"Verified breaking \xB7 this upgrade broke the project's own checks \u2014 measured, not predicted"}case"upstream-only":{let i=`${e.breakingCount} upstream change${e.breakingCount===1?"":"s"}, none used here`;return e.verifiedUnaffected===!0?`Verified safe \xB7 ${i}, and your own checks pass`:`Safe for your code \xB7 ${i}`}case"review-required":{let i=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial"?e.runtimeDeclarationSiteCount??0:0;if(e.impactCount-i<=0){let a=e.breakingCount;return`Review Required \xB7 ${a} breaking change${a===1?"":"s"} upstream; Drift found no usage in this repository but could not prove none \u2014 verify before upgrading`+(r?` \xB7 ${r}`:"")}let o=Math.max(1,e.impactCount-i),s=r?` \xB7 ${r}`:"";return e.impactConfidence==="low"||e.impactConfidence==="medium"?`May affect your code \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm \u2014 Review required; check before upgrading${s}`:`Review Required \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm${s}`}case"runtime-unresolved":return r?`Runtime Unknown \xB7 ${r}`:"Runtime Unknown \xB7 Drift could not resolve this repository\u2019s runtime compatibility";case"localization-incomplete":return"Localization Incomplete \xB7 Drift searched the indexed source subset, but the file limit prevented proving the breaking API is unused";case"evidence-missing":return"Evidence Missing \xB7 Drift could not obtain enough upstream evidence to decide";case"clean":{let i=e.recommendation==="upgrade-recommended";return t==="passed"?i?"Verified worth taking \xB7 no breaking changes, it improves on what you have, and your own checks pass":"Verified safe \xB7 no breaking changes found, and your own checks pass":i?`Worth taking \xB7 no breaking changes, and it improves on what you have${n}`:`Safe for your code \xB7 no breaking changes found${n}`}}}function qie(e){return{affected:0,"verification-failed":1,error:2,"review-required":3,"runtime-unresolved":4,"localization-incomplete":5,"evidence-missing":6,"upstream-only":7,pending:8,clean:9}[e]}function QVe(e,t){return qie(e)-qie(t)}function Hie(e,t){return QVe(lb(e),lb(t))}function XVe(e){if(e.runtimeCompatibility!=="unknown"&&e.runtimeCompatibility!=="partial")return;let t=e.runtimeAnalyses?.find(r=>r.state==="unknown"||r.state==="partial");if(t?.statement)return t.statement;if(t?.reason==="config-incomplete")return"Drift could not index every authoritative runtime configuration file";let n=e.runtimeDeclarationSiteCount??0;return n>0?`${n} runtime declaration${n===1?"":"s"} to review`:"Drift could not resolve this repository\u2019s runtime compatibility"}function QU(e,t){return Re(e,t)}function Ja(e,t){return Ye(e,t)??0}function RE(e){switch(e){case"npm":return"the npm registry";case"pypi":return"PyPI";case"cargo":return"crates.io";case"go":return"the Go module proxy";case"maven":return"Maven Central";case"rubygems":return"RubyGems";case"nuget":return"NuGet";case"packagist":return"Packagist";case"hex":return"Hex";case"pub":return"pub.dev";case"cocoapods":return"CocoaPods Trunk";case"conan":return"ConanCenter";case"vcpkg":return"the vcpkg registry";case"arduino":return"the Arduino Library Manager";case"swift":return"the package\u2019s git tags";case"opam":return"the opam repository"}}async function Kie(e){try{return await eqe(e)}catch(t){return{outcome:"unchecked",reason:`Checking ${RE(e.ecosystem)} for ${e.name} failed: ${t.message}`}}}async function eqe(e){let{name:t,ecosystem:n,current:r,range:i}=e,o=RE(n),s=QU(r,n);if(!s)return{outcome:"unchecked",reason:`${t} is installed at \u201C${r}\u201D, which Drift cannot compare against published versions.`};let a=await ez(e);if(!a)return{outcome:"unchecked",reason:`Drift could not reach ${o} for ${t}.`};if(a.complete===!1)return{outcome:"unchecked",reason:`Drift could not enumerate all of ${o} for ${t}, so it cannot establish whether a newer compatible version exists.`};if(a.versions.length===0)return{outcome:"unchecked",reason:`${o} returned no versions for ${t}, so Drift has nothing to compare against.`};let l=(n==="swift"?a.versions.filter(b=>XU(b)===XU(r)):a.versions).map(b=>QU(b,n)).filter(b=>b!==null);if(l.length===0)return n==="swift"?{outcome:"unchecked",reason:`${o} returned no tags in the installed version's ${XU(r)} family for ${t}.`}:{outcome:"unchecked",reason:`Drift could not read any of the ${a.versions.length} version numbers ${o} published for ${t}.`};let d=(s.prerelease?l:l.filter(b=>!b.prerelease)).filter(b=>Ja(b,s)>0).sort((b,w)=>Ja(w,b)),p=a.latest?QU(a.latest,n):null,f=n==="swift"?d[0]:p&&(s.prerelease||!p.prerelease)?p:d[0];if(!f||Ja(f,s)<=0)return{outcome:"up-to-date"};let m=cqe(d,s,i,n),g=d,h=aqe(g,s,n),v=[...new Map([f,...m?[m]:[],...h?[h]:[],...g.slice(0,18)].map(b=>[b.raw,b])).values()].filter(b=>Ja(b,s)>0).sort((b,w)=>Ja(w,b)).map(b=>b.raw);return{outcome:"upgrade",latest:f.raw,...m?{safeLatest:m.raw}:{},...h?{latestMinor:h.raw}:{},versions:v}}function XU(e){let t=e.trim().replace(/^[^\d]*/,"");return/^\d{4}[.-]\d{1,2}[.-]\d{1,2}(?:[.-]\d+)?(?:$|[-+])/.test(t)?"calendar":Re(e,"swift")?"semver":"unknown"}var tqe="https://repo1.maven.org/maven2";async function ez(e){switch(e.ecosystem){case"npm":return iqe(e.name);case"swift":return oqe(e.name,e.githubToken);case"opam":return sqe(e.name,e.githubToken);case"maven":return nqe(e.name);default:{let t=await Wn(e.name,e.ecosystem,null);return t?{latest:null,versions:t.versions}:null}}}async function nqe(e){let[t,n]=e.split(":");if(!t||!n)return null;let r=await nt(`${tqe}/${t.replace(/\./g,"/")}/${n}/maven-metadata.xml`);if(r===null){let s=await Wn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}let i=/([^<]+)<\/release>/.exec(r)?.[1]?.trim()??null,o=[...r.matchAll(/([^<]+)<\/version>/g)].map(s=>s[1].trim());if(o.length===0){let s=await Wn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}return{latest:i,versions:o}}var rqe="application/vnd.npm.install-v1+json, application/json";async function iqe(e){let t=await xe(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`,{timeoutMs:12e3,headers:{Accept:rqe}});return t?{latest:t["dist-tags"]?.latest?.trim()??null,versions:Object.keys(t.versions??{})}:null}function Jie(e){return{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28",...e?{Authorization:`Bearer ${e}`}:{}}}async function oqe(e,t){if(!/^[\w.-]+\/[\w.-]+$/.test(e))return null;let n=100,r=20,i=[];for(let o=1;o<=r;o++){let s=await xe(`https://api.github.com/repos/${e}/tags?per_page=${n}&page=${o}`,{headers:Jie(t)});if(!s)return o===1?null:{latest:null,versions:[...new Set(i)],complete:!1};if(i.push(...s.map(a=>a.name).filter(a=>!!a)),s.lengthr.sameCompatibilityLine(t,i)===!0).sort((i,o)=>Ja(o,i))[0]}function cqe(e,t,n,r){let i=Vi(r),s=e.filter(a=>Ja(a,t)>0).map(a=>({version:a,satisfies:i.satisfies(a,n)}));if(!s.some(a=>a.satisfies===null))return s.filter(a=>a.satisfies).map(a=>a.version).sort((a,c)=>Ja(c,a))[0]}function PE(e,t,n,r,i){if(!i)return e>0?`${e} breaking change${e===1?"":"s"} found in ${r}.`:`No breaking changes found for this version of ${r}.`;let{assessment:o,security:s}=i,a=jl[o.recommendation],c=[],l=new Map(t.map(g=>[g.id,g])),u=n.filter(g=>l.get(g.breakingChangeId)?.kind!=="runtime-requirement"),d=n.filter(g=>l.get(g.breakingChangeId)?.kind==="runtime-requirement");u.length>0&&c.push(`${u.length} place${u.length===1?"":"s"} in this repository use${u.length===1?"s":""} an API that ${r} changed`),c.push(...lqe(d));let p=o.runtimeCompatibility,f=p==="unknown"||p==="partial";d.length===0&&p==="unknown"&&c.push("this upgrade's runtime requirement could not be checked against this repository");let m=t.filter(g=>g.kind!=="runtime-requirement").length;if(u.length===0&&d.length===0&&m>0&&!f){let g=Yf(t);c.push(g?`${m} published ${g} change${m===1?"":"s"} ${m===1?"requires":"require"} review; ${m===1?"this package-role contract is":"these package-role contracts are"} assessed independently of source call signatures`:`${m} upstream API breaking change${m===1?"":"s"}, no usage of the changed parts located in this repository \u2014 review before upgrading`)}return s.checked&&s.resolved.length>0&&c.push(`fixes ${s.resolved.length} known ${s.resolved.length===1?"vulnerability":"vulnerabilities"}`),s.checked&&s.introduced.length>0&&c.push(`introduces ${s.introduced.length} known ${s.introduced.length===1?"vulnerability":"vulnerabilities"}`),c.length===0&&i.gaps.length>0?`${a}. ${i.gaps.join(" ")}`:c.length===0?`${a}. No breaking changes found for this version of ${r}.`:`${a}. ${uqe(c.join("; "))}.`}function lqe(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),r=e.filter(o=>o.runtimeVerdict==="partial"),i=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime declaration${o===1?"":"s"} in this repository do${o===1?"es":""} not satisfy this upgrade's runtime requirement`)}if(r.length>0){let o=r.length;t.push(`${o} runtime declaration${o===1?"":"s"} only partially satisf${o===1?"ies":"y"} this upgrade's runtime requirement`)}if(i.length>0){let o=i.length;t.push(`${o} runtime declaration${o===1?"":"s"} could not be resolved, so compatibility is unknown`)}return t}function uqe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function CE(e,t){let n={...e,verification:t};if(!n.plan||(n.plan=EE(n.plan,t),t.status==="skipped"))return n;n.breakingCount=n.plan.upstreamBreakingCount??n.plan.breakingChanges.length,n.impactCount=n.plan.impactSites.length,n.impactFiles=new Set(n.plan.impactSites.map(i=>i.file)).size;let r=n.plan.dispositions;return r&&(n.actionableImpactCount=r.reduce((i,o)=>i+o.actionableSites.length,0),n.actionableImpactFiles=new Set(r.flatMap(i=>i.actionableSites.map(o=>o.file))).size,n.runtimeDeclarationSiteCount=r.filter(i=>i.runtimeAnalysis!==void 0).reduce((i,o)=>i+o.sites.length,0)),n.rationale&&(n.rationale=n.plan.rationale?.find(i=>i.dependency===n.rationale.dependency)??n.plan.rationale?.[0]??n.rationale),n.risk=n.plan.risk,n.verifiedUnaffected=t.status==="passed"&&ob(t)==="isolated"&&t.checks.some(i=>i.status==="passed"&&i.compileCapable)&&Array.isArray(n.plan.dispositions)&&n.plan.dispositions.every(i=>i.state==="unaffected")&&(n.plan.breakingChanges.length>0||(n.plan.upstreamBreakingCount??0)>0),n.impactPendingIsolatedClearance=ob(t)==="batch"&&t.checks.some(i=>i.status==="passed"&&i.compileCapable)&&n.plan.impactSites.some(i=>{let o=n.plan.breakingChanges.find(s=>s.id===i.breakingChangeId);return o!==void 0&&jU(o)}),n.summary=PE(n.breakingCount,n.plan.breakingChanges,n.plan.impactSites,n.name,n.rationale),n}var Xie=(0,Qie.promisify)(Yie.execFile);function dqe(e,t){return t?[...e]:e.map(n=>n.state==="incompatible"||n.state==="partial"?n:{...n,state:"unknown",reason:"config-incomplete",statement:`${n.statement} Drift could not index every authoritative runtime configuration file, so this result is incomplete.`})}function eoe(e,t){return`${e}\0${t}`}var pqe={includeDev:!0,maxSites:40,maxPackages:0};function toe(e){return{available:!1,reason:e.reason,inspection:e.reason==="no-public-surface"?"succeeded":e.reason==="artifact-type-unsupported"?"not-applicable":"failed",tool:e.tool,detail:e.detail,...e.packageRole?{packageRole:e.packageRole}:{},...e.diagnostic?{diagnostic:e.diagnostic}:{}}}async function rz(e,t=[""],n=new Map,r=Hn()){let i=[],o=[],s=await gqe(e,r);for(let a of t){let c=a?(0,vr.join)(e,a):e,l=await r.readDirectory(c);if(l.length===0)continue;let u=[...l,...await fqe(c,l,r)],d=ca({entries:u,read:p=>coe((0,vr.join)(c,p))});if(d.length!==0){for(let p of YJ(d))(n.get(eoe(a,p.ecosystem))??(a?s.get(p.ecosystem):void 0))||o.push({...p,dir:a});for(let p of mqe(d,a,n,s)){let f=p.manager.manifestPattern?u.filter(h=>p.manager.manifestPattern.test(h)):[],m=p.manager.manifests.find(h=>u.includes(h))??f.find(sD)??f[0];if(!m)continue;let g=p.manager.lockfiles.find(h=>u.includes(h))??null;if(p.manager.id==="pip"&&sD(m)){let h=m.replace(/\.in$/i,".txt");if(u.includes(h)){let v=await r.readFile((0,vr.join)(c,h));v&&n_(v)&&(g=h)}}i.push({manager:p.manager,dir:a,manifestPath:a?`${a}/${m}`:m,lockfilePath:g?a?`${a}/${g}`:g:null})}}}return{targets:i,ambiguities:o}}async function fqe(e,t,n){let r=new Set;for(let o of aa)for(let s of[...o.manifests,...o.lockfiles])s.includes("/")&&r.add(s);let i=[];for(let o of r){if(t.includes(o))continue;let s=o.slice(0,o.indexOf("/"));t.includes(s)&&await n.readFile((0,vr.join)(e,o))!==null&&i.push(o)}return i}function mqe(e,t,n,r=new Map){let i=new Set,o=[];for(let s of new Set(e.map(a=>a.manager.ecosystem))){let a=e.filter(u=>u.manager.ecosystem===s),c=n.get(eoe(t,s)),l=a.find(u=>u.manager.id===c)??a.find(u=>u.manager.id===r.get(s))??a[0];i.has(s)||(i.add(s),o.push(l))}return o}async function gqe(e,t){let n=await t.readDirectory(e),r=ca({entries:n,read:o=>coe((0,vr.join)(e,o))}),i=new Map;for(let o of r)o.fromLockfile&&i.set(o.manager.ecosystem,o.manager.id);return i}async function noe(e){let{root:t,repo:n,config:r,logger:i,githubToken:o,onProgress:s,onCandidate:a,onDropped:c,onOutdated:l,token:u,repoLabel:d}=e,p=e.breadth??pqe,f=e.fs??Hn(),m=e.env??process.env,g=Math.max(1,Math.min(32,Math.floor(e.concurrency??AU(m))||1));i.debug(`Scan parallelism: ${die(m)}`);let h={enabled:(e.verify?.enabled??!1)&&r.verify.enabled,checks:e.verify?.checks??r.verify.checks,timeoutMs:e.verify?.timeoutMs??r.verify.timeoutMs,generatedSourceGlobs:e.verify?.generatedSourceGlobs??r.verify.generatedSourceGlobs,baselineCache:e.verify?.baselineCache},v=Date.now(),b=(B,Q,Ce=0,Ae=0)=>{let Be=Date.now();i.debug(`${B} (+${Be-v}ms): ${Q}`),v=Be,s?.({phase:B,detail:Q,done:Ce,total:Ae})},w=At("scan","total"),k=At("discover","manifests");b("Looking for manifests",t);let $=await cd(t,f),S=ld($),E=await g_(t,f,S).catch(()=>[]),T=E.filter(B=>B.hasOwnGit),A=E.filter(B=>!B.hasOwnGit).map(B=>B.dir),R=[...S,...A],j=e.dirs??R;if($.length>0||A.length>0){let B=[...$.map(Q=>Q.kind),...A.length>0?["undeclared"]:[]];b("Reading the workspace",`${j.length} package${j.length===1?"":"s"} \xB7 ${B.join(", ")}`)}let U=Sc("manifest.discovery"),{targets:Z,ambiguities:re}=await rz(t,j,e.managers??new Map,f);if(Z.length===0)return k.end({targets:0}),U.end({targets:0}),w.end({checked:0,candidates:0}),{candidates:[],checked:0,upToDate:0,unchecked:[],targets:Z,workspaces:$,ambiguities:re,nestedGitRepos:T};let L=new Map;for(let B of $)for(let Q of B.members)Q.name&&L.set(Q.dir,Q.name);for(let B of Z){if(L.has(B.dir))continue;let Q=B.manifestPath.includes("/")?B.manifestPath.slice(B.manifestPath.lastIndexOf("/")+1):B.manifestPath,Ce=await eh(t,f,B.dir,Q,B.manager.ecosystem).catch(()=>null);Ce&&L.set(B.dir,Ce)}k.end({targets:Z.length}),U.end({targets:Z.length,manifests:Z.length});let te=new Set(r.ecosystems),se=R.length>1||new Set(Z.map(B=>B.dir)).size>1,ae=new Set,Se=(B,Q)=>{ae.add(DE(B,d?t:void 0)),a?.(aoe({dep:B,member:se?B.target.dir:void 0,memberName:se?L.get(B.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,phase:Q}))},We=(B,Q)=>_qe(B,Q,"Waiting to be checked",{...se?{member:B.target.dir}:{},...se&&L.get(B.target.dir)?{memberName:L.get(B.target.dir)}:{},...d?{repoRoot:t,repoLabel:d}:{}}),we=()=>{for(let B of ue)ae.delete(B.id);for(let B of ae)c?.(B);ae.clear()},Et=B=>{let Q=DE(B,d?t:void 0);ae.delete(Q),c?.(Q)},vt=[],pt=[];for(let B of Z){if(!te.has(B.manager.ecosystem))continue;b("Reading manifest",B.manifestPath);let Q=await iz(t,B,p.includeDev,f),Ce=p.maxPackages>0?Math.max(0,p.maxPackages-vt.length):Q.dependencies.length;for(let Ae of Q.dependencies.slice(0,Ce))Se(Ae,"Waiting to be checked");vt.push(...Q.dependencies),pt.push(...Q.unresolved)}if(pt.length>0){let B=[];await tz(pt,gE(m),async Q=>{let Ce=Q.ecosystem,Ae=Q.current==="unspecified"?"*":Q.current,Be=Z.find(so=>so.manifestPath===Q.manifestPath);if(!Be){B.push(Q);return}let Mi=((await ez({name:Q.name,ecosystem:Ce,current:Ae,range:Ae,...o?{githubToken:o}:{}}).catch(()=>null))?.versions??[]).filter(so=>yK(so,Ae,Ce)===!0).sort((so,tT)=>Bg(tT,so,Ce)??0)[0];if(!Mi){B.push(Q);return}let $b={name:Q.name,kind:Q.kind,current:Mi,range:Ae,assumed:!0,target:Be};Se($b,"Waiting to be checked"),vt.push($b)}),pt.length=0,pt.push(...B)}let ft=p.maxPackages>0?vt.slice(0,p.maxPackages):vt;b("Indexing your code","Walking source files",0,ft.length);let Pn=At("index","walk+build"),Di=dd(t,{members:j}).then(B=>{b("Indexing your code",`${B.length} file${B.length===1?"":"s"} indexed \xB7 ${ft.length} direct dependenc${ft.length===1?"y":"ies"} to check`,0,ft.length);let Q={files:B,index:Uf(B)};return Pn.end({files:B.length}),Q});Di.catch(()=>{});let zn=0,Oi=0,he=0,ue=[],ke=[...pt],Ft=B=>h.enabled&&B.size>0&&!u?.isCancellationRequested?Eie({root:t,targets:[],kinds:h.checks,env:m,logger:i,timeoutMs:h.timeoutMs,...h.generatedSourceGlobs?{allowedGlobs:h.generatedSourceGlobs}:{},...h.baselineCache?{baselineCache:h.baselineCache}:{},...u?{token:u}:{}},[...new Map(Z.filter(Q=>B.has(Q.dir)).map(Q=>[Q.dir,Q])).values()].map(Q=>({dir:Q.dir,packageManager:Q.manager.id})),Q=>Q.output!==void 0?s?.({phase:"",detail:"",done:0,total:0,output:Q.output}):b(Q.phase,Q.detail)):void 0;b("Checking registries",`${ft.length} direct dependenc${ft.length===1?"y":"ies"}`,0,ft.length);let wt=[],sn=new Map,ii=At("phase","version-discovery");await Gr("version.discovery",{dependencies:ft.length},()=>tz(ft,gE(m),async B=>{if(u?.isCancellationRequested)return;let Q=RE(B.target.manager.ecosystem);Se(B,`Asking ${Q} what has been published`);let Ce=Sc("registry.lookup",{package:B.name}),Ae=JSON.stringify([B.target.manager.ecosystem,B.name,B.current,B.range??null]),Be=sn.get(Ae);Be||(Be=xn("versions",B.target.manager.ecosystem,()=>Kie({name:B.name,ecosystem:B.target.manager.ecosystem,current:B.current,range:B.range,...o?{githubToken:o}:{}})),sn.set(Ae,Be),Be.then(oi=>{oi.outcome==="unchecked"&&sn.get(Ae)===Be&&sn.delete(Ae)},()=>{sn.get(Ae)===Be&&sn.delete(Ae)}));let Tt=await Be;if(Ce.end({outcome:Tt.outcome}),Tt.outcome==="up-to-date"){zn+=1,Oi+=1,Et(B),b("Up to date",`${B.name}@${B.current}`,Oi,ft.length);return}if(Tt.outcome==="unchecked"){ke.push({name:B.name,kind:B.kind,ecosystem:B.target.manager.ecosystem,packageManager:B.target.manager.id,manifestPath:B.target.manifestPath,current:B.current,reason:Tt.reason}),Oi+=1,Et(B),b("Could not check",`${B.name}@${B.current} \xB7 ${Tt.reason}`,Oi,ft.length);return}wt.push({dep:B,available:Tt}),Oi+=1,a?.(We(B,Tt)),b("Outdated",`${B.name} ${B.current} \u2192 ${Tt.safeLatest??Tt.latest}`,Oi,ft.length)})),ii.end({checked:ft.length,outdated:wt.length}),wt.sort((B,Q)=>B.dep.name.localeCompare(Q.dep.name));let oo=Ft(new Set(wt.map(({dep:B})=>B.target.dir)));if(l?.({outdated:wt.map(({dep:B,available:Q})=>We(B,Q)),checked:ft.length,upToDate:zn,unchecked:[...ke]}),u?.isCancellationRequested)return we(),await oo?.dispose(),w.end({cancelled:!0}),{candidates:[],checked:ft.length,upToDate:zn,unchecked:ke,targets:Z,workspaces:$,ambiguities:re,nestedGitRepos:T};let St=At("phase","analysis"),et=new Map;for(let{dep:B,available:Q}of wt){let Ce=Q.safeLatest??Q.latest,Ae=ID({ecosystem:B.target.manager.ecosystem,name:B.name,from:B.current,to:Ce});et.has(Ae)||et.set(Ae,{name:B.name,ecosystem:B.target.manager.ecosystem,from:B.current,to:Ce})}let Gn=r.rationale.security&&et.size>0?Gr("security.batch",{upgrades:et.size},async()=>{let B=[...et.keys()],Q=[...et.values()];try{let Ce=await nb(Q,{});return new Map(B.map((Ae,Be)=>[Ae,Ce.get(Q[Be])??Uo("The OSV advisory batch lookup did not return a result for this upgrade, so its effect on known vulnerabilities is unknown.")]))}catch(Ce){let Ae=`The OSV advisory batch lookup failed unexpectedly (${Ce.message}), so this upgrade's effect on known vulnerabilities is unknown.`;return new Map(B.map(Be=>[Be,Uo(Ae)]))}}):void 0;Gn?.catch(()=>{});let _b=B=>Gn?.then(Q=>Q.get(B)),Ss=new Map,Bn=new Map,Bo=new Map,Jl=new Map,eT=(B,Q,Ce)=>{Jl.set(B,[Q,Ce]);for(let Ae of Bo.get(B)??[])Ae(Q,Ce)},Use=(B,Q)=>{let Ce=Bo.get(B);Ce||(Ce=new Set,Bo.set(B,Ce)),Ce.add(Q);let Ae=Jl.get(B);return Ae&&Q(Ae[0],Ae[1]),()=>{Ce.delete(Q),Ce.size===0&&(Bo.delete(B),Jl.delete(B))}},zse=(B,Q,Ce)=>{let Ae={name:B.name,ecosystem:B.target.manager.ecosystem,from:B.current,to:Q,kind:B.kind,bump:Qs(B.current,Q,B.target.manager.ecosystem),manifestPath:B.target.manifestPath,rawFrom:B.current,rawTo:Q},Be=ID(Ae),Tt=`${B.name} ${Ae.from} \u2192 ${Ae.to}`,oi=Ce?Use(Be,Ce):void 0,Mi=Ss.get(Be),$b=Mi!==void 0;if(!Mi){let ao=new Map,Zl=new Map,Cz=new Set,nT=new Map,rT=new Map;eT(Be,"Reading release notes and changelog",Tt);let Sb=Gr("upstream.analysis",{package:B.name,ecosystem:Ae.ecosystem,from:Ae.from,to:Ae.to,shared:!1},()=>MM(Ae,{config:r,logger:i,...o?{githubToken:o}:{},env:m,workspaceRoot:t,onSurfaceComputed:(Za,Li)=>{let Vo=cn(Za);Li.weight>=.8&&Cz.add(Vo),nT.set(Vo,{available:!0,inspection:"succeeded",tool:Li.tool,...Li.packageRole?{packageRole:Li.packageRole}:{}}),ao.set(Vo,{additions:Li.additions??[],locator:Li.locator}),eT(Be,"Comparing the public API surface",Tt)},onUnavailableSurface:(Za,Li)=>{let Vo=cn(Za);Zl.set(Vo,Li),nT.set(Vo,toe(Li))},onProseConsulted:(Za,Li)=>{let Vo=cn(Za);rT.set(Vo,[...rT.get(Vo)??[],Li])}}).then(Za=>({evidence:Za,additions:ao,surfaceGaps:Zl,surfaceCompared:Cz,surfaceAssessments:nT,prose:rT})));Ss.set(Be,Sb),Mi=Sb,Sb.catch(()=>{Ss.get(Be)===Sb&&Ss.delete(Be)})}let so=Bn.get(Be),tT=so!==void 0;if(!so){let ao=$U(Ae,{config:r,...o?{githubToken:o}:{},securityLookup:_b(Be),onProgress:Zl=>eT(Be,Zl,Tt)});Bn.set(Be,ao),so=ao,ao.catch(()=>{Bn.get(Be)===ao&&Bn.delete(Be)})}let Gse=Mi,Pz=so;return Gr("upstream.wait",{package:B.name,ecosystem:Ae.ecosystem,from:Ae.from,to:Ae.to,evidenceShared:$b,rationaleShared:tT},async()=>{let[ao,Zl]=await Promise.allSettled([Gse,Pz]);return oi?.(),{evidence:ao.status==="fulfilled"?ao.value:void 0,rationaleFacts:Zl.status==="fulfilled"?Pz:void 0}})};try{await Gr("analysis",{packages:wt.length},()=>tz(wt,g,async({dep:Q,available:Ce})=>{if(u?.isCancellationRequested)return;let Ae=Ce.safeLatest??Ce.latest,Be;try{Be=await zse(Q,Ae,(oi,Mi)=>{b(oi,Mi,he,wt.length),Se(Q,oi)})}catch(oi){i.debug(`Shared upstream analysis failed for ${Q.name} ${Q.current} \u2192 ${Ae}: ${oi.message}. Falling back to independent analysis for this row.`)}let Tt=await Gr("package",{package:Q.name,ecosystem:Q.target.manager.ecosystem,from:Q.current,to:Ae},()=>vqe({dep:Q,selected:Ae,versions:Ce.versions,latest:Ce.latest,safeLatest:Ce.safeLatest,latestMinor:Ce.latestMinor,repo:n,config:r,githubToken:o,root:t,indexing:Di,logger:i,env:m,maxSites:p.maxSites,member:se?Q.target.dir:void 0,allMembers:se?R:void 0,memberName:se?L.get(Q.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,prepared:Be,onProgress:(oi,Mi)=>{b(oi,Mi,he,wt.length),Se(Q,oi)}}));ue.push(Tt),a?.(h.enabled?{...Tt,status:"checking",phase:"Waiting to be installed and tested"}:Tt),he+=1,b(lb(Tt)==="affected"?"Needs your attention":"Checked",`${Tt.name} ${Tt.current} \u2192 ${Tt.selected} \xB7 ${Wie(Tt).toLowerCase()}`,he,wt.length)})),St.end({packages:wt.length});let B=At("phase","verification");try{h.enabled&&ue.length>0&&!u?.isCancellationRequested&&await Gr("verification",{candidates:ue.length},()=>hqe({root:t,candidates:ue,checks:h.checks,timeoutMs:h.timeoutMs,generatedSourceGlobs:h.generatedSourceGlobs,...h.baselineCache?{baselineCache:h.baselineCache}:{},env:m,logger:i,...oo?{warm:oo}:{},...u?{token:u}:{},onProgress:Q=>{if(Q.output!==void 0){s?.({phase:"",detail:"",done:Q.done,total:Q.total,output:Q.output});return}b(Q.phase,Q.detail,Q.done,Q.total);for(let Ce of Q.targets??[]){let Ae=ue.findIndex(Tt=>Tt.id===Ce),Be=Ae>=0?ue[Ae]:void 0;!Be||Be.verification||a?.({...Be,status:"checking",phase:Q.detail?`${Q.phase} \xB7 ${Q.detail}`:Q.phase})}},onCandidate:a}))}finally{if(h.enabled)for(let[Q,Ce]of ue.entries()){if(Ce.verification)continue;let Ae=CE(Ce,{status:"skipped",reason:u?.isCancellationRequested?`The scan was stopped before ${Ce.name} ${Ce.selected} could be installed and checked, so the findings below are predictions.`:`${Ce.name} ${Ce.selected} was not installed and checked, so the findings below are predictions.`,checks:[],failedFiles:[]});ue[Q]=Ae,a?.(Ae)}await oo?.dispose(),B.end({candidates:ue.length})}}finally{we()}return w.end({checked:ft.length,candidates:ue.length}),{candidates:ue.sort(Sqe),checked:ft.length,upToDate:zn,unchecked:ke,targets:Z,workspaces:$,ambiguities:re,nestedGitRepos:T}}async function hqe(e){let t=new Map(e.candidates.map(o=>[o.id,o])),n=e.candidates.filter(o=>o.rationale?.maintenance.deprecated);for(let o of n){let s=o.rationale?.maintenance.deprecated,a=CE(o,{status:"skipped",reason:`${o.name} ${o.selected} has been withdrawn (${s}), so it cannot be installed to test.`,checks:[],failedFiles:[]}),c=e.candidates.indexOf(o);c>=0&&(e.candidates[c]=a),e.onCandidate?.(a)}let i=e.candidates.filter(o=>!n.includes(o)).map(o=>({id:o.id,name:o.name,current:o.current,selected:o.selected,manifestPath:o.manifestPath,packageManager:o.packageManager,install:s=>yqe(s,o,"safe",Bl(e.env))}));await Sie({root:e.root,targets:i,installTogether:(o,s)=>bqe(o,s.map(a=>t.get(a.id)).filter(a=>a!==void 0),"safe",Bl(e.env)),kinds:e.checks,env:e.env,logger:e.logger,timeoutMs:e.timeoutMs,...e.generatedSourceGlobs?{allowedGlobs:e.generatedSourceGlobs}:{},...e.baselineCache?{baselineCache:e.baselineCache}:{},...e.warm?{warm:e.warm}:{},...e.token?{token:e.token}:{},onProgress:o=>e.onProgress?.({phase:o.phase,detail:o.detail,done:o.done,total:o.total,...o.targets?{targets:o.targets}:{},...o.output!==void 0?{output:o.output}:{}}),onVerified:(o,s)=>{let a=t.get(o.id);if(!a)return;let c=CE(a,s),l=e.candidates.indexOf(a);l>=0&&(e.candidates[l]=c);let u=(a.plan?.breakingChanges.length??0)-(c.plan?.breakingChanges.length??0);e.logger.info(`${o.name}@${o.selected}: ${sb(s)}`+(u>0?` ${u} predicted finding(s) dropped as disproved.`:"")),e.onCandidate?.(c)}})}async function tz(e,t,n){let r=0,i=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let o=r;r+=1;let s=e[o];if(s===void 0)return;await n(s)}});await Promise.all(i)}var nz=class extends Error{constructor(n){super(`${n.packageManager} cannot pin a version from the command line. Edit ${n.manifestPath} to require ${n.name} ${n.selected}, then re-run the scan.`);this.candidate=n}candidate};function roe(e,t="safe"){let n=ioe(e,t);return n?QJ(n):null}function ioe(e,t){let r=Tc(e.packageManager)?.upgrade(NE(e));return r?t==="force"&&e.packageManager==="npm"?{...r,args:[...r.args,"--force"]}:r:null}function NE(e){return{name:e.name,version:e.selected,kind:e.kind,...e.cargo?{cargo:e.cargo}:{}}}async function yqe(e,t,n="safe",r=process.env){let i=ioe(t,n);if(!i)throw new nz(t);let o=Tc(t.packageManager),s=(0,vr.join)(e,t.manifestPath),a=(0,vr.dirname)(s),c=await ooe([s,...(o?.lockfiles??[]).map(l=>(0,vr.join)(a,l))]);try{if(o?.rewriteManifest){let l=await(0,Go.readFile)(s,"utf8"),u=o.rewriteManifest(l,NE(t),t.manifestPath);u!==l&&await(0,Go.writeFile)(s,u,"utf8")}await Xie(i.command,i.args,{cwd:a,env:r,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}catch(l){throw await soe(c),l.code==="ENOENT"?new Error(`${i.command} was not found on PATH. Run \`command -v ${i.command}\` to check, and install it if it is genuinely missing.`):l}}async function bqe(e,t,n="safe",r=process.env){if(t.length===0)return!1;let i=t[0];if(!t.every(d=>d.manifestPath===i.manifestPath&&d.packageManager===i.packageManager))return!1;let s=Tc(i.packageManager);if(!s)return!1;let a=ZJ(s,t.map(NE));if(!a)return!1;let c=(0,vr.join)(e,i.manifestPath),l=(0,vr.dirname)(c),u=await ooe([c,...(s.lockfiles??[]).map(d=>(0,vr.join)(l,d))]);try{if(s.rewriteManifest){let d=await(0,Go.readFile)(c,"utf8"),p=d;for(let f of t)p=s.rewriteManifest(p,NE(f),f.manifestPath);p!==d&&await(0,Go.writeFile)(c,p,"utf8")}for(let d of a){let p=n==="force"&&i.packageManager==="npm"?[...d.args,"--force"]:d.args;await Xie(d.command,p,{cwd:l,env:r,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}}catch(d){throw await soe(u),d.code==="ENOENT"?new Error(`${a[0].command} was not found on PATH. Run \`command -v ${a[0].command}\` to check, and install it if it is genuinely missing.`):d}return!0}async function ooe(e){return Promise.all(e.map(async t=>({path:t,content:await(0,Go.readFile)(t,"utf8").catch(()=>null)})))}async function soe(e){await Promise.all(e.map(async({path:t,content:n})=>{try{n===null?await(0,Go.rm)(t,{force:!0}):await(0,Go.writeFile)(t,n,"utf8")}catch{}}))}async function vqe(e){let t=`${e.dep.name} ${e.dep.current} \u2192 ${e.selected}`,n=e.onProgress??(()=>{}),{target:r}=e.dep,i={name:e.dep.name,ecosystem:r.manager.ecosystem,from:e.dep.current,to:e.selected,kind:e.dep.kind,bump:Qs(e.dep.current,e.selected,r.manager.ecosystem),manifestPath:r.manifestPath,rawFrom:e.dep.current,rawTo:e.selected,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{}},o={id:DE(e.dep,e.repoRoot),name:e.dep.name,kind:e.dep.kind,ecosystem:r.manager.ecosystem,packageManager:r.manager.id,manifestPath:r.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},...e.allMembers?{allMembers:e.allMembers}:{},current:e.dep.current,...e.dep.assumed?{assumed:!0}:{},range:e.dep.range,safeLatest:e.safeLatest,latestMinor:e.latestMinor,selected:e.selected,latest:e.latest,versions:e.versions};try{n("Reading release notes and changelog",t);let s=new Map,a=new Map,c=new Set,l=new Map,u=new Map,d=e.prepared?.evidence?.evidence.map(A=>e.member===void 0?A:{...A,workspace:e.member})??await Gr("evidence",{package:e.dep.name,ecosystem:r.manager.ecosystem},()=>xn("evidence",r.manager.ecosystem,()=>MM(i,{config:e.config,logger:e.logger,githubToken:e.githubToken,env:e.env,workspaceRoot:e.root,onSurfaceComputed:(A,R)=>{let j=cn(A);R.weight>=.8&&c.add(j),l.set(j,{available:!0,inspection:"succeeded",tool:R.tool,...R.packageRole?{packageRole:R.packageRole}:{}}),s.set(j,{additions:R.additions??[],locator:R.locator})},onUnavailableSurface:(A,R)=>{let j=cn(A);a.set(j,R),l.set(j,toe(R))},onProseConsulted:(A,R)=>{let j=cn(A);u.set(j,[...u.get(j)??[],R])}}),{package:e.dep.name}));if(e.prepared?.evidence){let A=cn(i),R=cn({...i,workspace:void 0}),j=e.prepared.evidence;s.clear();let U=j.additions.get(R);U&&s.set(A,U),a.clear();let Z=j.surfaceGaps.get(R);Z&&a.set(A,Z),j.surfaceCompared.has(R)&&c.add(A),l.clear();let re=j.surfaceAssessments.get(R);re&&l.set(A,re),u.clear();let L=j.prose.get(R);L&&u.set(A,L)}n("Comparing the public API surface",`${t} \xB7 ${d.length} evidence source${d.length===1?"":"s"}`);let p=await Gr("api.diff",{package:e.dep.name,evidenceSources:d.length},()=>xn("analyze",r.manager.ecosystem,()=>zx([i],d,{config:e.config,logger:e.logger})));n(p.length>0?`Searching your code for ${p.length} breaking change${p.length===1?"":"s"}`:"No breaking changes to look for",t);let f=p.length>0?await xn("module-maps",r.manager.ecosystem,()=>Bx([i],{logger:e.logger})):void 0,m=At("index-wait",r.manager.ecosystem),{files:g,index:h}=await e.indexing;m.end();let v=At("localize",r.manager.ecosystem,{changes:p.length}),b=Sc("localization",{package:e.dep.name,changes:p.length,filesConsidered:g.length}),{sites:w,runtimeAnalyses:k}=Xx(p,[i],h,g,{logger:e.logger,maxSitesPerChange:e.maxSites??40,member:e.member,members:e.allMembers,...f?{moduleMaps:f}:{}}),$=dqe(k,g.coverage.runtimeConfigComplete);v.end({sites:w.length}),b.end({sites:w.length}),n("Weighing what this upgrade is worth",t);let[S]=await xn("rationale",r.manager.ecosystem,()=>uE({changes:[i],evidence:d,breakingChanges:p,impactSites:w,runtimeAnalyses:$,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated},{config:e.config,logger:e.logger,githubToken:e.githubToken,additions:s,surfaceCompared:c,surfaceGaps:a,prose:u,...e.prepared?.rationaleFacts?{preparedFacts:new Map([[i,e.prepared.rationaleFacts]])}:{},repoRuntime:Vf(g,e.member,e.allMembers),pythonRuntime:qf(g,e.member,e.allMembers),onProgress:(A,R)=>n(R,t)})),E=aE({repo:e.repo,config:e.config,changes:[i],evidence:d,breakingChanges:p,impactSites:w,runtimeAnalyses:$,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated,runtimeConfigComplete:g.coverage.runtimeConfigComplete,...S?{rationale:[S]}:{}}),T=l.get(cn(i));return{...o,status:p.length>0?"ready":"clean",evidenceCount:d.length,breakingCount:p.length,impactCount:w.length,actionableImpactCount:(E.dispositions??[]).reduce((A,R)=>A+R.actionableSites.length,0),actionableImpactFiles:new Set((E.dispositions??[]).flatMap(A=>A.actionableSites.map(R=>R.file))).size,runtimeDeclarationSiteCount:(E.dispositions??[]).filter(A=>A.runtimeAnalysis!==void 0).reduce((A,R)=>A+R.sites.length,0),impactFiles:new Set(w.map(A=>A.file)).size,impactConfidence:wqe(w),sourceCoverage:g.coverage,...T?{surfaceAssessment:T}:{},risk:E.risk,summary:PE(p.length,p,w,e.dep.name,S),gaps:S?.gaps??[],toolRequests:kqe(a),...S?{rationale:S,recommendation:S.assessment.recommendation,...S.assessment.runtimeCompatibility?{runtimeCompatibility:S.assessment.runtimeCompatibility}:{},...$.length>0?{runtimeAnalyses:$.map(A=>({changeId:A.changeId,runtime:A.runtime,state:A.state,reason:A.reason,siteCount:A.sites.length,declarationCount:A.declarations.length,unresolvedCount:A.unresolved.length,statement:A.statement}))}:{}}:{},plan:E}}catch(s){return{...o,status:"error",evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"Could not inspect this upgrade",gaps:[],toolRequests:[],error:s.message}}}function wqe(e){return e.some(t=>t.confidence==="high")?"high":e.some(t=>t.confidence==="medium")?"medium":e.some(t=>t.confidence==="low")?"low":"none"}function kqe(e){let t=new Set,n=[];for(let r of e.values())!r.install||t.has(r.install.id)||(t.add(r.install.id),n.push(r.install));return n}function DE(e,t){return`${t?`${t}::`:""}${e.target.manifestPath}#${e.name}@${e.current}`}function aoe(e){let{dep:t}=e;return{id:DE(t,e.repoRoot),name:t.name,kind:t.kind,...t.cargo?{cargo:t.cargo}:{},ecosystem:t.target.manager.ecosystem,packageManager:t.target.manager.id,manifestPath:t.target.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},current:t.current,...t.assumed?{assumed:!0}:{},range:t.range,selected:t.current,latest:t.current,versions:[],status:"pending",phase:e.phase,evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"",gaps:[],toolRequests:[]}}function _qe(e,t,n,r){return{...aoe({dep:e,phase:n,...r?.member===void 0?{}:{member:r.member},...r?.memberName?{memberName:r.memberName}:{},...r?.repoRoot?{repoRoot:r.repoRoot}:{},...r?.repoLabel?{repoLabel:r.repoLabel}:{}}),selected:t.safeLatest??t.latest,latest:t.latest,...t.safeLatest?{safeLatest:t.safeLatest}:{},...t.latestMinor?{latestMinor:t.latestMinor}:{},versions:t.versions}}async function $qe(e){let t=new Map,n=new Map,r=c=>{let l=c;for(let u=0;u<4&&l.includes("${");u+=1)l=l.replace(/\$\{([^}]+)\}/g,(d,p)=>n.get(p)??d);return l},i=c=>{for(let[u,d]of c.properties)n.has(u)||n.set(u,d);let l=[];for(let[u,d]of c.dependencyManagement){let p=d.split("|"),f=p[0]??"";f&&(p.includes("import")?l.push(`${u}:${f}`):t.has(u)||t.set(u,f))}return l},o;try{o=xM(e)}catch{return t}let s=i(o);o.parent&&s.push(o.parent);let a=new Set;for(let c=0;c<8&&s.length>0;c+=1){let l=s.shift(),[u,d,p]=l.split(":");if(!u||!d||!p)continue;let f=r(p),m=`${u}:${d}:${f}`;if(a.has(m)||f.includes("${"))continue;a.add(m);let g=await x$({groupId:u,artifactId:d},f);if(g.ok){for(let h of i(g.contract))s.push(h);g.contract.parent&&s.push(g.contract.parent)}}for(let[c,l]of t)t.set(c,r(l));return t}async function iz(e,t,n,r){let i=r_(t.manifestPath),o=await r.readFile((0,vr.join)(e,t.manifestPath));if(!i||o===null)return{dependencies:[],unresolved:[]};let s=i.parse(o,t.manifestPath),a=t.lockfilePath?await r.readFile((0,vr.join)(e,t.lockfilePath)):null,c=a!==null&&t.lockfilePath?r_(t.lockfilePath)?.parse(a,t.lockfilePath):void 0,l=n?["runtime","dev","optional","peer"]:["runtime"],u=[],d=[];for(let[p,f]of s){if(!l.includes(f.kind))continue;let m=t.manager.ecosystem,g=c?.get(p)?.version??null,h=Vi(m),v=g?h.exactVersion(g)??h.parse(g)?.raw??null:h.exactVersion(f.version??"");if(!v){let b=f.version?.trim()??"";d.push({name:p,kind:f.kind,ecosystem:m,packageManager:t.manager.id,manifestPath:t.manifestPath,current:b||"unspecified",reason:b?`no lockfile entry, and "${b}" is a range rather than one version`:m==="maven"?"no version here and none in a lockfile \u2014 it is set by a parent POM or an imported BOM, which Drift does not fetch yet":"no version declared here, and no lockfile entry to resolve one from"});continue}u.push({name:p,kind:f.kind,...f.cargo?{cargo:f.cargo}:{},current:v,range:f.version??v,target:t})}if(d.length>0&&t.manager.ecosystem==="maven"&&t.manifestPath.endsWith("pom.xml")){let p=await $qe(o);if(p.size>0){let f=Vi("maven"),m=[];for(let g of d){let h=p.get(g.name),v=h?f.exactVersion(h):null;if(!v){m.push(g);continue}u.push({name:g.name,kind:g.kind,current:v,range:h??v,target:t})}d.length=0,d.push(...m)}}return{dependencies:u,unresolved:d}}function coe(e){try{return(0,Zie.readFileSync)(e,"utf8")}catch{return null}}function Sqe(e,t){let n=Hie(e,t);if(n!==0)return n;if(e.impactCount!==t.impactCount)return t.impactCount-e.impactCount;let r=e.name.localeCompare(t.name);return r!==0?r:e.manifestPath.localeCompare(t.manifestPath)}var xqe=12;async function loe(e,t){if(!t)return e;let n=e.breakingChanges.filter(s=>s.symbols.length>0&&e.impactSites.some(a=>a.breakingChangeId===s.id));if(n.length===0)return e;let r=new Map,i=new Map,o=0;for(let s of n){if(o>=xqe)break;let a=e.changes.find(u=>u.name===s.dependency&&(u.workspace??"")===(s.workspace??""));if(!a?.to||a.ecosystem!=="npm")continue;let c=r.get(a.name);if(c===void 0&&(c=(await Wn(a.name,a.ecosystem,a.to))?.githubRepo??null,r.set(a.name,c)),!c)continue;o++;let l=await Eqe(c,a.to,s.symbols[0],t);l&&i.set(s.id,l.url)}return i.size===0?e:{...e,breakingChanges:e.breakingChanges.map(s=>i.has(s.id)?{...s,sourceUrl:i.get(s.id)}:s)}}async function Eqe(e,t,n,r){let i={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};r&&(i.Authorization=`Bearer ${r}`);let o=await Tqe(e,t,i);if(!o)return null;let s=await Iqe(e,n,i);if(!s)return null;let a=await Aqe(e,o,s,n);return a?{url:`https://github.com/${e}/blob/${o}/${s.split("/").map(encodeURIComponent).join("/")}#L${a}`,line:a}:null}async function Tqe(e,t,n){return(await xe(`https://api.github.com/repos/${e}/tags?per_page=100`,{headers:n})??[]).find(o=>!!o.name&&Od(o.name,t))?.name??null}async function Iqe(e,t,n){let r=encodeURIComponent(`${t} repo:${e} language:TypeScript`);return((await xe(`https://api.github.com/search/code?q=${r}&per_page=5`,{headers:n}))?.items??[]).map(s=>s.path).find(s=>!!s&&!s.endsWith(".d.ts")&&!s.includes("node_modules/"))??null}async function Aqe(e,t,n,r){let i=await nt(`https://raw.githubusercontent.com/${e}/${t}/${n}`);if(!i)return null;let o=new RegExp(`\\b(export\\s+)?(declare\\s+)?(default\\s+)?(function|const|class|interface|type|enum)\\s+${Rqe(r)}\\b`),a=i.split(` +`).findIndex(c=>o.test(c));return a===-1?null:a+1}function Rqe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Pqe="Drift",uoe="https://github.com/trydrift/drift",sz=9;function hoe(e,t){let n=new Map;for(let r of e)n.has(r.ruleId)||n.set(r.ruleId,{id:r.ruleId,name:r.ruleName,...r.helpUri?{helpUri:r.helpUri}:{}});return{$schema:"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",version:"2.1.0",runs:[{tool:{driver:{name:Pqe,informationUri:uoe,rules:[...n.values()].map(r=>({id:r.id,name:r.name,shortDescription:{text:r.name},fullDescription:{text:"A Drift finding: what changed, where it's used, and the fix \u2014 see the alert body."},helpUri:r.helpUri??uoe,defaultConfiguration:{level:"warning"},properties:{tags:["dependencies","drift"]}}))}},...t?{automationDetails:{id:t}}:{},results:e.map(r=>({ruleId:r.ruleId,level:r.level,message:{text:Cqe(r.message),markdown:r.message},locations:[poe(r.primaryLocation,r.snippetOk)],...r.relatedLocations.length>0?{relatedLocations:r.relatedLocations.map((i,o)=>({id:o+1,...poe(i)}))}:{},partialFingerprints:{primaryLocationLineHash:Dqe(r)}}))}]}}function Cqe(e){return e.replace(/\[([^\]]*)\]\(([^)]+)\)/g,"$1 ($2)").replace(/\*\*(.*?)\*\*/g,"$1").replace(/`([^`]*)`/g,"$1").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function doe(e){return e.replace(/&/g,"&").replace(//g,">")}function Nqe(e,t,n){let r=n?`${n}/${e}#L${t}`:`${e}#L${t}`;return`[\`${e}:${t}\`](${r})`}function poe(e,t=!1){return{physicalLocation:{artifactLocation:{uri:e.file},region:{startLine:Math.max(1,e.line),...t&&e.excerpt?{snippet:{text:e.excerpt}}:{}}}}}function Dqe(e){let t=`${e.ruleId}|${e.primaryLocation.file}|${(e.primaryLocation.excerpt??"").trim()}`;return(0,cz.createHash)("sha256").update(t).digest("hex").slice(0,40)}async function lz(e,t={}){let n=t.includeInformational??!1,r=t.granularity??"package",i=t.repoBlobUrl,o=[];e=await loe(e,t.githubToken);for(let s of e.changes){let a=e.breakingChanges.filter(g=>g.dependency===s.name&&(g.workspace??"")===(s.workspace??"")),c=e.rationale?.find(g=>g.dependency===s.name),l=[],u=0,d=[...a].sort((g,h)=>ME(h.confidence)-ME(g.confidence));for(let g of d){let h=e.impactSites.filter(v=>v.breakingChangeId===g.id);if(h.length===0){u++;continue}l.push({breaking:g,block:Uqe(g,h,e.evidence)})}let p=[];if(Mqe(c)&&p.push(Bqe(c)),e.verification?.status==="failed"&&p.push(Vqe(e.verification)),l.length===0&&p.length===0)if(u>0){if(!n)continue;p.push(Wqe(s,u))}else{if(!n||!c)continue;p.push(qqe(s,c))}let f=e.commits.find(g=>a.some(h=>g.breakingChangeIds.includes(h.id))),m=t.fixOf?.(s)??Zqe(f,e);if(r==="package"){let g=[...l.map(h=>h.block),...p];o.push(OE({change:s,blocks:g,upstreamOnlyCount:u,fix:m,repoBlobUrl:i,ruleName:g.length===1&&g[0].ruleNameSuffix?`${s.name}: ${g[0].ruleNameSuffix}`:void 0}));continue}for(let{breaking:g,block:h}of l)if(r==="affectedSite"){let v=[h.primaryCandidate,...h.relatedCandidates].filter(b=>b!==void 0);for(let b of v)o.push(OE({change:s,blocks:[{...h,primaryCandidate:b,relatedCandidates:[]}],upstreamOnlyCount:0,fix:m,ruleIdSuffix:`${g.id}/${Oqe(b)}`,ruleName:foe(s,g),snippetOk:!0,repoBlobUrl:i}))}else o.push(OE({change:s,blocks:[h],upstreamOnlyCount:0,fix:m,ruleIdSuffix:g.id,ruleName:foe(s,g),snippetOk:!0,repoBlobUrl:i}));for(let g of p)o.push(OE({change:s,blocks:[g],upstreamOnlyCount:0,fix:m,ruleIdSuffix:"other",ruleName:g.ruleNameSuffix?`${s.name}: ${g.ruleNameSuffix}`:void 0,repoBlobUrl:i}))}return o}function Oqe(e){return(0,cz.createHash)("sha256").update(`${e.file}|${(e.excerpt??"").trim()}`).digest("hex").slice(0,10)}function Mqe(e){if(!e)return!1;let t=e.security;return t.checked&&(t.resolved.length>0||t.introduced.length>0||t.current.length>0)}async function yoe(e,t={}){let n=[];for(let r of e){if(!r.plan)continue;let i=()=>{if(r.plan.commits.length>0)return;let o=roe(r);if(o)return{description:r.verification?.status==="failed"?"The project's own checks failed with this upgrade installed \u2014 measured, not predicted. Do not treat this as safe to upgrade without investigating.":r.breakingCount>0?"The upstream API changed, but no code in this repository was found to use the affected parts. Review before upgrading.":"Safe to upgrade \u2014 no breaking changes found.",command:o}};n.push(...await lz(r.plan,{...t,fixOf:i}))}return n}var Lqe={"removed-export":"Removed export used in this repository","renamed-export":"Renamed export used in this repository","moved-export":"Export moved to a different module","signature-change":"Call signature changed","type-change":"Type changed in a breaking way","behaviour-change":"Runtime behaviour changed","removed-endpoint":"API endpoint removed","changed-endpoint":"API endpoint changed","required-field-added":"New required field","default-change":"Default value changed","config-change":"Configuration shape changed","module-system-change":"Module loading compatibility changed","runtime-requirement":"Runtime requirement changed",unknown:"Unclassified breaking change"};function boe(e){return Lqe[e]??"Breaking change"}function foe(e,t){let n=`${e.name}: ${boe(t.kind)}`;if(t.symbols.length===0)return n;let r=t.symbols.slice(0,2).join(", "),i=t.symbols.length>2?", \u2026":"";return`${n} (${r}${i})`}var ub={runtime:"dependency",dev:"devDependency",peer:"peerDependency",optional:"optionalDependency",transitive:"transitive dependency"};function Fqe(e){return ub[e]??e}var moe={error:2,warning:1,note:0};function jqe(e){return e.reduce((t,n)=>moe[n]>moe[t]?n:t,"note")}function Uqe(e,t,n){let r=[...t].sort((d,p)=>ME(p.confidence)-ME(d.confidence)||d.file.localeCompare(p.file)||d.line-p.line),i=r[0],o=r.slice(1,1+sz),s=i.confidence,a=new Set(t.map(d=>d.file)),c=Hqe(e,n),l=e.sourceUrl??(c?Kqe(c,e):void 0),u=[`**${boe(e.kind)}:** ${zqe(e.summary,l)}`,"",`Upstream confidence: ${e.confidence}. Local confidence: ${s}`+(t.length>1?` (best of ${t.length} matches across ${a.size} file(s)).`:".")];return e.before&&e.after&&e.before!==e.after&&u.push("",`- \`${doe(az(e.before,300))}\``,`+ \`${doe(az(e.after,300))}\``),l&&u.push("",`${e.sourceUrl?"GitHub source":"Declaration source"}: ${l}`),{level:Gqe(e.confidence,s),lines:u,primaryCandidate:{file:i.file,line:i.line,excerpt:i.excerpt},relatedCandidates:o.map(d=>({file:d.file,line:d.line,excerpt:d.excerpt})),helpUri:l}}function az(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}function zqe(e,t){return t?e.replace(/`([^`]+)`/g,(n,r)=>`[\`${r}\`](${t})`):e}function Gqe(e,t){return e==="high"&&t==="high"?"error":e==="high"||t==="high"||e==="medium"&&t==="medium"?"warning":"note"}function ME(e){return e==="high"?2:e==="medium"?1:0}function Bqe(e){let t=e.security,n,r,i=[];if(t.current.length>0){n=`Currently affected by ${t.current.length} known ${nm(t.current.length,"advisory","advisories")}`;let s=goe(t.current);r=s==="critical"||s==="high"?"error":"warning",i.push(["**Currently affected:**",...t.current.map(a=>`- ${oz(a)}`)].join(` +`))}else if(t.introduced.length>0){n=`Upgrading would introduce ${t.introduced.length} new known ${nm(t.introduced.length,"advisory","advisories")}`;let s=goe(t.introduced);r=s==="critical"||s==="high"?"error":"warning"}else n=`Resolves ${t.resolved.length} known ${nm(t.resolved.length,"advisory","advisories")}`,r="note";t.introduced.length>0&&i.push(["**Would introduce:**",...t.introduced.map(s=>`- ${oz(s)}`)].join(` +`)),t.resolved.length>0&&i.push(["**Resolves:**",...t.resolved.map(s=>`- ${oz(s)}`)].join(` +`));let o=[`**${n}**`];for(let s of i)o.push("",s);o.push("",`Drift's assessment: **${jl[e.assessment.recommendation]}**.`);for(let s of e.assessment.reasons)o.push(`- ${s}`);return{level:r,lines:o,relatedCandidates:[],helpUri:t.current[0]?.url??t.introduced[0]?.url??t.resolved[0]?.url,ruleNameSuffix:n}}function Vqe(e){let n=e.checks.filter(o=>o.status==="failed").map(o=>`\`${o.label}\``).join(", "),i=[`**The project's own checks fail with this upgrade installed${e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:""}** \u2014 measured, not predicted. Drift's static analysis found no specific call site to point at, but the upgrade should not be treated as safe.`];return n&&i.push("",`Failing: ${n}`),e.diagnostics&&i.push("",az(e.diagnostics,4e3)),{level:"error",lines:i,relatedCandidates:[],ruleNameSuffix:"Project's own checks fail with this upgrade"}}function qqe(e,t){return{level:"note",lines:[`**Update available** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}), with no breaking changes or advisories found.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 safe to upgrade"}}function Wqe(e,t){return{level:"warning",lines:[`**Breaking change detected upstream** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}). ${t} upstream breaking ${nm(t,"change was","changes were")} found, and no code in this repository was found to use the affected parts \u2014 but a completed search is not proof the change cannot reach this repository. Review before upgrading.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 review before upgrading"}}function OE(e){let{change:t,blocks:n,upstreamOnlyCount:r,fix:i,ruleIdSuffix:o,ruleName:s,snippetOk:a,repoBlobUrl:c}=e,l=p_(t),u=t.to?`${t.from??"none"} \u2192 ${t.to}`:"removed",d=n.some(k=>k.primaryCandidate),p=Fqe(t.kind),f=[l?`**${t.name}** (${t.ecosystem} ${p}) ${u} \u2014 ${l}`:`**${t.name}** (${t.ecosystem} ${p}) ${u}`];r>0&&f.push("",`${r} additional upstream breaking ${nm(r,"change does","changes do")} not reach code in this repository and ${nm(r,"is","are")} omitted here.`);let m=a?n.find(k=>k.primaryCandidate)?.primaryCandidate??{file:t.manifestPath,line:1}:{file:t.manifestPath,line:1},g=new Set([`${m.file}:${m.line}`]),h=[];for(let k of n){let $=k.primaryCandidate?[k.primaryCandidate,...k.relatedCandidates]:k.relatedCandidates;for(let S of $){let E=`${S.file}:${S.line}`;if(!g.has(E)&&(g.add(E),h.push(S),h.length>=sz))break}if(h.length>=sz)break}let v=new Map(h.map((k,$)=>[`${k.file}:${k.line}`,$+1])),b=k=>{let $=v.get(`${k.file}:${k.line}`);return $!==void 0?`[\`${k.file}:${k.line}\`](${$})`:Nqe(k.file,k.line,c)},w=[f.join(` `),...n.map(k=>{if(!k.primaryCandidate)return k.lines.join(` -`);let _=["**Seen at:**",`- ${y(k.primaryCandidate)}`,...k.relatedCandidates.map(S=>`- ${y(S)}`)];return[...k.lines,"","",..._].join(` -`)}),QGe(r,d)].join(` +`);let $=["**Seen at:**",`- ${b(k.primaryCandidate)}`,...k.relatedCandidates.map(S=>`- ${b(S)}`)];return[...k.lines,"","",...$].join(` +`)}),Yqe(i,d)].join(` --- -`);return{ruleId:o?`drift/${t.ecosystem}/${t.name}/${o}`:`drift/${t.ecosystem}/${t.name}`,ruleName:s??`${t.name}: dependency finding`,dependency:t.name,ecosystem:t.ecosystem,dependencyKind:t.kind,from:t.from,to:t.to,manifestPath:t.manifestPath,workspace:t.workspace,workspaceLabel:l,level:jGe(n.map(k=>k.level)),message:w,primaryLocation:m,relatedLocations:h,snippetOk:a,fix:r,helpUri:n.find(k=>k.helpUri)?.helpUri}}function Uf(e,t,n){return e===1?t:n}function cre(e){return e.reduce((t,n)=>I1(n.severity,t)<0?n.severity:t,"unknown")}function fU(e){let t=e.fixedIn?`, fixed in ${e.fixedIn}`:"";return`[${e.id}](${e.url}) (${e.severity}${t}): ${e.summary}`}function KGe(e,t){for(let n of e.citations){let i=t.find(r=>r.id===n)?.url;if(i)return i}}function JGe(e,t){let n=ZGe(t);return n?`${e}#:~:text=${encodeURIComponent(n)}`:e}function ZGe(e){let n=(e.after??e.before)?.split(` -`)[0]?.trim()||e.symbols[0];if(n)return n.length>80?n.slice(0,80):n}function YGe(e,t){if(!e)return;if((e.codemod?.length??0)>0)return{description:`Deterministic fix available: "${e.message}". Drift can commit this itself once approved.`};if(e.fixPlan){let{plan:i,covered:r,residual:o}=e.fixPlan,s=r+o;return{description:`Validated fix plan \`${i.id}\` covers ${r}/${s} call site(s): ${i.migration} `+(o>0?`The remaining ${o} need an agent. `:"")+"Run `drift fix --plan` to read the full plan before applying it."}}return{description:t.risk==="none"?"No deterministic fix; comment `/drift apply` on Drift's approval issue for this plan to dispatch GitHub Copilot.":`No deterministic fix, and this plan carries risk: \`${t.risk}\`. Review the plan Drift filed, then comment \`/drift apply\` to dispatch a fix.`}}function QGe(e,t){return e?.url?`**Fix:** ${e.description} \u2192 ${e.url}`:e?.command?`**Fix:** ${e.description} Run: \`${e.command}\``:e?`**Fix:** ${e.description}`:t?"**Fix:** Drift did not produce a plan for this finding \u2014 see the workflow run for why.":"**Fix:** No action required; this is informational."}function bU(e){switch(e.kind){case"rename-identifier":return`Rename the identifier \`${e.from}\` to \`${e.to}\` at each call site Drift localized (bare uses only \u2014 never \`something.${e.from}\`, and never another \`${e.from}\` on the same line that was not localized).`;case"rename-member":return`Rename the member \`.${e.from}\` to \`.${e.to}\` at each call site Drift localized (member access only, and only on the receiver that was localized \u2014 a different object's \`.${e.from}\` on the same line is left alone).`;case"replace-import-path":return`Change the import path \`${e.from}\` to \`${e.to}\`, on localized lines that actually import, and only where that specifier appears once.`;case"insert-argument":return`Insert \`${e.text}\` as argument ${e.index+1} of each localized \`${e.callee}(\u2026)\` call that closes on its own line.`;case"wrap-call":return`Prefix each localized \`${e.callee}(\u2026)\` call with \`${e.wrapper}\`, where it is not already prefixed.`}}function XGe(e){return e==="proven"?"Every operation swaps one token or string for another of the same kind, at one anchored occurrence, so applying this cannot change whether the file parses and cannot touch anything Drift did not localize.":"At least one operation changes the structure of an expression. Drift knows exactly what it will write, but cannot promise the result compiles \u2014 so this plan is only applied automatically once the project\u2019s own checks have actually passed."}function pre(e){let{provenance:t}=e;switch(t.author){case"model":return`Authored by \`${t.model??"a model"}\` from the cited evidence, then validated by Drift.`;case"builtin":return"Derived by Drift\u2019s own codemod engine from a computed API diff. No model was involved.";case"recipe":return t.recipe?`Inferred from what \`${t.recipe.name}@${t.recipe.version}\` (${t.recipe.publisher}) did in a throwaway worktree, then re-derived and validated by Drift. The recipe\u2019s own output was not used \u2014 see ${t.recipe.source}.`:"Inferred from a community recipe, then re-derived and validated by Drift.";case"cache":return`Restored from a previously validated plan for this same migration (\`${t.sourceId??e.id}\`), then re-validated against this repository\u2019s own call sites.`;case"user":return"Supplied by a human. Validated by Drift exactly as an authored plan would be."}}function By(e,t={}){let{plan:n}=e,i=t.headingLevel??3,r=s=>"#".repeat(Math.min(6,i+s)),o=[];if(o.push(`${r(0)} Fix plan: ${n.migration}`),o.push(""),o.push(`\`${n.id}\` \xB7 **${n.dependency}** ${n.fromVersion??"?"} \u2192 ${n.toVersion??"?"} \xB7 ${n.changeKind}`),o.push(""),e.verdict==="rejected"){o.push("**Drift rejected this plan.** It was not applied, and the finding falls through to the tier below."),o.push("");for(let s of e.rejections)o.push(`- ${s}`);return o.push(""),o.push(pre(n)),o.join(` -`)}o.push(`${r(1)} What it does`),o.push("");for(let s of n.ops)o.push(`1. ${bU(s)}`);return o.push(""),n.rationale&&(o.push(`${r(1)} Why`),o.push(""),o.push(n.rationale),o.push("")),o.push(`${r(1)} What Drift checked`),o.push(""),o.push("- **Grounding.** Every operation acts on a symbol this finding names."),o.push("- **Exact occurrences.** Every edit is anchored to one call site Drift localized \u2014 file, line, column, and the exact text matched there. An operation cannot reach a same-named identifier elsewhere on the line, let alone elsewhere in the file."),o.push(`- **Attestation.** Every name introduced (${n.ops.flatMap(tVe).map(s=>`\`${s}\``).join(", ")||"none"}) appears in the cited evidence${n.citations.length?` (${n.citations.map(s=>`\`${s}\``).join(", ")})`:""}.`),o.push("- **Convergence.** Applying the plan twice was tested, and gives the same result as applying it once."),o.push("- **Line preservation.** No operation splits or joins a line."),o.push(`- **Assurance.** ${XGe(e.assurance)}`),o.push(""),o.push(`${r(1)} Coverage`),o.push(""),o.push(e.residual===0?`All ${e.covered} call site${e.covered===1?"":"s"} are resolved deterministically. No agent is asked about this finding.`:`${e.covered} of ${e.covered+e.residual} call sites are resolved deterministically. The remaining ${e.residual} ${e.residual===1?"is":"are"} listed below and ${e.residual===1?"is":"are"} handed to an agent individually \u2014 the plan is not abandoned because of them.`),o.push(""),t.sites!==!1&&e.sites.length>0&&(o.push(eVe(e.sites)),o.push("")),o.push(pre(n)),o.join(` -`)}function mre(e){if(e.verdict==="rejected")return`Fix plan rejected: ${e.rejections[0]??"it did not pass validation"}`;let t=e.plan.ops.length,n=e.covered+e.residual;return`${t} deterministic rule${t===1?"":"s"} covering ${e.covered}/${n} call site${n===1?"":"s"} (${e.assurance})`}function eVe(e){let t=["| Site | Change |","| --- | --- |"];for(let n of e){let i=`\`${n.file}:${n.line}\``;n.status==="covered"?t.push(`| ${i} | \`${fre(n.before)}\` \u2192 \`${fre(n.after??"")}\` |`):t.push(`| ${i} | _Not covered_ \u2014 ${n.reason??"no rule matched."} |`)}return t.join(` -`)}function tVe(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];default:return[]}}function fre(e){let t=e.trim();return t.length<=90?t:`${t.slice(0,87)}\u2026`}var nVe={high:"\u{1F7E2} high",medium:"\u{1F7E1} medium",low:"\u{1F7E0} low"},rVe={none:"\u26AA none",low:"\u{1F7E2} low",medium:"\u{1F7E1} medium",high:"\u{1F534} high"};function jf(e,t){let n=[];return n.push(iVe(e)),n.push(hre(e)),e.blockers.length>0&&n.push(yre(e)),e.warnings.length>0&&n.push(bre(e)),n.push(vre(e)),n.push(iU(e)),n.push(wre(e)),n.push(uVe(e)),n.push(X1(e.gaps)),n.push(eU(e)),n.push(kre(e)),n.push(dVe(e,t)),n.push($re(e)),n.filter(Boolean).join(` - -`)}function gre(e,t){let n=[];return n.push("## Drift found breaking changes that need your call"),n.push(e.blockers.length>0?"Drift analysed this dependency change and prepared a fix, then stopped. The reasons are listed below.":"Drift analysed this dependency change and prepared a fix. This repository runs in `approve` mode, so nothing has been changed yet."),n.push(hre(e)),e.blockers.length>0&&n.push(yre(e)),e.warnings.length>0&&n.push(bre(e)),n.push(vre(e)),n.push(iU(e)),n.push(wre(e)),n.push(X1(e.gaps)),n.push(eU(e)),n.push(kre(e)),n.push(["## To proceed","","Comment `/drift apply` on this issue and Drift will create the branch and","hand the plan to GitHub Copilot, one commit at a time. You will get a pull","request to review \u2014 nothing merges automatically.","","Comment `/drift dismiss` to close this out.","","To stop being asked for changes like this, adjust `.github/drift.yml` \u2014 see the [configuration reference](https://github.com/trydrift/drift/blob/main/docs/configuration.md)."].join(` -`)),n.push($re(e)),n.filter(Boolean).join(` - -`)}function iVe(e){let t=new Set(e.changes.map(i=>i.workspace).filter(i=>i!==void 0));return["## Drift: dependency compatibility fix","",`${e.changes.map(i=>{let r=t.size>1?qk(i):null,o=i.kind==="runtime"?null:Vy[i.kind],s=[i.ecosystem,o].filter(Boolean).join(", ");return`\`${i.name}\` _(${s})_ ${i.from??"\u2014"} \u2192 **${i.to??"\u2014"}**${r?` _(in ${r})_`:""}`}).join(", ")}`,"",e.commits.length>0?`Drift found **${e.breakingChanges.length} breaking change(s)** affecting **${new Set(e.impactSites.map(i=>i.file)).size} file(s)** in this repository, and planned **${e.commits.length} commit(s)** to fix them.`:Lf(e)].join(` -`)}function hre(e){let t=new Set(e.impactSites.map(n=>n.file)).size;return["| | |","|---|---|",`| **Risk** | ${rVe[e.risk]??e.risk} |`,`| **Breaking changes** | ${e.upstreamBreakingCount??e.breakingChanges.length} |`,`| **Impact sites** | ${e.impactSites.length} across ${t} file(s) |`,`| **Planned commits** | ${e.commits.length} |`,`| **Evidence sources** | ${oVe(e.evidence)} |`,`| **Base branch** | \`${e.baseBranch}\` |`].join(` -`)}function oVe(e){let t=new Map;for(let n of e)t.set(n.source,(t.get(n.source)??0)+1);return t.size===0?"none":[...t.entries()].map(([n,i])=>`${n} (${i})`).join(", ")}function yre(e){return["## \u26D4 Why Drift stopped","","Drift did not dispatch this automatically. Each reason below is a guardrail","from `.github/drift.yml`:","",...e.blockers.map(t=>`- ${t}`)].join(` -`)}function bre(e){return["## \u26A0\uFE0F Worth checking","",...e.warnings.map(t=>`- ${t}`)].join(` -`)}function vre(e){if(e.breakingChanges.length===0)return["## Breaking changes","","None identified from the available evidence."].join(` -`);let t=new Map(e.evidence.map(i=>[i.id,i])),n=["## Breaking changes",""];for(let i of e.breakingChanges){let r=e.impactSites.filter(a=>a.breakingChangeId===i.id).length,o=Y1(i);n.push(`### ${Rx(i).text} \xB7 \`${i.dependency}\` \xB7 ${i.kind}`),n.push(""),n.push(i.summary),n.push(""),i.before&&i.after&&i.before!==i.after&&n.push("```diff",`- ${vU(i.before,300)}`,`+ ${vU(i.after,300)}`,"```",""),n.push(`**Verdict:** ${Ine(o,i.assessment)}.`),n.push(""),n.push(Nne(i)),n.push(""),i.assessment&&(n.push(Rne(i.assessment)),n.push(""),n.push(Cne(i.assessment)),n.push("")),i.symbols.length>0&&(n.push(`**Symbols:** ${i.symbols.map(a=>`\`${a}\``).join(", ")}`),n.push("")),n.push(r>0?`**Found in this repo:** ${r} location(s)`:i.assessment?.localImpact.penalties.some(a=>a.code==="localization-unavailable")?"**Found in this repo:** not searched \u2014 no checkout was available. This is not evidence the change is unused.":"**Found in this repo:** no usages found in the files that import this dependency \u2014 no fix planned"),n.push(""),n.push(...sVe(i.remediation)),n.push("");let s=i.citations.map(a=>t.get(a)).filter(a=>a!==void 0);if(s.length>0){n.push("**Evidence:**");for(let a of s)n.push(`- ${_re(a)}`);n.push("")}}return n.join(` -`).trim()}function sVe(e){let t=aVe(e);return t.length===1?[`**Fix:** ${t[0]}`]:["**Fix:**","",...t]}function aVe(e){let t=[],n=[],i=()=>{let r=n.join(" ").trim();n.length=0,r&&t.push(r)};for(let r of e.split(/\r?\n/)){let o=r.trim(),s=/^(before|after):(.*)$/i.exec(o);if(s){i(),t.push(`**${lVe(s[1])}:**`,"",cVe(s[2].trimStart()),"");continue}if(!o){i();continue}n.push(o)}return i(),t.filter((r,o,s)=>r||s[o-1]&&s[o+1])}function cVe(e){let t=e.match(/`+/g)?.reduce((i,r)=>Math.max(i,r.length),2)??2,n="`".repeat(t+1);return[n,e,n].join(` -`)}function lVe(e){return e&&`${e[0].toUpperCase()}${e.slice(1).toLowerCase()}`}function wre(e){if(e.commits.length===0)return["## Commit plan","",`No commits planned. ${Lf(e)}`].join(` -`);let t=["## Commit plan","","Each commit addresses one concern. The graph below records only necessary","dependencies; commits in the same execution layer have disjoint file scope and","may run in parallel.",""];for(let n of e.commits){if(t.push(`**${n.order}. \`${n.message}\`**`),t.push(""),t.push(`Unit: \`${n.id}\``),t.push(`Layer: ${n.executionLayer}`),n.dependsOn.length>0&&(t.push(`Depends on: ${n.dependsOn.map(i=>`\`${i}\``).join(", ")}`),t.push(`Why: ${n.dependencyReasons.map(i=>`${i.reason}${i.evidence.length?` (${i.evidence.slice(0,3).join("; ")})`:""}`).join("; ")}`)),t.push(`Files: ${n.allowedFiles.map(i=>`\`${i}\``).join(", ")}`),(n.allowedSymbols??[]).length>0&&t.push(`Symbols: ${n.allowedSymbols.map(i=>`\`${i}\``).join(", ")}`),n.expectedChecks.length>0&&t.push(`Expected checks: ${n.expectedChecks.map(i=>i.kind).join(", ")}`),n.codemod?.length){let i=n.codemod.map(r=>`\`${r.from}\` \u2192 \`${r.to}\``).join(", ");t.push(`**Resolved deterministically** by Drift's codemod engine (${i}) \u2014 no model call was needed for this commit.`)}else if(n.fixPlan){let{plan:i,covered:r,residual:o,assurance:s}=n.fixPlan,a=r+o;t.push(`**Deterministic fix plan** \`${i.id}\` \u2014 ${i.migration} ${i.ops.length} rule${i.ops.length===1?"":"s"}, ${r}/${a} call site${a===1?"":"s"} covered, assurance \`${s}\`.`);for(let c of i.ops)t.push(` - ${bU(c)}`);if(o>0&&t.push(` - ${o} call site${o===1?"":"s"} not covered by the plan; an agent handles ${o===1?"it":"them"} individually.`),n.recipe?.length){let c=[...new Map(n.recipe.map(l=>[`${l.provider}:${l.name}@${l.version}`,l])).values()];t.push(` - Consulted: ${c.map(l=>`[\`${l.name}@${l.version}\`](${l.source}) from ${l.publisher}`).join(", ")}`)}}else if(n.recipe?.length){let i=[...new Map(n.recipe.map(o=>[`${o.provider}:${o.name}@${o.version}`,o])).values()],r=i.map(o=>`[\`${o.name}@${o.version}\`](${o.source}) from ${o.publisher} (${o.provider})`).join(", ");t.push(`**Community recipe consulted**: ${r} \u2014 ${i[0].migration} Drift could not re-derive its edits as deterministic operations, so this commit goes to an agent.`)}t.push("")}return t.join(` -`).trim()}function uVe(e){if(e.impactSites.length===0)return"";let t=new Map;for(let i of e.impactSites){let r=t.get(i.file);r?r.push(i):t.set(i.file,[i])}let n=["
",`All ${e.impactSites.length} impact site(s)`,""];for(let[i,r]of[...t.entries()].sort()){let o=r.every(s=>s.siteKind==="manifest");n.push(`**\`${i}\`**${o?" \u2014 the declaration, not a call site":""}`),n.push("");for(let s of r.slice(0,25)){let a=s.enclosingSymbol?` (in \`${s.enclosingSymbol}\`)`:"";n.push(`- L${s.line}${a} \u2014 \`${s.excerpt}\` \xB7 ${nVe[s.confidence]}`)}r.length>25&&n.push(`- \u2026and ${r.length-25} more in this file`),n.push("")}return n.push("
"),n.join(` -`)}function kre(e){if(e.evidence.length===0)return"";let t=["
",`Evidence Drift used (${e.evidence.length} source(s))`,"","Every finding above traces back to one of these. Open them to check the work.",""];for(let n of e.evidence)t.push(`#### ${_re(n)}`),t.push(""),t.push(`\`${n.source}\` \xB7 ${Ane(n.weight)} (weight ${n.weight.toFixed(2)})`),t.push(""),t.push("```"),t.push(vU(n.content,2e3)),t.push("```"),t.push("");return t.push("
"),t.join(` -`)}function dVe(e,t){let n=["Every edit corresponds to a breaking change listed above \u2014 no unrelated refactoring crept in","The fixes match what the cited evidence actually says","CI passes on this branch"];return e.impactSites.some(i=>i.file.includes("test"))&&n.push("Test changes update assertions to the new API rather than weakening them"),e.breakingChanges.some(i=>i.kind==="behaviour-change"||i.kind==="default-change")&&n.push("Behaviour changes were handled deliberately \u2014 these compile either way, so the type checker will not catch a wrong choice"),e.breakingChanges.some(i=>i.confidence==="low")&&n.push("Low-confidence findings were verified against the upstream source before accepting"),["## Review checklist","",...n.map(i=>`- [ ] ${i}`)].join(` -`)}function $re(e){return["---","",Dne({schemaVersion:Cf,planId:e.id,planDigest:lx(e),headSha:e.headSha,baseBranch:e.baseBranch}),"",`Generated by [Drift](https://github.com/trydrift/drift) \xB7 plan \`${e.id}\` \xB7 ${e.createdAt}
`,"Drift reads dependency changes, proves which ones break your code, and drives","GitHub Copilot to fix them. It never merges anything.
"].join(` -`)}function _re(e){let t=e.title;return e.url?`[${t}](${e.url})`:e.locator?`${t} (\`${e.locator}\`)`:t}function vU(e,t){return e.length<=t?e:`${e.slice(0,t)} -\u2026(truncated)`}function jx(e){if(e.commits.length===0)return`${Lf(e)} (${e.changes.length} dependency change(s) checked)`;let t=new Set(e.impactSites.map(n=>n.file)).size;return`${e.breakingChanges.length} breaking change(s), ${t} file(s) affected, ${e.commits.length} commit(s) planned (risk: ${e.risk})`}var zf=require("node:fs/promises"),Wy=require("node:path");function Sre(e){return e.codemod?"builtin":e.fixPlan?"fix-plan":"ai"}function wU(e,t){let n=new Set(t.map(r=>r.id)),i=new Set(t.flatMap(r=>r.breakingChangeIds));return{...e,commits:e.commits.filter(r=>n.has(r.id)),breakingChanges:e.breakingChanges.filter(r=>i.has(r.id))}}function zx(e,t){let n=new Map(t);for(let s of e.codemod??[])for(let a of s.files){let c=n.get(a);c!==void 0&&n.set(a,bee(c,s,a))}let i=[];for(let[s,a]of t){let c=n.get(s);c!==void 0&&c!==a&&i.push({path:s,content:c})}if(i.length===0)return{status:"no-changes",edits:[],message:"The deterministic fix produced no changes here \u2014 likely already applied by an earlier commit."};let r=new Set(i.map(s=>s.path)).size,o=e.codemod?.length??0;return{status:"applied",edits:i,message:`Applied ${o} deterministic rename${o===1?"":"s"} across ${r} file${r===1?"":"s"} \u2014 no agent call was made.`}}function Gx(e,t){let n=e.fixPlan;if(!n)return{status:"no-changes",edits:[],message:"This commit has no fix plan."};let i=new Map(t);for(let a of n.files){let c=i.get(a);c!==void 0&&i.set(a,Aee(c,n.plan.ops,n.anchors,a))}let r=[];for(let[a,c]of t){let l=i.get(a);l!==void 0&&l!==c&&r.push({path:a,content:l})}if(r.length===0)return{status:"no-changes",edits:[],message:"The fix plan produced no changes here \u2014 likely already applied by an earlier commit."};let o=new Set(r.map(a=>a.path)).size,s=mre({plan:n.plan,verdict:n.residual===0?"accepted":"partial",assurance:n.assurance,sites:[],covered:n.covered,residual:n.residual,rejections:[],anchors:n.anchors});return{status:"applied",edits:r,message:`Applied fix plan \`${n.plan.id}\` \u2014 ${s} \u2014 across ${o} file${o===1?"":"s"}.`+(n.residual>0?` ${n.residual} call site${n.residual===1?"":"s"} remain${n.residual===1?"s":""} for an agent.`:" No agent call was made.")}}function Vx(e,t,n={}){let{fixPlans:i}=t.remediation;if(e.verdict==="rejected")return{action:"skip",reason:e.rejections[0]??"The plan did not pass validation."};let r=e.covered+e.residual,o=r===0?0:e.covered/r;return ok.level)),message:w,primaryLocation:m,relatedLocations:h,snippetOk:a,fix:i,helpUri:n.find(k=>k.helpUri)?.helpUri}}function nm(e,t,n){return e===1?t:n}function goe(e){return e.reduce((t,n)=>wU(n.severity,t)<0?n.severity:t,"unknown")}function oz(e){let t=e.fixedIn?`, fixed in ${e.fixedIn}`:"";return`[${e.id}](${e.url}) (${e.severity}${t}): ${e.summary}`}function Hqe(e,t){for(let n of e.citations){let r=t.find(i=>i.id===n)?.url;if(r)return r}}function Kqe(e,t){let n=Jqe(t);return n?`${e}#:~:text=${encodeURIComponent(n)}`:e}function Jqe(e){let n=(e.after??e.before)?.split(` +`)[0]?.trim()||e.symbols[0];if(n)return n.length>80?n.slice(0,80):n}function Zqe(e,t){if(!e)return;if((e.codemod?.length??0)>0)return{description:`Deterministic fix available: "${e.message}". Drift can commit this itself once approved.`};if(e.fixPlan){let{plan:r,covered:i,residual:o}=e.fixPlan,s=i+o;return{description:`Validated fix plan \`${r.id}\` covers ${i}/${s} call site(s): ${r.migration} `+(o>0?`The remaining ${o} need an agent. `:"")+"Run `drift fix --plan` to read the full plan before applying it."}}return{description:t.risk==="none"?"No deterministic fix; comment `/drift apply` on Drift's approval issue for this plan to dispatch GitHub Copilot.":`No deterministic fix, and this plan carries risk: \`${t.risk}\`. Review the plan Drift filed, then comment \`/drift apply\` to dispatch a fix.`}}function Yqe(e,t){return e?.url?`**Fix:** ${e.description} \u2192 ${e.url}`:e?.command?`**Fix:** ${e.description} Run: \`${e.command}\``:e?`**Fix:** ${e.description}`:t?"**Fix:** Drift did not produce a plan for this finding \u2014 see the workflow run for why.":"**Fix:** No action required; this is informational."}function uz(e){switch(e.kind){case"rename-identifier":return`Rename the identifier \`${e.from}\` to \`${e.to}\` at each call site Drift localized (bare uses only \u2014 never \`something.${e.from}\`, and never another \`${e.from}\` on the same line that was not localized).`;case"rename-member":return`Rename the member \`.${e.from}\` to \`.${e.to}\` at each call site Drift localized (member access only, and only on the receiver that was localized \u2014 a different object's \`.${e.from}\` on the same line is left alone).`;case"replace-import-path":return`Change the import path \`${e.from}\` to \`${e.to}\`, on localized lines that actually import, and only where that specifier appears once.`;case"insert-argument":return`Insert \`${e.text}\` as argument ${e.index+1} of each localized \`${e.callee}(\u2026)\` call that closes on its own line.`;case"wrap-call":return`Prefix each localized \`${e.callee}(\u2026)\` call with \`${e.wrapper}\`, where it is not already prefixed.`}}function Qqe(e){return e==="proven"?"Every operation swaps one token or string for another of the same kind, at one anchored occurrence, so applying this cannot change whether the file parses and cannot touch anything Drift did not localize.":"At least one operation changes the structure of an expression. Drift knows exactly what it will write, but cannot promise the result compiles \u2014 so this plan is only applied automatically once the project\u2019s own checks have actually passed."}function voe(e){let{provenance:t}=e;switch(t.author){case"model":return`Authored by \`${t.model??"a model"}\` from the cited evidence, then validated by Drift.`;case"builtin":return"Derived by Drift\u2019s own codemod engine from a computed API diff. No model was involved.";case"recipe":return t.recipe?`Inferred from what \`${t.recipe.name}@${t.recipe.version}\` (${t.recipe.publisher}) did in a throwaway worktree, then re-derived and validated by Drift. The recipe\u2019s own output was not used \u2014 see ${t.recipe.source}.`:"Inferred from a community recipe, then re-derived and validated by Drift.";case"cache":return`Restored from a previously validated plan for this same migration (\`${t.sourceId??e.id}\`), then re-validated against this repository\u2019s own call sites.`;case"user":return"Supplied by a human. Validated by Drift exactly as an authored plan would be."}}function db(e,t={}){let{plan:n}=e,r=t.headingLevel??3,i=s=>"#".repeat(Math.min(6,r+s)),o=[];if(o.push(`${i(0)} Fix plan: ${n.migration}`),o.push(""),o.push(`\`${n.id}\` \xB7 **${n.dependency}** ${n.fromVersion??"?"} \u2192 ${n.toVersion??"?"} \xB7 ${n.changeKind}`),o.push(""),e.verdict==="rejected"){o.push("**Drift rejected this plan.** It was not applied, and the finding falls through to the tier below."),o.push("");for(let s of e.rejections)o.push(`- ${s}`);return o.push(""),o.push(voe(n)),o.join(` +`)}o.push(`${i(1)} What it does`),o.push("");for(let s of n.ops)o.push(`1. ${uz(s)}`);return o.push(""),n.rationale&&(o.push(`${i(1)} Why`),o.push(""),o.push(n.rationale),o.push("")),o.push(`${i(1)} What Drift checked`),o.push(""),o.push("- **Grounding.** Every operation acts on a symbol this finding names."),o.push("- **Exact occurrences.** Every edit is anchored to one call site Drift localized \u2014 file, line, column, and the exact text matched there. An operation cannot reach a same-named identifier elsewhere on the line, let alone elsewhere in the file."),o.push(`- **Attestation.** Every name introduced (${n.ops.flatMap(e2e).map(s=>`\`${s}\``).join(", ")||"none"}) appears in the cited evidence${n.citations.length?` (${n.citations.map(s=>`\`${s}\``).join(", ")})`:""}.`),o.push("- **Convergence.** Applying the plan twice was tested, and gives the same result as applying it once."),o.push("- **Line preservation.** No operation splits or joins a line."),o.push(`- **Assurance.** ${Qqe(e.assurance)}`),o.push(""),o.push(`${i(1)} Coverage`),o.push(""),o.push(e.residual===0?`All ${e.covered} call site${e.covered===1?"":"s"} are resolved deterministically. No agent is asked about this finding.`:`${e.covered} of ${e.covered+e.residual} call sites are resolved deterministically. The remaining ${e.residual} ${e.residual===1?"is":"are"} listed below and ${e.residual===1?"is":"are"} handed to an agent individually \u2014 the plan is not abandoned because of them.`),o.push(""),t.sites!==!1&&e.sites.length>0&&(o.push(Xqe(e.sites)),o.push("")),o.push(voe(n)),o.join(` +`)}function koe(e){if(e.verdict==="rejected")return`Fix plan rejected: ${e.rejections[0]??"it did not pass validation"}`;let t=e.plan.ops.length,n=e.covered+e.residual;return`${t} deterministic rule${t===1?"":"s"} covering ${e.covered}/${n} call site${n===1?"":"s"} (${e.assurance})`}function Xqe(e){let t=["| Site | Change |","| --- | --- |"];for(let n of e){let r=`\`${n.file}:${n.line}\``;n.status==="covered"?t.push(`| ${r} | \`${woe(n.before)}\` \u2192 \`${woe(n.after??"")}\` |`):t.push(`| ${r} | _Not covered_ \u2014 ${n.reason??"no rule matched."} |`)}return t.join(` +`)}function e2e(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];default:return[]}}function woe(e){let t=e.trim();return t.length<=90?t:`${t.slice(0,87)}\u2026`}var t2e={high:"\u{1F7E2} high",medium:"\u{1F7E1} medium",low:"\u{1F7E0} low"},n2e={none:"\u26AA none",low:"\u{1F7E2} low",medium:"\u{1F7E1} medium",high:"\u{1F534} high"};function rm(e,t){let n=[];return n.push(r2e(e)),n.push($oe(e)),e.blockers.length>0&&n.push(Soe(e)),e.warnings.length>0&&n.push(xoe(e)),n.push(Eoe(e)),n.push(ZU(e)),n.push(Toe(e)),n.push(l2e(e)),n.push(qU(e.gaps)),n.push(WU(e)),n.push(Ioe(e)),n.push(u2e(e,t)),n.push(Aoe(e)),n.filter(Boolean).join(` + +`)}function _oe(e,t){let n=[];return n.push("## Drift found breaking changes that need your call"),n.push(e.blockers.length>0?"Drift analysed this dependency change and prepared a fix, then stopped. The reasons are listed below.":"Drift analysed this dependency change and prepared a fix. This repository runs in `approve` mode, so nothing has been changed yet."),n.push($oe(e)),e.blockers.length>0&&n.push(Soe(e)),e.warnings.length>0&&n.push(xoe(e)),n.push(Eoe(e)),n.push(ZU(e)),n.push(Toe(e)),n.push(qU(e.gaps)),n.push(WU(e)),n.push(Ioe(e)),n.push(["## To proceed","","Comment `/drift apply` on this issue and Drift will create the branch and","hand the plan to GitHub Copilot, one commit at a time. You will get a pull","request to review \u2014 nothing merges automatically.","","Comment `/drift dismiss` to close this out.","","To stop being asked for changes like this, adjust `.github/drift.yml` \u2014 see the [configuration reference](https://github.com/trydrift/drift/blob/main/docs/configuration.md)."].join(` +`)),n.push(Aoe(e)),n.filter(Boolean).join(` + +`)}function r2e(e){let t=new Set(e.changes.map(r=>r.workspace).filter(r=>r!==void 0));return["## Drift: dependency compatibility fix","",`${e.changes.map(r=>{let i=t.size>1?p_(r):null,o=r.kind==="runtime"?null:ub[r.kind],s=[r.ecosystem,o].filter(Boolean).join(", ");return`\`${r.name}\` _(${s})_ ${r.from??"\u2014"} \u2192 **${r.to??"\u2014"}**${i?` _(in ${i})_`:""}`}).join(", ")}`,"",e.commits.length>0?`Drift found **${e.breakingChanges.length} breaking change(s)** affecting **${new Set(e.impactSites.map(r=>r.file)).size} file(s)** in this repository, and planned **${e.commits.length} commit(s)** to fix them.`:em(e)].join(` +`)}function $oe(e){let t=new Set(e.impactSites.map(n=>n.file)).size;return["| | |","|---|---|",`| **Risk** | ${n2e[e.risk]??e.risk} |`,`| **Breaking changes** | ${e.upstreamBreakingCount??e.breakingChanges.length} |`,`| **Impact sites** | ${e.impactSites.length} across ${t} file(s) |`,`| **Planned commits** | ${e.commits.length} |`,`| **Evidence sources** | ${i2e(e.evidence)} |`,`| **Base branch** | \`${e.baseBranch}\` |`].join(` +`)}function i2e(e){let t=new Map;for(let n of e)t.set(n.source,(t.get(n.source)??0)+1);return t.size===0?"none":[...t.entries()].map(([n,r])=>`${n} (${r})`).join(", ")}function Soe(e){return["## \u26D4 Why Drift stopped","","Drift did not dispatch this automatically. Each reason below is a guardrail","from `.github/drift.yml`:","",...e.blockers.map(t=>`- ${t}`)].join(` +`)}function xoe(e){return["## \u26A0\uFE0F Worth checking","",...e.warnings.map(t=>`- ${t}`)].join(` +`)}function Eoe(e){if(e.breakingChanges.length===0)return["## Breaking changes","","None identified from the available evidence."].join(` +`);let t=new Map(e.evidence.map(r=>[r.id,r])),n=["## Breaking changes",""];for(let r of e.breakingChanges){let i=e.impactSites.filter(a=>a.breakingChangeId===r.id).length,o=BU(r);n.push(`### ${TE(r).text} \xB7 \`${r.dependency}\` \xB7 ${r.kind}`),n.push(""),n.push(r.summary),n.push(""),r.before&&r.after&&r.before!==r.after&&n.push("```diff",`- ${dz(r.before,300)}`,`+ ${dz(r.after,300)}`,"```",""),n.push(`**Verdict:** ${Oie(o,r.assessment)}.`),n.push(""),n.push(Fie(r)),n.push(""),r.assessment&&(n.push(Lie(r.assessment)),n.push(""),n.push(jie(r.assessment)),n.push("")),r.symbols.length>0&&(n.push(`**Symbols:** ${r.symbols.map(a=>`\`${a}\``).join(", ")}`),n.push("")),n.push(i>0?`**Found in this repo:** ${i} location(s)`:r.assessment?.localImpact.penalties.some(a=>a.code==="localization-unavailable")?"**Found in this repo:** not searched \u2014 no checkout was available. This is not evidence the change is unused.":"**Found in this repo:** no usages found in the files that import this dependency \u2014 no fix planned"),n.push(""),n.push(...o2e(r.remediation)),n.push("");let s=r.citations.map(a=>t.get(a)).filter(a=>a!==void 0);if(s.length>0){n.push("**Evidence:**");for(let a of s)n.push(`- ${Roe(a)}`);n.push("")}}return n.join(` +`).trim()}function o2e(e){let t=s2e(e);return t.length===1?[`**Fix:** ${t[0]}`]:["**Fix:**","",...t]}function s2e(e){let t=[],n=[],r=()=>{let i=n.join(" ").trim();n.length=0,i&&t.push(i)};for(let i of e.split(/\r?\n/)){let o=i.trim(),s=/^(before|after):(.*)$/i.exec(o);if(s){r(),t.push(`**${c2e(s[1])}:**`,"",a2e(s[2].trimStart()),"");continue}if(!o){r();continue}n.push(o)}return r(),t.filter((i,o,s)=>i||s[o-1]&&s[o+1])}function a2e(e){let t=e.match(/`+/g)?.reduce((r,i)=>Math.max(r,i.length),2)??2,n="`".repeat(t+1);return[n,e,n].join(` +`)}function c2e(e){return e&&`${e[0].toUpperCase()}${e.slice(1).toLowerCase()}`}function Toe(e){if(e.commits.length===0)return["## Commit plan","",`No commits planned. ${em(e)}`].join(` +`);let t=["## Commit plan","","Each commit addresses one concern. The graph below records only necessary","dependencies; commits in the same execution layer have disjoint file scope and","may run in parallel.",""];for(let n of e.commits){if(t.push(`**${n.order}. \`${n.message}\`**`),t.push(""),t.push(`Unit: \`${n.id}\``),t.push(`Layer: ${n.executionLayer}`),n.dependsOn.length>0&&(t.push(`Depends on: ${n.dependsOn.map(r=>`\`${r}\``).join(", ")}`),t.push(`Why: ${n.dependencyReasons.map(r=>`${r.reason}${r.evidence.length?` (${r.evidence.slice(0,3).join("; ")})`:""}`).join("; ")}`)),t.push(`Files: ${n.allowedFiles.map(r=>`\`${r}\``).join(", ")}`),(n.allowedSymbols??[]).length>0&&t.push(`Symbols: ${n.allowedSymbols.map(r=>`\`${r}\``).join(", ")}`),n.expectedChecks.length>0&&t.push(`Expected checks: ${n.expectedChecks.map(r=>r.kind).join(", ")}`),n.codemod?.length){let r=n.codemod.map(i=>`\`${i.from}\` \u2192 \`${i.to}\``).join(", ");t.push(`**Resolved deterministically** by Drift's codemod engine (${r}) \u2014 no model call was needed for this commit.`)}else if(n.fixPlan){let{plan:r,covered:i,residual:o,assurance:s}=n.fixPlan,a=i+o;t.push(`**Deterministic fix plan** \`${r.id}\` \u2014 ${r.migration} ${r.ops.length} rule${r.ops.length===1?"":"s"}, ${i}/${a} call site${a===1?"":"s"} covered, assurance \`${s}\`.`);for(let c of r.ops)t.push(` - ${uz(c)}`);if(o>0&&t.push(` - ${o} call site${o===1?"":"s"} not covered by the plan; an agent handles ${o===1?"it":"them"} individually.`),n.recipe?.length){let c=[...new Map(n.recipe.map(l=>[`${l.provider}:${l.name}@${l.version}`,l])).values()];t.push(` - Consulted: ${c.map(l=>`[\`${l.name}@${l.version}\`](${l.source}) from ${l.publisher}`).join(", ")}`)}}else if(n.recipe?.length){let r=[...new Map(n.recipe.map(o=>[`${o.provider}:${o.name}@${o.version}`,o])).values()],i=r.map(o=>`[\`${o.name}@${o.version}\`](${o.source}) from ${o.publisher} (${o.provider})`).join(", ");t.push(`**Community recipe consulted**: ${i} \u2014 ${r[0].migration} Drift could not re-derive its edits as deterministic operations, so this commit goes to an agent.`)}t.push("")}return t.join(` +`).trim()}function l2e(e){if(e.impactSites.length===0)return"";let t=new Map;for(let r of e.impactSites){let i=t.get(r.file);i?i.push(r):t.set(r.file,[r])}let n=["
",`All ${e.impactSites.length} impact site(s)`,""];for(let[r,i]of[...t.entries()].sort()){let o=i.every(s=>s.siteKind==="manifest");n.push(`**\`${r}\`**${o?" \u2014 the declaration, not a call site":""}`),n.push("");for(let s of i.slice(0,25)){let a=s.enclosingSymbol?` (in \`${s.enclosingSymbol}\`)`:"";n.push(`- L${s.line}${a} \u2014 \`${s.excerpt}\` \xB7 ${t2e[s.confidence]}`)}i.length>25&&n.push(`- \u2026and ${i.length-25} more in this file`),n.push("")}return n.push("
"),n.join(` +`)}function Ioe(e){if(e.evidence.length===0)return"";let t=["
",`Evidence Drift used (${e.evidence.length} source(s))`,"","Every finding above traces back to one of these. Open them to check the work.",""];for(let n of e.evidence)t.push(`#### ${Roe(n)}`),t.push(""),t.push(`\`${n.source}\` \xB7 ${Mie(n.weight)} (weight ${n.weight.toFixed(2)})`),t.push(""),t.push("```"),t.push(dz(n.content,2e3)),t.push("```"),t.push("");return t.push("
"),t.join(` +`)}function u2e(e,t){let n=["Every edit corresponds to a breaking change listed above \u2014 no unrelated refactoring crept in","The fixes match what the cited evidence actually says","CI passes on this branch"];return e.impactSites.some(r=>r.file.includes("test"))&&n.push("Test changes update assertions to the new API rather than weakening them"),e.breakingChanges.some(r=>r.kind==="behaviour-change"||r.kind==="default-change")&&n.push("Behaviour changes were handled deliberately \u2014 these compile either way, so the type checker will not catch a wrong choice"),e.breakingChanges.some(r=>r.confidence==="low")&&n.push("Low-confidence findings were verified against the upstream source before accepting"),["## Review checklist","",...n.map(r=>`- [ ] ${r}`)].join(` +`)}function Aoe(e){return["---","",zie({schemaVersion:Jf,planId:e.id,planDigest:sE(e),headSha:e.headSha,baseBranch:e.baseBranch}),"",`Generated by [Drift](https://github.com/trydrift/drift) \xB7 plan \`${e.id}\` \xB7 ${e.createdAt}
`,"Drift reads dependency changes, proves which ones break your code, and drives","GitHub Copilot to fix them. It never merges anything.
"].join(` +`)}function Roe(e){let t=e.title;return e.url?`[${t}](${e.url})`:e.locator?`${t} (\`${e.locator}\`)`:t}function dz(e,t){return e.length<=t?e:`${e.slice(0,t)} +\u2026(truncated)`}function LE(e){if(e.commits.length===0)return`${em(e)} (${e.changes.length} dependency change(s) checked)`;let t=new Set(e.impactSites.map(n=>n.file)).size;return`${e.breakingChanges.length} breaking change(s), ${t} file(s) affected, ${e.commits.length} commit(s) planned (risk: ${e.risk})`}var im=require("node:fs/promises"),fb=require("node:path");function Poe(e){return e.codemod?"builtin":e.fixPlan?"fix-plan":"ai"}function pz(e,t){let n=new Set(t.map(i=>i.id)),r=new Set(t.flatMap(i=>i.breakingChangeIds));return{...e,commits:e.commits.filter(i=>n.has(i.id)),breakingChanges:e.breakingChanges.filter(i=>r.has(i.id))}}function FE(e,t){let n=new Map(t);for(let s of e.codemod??[])for(let a of s.files){let c=n.get(a);c!==void 0&&n.set(a,xne(c,s,a))}let r=[];for(let[s,a]of t){let c=n.get(s);c!==void 0&&c!==a&&r.push({path:s,content:c})}if(r.length===0)return{status:"no-changes",edits:[],message:"The deterministic fix produced no changes here \u2014 likely already applied by an earlier commit."};let i=new Set(r.map(s=>s.path)).size,o=e.codemod?.length??0;return{status:"applied",edits:r,message:`Applied ${o} deterministic rename${o===1?"":"s"} across ${i} file${i===1?"":"s"} \u2014 no agent call was made.`}}function jE(e,t){let n=e.fixPlan;if(!n)return{status:"no-changes",edits:[],message:"This commit has no fix plan."};let r=new Map(t);for(let a of n.files){let c=r.get(a);c!==void 0&&r.set(a,Mne(c,n.plan.ops,n.anchors,a))}let i=[];for(let[a,c]of t){let l=r.get(a);l!==void 0&&l!==c&&i.push({path:a,content:l})}if(i.length===0)return{status:"no-changes",edits:[],message:"The fix plan produced no changes here \u2014 likely already applied by an earlier commit."};let o=new Set(i.map(a=>a.path)).size,s=koe({plan:n.plan,verdict:n.residual===0?"accepted":"partial",assurance:n.assurance,sites:[],covered:n.covered,residual:n.residual,rejections:[],anchors:n.anchors});return{status:"applied",edits:i,message:`Applied fix plan \`${n.plan.id}\` \u2014 ${s} \u2014 across ${o} file${o===1?"":"s"}.`+(n.residual>0?` ${n.residual} call site${n.residual===1?"":"s"} remain${n.residual===1?"s":""} for an agent.`:" No agent call was made.")}}function UE(e,t,n={}){let{fixPlans:r}=t.remediation;if(e.verdict==="rejected")return{action:"skip",reason:e.rejections[0]??"The plan did not pass validation."};let i=e.covered+e.residual,o=i===0?0:e.covered/i;return ou.to),r=i.map(u=>u.name),o=i.map(u=>`${u.name} from ${u.from??"its previous version"} to ${u.to}`),s=n.id!==Bx,a=[`The dependenc${i.length===1?"y":"ies"} ${o.join(", ")||"in this repository"} ${i.length===1?"has":"have"} been upgraded.`,"","Update this repository so that it works correctly with the new version.",""];if(s){let u=t.breakingChanges.filter(p=>n.breakingChangeIds.includes(p.id)),d=t.impactSites.filter(p=>n.breakingChangeIds.includes(p.breakingChangeId));a.push("Fix only this problem, which the developer chose to fix on its own:","",...u.map(p=>`- ${p.summary}`),...d.slice(0,20).map(p=>` at ${p.file}:${p.line}`),"","Leave any other breakage for its own fix, and change another file only where","this fix needs it.","")}else a.push("Find and fix all relevant incompatibilities.","");let c=[...e.protectedPaths??[]];a.push(`Do not revert or downgrade ${r.length===1?"the dependency":"the dependencies"}. A companion package the new version requires may move with it.`,"","Run the appropriate tests/build/typecheck and leave the repository in a working state.","","Do not make a check pass by checking less: no lowered coverage thresholds, relaxed","compiler strictness, disabled lint rules, skipped or deleted tests, or suppression","directives."+(c.length?` Do not edit ${c.join(", ")}.`:""),"Drift reverts any file that breaks these rules.");let l=[a.join(` +${m.message}`)?(a.add(c.id),o.info(`Resolved commit ${c.order} directly (builtin): ${m.message}`)):await pb(t.workspace,c.files,s);continue}let u=c.fixPlan,d=UE({plan:u.plan,verdict:u.residual===0?"accepted":"partial",assurance:u.assurance,sites:[],covered:u.covered,residual:u.residual,rejections:[],anchors:u.anchors},r,{verificationPassed:n.verification?.status==="passed"});if(d.action!=="apply"){o.info(`Commit ${c.order} has a validated fix plan that will not be applied unattended: ${d.reason} The plan document is included for review.`);continue}let p=await p2e(t.workspace,c);if(!p){await pb(t.workspace,c.files,s);continue}await i.commitFiles(t,n.branchName,p.edits,[`${c.message}`,"",c.body,"",p.message,"",db({plan:u.plan,verdict:u.residual===0?"accepted":"partial",assurance:u.assurance,sites:[],covered:u.covered,residual:u.residual,rejections:[],anchors:u.anchors},{sites:!1,headingLevel:2})].join(` +`))?(a.add(c.id),o.info(`Resolved commit ${c.order} directly (fix plan): ${p.message}`)):await pb(t.workspace,c.files,s)}catch(u){o.warn(`Deterministic remediation failed for commit ${c.order}, falling back to an agent: ${u.message}`),await pb(t.workspace,c.files,s)}}return{committedIds:a}}async function d2e(e,t){let n=new Map;for(let i of t.files)try{n.set(i,await(0,im.readFile)((0,fb.join)(e,i),"utf8"))}catch{}let r=FE(t,n);if(r.status!=="applied")return null;for(let i of r.edits)await(0,im.writeFile)((0,fb.join)(e,i.path),i.content,"utf8");return{edits:r.edits,message:r.message}}async function p2e(e,t){let n=new Map;for(let i of t.fixPlan?.files??[])try{n.set(i,await(0,im.readFile)((0,fb.join)(e,i),"utf8"))}catch{}let r=jE(t,n);if(r.status!=="applied")return null;for(let i of r.edits)await(0,im.writeFile)((0,fb.join)(e,i.path),i.content,"utf8");return{edits:r.edits,message:r.message}}async function pb(e,t,n){t.length!==0&&await n("git",["checkout","--",...t],{cwd:e})}var am=require("node:fs/promises"),Yoe=require("node:crypto"),Qoe=require("node:os"),$s=require("node:path");var zE="upgrade";function f2e(e){return{plan:e.plan,commit:e.commit,files:e.files,customInstructions:e.customInstructions,context:e.context,diagnostics:e.diagnostics,revision:e.revision,repair:e.repair,mode:e.mode,protectedPaths:e.protectedPaths}}function Doe(e,t=""){let n=e.mode==="upgrade"?[]:["","## Your task","",e.commit.instructions];return[m2e(e),...n,...t?["",t]:[]].join(` +`)}function m2e(e){return g2e(f2e(e))}function fz(e){let{plan:t,commit:n}=e,r=t.changes.filter(u=>u.to),i=r.map(u=>u.name),o=r.map(u=>`${u.name} from ${u.from??"its previous version"} to ${u.to}`),s=n.id!==zE,a=[`The dependenc${r.length===1?"y":"ies"} ${o.join(", ")||"in this repository"} ${r.length===1?"has":"have"} been upgraded.`,"","Update this repository so that it works correctly with the new version.",""];if(s){let u=t.breakingChanges.filter(p=>n.breakingChangeIds.includes(p.id)),d=t.impactSites.filter(p=>n.breakingChangeIds.includes(p.breakingChangeId));a.push("Fix only this problem, which the developer chose to fix on its own:","",...u.map(p=>`- ${p.summary}`),...d.slice(0,20).map(p=>` at ${p.file}:${p.line}`),"","Leave any other breakage for its own fix, and change another file only where","this fix needs it.","")}else a.push("Find and fix all relevant incompatibilities.","");let c=[...e.protectedPaths??[]];a.push(`Do not revert or downgrade ${i.length===1?"the dependency":"the dependencies"}. A companion package the new version requires may move with it.`,"","Run the appropriate tests/build/typecheck and leave the repository in a working state.","","Do not make a check pass by checking less: no lowered coverage thresholds, relaxed","compiler strictness, disabled lint rules, skipped or deleted tests, or suppression","directives."+(c.length?` Do not edit ${c.join(", ")}.`:""),"Drift reverts any file that breaks these rules.");let l=[a.join(` `)];if(e.customInstructions?.trim()&&l.push(`## Repository conventions ${e.customInstructions.trim()}`),e.context?.length){let u=["## Context the developer attached","","Reference material. Read it to match this codebase, but do NOT edit any of it.",""];for(let d of e.context)u.push(`### ${d.kind}: ${d.value}`),d.content&&u.push("```",d.content.slice(0,4e3),"```"),u.push("");l.push(u.join(` `))}return e.revision?.guidance.trim()&&l.push(["## The developer rejected your previous attempt","",`This is attempt ${e.revision.attempt}. What they said:`,"","```",e.revision.guidance.trim().slice(0,4e3),"```"].join(` `)),l.join(` -`)}function hVe(e){if(e.mode==="upgrade")return kU(e);let{plan:t,commit:n}=e,i=new Map(t.evidence.map(s=>[s.id,s])),r=t.breakingChanges.filter(s=>n.breakingChangeIds.includes(s.id)),o=[];o.push(["You are fixing code that a dependency upgrade broke.","","The dependency versions have ALREADY been updated. Your job is to update","this repository's own code so it works with the new version.","",`Dependencies that moved: ${t.changes.map(s=>`${s.name} ${s.from??"\u2014"} \u2192 ${s.to??"\u2014"}`).join(", ")}`].join(` -`));for(let s of r){let a=[`## ${s.summary}`,""];a.push(`- Package: ${s.dependency}`),a.push(`- Kind: ${s.kind}`),a.push(`- Confidence: ${s.confidence}`),s.symbols.length&&a.push(`- Symbols: ${s.symbols.join(", ")}`),a.push(""),a.push(`**Required fix:** ${s.remediation}`),a.push("");for(let l of s.citations){let u=i.get(l);u&&(a.push(`Evidence \u2014 ${u.title}:`),a.push("```"),a.push(u.content.slice(0,1200)),a.push("```"),u.url&&a.push(`Source: ${u.url}`),a.push(""))}let c=t.impactSites.filter(l=>l.breakingChangeId===s.id);if(c.length){a.push("Known locations (verify each; there may be others):");for(let l of c.slice(0,30)){let u=l.enclosingSymbol?` in ${l.enclosingSymbol}`:"";a.push(`- ${l.file}:${l.line}${u} \u2014 ${l.excerpt}`)}a.push("")}o.push(a.join(` +`)}function g2e(e){if(e.mode==="upgrade")return fz(e);let{plan:t,commit:n}=e,r=new Map(t.evidence.map(s=>[s.id,s])),i=t.breakingChanges.filter(s=>n.breakingChangeIds.includes(s.id)),o=[];o.push(["You are fixing code that a dependency upgrade broke.","","The dependency versions have ALREADY been updated. Your job is to update","this repository's own code so it works with the new version.","",`Dependencies that moved: ${t.changes.map(s=>`${s.name} ${s.from??"\u2014"} \u2192 ${s.to??"\u2014"}`).join(", ")}`].join(` +`));for(let s of i){let a=[`## ${s.summary}`,""];a.push(`- Package: ${s.dependency}`),a.push(`- Kind: ${s.kind}`),a.push(`- Confidence: ${s.confidence}`),s.symbols.length&&a.push(`- Symbols: ${s.symbols.join(", ")}`),a.push(""),a.push(`**Required fix:** ${s.remediation}`),a.push("");for(let l of s.citations){let u=r.get(l);u&&(a.push(`Evidence \u2014 ${u.title}:`),a.push("```"),a.push(u.content.slice(0,1200)),a.push("```"),u.url&&a.push(`Source: ${u.url}`),a.push(""))}let c=t.impactSites.filter(l=>l.breakingChangeId===s.id);if(c.length){a.push("Known locations (verify each; there may be others):");for(let l of c.slice(0,30)){let u=l.enclosingSymbol?` in ${l.enclosingSymbol}`:"";a.push(`- ${l.file}:${l.line}${u} \u2014 ${l.excerpt}`)}a.push("")}o.push(a.join(` `))}if(e.diagnostics?.trim()&&o.push(["## What the project's own checks report right now","","These ran against the tree you are about to edit, after the dependency","versions moved. Unlike everything above, this is measured rather than","predicted \u2014 where it disagrees with the analysis, believe this.","","Diagnostics are grouped by root cause with a count. A problem reported","many times is one problem: find what it shares before editing any","individual site, and do not work through occurrences one by one.","","Some of these may have nothing to do with the upgrade. Fixing unrelated","pre-existing errors is out of scope \u2014 leave them alone.","",e.diagnostics.trim()].join(` -`)),o.push(["## Rules","",`0. You may edit ONLY these ${e.files.length} file${e.files.length===1?"":"s"}, whose current contents`," accompany this prompt \u2014 nothing else, including generated/bundled output,"," lockfiles, or a file you notice is *also* broken by this upgrade. This"," is enforced after you finish: an edit to any other file throws out"," this whole commit's work. If the real fix needs a file outside this"," list, say so and stop rather than making the edit.",` In scope: ${e.files.map(s=>s.path).join(", ")}`,"1. Change ONLY what is required for this specific fix. No refactoring,"," renaming, reformatting, or tidying of code you happen to pass by.","2. Do NOT change dependency versions in any manifest or lockfile.","3. Do NOT weaken, skip, or delete tests to make them pass. Update a test"," to exercise the new API while asserting the same behaviour.","4. If you cannot determine the correct fix for a location, leave it alone"," and add a `TODO(drift):` comment explaining what is unresolved. A"," flagged unknown is useful; a confident guess is not.","5. Do not invent APIs. If the evidence names no replacement, say so.","6. If a decision genuinely needs the developer \u2014 two valid migrations, a"," behaviour change only they can rule on \u2014 ask instead of guessing. Emit",` \`${yVe} |