varRUe=Object.create;varCx=Object.defineProperty;varTUe=Object.getOwnPropertyDescriptor;varDUe=Object.getOwnPropertyNames;varQUe=Object.getPrototypeOf,kUe=Object.prototype.hasOwnProperty;varo=(t,e)=>Cx(t,"name",{value:e,configurable:!0});varA=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),PUe=(t,e)=>{for(varrine)Cx(t,r,{get:e[r],enumerable:!0})},OUe=(t,e,r,n)=>{if(e&&typeofe=="object"||typeofe=="function")for(letiofDUe(e))!kUe.call(t,i)&&i!==r&&Cx(t,i,{get:()=>e[i],enumerable:!(n=TUe(e,i))||n.enumerable});returnt};varR=(t,e,r)=>(r=t!=null?RUe(QUe(t)):{},OUe(e||!t||!t.__esModule?Cx(r,"default",{value:t,enumerable:!0}):r,t));varTZ=A(cm=>{"use strict";varu5t=require("net"),GUe=require("tls"),AL=require("http"),NZ=require("https"),HUe=require("events"),d5t=require("assert"),VUe=require("util");cm.httpOverHttp=zUe;cm.httpsOverHttp=jUe;cm.httpOverHttps=$Ue;cm.httpsOverHttps=JUe;functionzUe(t){vare=newpu(t);returne.request=AL.request,e}o(zUe,"httpOverHttp");functionjUe(t){vare=newpu(t);returne.request=AL.request,e.createSocket=_Z,e.defaultPort=443,e}o(jUe,"httpsOverHttp");function$Ue(t){vare=newpu(t);returne.request=NZ.request,e}o($Ue,"httpOverHttps");functionJUe(t){vare=newpu(t);returne.request=NZ.request,e.createSocket=_Z,e.defaultPort=443,e}o(JUe,"httpsOverHttps");functionpu(t){vare=this;e.options=t||{},e.proxyOptions=e.options.proxy||{},e.maxSockets=e.options.maxSockets||AL.Agent.defaultMaxSockets,e.requests=[],e.sockets=[],e.on("free",o(function(n,i,s,a){for(varc=RZ(i,s,a),l=0,u=e.requests.length;l<u;++l){vard=e.requests[l];if(d.host===c.host&&d.port===c.port){e.requests.splice(l,1),d.request.onSocket(n);return}}n.destroy(),e.removeSocket(n)},"onFree"))}o(pu,"TunnelingAgent");VUe.inherits(pu,HUe.EventEmitter);pu.prototype.addRequest=o(function(e,r,n,i){vars=this,a=mL({request:e},s.options,RZ(r,n,i));if(s.sockets.length>=this.maxSockets){s.requests.push(a);return}s.createSocket(a,function(c){c.on("free",l),c.on("close",u),c.on("agentRemove",u),e.onSocket(c);functionl(){s.emit("free",c,a)}o(l,"onFree");functionu(d){s.removeSocket(c),c.removeListener("free",l),c.removeListener("close",u),c.removeListener("agentRemove",u)}o(u,"onCloseOrRemove")})},"addRequest");pu.prototype.createSocket=o(function(e,r){varn=this,i={};n.sockets.push(i);vars=mL({},n.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(s.localAddress=e.localAddress),s.proxyAuth&&(s.headers=s.headers||{},s.headers["Proxy-Authorization"]="Basic "+newBuffer(s.proxyAuth).toString("base64")),Qd("making CONNECT request");vara=n.request(s);a.useChunkedEncodingByDefault=!1,a.once("response",c),a.once("upgrade",l),a.once("connect",u),a.once("error",d),a.end();functionc(f){f.upgrade=!0}o(c,"onResponse");functionl(f,h,p){process.nextTick(function(){u(f,h,p)})}o(l,"onUpgrade");functionu(f,h,p){if(a.removeAllListeners(),h.removeAllListeners(),f.statusCode!==200){Qd("tunneling socket could not be established, statusCode=%d",f.statusCode),h.destroy();varm=newError("tunneling socket could not be established, statusCode="+f.statusCode);m.code="ECONNRESET",e.request.emit("error",m),n.removeSocket(i);return}if(p.length>0){Qd("got illegal response body from proxy"),h.destroy();varm=newError("got illegal response body from proxy");m.code="ECONNRESET",e.request.emit("error",m),n.removeSocket(i);return}returnQd("tunneling connection has established"),n.sockets[n.sockets.indexOf(i)]=h,r(h)}o(u,"onConnect");functiond(f){a.removeAllListeners(),Qd(`tunneling socket could not be established, cause=%s
`);h.push(g),s+=g.byteLength,m&&(s=null),i=t,n=o(async function*(){for(let E of h)E.stream?yield*E.stream():yield E},"action"),a=`multipart/form-data;boundary=${l}`}else if(Fte(t))i=t,s=t.size,t.type&&(a=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(lb.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:fHe(t)}if((typeof i=="string"||lb.isBuffer(i))&&(s=Buffer.byteLength(i)),n!=null){let l;r=new ReadableStream({async start(){l=n(t)[Symbol.asyncIterator]()},async pull(u){let{value:d,done:f}=await l.next();if(f)queueMicrotask(()=>{u.close(),u.byobRequest?.respond(0)});else if(!Gte(r)){let h=new Uint8Array(d);h.byteLength&&u.enqueue(h)}return u.desiredSize>0},async cancel(u){await l.return()},type:"bytes"})}return[{stream:r,source:i,length:s},a]}o(zte,"extractBody");function BHe(t,e=!1){return t instanceof ReadableStream&&(bF(!lb.isDisturbed(t),"The body has already been consumed."),bF(!t.locked,"The stream is locked.")),zte(t,e)}o(BHe,"safelyExtractBody");function xHe(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}o(xHe,"cloneBody");function vHe(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}o(vHe,"throwIfAborted");function NHe(t){return{blob(){return wm(this,r=>{let n=Ute(this);return n===null?n="":n&&(n=wHe(n)),new EHe([r],{type:n})},t)},arrayBuffer(){return wm(this,r=>new Uint8Array(r).buffer,t)},text(){return wm(this,qte,t)},json(){return wm(this,RHe,t)},formData(){return wm(this,r=>{let n=Ute(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let i=IHe(r,n);if(i==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new Mte;return s[Im]=i,s}case"application/x-www-form-urlencoded":{let i=new URLSearchParams(r.toString()),s=new Mte;for(let[a,c]of i)s.append(a,c);return s}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return wm(this,r=>new Uint8Array(r),t)}}}o(NHe,"bodyMixinMethods");function _He(t){Object.assign(t.prototype,NHe(t))}o(_He,"mixinBody");async function wm(t,e,r){if(yHe.brandCheck(t,r),jte(t))throw new TypeError("Body is unusable: Body has already been read");vHe(t[Im]);let n=AHe(),i=o(a=>n.reject(a),"errorSteps"),s=o(a=>{try{n.resolve(e(a))}catch(c){i(c)}},"successSteps");return t[Im].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await mHe(t[Im].body,s,i),n.promise)}o(wm,"consumeBody");function jte(t){let e=t[Im].body;return e!=null&&(e.stream.locked||lb.isDisturbed(e.stream))}o(jte,"bodyUnusable");function RHe(t){return JSON.parse(qte(t))}o(RHe,"parseJSONFromBytes");function Ute(t){let e=t[Im].headersList,r=gHe(e);return r==="failure"?null:r}o(Ute,"bodyMimeType");$te.exports={extractBody:zte,safelyExtractBody:BHe,cloneBody:xHe,mixinBody:_He,streamRegistry:Vte,hasFinalizationRegistry:Hte,bodyUnusable:jte}});var lre=A((iVt,cre)=>{"use strict";var Re=require("node:assert"),Fe=ot(),{channels:Jte}=dm(),IF=iF(),{RequestContentLengthMismatchError:Th,ResponseContentLengthMismatchError:Wte,RequestAbortedError:nre,HeadersTimeoutError:THe,HeadersOverflowError:DHe,SocketError:Bm,InformationalError:xm,BodyTimeoutError:QHe,HTTPParserError:kHe,ResponseExceededMaxSizeError:PHe}=_t(),{kUrl:ire,kReset:gs,kClient:Zx,kParser:tr,kBlocking:fb,kRunning:pn,kPending:sre,kSize:Yte,kWriting:Pd,kQueue:Pa,kNoRef:ub,kKeepAliveDefaultTimeout:OHe,kHostHeader:LHe,kPendingIdx:FHe,kRunningIdx:ko,kError:qi,kPipelining:ev,kSocket:Qh,kKeepAliveTimeoutValue:rv,kMaxHeadersSize:SF,kKeepAliveMaxTimeout:MHe,kKeepAliveTimeoutThreshold:UHe,kHeadersTimeout:qHe,kBodyTimeout:GHe,kStrictContentLength:vF,kMaxRequests:Kte,kCounter:HHe,kMaxResponseSize:VHe,kOnError:Xte,kResume:Cu,kHTTPContext:ore}=Ar(),js=Vee(),Zte=Buffer.alloc(0),Yx=Buffer[Symbol.species],Kx=Fe.addListener,zHe=Fe.removeAllListeners,kh=Symbol("kIdleSocketValidation"),Dh=Symbol("kIdleSocketValidationTimeout"),TF=Symbol("kSocketUsed"),BF;async function jHe(){let t=p
`}return Jte.sendHeaders.hasSubscribers&&Jte.sendHeaders.publish({request:e,headers:g,socket:p}),!l||h===0?tre(m,null,t,e,p,d,g,f):Fe.isBuffer(l)?tre(m,l,t,e,p,d,g,f):Fe.isBlobLike(l)?typeof l.stream=="function"?rre(m,l.stream(),t,e,p,d,g,f):e4e(m,l,t,e,p,d,g,f):Fe.isStream(l)?ZHe(m,l,t,e,p,d,g,f):Fe.isIterable(l)?rre(m,l,t,e,p,d,g,f):Re(!1),!0}o(XHe,"writeH1");function ZHe(t,e,r,n,i,s,a,c){Re(s!==0||r[pn]===0,"stream body cannot be pipelined");let l=!1,u=new nv({abort:t,socket:i,request:n,contentLength:s,client:r,expectsPayload:c,header:a}),d=o(function(m){if(!l)try{!u.write(m)&&this.pause&&this.pause()}catch(g){Fe.destroy(this,g)}},"onData"),f=o(function(){l||e.resume&&e.resume()},"onDrain"),h=o(function(){if(queueMicrotask(()=>{e.removeListener("error",p)}),!l){let m=new nre;queueMicrotask(()=>p(m))}},"onClose"),p=o(function(m){if(!l){if(l=!0,Re(i.destroyed||i[Pd]&&r[pn]<=1),i.off("drain",f).off("error",p),e.removeListener("data",d).removeListener("end",p).removeListener("close",h),!m)try{u.end()}catch(g){m=g}u.destroy(m),m&&(m.code!=="UND_ERR_INFO"||m.message!=="reset")?Fe.destroy(e,m):Fe.destroy(e)}},"onFinished");e.on("data",d).on("end",p).on("error",p).on("close",h),e.resume&&e.resume(),i.on("drain",f).on("error",p),e.errorEmitted??e.errored?setImmediate(()=>p(e.errored)):(e.endEmitted??e.readableEnded)&&setImmediate(()=>p(null)),(e.closeEmitted??e.closed)&&setImmediate(h)}o(ZHe,"writeStream");function tre(t,e,r,n,i,s,a,c){try{e?Fe.isBuffer(e)&&(Re(s===e.byteLength,"buffer body must have content length"),i.cork(),i.write(`${a}content-length:${s}\r
`,"latin1"):(Re(s===null,"no body must not have content length"),i.write(`${a}\r
`,"latin1")),n.onRequestSent(),r[Cu]()}catch(l){t(l)}}o(tre,"writeBuffer");async function e4e(t,e,r,n,i,s,a,c){Re(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new Th;let l=Buffer.from(await e.arrayBuffer());i.cork(),i.write(`${a}content-length:${s}\r
`,"latin1"),i.write(l),i.uncork(),n.onBodySent(l),n.onRequestSent(),!c&&n.reset!==!1&&(i[gs]=!0),r[Cu]()}catch(l){t(l)}}o(e4e,"writeBlob");async function rre(t,e,r,n,i,s,a,c){Re(s!==0||r[pn]===0,"iterator body cannot be pipelined");let l=null;function u(){if(l){let h=l;l=null,h()}}o(u,"onDrain");let d=o(()=>new Promise((h,p)=>{Re(l===null),i[qi]?p(i[qi]):l=h}),"waitForDrain");i.on("close",u).on("drain",u);let f=new nv({abort:t,socket:i,request:n,contentLength:s,client:r,expectsPayload:c,header:a});try{for await(let h of e){if(i[qi])throw i[qi];f.write(h)||await d()}f.end()}catch(h){f.destroy(h)}finally{i.off("close",u).off("drain",u)}}o(rre,"writeIterable");var nv=class{static{o(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:i,client:s,expectsPayload:a,header:c}){this.socket=r,this.request=n,this.contentLength=i,this.client=s,this.bytesWritten=0,this.expectsPayload=a,this.header=c,this.abort=e,r[Pd]=!0}write(e){let{socket:r,request:n,contentLength:i,client:s,bytesWritten:a,expectsPayload:c,header:l}=this;if(r[qi])throw r[qi];if(r.destroyed)return!1;let u=Buffer.byteLength(e);if(!u)return!0;if(i!==null&&a+u>i){if(s[vF])throw new Th;process.emitWarning(new Th)}r.cork(),a===0&&(!c&&n.reset!==!1&&(r[gs]=!0),i===null?r.write(`${l}transfer-encoding:chunked\r
`,"latin1"),r!==null&&i!==r){if(n[vF])throw new Th;process.emitWarning(new Th)}e[tr].timeout&&e[tr].timeoutType===vm&&e[tr].timeout.refresh&&e[tr].timeout.refresh(),n[Cu]()}}destroy(e){let{socket:r,client:n,abort:i}=this;r[Pd]=!1,e&&(Re(n[pn]<=1,"pipeline should only contain this request"),i(e))}};cre.exports=JHe});var gre=A((oVt,mre)=>{"use strict";var Po=require("node:assert"),{pipeline:t4e}=require("node:stream"),pt=ot(),{RequestContentLengthMismatchError:DF,RequestAbortedError:ure,SocketError:hb,InformationalError:QF}=_t(),{kUrl:iv,kReset:ov,kClient:Nm,kRunning:av,kPending:r4e,kQueue:Od,kPendingIdx:kF,kRunningIdx:Oa,kError:Fa,kSocket:qn,kStrictContentLength:n4e,kOnError:PF,kMaxConcurrentStreams:Are,kHTTP2Session:La,kResume:Ld,kSize:i4e,kHTTPContext:s4e}=Ar(),bu=Symbol("open streams"),dre,fre=!1,sv;try{sv=require("node:http2")}catch{sv={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:o4e,HTTP2_HEADER_METHOD:a4e,HTTP2_HEADER_PATH:c4e,HTTP2_HEADER_SCHEME:l4e,HTTP2_HEADER_CONTENT_LENGTH:u4e,HTTP2_HEADER_EXPECT:d4e,HTTP2_HEADER_STATUS:f4e}}=sv;function h4e(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let i of n)e.push(Buffer.from(r),Buffer.from(i));else e.push(Buffer.from(r),Buffer.from(n));return e}o(h4e,"parseH2Headers");async function p4e(t,e){t[qn]=e,fre||(fre=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=sv.connect(t[iv],{createConnection:o(()=>e,"createConnection"),peerMaxConcurrentStreams:t[Are]});r[bu]=0,r[Nm]=t,r[qn]=e,pt.addListener(r,"error",m4e),pt.addListener(r,"frameError",g4e),pt.addListener(r,"end",y4e),pt.addListener(r,"goaway",E4e),pt.addListener(r,"close",function(){let{[Nm]:i}=this,{[qn]:s}=i,a=this[qn][Fa]||this[Fa]||new hb("closed",pt.getSocketInfo(s));if(i[La]=null,i.destroyed){Po(i[r4e]===0);let c=i[Od].splice(i[Oa]);for(let l=0;l<c.length;l++){let u=c[l];pt.errorRequest(i,u,a)}}}),r.unref(),t[La]=r,e[La]=r,pt.addListener(e,"error",function(i){Po(i.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Fa]=i,this[Nm][PF](i)}),pt.addListener(e,"end",function(){pt.destroy(this,new hb("other side closed",pt.getSocketInfo(this)))}),pt.addListener(e,"close",function(){let i=this[Fa]||new hb("closed",pt.getSocketInfo(this));t[qn]=null,this[La]!=null&&this[La].destroy(i),t[kF]=t[Oa],Po(t[av]===0),t.emit("disconnect",t[iv],[t],i),t[Ld]()});let n=!1;return e.on("close",()=>{n=!0}),{version:"h2",defaultPipelining:1/0,write(...i){return b4e(t,...i)},resume(){A4e(t)},destroy(i,s){n?queueMicrotask(s):e.destroy(i).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}o(p4e,"connectH2");function A4e(t){let e=t[qn];e?.destroyed===!1&&(t[i4e]===0&&t[Are]===0?(e.unref(),t[La].unref()):(e.ref(),t[La].ref()))}o(A4e,"resumeH2");function m4e(t){Po(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[qn][Fa]=t,this[Nm][PF](t)}o(m4e,"onHttp2SessionError");function g4e(t,e,r){if(r===0){let n=new QF(`HTTP/2:"frameError"received-type${t},code${e}`);this[qn][Fa]=n,this[Nm][PF](n)}}o(g4e,"onHttp2FrameError");function y4e(){let t=new hb("other side closed",pt.getSocketInfo(this[qn]));this.destroy(t),pt.destroy(this[qn],t)}o(y4e,"onHttp2SessionEnd");function E4e(t){let e=this[Fa]||new hb(`HTTP/2:"GOAWAY"framereceivedwithcode${t}`,pt.getSocketInfo(this)),r=this[Nm];if(r[qn]=null,r[s4e]=null,this[La]!=null&&(this[La].destroy(e),this[La]=null),pt.destroy(this[qn],e),r[Oa]<r[Od].length){let n=r[Od][r[Oa]];r[Od][r[Oa]++]=null,pt.errorRequest(r,n,e),r[kF]=r[Oa]}Po(r[av]===0),r.emit("disconnect",r[iv],[r],e),r[Ld]()}o(E4e,"onHTTP2GoAway");function C4e(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}o(C4e,"shouldSendContentLength");function b4e(t,e){let r=t[La],{method:n,path:i,host:s,upgrade:a,expectContinue:c,signal:l,headers:u}=e,{body:d}=e;if(a)return pt.errorRequest(t,e,new Error("Upgrade not supported for H2")),!1;let f={};for(let B=0;B<u.length;B+=2){let Q=u[B+0],M=u[B+1];if(Array.isArray(M))for(let v=0;v<M.length;v++)f[Q]?f[Q]+=`,${M[v]}`:f[Q]=M[v];else f[Q]=M}let h,{hostname:p,port:m}=t[iv];f[o4
`);if(h===-1){k_("have not received end of HTTP headers yet..."),s();return}let p=f.slice(0,h).toString("ascii").split(`\r
`),m=p.shift();if(!m)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let g=m.split(" "),E=+g[1],y=g.slice(2).join(" "),C={};for(let w of p){if(!w)continue;let B=w.indexOf(":");if(B===-1)return t.destroy(),r(new Error(`InvalidheaderfromproxyCONNECTresponse:"${w}"`));let Q=w.slice(0,B).toLowerCase(),M=w.slice(B+1).trimStart(),v=C[Q];typeof v=="string"?C[Q]=[v,M]:Array.isArray(v)?v.push(M):C[Q]=M}k_("got proxy server response: %o %o",m,C),a(),e({connect:{statusCode:E,statusText:y,headers:C},buffered:f})}o(u,"ondata"),t.on("error",l),t.on("end",c),s()})}o(ktt,"parseProxyResponse");Ng.parseProxyResponse=ktt});var fpe=A(Wo=>{"use strict";var Ptt=Wo&&Wo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ott=Wo&&Wo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),upe=Wo&&Wo.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Ptt(e,t,r);return Ott(e,t),e},dpe=Wo&&Wo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.HttpsProxyAgent=void 0;var P_=upe(require("net")),ape=upe(require("tls")),Ltt=dpe(require("assert")),Ftt=dpe(Q_()),Mtt=spe(),Utt=require("url"),qtt=ope(),k0=(0,Ftt.default)("https-proxy-agent"),cpe=o(t=>t.servername===void 0&&t.host&&!P_.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),O_=class extends Mtt.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new Utt.URL(e):e,this.proxyHeaders=r?.headers??{},k0("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?lpe(r,"headers"):null,host:n,port:i}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(k0("Creating `tls.Socket`: %o",this.connectOpts),i=ape.connect(cpe(this.connectOpts))):(k0("Creating `net.Socket`: %o",this.connectOpts),i=P_.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=P_.isIPv6(r.host)?`[${r.host}]`:r.host,c=`CONNECT${a}:${r.port}HTTP/1.1\r
`;if(n.username||n.password){let h=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic${Buffer.from(h).toString("base64")}`}s.Host=`${a}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let h of Object.keys(s))c+=`${h}:${s[h]}\r
`)+4,e.outputData[0].data=e._header+n.substring(i),_g("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(_g("Creating `tls.Socket`: %o",this.connectOpts),s=nrt.connect(this.connectOpts)):(_g("Creating `net.Socket`: %o",this.connectOpts),s=rrt.connect(this.connectOpts)),await(0,srt.once)(s,"connect"),s}};L_.protocols=["http","https"];Yo.HttpProxyAgent=L_;function art(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(art,"omit")});var Vpe=A(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});K_.state=void 0;K_.state={instrumenterImplementation:void 0}});var aAe=A(rR=>{"use strict";Object.defineProperty(rR,"__esModule",{value:!0});rR.state=void 0;rR.state={operationRequestMap:new WeakMap}});var Mge=A($g=>{"use strict";Object.defineProperty($g,"__esModule",{value:!0});var vat=require("os"),Nat=require("util");function _at(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}o(_at,"_interopDefaultLegacy");var Rat=_at(Nat);function Tat(t,...e){process.stderr.write(`${Rat.default.format(t,...e)}${vat.EOL}`)}o(Tat,"log");var _ge=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Tge,bV=[],wV=[],bT=[];_ge&&IV(_ge);var Dge=Object.assign(t=>Qge(t),{enable:IV,enabled:SV,disable:Dat,log:Tat});function IV(t){Tge=t,bV=[],wV=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?wV.push(new RegExp(`^${n.substr(1)}$`)):bV.push(new RegExp(`^${n}$`));for(let n of bT)n.enabled=SV(n.namespace)}o(IV,"enable");function SV(t){if(t.endsWith("*"))return!0;for(let e of wV)if(e.test(t))return!1;for(let e of bV)if(e.test(t))return!0;return!1}o(SV,"enabled");function Dat(){let t=Tge||"";return IV(""),t}o(Dat,"disable");function Qge(t){let e=Object.assign(r,{enabled:SV(t),destroy:Qat,log:Dge.log,namespace:t,extend:kat});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t}${n[0]}`),e.log(...n))}return o(r,"debug"),bT.push(e),e}o(Qge,"createDebugger");function Qat(){let t=bT.indexOf(this);return t>=0?(bT.splice(t,1),!0):!1}o(Qat,"destroy");function kat(t){let e=Qge(`${this.namespace}:${t}`);return e.log=this.log,e}o(kat,"extend");var bw=Dge,kge=new Set,ET=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,wT,IT=bw("azure");IT.log=(...t)=>{bw.log(...t)};var BV=["verbose","info","warning","error"];ET&&(Fge(ET)?Pge(ET):console.error(`AZURE_LOG_LEVELsettounknownloglevel'${ET}';loggingisnotenabled.Acceptablevalues:${BV.join(", ")}.`));function Pge(t){if(t&&!Fge(t))throw new Error(`Unknownloglevel'${t}'.Acceptablevalues:${BV.join(",")}`);wT=t;let e=[];for(let r of kge)Lge(r)&&e.push(r.namespace);bw.enable(e.join(","))}o(Pge,"setLogLevel");function Pat(){return wT}o(Pat,"getLogLevel");var Rge={verbose:400,info:300,warning:200,error:100};function Oat(t){let e=IT.extend(t);return Oge(IT,e),{error:CT(e,"error"),warning:CT(e,"warning"),info:CT(e,"info"),verbose:CT(e,"verbose")}}o(Oat,"createClientLogger");function Oge(t,e){e.log=(...r)=>{t.log(...r)}}o(Oge,"patchLogMethod");function CT(t,e){let r=Object.assign(t.extend(e),{level:e});if(Oge(t,r),Lge(r)){let n=bw.disable();bw.enable(n+","+r.namespace)}return kge.add(r),r}o(CT,"createLogger");function Lge(t){return!!(wT&&Rge[t.level]<=Rge[wT])}o(Lge,"shouldEnable");function Fge(t){return BV.includes(t)}o(Fge,"isAzureLogLevel");$g.AzureLogger=IT;$g.createClientLogger=Oat;$g.getLogLevel=Pat;$g.setLogLevel=Pge});var NV=A(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});var Jg=new WeakMap,ST=new WeakMap,ww=class t{static{o(this,"AbortSignal")}constructor(){this.onabort=null,Jg.set(this,[]),ST.set(this,!1)}get aborted(){if(!ST.has(this))throw new TypeError("Expected `this` to be an instance of AbortSignal.");return ST.get(this)}static get none(){return new t}addEventListener(e,r){if(!Jg.has(this))throw new TypeError("Expected `this` to be an instance of AbortSignal.");Jg.get(this).push(r)}removeEventListener(e,r){if(!Jg.has(this))throw new TypeError("Expected `this` to be an instance of AbortSignal.");let n=Jg.get(this),i=n.indexOf(r);i>-
Seehttps://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}o(LAt,"logUnexpecedPropertyAccessOnce");function FAt(){Object.keys(rD).forEach(function(t){delete rD[t]})}o(FAt,"resetLoggedProperties")});var iD=A(Il=>{"use strict";Il.__esModule=!0;Il.HandlebarsEnvironment=Zj;function I0e(t){return t&&t.__esModule?t:{default:t}}o(I0e,"_interopRequireDefault");var Hp=ts(),MAt=Eo(),Kj=I0e(MAt),UAt=$j(),qAt=E0e(),GAt=Wj(),nD=I0e(GAt),HAt=Yj(),VAt="4.7.9";Il.VERSION=VAt;var zAt=8;Il.COMPILER_REVISION=zAt;var jAt=7;Il.LAST_COMPATIBLE_COMPILER_REVISION=jAt;var $At={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};Il.REVISION_CHANGES=$At;var Xj="[object Object]";function Zj(t,e,r){this.helpers=t||{},this.partials=e||{},this.decorators=r||{},UAt.registerDefaultHelpers(this),qAt.registerDefaultDecorators(this)}o(Zj,"HandlebarsEnvironment");Zj.prototype={constructor:Zj,logger:nD.default,log:nD.default.log,registerHelper:o(function(e,r){if(Hp.toString.call(e)===Xj){if(r)throw new Kj.default("Arg not supported with multiple helpers");Hp.extend(this.helpers,e)}else this.helpers[e]=r},"registerHelper"),unregisterHelper:o(function(e){delete this.helpers[e]},"unregisterHelper"),registerPartial:o(function(e,r){if(Hp.toString.call(e)===Xj)Hp.extend(this.partials,e);else{if(typeof r>"u")throw new Kj.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=r}},"registerPartial"),unregisterPartial:o(function(e){delete this.partials[e]},"unregisterPartial"),registerDecorator:o(function(e,r){if(Hp.toString.call(e)===Xj){if(r)throw new Kj.default("Arg not supported with multiple decorators");Hp.extend(this.decorators,e)}else this.decorators[e]=r},"registerDecorator"),unregisterDecorator:o(function(e){delete this.decorators[e]},"unregisterDecorator"),resetLoggedPropertyAccesses:o(function(){HAt.resetLoggedProperties()},"resetLoggedPropertyAccesses")};var JAt=nD.default.log;Il.log=JAt;Il.createFrame=Hp.createFrame;Il.logger=nD.default});var B0e=A((sD,S0e)=>{"use strict";sD.__esModule=!0;function e$(t){this.string=t}o(e$,"SafeString");e$.prototype.toString=e$.prototype.toHTML=function(){return""+this.string};sD.default=e$;S0e.exports=sD.default});var x0e=A(t$=>{"use strict";t$.__esModule=!0;t$.wrapHelper=WAt;function WAt(t,e){if(typeof t!="function")return t;var r=o(function(){var i=arguments[arguments.length-1];return arguments[arguments.length-1]=e(i),t.apply(this,arguments)},"wrapper");return r}o(WAt,"wrapHelper")});var D0e=A(vf=>{"use strict";vf.__esModule=!0;vf.checkRevision=tmt;vf.template=rmt;vf.wrapProgram=oD;vf.resolvePartial=nmt;vf.invokePartial=imt;vf.noop=R0e;function YAt(t){return t&&t.__esModule?t:{default:t}}o(YAt,"_interopRequireDefault");function KAt(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}o(KAt,"_interopRequireWildcard");var XAt=ts(),by=KAt(XAt),ZAt=Eo(),Ku=YAt(ZAt),Xu=iD(),v0e=$j(),emt=x0e(),N0e=Yj();function tmt(t){var e=t&&t[0]||1,r=Xu.COMPILER_REVISION;if(!(e>=Xu.LAST_COMPATIBLE_COMPILER_REVISION&&e<=Xu.COMPILER_REVISION))if(e<Xu.LAST_COMPATIBLE_COMPILER_REVISION){var n=Xu.REVISION_CHANGES[r],i=Xu.REVISION_CHANGES[e];throw new Ku.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+i+").")}else throw new Ku.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}o(tmt,"checkRevision");function rmt(t,e){if(!e)throw new Ku.default("No environment passed to template");if(!t||!t.main)throw new Ku.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var r=t.compiler&&t.compiler[0]===7;function n(a,c,l){l.hash&&(c=by.extend({},c,l.hash),l.ids&&(l.ids[0]=!0)),a=e.VM.res
Expecting`+ae.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ae="Parse error on line "+(f+1)+": Unexpected "+(B==1?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ae,{text:this.lexer.match,token:this.terminals_[B]||B,line:this.lexer.yylineno,loc:E,expected:ae})}}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+B);switch(v[0]){case 1:a.push(B),c.push(this.lexer.yytext),l.push(this.lexer.yylloc),a.push(v[1]),B=null,Q?(B=Q,Q=null):(h=this.lexer.yyleng,d=this.lexer.yytext,f=this.lexer.yylineno,E=this.lexer.yylloc,p>0&&p--);break;case 2:if(W=this.productions_[v[1]][1],G.$=c[c.length-W],G._$={first_line:l[l.length-(W||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(W||1)].first_column,last_column:l[l.length-1].last_column},y&&(G._$.range=[l[l.length-(W||1)].range[0],l[l.length-1].range[1]]),T=this.performAction.call(G,d,h,f,this.yy,v[1],c,l),typeof T<"u")return T;W&&(a=a.slice(0,-1*W*2),c=c.slice(0,-1*W),l=l.slice(0,-1*W)),a.push(this.productions_[v[1]][0]),c.push(G.$),l.push(G._$),ee=u[a[a.length-2]][a[a.length-1]],a.push(ee);break;case 3:return!0}}return!0},"parse")},e=(function(){var n={EOF:1,parseError:o(function(s,a){if(this.yy.parser)this.yy.parser.parseError(s,a);else throw new Error(s)},"parseError"),setInput:o(function(s){return this._input=s,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var a=s.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var a=s.length,c=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a-1),this.offset-=a;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===l.length?this.yylloc.first_column:0)+l[l.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-a]),this},"unput"),more:o(function(){return this._more=!0,this},"more"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),a=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
`+a+"^"},"showPosition"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,a,c,l,u,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),h=0;h<f.length&&(c=this._input.match(this.rules[f[h]]),!(c&&(!a||c[0].length>a[0].length)&&(a=c,l=h,!this.options.flex)));h++);return a?(d=a[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],s=this.performAction.call(this,this.yy,this,f[l],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`.Unrecognizedtext.
`)}};xQ.RpcError=e6});var r6=A(NQ=>{"use strict";Object.defineProperty(NQ,"__esModule",{value:!0});NQ.mergeRpcOptions=void 0;var USe=ar();function VCt(t,e){if(!e)return t;let r={};vQ(t,r),vQ(e,r);for(let n of Object.keys(e)){let i=e[n];switch(n){case"jsonOptions":r.jsonOptions=USe.mergeJsonOptions(t.jsonOptions,r.jsonOptions);break;case"binaryOptions":r.binaryOptions=USe.mergeBinaryOptions(t.binaryOptions,r.binaryOptions);break;case"meta":r.meta={},vQ(t.meta,r.meta),vQ(e.meta,r.meta);break;case"interceptors":r.interceptors=t.interceptors?t.interceptors.concat(i):i.concat();break}}return r}o(VCt,"mergeRpcOptions");NQ.mergeRpcOptions=VCt;function vQ(t,e){if(!t)return;let r=e;for(let[n,i]of Object.entries(t))i instanceof Date?r[n]=new Date(i.getTime()):Array.isArray(i)?r[n]=i.concat():r[n]=i}o(vQ,"copy")});var i6=A(eA=>{"use strict";Object.defineProperty(eA,"__esModule",{value:!0});eA.Deferred=eA.DeferredState=void 0;var Dl;(function(t){t[t.PENDING=0]="PENDING",t[t.REJECTED=1]="REJECTED",t[t.RESOLVED=2]="RESOLVED"})(Dl=eA.DeferredState||(eA.DeferredState={}));var n6=class{static{o(this,"Deferred")}constructor(e=!0){this._state=Dl.PENDING,this._promise=new Promise((r,n)=>{this._resolve=r,this._reject=n}),e&&this._promise.catch(r=>{})}get state(){return this._state}get promise(){return this._promise}resolve(e){if(this.state!==Dl.PENDING)throw new Error(`cannotresolve${Dl[this.state].toLowerCase()}`);this._resolve(e),this._state=Dl.RESOLVED}reject(e){if(this.state!==Dl.PENDING)throw new Error(`cannotreject${Dl[this.state].toLowerCase()}`);this._reject(e),this._state=Dl.REJECTED}resolvePending(e){this._state===Dl.PENDING&&this.resolve(e)}rejectPending(e){this._state===Dl.PENDING&&this.reject(e)}};eA.Deferred=n6});var o6=A(_Q=>{"use strict";Object.defineProperty(_Q,"__esModule",{value:!0});_Q.RpcOutputStreamController=void 0;var qSe=i6(),tA=ar(),s6=class{static{o(this,"RpcOutputStreamController")}constructor(){this._lis={nxt:[],msg:[],err:[],cmp:[]},this._closed=!1}onNext(e){return this.addLis(e,this._lis.nxt)}onMessage(e){return this.addLis(e,this._lis.msg)}onError(e){return this.addLis(e,this._lis.err)}onComplete(e){return this.addLis(e,this._lis.cmp)}addLis(e,r){return r.push(e),()=>{let n=r.indexOf(e);n>=0&&r.splice(n,1)}}clearLis(){for(let e of Object.values(this._lis))e.splice(0,e.length)}get closed(){return this._closed!==!1}notifyNext(e,r,n){tA.assert((e?1:0)+(r?1:0)+(n?1:0)<=1,"only one emission at a time"),e&&this.notifyMessage(e),r&&this.notifyError(r),n&&this.notifyComplete()}notifyMessage(e){tA.assert(!this.closed,"stream is closed"),this.pushIt({value:e,done:!1}),this._lis.msg.forEach(r=>r(e)),this._lis.nxt.forEach(r=>r(e,void 0,!1))}notifyError(e){tA.assert(!this.closed,"stream is closed"),this._closed=e,this.pushIt(e),this._lis.err.forEach(r=>r(e)),this._lis.nxt.forEach(r=>r(void 0,e,!1)),this.clearLis()}notifyComplete(){tA.assert(!this.closed,"stream is closed"),this._closed=!0,this.pushIt({value:null,done:!0}),this._lis.cmp.forEach(e=>e()),this._lis.nxt.forEach(e=>e(void 0,void 0,!0)),this.clearLis()}[Symbol.asyncIterator](){return this._itState||(this._itState={q:[]}),this._closed===!0?this.pushIt({value:null,done:!0}):this._closed!==!1&&this.pushIt(this._closed),{next:o(()=>{let e=this._itState;tA.assert(e,"bad state"),tA.assert(!e.p,"iterator contract broken");let r=e.q.shift();return r?"value"in r?Promise.resolve(r):Promise.reject(r):(e.p=new qSe.Deferred,e.p.promise)},"next")}}pushIt(e){let r=this._itState;if(r)if(r.p){let n=r.p;tA.assert(n.state==qSe.DeferredState.PENDING,"iterator contract broken"),"value"in e?n.resolve(e):n.reject(e),delete r.p}else r.q.push(e)}};_Q.RpcOutputStreamController=s6});var c6=A($y=>{"use strict";var zCt=$y&&$y.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return o(i,"adopt"),new(r||(r=Promise))(function(s,a){function c(d){try{u(n.next(d))}catch(f){a(f)}}o(c,"fulfilled");function l(d){try{u(n.throw(d))}catch(f){a(f)}}o(l,"rejected");function u(d){d.done?s(d.value):i(d.value).then(c,l)}o(u,"step"),u((n=n.apply(t,e||[])).next())
globstarwhile`,e,f,r,h,p),this.matchOne(e.slice(f),r.slice(h),n))return this.debug("globstar found match!",f,c,p),!0;if(p==="."||p===".."||!i.dot&&p.charAt(0)==="."){this.debug("dot detected!",e,f,r,h);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(n&&(this.debug(`
`,p4t=/\u2014 (\S+) (\S+)\n/g;function A4t(t,e){let r=t.inclusionProof,n=BX.fromString(r.checkpoint.envelope),i=FO.fromString(n.note);if(!m4t(n,e))throw new GB.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid checkpoint signature"});return i}o(A4t,"verifyCheckpoint");function m4t(t,e){let r=Buffer.from(t.note,"utf-8");return t.signatures.some(n=>{let i=e.find(s=>hMe.crypto.bufferEqual(s.logID.subarray(0,4),n.keyHint)&&s.baseURL.match(n.name));return i?hMe.crypto.verify(r,i.publicKey,n.signature):!1})}o(m4t,"verifySignedNote");var BX=class t{static{o(this,"SignedNote")}note;signatures;constructor(e,r){this.note=e,this.signatures=r}static fromString(e){if(!e.includes(SX))throw new GB.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"missing checkpoint separator"});let r=e.indexOf(SX),n=e.slice(0,r+1),s=e.slice(r+SX.length).matchAll(p4t),a=Array.from(s,c=>{let[,l,u]=c,d=Buffer.from(u,"base64");if(d.length<5)throw new GB.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"malformed checkpoint signature"});return{name:l,keyHint:d.subarray(0,4),signature:d.subarray(4)}});if(a.length===0)throw new GB.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"no signatures found in checkpoint"});return new t(n,a)}},FO=class t{static{o(this,"LogCheckpoint")}origin;logSize;logHash;rest;constructor(e,r,n,i){this.origin=e,this.logSize=r,this.logHash=n,this.rest=i}static fromString(e){let r=e.trimEnd().split(`
`);if(r.length<3)throw new GB.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"too few lines in checkpoint header"});let n=r[0],i=BigInt(r[1]),s=Buffer.from(r[2],"base64"),a=r.slice(3);return new t(n,i,s,a)}};HB.LogCheckpoint=FO});var AMe=A(_X=>{"use strict";Object.defineProperty(_X,"__esModule",{value:!0});_X.verifyMerkleInclusion=E4t;var NX=Cc(),xX=Mi(),g4t=Buffer.from([0]),y4t=Buffer.from([1]);function E4t(t,e){let r=t.inclusionProof,n=BigInt(r.logIndex),i=BigInt(e.logSize);if(n<0n||n>=i)throw new xX.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalidindex:${n}`});let{inner:s,border:a}=C4t(n,i);if(r.hashes.length!==s+a)throw new xX.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid hash count"});let c=r.hashes.slice(0,s),l=r.hashes.slice(s),u=x4t(t.canonicalizedBody),d=w4t(b4t(u,c,n),l);if(!NX.crypto.bufferEqual(d,e.logHash))throw new xX.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}o(E4t,"verifyMerkleInclusion");function C4t(t,e){let r=I4t(t,e),n=S4t(t>>BigInt(r));return{inner:r,border:n}}o(C4t,"decompInclProof");function b4t(t,e,r){return e.reduce((n,i,s)=>r>>BigInt(s)&BigInt(1)?vX(i,n):vX(n,i),t)}o(b4t,"chainInner");function w4t(t,e){return e.reduce((r,n)=>vX(n,r),t)}o(w4t,"chainBorderRight");function I4t(t,e){return B4t(t^e-BigInt(1))}o(I4t,"innerProofSize");function S4t(t){return t.toString(2).split("1").length-1}o(S4t,"onesCount");function B4t(t){return t===0n?0:t.toString(2).length}o(B4t,"bitLength");function vX(t,e){return NX.crypto.digest("sha256",y4t,t,e)}o(vX,"hashChildren");function x4t(t){return NX.crypto.digest("sha256",g4t,t)}o(x4t,"hashLeaf")});var gMe=A(RX=>{"use strict";Object.defineProperty(RX,"__esModule",{value:!0});RX.verifyTLogSET=_4t;var mMe=Cc(),v4t=Mi(),N4t=RC();function _4t(t,e){if(!(0,N4t.filterTLogAuthorities)(e,{logID:t.logId.keyId,targetDate:new Date(Number(t.integratedTime)*1e3)}).some(i=>{let s=R4t(t),a=Buffer.from(mMe.json.canonicalize(s),"utf8"),c=t.inclusionPromise.signedEntryTimestamp;return mMe.crypto.verify(a,i.publicKey,c)}))throw new v4t.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}o(_4t,"verifyTLogSET");function R4t(t){let{integratedTime:e,logIndex:r,logId:n,canonicalizedBody:i}=t;return{body:i.toString("base64"),integratedTime:Number(e),logIndex:Number(r),logID:n.keyId.toString("hex")}}o(R4t,"toVerificationPayload")});var EMe=A(MO=>{"use strict";Object.defineProperty(MO,"__esModule",{value:!0});MO.verifyTLogBody=P4t;MO.verifyTLogInclusion=O4t;var yMe=lMe(),QX=Mi(),TX=uMe(),DX=dMe(),T4t=fMe(),D4t=pMe(),Q4t=AMe(),k4t=gMe();function P4t(t,e){let{kind:r,version:n}=t.kindVersion,i=JSON.parse(t.canonicalizedBody.toString("utf8"));if(r!==i.kind||n!==i.apiVersion)throw new QX.VerificationError({code:"TLOG_BODY_ERROR",message:`kind/versionmismatch-expected:${r}/${n},received:${i.kind}/${i.apiVersion}`});switch(r){case"dsse":if(n==TX.DSSE_API_VERSION_V1)return(0,TX.verifyDSSETLogBody)(i,e);{let s=yMe.Entry.fromJSON(i);return(0,TX.verifyDSSETLogBodyV2)(s,e)}case"intoto":return(0,T4t.verifyIntotoTLogBody)(i,e);case"hashedrekord":if(n==DX.HASHEDREKORD_API_VERSION_V1)return(0,DX.verifyHashedRekordTLogBody)(i,e);{let s=yMe.Entry.fromJSON(i);return(0,DX.verifyHashedRekordTLogBodyV2)(s,e)}default:throw new QX.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupportedkind:${r}`})}}o(P4t,"verifyTLogBody");function O4t(t,e){let r=!1;if(L4t(t)&&((0,k4t.verifyTLogSET)(t,e),r=!0),F4t(t)){let n=(0,D4t.verifyCheckpoint)(t,e);(0,Q4t.verifyMerkleInclusion)(t,n),r=!0}if(!r)throw new QX.VerificationError({code:"TLOG_MISSING_INCLUSION_ERROR",message:"inclusion could not be verified"})}o(O4t,"verifyTLogInclusion");function L4t(t){return t.inclusionPromise!==void 0}o(L4t,"isTLogEntryWithInclusionPromise");function F4t(t){return t.inclusionProof!==void 0}o(F4t,"isTLogEntryWithInclusionProof")});var SMe=A(UO=>{"use strict";Object.defineProperty(UO,"__esModule",{value:!0});UO.Verifier=void 0;var M4t=require("util"),
Supportbooleaninputlist:\`true | True | TRUE | false | False | FALSE\``)}o(tp,"getBooleanInput");functionSN(t,e){if(process.env.GITHUB_OUTPUT||"")returnIx("OUTPUT",hL(t,e));process.stdout.write(rq.EOL),hu("set-output",{name:t},fu(e))}o(SN,"setOutput");functionBN(t){process.exitCode=tq.Failure,lg(t)}o(BN,"setFailed");functionrp(){returnprocess.env.RUNNER_DEBUG==="1"}o(rp,"isDebug");functionD(t){hu("debug",{},t)}o(D,"debug");functionlg(t,e={}){hu("error",uL(e),tinstanceofError?t.toString():t)}o(lg,"error");functionat(t,e={}){hu("warning",uL(e),tinstanceofError?t.toString():t)}o(at,"warning");functionL(t){process.stdout.write(t+rq.EOL)}o(L,"info");functiongWe(t){fL("group",t)}o(gWe,"startGroup");functionyWe(){fL("endgroup")}o(yWe,"endGroup");functionQr(t,e){returnmWe(this,void0,void0,function*(){gWe(t);letr;try{r=yielde()}finally{yWe()}returnr})}o(Qr,"group");functionza(t,e){if(process.env.GITHUB_STATE||"")returnIx("STATE",hL(t,e));hu("save-state",{name:t},fu(e))}o(za,"saveState");functionvce(t){returnprocess.env[`STATE_${t}`]||""}o(vce,"getState");var_2=R(require("fs"),1),pj=R(require("os"),1),Aj=R(require("path"),1);var_ce=R(require("os"),1);functionn0(t){returnt==null?"":typeoft=="string"||tinstanceofString?t:JSON.stringify(t)}o(n0,"toCommandValue");functionRce(t,e,r){letn=newnq(t,e,r);process.stdout.write(n.toString()+_ce.EOL)}o(Rce,"issueCommand");varNce="::",nq=class{static{o(this,"Command")}constructor(e,r,n){e||(e="missing.command"),this.command=e,this.properties=r,this.message=n}toString(){lete=Nce+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";letr=!0;for(letninthis.properties)if(this.properties.hasOwnProperty(n)){leti=this.properties[n];i&&(r?r=!1:e+=",",e+=`${n}=${CWe(i)}`)}}returne+=`${Nce}${EWe(this.message)}`,e}};functionEWe(t){returnn0(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}o(EWe,"escapeData");functionCWe(t){returnn0(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}o(CWe,"escapeProperty");varkce=R(require("os"),1);varDce=require("os"),i0=require("fs");variq=function(t,e,r,n){functioni(s){returnsinstanceofr?s:newr(function(a){a(s)})}returno(i,"adopt"),new(r||(r=Promise))(function(s,a){functionc(d){try{u(n.next(d))}catch(f){a(f)}}o(c,"fulfilled");functionl(d){try{u(n.throw(d))}catch(f){a(f)}}o(l,"rejected");functionu(d){d.done?s(d.value):i(d.value).then(c,l)}o(u,"step"),u((n=n.apply(t,e||[])).next())})},{access:bWe,appendFile:wWe,writeFile:IWe}=i0.promises,Tce="GITHUB_STEP_SUMMARY";varsq=class{static{o(this,"Summary")}constructor(){this._buffer=""}filePath(){returniq(this,void0,void0,function*(){if(this._filePath)returnthis._filePath;lete=process.env[Tce];if(!e)thrownewError(`Unable to find environment variable for $${Tce}. Check if your runtime environment supports job summaries.`);try{yieldbWe(e,i0.constants.R_OK|i0.constants.W_OK)}catch{thrownewError(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}returnthis._filePath=e,this._filePath})}wrap(e,r,n={}){leti=Object.entries(n).map(([s,a])=>`${s}="${a}"`).join("");returnr?`<${e}${i}>${r}</${e}>`:`<${e}${i}>`}write(e){returniq(this,void0,void0,function*(){letr=!!e?.overwrite,n=yieldthis.filePath();returnyield(r?IWe:wWe)(n,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){returniq(this,void0,void0,function*(){returnthis.emptyBuffer().write({overwrite:!0})})}stringify(){returnthis._buffer}isEmptyBuffer(){returnthis._buffer.length===0}emptyBuffer(){returnthis._buffer="",this}addRaw(e,r=!1){returnthis._buffer+=e,r?this.addEOL():this}addEOL(){returnthis.addRaw(Dce.EOL)}addCodeBlock(e,r){letn=Object.assign({},r&&{lang:r}),i=this.wrap("pre",this.wrap("code",e),n);returnthis.addRaw(i).addEOL()}addList(e,r=!1){letn=r?"ol":"ul",i=e.map(a=>this.wrap("li",a)).join(""),s=this.wrap(n,i);returnthis.addRaw(s).addEOL()}addTable(e){letr=e.map(i=>{lets=i.map(a=>{if(typeofa=="string")returnthis.wrap("td",a);let
${Let.sanitize({...this,request:{...this.request,agent:n},response:this.response})}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};function A_(t){return t instanceof Yi?!0:lp(t)&&t.name==="RestError"}o(A_,"isRestError");function ws(t,e){return Buffer.from(t,e)}o(ws,"stringToUint8Array");var m_=R(require("node:http"),1),g_=R(require("node:https"),1),R3=R(require("node:zlib"),1),vhe=require("node:stream");var $o=T0("ts-http-runtime");var Fet={};function D0(t){return t&&typeof t.pipe=="function"}o(D0,"isReadableStream");function xhe(t){return t.readable===!1?Promise.resolve():new Promise(e=>{let r=o(()=>{e(),t.removeListener("close",r),t.removeListener("end",r),t.removeListener("error",r)},"handler");t.on("close",r),t.on("end",r),t.on("error",r)})}o(xhe,"isStreamComplete");function Nhe(t){return t&&typeof t.byteLength=="number"}o(Nhe,"isArrayBuffer");var y_=class extends vhe.Transform{static{o(this,"ReportTransform")}loadedBytes=0;progressCallback;_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(i){n(i)}}constructor(e){super(),this.progressCallback=e}},T3=class{static{o(this,"NodeHttpClient")}cachedHttpAgent;cachedHttpsAgents=new WeakMap;async sendRequest(e){let r=new AbortController,n;if(e.abortSignal){if(e.abortSignal.aborted)throw new Gc("The operation was aborted. Request has already been canceled.");n=o(u=>{u.type==="abort"&&r.abort()},"abortListener"),e.abortSignal.addEventListener("abort",n)}let i;e.timeout>0&&(i=setTimeout(()=>{let u=new Wa;$o.info(`requestto'${u.sanitizeUrl(e.url)}'timedout.canceling...`),r.abort()},e.timeout));let s=e.headers.get("Accept-Encoding"),a=s?.includes("gzip")||s?.includes("deflate"),c=typeof e.body=="function"?e.body():e.body;if(c&&!e.headers.has("Content-Length")){let u=Get(c);u!==null&&e.headers.set("Content-Length",u)}let l;try{if(c&&e.onUploadProgress){let m=e.onUploadProgress,g=new y_(m);g.on("error",E=>{$o.error("Error in upload progress",E)}),D0(c)?c.pipe(g):g.end(c),c=g}let u=await this.makeRequest(e,r,c);i!==void 0&&clearTimeout(i);let d=Met(u),h={status:u.statusCode??0,headers:d,request:e};if(e.method==="HEAD")return u.resume(),h;l=a?Uet(u,d):u;let p=e.onDownloadProgress;if(p){let m=new y_(p);m.on("error",g=>{$o.error("Error in download progress",g)}),l.pipe(m),l=m}return e.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY)||e.streamResponseStatusCodes?.has(h.status)?h.readableStreamBody=l:h.bodyAsText=await qet(l),h}finally{if(e.abortSignal&&n){let u=Promise.resolve();D0(c)&&(u=xhe(c));let d=Promise.resolve();D0(l)&&(d=xhe(l)),Promise.all([u,d]).then(()=>{n&&e.abortSignal?.removeEventListener("abort",n)}).catch(f=>{$o.warning("Error when cleaning up abortListener on httpRequest",f)})}}}makeRequest(e,r,n){let i=new URL(e.url),s=i.protocol!=="https:";if(s&&!e.allowInsecureConnection)throw new Error(`Cannotconnectto${e.url}whileallowInsecureConnectionisfalse.`);let c={agent:e.agent??this.getOrCreateAgent(e,s),hostname:i.hostname,path:`${i.pathname}${i.search}`,port:i.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0}),...e.requestOverrides};return new Promise((l,u)=>{let d=s?m_.default.request(c,l):g_.default.request(c,l);d.once("error",f=>{u(new Yi(f.message,{code:f.code??Yi.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let f=new Gc("The operation was aborted. Rejecting from abort signal callback while making request.");d.destroy(f),u(f)}),n&&D0(n)?n.pipe(d):n?typeof n=="string"||Buffer.isBuffer(n)?d.end(n):Nhe(n)?d.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):($o.error("Unrecognized body type",n),u(new Yi("Unrecognized body type"))):d.end()})}getOrCreateAgent(e,r){let n=e.disableKeepAlive;if(r)return n?m_.default.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new m_.default.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(n&&!e.tlsSettings)return g_.default.globalAgent;let i=e.tlsSettings??Fet,s=this.cachedHttpsAgents.get(i);return s&&s.options.keepAlive===!n||($o.info("No cached TLS Agent exi
`;return e}o(Ert,"encodeHeaders");function Crt(t){return t instanceof Uint8Array?t.byteLength:G_(t)?t.size===-1?void 0:t.size:void 0}o(Crt,"getLength");function brt(t){let e=0;for(let r of t){let n=Crt(r);if(n===void 0)return;e+=n}return e}o(brt,"getTotalLength");async function wrt(t,e,r){let n=[ws(`--${r}`,"utf-8"),...e.flatMap(s=>[ws(`\r
`,"utf-8")],i=brt(n);i&&t.headers.set("Content-Length",i),t.body=await Dpe(n)}o(wrt,"buildRequestBody");var P0="multipartPolicy",Irt=70,Srt=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function Brt(t){if(t.length>Irt)throw new Error(`Multipartboundary"${t}"exceedsmaximumlengthof70characters`);if(Array.from(t).some(e=>!Srt.has(e)))throw new Error(`Multipartboundary"${t}"containsinvalidcharacters`)}o(Brt,"assertValidBoundary");function V_(){return{name:P0,async sendRequest(t,e){if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let r=t.multipartBody.boundary,n=t.headers.get("Content-Type")??"multipart/mixed",i=n.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!i)throw new Error(`Gotmultipartrequestbody,butcontent-typeheaderwasnotmultipart:${n}`);let[,s,a]=i;if(a&&r&&a!==r)throw new Error(`Multipartboundarywasspecifiedas${a}intheheader,butgot${r}intherequestbody`);return r??=a,r?Brt(r):r=yrt(),t.headers.set("Content-Type",`${s};boundary=${r}`),await wrt(t,t.multipartBody.parts,r),t.multipartBody=void 0,e(t)}}}o(V_,"multipartPolicy");function z_(){return p_()}o(z_,"createEmptyPipeline");var Qpe=d_({logLevelEnvVarName:"AZURE_LOG_LEVEL",namespace:"azure"}),FZt=Qpe.logger;function zc(t){return Qpe.createClientLogger(t)}o(zc,"createClientLogger");var jc=zc("core-rest-pipeline");function Y3(t={}){return C_({logger:jc.info,...t})}o(Y3,"logPolicy");var K3=b_;function X3(t={}){return w_(t)}o(X3,"redirectPolicy");var j_=R(require("node:os"),1),$_=R(require("node:process"),1);function kpe(){return"User-Agent"}o(kpe,"getHeaderName");async function Ppe(t){if($_.default&&$_.default.versions){let e=`${j_.default.type()}${j_.default.release()};${j_.default.arch()}`,r=$_.default.versions;r.bun?t.set("Bun",`${r.bun}(${e})`):r.deno?t.set("Deno",`${r.deno}(${e})`):r.node&&t.set("Node",`${r.node}(${e})`)}}o(Ppe,"setPlatformSpecificData");var J_="1.22.2";function Qrt(t){let e=[];for(let[r,n]of t){let i=n?`${r}/${n}`:r;e.push(i)}return e.join(" ")}o(Qrt,"getUserAgentString");function Ope(){return kpe()}o(Ope,"getUserAgentHeaderName");async function W_(t){let e=new Map;e.set("core-rest-pipeline",J_),await Ppe(e);let r=Qrt(e);return t?`${t}${r}`:r}o(W_,"getUserAgentValue");var Lpe=Ope(),Fpe="userAgentPolicy";function Z3(t={}){let e=W_(t.userAgentPrefix);return{name:Fpe,async sendRequest(r,n){return r.headers.has(Lpe)||r.headers.set(Lpe,await e),n(r)}}}o(Z3,"userAgentPolicy");var lo=class extends Error{static{o(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function eG(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:i}=e??{};return new Promise((s,a)=>{function c(){a(new lo(i??"The operation was aborted."))}o(c,"rejectOnAbort");function l(){n?.removeEventListener("abort",u)}o(l,"removeListeners");function u(){r?.(),l(),c()}if(o(u,"onAbort"),n?.aborted)return c();try{t(d=>{l(),s(d)},d=>{l(),a(d)})}catch(d){a(d)}n?.addEventListener("abort",u)})}o(eG,"createAbortablePromise");var Frt="The delay was aborted.";function O0(t,e){let r,{abortSignal:n,abortErrorMsg:i}=e??{};return eG(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:o(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:i??Frt})}o(O0,"delay");function df(t){if(lp(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknownerror${e}`}}o(df,"getErrorMessage");function Mpe(t){return lp(t)}o(Mpe,"isError");function Rg(){return cp()}o(Rg,"randomUUID");var Ot=fp;var Upe=Symbol("rawContent");function rG(t){return typeof t[Upe]=="function"}o(rG,"hasRawContent");function qpe(t){return rG(t)?t[Upe]():t}o(qpe,"getRawContent");var Y_=P0;function nG(){let t=V_();return{name:Y_,sendRequest:o(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)rG(n.body)&&(n.body=qpe(n.body));return t.sendRequest(e,r)},"sendRequest")}}o(nG,"multipartPolicy");var iG=I_;function sG(){return S_()}o(sG,"decompressResponsePolicy");fun
`&&t[s]!=="\r";s++)l+=t[s];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),s--),!cit(l)){let f;return l.trim().length===0?f="Invalid space after '<'.":f="Tag '"+l+"' is an invalid name.",Zr("InvalidTag",f,Ki(t,s))}let u=nit(t,s);if(u===!1)return Zr("InvalidAttr","Attributes for '"+l+"' have open quote.",Ki(t,s));let d=u.value;if(s=u.index,d[d.length-1]==="/"){let f=s-d.length;d=d.substring(0,d.length-1);let h=xAe(d,e);if(h===!0)n=!0;else return Zr(h.err.code,h.err.msg,Ki(t,f+h.err.line))}else if(c)if(u.tagClosed){if(d.trim().length>0)return Zr("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Ki(t,a));if(r.length===0)return Zr("InvalidTag","Closing tag '"+l+"' has not been opened.",Ki(t,a));{let f=r.pop();if(l!==f.tagName){let h=Ki(t,f.tagStartPos);return Zr("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+h.line+", col "+h.col+") instead of closing tag '"+l+"'.",Ki(t,a))}r.length==0&&(i=!0)}}else return Zr("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Ki(t,s));else{let f=xAe(d,e);if(f!==!0)return Zr(f.err.code,f.err.msg,Ki(t,s-d.length+f.err.line));if(i===!0)return Zr("InvalidXml","Multiple possible root nodes found.",Ki(t,s));e.unpairedTags.indexOf(l)!==-1||r.push({tagName:l,tagStartPos:a}),n=!0}for(s++;s<t.length;s++)if(t[s]==="<")if(t[s+1]==="!"){s++,s=BAe(t,s);continue}else if(t[s+1]==="?"){if(s=SAe(t,++s),s.err)return s}else break;else if(t[s]==="&"){let f=oit(t,s);if(f==-1)return Zr("InvalidChar","char '&' is not expected.",Ki(t,s));s=f}else if(i===!0&&!IAe(t[s]))return Zr("InvalidXml","Extra text at the end",Ki(t,s));t[s]==="<"&&s--}}else{if(IAe(t[s]))continue;return Zr("InvalidChar","char '"+t[s]+"' is not expected.",Ki(t,s))}if(n){if(r.length==1)return Zr("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",Ki(t,r[0].tagStartPos));if(r.length>0)return Zr("InvalidXml","Invalid '"+JSON.stringify(r.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Zr("InvalidXml","Start tag expected.",1);return!0}o(lR,"validate");function IAe(t){return t===" "||t===" "||t===`
`||t==="\r"}o(IAe,"isWhiteSpace");function SAe(t,e){let r=e;for(;e<t.length;e++)if(t[e]=="?"||t[e]==" "){let n=t.substr(r,e-r);if(e>5&&n==="xml")return Zr("InvalidXml","XML declaration allowed only at the start of the document.",Ki(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}o(SAe,"readPI");function BAe(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let r=1;for(e+=8;e<t.length;e++)if(t[e]==="<")r++;else if(t[e]===">"&&(r--,r===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}o(BAe,"readCommentAndCDATA");var tit='"',rit="'";function nit(t,e){let r="",n="",i=!1;for(;e<t.length;e++){if(t[e]===tit||t[e]===rit)n===""?n=t[e]:n!==t[e]||(n="");else if(t[e]===">"&&n===""){i=!0;break}r+=t[e]}return n!==""?!1:{value:r,index:e,tagClosed:i}}o(nit,"readAttributeStr");var iit=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function xAe(t,e){let r=aR(t,iit),n={};for(let i=0;i<r.length;i++){if(r[i][1].length===0)return Zr("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",J0(r[i]));if(r[i][3]!==void 0&&r[i][4]===void 0)return Zr("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",J0(r[i]));if(r[i][3]===void 0&&!e.allowBooleanAttributes)return Zr("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",J0(r[i]));let s=r[i][2];if(!ait(s))return Zr("InvalidAttr","Attribute '"+s+"' is an invalid name.",J0(r[i]));if(!Object.prototype.hasOwnProperty.call(n,s))n[s]=1;else return Zr("InvalidAttr","Attribute '"+s+"' is repeated.",J0(r[i]))}return!0}o(xAe,"validateAttributeString");function sit(t,e){let r=/\d/;for(t[e]==="x"&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(r))break}return-1}o(sit,"validateNumberAmpersand");function oit(t,e){if(e++,t[e]===";")return-1;if(t[e]==="#")return e++,sit(t,e);let r=0;for(;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(t[e]===";")break;return-1}return e}o(oit,"validateAmpersand");function Zr(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}o(Zr,"getErrorObject");function ait(t){return RG(t)}o(ait,"validateAttrName");function cit(t){return RG(t)}o(cit,"validateTagName");function Ki(t,e){let r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}o(Ki,"getLineNumberForPosition");function J0(t){return t.startIndex+t[1].length}o(J0,"getPositionFromMatch");var vAe={amp:"&",AMP:"&",lt:"<",LT:"<",gt:">",GT:">",quot:'"',QUOT:'"',apos:"'",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",lsquor:"\u201A",rsquor:"\u2019",ldquor:"\u201E",bdquo:"\u201E",comma:",",period:".",colon:":",semi:";",excl:"!",quest:"?",num:"#",dollar:"$",percent:"%",amp:"&",ast:"*",commat:"@",lowbar:"_",verbar:"|",vert:"|",sol:"/",bsol:"\\",lbrace:"{",rbrace:"}",lbrack:"[",rbrack:"]",lpar:"(",rpar:")",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",COPY:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",REG:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",half:"\xBD",frac34:"\xBE",iquest:"\xBF",times:"\xD7",div:"\xF7",divide:"\xF7"},NAe={Agrave:"\xC0",agrave:"\xE0",Aacute:"\xC1",aacute:"\xE1",Acirc:"\xC2",acirc:"\xE2",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",Aring:"\xC5",aring:"\xE5",AElig:"\xC6",aelig:"\xE6",Ccedil:"\xC7",ccedil:"\xE7",Egrave:"\xC8",egrave:"\xE8",Eacute:"\xC9",eacute:"\xE9",Ecirc:"\xCA",ecirc:"\xEA",Euml:"\xCB",euml:"\xEB",Igrave:"\xCC",igrave:"\xEC",Iacute:"\xCD",iacute:"\xED",Icirc:"\xCE",icirc:"\xEE",Iuml:"\xCF",iuml:"\xEF",ETH:"\xD0",eth:"\xF0",Ntilde:"\xD1",ntil
`);let e=new xs("!xml"),r=e,n="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let i=this.options,s=new K0(i.processEntities),a=t.length;for(let c=0;c<a;c++)if(t[c]==="<"){let u=t.charCodeAt(c+1);if(u===47){let d=Og(t,">",c,"Closing Tag is not closed."),f=t.substring(c+2,d).trim();if(i.removeNSPrefix){let p=f.indexOf(":");p!==-1&&(f=f.substr(p+1))}f=FG(i.transformTagName,f,"",i).tagName,r&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher));let h=this.matcher.getCurrentTag();if(f&&i.unpairedTagsSet.has(f))throw new Error(`Unpairedtagcannotbeusedasclosingtag:</${f}>`);h&&i.unpairedTagsSet.has(h)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop(),n="",c=d}else if(u===63){let d=MG(t,c,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,this.readonlyMatcher);let f=this.buildAttributesMap(d.tagExp,this.matcher,d.tagName,!0);if(f){let h=f[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(h)||1),s.setXmlVersion(Number(h)||1)}if(!(i.ignoreDeclaration&&d.tagName==="?xml"||i.ignorePiTags)){let h=new xs(d.tagName);h.add(i.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&i.ignoreAttributes!==!0&&(h[":@"]=f),this.addChild(r,h,this.readonlyMatcher,c)}c=d.closeIndex+1}else if(u===33&&t.charCodeAt(c+2)===45&&t.charCodeAt(c+3)===45){let d=Og(t,"-->",c+4,"Comment is not closed.");if(i.commentPropName){let f=t.substring(c+4,d-2);n=this.saveTextToParentTag(n,r,this.readonlyMatcher),r.add(i.commentPropName,[{[i.textNodeName]:f}])}c=d}else if(u===33&&t.charCodeAt(c+2)===68){let d=s.readDocType(t,c);this.entityDecoder.addInputEntities(d.entities),c=d.i}else if(u===33&&t.charCodeAt(c+2)===91){let d=Og(t,"]]>",c,"CDATA is not closed.")-2,f=t.substring(c+9,d);n=this.saveTextToParentTag(n,r,this.readonlyMatcher);let h=this.parseTextData(f,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);h==null&&(h=""),i.cdataPropName?r.add(i.cdataPropName,[{[i.textNodeName]:f}]):r.add(i.textNodeName,h),c=d+2}else{let d=MG(t,c,i.removeNSPrefix);if(!d){let M=t.substring(Math.max(0,c-50),Math.min(a,c+50));throw new Error(`readTagExp returned undefined at position ${c}. Context: "${M}"`)}let f=d.tagName,h=d.rawTagName,p=d.tagExp,m=d.attrExpPresent,g=d.closeIndex;if({tagName:f,tagExp:p}=FG(i.transformTagName,f,p,i),i.strictReservedNames&&(f===i.commentPropName||f===i.cdataPropName||f===i.textNodeName||f===i.attributesGroupName))throw new Error(`Invalid tag name: ${f}`);r&&n&&r.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,r,this.readonlyMatcher,!1));let E=r;E&&i.unpairedTagsSet.has(E.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());let y=!1;p.length>0&&p.lastIndexOf("/")===p.length-1&&(y=!0,f[f.length-1]==="/"?(f=f.substr(0,f.length-1),p=f):p=p.substr(0,p.length-1),m=f!==p);let C=null,w={},B;B=Tit(h),f!==e.tagname&&this.matcher.push(f,{},B),f!==p&&m&&(C=this.buildAttributesMap(p,this.matcher,f),C&&(w=Rit(C,i))),f!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let Q=c;if(this.isCurrentNodeStopNode){let M="";if(y)c=d.closeIndex;else if(i.unpairedTagsSet.has(f))c=d.closeIndex;else{let j=this.readStopNodeData(t,h,g+1);if(!j)throw new Error(`Unexpected end of ${h}`);c=j.i,M=j.tagContent}let v=new xs(f);C&&(v[":@"]=C),v.add(i.textNodeName,M),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,v,this.readonlyMatcher,Q)}else{if(y){({tagName:f,tagExp:p}=FG(i.transformTagName,f,p,i));let M=new xs(f);C&&(M[":@"]=C),this.addChild(r,M,this.readonlyMatcher,Q),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(i.unpairedTagsSet.has(f)){let M=new xs(f);C&&(M[":@"]=C),this.addChild(r,M,this.readonlyMatcher,Q),this.matcher.pop(),this.isCurrentNodeStopNode=!1,c=d.closeIndex;continue}else{let M=new xs(f);if(this.tagsNodeStack.length>i.maxNestedTags)throw new Error("Maximumnestedtagsexceeded");this.tagsNodeStack.push(r),C&&(M[":@"]=C),this.addChild(r,M,this.readonlyMatcher,Q),r=M}n="",c=g}}}else n+=t[c];return e.child},"parseXml"
`}),n}getCanonicalizedResourceString(e){let r=wR(e.url)||"/",n="";n+=`/${this.factory.accountName}${r}`;let i=IR(e.url),s={};if(i){let a=[];for(let c in i)if(Object.prototype.hasOwnProperty.call(i,c)){let l=c.toLowerCase();s[l]=i[c],a.push(l)}a.sort();for(let c of a)n+=`
${c}:${decodeURIComponent(s[c])}`}return n}};var Pr=class extends Cp{static{o(this,"StorageSharedKeyCredential")}accountName;accountKey;constructor(e,r){super(),this.accountName=e,this.accountKey=Buffer.from(r,"base64")}create(e,r){return new rw(e,r,this)}computeHMACSHA256(e){return(0,sme.createHmac)("sha256",this.accountKey).update(e,"utf8").digest("base64")}};var vn=zc("storage-common");var Ko;(function(t){t[t.EXPONENTIAL=0]="EXPONENTIAL",t[t.FIXED=1]="FIXED"})(Ko||(Ko={}));var gf={maxRetryDelayInMs:120*1e3,maxTries:4,retryDelayInMs:4*1e3,retryPolicyType:Ko.EXPONENTIAL,secondaryHost:"",tryTimeoutInMs:void 0},ust=new lo("The operation was aborted."),nw=class extends Yc{static{o(this,"StorageRetryPolicy")}retryOptions;constructor(e,r,n=gf){super(e,r),this.retryOptions={retryPolicyType:n.retryPolicyType?n.retryPolicyType:gf.retryPolicyType,maxTries:n.maxTries&&n.maxTries>=1?Math.floor(n.maxTries):gf.maxTries,tryTimeoutInMs:n.tryTimeoutInMs&&n.tryTimeoutInMs>=0?n.tryTimeoutInMs:gf.tryTimeoutInMs,retryDelayInMs:n.retryDelayInMs&&n.retryDelayInMs>=0?Math.min(n.retryDelayInMs,n.maxRetryDelayInMs?n.maxRetryDelayInMs:gf.maxRetryDelayInMs):gf.retryDelayInMs,maxRetryDelayInMs:n.maxRetryDelayInMs&&n.maxRetryDelayInMs>=0?n.maxRetryDelayInMs:gf.maxRetryDelayInMs,secondaryHost:n.secondaryHost?n.secondaryHost:gf.secondaryHost}}async sendRequest(e){return this.attemptSendRequest(e,!1,1)}async attemptSendRequest(e,r,n){let i=e.clone(),s=r||!this.retryOptions.secondaryHost||!(e.method==="GET"||e.method==="HEAD"||e.method==="OPTIONS")||n%2===1;s||(i.url=bR(i.url,this.retryOptions.secondaryHost)),this.retryOptions.tryTimeoutInMs&&(i.url=mf(i.url,Mu.Parameters.TIMEOUT,Math.floor(this.retryOptions.tryTimeoutInMs/1e3).toString()));let a;try{if(vn.info(`RetryPolicy:=====>Try=${n}${s?"Primary":"Secondary"}`),a=await this._nextPolicy.sendRequest(i),!this.shouldRetry(s,n,a))return a;r=r||!s&&a.status===404}catch(c){if(vn.error(`RetryPolicy:Caughterror,message:${c.message},code:${c.code}`),!this.shouldRetry(s,n,a,c))throw c}return await this.delay(s,n,e.abortSignal),this.attemptSendRequest(e,r,++n)}shouldRetry(e,r,n,i){if(r>=this.retryOptions.maxTries)return vn.info(`RetryPolicy:Attempt(s)${r}>=maxTries${this.retryOptions.maxTries},nofurthertry.`),!1;let s=["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNREFUSED","ECONNRESET","ENOENT","ENOTFOUND","TIMEOUT","EPIPE","REQUEST_SEND_ERROR"];if(i){for(let a of s)if(i.name.toUpperCase().includes(a)||i.message.toUpperCase().includes(a)||i.code&&i.code.toString().toUpperCase()===a)return vn.info(`RetryPolicy:Networkerror${a}found,willretry.`),!0}if(n||i){let a=n?n.status:i?i.statusCode:0;if(!e&&a===404)return vn.info("RetryPolicy: Secondary access with 404, will retry."),!0;if(a===503||a===500)return vn.info(`RetryPolicy:Willretryforstatuscode${a}.`),!0}if(n&&n?.status>=400){let a=n.headers.get(Ve.X_MS_CopySourceErrorCode);if(a!==void 0)switch(a){case"InternalError":case"OperationTimedOut":case"ServerBusy":return!0}}return i?.code==="PARSE_ERROR"&&i?.message.startsWith('Error "Error: Unclosed root tag')?(vn.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."),!0):!1}async delay(e,r,n){let i=0;if(e)switch(this.retryOptions.retryPolicyType){case Ko.EXPONENTIAL:i=Math.min((Math.pow(2,r-1)-1)*this.retryOptions.retryDelayInMs,this.retryOptions.maxRetryDelayInMs);break;case Ko.FIXED:i=this.retryOptions.retryDelayInMs;break}else i=Math.random()*1e3;return vn.info(`RetryPolicy:Delayfor${i}ms`),SR(i,n,ust)}};var iw=class{static{o(this,"StorageRetryPolicyFactory")}retryOptions;constructor(e){this.retryOptions=e}create(e,r){return new nw(e,r,this.retryOptions)}};var dst="storageBrowserPolicy";function ome(){return{name:dst,async sendRequest(t,e){return Ot||((t.method==="GET"||t.method==="HEAD")&&(t.url=mf(t.url,Mu.Parameters.FORCE_BROWSER_NO_CACHE,new Date().getTime().toString())),t.headers.delete(Ve.COOKIE),t.headers.delete(Ve.CONTENT_LENGTH)),e(t)}}}o(ome,"storageBrowserPolicy");var fst="StorageCorrectContentLengthPolicy";function ame(){function t(e){e.body&&(
`}),c}o(n,"getCanonicalizedHeadersString");function i(s){let a=wR(s.url)||"/",c="";c+=`/${t.accountName}${a}`;let l=IR(s.url),u={};if(l){let d=[];for(let f in l)if(Object.prototype.hasOwnProperty.call(l,f)){let h=f.toLowerCase();u[h]=l[f],d.push(h)}d.sort();for(let f of d)c+=`
`),s=e.computeHMACSHA256(i);return{sasQueryParameters:new tc(t.version,s,n,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,r,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType),stringToSign:i}}o(Cat,"generateBlobSASQueryParameters20150405");function bat(t,e){if(t=_p(t),!t.identifier&&!(t.permissions&&t.expiresOn))throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");let r="c",n=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",n=t.versionId));let i;t.permissions&&(t.blobName?i=hl.parse(t.permissions.toString()).toString():i=pl.parse(t.permissions.toString()).toString());let s=[i||"",t.startsOn?Lt(t.startsOn,!1):"",t.expiresOn?Lt(t.expiresOn,!1):"",Np(e.accountName,t.containerName,t.blobName),t.identifier,t.ipRange?ec(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,n,t.cacheControl?t.cacheControl:"",t.contentDisposition?t.contentDisposition:"",t.contentEncoding?t.contentEncoding:"",t.contentLanguage?t.contentLanguage:"",t.contentType?t.contentType:""].join(`
`),a=e.computeHMACSHA256(s);return{sasQueryParameters:new tc(t.version,a,i,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,r,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType),stringToSign:s}}o(bat,"generateBlobSASQueryParameters20181109");function wat(t,e){if(t=_p(t),!t.identifier&&!(t.permissions&&t.expiresOn))throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");let r="c",n=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",n=t.versionId));let i;t.permissions&&(t.blobName?i=hl.parse(t.permissions.toString()).toString():i=pl.parse(t.permissions.toString()).toString());let s=[i||"",t.startsOn?Lt(t.startsOn,!1):"",t.expiresOn?Lt(t.expiresOn,!1):"",Np(e.accountName,t.containerName,t.blobName),t.identifier,t.ipRange?ec(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,n,t.encryptionScope,t.cacheControl?t.cacheControl:"",t.contentDisposition?t.contentDisposition:"",t.contentEncoding?t.contentEncoding:"",t.contentLanguage?t.contentLanguage:"",t.contentType?t.contentType:""].join(`
`),a=e.computeHMACSHA256(s);return{sasQueryParameters:new tc(t.version,a,i,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,r,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType,void 0,void 0,void 0,t.encryptionScope),stringToSign:s}}o(wat,"generateBlobSASQueryParameters20201206");function Iat(t,e){if(t=_p(t),!t.permissions||!t.expiresOn)throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");let r="c",n=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",n=t.versionId));let i;t.permissions&&(t.blobName?i=hl.parse(t.permissions.toString()).toString():i=pl.parse(t.permissions.toString()).toString());let s=[i||"",t.startsOn?Lt(t.startsOn,!1):"",t.expiresOn?Lt(t.expiresOn,!1):"",Np(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?Lt(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?Lt(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.ipRange?ec(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,n,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
`),a=e.computeHMACSHA256(s);return{sasQueryParameters:new tc(t.version,a,i,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,r,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType,e.userDelegationKey),stringToSign:s}}o(Iat,"generateBlobSASQueryParametersUDK20181109");function Sat(t,e){if(t=_p(t),!t.permissions||!t.expiresOn)throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");let r="c",n=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",n=t.versionId));let i;t.permissions&&(t.blobName?i=hl.parse(t.permissions.toString()).toString():i=pl.parse(t.permissions.toString()).toString());let s=[i||"",t.startsOn?Lt(t.startsOn,!1):"",t.expiresOn?Lt(t.expiresOn,!1):"",Np(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?Lt(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?Lt(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.preauthorizedAgentObjectId,void 0,t.correlationId,t.ipRange?ec(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,n,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
`),a=e.computeHMACSHA256(s);return{sasQueryParameters:new tc(t.version,a,i,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,r,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType,e.userDelegationKey,t.preauthorizedAgentObjectId,t.correlationId),stringToSign:s}}o(Sat,"generateBlobSASQueryParametersUDK20200210");function Bat(t,e){if(t=_p(t),!t.permissions||!t.expiresOn)throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");let r="c",n=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",n=t.versionId));let i;t.permissions&&(t.blobName?i=hl.parse(t.permissions.toString()).toString():i=pl.parse(t.permissions.toString()).toString());let s=[i||"",t.startsOn?Lt(t.startsOn,!1):"",t.expiresOn?Lt(t.expiresOn,!1):"",Np(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?Lt(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?Lt(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.preauthorizedAgentObjectId,void 0,t.correlationId,t.ipRange?ec(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,n,t.encryptionScope,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
`),a=e.computeHMACSHA256(s);return{sasQueryParameters:new tc(t.version,a,i,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,r,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType,e.userDelegationKey,t.preauthorizedAgentObjectId,t.correlationId,t.encryptionScope),stringToSign:s}}o(Bat,"generateBlobSASQueryParametersUDK20201206");function xat(t,e){if(t=_p(t),!t.permissions||!t.expiresOn)throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");let r="c",n=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",n=t.versionId));let i;t.permissions&&(t.blobName?i=hl.parse(t.permissions.toString()).toString():i=pl.parse(t.permissions.toString()).toString());let s=[i||"",t.startsOn?Lt(t.startsOn,!1):"",t.expiresOn?Lt(t.expiresOn,!1):"",Np(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?Lt(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?Lt(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.preauthorizedAgentObjectId,void 0,t.correlationId,void 0,t.delegatedUserObjectId,t.ipRange?ec(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,n,t.encryptionScope,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
`),a=e.computeHMACSHA256(s);return{sasQueryParameters:new tc(t.version,a,i,void 0,void 0,t.protocol,t.startsOn,t.expiresOn,t.ipRange,t.identifier,r,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType,e.userDelegationKey,t.preauthorizedAgentObjectId,t.correlationId,t.encryptionScope,t.delegatedUserObjectId),stringToSign:s}}o(xat,"generateBlobSASQueryParametersUDK20250705");function Np(t,e,r){let n=[`/blob/${t}/${e}`];return r&&n.push(`/${r}`),n.join("")}o(Np,"getCanonicalName");function _p(t){let e=t.version?t.version:NR;if(t.snapshotTime&&e<"2018-11-09")throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'.");if(t.blobName===void 0&&t.snapshotTime)throw RangeError("Must provide 'blobName' when providing 'snapshotTime'.");if(t.versionId&&e<"2019-10-10")throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'.");if(t.blobName===void 0&&t.versionId)throw RangeError("Must provide 'blobName' when providing 'versionId'.");if(t.permissions&&t.permissions.setImmutabilityPolicy&&e<"2020-08-04")throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission.");if(t.permissions&&t.permissions.deleteVersion&&e<"2019-10-10")throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.");if(t.permissions&&t.permissions.permanentDelete&&e<"2019-10-10")throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission.");if(t.permissions&&t.permissions.tag&&e<"2019-12-12")throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission.");if(e<"2020-02-10"&&t.permissions&&(t.permissions.move||t.permissions.execute))throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.");if(e<"2021-04-10"&&t.permissions&&t.permissions.filterByTags)throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission.");if(e<"2020-02-10"&&(t.preauthorizedAgentObjectId||t.correlationId))throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");if(t.encryptionScope&&e<"2020-12-06")throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");return t.version=e,t}o(_p,"SASSignatureValuesSanityCheckAndAutofill");var gw=class{static{o(this,"BlobLeaseClient")}_leaseId;_url;_containerOrBlobOperation;_isContainer;get leaseId(){return this._leaseId}get url(){return this._url}constructor(e,r){let n=e.storageClientContext;this._url=e.url,e.name===void 0?(this._isContainer=!0,this._containerOrBlobOperation=n.container):(this._isContainer=!1,this._containerOrBlobOperation=n.blob),r||(r=Rg()),this._leaseId=r}async acquireLease(e,r={}){if(this._isContainer&&(r.conditions?.ifMatch&&r.conditions?.ifMatch!==Ya||r.conditions?.ifNoneMatch&&r.conditions?.ifNoneMatch!==Ya||r.conditions?.tagConditions))throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");return Ce.withSpan("BlobLeaseClient-acquireLease",r,async n=>Ne(await this._containerOrBlobOperation.acquireLease({abortSignal:r.abortSignal,duration:e,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},proposedLeaseId:this._leaseId,tracingOptions:n.tracingOptions})))}async changeLease(e,r={}){if(this._isContainer&&(r.conditions?.ifMatch&&r.conditions?.ifMatch!==Ya||r.conditions?.ifNoneMatch&&r.conditions?.ifNoneMatch!==Ya||r.conditions?.tagConditions))throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.");return Ce.withSpan("BlobLeaseClient-changeLease",r,async n=>{let i=Ne(await this._containerOrBlobOperation.changeLease(this._leaseId,e,{abortSignal:r.abortSignal,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},tracingOptions:n.tracingOptions}));return this._leaseId=e,i})}async releaseLease(e={}){if(this._isContainer&&(e.conditions?.i
Ifyouareusingself-hostedrunners,pleasemakesureyourrunnerhasaccesstoallGitHubendpoints:https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`;super(r),this.code=e,this.name="NetworkError"}};Yg.isNetworkErrorCode=t=>t?["ECONNRESET","ENOTFOUND","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH"].includes(t):!1;var Qp=class extends Error{static{o(this,"UsageError")}constructor(){super(`Cache storage quota has been hit. Unable to upload any new cache entries.
Moreinfoonstoragelimits:https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`),this.name="UsageError"}};Qp.isUsageErrorMessage=t=>t?t.includes("insufficient usage"):!1;var vw=class extends Error{static{o(this,"RateLimitError")}constructor(e){super(e),this.name="RateLimitError"}};var Oct=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return o(i,"adopt"),new(r||(r=Promise))(function(s,a){function c(d){try{u(n.next(d))}catch(f){a(f)}}o(c,"fulfilled");function l(d){try{u(n.throw(d))}catch(f){a(f)}}o(l,"rejected");function u(d){d.done?s(d.value):i(d.value).then(c,l)}o(u,"step"),u((n=n.apply(t,e||[])).next())})},VV=class{static{o(this,"UploadProgress")}constructor(e){this.contentLength=e,this.sentBytes=0,this.displayedComplete=!1,this.startTime=Date.now()}setSentBytes(e){this.sentBytes=e}getTransferredBytes(){return this.sentBytes}isDone(){return this.getTransferredBytes()===this.contentLength}display(){if(this.displayedComplete)return;let e=this.sentBytes,r=(100*(e/this.contentLength)).toFixed(1),n=Date.now()-this.startTime,i=(e/(1024*1024)/(n/1e3)).toFixed(1);L(`Sent ${e} of ${this.contentLength} (${r}%), ${i} MBs/sec`),this.isDone()&&(this.displayedComplete=!0)}onProgress(){return e=>{this.setSentBytes(e.loadedBytes)}}startDisplayTimer(e=1e3){let r=o(()=>{this.display(),this.isDone()||(this.timeoutHandle=setTimeout(r,e))},"displayCallback");this.timeoutHandle=setTimeout(r,e)}stopDisplayTimer(){this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0),this.display()}};function wye(t,e,r){return Oct(this,void 0,void 0,function*(){var n;let i=new rc(t),s=i.getBlockBlobClient(),a=new VV((n=r?.archiveSizeBytes)!==null&&n!==void 0?n:0),c={blockSize:r?.uploadChunkSize,concurrency:r?.uploadConcurrency,maxSingleShotSize:128*1024*1024,onProgress:a.onProgress()};try{a.startDisplayTimer(),D(`BlobClient: ${i.name}:${i.accountName}:${i.containerName}`);let l=yield s.uploadFile(e,c);if(l._response.status>=400)throw new QT(`uploadCacheArchiveSDK: upload failed with status code ${l._response.status}`);return l}catch(l){throw at(`uploadCacheArchiveSDK: internal error uploading cache archive: ${l.message}`),l}finally{a.stopDisplayTimer()}})}o(wye,"uploadCacheArchiveSDK");var Sye=R(require("buffer"),1),Al=R(require("fs"),1),Bye=R(require("stream"),1),xye=R(require("util"),1);var kT=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return o(i,"adopt"),new(r||(r=Promise))(function(s,a){function c(d){try{u(n.next(d))}catch(f){a(f)}}o(c,"fulfilled");function l(d){try{u(n.throw(d))}catch(f){a(f)}}o(l,"rejected");function u(d){d.done?s(d.value):i(d.value).then(c,l)}o(u,"step"),u((n=n.apply(t,e||[])).next())})};function PT(t){return t?t>=200&&t<300:!1}o(PT,"isSuccessStatusCode");function Lct(t){return t?t>=500:!0}o(Lct,"isServerErrorStatusCode");function Fct(t){return t?[kr.BadGateway,kr.ServiceUnavailable,kr.GatewayTimeout].includes(t):!1}o(Fct,"isRetryableStatusCode");function Mct(t){return kT(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}o(Mct,"sleep");function Iye(t,e,r){return kT(this,arguments,void 0,function*(n,i,s,a=s_,c=o_,l=void 0){let u="",d=1;for(;d<=a;){let f,h,p=!1;try{f=yield i()}catch(m){l&&(f=l(m)),p=!0,u=m.message}if(f&&(h=s(f),!Lct(h)))return f;if(h&&(p=Fct(h),u=`Cache service responded with ${h}`),D(`${n} - Attempt ${d} of ${a} failed with error: ${u}`),!p){D(`${n} - Error is not retryable`);break}yield Mct(c),d++}throw Error(`${n} failed: ${u}`)})}o(Iye,"retry");function Nw(t,e){return kT(this,arguments,void 0,function*(r,n,i=s_,s=o_){return yield Iye(r,n,a=>a.statusCode,i,s,a=>{if(a instanceof qc)return{statusCode:a.statusCode,result:null,headers:{},error:a}})})}o(Nw,"retryTypedResponse");function Kg(t,e){return kT(this,arguments,void 0,function*(r,n,i=s_,s=o_){return yield Iye(r,n,a=>a.message.statusCode,i,s)})}o(Kg,"retryHttpClientResponse");var ra=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a
Othercacheswithsimilarkey:`);for(let c of s?.artifactCaches||[])D(`CacheKey:${c?.cacheKey},CacheVersion:${c?.cacheVersion},CacheScope:${c?.scope},CacheCreated:${c?.creationTime}`)}}})}o($ct,"printCachesListForDiagnostics");function JV(t,e,r){return Rs(this,void 0,void 0,function*(){let n=new Oye.URL(t),i=Rye(r);n.hostname.endsWith(".blob.core.windows.net")?i.useAzureSdk?yield Nye(t,e,i):i.concurrentBlobDownloads?yield vye(t,e,i):yield LT(t,e):yield LT(t,e)})}o(JV,"downloadCache");function Fye(t,e,r){return Rs(this,void 0,void 0,function*(){let n=$V(),i=bg(e,r?.compressionMethod,r?.enableCrossOsArchive),s={key:t,version:i,cacheSize:r?.cacheSize};return yield Nw("reserveCache",()=>Rs(this,void 0,void 0,function*(){return n.postJson(Rw("caches"),s)}))})}o(Fye,"reserveCache");function Pye(t,e){return`bytes${t}-${e}/*`}o(Pye,"getContentRange");function Jct(t,e,r,n,i){return Rs(this,void 0,void 0,function*(){D(`Uploadingchunkofsize${i-n+1}bytesatoffset${n}withcontentrange:${Pye(n,i)}`);let s={"Content-Type":"application/octet-stream","Content-Range":Pye(n,i)},a=yield Kg(`uploadChunk(start:${n},end:${i})`,()=>Rs(this,void 0,void 0,function*(){return t.sendStream("PATCH",e,r(),s)}));if(!PT(a.message.statusCode))throw new Error(`Cacheservicerespondedwith${a.message.statusCode}duringuploadchunk.`)})}o(Jct,"uploadChunk");function Wct(t,e,r,n){return Rs(this,void 0,void 0,function*(){let i=Uc(r),s=Rw(`caches/${e.toString()}`),a=Xg.openSync(r,"r"),c=zV(n),l=g3("uploadConcurrency",c.uploadConcurrency),u=g3("uploadChunkSize",c.uploadChunkSize),d=[...new Array(l).keys()];D("Awaiting all uploads");let f=0;try{yield Promise.all(d.map(()=>Rs(this,void 0,void 0,function*(){for(;f<i;){let h=Math.min(i-f,u),p=f,m=f+h-1;f+=u,yield Jct(t,s,()=>Xg.createReadStream(r,{fd:a,start:p,end:m,autoClose:!1}).on("error",g=>{throw new Error(`Cacheuploadfailedbecausefilereadfailedwith${g.message}`)}),p,m)}})))}finally{Xg.closeSync(a)}})}o(Wct,"uploadFile");function Yct(t,e,r){return Rs(this,void 0,void 0,function*(){let n={size:r};return yield Nw("commitCache",()=>Rs(this,void 0,void 0,function*(){return t.postJson(Rw(`caches/${e.toString()}`),n)}))})}o(Yct,"commitCache");function WV(t,e,r,n){return Rs(this,void 0,void 0,function*(){if(zV(n).useAzureSdk){if(!r)throw new Error("Azure Storage SDK can only be used when a signed URL is provided.");yield wye(r,e,n)}else{let s=$V();D("Upload cache"),yield Wct(s,t,e,n),D("Commiting cache");let a=Uc(e);L(`CacheSize:~${Math.round(a/(1024*1024))}MB(${a}B)`);let c=yield Yct(s,t,a);if(!PT(c.statusCode))throw new Error(`Cacheservicerespondedwith${c.statusCode}duringcommitcache.`);L("Cache saved successfully")}})}o(WV,"saveCache");var DEe=R(BEe(),1),nn=R(rn(),1),mo=R(rn(),1),Fp=R(rn(),1),Mp=R(rn(),1),Up=R(rn(),1);var Hz=R(rn(),1),Vz=R(rn(),1),_Ee=R(rn(),1),REe=R(rn(),1),TEe=R(rn(),1);var Uz=R(rn(),1),qz=R(rn(),1),xEe=R(rn(),1),vEe=R(rn(),1),NEe=R(rn(),1);var Gz=class extends NEe.MessageType{static{o(this,"CacheScope$Type")}constructor(){super("github.actions.results.entities.v1.CacheScope",[{no:1,name:"scope",kind:"scalar",T:9},{no:2,name:"permission",kind:"scalar",T:3}])}create(e){let r={scope:"",permission:"0"};return globalThis.Object.defineProperty(r,vEe.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,xEe.reflectionMergePartial)(this,r,e),r}internalBinaryRead(e,r,n,i){let s=i??this.create(),a=e.pos+r;for(;e.pos<a;){let[c,l]=e.tag();switch(c){case 1:s.scope=e.string();break;case 2:s.permission=e.int64().toString();break;default:let u=n.readUnknownField;if(u==="throw")throw new globalThis.Error(`Unknownfield${c}(wiretype${l})for${this.typeName}`);let d=e.skip(l);u!==!1&&(u===!0?qz.UnknownFieldHandler.onRead:u)(this.typeName,s,c,l,d)}}return s}internalBinaryWrite(e,r,n){e.scope!==""&&r.tag(1,Uz.WireType.LengthDelimited).string(e.scope),e.permission!=="0"&&r.tag(2,Uz.WireType.Varint).int64(e.permission);let i=n.writeUnknownFields;return i!==!1&&(i==!0?qz.UnknownFieldHandler.onWrite:i)(this.typeName,e,r),r}},S2=new Gz;var zz=class extends TEe.Mess
`));let n=yield oj(r,"create");yield aj(n,t)})}o(lj,"createTar");var Ay=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return o(i,"adopt"),new(r||(r=Promise))(function(s,a){function c(d){try{u(n.next(d))}catch(f){a(f)}}o(c,"fulfilled");function l(d){try{u(n.throw(d))}catch(f){a(f)}}o(l,"rejected");function u(d){d.done?s(d.value):i(d.value).then(c,l)}o(u,"step"),u((n=n.apply(t,e||[])).next())})},sc=class t extends Error{static{o(this,"ValidationError")}constructor(e){super(e),this.name="ValidationError",Object.setPrototypeOf(this,t.prototype)}},qp=class t extends Error{static{o(this,"ReserveCacheError")}constructor(e){super(e),this.name="ReserveCacheError",Object.setPrototypeOf(this,t.prototype)}},uj="cache write denied:",py=class t extends qp{static{o(this,"CacheWriteDeniedError")}constructor(e){super(e),this.name="CacheWriteDeniedError",Object.setPrototypeOf(this,t.prototype)}},N2=class t extends Error{static{o(this,"FinalizeCacheError")}constructor(e){super(e),this.name="FinalizeCacheError",Object.setPrototypeOf(this,t.prototype)}};function OEe(t){if(!t||t.length===0)throw new sc("Path Validation Error: At least one directory or file path is required")}o(OEe,"checkPaths");function dj(t){if(t.length>512)throw new sc(`KeyValidationError:${t}cannotbelargerthan512characters.`);if(!/^[^,]*$/.test(t))throw new sc(`KeyValidationError:${t}cannotcontaincommas.`)}o(dj,"checkKey");function fj(){return _w()==="v2"?!!process.env.ACTIONS_RESULTS_URL:!!process.env.ACTIONS_CACHE_URL}o(fj,"isFeatureAvailable");function LEe(t,e,r,n){return Ay(this,arguments,void 0,function*(i,s,a,c,l=!1){let u=_w();return D(`Cacheserviceversion:${u}`),OEe(i),u==="v2"?yield ddt(i,s,a,c,l):yield udt(i,s,a,c,l)})}o(LEe,"restoreCache");function udt(t,e,r,n){return Ay(this,arguments,void 0,function*(i,s,a,c,l=!1){a=a||[];let u=[s,...a];if(D("Resolved Keys:"),D(JSON.stringify(u)),u.length>10)throw new sc("Key Validation Error: Keys are limited to a maximum of 10.");for(let h of u)dj(h);let d=yield N0(),f="";try{let h=yield Lye(u,i,{compressionMethod:d,enableCrossOsArchive:l});if(!h?.archiveLocation)return;if(c?.lookupOnly)return L("Lookup only - skipping download"),h.cacheKey;f=jw.join(yield x0(),cf(d)),D(`ArchivePath:${f}`),yield JV(h.archiveLocation,f,c),rp()&&(yield zw(f,d));let p=Uc(f);return L(`CacheSize:~${Math.round(p/(1024*1024))}MB(${p}B)`),yield cj(f,d),L("Cache restored successfully"),h.cacheKey}catch(h){let p=h;if(p.name===sc.name)throw h;p instanceof qc&&typeof p.statusCode=="number"&&p.statusCode>=500?lg(`Failedtorestore:${h.message}`):at(`Failedtorestore:${h.message}`)}finally{try{yield v0(f)}catch(h){D(`Failedtodeletearchive:${h}`)}}})}o(udt,"restoreCacheV1");function ddt(t,e,r,n){return Ay(this,arguments,void 0,function*(i,s,a,c,l=!1){c=Object.assign(Object.assign({},c),{useAzureSdk:!0}),a=a||[];let u=[s,...a];if(D("Resolved Keys:"),D(JSON.stringify(u)),u.length>10)throw new sc("Key Validation Error: Keys are limited to a maximum of 10.");for(let f of u)dj(f);let d="";try{let f=sj(),h=yield N0(),p={key:s,restoreKeys:a,version:bg(i,h,l)},m=yield f.GetCacheEntryDownloadURL(p);if(!m.ok){D(`Cachenotfoundforversion${p.version}ofkeys:${u.join(", ")}`);return}if(p.key!==m.matchedKey?L(`Cachehitforrestore-key:${m.matchedKey}`):L(`Cachehitfor:${m.matchedKey}`),c?.lookupOnly)return L("Lookup only - skipping download"),m.matchedKey;d=jw.join(yield x0(),cf(h)),D(`Archivepath:${d}`),D(`Startingdownloadofarchiveto:${d}`),yield JV(m.signedDownloadUrl,d,c);let E=Uc(d);return L(`CacheSize:~${Math.round(E/(1024*1024))}MB(${E}B)`),rp()&&(yield zw(d,h)),yield cj(d,h),L("Cache restored successfully"),m.matchedKey}catch(f){let h=f;if(h.name===sc.name)throw f;h instanceof qc&&typeof h.statusCode=="number"&&h.statusCode>=500?lg(`Failedtorestore:${f.message}`):at(`Failedtorestore:${f.message}`)}finally{try{d&&(yield v0(d))}catch(f){D(`Failedtodeletearchive:${f}`)}}})}o(ddt,"restoreCacheV2");function hj(t,e,r){return Ay(this,arguments,void 0,function*(n,i,s,a=!1)
`,a).length:f,u?(c===null?0:c.length)+l.length:0,u?l.length+f:0);return h<p},"__needMoreData"),parse:o(function(n,i,s,a){let{bom:c,comment_no_infix:l,delimiter_auto:u,encoding:d,from_line:f,ltrim:h,max_record_size:p,raw:m,relax_quotes:g,rtrim:E,skip_empty_lines:y,to:C,to_line:w}=this.options,{comment:B,escape:Q,quote:M,record_delimiter:v}=this.options,{bomSkipped:j,delimiterDiscovered:T,delimiterBufPrevious:G,rawBuffer:V,escapeIsQuote:W}=this.state;if(!T&&u){let z;if(G===void 0?z=n:G!==void 0&&n===void 0?z=G:z=Buffer.concat([G,n]),n=void 0,i||z.length>u.size)this.options.delimiter=[Buffer.from(Hwe(z,this.options.delimiter_auto))],this.state.previousBuf=z,this.state.delimiterBufPrevious=void 0,this.state.delimiterDiscovered=!0;else{this.state.delimiterBufPrevious=z;return}}let{previousBuf:ee}=this.state,ae;if(ee===void 0)if(n===void 0){a();return}else ae=n;else ee!==void 0&&n===void 0?ae=ee:ae=Buffer.concat([ee,n]);if(j===!1)if(c===!1)this.state.bomSkipped=!0;else if(ae.length<3){if(i===!1){this.state.previousBuf=ae;return}}else{for(let z in Ty)if(Ty[z].compare(ae,0,Ty[z].length)===0){let Ie=Ty[z].length;this.state.bufBytesStart+=Ie,ae=ae.slice(Ie);let Be=Ry({...this.original_options,encoding:z});for(let it in Be)this.options[it]=Be[it];({comment:B,escape:Q,quote:M}=this.options);break}this.state.bomSkipped=!0}let Ae=ae.length,Y;for(Y=0;Y<Ae&&!this.__needMoreData(Y,Ae,i);Y++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),w!==-1&&this.info.lines>w){this.state.stop=!0,a();return}this.state.quoting===!1&&v.length===0&&this.__autoDiscoverRecordDelimiter(ae,Y)&&(v=this.options.record_delimiter);let z=ae[Y];if(m===!0&&V.append(z),(z===Pgt||z===Ogt)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(Q!==null&&this.state.quoting===!0&&this.__isEscape(ae,Y,z)&&Y+Q.length<Ae)if(W){if(this.__isQuote(ae,Y+Q.length)){this.state.escaping=!0,Y+=Q.length-1;continue}}else{this.state.escaping=!0,Y+=Q.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(ae,Y))if(this.state.quoting===!0){let it=ae[Y+M.length],Et=E&&this.__isCharTrimable(ae,Y+M.length),fr=B!==null&&this.__compareBytes(B,ae,Y+M.length,it),fn=this.__isDelimiter(ae,Y+M.length,it),si=v.length===0?this.__autoDiscoverRecordDelimiter(ae,Y+M.length):this.__isRecordDelimiter(it,ae,Y+M.length);if(Q!==null&&this.__isEscape(ae,Y,z)&&this.__isQuote(ae,Y+Q.length))Y+=Q.length-1;else if(!it||fn||si||fr||Et){this.state.quoting=!1,this.state.wasQuoting=!0,Y+=M.length-1;continue}else if(g===!1){let hr=this.__error(new dt("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got"${String.fromCharCode(it)}"`,`atline${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(hr!==void 0)return hr}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(M),Y+=M.length-1}else if(this.state.field.length!==0){if(g===!1){let it=this.__infoField(),Et=Object.keys(Ty).map(fn=>Ty[fn].equals(this.state.field.toString())?fn:!1).filter(Boolean)[0],fr=this.__error(new dt("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`aquoteisfoundonfield${JSON.stringify(it.column)}atline${it.lines},valueis${JSON.stringify(this.state.field.toString(d))}`,Et?`(${Et}bom)`:void 0],this.options,it,{field:this.state.field}));if(fr!==void 0)return fr}}else{this.state.quoting=!0,Y+=M.length-1;continue}if(this.state.quoting===!1){let it=this.__isRecordDelimiter(z,ae,Y);if(it!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=f){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),Y+=it-1;continue}if(y===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,Y+=it-1;continue}this.info.bytes=this.state.bufBytesStart+Y;let fn=this.__onField();if(
`)}o(Nyt,"_buildMessageForResponseErrors");var _yt=class extends Error{static{o(this,"GraphqlResponseError")}constructor(t,e,r){super(Nyt(r)),this.request=t,this.headers=e,this.response=r,this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name="GraphqlResponseError";errors;data},Ryt=["method","baseUrl","url","headers","request","query","mediaType","operationName"],Tyt=["query","method","url"],TIe=/\/api\/v3\/?$/;function Dyt(t,e,r){if(r){if(typeof e=="string"&&"query"in r)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let a in r)if(Tyt.includes(a))return Promise.reject(new Error(`[@octokit/graphql]"${a}"cannotbeusedasvariablename`))}let n=typeof e=="string"?Object.assign({query:e},r):e,i=Object.keys(n).reduce((a,c)=>Ryt.includes(c)?(a[c]=n[c],a):(a.variables||(a.variables={}),a.variables[c]=n[c],a),{}),s=n.baseUrl||t.endpoint.DEFAULTS.baseUrl;return TIe.test(s)&&(i.url=s.replace(TIe,"/api/graphql")),t(i).then(a=>{if(a.data.errors){let c={};for(let l of Object.keys(a.headers))c[l]=a.headers[l];throw new _yt(i,c,a.data)}return a.data.data})}o(Dyt,"graphql");function W$(t,e){let r=t.defaults(e);return Object.assign(o((i,s)=>Dyt(r,i,s),"newApi"),{defaults:W$.bind(null,r),endpoint:r.endpoint})}o(W$,"withDefaults");var rwr=W$(yI,{headers:{"user-agent":`octokit-graphql.js/${vyt}${_f()}`},method:"POST",url:"/graphql"});function DIe(t){return W$(t,{method:"POST",url:"/graphql"})}o(DIe,"withCustomRequest");var Y$="(?:[a-zA-Z0-9_-]+)",QIe="\\.",kIe=new RegExp(`^${Y$}${QIe}${Y$}${QIe}${Y$}$`),Qyt=kIe.test.bind(kIe);async function kyt(t){let e=Qyt(t),r=t.startsWith("v1.")||t.startsWith("ghs_"),n=t.startsWith("ghu_");return{type:"token",token:t,tokenType:e?"app":r?"installation":n?"user-to-server":"oauth"}}o(kyt,"auth");function Pyt(t){return t.split(/\./).length===3?`bearer${t}`:`token${t}`}o(Pyt,"withAuthorizationPrefix");async function Oyt(t,e,r,n){let i=e.endpoint.merge(r,n);return i.headers.authorization=Pyt(t),e(i)}o(Oyt,"hook");var PIe=o(function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(kyt.bind(null,e),{hook:Oyt.bind(null,e)})},"createTokenAuth2");var K$="7.0.6";var OIe=o(()=>{},"noop"),Lyt=console.warn.bind(console),Fyt=console.error.bind(console);function Myt(t={}){return typeof t.debug!="function"&&(t.debug=OIe),typeof t.info!="function"&&(t.info=OIe),typeof t.warn!="function"&&(t.warn=Lyt),typeof t.error!="function"&&(t.error=Fyt),t}o(Myt,"createLogger");var LIe=`octokit-core.js/${K$}${_f()}`,Py=class{static{o(this,"Octokit")}static VERSION=K$;static defaults(e){return class extends this{static{o(this,"OctokitWithDefaults")}constructor(...n){let i=n[0]||{};if(typeof e=="function"){super(e(i));return}super(Object.assign({},e,i,i.userAgent&&e.userAgent?{userAgent:`${i.userAgent}${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let r=this.plugins;return class extends this{static{o(this,"NewOctokit")}static plugins=r.concat(e.filter(i=>!r.includes(i)))}}constructor(e={}){let r=new uIe.Collection,n={baseUrl:yI.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:r.bind(null,"request")}),mediaType:{previews:[],format:""}};if(n.headers["user-agent"]=e.userAgent?`${e.userAgent}${LIe}`:LIe,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=yI.defaults(n),this.graphql=DIe(this.request).defaults(n),this.log=Myt(e.log),this.hook=r,e.authStrategy){let{authStrategy:s,...a}=e,c=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:a},e.auth));r.wrap("request",c.hook),this.auth=c}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{let s=PIe(e.auth);r.wrap("request",s.hook),this.auth=s}let i=this.constructor;for(let s=0;s<i.plugins.length;++s)
Moreinfo:${l.url}`);let p=l.range&&l.range.length>0?l.range[0]?.start.line:void 0,m=!1;for(let g of a)if(g.remote||g.path.endsWith(u)&&g.content===d){c.push({title:f,message:h,file:g.path,startLine:p}),m=!0;break}m||D(`Buildx.convertWarningsToGitHubAnnotations:skippingwarningwithoutmatchingDockerfile${u}:${f}`)}return c}};var a8=R(require("fs"),1),c8=R(require("path"),1);var zD=class t{static{o(this,"History")}buildx;constructor(e){this.buildx=e?.buildx||new Dt}async getCommand(e){return await this.buildx.getCommand(["history",...e])}async getInspectCommand(e){return await this.getCommand(["inspect",...e])}async getExportCommand(e){return await this.getCommand(["export",...e])}async inspect(e){let r=["--format","json"];e.builder&&r.push("--builder",e.builder),e.ref&&r.push(e.ref);let n=await this.getInspectCommand(r);return await _e.getExecOutput(n.command,n.args,{ignoreReturnCode:!0,silent:!0}).then(i=>{if(i.stderr.length>0&&i.exitCode!=0)throw new Error(i.stderr.trim());return JSON.parse(i.stdout)})}async export(e){if(!await this.buildx.versionSatisfies(">=0.23.0"))throw new Error("Buildx >= 0.23.0 is required to export a build record");let r="",n="",i=[];for(let f of e.refs){let h=f.split("/");if(h.length!=3)throw new Error(`Invalidbuildref:${f}`);i.push(h[2]),r||(r=h[0]),n||(n=h[1])}if(i.length===0)throw new Error("No build refs provided");let s=c8.default.join(mt.tmpDir(),"export");L(`exportingbuildrecordto${s}`),a8.default.mkdirSync(s,{recursive:!0}),await this.buildx.versionSatisfies("<0.24.0")&&await re.sleep(3);let a={};if(!e.noSummaries)for(let f of i)await this.inspect({ref:f,builder:r}).then(h=>{let p="";h.Error&&h.Status!=="canceled"&&(h.Error.Message?p=h.Error.Message:h.Error.Name&&h.Error.Logs&&(p=`=>${h.Error.Name}
`," Line feed \\n"]]),YSe=new Map([...M6,["\\"," Backslash \\"],["/"," Forward slash /"]]);function KSe(t){if(!t)throw new Error("Provided artifact name input during validation is empty");for(let[e,r]of YSe)if(t.includes(e))throw new Error(`Theartifactnameisnotvalid:${t}.Containsthefollowingcharacter:${r}
ThesecharactersarenotallowedintheartifactnameduetolimitationswithcertainfilesystemssuchasNTFS.Tomaintainfilesystemagnosticbehavior,thesecharactersareintentionallynotallowedtopreventpotentialproblemswithdownloadsondifferentfilesystems.`);ct("Artifact name is valid!")}o(KSe,"validateArtifactName");function U6(t){if(!t)throw new Error("Provided file path input during validation is empty");for(let[e,r]of M6)if(t.includes(e))throw new Error(`Thepathforoneofthefilesinartifactisnotvalid:${t}.Containsthefollowingcharacter:${r}
`)}o(U6,"validateFilePath");var tBe=R(eBe(),1);function Ql(){return`@actions/artifact-${tBe.version}`}o(Ql,"getUserAgentString");var eE=class extends Error{static{o(this,"FilesNotFoundError")}constructor(e=[]){let r="No files were found to upload";e.length>0&&(r+=`:${e.join(", ")}`),super(r),this.files=e,this.name="FilesNotFoundError"}},uc=class extends Error{static{o(this,"InvalidResponseError")}constructor(e){super(e),this.name="InvalidResponseError"}},sd=class extends Error{static{o(this,"ArtifactNotFoundError")}constructor(e="Artifact not found"){super(e),this.name="ArtifactNotFoundError"}},kf=class extends Error{static{o(this,"GHESNotSupportedError")}constructor(e="@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES."){super(e),this.name="GHESNotSupportedError"}},od=class extends Error{static{o(this,"NetworkError")}constructor(e){let r=`Unabletomakerequest:${e}
Ifyouareusingself-hostedrunners,pleasemakesureyourrunnerhasaccesstoallGitHubendpoints:https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github`;super(r),this.code=e,this.name="NetworkError"}};od.isNetworkErrorCode=t=>t?["ECONNRESET","ENOTFOUND","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH"].includes(t):!1;var rA=class extends Error{static{o(this,"UsageError")}constructor(){super(`Artifact storage quota has been hit. Unable to upload any new artifacts.
Moreinfoonstoragelimits:https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`),this.name="UsageError"}};rA.isUsageErrorMessage=t=>t?t.includes("insufficient usage"):!1;var QQ=new Error("Failed to get backend IDs: The provided JWT token is invalid and/or missing claims");function kl(){let t=$D(),e=VD(t);if(!e.scp)throw QQ;let r=e.scp.split(" ");if(r.length===0)throw QQ;for(let n of r){let i=n.split(":");if(i?.[0]!=="Actions.Results")continue;if(i.length!==3)throw QQ;let s={workflowRunBackendId:i[1],workflowJobRunBackendId:i[2]};return Xe(`Workflow Run Backend ID: ${s.workflowRunBackendId}`),Xe(`Workflow Job Run Backend ID: ${s.workflowJobRunBackendId}`),s}throw QQ}o(kl,"getBackendIdsFromToken");function rBe(t){if(t)try{let r=new URL(t).searchParams.get("sig");r&&(jD(r),jD(encodeURIComponent(r)))}catch(e){Xe(`Failed to parse URL: ${t} ${e instanceof Error?e.message:String(e)}`)}}o(rBe,"maskSigUrl");function nBe(t){if(typeof t!="object"||t===null){Xe("body is not an object or is null");return}"signed_upload_url"in t&&typeof t.signed_upload_url=="string"&&rBe(t.signed_upload_url),"signed_url"in t&&typeof t.signed_url=="string"&&rBe(t.signed_url)}o(nBe,"maskSecretUrls");var kQ=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return o(i,"adopt"),new(r||(r=Promise))(function(s,a){function c(d){try{u(n.next(d))}catch(f){a(f)}}o(c,"fulfilled");function l(d){try{u(n.throw(d))}catch(f){a(f)}}o(l,"rejected");function u(d){d.done?s(d.value):i(d.value).then(c,l)}o(u,"step"),u((n=n.apply(t,e||[])).next())})},q6=class{static{o(this,"ArtifactHttpClient")}constructor(e,r,n,i){this.maxAttempts=5,this.baseRetryIntervalMilliseconds=3e3,this.retryMultiplier=1.5;let s=$D();this.baseUrl=ZIe(),r&&(this.maxAttempts=r),n&&(this.baseRetryIntervalMilliseconds=n),i&&(this.retryMultiplier=i),this.httpClient=new Mo(e,[new Zd(s)])}request(e,r,n,i){return kQ(this,void 0,void 0,function*(){let s=new URL(`/twirp/${e}/${r}`,this.baseUrl).href;Xe(`[Request] ${r} ${s}`);let a={"Content-Type":n};try{let{body:c}=yield this.retryableRequest(()=>kQ(this,void 0,void 0,function*(){return this.httpClient.post(s,JSON.stringify(i),a)}));return c}catch(c){throw new Error(`Failed to ${r}: ${c.message}`)}})}retryableRequest(e){return kQ(this,void 0,void 0,function*(){let r=0,n="",i="";for(;r<this.maxAttempts;){let s=!1;try{let c=yield e(),l=c.message.statusCode;i=yield c.readBody(),Xe(`[Response] - ${c.message.statusCode}`),Xe(`Headers: ${JSON.stringify(c.message.headers,null,2)}`);let u=JSON.parse(i);if(nBe(u),Xe(`Body: ${JSON.stringify(u,null,2)}`),this.isSuccessStatusCode(l))return{response:c,body:u};if(s=this.isRetryableHttpStatusCode(l),n=`Failed request: (${l}) ${c.message.statusMessage}`,u.msg){if(rA.isUsageErrorMessage(u.msg))throw new rA;n=`${n}: ${u.msg}`}}catch(c){if(c instanceof SyntaxError&&Xe(`Raw Body: ${i}`),c instanceof rA)throw c;if(od.isNetworkErrorCode(c?.code))throw new od(c?.code);s=!0,n=c.message}if(!s)throw new Error(`Received non-retryable error: ${n}`);if(r+1===this.maxAttempts)throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${n}`);let a=this.getExponentialRetryTimeMilliseconds(r);ct(`Attempt ${r+1} of ${this.maxAttempts} failed with error: ${n}. Retrying request in ${a} ms...`),yield this.sleep(a),r++}throw new Error("Request failed")})}isSuccessStatusCode(e){return e?e>=200&&e<300:!1}isRetryableHttpStatusCode(e){return e?[Gn.BadGateway,Gn.GatewayTimeout,Gn.InternalServerError,Gn.ServiceUnavailable,Gn.TooManyRequests].includes(e):!1}sleep(e){return kQ(this,void 0,void 0,function*(){return new Promise(r=>setTimeout(r,e))})}getExponentialRetryTimeMilliseconds(e){if(e<0)throw new Error("attempt should be a positive integer");if(e===0)return this.baseRetryIntervalMilliseconds;let r=this.baseRetryIntervalMilliseconds*Math.pow(this.retryMultiplier,e),n=r*this.retryMultiplier;return Math.trunc(Math.random()*(n-r)+r)}};function Pl(t){let e=new q6(Ql(),t?.maxAttempts,t?.retryIntervalMs,t?.retryMulti
Areyoutryingtodownloadfromadifferentrun?Tryspecifyingagithub-tokenwith\`actions:read\` scope.`);l.length>1&&Ai("Multiple artifacts found, defaulting to first.");letu={workflowRunBackendId:l[0].workflowRunBackendId,workflowJobRunBackendId:l[0].workflowJobRunBackendId,name:l[0].name},{signedUrl:d}=yieldn.GetSignedArtifactURL(u);ct(`Redirecting to blob download url: ${yPe(d)}`);try{ct(`Starting download of artifact to: ${r}`);letf=yieldEPe(d,r,e?.skipDecompress);ct("Artifact download completed successfully."),e?.expectedHash&&e?.expectedHash!==f.sha256Digest&&(i=!0,Xe(`Computed digest: ${f.sha256Digest}`),Xe(`Expected digest: ${e.expectedHash}`))}catch(f){thrownewError(`Unable to download and extract artifact: ${f.message}`)}return{downloadPath:r,digestMismatch:i}})}o(bPe,"downloadArtifactInternal");functionwPe(){returnZE(this,arguments,void0,function*(t=eSe()){return(yieldTOt(t))?Xe(`Artifact destination folder already exists: ${t}`):(Xe(`Artifact destination folder does not exist, creating: ${t}`),yieldqY.default.mkdir(t,{recursive:!0})),t})}o(wPe,"resolveOrCreateDirectory");varQOt=5,kOt=[400,401,403,404,422];functioneC(t,e=QOt,r=kOt){varn;if(e<=0)return[{enabled:!1},t.request];leti={enabled:!0};r.length>0&&(i.doNotRetry=r);lets=Object.assign(Object.assign({},t.request),{retries:e});returnXe(`GitHub client configured with: (retries: ${s.retries}, retry-exempt-status-code: ${(n=i.doNotRetry)!==null&&n!==void0?n:"octokit default: [400, 401, 403, 404, 422]"})`),[i,s]}o(eC,"getRetryOptions");varIPe="6.0.0";functionQA(t){t.hook.wrap("request",(e,r)=>{t.log.debug("request",r);letn=Date.now(),i=t.request.endpoint.parse(r),s=i.url.replace(r.baseUrl,"");returne(r).then(a=>{letc=a.headers["x-github-request-id"];returnt.log.info(`${i.method}${s} - ${a.status} with id ${c} in ${Date.now()-n}ms`),a}).catch(a=>{letc=a.response?.headers["x-github-request-id"]||"UNKNOWN";throwt.log.error(`${i.method}${s} - ${a.status} with id ${c} in ${Date.now()-n}ms`),a})})}o(QA,"requestLog");QA.VERSION=IPe;varxPe=R(SPe(),1);varPOt="0.0.0-development";functionOOt(t){returnt.request!==void0}o(OOt,"isRequestError");asyncfunctionBPe(t,e,r,n){if(!OOt(r)||!r?.request.request)throwr;if(r.status>=400&&!t.doNotRetry.includes(r.status)){leti=n.request.retries!=null?n.request.retries:t.retries,s=Math.pow((n.request.retryCount||0)+1,2);throwe.retry.retryRequest(r,i,s)}throwr}o(BPe,"errorRequest");asyncfunctionLOt(t,e,r,n){leti=newxPe.default;returni.on("failed",function(s,a){letc=~~s.request.request?.retries,l=~~s.request.request?.retryAfter;if(n.request.retryCount=a.retryCount+1,c>a.retryCount)returnl*t.retryAfterBaseValue}),i.schedule(FOt.bind(null,t,e,r),n)}o(LOt,"wrapRequest");asyncfunctionFOt(t,e,r,n){leti=awaitr(n);if(i.data&&i.data.errors&&i.data.errors.length>0&&/Something went wrong while executing your query/.test(i.data.errors[0].message)){lets=newtd(i.data.errors[0].message,500,{request:n,response:i});returnBPe(t,e,s,n)}returni}o(FOt,"requestWithGraphqlErrorHandling");functionkA(t,e){letr=Object.assign({enabled:!0,retryAfterBaseValue:1e3,doNotRetry:[400,401,403,404,410,422,451],retries:3},e.retry),n={retry:{retryRequest:o((i,s,a)=>(i.request.request=Object.assign({},i.request.request,{retries:s,retryAfter:a}),i),"retryRequest")}};returnr.enabled&&(t.hook.error("request",BPe.bind(null,r,n)),t.hook.wrap("request",LOt.bind(null,r,n))),n}o(kA,"retry");kA.VERSION=POt;varvPe=function(t,e,r,n){functioni(s){returnsinstanceofr?s:newr(function(a){a(s)})}returno(i,"adopt"),new(r||(r=Promise))(function(s,a){functionc(d){try{u(n.next(d))}catch(f){a(f)}}o(c,"fulfilled");functionl(d){try{u(n.throw(d))}catch(f){a(f)}}o(l,"rejected");functionu(d){d.done?s(d.value):i(d.value).then(c,l)}o(u,"step"),u((n=n.apply(t,e||[])).next())})};functionZk(t,e,r,n,i){returnvPe(this,void0,void0,function*(){vars;let[a,c]=eC(RA),l={log:void0,userAgent:Ql(),previews:void0,retry:a,request:c},d=yieldth(i,l,kA,QA).request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}",{owner:r,repo:
Formoreinformation,visittheGitHubArtifactsFAQ:https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`);let f=d.data.artifacts[0];return d.data.artifacts.length>1&&(f=d.data.artifacts.sort((h,p)=>p.id-h.id)[0],Xe(`More than one artifact found for a single name, returning newest (id: ${f.id})`)),{artifact:{name:f.name,id:f.id,size:f.size_in_bytes,createdAt:f.created_at?new Date(f.created_at):void 0,digest:f.digest}}})}o(Zk,"getArtifactPublic");function NPe(t){return vPe(this,void 0,void 0,function*(){var e;let r=Pl(),{workflowRunBackendId:n,workflowJobRunBackendId:i}=kl(),s={workflowRunBackendId:n,workflowJobRunBackendId:i,nameFilter:Cn.create({value:t})},a=yield r.ListArtifacts(s);if(a.artifacts.length===0)throw new sd(`Artifact not found for name: ${t}
Formoreinformation,visittheGitHubArtifactsFAQ:https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md`);let c=a.artifacts[0];return a.artifacts.length>1&&(c=a.artifacts.sort((l,u)=>Number(u.databaseId)-Number(l.databaseId))[0],Xe(`More than one artifact found for a single name, returning newest (id: ${c.databaseId})`)),{artifact:{name:c.name,id:Number(c.databaseId),size:Number(c.size),createdAt:c.createdAt?Io.toDate(c.createdAt):void 0,digest:(e=c.digest)===null||e===void 0?void 0:e.value}}})}o(NPe,"getArtifactInternal");var _Pe=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return o(i,"adopt"),new(r||(r=Promise))(function(s,a){function c(d){try{u(n.next(d))}catch(f){a(f)}}o(c,"fulfilled");function l(d){try{u(n.throw(d))}catch(f){a(f)}}o(l,"rejected");function u(d){d.done?s(d.value):i(d.value).then(c,l)}o(u,"step"),u((n=n.apply(t,e||[])).next())})};function RPe(t,e,r,n,i){return _Pe(this,void 0,void 0,function*(){var s;let[a,c]=eC(RA),l={log:void 0,userAgent:Ql(),previews:void 0,retry:a,request:c},u=th(i,l,kA,QA),d=yield Zk(t,e,r,n,i),f=yield u.rest.actions.deleteArtifact({owner:r,repo:n,artifact_id:d.artifact.id});if(f.status!==204)throw new uc(`Invalid response from GitHub API: ${f.status} (${(s=f?.headers)===null||s===void 0?void 0:s["x-github-request-id"]})`);return{id:d.artifact.id}})}o(RPe,"deleteArtifactPublic");function TPe(t){return _Pe(this,void 0,void 0,function*(){let e=Pl(),{workflowRunBackendId:r,workflowJobRunBackendId:n}=kl(),i={workflowRunBackendId:r,workflowJobRunBackendId:n,nameFilter:Cn.create({value:t})},s=yield e.ListArtifacts(i);if(s.artifacts.length===0)throw new sd(`Artifact not found for name: ${t}`);let a=s.artifacts[0];s.artifacts.length>1&&(a=s.artifacts.sort((u,d)=>Number(d.databaseId)-Number(u.databaseId))[0],Xe(`More than one artifact found for a single name, returning newest (id: ${a.databaseId})`));let c={workflowRunBackendId:a.workflowRunBackendId,workflowJobRunBackendId:a.workflowJobRunBackendId,name:a.name},l=yield e.DeleteArtifact(c);return ct(`Artifact '${t}' (ID: ${l.artifactId}) deleted`),{id:Number(l.artifactId)}})}o(TPe,"deleteArtifactInternal");var DPe=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return o(i,"adopt"),new(r||(r=Promise))(function(s,a){function c(d){try{u(n.next(d))}catch(f){a(f)}}o(c,"fulfilled");function l(d){try{u(n.throw(d))}catch(f){a(f)}}o(l,"rejected");function u(d){d.done?s(d.value):i(d.value).then(c,l)}o(u,"step"),u((n=n.apply(t,e||[])).next())})},eP=nSe(),tP=100,MOt=Math.ceil(eP/tP);function QPe(t,e,r,n){return DPe(this,arguments,void 0,function*(i,s,a,c,l=!1){ct(`Fetching artifact list for workflow run ${i} in repository ${s}/${a}`);let u=[],[d,f]=eC(RA),h={log:void 0,userAgent:Ql(),previews:void 0,retry:d,request:f},p=th(c,h,kA,QA),m=1,{data:g}=yield p.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",{owner:s,repo:a,run_id:i,per_page:tP,page:m}),E=Math.ceil(g.total_count/tP),y=g.total_count;y>eP&&(Ai(`Workflow run ${i} has ${y} artifacts, exceeding the limit of ${eP}. Results will be incomplete as only the first ${eP} artifacts will be returned`),E=MOt);for(let C of g.artifacts)u.push({name:C.name,id:C.id,size:C.size_in_bytes,createdAt:C.created_at?new Date(C.created_at):void 0,digest:C.digest});for(m++,m;m<=E;m++){Xe(`Fetching page ${m} of artifact list`);let{data:C}=yield p.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",{owner:s,repo:a,run_id:i,per_page:tP,page:m});for(let w of C.artifacts)u.push({name:w.name,id:w.id,size:w.size_in_bytes,createdAt:w.created_at?new Date(w.created_at):void 0,digest:w.digest})}return l&&(u=PPe(u)),ct(`Found ${u.length} artifact(s)`),{artifacts:u}})}o(QPe,"listArtifactsPublic");function kPe(){return DPe(this,arguments,void 0,function*(t=!1){let e=Pl(),{workflowRunBackendId:r,workflowJobRunBackendId:n}=kl(),i={workflowRunBackendId:r,workflowJobRunBackendId:n},a=(yield e.ListArtifacts(i)).artifacts.map(c=>{var l;return{name:c.name,id:Number(c.databaseId),size:Number(c.size),creat
`)}return n}o(kFt,"present");var PFt=$Lt.withTags({...jY,resolve:o((t,e,r)=>{let n=jY.resolve(t,e,r);return n===kt?WPe.resolve(t,e,r):n},"resolve")},{...$Y,resolve:o((t,e,r)=>{let n=$Y.resolve(t,e,r);return n===kt?YPe.resolve(t,e,r):n},"resolve")}),OFt={...iK,schema:PFt,skipInvalid:!1,noRefs:!1,flowLevel:-1,transform:o(()=>{},"transform")};function fOe(t,e={}){let r={...OFt,...e},n=tFt(t,r.schema,{noRefs:r.noRefs,skipInvalid:r.skipInvalid});return r.flowLevel>=0&&nFt(n,(i,s)=>{if(!(s.depth<r.flowLevel))return i.style.flow=!0,eOe}),r.transform(n),kFt(n,{...ULt(r,Object.keys(iK)),schema:r.schema})}o(fOe,"dump");var hOe=R(require("os"),1);var lP=class t{static{o(this,"GitHubSummary")}static async writeBuildSummary(e){let r=o(function(l,u,d=!1){return`<ahref="${u}">${l}</a>`+(d?hOe.default.EOL:"")},"addLink"),n=e.exportRes.refs.length,i=n>0?e.exportRes.refs?.[0]:void 0,s=i?e.exportRes.summaries?.[i]:void 0,a=e.driver==="cloud"&&e.endpoint?e.endpoint?.replace(/^cloud:\/\//,"").split("/")[0]:void 0,c=zU.addHeading("Docker Build summary",2);if(a&&n===1&&i&&s){let l=t.formatDBCBuildURL(a,i,s.defaultPlatform);c.addRaw("<p>").addRaw("For a detailed look at the build, you can check the results at:").addRaw("</p>").addRaw("<p>").addRaw(`:whale: ${r(`<strong>${l}</strong>`,l)}`).addRaw("</p>")}if(e.uploadRes){let l=`./${Ze.runId}/${e.uploadRes.url.split("/").slice(-2).join("/")}`;a&&n===1?c.addRaw("<p>").addRaw("You can also download the following build record archive and import it into Docker Desktop's Builds view. ").addBreak().addRaw("Build records include details such as timing, dependencies, results, logs, traces, and other information about a build. ").addRaw(r("Learn more","https://www.docker.com/blog/new-beta-feature-deep-dive-into-github-actions-docker-builds-with-docker-desktop/?utm_source=github&utm_medium=actions")).addRaw("</p>"):c.addRaw("<p>").addRaw("For a detailed look at the build, download the following build record archive and import it into Docker Desktop's Builds view. ").addBreak().addRaw("Build records include details such as timing, dependencies, results, logs, traces, and other information about a build. ").addRaw(r("Learn more","https://www.docker.com/blog/new-beta-feature-deep-dive-into-github-actions-docker-builds-with-docker-desktop/?utm_source=github&utm_medium=actions")).addRaw("</p>"),c.addRaw("<p>").addRaw(`:arrow_down: ${r(`<strong>${re.stringToUnicodeEntities(e.uploadRes.filename)}</strong>`,l)} (${re.formatFileSize(e.uploadRes.size)} - includes <strong>${n} build record${n>1?"s":""}</strong>)`).addRaw("</p>")}else e.exportRes.summaries&&c.addRaw("<p>").addRaw("The following table provides a brief summary of your build.").addBreak().addRaw("For a detailed look at the build, including timing, dependencies, results, logs, traces, and other information, consider enabling the export of the build record so you can import it into Docker Desktop's Builds view. ").addRaw(r("Learn more","https://www.docker.com/blog/new-beta-feature-deep-dive-into-github-actions-docker-builds-with-docker-desktop/?utm_source=github&utm_medium=actions")).addRaw("</p>");if(c.addRaw("<p>").addRaw("Find this useful? ").addRaw(r("Let us know","https://docs.docker.com/feedback/gha-build-summary")).addRaw("</p>"),e.exportRes.summaries){c.addRaw("<p>");let l=[[{header:!0,data:"ID"},{header:!0,data:"Name"},{header:!0,data:"Status"},{header:!0,data:"Cached"},{header:!0,data:"Duration"},...a&&n>1?[{header:!0,data:"Build result URL"}]:[]]],u;for(let d in e.exportRes.summaries)if(Object.prototype.hasOwnProperty.call(e.exportRes.summaries,d)){let f=e.exportRes.summaries[d];l.push([{data:`<code>${d.substring(0,6).toUpperCase()}</code>`},{data:`<strong>${re.stringToUnicodeEntities(f.name)}</strong>`},{data:`${f.status==="completed"?":white_check_mark:":f.status==="canceled"?":no_entry_sign:":":x:"} ${f.status}`},{data:`${f.numCachedSteps>0?Math.round(f.numCachedSteps/f.numTotalSteps*100):0}%`},{data:f.duration},...a&&n>1?[{data:r(":whale: Open",t.formatDBCBuildURL(a,d,f.defaultPlatform))}]:[]]),f.error&&(u=f.error)}c.addTable([...l]),c.add
`),{delimiter:",",trim:!0,columns:!1,relaxColumnCount:!0});for(let i of n){if(i.length==1&&!i[0].startsWith("type="))return e=="local";for(let[s,a]of i.map(c=>c.split("=").map(l=>l.trim())))if(s=="type"&&a==e)return!0}return!1}static hasAttestationType(e,r){let n=bo(r,{delimiter:",",trim:!0,columns:!1,relaxColumnCount:!0});for(let i of n)for(let[s,a]of i.map(c=>c.split("=").map(l=>l.trim())))if(s=="type"&&a==e)return!0;return!1}static resolveAttestationAttrs(e){let r=bo(e,{delimiter:",",trim:!0,columns:!1,relaxColumnCount:!0}),n=[];for(let i of r)for(let s of i)try{let a=re.parseBool(s);n.push(`disabled=${!a}`)}catch{n.push(s)}return n.join(",")}static hasGitAuthTokenSecret(e,r){for(let n of e){if(r&&n.startsWith(`GIT_AUTH_TOKEN.${r}=`))return!0;if(n.startsWith("GIT_AUTH_TOKEN="))return!0}return!1}static parseSecretKvp(e,r){let n=e.indexOf("="),i=e.substring(0,n),s=e.substring(n+1);if(i.length==0||s.length==0)throw new Error(`${e}isnotavalidsecret`);return r&&kc(s),[i,s]}};var lK=R(require("fs"),1),pOe=R(require("path"),1);var uP=class t{static{o(this,"Bake")}buildx;metadataFilename;constructor(e){this.buildx=e?.buildx||new Dt,this.metadataFilename=`bake-metadata-${re.generateRandomString()}.json`}getMetadataFilePath(){return pOe.default.join(mt.tmpDir(),this.metadataFilename)}resolveMetadata(){let e=this.getMetadataFilePath();if(!lK.default.existsSync(e))return;let r=lK.default.readFileSync(e,{encoding:"utf-8"}).trim();if(r!=="null")return JSON.parse(r)}resolveRefs(e){if(!e&&(e=this.resolveMetadata(),!e))return;let r=new Array;for(let n in e)"buildx.build.ref"in e[n]&&r.push(e[n]["buildx.build.ref"]);return r.length>0?r:void 0}resolveWarnings(e){if(!(!e&&(e=this.resolveMetadata(),!e))&&"buildx.build.warnings"in e)return e["buildx.build.warnings"]}async getDefinition(e,r){r=r||{ignoreReturnCode:!0},r.ignoreReturnCode=!0,r.env=Object.assign({},process.env,r.env||{},e.githubToken?{BUILDX_BAKE_GIT_AUTH_TOKEN:e.githubToken}:{});let n=["bake"],i,s=[],a=[...e.files||[],e.source];if(a){for(let l of a.map(u=>u?u.trim():""))if(l.length!=0){if(!re.isValidRef(l)){s.push(l);continue}if(i)throw new Error("Only one remote bake definition can be defined");i=l}}i&&n.push(i);for(let l of s)n.push("--file",l);if(e.overrides)for(let l of e.overrides)n.push("--set",l);if(e.vars)for(let l of e.vars)n.push("--var",l);if(e.allow)for(let l of e.allow)n.push("--allow",l);e.call&&n.push("--call",e.call),e.load&&n.push("--load"),e.noCache&&n.push("--no-cache"),e.provenance&&n.push("--provenance",e.provenance),e.push&&n.push("--push"),e.sbom&&n.push("--sbom",e.sbom);let c=await this.buildx.getCommand([...n,"--print",...e.targets||[]]);return await _e.getExecOutput(c.command,c.args,r).then(l=>{if(l.stderr.length>0&&l.exitCode!=0)throw new Error(`cannotparsebakedefinitions:${l.stderr.match(/(.*)\s*$/)?.[0]?.trim()??"unknown error"}`);return t.parseDefinition(l.stdout.trim())})}static parseDefinition(e){let r=JSON.parse(e);for(let n in r.target){let i=r.target[n];i.attest&&Array.isArray(i.attest)&&(i.attest=i.attest.map(s=>t.parseAttestEntry(s))),i["cache-from"]&&Array.isArray(i["cache-from"])&&(i["cache-from"]=i["cache-from"].map(s=>t.parseCacheEntry(s))),i["cache-to"]&&Array.isArray(i["cache-to"])&&(i["cache-to"]=i["cache-to"].map(s=>t.parseCacheEntry(s))),i.output&&Array.isArray(i.output)&&(i.output=i.output.map(s=>t.parseExportEntry(s))),i.secret&&Array.isArray(i.secret)&&(i.secret=i.secret.map(s=>t.parseSecretEntry(s))),i.ssh&&Array.isArray(i.ssh)&&(i.ssh=i.ssh.map(s=>t.parseSSHEntry(s)))}return r}static parseAttestEntry(e){if(typeof e!="string")return e;let r={type:""},n=bo(e,{relaxColumnCount:!0,skipEmptyLines:!0})[0];for(let i of n){let[s,a]=i.toString().split(/(?<=^[^=]+?)=/).map(c=>c.trim());switch(s){case"type":r.type=a;break;case"disabled":r.disabled=re.parseBool(a);break;default:r[s]=a}}return r}static parseCacheEntry(e){if(typeof e!="string")return e;let r={type:""},n=bo(e,{relaxColumnCount:!0,skipEmptyLines:!0})[0];if(n.length===1&&!n[0].includes("="))return r.type="registry",r.ref=n[0],r;for(let i of n){let[s,a]=i.toString().
`).map(s=>s.trim()).filter(s=>s.length>0);if(i)return`refs/tags/${i}`;throw new Error("Cannot infer ref from detached HEAD")}static async findDetachedTagRef(e,r){let i=(await t.exec(["for-each-ref","--format=%(refname)","--points-at","HEAD","refs/tags/"])).split(`
`).map(s=>s.trim()).filter(s=>s.length>0).sort((s,a)=>a.length-s.length);for(let s of i){let a=`tag:${s.slice(10)}`;if(e===a||e.startsWith(`${a},`))return s}if(i.length===1)return i[0];throw new Error(`Cannotfinddetachedtagrefin"${r}"`)}static async findContainingRef(e){let r=await t.exec(["for-each-ref","--format=%(refname)","--contains","HEAD","--sort=-committerdate",e]),[n]=r.split(`
`).map(i=>i.trim()).filter(i=>i.length>0);return n}static async commitDate(e){return new Date(await t.exec(["show","-s",'--format="%ci"',e]))}};var RMe=require("crypto"),ou=R(require("fs"),1),au=R(require("path"),1);var PC=R(gK(),1),TMe=R(D7(),1),OC=R(xMe(),1);var OX=R(gK(),1);var NMe=R(oc(),1);var vMe="application/vnd.oci.empty.v1+json";var su=class{static{o(this,"Cosign")}binPath;_version;_versionOnce;constructor(e){this.binPath=e?.binPath||"cosign",this._version="",this._versionOnce=!1}async isAvailable(){let e=await _e.getExecOutput(this.binPath,[],{ignoreReturnCode:!0,silent:!0}).then(r=>r.stderr.length>0&&r.exitCode!=0?(D(`Cosign.isAvailablecmderr:${r.stderr.trim()}`),!1):r.exitCode==0).catch(r=>(D(`Cosign.isAvailableerror:${r}`),!1));return D(`Cosign.isAvailable:${e}`),e}async version(){return this._versionOnce?this._version:(this._versionOnce=!0,this._version=await _e.getExecOutput(this.binPath,["version","--json"],{ignoreReturnCode:!0,silent:!0}).then(e=>{if(e.stderr.length>0&&e.exitCode!=0)throw new Error(e.stderr.trim());return JSON.parse(e.stdout.trim()).gitVersion}),this._version)}async printVersion(){await _e.exec(this.binPath,["version","--json"],{failOnStdErr:!1})}async versionSatisfies(e,r){let n=r??await this.version();if(!n)return D("Cosign.versionSatisfies false: undefined version"),!1;let i=NMe.satisfies(n,e)||/^[0-9a-f]{7}$/.exec(n)!==null;return D(`Cosign.versionSatisfies${n}statisfies${e}:${i}`),i}static parseCommandOutput(e){let r,n,i,s;for(let a of e.split(/\r?\n/)){let c=a.trim();if(!c.startsWith("{")||!c.endsWith("}"))continue;let l;try{l=JSON.parse(c)}catch{continue}if(l&&Array.isArray(l.errors)&&l.errors.length>0&&(s=l.errors),!r&&l&&Array.isArray(l.manifests)&&l.manifests.length>0){let u=l.manifests[0];u?.artifactType===OX.BUNDLE_V03_MEDIA_TYPE&&typeof u.digest=="string"?r=u.digest:u?.artifactType===vMe&&typeof u.digest=="string"&&(n=u.digest)}if(!i&&l&&l.mediaType===OX.BUNDLE_V03_MEDIA_TYPE&&(i=l),i&&(r||n)){s=void 0;break}}return{bundle:i,signatureManifestDigest:r||n,errors:s}}};var LX=R(require("fs"),1);var qO=class t{static{o(this,"ImageTools")}buildx;constructor(e){this.buildx=e?.buildx||new Dt}async getCommand(e){return await this.buildx.getCommand(["imagetools",...e])}async getInspectCommand(e){return await this.getCommand(["inspect",...e])}async getCreateCommand(e){return await this.getCommand(["create",...e])}async inspectImage(e){return await this.inspect(e,"{{json .Image}}",r=>{if(typeof r=="object"&&!Array.isArray(r)&&r!==null)return Object.prototype.hasOwnProperty.call(r,"config"),r;throw new Error("Unexpected output format")})}async inspectManifest(e){return await this.inspect(e,"{{json .Manifest}}",r=>{if(typeof r=="object"&&!Array.isArray(r)&&r!==null)return Object.prototype.hasOwnProperty.call(r,"manifests"),r;throw new Error("Unexpected output format")})}async attestationDescriptors(e){let r=await this.inspectManifest(e);if(typeof r!="object"||r===null||!("manifests"in r)||!Array.isArray(r.manifests))throw new Error(`Nodescriptorfoundfor${e.name}`);let n=r.manifests.filter(a=>a.annotations?.["vnd.docker.reference.type"]==="attestation-manifest");if(!e.platform)return n;let i=e.platform,s=new Map;for(let a of r.manifests)a.digest&&s.set(a.digest,a);return n.filter(a=>{let c=a.annotations?.["vnd.docker.reference.digest"];if(!c)return!1;let l=s.get(c);return l?l.platform?.os===i.os&&l.platform?.architecture===i.architecture&&(l.platform?.variant??"")===(i.variant??""):!1})}async attestationDigests(e){return(await this.attestationDescriptors(e)).map(r=>r.digest)}async create(e){let r=[],n=mt.tmpName({tmpdir:mt.tmpDir(),template:"imagetools-metadata-XXXXXX"}),i=[],s=[];for(let c of e.sources){if(c.startsWith("cwd://")){let l=c.substring(6);l.length>0&&i.push(l);continue}s.push(c)}if(e.tags)for(let c of e.tags)r.push("--tag",c);if(e.platforms)for(let c of e.platforms)r.push("--platform",c);if(e.annotations)for(let c of e.annotations)r.push("--annotation",c);e.dryRun?r.push("--dry-run"):r.push("--metadata-file",n);for(let c of i)r.push("--file",c);for(let c of s)r.
${a.message}`),await new Promise(u=>setTimeout(u,Math.pow(2,c)*100))}throw a??new Error(`ImageToolsinspectcommandfailedfor${e.name}`)}async execInspect(e,r,n){return await _e.getExecOutput(e,r,{ignoreReturnCode:!0,silent:!0}).then(i=>{if(i.stderr.length>0&&i.exitCode!=0)throw new Error(i.stderr.trim());return n(JSON.parse(i.stdout))})}static isManifestUnknownError(e){return/(MANIFEST_UNKNOWN|manifest unknown)/i.test(e)||/:\s*not found$/i.test(e)}};var tm="https://search.sigstore.dev";var _Me="slsaprovenance1",bh=class t{static{o(this,"Sigstore")}cosign;imageTools;constructor(e){this.cosign=e?.cosign||new su,this.imageTools=e?.imageTools||new qO}async signAttestationManifests(e){if(!await this.cosign.isAvailable())throw new Error("Cosign is required to sign attestation manifests");let r={};try{if(!process.env.ACTIONS_ID_TOKEN_REQUEST_URL)throw new Error('missing "id-token" permission. Please add "permissions: id-token: write" to your workflow.');let n=await this.cosignSigningConfigArgs(e.noTransparencyLog);for(let i of e.imageNames){let s=await this.imageTools.attestationDigests({name:`${i}@${e.imageDigest}`,retryOnManifestUnknown:e.retryOnManifestUnknown,retryLimit:e.retryLimit});for(let a of s){let c=`${i}@${a}`;await Qr(`Signingattestationmanifest${c}`,async()=>{let l=["sign","--yes","--oidc-provider","github-actions","--registry-referrers-mode","oci-1-1","--new-bundle-format",...n];L(`[command]${this.cosign.binPath}${[...l,c].join(" ")}`);let u=await _e.getExecOutput(this.cosign.binPath,["--verbose",...l,c],{ignoreReturnCode:!0,silent:!0,env:Object.assign({},process.env,{COSIGN_EXPERIMENTAL:"1"})}),d=su.parseCommandOutput(u.stderr.trim());if(u.exitCode!=0)if(d.errors&&d.errors.length>0){let h=d.errors.map(p=>`-[${p.code}]${p.message}:${p.detail}`).join(`
${u}`),await new Promise(d=>setTimeout(d,Math.pow(2,a)*100));else throw s}else throw new Error(`Cosignverifycommandfailedwith:${c.stderr.trim().split(/\r?\n/).filter(u=>u.length>0).pop()??"unknown error"}`)}throw s}async signProvenanceBlobs(e){if(!await this.cosign.isAvailable())throw new Error("Cosign is required to sign provenance blobs");let r={};try{if(!process.env.ACTIONS_ID_TOKEN_REQUEST_URL)throw new Error('missing "id-token" permission. Please add "permissions: id-token: write" to your workflow.');let n=await this.cosignSigningConfigArgs(e.noTransparencyLog),i=t.getProvenanceBlobs(e);for(let s of Object.keys(i))await Qr(`Signing${s}`,async()=>{let a=i[s],c=au.default.join(au.default.dirname(s),`${e.name??"provenance"}.sigstore.json`),l=t.getProvenanceSubjects(a);if(l.length===0){at(`Nosubjectsfoundinprovenance${s},skipsigning.`);return}let u=au.default.join(au.default.dirname(s),l[0].name),d=["attest-blob","--yes","--oidc-provider","github-actions","--new-bundle-format","--statement",s,"--type",_Me,"--bundle",c,...n];L(`[command]${this.cosign.binPath}${[...d,u].join(" ")}`);let f=await _e.getExecOutput(this.cosign.binPath,["--verbose",...d,u],{ignoreReturnCode:!0,silent:!0,env:Object.assign({},process.env,{COSIGN_EXPERIMENTAL:"1"})}),h=su.parseCommandOutput(f.stderr.trim());if(f.exitCode!=0)if(h.errors&&h.errors.length>0){let m=h.errors.map(g=>`-[${g.code}]${g.message}:${g.detail}`).join(`
`);throw new Error(`Cosignattest-blobcommandfailedwitherrors:
${m}`)}else throw new Error(`Cosignattest-blobcommandfailedwith:${f.stderr.trim().split(/\r?\n/).filter(m=>m.length>0).pop()??"unknown error"}`);let p=t.parseBundle((0,PC.bundleFromJSON)(JSON.parse(ou.default.readFileSync(c,{encoding:"utf-8"}))));L("Provenance blob signed for:");for(let m of l){let[g,E]=Object.entries(m.digest)[0]||[];L(`-${m.name}(${g}:${E})`)}p.tlogID&&L(`AttestationsignatureuploadedtoRekortransparencylog:${tm}?logIndex=${p.tlogID}`),L(`Sigstorebundlewrittento:${c}`),r[s]={...p,bundlePath:c,subjects:l}})}catch(n){throw new Error(`SigningBuildKitprovenanceblobsfailed:${n.message}`)}return r}async verifySignedArtifacts(e,r){let n={};if(!await this.cosign.isAvailable())throw new Error("Cosign is required to verify signed artifacts");for(let[i,s]of Object.entries(e)){let a=au.default.dirname(i);await Qr(`Verifyingsignaturebundle${s.bundlePath}`,async()=>{for(let c of s.subjects){let l=au.default.join(a,c.name);L(`Verifyingsignedartifact${l}`);let u=["verify-blob-attestation","--new-bundle-format","--certificate-oidc-issuer","https://token.actions.githubusercontent.com","--certificate-identity-regexp",r.certificateIdentityRegexp,"--type",r.predicateType??_Me];(r.noTransparencyLog||!s.tlogID)&&u.push("--use-signed-timestamps","--insecure-ignore-tlog");let d=await _e.getExecOutput(this.cosign.binPath,[...u,"--bundle",s.bundlePath,l],{ignoreReturnCode:!0});if(d.stderr.length>0&&d.exitCode!=0)throw new Error(d.stderr);n[l]={bundlePath:s.bundlePath,cosignArgs:u}}})}return n}async verifyArtifact(e,r,n){L("Verifying keyless verification bundle signature");let i=JSON.parse(ou.default.readFileSync(r,"utf-8")),s=(0,PC.bundleFromJSON)(i);L("Fetching Sigstore TUF trusted root metadata");let a=await TMe.getTrustedRoot(),c=(0,OC.toTrustMaterial)(a);try{L("Verifying artifact signature");let l=(0,OC.toSignedEntity)(s,ou.default.readFileSync(e)),u=t.parseCertificate(s),d=s.verificationMaterial.tlogEntries,f=d.length>0?d[0].logIndex:void 0;if(n?.subjectAlternativeName&&n?.subjectAlternativeName instanceof RegExp){let m=u.subjectAltName?.replace(/^uri:/i,"");if(m){if(!m.match(n.subjectAlternativeName))throw new Error(`SigningcertificatesubjectAlternativeName"${m}"doesnotmatchexpectedpattern`)}else throw new Error("Signing certificate does not contain subjectAltName")}let p=new OC.Verifier(c).verify(l,{subjectAlternativeName:n?.subjectAlternativeName&&typeof n.subjectAlternativeName=="string"?n.subjectAlternativeName:void 0,extensions:n?.issuer?{issuer:n.issuer}:void 0});return D(`Sigstore.verifyArtifactsigner:${JSON.stringify(p)}`),{payload:i,certificate:u.toString(),tlogID:f}}catch(l){throw new Error(`Failedtoverifyartifactsignature:${l}`)}}static noTransparencyLog(e){return e??Ze.context.payload.repository?.private??!1}async cosignSigningConfigArgs(e){let r=[],n=t.noTransparencyLog(e);return L(`Uploadtotransparencylog:${n?"disabled":"enabled"}`),await this.cosign.versionSatisfies(">=3.0.4")?await Qr("Creating Sigstore protobuf signing config",async()=>{let i=mt.tmpName({template:"signing-config-XXXXXX.json",tmpdir:mt.tmpDir()}),s=["signing-config","create","--with-default-services=true",`--out=${i}`];n&&s.push("--no-default-rekor=true"),await _e.exec(this.cosign.binPath,s,{env:Object.assign({},process.env,{COSIGN_EXPERIMENTAL:"1"})}),L(JSON.stringify(JSON.parse(ou.default.readFileSync(i,{encoding:"utf-8"})),null,2)),r.push(`--signing-config=${i}`)}):(r.push("--use-signing-config"),n&&r.push("--tlog-upload=false")),r}static getProvenanceBlobs(e){let r=au.default.join(e.localExportDir,"provenance.json");if(ou.default.existsSync(r))return{[r]:ou.default.readFileSync(r)};let n=ou.default.readdirSync(e.localExportDir,{withFileTypes:!0}),i=n.filter(s=>s.isDirectory());if(i.length>0&&i.length===n.length&&i.every(s=>ou.default.existsSync(au.default.join(e.localExportDir,s.name,"provenance.json")))){let s={};for(let a of i){let c=au.default.join(e.localExportDir,a.name,"provenance.json");s[c]=ou.default.readFileSync(c)}return s}throw new Error(`Novalidprovenance.jsonfoundin${e.