|
|
|
@@ -0,0 +1,226 @@
|
|
|
|
|
var Hce=Object.create;var iE=Object.defineProperty;var Vce=Object.getOwnPropertyDescriptor;var zce=Object.getOwnPropertyNames;var Jce=Object.getPrototypeOf,Yce=Object.prototype.hasOwnProperty;var o=(t,e)=>iE(t,"name",{value:e,configurable:!0});var h=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),$ce=(t,e)=>{for(var r in e)iE(t,r,{get:e[r],enumerable:!0})},Wce=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of zce(e))!Yce.call(t,n)&&n!==r&&iE(t,n,{get:()=>e[n],enumerable:!(s=Vce(e,n))||s.enumerable});return t};var w=(t,e,r)=>(r=t!=null?Hce(Jce(t)):{},Wce(e||!t||!t.__esModule?iE(r,"default",{value:t,enumerable:!0}):r,t));var nq=h(zu=>{"use strict";var e4e=require("net"),tle=require("tls"),RN=require("http"),tq=require("https"),rle=require("events"),t4e=require("assert"),sle=require("util");zu.httpOverHttp=nle;zu.httpsOverHttp=ile;zu.httpOverHttps=ole;zu.httpsOverHttps=ale;function nle(t){var e=new Uo(t);return e.request=RN.request,e}o(nle,"httpOverHttp");function ile(t){var e=new Uo(t);return e.request=RN.request,e.createSocket=rq,e.defaultPort=443,e}o(ile,"httpsOverHttp");function ole(t){var e=new Uo(t);return e.request=tq.request,e}o(ole,"httpOverHttps");function ale(t){var e=new Uo(t);return e.request=tq.request,e.createSocket=rq,e.defaultPort=443,e}o(ale,"httpsOverHttps");function Uo(t){var e=this;e.options=t||{},e.proxyOptions=e.options.proxy||{},e.maxSockets=e.options.maxSockets||RN.Agent.defaultMaxSockets,e.requests=[],e.sockets=[],e.on("free",o(function(s,n,i,a){for(var c=sq(n,i,a),l=0,u=e.requests.length;l<u;++l){var d=e.requests[l];if(d.host===c.host&&d.port===c.port){e.requests.splice(l,1),d.request.onSocket(s);return}}s.destroy(),e.removeSocket(s)},"onFree"))}o(Uo,"TunnelingAgent");sle.inherits(Uo,rle.EventEmitter);Uo.prototype.addRequest=o(function(e,r,s,n){var i=this,a=TN({request:e},i.options,sq(r,s,n));if(i.sockets.length>=this.maxSockets){i.requests.push(a);return}i.createSocket(a,function(c){c.on("free",l),c.on("close",u),c.on("agentRemove",u),e.onSocket(c);function l(){i.emit("free",c,a)}o(l,"onFree");function u(d){i.removeSocket(c),c.removeListener("free",l),c.removeListener("close",u),c.removeListener("agentRemove",u)}o(u,"onCloseOrRemove")})},"addRequest");Uo.prototype.createSocket=o(function(e,r){var s=this,n={};s.sockets.push(n);var i=TN({},s.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(i.localAddress=e.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),qa("making CONNECT request");var a=s.request(i);a.useChunkedEncodingByDefault=!1,a.once("response",c),a.once("upgrade",l),a.once("connect",u),a.once("error",d),a.end();function c(A){A.upgrade=!0}o(c,"onResponse");function l(A,p,f){process.nextTick(function(){u(A,p,f)})}o(l,"onUpgrade");function u(A,p,f){if(a.removeAllListeners(),p.removeAllListeners(),A.statusCode!==200){qa("tunneling socket could not be established, statusCode=%d",A.statusCode),p.destroy();var m=new Error("tunneling socket could not be established, statusCode="+A.statusCode);m.code="ECONNRESET",e.request.emit("error",m),s.removeSocket(n);return}if(f.length>0){qa("got illegal response body from proxy"),p.destroy();var m=new Error("got illegal response body from proxy");m.code="ECONNRESET",e.request.emit("error",m),s.removeSocket(n);return}return qa("tunneling connection has established"),s.sockets[s.sockets.indexOf(n)]=p,r(p)}o(u,"onConnect");function d(A){a.removeAllListeners(),qa(`tunneling socket could not be established, cause=%s
|
|
|
|
|
`,A.message,A.stack);var p=new Error("tunneling socket could not be established, cause="+A.message);p.code="ECONNRESET",e.request.emit("error",p),s.removeSocket(n)}o(d,"onError")},"createSocket");Uo.prototype.removeSocket=o(function(e){var r=this.sockets.indexOf(e);if(r!==-1){this.sockets.splice(r,1);var s=this.requests.shift();s&&this.createSocket(s,function(n){s.request.onSocket(n)})}},"removeSocket");function rq(t,e){var r=this;Uo.prototype.createSocket.call(r,t,function(s){var n=t.request.getHeader("host"),i=TN({},r.options,{socket:s,servername:n?n.replace(/:.*$/,""):t.host}),a=tle.connect(0,i);r.sockets[r.sockets.indexOf(s)]=a,e(a)})}o(rq,"createSecureSocket");function sq(t,e,r){return typeof t=="string"?{host:t,port:e,localAddress:r}:t}o(sq,"toOptions");function TN(t){for(var e=1,r=arguments.length;e<r;++e){var s=arguments[e];if(typeof s=="object")for(var n=Object.keys(s),i=0,a=n.length;i<a;++i){var c=n[i];s[c]!==void 0&&(t[c]=s[c])}}return t}o(TN,"mergeOptions");var qa;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?qa=o(function(){var t=Array.prototype.slice.call(arguments);typeof t[0]=="string"?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)},"debug"):qa=o(function(){},"debug");zu.debug=qa});var Zp=h((n4e,iq)=>{iq.exports=nq()});var ot=h((i4e,oq)=>{oq.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}});var Te=h((o4e,vq)=>{"use strict";var aq=Symbol.for("undici.error.UND_ERR"),at=class extends Error{static{o(this,"UndiciError")}constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[aq]===!0}[aq]=!0},cq=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),vN=class extends at{static{o(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[cq]===!0}[cq]=!0},lq=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),PN=class extends at{static{o(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[lq]===!0}[lq]=!0},uq=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),_N=class extends at{static{o(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[uq]===!0}[uq]=!0},dq=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),kN=class extends at{static{o(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"
Line truncated
|
|
|
|
|
`)||t.includes("\r")||t.includes("\0"))===!1}o(VG,"isValidHeaderValue");function bde(t,e){let{headersList:r}=e,s=(r.get("referrer-policy",!0)??"").split(","),n="";if(s.length>0)for(let i=s.length;i!==0;i--){let a=s[i-1].trim();if(ade.has(a)){n=a;break}}n!==""&&(t.referrerPolicy=n)}o(bde,"setRequestReferrerPolicyOnRedirect");function wde(){return"allowed"}o(wde,"crossOriginResourcePolicyCheck");function Sde(){return"success"}o(Sde,"corsCheck");function Nde(){return"success"}o(Nde,"TAOCheck");function xde(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}o(xde,"appendFetchMetadata");function Qde(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&xx(t.origin)&&!xx(lf(t))&&(e=null);break;case"same-origin":RE(t,lf(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}o(Qde,"appendRequestOriginHeader");function td(t,e){return t}o(td,"coarsenTime");function Rde(t,e,r){return!t?.startTime||t.startTime<e?{domainLookupStartTime:e,domainLookupEndTime:e,connectionStartTime:e,connectionEndTime:e,secureConnectionStartTime:e,ALPNNegotiatedProtocol:t?.ALPNNegotiatedProtocol}:{domainLookupStartTime:td(t.domainLookupStartTime,r),domainLookupEndTime:td(t.domainLookupEndTime,r),connectionStartTime:td(t.connectionStartTime,r),connectionEndTime:td(t.connectionEndTime,r),secureConnectionStartTime:td(t.secureConnectionStartTime,r),ALPNNegotiatedProtocol:t.ALPNNegotiatedProtocol}}o(Rde,"clampAndCoarsenConnectionTimingInfo");function Tde(t){return td(Ade.now(),t)}o(Tde,"coarsenedSharedCurrentTime");function vde(t){return{startTime:t.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:t.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}o(vde,"createOpaqueTimingInfo");function zG(){return{referrerPolicy:"strict-origin-when-cross-origin"}}o(zG,"makePolicyContainer");function Pde(t){return{referrerPolicy:t.referrerPolicy}}o(Pde,"clonePolicyContainer");function _de(t){let e=t.referrerPolicy;sl(e);let r=null;if(t.referrer==="client"){let c=FG();if(!c||c.origin==="null")return"no-referrer";r=new URL(c)}else t.referrer instanceof URL&&(r=t.referrer);let s=Nx(r),n=Nx(r,!0);s.toString().length>4096&&(s=n);let i=RE(t,s),a=cf(s)&&!cf(t.url);switch(e){case"origin":return n??Nx(r,!0);case"unsafe-url":return s;case"same-origin":return i?n:"no-referrer";case"origin-when-cross-origin":return i?s:n;case"strict-origin-when-cross-origin":{let c=lf(t);return RE(s,c)?s:cf(s)&&!cf(c)?"no-referrer":n}default:return a?"no-referrer":n}}o(_de,"determineRequestsReferrer");function Nx(t,e){return sl(t instanceof URL),t=new URL(t),t.protocol==="file:"||t.protocol==="about:"||t.protocol==="blank:"?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}o(Nx,"stripURLForReferrer");function cf(t){if(!(t instanceof URL))return!1;if(t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="file:")return!0;return e(t.origin);function e(r){if(r==null||r==="null")return!1;let s=new URL(r);return!!(s.protocol==="https:"||s.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(s.hostname)||s.hostname==="localhost"||s.hostname.includes("localhost.")||s.hostname.endsWith(".localhost"))}}o(cf,"isURLPotentiallyTrustworthy");function kde(t,e){if(QE===void 0)return!0;let r=JG(e);if(r==="no metadata"||r.length===0)return!0;let s=Ode(r),n=Mde(r,s);for(let i of n){let a=i.algo,c=i.hash,l=QE.createHash(a).update(t).digest("base64");if(l[l.length-1]==="="&&(l[l.length-2]==="="?l=l.slice(0,-2):l=l.slice(0,-1)),Lde(l,c))return!0}return!1}o(kde,"bytesMatch");var Dde=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function JG(t){let e=[],r=!0;for(let s of t.split(" ")){r=!1;let n=Dde.exec(s);if(n===null||n.groups===void 0||n.groups.algo===void 0)continue;let i=n.groups.algo.toLowerCase();qG.includes(i)&&e.push(n.groups)}return r===!0?"no metadata":e}o(JG,"parseMetadata");function Ode(t){let e=t[0].algo;if(e[3]==="5")return e;for(let r=1;r<t.length;++r){let s=t[r];if(s.algo[3]==="5"){e="sha512";break}else{if(e[3]==="3")continue;s.algo[3]==="3"&&(e="sha384")}}return e}o(Ode,"getStrongestMetadata");function Mde(t,e){if(t.length===1)return t;let r=0;for(let s=0;s<t.length;++s)t[s].algo===e&&(t[r++]=t[s]);return t.length=r,t}o(Mde,"filterMetadataListByAlgorithm");function Lde(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r]){if(t[r]==="+"&&e[r]==="-"||t[r]==="/"&&e[r]==="_")continue;return!1}return!0}o(Lde,"compareBase64Mixed");function Fde(t){}o(Fde,"tryUpgradeReque
Line truncated
|
|
|
|
|
`);function IAe(t){for(let e=0;e<t.length;++e)if((t.charCodeAt(e)&-128)!==0)return!1;return!0}o(IAe,"isAsciiString");function BAe(t){let e=t.length;if(e<27||e>70)return!1;for(let r=0;r<e;++r){let s=t.charCodeAt(r);if(!(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||s===39||s===45||s===95))return!1}return!0}o(BAe,"validateBoundary");function bAe(t,e){vE(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)return"failure";let s=Buffer.from(`--${r}`,"utf8"),n=[],i={position:0};for(;t[i.position]===13&&t[i.position+1]===10;)i.position+=2;let a=t.length;for(;t[a-1]===10&&t[a-2]===13;)a-=2;for(a!==t.length&&(t=t.subarray(0,a));;){if(t.subarray(i.position,i.position+s.length).equals(s))i.position+=s.length;else return"failure";if(i.position===t.length-2&&PE(t,yAe,i)||i.position===t.length-4&&PE(t,CAe,i))return n;if(t[i.position]!==13||t[i.position+1]!==10)return"failure";i.position+=2;let c=wAe(t,i);if(c==="failure")return"failure";let{name:l,filename:u,contentType:d,encoding:A}=c;i.position+=2;let p;{let m=t.indexOf(s.subarray(2),i.position);if(m===-1)return"failure";p=t.subarray(i.position,m-4),i.position+=p.length,A==="base64"&&(p=Buffer.from(p.toString(),"base64"))}if(t[i.position]!==13||t[i.position+1]!==10)return"failure";i.position+=2;let f;u!==null?(d??="text/plain",IAe(d)||(d=""),f=new gAe([p],u,{type:d})):f=AAe(Buffer.from(p)),vE(iH(l)),vE(typeof f=="string"&&iH(f)||fAe(f)),n.push(hAe(l,f,u))}}o(bAe,"multipartFormDataParser");function wAe(t,e){let r=null,s=null,n=null,i=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10)return r===null?"failure":{name:r,filename:s,contentType:n,encoding:i};let a=sd(c=>c!==10&&c!==13&&c!==58,t,e);if(a=kx(a,!0,!0,c=>c===9||c===32),!pAe.test(a.toString())||t[e.position]!==58)return"failure";switch(e.position++,sd(c=>c===32||c===9,t,e),dAe(a)){case"content-disposition":{if(r=s=null,!PE(t,EAe,e)||(e.position+=17,r=cH(t,e),r===null))return"failure";if(PE(t,aH,e)){let c=e.position+aH.length;if(t[c]===42&&(e.position+=1,c+=1),t[c]!==61||t[c+1]!==34||(e.position+=12,s=cH(t,e),s===null))return"failure"}break}case"content-type":{let c=sd(l=>l!==10&&l!==13,t,e);c=kx(c,!1,!0,l=>l===9||l===32),n=oH(c);break}case"content-transfer-encoding":{let c=sd(l=>l!==10&&l!==13,t,e);c=kx(c,!1,!0,l=>l===9||l===32),i=oH(c);break}default:sd(c=>c!==10&&c!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}o(wAe,"parseMultipartFormDataHeaders");function cH(t,e){vE(t[e.position-1]===34);let r=sd(s=>s!==10&&s!==13&&s!==34,t,e);return t[e.position]!==34?null:(e.position++,r=new TextDecoder().decode(r).replace(/%0A/ig,`
|
|
|
|
|
`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),r)}o(cH,"parseMultipartFormDataName");function sd(t,e,r){let s=r.position;for(;s<e.length&&t(e[s]);)++s;return e.subarray(r.position,r.position=s)}o(sd,"collectASequenceOfBytes");function kx(t,e,r,s){let n=0,i=t.length-1;if(e)for(;n<t.length&&s(t[n]);)n++;if(r)for(;i>0&&s(t[i]);)i--;return n===0&&i===t.length-1?t:t.subarray(n,i+1)}o(kx,"removeChars");function PE(t,e,r){if(t.length<e.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[r.position+s])return!1;return!0}o(PE,"bufferStartsWith");lH.exports={multipartFormDataParser:bAe,validateBoundary:BAe}});var od=h((J4e,CH)=>{"use strict";var Af=Ce(),{ReadableStreamFrom:SAe,isBlobLike:dH,isReadableStreamLike:NAe,readableStreamClose:xAe,createDeferredPromise:QAe,fullyReadBody:RAe,extractMimeType:TAe,utf8DecodeBytes:fH}=Ss(),{FormData:AH}=df(),{kState:id}=Ga(),{webidl:vAe}=pr(),{Blob:PAe}=require("node:buffer"),Dx=require("node:assert"),{isErrored:hH,isDisturbed:_Ae}=require("node:stream"),{isArrayBuffer:kAe}=require("node:util/types"),{serializeAMimeType:DAe}=Zr(),{multipartFormDataParser:OAe}=uH(),Ox;try{let t=require("node:crypto");Ox=o(e=>t.randomInt(0,e),"random")}catch{Ox=o(t=>Math.floor(Math.random(t)),"random")}var _E=new TextEncoder;function MAe(){}o(MAe,"noop");var mH=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,gH;mH&&(gH=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!_Ae(e)&&!hH(e)&&e.cancel("Response object has been garbage collected").catch(MAe)}));function EH(t,e=!1){let r=null;t instanceof ReadableStream?r=t:dH(t)?r=t.stream():r=new ReadableStream({async pull(l){let u=typeof n=="string"?_E.encode(n):n;u.byteLength&&l.enqueue(u),queueMicrotask(()=>xAe(l))},start(){},type:"bytes"}),Dx(NAe(r));let s=null,n=null,i=null,a=null;if(typeof t=="string")n=t,a="text/plain;charset=UTF-8";else if(t instanceof URLSearchParams)n=t.toString(),a="application/x-www-form-urlencoded;charset=UTF-8";else if(kAe(t))n=new Uint8Array(t.slice());else if(ArrayBuffer.isView(t))n=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));else if(Af.isFormDataLike(t)){let l=`----formdata-undici-0${`${Ox(1e11)}`.padStart(11,"0")}`,u=`--${l}\r
|
|
|
|
|
Content-Disposition: form-data`;let d=o(y=>y.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"escape"),A=o(y=>y.replace(/\r?\n|\r/g,`\r
|
|
|
|
|
`),"normalizeLinefeeds"),p=[],f=new Uint8Array([13,10]);i=0;let m=!1;for(let[y,E]of t)if(typeof E=="string"){let C=_E.encode(u+`; name="${d(A(y))}"\r
|
|
|
|
|
\r
|
|
|
|
|
${A(E)}\r
|
|
|
|
|
`);p.push(C),i+=C.byteLength}else{let C=_E.encode(`${u}; name="${d(A(y))}"`+(E.name?`; filename="${d(E.name)}"`:"")+`\r
|
|
|
|
|
Content-Type: ${E.type||"application/octet-stream"}\r
|
|
|
|
|
\r
|
|
|
|
|
`);p.push(C,E,f),typeof E.size=="number"?i+=C.byteLength+E.size+f.byteLength:m=!0}let g=_E.encode(`--${l}--\r
|
|
|
|
|
`);p.push(g),i+=g.byteLength,m&&(i=null),n=t,s=o(async function*(){for(let y of p)y.stream?yield*y.stream():yield y},"action"),a=`multipart/form-data; boundary=${l}`}else if(dH(t))n=t,i=t.size,t.type&&(a=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(Af.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:SAe(t)}if((typeof n=="string"||Af.isBuffer(n))&&(i=Buffer.byteLength(n)),s!=null){let l;r=new ReadableStream({async start(){l=s(t)[Symbol.asyncIterator]()},async pull(u){let{value:d,done:A}=await l.next();if(A)queueMicrotask(()=>{u.close(),u.byobRequest?.respond(0)});else if(!hH(r)){let p=new Uint8Array(d);p.byteLength&&u.enqueue(p)}return u.desiredSize>0},async cancel(u){await l.return()},type:"bytes"})}return[{stream:r,source:n,length:i},a]}o(EH,"extractBody");function LAe(t,e=!1){return t instanceof ReadableStream&&(Dx(!Af.isDisturbed(t),"The body has already been consumed."),Dx(!t.locked,"The stream is locked.")),EH(t,e)}o(LAe,"safelyExtractBody");function FAe(t,e){let[r,s]=e.stream.tee();return e.stream=r,{stream:s,length:e.length,source:e.source}}o(FAe,"cloneBody");function UAe(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}o(UAe,"throwIfAborted");function qAe(t){return{blob(){return nd(this,r=>{let s=pH(this);return s===null?s="":s&&(s=DAe(s)),new PAe([r],{type:s})},t)},arrayBuffer(){return nd(this,r=>new Uint8Array(r).buffer,t)},text(){return nd(this,fH,t)},json(){return nd(this,HAe,t)},formData(){return nd(this,r=>{let s=pH(this);if(s!==null)switch(s.essence){case"multipart/form-data":{let n=OAe(r,s);if(n==="failure")throw new TypeError("Failed to parse body as FormData.");let i=new AH;return i[id]=n,i}case"application/x-www-form-urlencoded":{let n=new URLSearchParams(r.toString()),i=new AH;for(let[a,c]of n)i.append(a,c);return i}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return nd(this,r=>new Uint8Array(r),t)}}}o(qAe,"bodyMixinMethods");function GAe(t){Object.assign(t.prototype,qAe(t))}o(GAe,"mixinBody");async function nd(t,e,r){if(vAe.brandCheck(t,r),yH(t))throw new TypeError("Body is unusable: Body has already been read");UAe(t[id]);let s=QAe(),n=o(a=>s.reject(a),"errorSteps"),i=o(a=>{try{s.resolve(e(a))}catch(c){n(c)}},"successSteps");return t[id].body==null?(i(Buffer.allocUnsafe(0)),s.promise):(await RAe(t[id].body,i,n),s.promise)}o(nd,"consumeBody");function yH(t){let e=t[id].body;return e!=null&&(e.stream.locked||Af.isDisturbed(e.stream))}o(yH,"bodyUnusable");function HAe(t){return JSON.parse(fH(t))}o(HAe,"parseJSONFromBytes");function pH(t){let e=t[id].headersList,r=TAe(e);return r==="failure"?null:r}o(pH,"bodyMimeType");CH.exports={extractBody:EH,safelyExtractBody:LAe,cloneBody:FAe,mixinBody:GAe,streamRegistry:gH,hasFinalizationRegistry:mH,bodyUnusable:yH}});var OH=h(($4e,DH)=>{"use strict";var j=require("node:assert"),Z=Ce(),{channels:IH}=Yu(),Mx=Ex(),{RequestContentLengthMismatchError:nl,ResponseContentLengthMismatchError:BH,RequestAbortedError:TH,HeadersTimeoutError:VAe,HeadersOverflowError:zAe,SocketError:ad,InformationalError:cd,BodyTimeoutError:JAe,HTTPParserError:YAe,ResponseExceededMaxSizeError:$Ae}=Te(),{kUrl:vH,kReset:es,kClient:ME,kParser:Xe,kBlocking:hf,kRunning:Ft,kPending:PH,kSize:bH,kWriting:Ha,kQueue:zn,kNoRef:pf,kKeepAliveDefaultTimeout:WAe,kHostHeader:jAe,kPendingIdx:KAe,kRunningIdx:nn,kError:_r,kPipelining:LE,kSocket:ol,kKeepAliveTimeoutValue:UE,kMaxHeadersSize:Lx,kKeepAliveMaxTimeout:XAe,kKeepAliveTimeoutThreshold:ZAe,kHeadersTimeout:epe,kBodyTimeout:tpe,kStrictContentLength:qx,kMaxRequests:wH,kCounter:rpe,kMaxResponseSize:spe,kOnError:SH,kResume:Jo,kHTTPContext:_H}=ot(),Ns=gG(),NH=Buffer.alloc(0),kE=Buffer[Symbol.species],DE=Z.addListener,npe=Z.removeAllListeners,al=Symbol("kIdleSocketValidation"),il=Symbol("kIdleSocketValidationTimeout"),zx=Symbol("kSocketUsed"),Fx;async function ipe(){let t=process.env.JEST_WORKER_ID?Ix():void 0,e;try{e=await WebAssembly.compile(CG())}catch{e=await WebAssembly.compile(t||Ix())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:o((r,s,n)=>0,"wasm_on_url"),wasm_on_status:o((r,s,n)=>{j(Et.ptr===r);let i=s-Ni+Si.byteOffset;return Et.onStatus(new kE(Si.buffer,i,n))||0},"wasm_on_status"),wasm_on_message_begin:o(r=>(j(Et.ptr===r),Et.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:o((r,s,n)=>{j(Et.ptr===r);let i=s-Ni+Si.byteOffset;return Et.onHeaderField(new kE(Si.buffer,i,n))||0},"wasm_on_header_field"),wasm_on_header_value:o((r,s,n)=>{j(Et.ptr===r);let i=s-Ni+Si.byteOffset;return Et.onHeaderValue(new kE(Si.buffer,i,n))||0},"wasm_on_header_value"),wasm_on_headers_complete:o((r,s,n,i)=>(j(Et.ptr===r),Et.onHeadersComplete(s,!!n,!!i)||0),"wasm_on_headers_complete"),wasm_on_body:o((r,s,n)=>{j(Et.ptr===r);let i=s-Ni+Si.byteOffset;return Et.onBody(new kE(Si.buffer,i,n))
Line truncated
|
|
|
|
|
`;if(typeof n=="string"?g+=`host: ${n}\r
|
|
|
|
|
`:g+=t[jAe],i?g+=`connection: upgrade\r
|
|
|
|
|
upgrade: ${i}\r
|
|
|
|
|
`:t[LE]&&!f[es]?g+=`connection: keep-alive\r
|
|
|
|
|
`:g+=`connection: close\r
|
|
|
|
|
`,Array.isArray(u))for(let y=0;y<u.length;y+=2){let E=u[y+0],C=u[y+1];if(Array.isArray(C))for(let I=0;I<C.length;I++)g+=`${E}: ${C[I]}\r
|
|
|
|
|
`;else g+=`${E}: ${C}\r
|
|
|
|
|
`}return IH.sendHeaders.hasSubscribers&&IH.sendHeaders.publish({request:e,headers:g,socket:f}),!l||p===0?QH(m,null,t,e,f,d,g,A):Z.isBuffer(l)?QH(m,l,t,e,f,d,g,A):Z.isBlobLike(l)?typeof l.stream=="function"?RH(m,l.stream(),t,e,f,d,g,A):ppe(m,l,t,e,f,d,g,A):Z.isStream(l)?Ape(m,l,t,e,f,d,g,A):Z.isIterable(l)?RH(m,l,t,e,f,d,g,A):j(!1),!0}o(dpe,"writeH1");function Ape(t,e,r,s,n,i,a,c){j(i!==0||r[Ft]===0,"stream body cannot be pipelined");let l=!1,u=new qE({abort:t,socket:n,request:s,contentLength:i,client:r,expectsPayload:c,header:a}),d=o(function(m){if(!l)try{!u.write(m)&&this.pause&&this.pause()}catch(g){Z.destroy(this,g)}},"onData"),A=o(function(){l||e.resume&&e.resume()},"onDrain"),p=o(function(){if(queueMicrotask(()=>{e.removeListener("error",f)}),!l){let m=new TH;queueMicrotask(()=>f(m))}},"onClose"),f=o(function(m){if(!l){if(l=!0,j(n.destroyed||n[Ha]&&r[Ft]<=1),n.off("drain",A).off("error",f),e.removeListener("data",d).removeListener("end",f).removeListener("close",p),!m)try{u.end()}catch(g){m=g}u.destroy(m),m&&(m.code!=="UND_ERR_INFO"||m.message!=="reset")?Z.destroy(e,m):Z.destroy(e)}},"onFinished");e.on("data",d).on("end",f).on("error",f).on("close",p),e.resume&&e.resume(),n.on("drain",A).on("error",f),e.errorEmitted??e.errored?setImmediate(()=>f(e.errored)):(e.endEmitted??e.readableEnded)&&setImmediate(()=>f(null)),(e.closeEmitted??e.closed)&&setImmediate(p)}o(Ape,"writeStream");function QH(t,e,r,s,n,i,a,c){try{e?Z.isBuffer(e)&&(j(i===e.byteLength,"buffer body must have content length"),n.cork(),n.write(`${a}content-length: ${i}\r
|
|
|
|
|
\r
|
|
|
|
|
`,"latin1"),n.write(e),n.uncork(),s.onBodySent(e),!c&&s.reset!==!1&&(n[es]=!0)):i===0?n.write(`${a}content-length: 0\r
|
|
|
|
|
\r
|
|
|
|
|
`,"latin1"):(j(i===null,"no body must not have content length"),n.write(`${a}\r
|
|
|
|
|
`,"latin1")),s.onRequestSent(),r[Jo]()}catch(l){t(l)}}o(QH,"writeBuffer");async function ppe(t,e,r,s,n,i,a,c){j(i===e.size,"blob body must have content length");try{if(i!=null&&i!==e.size)throw new nl;let l=Buffer.from(await e.arrayBuffer());n.cork(),n.write(`${a}content-length: ${i}\r
|
|
|
|
|
\r
|
|
|
|
|
`,"latin1"),n.write(l),n.uncork(),s.onBodySent(l),s.onRequestSent(),!c&&s.reset!==!1&&(n[es]=!0),r[Jo]()}catch(l){t(l)}}o(ppe,"writeBlob");async function RH(t,e,r,s,n,i,a,c){j(i!==0||r[Ft]===0,"iterator body cannot be pipelined");let l=null;function u(){if(l){let p=l;l=null,p()}}o(u,"onDrain");let d=o(()=>new Promise((p,f)=>{j(l===null),n[_r]?f(n[_r]):l=p}),"waitForDrain");n.on("close",u).on("drain",u);let A=new qE({abort:t,socket:n,request:s,contentLength:i,client:r,expectsPayload:c,header:a});try{for await(let p of e){if(n[_r])throw n[_r];A.write(p)||await d()}A.end()}catch(p){A.destroy(p)}finally{n.off("close",u).off("drain",u)}}o(RH,"writeIterable");var qE=class{static{o(this,"AsyncWriter")}constructor({abort:e,socket:r,request:s,contentLength:n,client:i,expectsPayload:a,header:c}){this.socket=r,this.request=s,this.contentLength=n,this.client=i,this.bytesWritten=0,this.expectsPayload=a,this.header=c,this.abort=e,r[Ha]=!0}write(e){let{socket:r,request:s,contentLength:n,client:i,bytesWritten:a,expectsPayload:c,header:l}=this;if(r[_r])throw r[_r];if(r.destroyed)return!1;let u=Buffer.byteLength(e);if(!u)return!0;if(n!==null&&a+u>n){if(i[qx])throw new nl;process.emitWarning(new nl)}r.cork(),a===0&&(!c&&s.reset!==!1&&(r[es]=!0),n===null?r.write(`${l}transfer-encoding: chunked\r
|
|
|
|
|
`,"latin1"):r.write(`${l}content-length: ${n}\r
|
|
|
|
|
\r
|
|
|
|
|
`,"latin1")),n===null&&r.write(`\r
|
|
|
|
|
${u.toString(16)}\r
|
|
|
|
|
`,"latin1"),this.bytesWritten+=u;let d=r.write(e);return r.uncork(),s.onBodySent(e),d||r[Xe].timeout&&r[Xe].timeoutType===ld&&r[Xe].timeout.refresh&&r[Xe].timeout.refresh(),d}end(){let{socket:e,contentLength:r,client:s,bytesWritten:n,expectsPayload:i,header:a,request:c}=this;if(c.onRequestSent(),e[Ha]=!1,e[_r])throw e[_r];if(!e.destroyed){if(n===0?i?e.write(`${a}content-length: 0\r
|
|
|
|
|
\r
|
|
|
|
|
`,"latin1"):e.write(`${a}\r
|
|
|
|
|
`,"latin1"):r===null&&e.write(`\r
|
|
|
|
|
0\r
|
|
|
|
|
\r
|
|
|
|
|
`,"latin1"),r!==null&&n!==r){if(s[qx])throw new nl;process.emitWarning(new nl)}e[Xe].timeout&&e[Xe].timeoutType===ld&&e[Xe].timeout.refresh&&e[Xe].timeout.refresh(),s[Jo]()}}destroy(e){let{socket:r,client:s,abort:n}=this;r[Ha]=!1,e&&(j(s[Ft]<=1,"pipeline should only contain this request"),n(e))}};DH.exports=ape});var VH=h((j4e,HH)=>{"use strict";var on=require("node:assert"),{pipeline:fpe}=require("node:stream"),be=Ce(),{RequestContentLengthMismatchError:Jx,RequestAbortedError:MH,SocketError:mf,InformationalError:Yx}=Te(),{kUrl:GE,kReset:VE,kClient:ud,kRunning:zE,kPending:hpe,kQueue:Va,kPendingIdx:$x,kRunningIdx:Jn,kError:$n,kSocket:nr,kStrictContentLength:mpe,kOnError:Wx,kMaxConcurrentStreams:GH,kHTTP2Session:Yn,kResume:za,kSize:gpe,kHTTPContext:Epe}=ot(),Yo=Symbol("open streams"),LH,FH=!1,HE;try{HE=require("node:http2")}catch{HE={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:ype,HTTP2_HEADER_METHOD:Cpe,HTTP2_HEADER_PATH:Ipe,HTTP2_HEADER_SCHEME:Bpe,HTTP2_HEADER_CONTENT_LENGTH:bpe,HTTP2_HEADER_EXPECT:wpe,HTTP2_HEADER_STATUS:Spe}}=HE;function Npe(t){let e=[];for(let[r,s]of Object.entries(t))if(Array.isArray(s))for(let n of s)e.push(Buffer.from(r),Buffer.from(n));else e.push(Buffer.from(r),Buffer.from(s));return e}o(Npe,"parseH2Headers");async function xpe(t,e){t[nr]=e,FH||(FH=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=HE.connect(t[GE],{createConnection:o(()=>e,"createConnection"),peerMaxConcurrentStreams:t[GH]});r[Yo]=0,r[ud]=t,r[nr]=e,be.addListener(r,"error",Rpe),be.addListener(r,"frameError",Tpe),be.addListener(r,"end",vpe),be.addListener(r,"goaway",Ppe),be.addListener(r,"close",function(){let{[ud]:n}=this,{[nr]:i}=n,a=this[nr][$n]||this[$n]||new mf("closed",be.getSocketInfo(i));if(n[Yn]=null,n.destroyed){on(n[hpe]===0);let c=n[Va].splice(n[Jn]);for(let l=0;l<c.length;l++){let u=c[l];be.errorRequest(n,u,a)}}}),r.unref(),t[Yn]=r,e[Yn]=r,be.addListener(e,"error",function(n){on(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[$n]=n,this[ud][Wx](n)}),be.addListener(e,"end",function(){be.destroy(this,new mf("other side closed",be.getSocketInfo(this)))}),be.addListener(e,"close",function(){let n=this[$n]||new mf("closed",be.getSocketInfo(this));t[nr]=null,this[Yn]!=null&&this[Yn].destroy(n),t[$x]=t[Jn],on(t[zE]===0),t.emit("disconnect",t[GE],[t],n),t[za]()});let s=!1;return e.on("close",()=>{s=!0}),{version:"h2",defaultPipelining:1/0,write(...n){return kpe(t,...n)},resume(){Qpe(t)},destroy(n,i){s?queueMicrotask(i):e.destroy(n).on("close",i)},get destroyed(){return e.destroyed},busy(){return!1}}}o(xpe,"connectH2");function Qpe(t){let e=t[nr];e?.destroyed===!1&&(t[gpe]===0&&t[GH]===0?(e.unref(),t[Yn].unref()):(e.ref(),t[Yn].ref()))}o(Qpe,"resumeH2");function Rpe(t){on(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[nr][$n]=t,this[ud][Wx](t)}o(Rpe,"onHttp2SessionError");function Tpe(t,e,r){if(r===0){let s=new Yx(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[nr][$n]=s,this[ud][Wx](s)}}o(Tpe,"onHttp2FrameError");function vpe(){let t=new mf("other side closed",be.getSocketInfo(this[nr]));this.destroy(t),be.destroy(this[nr],t)}o(vpe,"onHttp2SessionEnd");function Ppe(t){let e=this[$n]||new mf(`HTTP/2: "GOAWAY" frame received with code ${t}`,be.getSocketInfo(this)),r=this[ud];if(r[nr]=null,r[Epe]=null,this[Yn]!=null&&(this[Yn].destroy(e),this[Yn]=null),be.destroy(this[nr],e),r[Jn]<r[Va].length){let s=r[Va][r[Jn]];r[Va][r[Jn]++]=null,be.errorRequest(r,s,e),r[$x]=r[Jn]}on(r[zE]===0),r.emit("disconnect",r[GE],[r],e),r[za]()}o(Ppe,"onHTTP2GoAway");function _pe(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}o(_pe,"shouldSendContentLength");function kpe(t,e){let r=t[Yn],{method:s,path:n,host:i,upgrade:a,expectContinue:c,signal:l,headers:u}=e,{body:d}=e;if(a)return be.errorRequest(t,e,new Error("Upgrade not supported for H2")),!1;let A={};for(let B=0;B<u.length;B+=2){let N=u[B+0],Q=u[B+1];if(Array.isArray(Q))for(let D=0;D<Q.length;D++)A[N]?A[N]+=`,${Q[D]}`:A[N]=Q[D];else A[N]=Q}let p,{hostname:f,port:m}=t[GE];A[ype]=i||`${f}${m?`:${m}`:""}`,A[Cpe]=s;let g=o(B=>{e.aborted||e.completed||(B=B||new MH,be.errorRequest(t,e,B),p!=null&&be.destroy(p,B),be.destroy(d,B),t[Va][t[Jn]++]=null,t[za]())},"abort");try{e.onConnect(g)}catch(B){be.errorRequest(t,e,B)}if(e.aborted)return!1;if(s==="CONNECT")return r.ref(),p=r.request(A,{endStream:!1,signal:l}),p.id&&!p.pending?(e.onUpgrade(null,null,p),++r[Yo],t[Va][t[Jn]++]=null):p.once("ready",()=>{e.onUpgrade(null,null,p),++r[Yo],t[Va][t[Jn]++]=null}),p.once("close",()=>{r[Yo]-=1,r[Yo]===0&&r.unref()}),!0;A[Ipe]=n,A[Bpe]="https";let y=s==="PUT"||s==="POST"||s==="PATCH";d&&typeof d.read=="function"&&d.read(0);let E=be.bodyLength(d);if(be.isFormDataLike(d)){LH??=od().extractBody;let[B,N]=LH(d);A["content-type"]=N,d=B.stream,E=B.length}if(E==null&&(E=e.contentLength),(E===0||!y)&&(E=null),_pe(s)&&E>0&&e.contentLength!=null&&e.contentLength!==E){if(t[mpe])return be.errorRequest(t,e,n
Line truncated
|
|
|
|
|
`,this[ofe]=l??3e5,this[ife]=n??3e5,this[afe]=C??!0,this[cfe]=B,this[Zx]=Q,this[Ya]=null,this[pfe]=le>-1?le:-1,this[hfe]=Oe??100,this[Rt]=null,this[Wn]=[],this[Wo]=0,this[jn]=0,this[Cf]=ue=>tQ(this,ue),this[ffe]=ue=>rV(this,ue)}get pipelining(){return this[WE]}set pipelining(e){this[WE]=e,this[Cf](!0)}get[bf](){return this[Wn].length-this[jn]}get[Bf](){return this[jn]-this[Wo]}get[If](){return this[Wn].length-this[Wo]}get[Xpe](){return!!this[Rt]&&!this[Ad]&&!this[Rt].destroyed}get[Xx](){return!!(this[Rt]?.busy(null)||this[If]>=(tV(this)||1)||this[bf]>0)}[Kpe](e){sV(this),this.once("connect",e)}[Afe](e,r){let s=e.origin||this[Qi].origin,n=new zpe(s,e,r);return this[Wn].push(n),this[ll]||(cl.bodyLength(n.body)==null&&cl.isIterable(n.body)?(this[ll]=1,queueMicrotask(()=>tQ(this))):this[Cf](!0)),this[ll]&&this[$a]!==2&&this[Xx]&&(this[$a]=2),this[$a]<2}async[ufe](){return new Promise(e=>{this[If]?this[Ya]=e:e(null)})}async[dfe](e){return new Promise(r=>{let s=this[Wn].splice(this[jn]);for(let i=0;i<s.length;i++){let a=s[i];cl.errorRequest(this,a,e)}let n=o(()=>{this[Ya]&&(this[Ya](),this[Ya]=null),r(null)},"callback");this[Rt]?(this[Rt].destroy(e,n),this[Rt]=null):queueMicrotask(n),this[Cf]()})}},Efe=$E();function rV(t,e){if(t[Bf]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){$o(t[jn]===t[Wo]);let r=t[Wn].splice(t[Wo]);for(let s=0;s<r.length;s++){let n=r[s];cl.errorRequest(t,n,e)}$o(t[If]===0)}}o(rV,"onError");async function sV(t){$o(!t[Ad]),$o(!t[Rt]);let{host:e,hostname:r,protocol:s,port:n}=t[Qi];if(r[0]==="["){let i=r.indexOf("]");$o(i!==-1);let a=r.substring(1,i);$o(eV.isIP(a)),r=a}t[Ad]=!0,dd.beforeConnect.hasSubscribers&&dd.beforeConnect.publish({connectParams:{host:e,hostname:r,protocol:s,port:n,version:t[Rt]?.version,servername:t[Ja],localAddress:t[yf]},connector:t[Ef]});try{let i=await new Promise((a,c)=>{t[Ef]({host:e,hostname:r,protocol:s,port:n,servername:t[Ja],localAddress:t[yf]},(l,u)=>{l?c(l):a(u)})});if(t.destroyed){cl.destroy(i.on("error",XH),new $pe);return}$o(i);try{t[Rt]=i.alpnProtocol==="h2"?await gfe(t,i):await mfe(t,i)}catch(a){throw i.destroy().on("error",XH),a}t[Ad]=!1,i[lfe]=0,i[Zx]=t[Zx],i[jpe]=t,i[efe]=null,dd.connected.hasSubscribers&&dd.connected.publish({connectParams:{host:e,hostname:r,protocol:s,port:n,version:t[Rt]?.version,servername:t[Ja],localAddress:t[yf]},connector:t[Ef],socket:i}),t.emit("connect",t[Qi],[t])}catch(i){if(t.destroyed)return;if(t[Ad]=!1,dd.connectError.hasSubscribers&&dd.connectError.publish({connectParams:{host:e,hostname:r,protocol:s,port:n,version:t[Rt]?.version,servername:t[Ja],localAddress:t[yf]},connector:t[Ef],error:i}),i.code==="ERR_TLS_CERT_ALTNAME_INVALID")for($o(t[Bf]===0);t[bf]>0&&t[Wn][t[jn]].servername===t[Ja];){let a=t[Wn][t[jn]++];cl.errorRequest(t,a,i)}else rV(t,i);t.emit("connectionError",t[Qi],[t],i)}t[Cf]()}o(sV,"connect");function ZH(t){t[$a]=0,t.emit("drain",t[Qi],[t])}o(ZH,"emitDrain");function tQ(t,e){t[ll]!==2&&(t[ll]=2,yfe(t,e),t[ll]=0,t[Wo]>256&&(t[Wn].splice(0,t[Wo]),t[jn]-=t[Wo],t[Wo]=0))}o(tQ,"resume");function yfe(t,e){for(;;){if(t.destroyed){$o(t[bf]===0);return}if(t[Ya]&&!t[If]){t[Ya](),t[Ya]=null;return}if(t[Rt]&&t[Rt].resume(),t[Xx])t[$a]=2;else if(t[$a]===2){e?(t[$a]=1,queueMicrotask(()=>ZH(t))):ZH(t);continue}if(t[bf]===0||t[Bf]>=(tV(t)||1))return;let r=t[Wn][t[jn]];if(t[Qi].protocol==="https:"&&t[Ja]!==r.servername){if(t[Bf]>0)return;t[Ja]=r.servername,t[Rt]?.destroy(new Ype("servername changed"),()=>{t[Rt]=null,tQ(t)})}if(t[Ad])return;if(!t[Rt]){sV(t);return}if(t[Rt].destroyed||t[Rt].busy(r))return;!r.aborted&&t[Rt].write(r)?t[jn]++:t[Wn].splice(t[jn],1)}}o(yfe,"_resume");nV.exports=eQ});var rQ=h((i5e,iV)=>{"use strict";var jE=class{static{o(this,"FixedCircularBuffer")}constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};iV.exports=class{static{o(this,"FixedQueue")}constructor(){this.head=this.tail=new jE}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new jE),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var aV=h((a5e,oV)=>{var{kFree:Cfe,kConnected:Ife,kPending:Bfe,kQueued:bfe,kRunning:wfe,kSize:Sfe}=ot(),ul=Symbol("pool"),sQ=class{static{o(this,"PoolStats")}constructor(e){this[ul]=e}get connected(){return this[ul][Ife]}get free(){return this[ul][Cfe]}get pending(){return this[ul][Bfe]}get queued(){return this[ul][bfe]}get running(){return this[ul][wfe]}get size(){return this[ul][Sfe]}};oV.exports=sQ});var lQ=h((l5e,gV)=>{"use strict";var Nfe=Ku(),xfe=rQ(),{kConnected:nQ,kSize:cV,kRunning:lV,kPending:uV,kQueued:wf,kBusy:Qfe,kFree:Rfe,kUrl:Tfe,kClose:vfe,kDestroy:Pfe,kDispatch:_fe}=ot(),kfe=aV(),ts=Symbol("cl
Line truncated
|
|
|
|
|
${s.count} ${s.noun} ${s.is} pending:
|
|
|
|
|
|
|
|
|
|
${e.format(r)}
|
|
|
|
|
`.trim())}};bJ.exports=lR});var fy=h((a8e,QJ)=>{"use strict";var SJ=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:oge}=Te(),age=hd();xJ()===void 0&&NJ(new age);function NJ(t){if(!t||typeof t.dispatch!="function")throw new oge("Argument agent must implement Agent");Object.defineProperty(globalThis,SJ,{value:t,writable:!0,enumerable:!1,configurable:!1})}o(NJ,"setGlobalDispatcher");function xJ(){return globalThis[SJ]}o(xJ,"getGlobalDispatcher");QJ.exports={setGlobalDispatcher:NJ,getGlobalDispatcher:xJ}});var hy=h((u8e,RJ)=>{"use strict";RJ.exports=class{static{o(this,"DecoratorHandler")}#e;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}});var vJ=h((A8e,TJ)=>{"use strict";var cge=YE();TJ.exports=t=>{let e=t?.maxRedirections;return r=>o(function(n,i){let{maxRedirections:a=e,...c}=n;if(!a)return r(n,i);let l=new cge(r,a,n,i);return r(c,l)},"redirectInterceptor")}});var _J=h((f8e,PJ)=>{"use strict";var lge=ny();PJ.exports=t=>e=>o(function(s,n){return e(s,new lge({...s,retryOptions:{...t,...s.retryOptions}},{handler:n,dispatch:e}))},"retryInterceptor")});var DJ=h((m8e,kJ)=>{"use strict";var uge=Ce(),{InvalidArgumentError:dge,RequestAbortedError:Age}=Te(),pge=hy(),uR=class extends pge{static{o(this,"DumpHandler")}#e=1024*1024;#t=null;#s=!1;#r=!1;#n=0;#i=null;#a=null;constructor({maxSize:e},r){if(super(r),e!=null&&(!Number.isFinite(e)||e<1))throw new dge("maxSize must be a number greater than 0");this.#e=e??this.#e,this.#a=r}onConnect(e){this.#t=e,this.#a.onConnect(this.#o.bind(this))}#o(e){this.#r=!0,this.#i=e}onHeaders(e,r,s,n){let a=uge.parseHeaders(r)["content-length"];if(a!=null&&a>this.#e)throw new Age(`Response size (${a}) larger than maxSize (${this.#e})`);return this.#r?!0:this.#a.onHeaders(e,r,s,n)}onError(e){this.#s||(e=this.#i??e,this.#a.onError(e))}onData(e){return this.#n=this.#n+e.length,this.#n>=this.#e&&(this.#s=!0,this.#r?this.#a.onError(this.#i):this.#a.onComplete([])),!0}onComplete(e){if(!this.#s){if(this.#r){this.#a.onError(this.reason);return}this.#a.onComplete(e)}}};function fge({maxSize:t}={maxSize:1024*1024}){return e=>o(function(s,n){let{dumpMaxSize:i=t}=s,a=new uR({maxSize:i},n);return e(s,a)},"Intercept")}o(fge,"createDumpInterceptor");kJ.exports=fge});var LJ=h((E8e,MJ)=>{"use strict";var{isIP:hge}=require("node:net"),{lookup:mge}=require("node:dns"),gge=hy(),{InvalidArgumentError:Sd,InformationalError:Ege}=Te(),OJ=Math.pow(2,31)-1,dR=class{static{o(this,"DNSInstance")}#e=0;#t=0;#s=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#n}get full(){return this.#s.size===this.#t}runLookup(e,r,s){let n=this.#s.get(e.hostname);if(n==null&&this.full){s(null,e.origin);return}let i={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(n==null)this.lookup(e,i,(a,c)=>{if(a||c==null||c.length===0){s(a??new Ege("No DNS entries found"));return}this.setRecords(e,c);let l=this.#s.get(e.hostname),u=this.pick(e,l,i.affinity),d;typeof u.port=="number"?d=`:${u.port}`:e.port!==""?d=`:${e.port}`:d="",s(null,`${e.protocol}//${u.family===6?`[${u.address}]`:u.address}${d}`)});else{let a=this.pick(e,n,i.affinity);if(a==null){this.#s.delete(e.hostname),this.runLookup(e,r,s);return}let c;typeof a.port=="number"?c=`:${a.port}`:e.port!==""?c=`:${e.port}`:c="",s(null,`${e.protocol}//${a.family===6?`[${a.address}]`:a.address}${c}`)}}#r(e,r,s){mge(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(n,i)=>{if(n)return s(n);let a=new Map;for(let c of i)a.set(`${c.address}:${c.family}`,c);s(null,a.values())})}#n(e,r,s){let n=null,{records:i,offset:a}=r,c;if(this.dualStack?(s==null&&(a==null||a===OJ?(r.offset=0,s=4):(r.offset++,s=(r.offset&1)===1?6:4)),i[s]!=null&&i[s].ips.length>0?c=i[s]:c=i[s===4?6:4]):c=i[s],c==null||c.ips.length===0)return n;c.offset==null||c.offset===OJ?c.offset=0:c.offset++;let l=c.offset%c.ips.length;return n=c.ips[l]??null,n==null?n:Date.now()-n.timestamp>n.ttl?(c.ips.splice(l,1),this.pick(e,r,s)):n}setRecords(e,r){let s=Date.now(),n={records:{4:null,6:null}};for(let i of r){i.timestamp=s,typeof i.ttl=="number"?i.ttl=Math.min(i.ttl,this.#e):i.ttl=this.#e;let a=n.records[i.family]??{ips:[]};a.ips.push(i),n.records[i.family]=a}this.#s.set(e.hostname,n)}getHandler(e,r){return new AR(this,e,r)}},AR=class extends gge{static{o(this,"DNSDispatchHandler")}#e=null;#t=null;#s=null
Line truncated
|
|
|
|
|
${i}`;break;case"retry":g3(i)&&(r[n]=i);break;case"id":E3(i)&&(r[n]=i);break;case"event":i.length>0&&(r[n]=i);break}}processEvent(e){e.retry&&g3(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&E3(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};y3.exports={EventSourceStream:ZR}});var Q3=h((I6e,x3)=>{"use strict";var{pipeline:NIe}=require("node:stream"),{fetching:xIe}=Lf(),{makeRequest:QIe}=Qd(),{webidl:ea}=pr(),{EventSourceStream:RIe}=C3(),{parseMIMEType:TIe}=Zr(),{createFastMessageEvent:vIe}=kd(),{isNetworkError:I3}=Of(),{delay:PIe}=KR(),{kEnumerableProperty:Sl}=Ce(),{environmentSettingsObject:B3}=Ss(),b3=!1,w3=3e3,Xf=0,S3=1,Zf=2,_Ie="anonymous",kIe="use-credentials",Fd=class t extends EventTarget{static{o(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#s=!1;#r=Xf;#n=null;#i=null;#a;#o;constructor(e,r={}){super(),ea.util.markAsUncloneable(this);let s="EventSource constructor";ea.argumentLengthCheck(arguments,1,s),b3||(b3=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=ea.converters.USVString(e,s,"url"),r=ea.converters.EventSourceInitDict(r,s,"eventSourceInitDict"),this.#a=r.dispatcher,this.#o={lastEventId:"",reconnectionTime:w3};let n=B3,i;try{i=new URL(e,n.settingsObject.baseUrl),this.#o.origin=i.origin}catch(l){throw new DOMException(l,"SyntaxError")}this.#t=i.href;let a=_Ie;r.withCredentials&&(a=kIe,this.#s=!0);let c={redirect:"follow",keepalive:!0,mode:"cors",credentials:a==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};c.client=B3.settingsObject,c.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],c.cache="no-store",c.initiator="other",c.urlList=[new URL(this.#t)],this.#n=QIe(c),this.#l()}get readyState(){return this.#r}get url(){return this.#t}get withCredentials(){return this.#s}#l(){if(this.#r===Zf)return;this.#r=Xf;let e={request:this.#n,dispatcher:this.#a},r=o(s=>{I3(s)&&(this.dispatchEvent(new Event("error")),this.close()),this.#c()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=s=>{if(I3(s))if(s.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#c();return}let n=s.headersList.get("content-type",!0),i=n!==null?TIe(n):"failure",a=i!=="failure"&&i.essence==="text/event-stream";if(s.status!==200||a===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#r=S3,this.dispatchEvent(new Event("open")),this.#o.origin=s.urlList[s.urlList.length-1].origin;let c=new RIe({eventSourceSettings:this.#o,push:o(l=>{this.dispatchEvent(vIe(l.type,l.options))},"push")});NIe(s.body.stream,c,l=>{l?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#i=xIe(e)}async#c(){this.#r!==Zf&&(this.#r=Xf,this.dispatchEvent(new Event("error")),await PIe(this.#o.reconnectionTime),this.#r===Xf&&(this.#o.lastEventId.length&&this.#n.headersList.set("last-event-id",this.#o.lastEventId,!0),this.#l()))}close(){ea.brandCheck(this,t),this.#r!==Zf&&(this.#r=Zf,this.#i.abort(),this.#n=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}},N3={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Xf,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:S3,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:Zf,writable:!1}};Object.defineProperties(Fd,N3);Object.defineProperties(Fd.prototype,N3);Object.defineProperties(Fd.prototype,{close:Sl,onerror:Sl,onmessage:Sl,onopen:Sl,readyState:Sl,url:Sl,withCredentials:Sl});ea.converters.EventSourceInitDict=ea.dictionaryConverter([{key:"withCredentials",converter:ea.converters.boolean,defaultValue:o(()=>!1,"defaultValue")},{key:"dispatcher",converter:ea.converters.any}]);x3.exports={EventSource:Fd,defaultReconnectionTime:w3}});var qd=h((b6e,te)=>{"use strict";var DIe=pd(),R3=tf(),OIe=fd(),MIe=NV(),LIe=hd(),FIe=BQ(),UIe=jV(),qIe=rz(),T3=Te(),rC=Ce(),{InvalidArgumentError:tC}=T3,Ud=Gz(),GIe=sf(),HIe=sR(),VIe=wJ(),zIe=oR(),JIe=VQ(),YIe=ny(),{getGlobalDispatcher:v3,setGlobalDispatcher:$Ie}=fy(),WIe=hy(),jIe=YE(),KIe=$E();Object.assign(R3.prototype,Ud);te.exports.Dispatcher=R3;te.exports.Client=DIe;te.exports.Pool=OIe;te.exports.BalancedPool=MIe;te.exports.Agent=LIe;te.exports.
Line truncated
|
|
|
|
|
%s`,N,N,C,s);var Q=C.type==="*"?rv:C.type==="?"?tv:"\\"+C.type;n=!0,s=s.slice(0,C.reStart)+Q+"\\("+N}m(),i&&(s+="\\\\");var D=!1;switch(s.charAt(0)){case"[":case".":case"(":D=!0}for(var le=c.length-1;le>-1;le--){var Se=c[le],Re=s.slice(0,Se.reStart),Oe=s.slice(Se.reStart,Se.reEnd-8),me=s.slice(Se.reEnd-8,Se.reEnd),Je=s.slice(Se.reEnd);me+=Je;var ue=Re.split("(").length-1,vr=Je;for(g=0;g<ue;g++)vr=vr.replace(/\)[+*?]?/,"");Je=vr;var J="";Je===""&&e!==xC&&(J="$");var Me=Re+Oe+Je+J+me;s=Me}if(s!==""&&n&&(s="(?=.)"+s),D&&(s=p+s),e===xC)return[s,n];if(!n)return hSe(t);var Ci=r.nocase?"i":"";try{var La=new RegExp("^"+s+"$",Ci)}catch{return new RegExp("$.")}return La._glob=t,La._src=s,La}o(pSe,"parse");Ls.makeRe=function(t,e){return new Gt(t,e||{}).makeRe()};Gt.prototype.makeRe=fSe;function fSe(){if(this.regexp||this.regexp===!1)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,r=e.noglobstar?rv:e.dot?oSe:aSe,s=e.nocase?"i":"",n=t.map(function(i){return i.map(function(a){return a===vl?r:typeof a=="string"?mSe(a):a._src}).join("\\/")}).join("|");n="^(?:"+n+")$",this.negate&&(n="^(?!"+n+").*$");try{this.regexp=new RegExp(n,s)}catch{this.regexp=!1}return this.regexp}o(fSe,"makeRe");Ls.match=function(t,e,r){r=r||{};var s=new Gt(e,r);return t=t.filter(function(n){return s.match(n)}),s.options.nonull&&!t.length&&t.push(e),t};Gt.prototype.match=o(function(e,r){if(typeof r>"u"&&(r=this.partial),this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;var s=this.options;Ih.sep!=="/"&&(e=e.split(Ih.sep).join("/")),e=e.split(D4),this.debug(this.pattern,"split",e);var n=this.set;this.debug(this.pattern,"set",n);var i,a;for(a=e.length-1;a>=0&&(i=e[a],!i);a--);for(a=0;a<n.length;a++){var c=n[a],l=e;s.matchBase&&c.length===1&&(l=[i]);var u=this.matchOne(l,c,r);if(u)return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate},"match");Gt.prototype.matchOne=function(t,e,r){return e.indexOf(vl)!==-1?this._matchGlobstar(t,e,r,0,0):this._matchOne(t,e,r,0,0)};Gt.prototype._matchGlobstar=function(t,e,r,s,n){var i,a=-1;for(i=n;i<e.length;i++)if(e[i]===vl){a=i;break}var c=-1;for(i=e.length-1;i>=0;i--)if(e[i]===vl){c=i;break}var l=e.slice(n,a),u=r?e.slice(a+1):e.slice(a+1,c),d=r?[]:e.slice(c+1);if(l.length){var A=t.slice(s,s+l.length);if(!this._matchOne(A,l,r,0,0))return!1;s+=l.length}var p=0;if(d.length){if(d.length+s>t.length)return!1;var f=t.length-d.length;if(this._matchOne(t,d,r,f,0))p=d.length;else{if(t[t.length-1]!==""||s+d.length===t.length||(f--,!this._matchOne(t,d,r,f,0)))return!1;p=d.length+1}}if(!u.length){var m=!!p;for(i=s;i<t.length-p;i++){var g=String(t[i]);if(m=!0,g==="."||g===".."||!this.options.dot&&g.charAt(0)===".")return!1}return r||m}for(var y=[[[],0]],E=y[0],C=0,I=[0],B=0;B<u.length;B++){var N=u[B];N===vl?(I.push(C),E=[[],0],y.push(E)):(E[0].push(N),C++)}for(var Q=y.length-1,D=t.length-p,le=0;le<y.length;le++)y[le][1]=D-(I[Q--]+y[le][0].length);return!!this._matchGlobStarBodySections(t,y,s,0,r,0,!!p)};Gt.prototype._matchGlobStarBodySections=function(t,e,r,s,n,i,a){var c=e[s];if(!c){for(var l=r;l<t.length;l++){a=!0;var u=t[l];if(u==="."||u===".."||!this.options.dot&&u.charAt(0)===".")return!1}return a}for(var d=c[0],A=c[1];r<=A;){var p=this._matchOne(t.slice(0,r+d.length),d,n,r,0);if(p&&i<this.maxGlobstarRecursion){var f=this._matchGlobStarBodySections(t,e,r+d.length,s+1,n,i+1,a);if(f!==!1)return f}var u=t[r];if(u==="."||u===".."||!this.options.dot&&u.charAt(0)===".")return!1;r++}return n||null};Gt.prototype._matchOne=function(t,e,r,s,n){var i,a,c,l;for(i=s,a=n,c=t.length,l=e.length;i<c&&a<l;i++,a++){this.debug("matchOne loop");var u=e[a],d=t[i];if(this.debug(e,u,d),u===!1||u===vl)return!1;var A;if(typeof u=="string"?(A=d===u,this.debug("string match",u,d,A)):(A=d.match(u),this.debug("pattern match",u,d,A)),!A)return!1}if(i===c&&a===l)return!0;if(i===c)return r;if(a===l)return i===c-1&&t[i]==="";throw new Error("wtf?")};function hSe(t){return t.replace(/\\(.)/g,"$1")}o(hSe,"globUnescape");function mSe(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}o(mSe,"regExpEscape")});var wh=h((ZZe,G4)=>{"use strict";var wSe="2.0.0",SSe=Number.MAX_SAFE_INTEGER||9007199254740991,NSe=16,xSe=250,QSe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];G4.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:NSe,MAX_SAFE_BUILD_LENGTH:xSe,MAX_SAFE_INTEGER:SSe,RELEASE_TYPES:QSe,SEMVER_SPEC_VERSION:wSe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Sh=h((e7e,H4)=>{"use strict";var RSe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};H4.exports=RSe});var Xd=h((Mi,V4)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:nv,MAX_SAFE_BUILD_LENGTH:TSe,MAX_LENGTH:vSe}=wh(),PSe=Sh();Mi=V4.exports={};var _Se=Mi.re=[],kSe=Mi.safeRe=[],L=Mi.src=[],DSe=Mi.safeSrc=[],F=Mi.t={},OSe=0,iv="[a-zA-Z0-9-]",MSe=[["\\s",1],["\\d",
Line truncated
|
|
|
|
|
`).join(`
|
|
|
|
|
`+i),t.push(n+"m+"+mI.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=gRe()+e+" "+t[0]}o(mRe,"formatArgs");function gRe(){return hr.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(gRe,"getDate");function ERe(...t){return process.stderr.write(hI.format(...t)+`
|
|
|
|
|
`)}o(ERe,"log");function yRe(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(yRe,"save");function CRe(){return process.env.DEBUG}o(CRe,"load");function IRe(t){t.inspectOpts={};let e=Object.keys(hr.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=hr.inspectOpts[e[r]]}o(IRe,"init");mI.exports=Yv()(hr);var{formatters:S6}=mI.exports;S6.o=function(t){return this.inspectOpts.colors=this.useColors,hI.inspect(t,this.inspectOpts).split(`
|
|
|
|
|
`).map(e=>e.trim()).join(" ")};S6.O=function(t){return this.inspectOpts.colors=this.useColors,hI.inspect(t,this.inspectOpts)}});var gI=h((zrt,Kv)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Kv.exports=C6():Kv.exports=N6()});var R6=h(os=>{"use strict";var BRe=os&&os.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),bRe=os&&os.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),x6=os&&os.__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)&&BRe(e,t,r);return bRe(e,t),e};Object.defineProperty(os,"__esModule",{value:!0});os.req=os.json=os.toBuffer=void 0;var wRe=x6(require("http")),SRe=x6(require("https"));async function Q6(t){let e=0,r=[];for await(let s of t)e+=s.length,r.push(s);return Buffer.concat(r,e)}o(Q6,"toBuffer");os.toBuffer=Q6;async function NRe(t){let r=(await Q6(t)).toString("utf8");try{return JSON.parse(r)}catch(s){let n=s;throw n.message+=` (input: ${r})`,n}}o(NRe,"json");os.json=NRe;function xRe(t,e={}){let s=((typeof t=="string"?t:t.href).startsWith("https:")?SRe:wRe).request(t,e),n=new Promise((i,a)=>{s.once("response",i).once("error",a).end()});return s.then=n.then.bind(n),s}o(xRe,"req");os.req=xRe});var _6=h(Gs=>{"use strict";var v6=Gs&&Gs.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),QRe=Gs&&Gs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),P6=Gs&&Gs.__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)&&v6(e,t,r);return QRe(e,t),e},RRe=Gs&&Gs.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v6(e,t,r)};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.Agent=void 0;var TRe=P6(require("net")),T6=P6(require("http")),vRe=require("https");RRe(R6(),Gs);var qi=Symbol("AgentBaseInternalState"),Xv=class extends T6.Agent{static{o(this,"Agent")}constructor(e){super(e),this[qi]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
|
|
|
|
|
`).some(s=>s.indexOf("(https.js:")!==-1||s.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new TRe.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let s=this.sockets[e],n=s.indexOf(r);n!==-1&&(s.splice(n,1),this.totalSocketCount--,s.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?vRe.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,s){let n={...r,secureEndpoint:this.isSecureEndpoint(r)},i=this.getName(n),a=this.incrementSockets(i);Promise.resolve().then(()=>this.connect(e,n)).then(c=>{if(this.decrementSockets(i,a),c instanceof T6.Agent)try{return c.addRequest(e,n)}catch(l){return s(l)}this[qi].currentSocket=c,super.createSocket(e,r,s)},c=>{this.decrementSockets(i,a),s(c)})}createConnection(){let e=this[qi].currentSocket;if(this[qi].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[qi].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[qi]&&(this[qi].defaultPort=e)}get protocol(){return this[qi].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[qi]&&(this[qi].protocol=e)}};Gs.Agent=Xv});var k6=h(cA=>{"use strict";var PRe=cA&&cA.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cA,"__esModule",{value:!0});cA.parseProxyResponse=void 0;var _Re=PRe(gI()),EI=(0,_Re.default)("https-proxy-agent:parse-proxy-response");function kRe(t){return new Promise((e,r)=>{let s=0,n=[];function i(){let d=t.read();d?u(d):t.once("readable",i)}o(i,"read");function a(){t.removeListener("end",c),t.removeListener("error",l),t.removeListener("readable",i)}o(a,"cleanup");function c(){a(),EI("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(c,"onend");function l(d){a(),EI("onerror %o",d),r(d)}o(l,"onerror");function u(d){n.push(d),s+=d.length;let A=Buffer.concat(n,s),p=A.indexOf(`\r
|
|
|
|
|
\r
|
|
|
|
|
`);if(p===-1){EI("have not received end of HTTP headers yet..."),i();return}let f=A.slice(0,p).toString("ascii").split(`\r
|
|
|
|
|
`),m=f.shift();if(!m)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let g=m.split(" "),y=+g[1],E=g.slice(2).join(" "),C={};for(let I of f){if(!I)continue;let B=I.indexOf(":");if(B===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${I}"`));let N=I.slice(0,B).toLowerCase(),Q=I.slice(B+1).trimStart(),D=C[N];typeof D=="string"?C[N]=[D,Q]:Array.isArray(D)?D.push(Q):C[N]=Q}EI("got proxy server response: %o %o",m,C),a(),e({connect:{statusCode:y,statusText:E,headers:C},buffered:A})}o(u,"ondata"),t.on("error",l),t.on("end",c),i()})}o(kRe,"parseProxyResponse");cA.parseProxyResponse=kRe});var U6=h(Cn=>{"use strict";var DRe=Cn&&Cn.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),ORe=Cn&&Cn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),L6=Cn&&Cn.__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)&&DRe(e,t,r);return ORe(e,t),e},F6=Cn&&Cn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.HttpsProxyAgent=void 0;var yI=L6(require("net")),D6=L6(require("tls")),MRe=F6(require("assert")),LRe=F6(gI()),FRe=_6(),URe=require("url"),qRe=k6(),qh=(0,LRe.default)("https-proxy-agent"),O6=o(t=>t.servername===void 0&&t.host&&!yI.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),CI=class extends FRe.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new URe.URL(e):e,this.proxyHeaders=r?.headers??{},qh("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let s=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?M6(r,"headers"):null,host:s,port:n}}async connect(e,r){let{proxy:s}=this;if(!r.host)throw new TypeError('No "host" provided');let n;s.protocol==="https:"?(qh("Creating `tls.Socket`: %o",this.connectOpts),n=D6.connect(O6(this.connectOpts))):(qh("Creating `net.Socket`: %o",this.connectOpts),n=yI.connect(this.connectOpts));let i=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=yI.isIPv6(r.host)?`[${r.host}]`:r.host,c=`CONNECT ${a}:${r.port} HTTP/1.1\r
|
|
|
|
|
`;if(s.username||s.password){let p=`${decodeURIComponent(s.username)}:${decodeURIComponent(s.password)}`;i["Proxy-Authorization"]=`Basic ${Buffer.from(p).toString("base64")}`}i.Host=`${a}:${r.port}`,i["Proxy-Connection"]||(i["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let p of Object.keys(i))c+=`${p}: ${i[p]}\r
|
|
|
|
|
`;let l=(0,qRe.parseProxyResponse)(n);n.write(`${c}\r
|
|
|
|
|
`);let{connect:u,buffered:d}=await l;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",GRe),r.secureEndpoint?(qh("Upgrading socket connection to TLS"),D6.connect({...M6(O6(r),"host","path","port"),socket:n})):n;n.destroy();let A=new yI.Socket({writable:!1});return A.readable=!0,e.once("socket",p=>{qh("Replaying proxy buffer for failed request"),(0,MRe.default)(p.listenerCount("data")>0),p.push(d),p.push(null)}),A}};CI.protocols=["http","https"];Cn.HttpsProxyAgent=CI;function GRe(t){t.resume()}o(GRe,"resume");function M6(t,...e){let r={},s;for(s in t)e.includes(s)||(r[s]=t[s]);return r}o(M6,"omit")});var H6=h(as=>{"use strict";var HRe=as&&as.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),VRe=as&&as.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),q6=as&&as.__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)&&HRe(e,t,r);return VRe(e,t),e};Object.defineProperty(as,"__esModule",{value:!0});as.req=as.json=as.toBuffer=void 0;var zRe=q6(require("http")),JRe=q6(require("https"));async function G6(t){let e=0,r=[];for await(let s of t)e+=s.length,r.push(s);return Buffer.concat(r,e)}o(G6,"toBuffer");as.toBuffer=G6;async function YRe(t){let r=(await G6(t)).toString("utf8");try{return JSON.parse(r)}catch(s){let n=s;throw n.message+=` (input: ${r})`,n}}o(YRe,"json");as.json=YRe;function $Re(t,e={}){let s=((typeof t=="string"?t:t.href).startsWith("https:")?JRe:zRe).request(t,e),n=new Promise((i,a)=>{s.once("response",i).once("error",a).end()});return s.then=n.then.bind(n),s}o($Re,"req");as.req=$Re});var Y6=h(Hs=>{"use strict";var z6=Hs&&Hs.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),WRe=Hs&&Hs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),J6=Hs&&Hs.__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)&&z6(e,t,r);return WRe(e,t),e},jRe=Hs&&Hs.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&z6(e,t,r)};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.Agent=void 0;var KRe=J6(require("net")),V6=J6(require("http")),XRe=require("https");jRe(H6(),Hs);var Gi=Symbol("AgentBaseInternalState"),Zv=class extends V6.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Gi]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
|
|
|
|
|
`).some(s=>s.indexOf("(https.js:")!==-1||s.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new KRe.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let s=this.sockets[e],n=s.indexOf(r);n!==-1&&(s.splice(n,1),this.totalSocketCount--,s.length===0&&delete this.sockets[e])}getName(e){return(typeof e.secureEndpoint=="boolean"?e.secureEndpoint:this.isSecureEndpoint(e))?XRe.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,s){let n={...r,secureEndpoint:this.isSecureEndpoint(r)},i=this.getName(n),a=this.incrementSockets(i);Promise.resolve().then(()=>this.connect(e,n)).then(c=>{if(this.decrementSockets(i,a),c instanceof V6.Agent)return c.addRequest(e,n);this[Gi].currentSocket=c,super.createSocket(e,r,s)},c=>{this.decrementSockets(i,a),s(c)})}createConnection(){let e=this[Gi].currentSocket;if(this[Gi].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Gi].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Gi]&&(this[Gi].defaultPort=e)}get protocol(){return this[Gi].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Gi]&&(this[Gi].protocol=e)}};Hs.Agent=Zv});var j6=h(In=>{"use strict";var ZRe=In&&In.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),eTe=In&&In.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),W6=In&&In.__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)&&ZRe(e,t,r);return eTe(e,t),e},tTe=In&&In.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(In,"__esModule",{value:!0});In.HttpProxyAgent=void 0;var rTe=W6(require("net")),sTe=W6(require("tls")),nTe=tTe(gI()),iTe=require("events"),oTe=Y6(),$6=require("url"),lA=(0,nTe.default)("http-proxy-agent"),II=class extends oTe.Agent{static{o(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new $6.URL(e):e,this.proxyHeaders=r?.headers??{},lA("Creating new HttpProxyAgent instance: %o",this.proxy.href);let s=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...r?aTe(r,"headers"):null,host:s,port:n}}addRequest(e,r){e._header=null,this.setRequestProps(e,r),super.addRequest(e,r)}setRequestProps(e,r){let{proxy:s}=this,n=r.secureEndpoint?"https:":"http:",i=e.getHeader("host")||"localhost",a=`${n}//${i}`,c=new $6.URL(e.path,a);r.port!==80&&(c.port=String(r.port)),e.path=String(c);let l=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(s.username||s.password){let u=`${decodeURIComponent(s.username)}:${decodeURIComponent(s.password)}`;l["Proxy-Authorization"]=`Basic ${Buffer.from(u).toString("base64")}`}l["Proxy-Connection"]||(l["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let u of Object.keys(l)){let d=l[u];d&&e.setHeader(u,d)}}async connect(e,r){e._header=null,e.path.includes("://")||this.setRequestProps(e,r);let s,n;lA("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(lA("Patching connection write() output buffer with updated header"),s=e.outputData[0].data,n=s.indexOf(`\r
|
|
|
|
|
\r
|
|
|
|
|
`)+4,e.outputData[0].data=e._header+s.substring(n),lA("Output buffer: %o",e.outputData[0].data));let i;return this.proxy.protocol==="https:"?(lA("Creating `tls.Socket`: %o",this.connectOpts),i=sTe.connect(this.connectOpts)):(lA("Creating `net.Socket`: %o",this.connectOpts),i=rTe.connect(this.connectOpts)),await(0,iTe.once)(i,"connect"),i}};II.protocols=["http","https"];In.HttpProxyAgent=II;function aTe(t,...e){let r={},s;for(s in t)e.includes(s)||(r[s]=t[s]);return r}o(aTe,"omit")});var E9=h(DI=>{"use strict";Object.defineProperty(DI,"__esModule",{value:!0});DI.state=void 0;DI.state={instrumenterImplementation:void 0}});var D9=h(UI=>{"use strict";Object.defineProperty(UI,"__esModule",{value:!0});UI.state=void 0;UI.state={operationRequestMap:new WeakMap}});var pZ=h(xA=>{"use strict";Object.defineProperty(xA,"__esModule",{value:!0});var xDe=require("os"),QDe=require("util");function RDe(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}o(RDe,"_interopDefaultLegacy");var TDe=RDe(QDe);function vDe(t,...e){process.stderr.write(`${TDe.default.format(t,...e)}${xDe.EOL}`)}o(vDe,"log");var sZ=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,iZ,vO=[],PO=[],ib=[];sZ&&_O(sZ);var oZ=Object.assign(t=>aZ(t),{enable:_O,enabled:kO,disable:PDe,log:vDe});function _O(t){iZ=t,vO=[],PO=[];let e=/\*/g,r=t.split(",").map(s=>s.trim().replace(e,".*?"));for(let s of r)s.startsWith("-")?PO.push(new RegExp(`^${s.substr(1)}$`)):vO.push(new RegExp(`^${s}$`));for(let s of ib)s.enabled=kO(s.namespace)}o(_O,"enable");function kO(t){if(t.endsWith("*"))return!0;for(let e of PO)if(e.test(t))return!1;for(let e of vO)if(e.test(t))return!0;return!1}o(kO,"enabled");function PDe(){let t=iZ||"";return _O(""),t}o(PDe,"disable");function aZ(t){let e=Object.assign(r,{enabled:kO(t),destroy:_De,log:oZ.log,namespace:t,extend:kDe});function r(...s){e.enabled&&(s.length>0&&(s[0]=`${t} ${s[0]}`),e.log(...s))}return o(r,"debug"),ib.push(e),e}o(aZ,"createDebugger");function _De(){let t=ib.indexOf(this);return t>=0?(ib.splice(t,1),!0):!1}o(_De,"destroy");function kDe(t){let e=aZ(`${this.namespace}:${t}`);return e.log=this.log,e}o(kDe,"extend");var Qm=oZ,cZ=new Set,sb=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,ob,ab=Qm("azure");ab.log=(...t)=>{Qm.log(...t)};var DO=["verbose","info","warning","error"];sb&&(AZ(sb)?lZ(sb):console.error(`AZURE_LOG_LEVEL set to unknown log level '${sb}'; logging is not enabled. Acceptable values: ${DO.join(", ")}.`));function lZ(t){if(t&&!AZ(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${DO.join(",")}`);ob=t;let e=[];for(let r of cZ)dZ(r)&&e.push(r.namespace);Qm.enable(e.join(","))}o(lZ,"setLogLevel");function DDe(){return ob}o(DDe,"getLogLevel");var nZ={verbose:400,info:300,warning:200,error:100};function ODe(t){let e=ab.extend(t);return uZ(ab,e),{error:nb(e,"error"),warning:nb(e,"warning"),info:nb(e,"info"),verbose:nb(e,"verbose")}}o(ODe,"createClientLogger");function uZ(t,e){e.log=(...r)=>{t.log(...r)}}o(uZ,"patchLogMethod");function nb(t,e){let r=Object.assign(t.extend(e),{level:e});if(uZ(t,r),dZ(r)){let s=Qm.disable();Qm.enable(s+","+r.namespace)}return cZ.add(r),r}o(nb,"createLogger");function dZ(t){return!!(ob&&nZ[t.level]<=nZ[ob])}o(dZ,"shouldEnable");function AZ(t){return DO.includes(t)}o(AZ,"isAzureLogLevel");xA.AzureLogger=ab;xA.createClientLogger=ODe;xA.getLogLevel=DDe;xA.setLogLevel=lZ});var LO=h(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});var QA=new WeakMap,cb=new WeakMap,Rm=class t{static{o(this,"AbortSignal")}constructor(){this.onabort=null,QA.set(this,[]),cb.set(this,!1)}get aborted(){if(!cb.has(this))throw new TypeError("Expected `this` to be an instance of AbortSignal.");return cb.get(this)}static get none(){return new t}addEventListener(e,r){if(!QA.has(this))throw new TypeError("Expected `this` to be an instance of AbortSignal.");QA.get(this).push(r)}removeEventListener(e,r){if(!QA.has(this))throw new TypeError("Expected `this` to be an instance of AbortSignal.");let s=QA.get(this),n=s.indexOf(r);n>-1&&s.splice(n,1)}dispatchEvent(e){throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes.")}};function fZ(t){if(t.aborted)return;t.onabort&&t.onabort.call(t);let e=QA.get(t);e&&e.slice().forEach(r=>{r.call(t,{type:"abort"})}),cb.set(t,!0)}o(fZ,"abortSignal");var OO=class extends Error{static{o(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}},MO=class{static{o(this,"AbortController")}constructor(e){if(this._signal=new Rm,!!e){Array.isArray(e)||(e=arguments);for(let r of e)r.aborted?this.abort():r.addEventListener("abort",()=>{this.abort()})}}get signal(){return this._signal}abort(){fZ(this._signal)}static timeout(e){let r=new Rm,s=setTimeout(fZ,e,r);return typeof s.unref=="function"&&s.unref(),r}};Tm.AbortController=MO;Tm.AbortError=OO;Tm.AbortSignal=Rm});var yZ=h(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});var MDe
Line truncated
|
|
|
|
|
Polling from: ${r.config.operationLocation}
|
|
|
|
|
Operation status: ${d}
|
|
|
|
|
Polling status: ${bZ.includes(d)?"Stopped":"Running"}`),d==="succeeded"){let A=a(u,r);if(A!==void 0)return{response:await e(A).catch(IZ({state:r,stateProxy:s,isOperationError:c})),status:d}}return{response:u,status:d}}o(ZDe,"pollOperationHelper");async function xZ(t){let{poll:e,state:r,stateProxy:s,options:n,getOperationStatus:i,getResourceLocation:a,getOperationLocation:c,isOperationError:l,withOperationLocation:u,getPollingInterval:d,processResult:A,getError:p,updateState:f,setDelay:m,isDone:g,setErrorAsResult:y}=t,{operationLocation:E}=r.config;if(E!==void 0){let{response:C,status:I}=await ZDe({poll:e,getOperationStatus:i,state:r,stateProxy:s,operationLocation:E,getResourceLocation:a,isOperationError:l,options:n});if(SZ({status:I,response:C,state:r,stateProxy:s,isDone:g,processResult:A,getError:p,setErrorAsResult:y}),!bZ.includes(I)){let B=d?.(C);B&&m(B);let N=c?.(C,r);if(N!==void 0){let Q=E!==N;r.config.operationLocation=N,u?.(N,Q)}else u?.(E,!1)}f?.(r,C)}}o(xZ,"pollOperation");function QZ(t){let{azureAsyncOperation:e,operationLocation:r}=t;return r??e}o(QZ,"getOperationLocationPollingUrl");function RZ(t){return t.headers.location}o(RZ,"getLocationHeader");function TZ(t){return t.headers["operation-location"]}o(TZ,"getOperationLocationHeader");function vZ(t){return t.headers["azure-asyncoperation"]}o(vZ,"getAzureAsyncOperationHeader");function eOe(t){let{location:e,requestMethod:r,requestPath:s,resourceLocationConfig:n}=t;switch(r){case"PUT":return s;case"DELETE":return;default:switch(n){case"azure-async-operation":return;case"original-uri":return s;default:return e}}}o(eOe,"findResourceLocation");function PZ(t){let{rawResponse:e,requestMethod:r,requestPath:s,resourceLocationConfig:n}=t,i=TZ(e),a=vZ(e),c=QZ({operationLocation:i,azureAsyncOperation:a}),l=RZ(e),u=r?.toLocaleUpperCase();return c!==void 0?{mode:"OperationLocation",operationLocation:c,resourceLocation:eOe({requestMethod:u,location:l,requestPath:s,resourceLocationConfig:n})}:l!==void 0?{mode:"ResourceLocation",operationLocation:l}:u==="PUT"&&s?{mode:"Body",operationLocation:s}:void 0}o(PZ,"inferLroMode");function _Z(t){let{status:e,statusCode:r}=t;if(typeof e!="string"&&e!==void 0)throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${e}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`);switch(e?.toLocaleLowerCase()){case void 0:return JO(r);case"succeeded":return"succeeded";case"failed":return"failed";case"running":case"accepted":case"started":case"canceling":case"cancelling":return"running";case"canceled":case"cancelled":return"canceled";default:return iu.verbose(`LRO: unrecognized operation status: ${e}`),e}}o(_Z,"transformStatus");function tOe(t){var e;let{status:r}=(e=t.body)!==null&&e!==void 0?e:{};return _Z({status:r,statusCode:t.statusCode})}o(tOe,"getStatus");function rOe(t){var e,r;let{properties:s,provisioningState:n}=(e=t.body)!==null&&e!==void 0?e:{},i=(r=s?.provisioningState)!==null&&r!==void 0?r:n;return _Z({status:i,statusCode:t.statusCode})}o(rOe,"getProvisioningState");function JO(t){return t===202?"running":t<300?"succeeded":"failed"}o(JO,"toOperationStatus");function kZ({rawResponse:t}){let e=t.headers["retry-after"];if(e!==void 0){let r=parseInt(e);return isNaN(r)?sOe(new Date(e)):r*1e3}}o(kZ,"parseRetryAfter");function DZ(t){let e=t.flatResponse.error;if(!e){iu.warning("The long-running operation failed but there is no error property in the response's body");return}if(!e.code||!e.message){iu.warning("The long-running operation failed but the error property in the response's body doesn't contain code or message");return}return e}o(DZ,"getErrorFromResponse");function sOe(t){let e=Math.floor(new Date().getTime()),r=t.getTime();if(e<r)return r-e}o(sOe,"calculatePollingIntervalFromDate");function OZ(t){let{response:e,state:r,operationLocation:s}=t;function n(){var a;switch((a=r.config.metadata)===null||a===void 0?void 0:a.mode){case void 0:return JO(e.rawResponse.statusCode);case"Body":return YO(e,r);default:return"running"}}o(n,"helper");let i=n();return i==="running"&&s===void 0?"succeeded":i}o(OZ,"getStatusFromInitialResponse");async function nOe(t){let{stateProxy:e,resourceLocationConfig:r,processResult:s,lro:n,setErrorAsResult:i}=t;return NZ({init:o(async()=>{let a=await n.sendInitialRequest(),c=PZ({rawResponse:a.rawResponse,requestPath:n.requestPath,requestMethod:n.requestMethod,resourceLocationConfig:r});return Object.assign({response:a,operationLocation:c?.operationLocation,resourceLocation:c?.resourceLocation},c?.mode?{metadata:{mode:c.mode}}:{})},"init"),stateProxy:e,processResult:s?({flatResponse:a},c)=>s(a,c):({flatResponse:a})=>a,getOperationStatus:OZ,setErrorAsResult:i})}o(nOe,"initHttpOperation");function MZ({rawResponse:t},e){var r;switch((r=e.config.metadata)===null||r===void 0?void 0:r.mode){case"OperationLocation":return QZ({operationLocation:TZ(t),azureAsyncOperLine truncated
|
|
|
|
|
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(n){case 0:a=i,n=1;break;case 1:r[s++]=a<<2|(i&48)>>4,a=i,n=2;break;case 2:r[s++]=(a&15)<<4|(i&60)>>2,a=i,n=3;break;case 3:r[s++]=(a&3)<<6|i,n=0;break}}if(n==1)throw Error("invalid base64 string.");return r.subarray(0,s)}o(qOe,"base64decode");kA.base64decode=qOe;function GOe(t){let e="",r=0,s,n=0;for(let i=0;i<t.length;i++)switch(s=t[i],r){case 0:e+=Ia[s>>2],n=(s&3)<<4,r=1;break;case 1:e+=Ia[n|s>>4],n=(s&15)<<2,r=2;break;case 2:e+=Ia[n|s>>6],e+=Ia[s&63],r=0;break}return r&&(e+=Ia[n],e+="=",r==1&&(e+="=")),e}o(GOe,"base64encode");kA.base64encode=GOe});var p7=h(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});xb.utf8read=void 0;var sM=o(t=>String.fromCharCode.apply(String,t),"fromCharCodes");function HOe(t){if(t.length<1)return"";let e=0,r=[],s=[],n=0,i,a=t.length;for(;e<a;)i=t[e++],i<128?s[n++]=i:i>191&&i<224?s[n++]=(i&31)<<6|t[e++]&63:i>239&&i<365?(i=((i&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,s[n++]=55296+(i>>10),s[n++]=56320+(i&1023)):s[n++]=(i&15)<<12|(t[e++]&63)<<6|t[e++]&63,n>8191&&(r.push(sM(s)),n=0);return r.length?(n&&r.push(sM(s.slice(0,n))),r.join("")):sM(s.slice(0,n))}o(HOe,"utf8read");xb.utf8read=HOe});var Lm=h(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.WireType=ho.mergeBinaryOptions=ho.UnknownFieldHandler=void 0;var VOe;(function(t){t.symbol=Symbol.for("protobuf-ts/unknown"),t.onRead=(r,s,n,i,a)=>{(e(s)?s[t.symbol]:s[t.symbol]=[]).push({no:n,wireType:i,data:a})},t.onWrite=(r,s,n)=>{for(let{no:i,wireType:a,data:c}of t.list(s))n.tag(i,a).raw(c)},t.list=(r,s)=>{if(e(r)){let n=r[t.symbol];return s?n.filter(i=>i.no==s):n}return[]},t.last=(r,s)=>t.list(r,s).slice(-1)[0];let e=o(r=>r&&Array.isArray(r[t.symbol]),"is")})(VOe=ho.UnknownFieldHandler||(ho.UnknownFieldHandler={}));function zOe(t,e){return Object.assign(Object.assign({},t),e)}o(zOe,"mergeBinaryOptions");ho.mergeBinaryOptions=zOe;var JOe;(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(JOe=ho.WireType||(ho.WireType={}))});var Rb=h(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.varint32read=fs.varint32write=fs.int64toString=fs.int64fromString=fs.varint64write=fs.varint64read=void 0;function YOe(){let t=0,e=0;for(let s=0;s<28;s+=7){let n=this.buf[this.pos++];if(t|=(n&127)<<s,(n&128)==0)return this.assertBounds(),[t,e]}let r=this.buf[this.pos++];if(t|=(r&15)<<28,e=(r&112)>>4,(r&128)==0)return this.assertBounds(),[t,e];for(let s=3;s<=31;s+=7){let n=this.buf[this.pos++];if(e|=(n&127)<<s,(n&128)==0)return this.assertBounds(),[t,e]}throw new Error("invalid varint")}o(YOe,"varint64read");fs.varint64read=YOe;function $Oe(t,e,r){for(let i=0;i<28;i=i+7){let a=t>>>i,c=!(!(a>>>7)&&e==0),l=(c?a|128:a)&255;if(r.push(l),!c)return}let s=t>>>28&15|(e&7)<<4,n=e>>3!=0;if(r.push((n?s|128:s)&255),!!n){for(let i=3;i<31;i=i+7){let a=e>>>i,c=!!(a>>>7),l=(c?a|128:a)&255;if(r.push(l),!c)return}r.push(e>>>31&1)}}o($Oe,"varint64write");fs.varint64write=$Oe;var Qb=65536*65536;function WOe(t){let e=t[0]=="-";e&&(t=t.slice(1));let r=1e6,s=0,n=0;function i(a,c){let l=Number(t.slice(a,c));n*=r,s=s*r+l,s>=Qb&&(n=n+(s/Qb|0),s=s%Qb)}return o(i,"add1e6digit"),i(-24,-18),i(-18,-12),i(-12,-6),i(-6),[e,s,n]}o(WOe,"int64fromString");fs.int64fromString=WOe;function jOe(t,e){if(e>>>0<=2097151)return""+(Qb*e+(t>>>0));let r=t&16777215,s=(t>>>24|e<<8)>>>0&16777215,n=e>>16&65535,i=r+s*6777216+n*6710656,a=s+n*8147497,c=n*2,l=1e7;i>=l&&(a+=Math.floor(i/l),i%=l),a>=l&&(c+=Math.floor(a/l),a%=l);function u(d,A){let p=d?String(d):"";return A?"0000000".slice(p.length)+p:p}return o(u,"decimalFrom1e7"),u(c,0)+u(a,c)+u(i,1)}o(jOe,"int64toString");fs.int64toString=jOe;function KOe(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let r=0;r<9;r++)e.push(t&127|128),t=t>>7;e.push(1)}}o(KOe,"varint32write");fs.varint32write=KOe;function XOe(){let t=this.buf[this.pos++],e=t&127;if((t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,(t&128)==0)return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let r=5;(t&128)!==0&&r<10;r++)t=this.buf[this.pos++];if((t&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}o(XOe,"varint32read");fs.varint32read=XOe});var Qc=h(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.PbLong=xc.PbULong=xc.detectBi=void 0;var Fm=Rb(),Ve;function f7(){let t=new DataView(new ArrayBuffer(8));Ve=globalThis.BigInt!==void 0&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"
Line truncated
|
|
|
|
|
`)}};rw.RpcError=TM});var PM=h(nw=>{"use strict";Object.defineProperty(nw,"__esModule",{value:!0});nw.mergeRpcOptions=void 0;var J7=Dt();function CLe(t,e){if(!e)return t;let r={};sw(t,r),sw(e,r);for(let s of Object.keys(e)){let n=e[s];switch(s){case"jsonOptions":r.jsonOptions=J7.mergeJsonOptions(t.jsonOptions,r.jsonOptions);break;case"binaryOptions":r.binaryOptions=J7.mergeBinaryOptions(t.binaryOptions,r.binaryOptions);break;case"meta":r.meta={},sw(t.meta,r.meta),sw(e.meta,r.meta);break;case"interceptors":r.interceptors=t.interceptors?t.interceptors.concat(n):n.concat();break}}return r}o(CLe,"mergeRpcOptions");nw.mergeRpcOptions=CLe;function sw(t,e){if(!t)return;let r=e;for(let[s,n]of Object.entries(t))n instanceof Date?r[s]=new Date(n.getTime()):Array.isArray(n)?r[s]=n.concat():r[s]=n}o(sw,"copy")});var kM=h(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.Deferred=uu.DeferredState=void 0;var Eo;(function(t){t[t.PENDING=0]="PENDING",t[t.REJECTED=1]="REJECTED",t[t.RESOLVED=2]="RESOLVED"})(Eo=uu.DeferredState||(uu.DeferredState={}));var _M=class{static{o(this,"Deferred")}constructor(e=!0){this._state=Eo.PENDING,this._promise=new Promise((r,s)=>{this._resolve=r,this._reject=s}),e&&this._promise.catch(r=>{})}get state(){return this._state}get promise(){return this._promise}resolve(e){if(this.state!==Eo.PENDING)throw new Error(`cannot resolve ${Eo[this.state].toLowerCase()}`);this._resolve(e),this._state=Eo.RESOLVED}reject(e){if(this.state!==Eo.PENDING)throw new Error(`cannot reject ${Eo[this.state].toLowerCase()}`);this._reject(e),this._state=Eo.REJECTED}resolvePending(e){this._state===Eo.PENDING&&this.resolve(e)}rejectPending(e){this._state===Eo.PENDING&&this.reject(e)}};uu.Deferred=_M});var OM=h(iw=>{"use strict";Object.defineProperty(iw,"__esModule",{value:!0});iw.RpcOutputStreamController=void 0;var Y7=kM(),du=Dt(),DM=class{static{o(this,"RpcOutputStreamController")}constructor(){this._lis={nxt:[],msg:[],err:[],cmp:[]},this._closed=!1,this._itState={q:[]}}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 s=r.indexOf(e);s>=0&&r.splice(s,1)}}clearLis(){for(let e of Object.values(this._lis))e.splice(0,e.length)}get closed(){return this._closed!==!1}notifyNext(e,r,s){du.assert((e?1:0)+(r?1:0)+(s?1:0)<=1,"only one emission at a time"),e&&this.notifyMessage(e),r&&this.notifyError(r),s&&this.notifyComplete()}notifyMessage(e){du.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){du.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(){du.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._closed===!0?this.pushIt({value:null,done:!0}):this._closed!==!1&&this.pushIt(this._closed),{next:o(()=>{let e=this._itState;du.assert(e,"bad state"),du.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 Y7.Deferred,e.p.promise)},"next")}}pushIt(e){let r=this._itState;if(r.p){let s=r.p;du.assert(s.state==Y7.DeferredState.PENDING,"iterator contract broken"),"value"in e?s.resolve(e):s.reject(e),delete r.p}else r.q.push(e)}};iw.RpcOutputStreamController=DM});var LM=h(qA=>{"use strict";var ILe=qA&&qA.__awaiter||function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return o(n,"adopt"),new(r||(r=Promise))(function(i,a){function c(d){try{u(s.next(d))}catch(A){a(A)}}o(c,"fulfilled");function l(d){try{u(s.throw(d))}catch(A){a(A)}}o(l,"rejected");function u(d){d.done?i(d.value):n(d.value).then(c,l)}o(u,"step"),u((s=s.apply(t,e||[])).next())})};Object.defineProperty(qA,"__esModule",{value:!0});qA.UnaryCall=void 0;var MM=class{static{o(this,"UnaryCall")}constructor(e,r,s,n,i,a,c){this.method=e,this.requestHeaders=r,this.request=s,this.headers=n,this.response=i,this.status=a,this.trailers=c}then(e,r){return this.promiseFinished().then(s=>e?Promise.resolve(e(s)):s,s=>r?Promise.resolve(r(s)):Promise.reject(s))}promiseFinished(){return ILe(this,void 0,void 0,function*(){let[e,r,s,n]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:e,response:r,status:s,trailers:n}})}};qA.UnaryCall=MM});var UM=h(GA=>{"use strict";var BLe=GA&&GA.__awaiter||function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return o(n,"adopt"),new(r||(r=Promise))(function(i,a){function c(d){try{u(s.next(d))}catch(A){a(A)}}o(c,"fulfilled");function l(d){t
Line truncated
|
|
|
|
|
You can add a runtime option to disable the check or this warning:
|
|
|
|
|
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}o(g1e,"logUnexpecedPropertyAccessOnce");function E1e(){Object.keys(xw).forEach(function(t){delete xw[t]})}o(E1e,"resetLoggedProperties")});var Rw=h(Io=>{"use strict";Io.__esModule=!0;Io.HandlebarsEnvironment=UL;function ate(t){return t&&t.__esModule?t:{default:t}}o(ate,"_interopRequireDefault");var gu=Yr(),y1e=Zs(),LL=ate(y1e),C1e=kL(),I1e=ste(),B1e=OL(),Qw=ate(B1e),b1e=ML(),w1e="4.7.9";Io.VERSION=w1e;var S1e=8;Io.COMPILER_REVISION=S1e;var N1e=7;Io.LAST_COMPATIBLE_COMPILER_REVISION=N1e;var x1e={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"};Io.REVISION_CHANGES=x1e;var FL="[object Object]";function UL(t,e,r){this.helpers=t||{},this.partials=e||{},this.decorators=r||{},C1e.registerDefaultHelpers(this),I1e.registerDefaultDecorators(this)}o(UL,"HandlebarsEnvironment");UL.prototype={constructor:UL,logger:Qw.default,log:Qw.default.log,registerHelper:o(function(e,r){if(gu.toString.call(e)===FL){if(r)throw new LL.default("Arg not supported with multiple helpers");gu.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(gu.toString.call(e)===FL)gu.extend(this.partials,e);else{if(typeof r>"u")throw new LL.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(gu.toString.call(e)===FL){if(r)throw new LL.default("Arg not supported with multiple decorators");gu.extend(this.decorators,e)}else this.decorators[e]=r},"registerDecorator"),unregisterDecorator:o(function(e){delete this.decorators[e]},"unregisterDecorator"),resetLoggedPropertyAccesses:o(function(){b1e.resetLoggedProperties()},"resetLoggedPropertyAccesses")};var Q1e=Qw.default.log;Io.log=Q1e;Io.createFrame=gu.createFrame;Io.logger=Qw.default});var lte=h((Tw,cte)=>{"use strict";Tw.__esModule=!0;function qL(t){this.string=t}o(qL,"SafeString");qL.prototype.toString=qL.prototype.toHTML=function(){return""+this.string};Tw.default=qL;cte.exports=Tw.default});var ute=h(GL=>{"use strict";GL.__esModule=!0;GL.wrapHelper=R1e;function R1e(t,e){if(typeof t!="function")return t;var r=o(function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=e(n),t.apply(this,arguments)},"wrapper");return r}o(R1e,"wrapHelper")});var mte=h(vc=>{"use strict";vc.__esModule=!0;vc.checkRevision=D1e;vc.template=O1e;vc.wrapProgram=vw;vc.resolvePartial=M1e;vc.invokePartial=L1e;vc.noop=fte;function T1e(t){return t&&t.__esModule?t:{default:t}}o(T1e,"_interopRequireDefault");function v1e(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(v1e,"_interopRequireWildcard");var P1e=Yr(),ZA=v1e(P1e),_1e=Zs(),wa=T1e(_1e),Sa=Rw(),dte=kL(),k1e=ute(),Ate=ML();function D1e(t){var e=t&&t[0]||1,r=Sa.COMPILER_REVISION;if(!(e>=Sa.LAST_COMPATIBLE_COMPILER_REVISION&&e<=Sa.COMPILER_REVISION))if(e<Sa.LAST_COMPATIBLE_COMPILER_REVISION){var s=Sa.REVISION_CHANGES[r],n=Sa.REVISION_CHANGES[e];throw new wa.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+s+") or downgrade your runtime to an older version ("+n+").")}else throw new wa.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(D1e,"checkRevision");function O1e(t,e){if(!e)throw new wa.default("No environment passed to template");if(!t||!t.main)throw new wa.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 s(a,c,l){l.hash&&(c=ZA.extend({},c,l.hash),l.ids&&(l.ids[0]=!0)),a=e.VM.resolvePartial.call(this,a,c,l),l.hooks=this.hooks,l.protoAccessControl=this.protoAccessControl;var u=e.VM.invokePartial.call(this,a,c,l);if(u==null&&e.compile&&(l.partials[l.name]=e.compile(a,t.compilerOptions,e),u=l.partials[l.name](c,l)),u!=null){if(l.indent){for(var d=u.split(`
|
|
|
|
|
`),A=0,p=d.length;A<p&&!(!d[A]&&A+1===p);A++)d[A]=l.indent+d[A];u=d.join(`
|
|
|
|
|
`)}return u}else throw new wa.default("The partial "+l.name+" could not be compiled when running in runtime-only mode")}o(s,"invokePartialWrapper");var n={strict:o(function(c,l,u){if(!c||!(l in c))throw new wa.default('"'+l+'" not defined in '+c,{loc:u});return n.lookupProperty(c,l)},"strict"),lookupProperty:o(function(c,l){var u=c[l];if(u==null||Object.prototype.hasOwnProperty.call(c,l)||Ate.resultIsAllowed(u,n.protoAccessControl,l))return u},"lookupProperty"),lookup:o(function(c,l){for(var u=c.length,d=0;d<u;d++){var A=c[d]&&n.lookupProperty(c[d],l);if(A!=null)return A}},"lookup"),lambda:o(function(c,l){return typeof c=="function"?c.call(l):c},"lambda"),escapeExpression:ZA.escapeExpression,invokePartial:s,fn:o(function(c){var l=t[c];return l.decorator=t[c+"_d"],l},"fn"),programs:[],program:o(function(c,l,u,d,A){var p=this.programs[c],f=this.fn(c);return l||A||d||u?p=vw(this,c,f,l,u,d,A):p||(p=this.programs[c]=vw(this,c,f)),p},"program"),data:o(function(c,l){for(;c&&l--;)c=c._parent;return c},"data"),mergeIfNeeded:o(function(c,l){var u=c||l;return c&&l&&c!==l&&(u=ZA.extend({},l,c)),u},"mergeIfNeeded"),nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:t.compiler};function i(a){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],l=c.data;i._setup(c),!c.partial&&t.useData&&(l=F1e(a,l));var u=void 0,d=t.useBlockParams?[]:void 0;t.useDepths&&(c.depths?u=a!=c.depths[0]?[a].concat(c.depths):c.depths:u=[a]);function A(p){return""+t.main(n,p,n.helpers,n.partials,l,d,u)}return o(A,"main"),A=hte(t.main,A,n,c.depths||[],l,d),A(a,c)}return o(i,"ret"),i.isTop=!0,i._setup=function(a){if(a.partial)n.protoAccessControl=a.protoAccessControl,n.helpers=a.helpers,n.partials=a.partials,n.decorators=a.decorators,n.hooks=a.hooks;else{var c={};pte(c,e.helpers,n),pte(c,a.helpers,n),n.helpers=c,t.usePartial&&(n.partials=n.mergeIfNeeded(a.partials,e.partials)),(t.usePartial||t.useDecorators)&&(n.decorators=ZA.extend({},e.decorators,a.decorators)),n.hooks={},n.protoAccessControl=Ate.createProtoAccessControl(a);var l=a.allowCallsToHelperMissing||r;dte.moveHelperToHooks(n,"helperMissing",l),dte.moveHelperToHooks(n,"blockHelperMissing",l)}},i._child=function(a,c,l,u){if(t.useBlockParams&&!l)throw new wa.default("must pass block params");if(t.useDepths&&!u)throw new wa.default("must pass parent depths");return vw(n,a,t[a],c,0,l,u)},i}o(O1e,"template");function vw(t,e,r,s,n,i,a){function c(l){var u=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],d=a;return a&&l!=a[0]&&!(l===t.nullContext&&a[0]===null)&&(d=[l].concat(a)),r(t,l,t.helpers,t.partials,u.data||s,i&&[u.blockParams].concat(i),d)}return o(c,"prog"),c=hte(r,c,t,a,s,i),c.program=e,c.depth=a?a.length:0,c.blockParams=n||0,c}o(vw,"wrapProgram");function M1e(t,e,r){return t?!t.call&&!r.name&&(r.name=t,t=Pw(r.partials,t)):r.name==="@partial-block"?t=Pw(r.data,"partial-block"):t=Pw(r.partials,r.name),t}o(M1e,"resolvePartial");function L1e(t,e,r){var s=Pw(r.data,"partial-block");r.partial=!0,r.ids&&(r.data.contextPath=r.ids[0]||r.data.contextPath);var n=void 0;if(r.fn&&r.fn!==fte&&(function(){r.data=Sa.createFrame(r.data);var i=r.fn;n=r.data["partial-block"]=o(function(c){var l=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return l.data=Sa.createFrame(l.data),l.data["partial-block"]=s,i(c,l)},"partialBlockWrapper"),i.partials&&(r.partials=ZA.extend({},r.partials,i.partials))})(),t===void 0&&n&&(t=n),t===void 0)throw new wa.default("The partial "+r.name+" could not be found");if(t instanceof Function)return t(e,r)}o(L1e,"invokePartial");function fte(){return""}o(fte,"noop");function Pw(t,e){if(t&&Object.prototype.hasOwnProperty.call(t,e))return t[e]}o(Pw,"lookupOwnProperty");function F1e(t,e){return(!e||!("root"in e))&&(e=e?Sa.createFrame(e):{},e.root=t),e}o(F1e,"initData");function hte(t,e,r,s,n,i){if(t.decorator){var a={};e=t.decorator(e,a,r,s&&s[0],n,i,s),ZA.extend(e,a)}return e}o(hte,"executeDecorators");function pte(t,e,r){e&&Object.keys(e).forEach(function(s){var n=e[s];t[s]=U1e(n,r)})}o(pte,"addHelpers");function U1e(t,e){var r=e.lookupProperty;return k1e.wrapHelper(t,function(s){return s.lookupProperty=r,s})}o(U1e,"passLookupPropertyOption")});var HL=h((_w,gte)=>{"use strict";_w.__esModule=!0;_w.default=function(t){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var e=globalThis.Handlebars;t.noConflict=function(){return globalThis.Handlebars===t&&(globalThis.Handlebars=e),t}};gte.exports=_w.default});var Bte=h((kw,Ite)=>{"use strict";kw.__esModule=!0;function zL(t){return t&&t.__esModule?t:{default:t}}o(zL,"_interopRequireDefault");function JL(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(JL,"_interopRequireWildcard");var q1e=Rw(),Ete=JL(q1e),G1e=lte(),H1e=zL(G1e),V1e=Zs(),z1e=zL(V1e),J1e=Yr(),VL=JL(J1e),Y1e=mte
Line truncated
|
|
|
|
|
`+this.lexer.showPosition()+`
|
|
|
|
|
Expecting `+ue.join(", ")+", got '"+(this.terminals_[B]||B)+"'":vr="Parse error on line "+(A+1)+": Unexpected "+(B==1?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(vr,{text:this.lexer.match,token:this.terminals_[B]||B,line:this.lexer.yylineno,loc:y,expected:ue})}}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+B);switch(D[0]){case 1:a.push(B),c.push(this.lexer.yytext),l.push(this.lexer.yylloc),a.push(D[1]),B=null,N?(B=N,N=null):(p=this.lexer.yyleng,d=this.lexer.yytext,A=this.lexer.yylineno,y=this.lexer.yylloc,f>0&&f--);break;case 2:if(me=this.productions_[D[1]][1],Re.$=c[c.length-me],Re._$={first_line:l[l.length-(me||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(me||1)].first_column,last_column:l[l.length-1].last_column},E&&(Re._$.range=[l[l.length-(me||1)].range[0],l[l.length-1].range[1]]),Se=this.performAction.call(Re,d,p,A,this.yy,D[1],c,l),typeof Se<"u")return Se;me&&(a=a.slice(0,-1*me*2),c=c.slice(0,-1*me),l=l.slice(0,-1*me)),a.push(this.productions_[D[1]][0]),c.push(Re.$),l.push(Re._$),Je=u[a[a.length-2]][a[a.length-1]],a.push(Je);break;case 3:return!0}}return!0},"parse")},e=(function(){var s={EOF:1,parseError:o(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw new Error(i)},"parseError"),setInput:o(function(i){return this._input=i,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 i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.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),i},"input"),unput:o(function(i){var a=i.length,c=i.split(/(?:\r\n?|\n)/g);this._input=i+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(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
|
|
|
`+a+"^"},"showPosition"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,a,c,l,u,d;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),p=0;p<A.length&&(c=this._input.match(this.rules[A[p]]),!(c&&(!a||c[0].length>a[0].length)&&(a=c,l=p,!this.options.flex)));p++);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],i=this.performAction.call(this,this.yy,this,A[l],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
|
|
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var i=this.next();return typeof i<"u"?i:this.lex()},"lex"),begin:o(function(i){this.conditionStack.push(i)},"begin"),popState:o(function(){return this.conditionStack.pop()},"popState"),_currentRules:o(function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},"_currentRules"),topState:o(function(){return this.conditionStack[this.conditionStack.length-2]},"topState"),pushState:o(function(i){this.begin(i)},"begin")};return s.options={},s.performAction=o(function(i,a,c,l){function u(A,p){return a.yytext=a.yytext.substring(A,a.yyleng-p+A)}o(u,"strip");var d=l;switch(c){case 0:if(a.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):a.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),a.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(u(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(a.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return a.yytext=u(1,2).replace(/\\"/g,'"'),80;break;case 32:return a.yytext=u(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return a.yytext=a.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},"anonymous"),s.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],s.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},s})();t.lexer=e;function r(){this.yy={}}return o(r,"Parser"),r.prototype=t,t.Parser=r,new r})();Ow.default=j1e;Ste.exports=Ow.default});var Uw=h((Fw,Rte)=>{"use strict";Fw.__esModule=!0;function K1e(t){return t&&t.__esModule?t:{default:t}}o(K1e,"_interopRequireDefault");var X1e=Zs(),$L=K1e(X1e);function Mw(){this.parents=[]}o(Mw,"Visitor");Mw.prototype={constructor:Mw,mutating:!1,acceptKey:o(function(e,r){var s=this.accept(e[r]);if(this.mutating){if(s&&!Mw.prototype[s.type])throw new $L.default('Unexpected node type "'+s.type+'" found when accepting '+r+" on "+e.type);e[r]=s}},"acceptKey"),acceptRequired:o(function(e,r){if(this.acceptKey(e,r),!e[r])throw new $L.default(e.type+" requires "+r)},"acceptRequired"),acceptArray:o(function(e){for(var r=0,s=e.length;r<s;r++)this.acceptKey(e,r),e[r]||(e.splice(r,1),r--,s--)},"acceptArray"),accept:o(function(e){if(e){if(!this[e.type])throw new $L.default("Unknown type: "+e.type,e);this.current&&this.parents.unshift(this.current),this.current=e;var r=this[e.type](e);if(this.current=this.parents.shift(),!this.mutating||r)return r;if(r!==!1)return e}},"accept"),Program:o(function(e){this.acceptArray(e.body)},"Program"),MustacheStatement:Lw,Decorator:Lw,BlockStatement:xte,DecoratorBlock:xte,PartialStatement:Qte,PartialBlockStatement:o(function(e){Qte.call(this,e),this.acceptKey(e,"program")},"PartialBlockStatement"),ContentStatement:o(function(){},"ContentStatement"),CommentStatement:o(function(){},"CommentStatement"),SubExpression:Lw,PathExpression:o(function(){},"PathExpressionLine truncated
|
|
|
|
|
`])}),e},"merge"),each:o(function(e){for(var r=0,s=this.source.length;r<s;r++)e(this.source[r])},"each"),empty:o(function(){var e=this.currentLocation||{start:{}};return new Iu(e.start.line,e.start.column,this.srcFile)},"empty"),wrap:o(function(e){var r=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];return e instanceof Iu?e:(e=mF(e,this,r),new Iu(r.start.line,r.start.column,this.srcFile,e))},"wrap"),functionCall:o(function(e,r,s){return s=this.generateList(s),this.wrap([e,r?"."+r+"(":"(",s,")"])},"functionCall"),quotedString:o(function(e){return'"'+(e+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},"quotedString"),objectLiteral:o(function(e){var r=this,s=[];Object.keys(e).forEach(function(i){var a=mF(e[i],r);a!=="undefined"&&s.push([r.quotedString(i),":",a])});var n=this.generateList(s);return n.prepend("{"),n.add("}"),n},"objectLiteral"),generateList:o(function(e){for(var r=this.empty(),s=0,n=e.length;s<n;s++)s&&r.add(","),r.add(mF(e[s],this));return r},"generateList"),generateArray:o(function(e){var r=this.generateList(e);return r.prepend("["),r.add("]"),r},"generateArray")};$w.default=ure;dre.exports=$w.default});var gre=h((Ww,mre)=>{"use strict";Ww.__esModule=!0;function hre(t){return t&&t.__esModule?t:{default:t}}o(hre,"_interopRequireDefault");var pre=Rw(),WUe=Zs(),EF=hre(WUe),jUe=Yr(),KUe=Are(),fre=hre(KUe);function ip(t){this.value=t}o(ip,"Literal");function op(){}o(op,"JavaScriptCompiler");op.prototype={nameLookup:o(function(e,r){return this.internalNameLookup(e,r)},"nameLookup"),depthedLookup:o(function(e){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(e),")"]},"depthedLookup"),compilerInfo:o(function(){var e=pre.COMPILER_REVISION,r=pre.REVISION_CHANGES[e];return[e,r]},"compilerInfo"),appendToBuffer:o(function(e,r,s){return jUe.isArray(e)||(e=[e]),e=this.source.wrap(e,r),this.environment.isSimple?["return ",e,";"]:s?["buffer += ",e,";"]:(e.appendToBuffer=!0,e)},"appendToBuffer"),initializeBuffer:o(function(){return this.quotedString("")},"initializeBuffer"),internalNameLookup:o(function(e,r){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",e,",",JSON.stringify(r),")"]},"internalNameLookup"),lookupPropertyFunctionIsUsed:!1,compile:o(function(e,r,s,n){this.environment=e,this.options=r,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!n,this.name=this.environment.name,this.isChild=!!s,this.context=s||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(e,r),this.useDepths=this.useDepths||e.useDepths||e.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||e.useBlockParams;var i=e.opcodes,a=void 0,c=void 0,l=void 0,u=void 0;for(l=0,u=i.length;l<u;l++)a=i[l],this.source.currentLocation=a.loc,c=c||a.loc,this[a.opcode].apply(this,a.args);if(this.source.currentLocation=c,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new EF.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
|
|
|
|
|
`]),this.decorators.push("return fn;"),n?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
|
|
|
|
|
`),this.decorators.push(`}
|
|
|
|
|
`),this.decorators=this.decorators.merge()));var d=this.createFunctionContext(n);if(this.isChild)return d;var A={compiler:this.compilerInfo(),main:d};this.decorators&&(A.main_d=this.decorators,A.useDecorators=!0);var p=this.context,f=p.programs,m=p.decorators;for(l=0,u=f.length;l<u;l++)A[l]=f[l],m[l]&&(A[l+"_d"]=m[l],A.useDecorators=!0);return this.environment.usePartial&&(A.usePartial=!0),this.options.data&&(A.useData=!0),this.useDepths&&(A.useDepths=!0),this.useBlockParams&&(A.useBlockParams=!0),this.options.compat&&(A.compat=!0),n?A.compilerOptions=this.options:(A.compiler=JSON.stringify(A.compiler),this.source.currentLocation={start:{line:1,column:0}},A=this.objectLiteral(A),r.srcName?(A=A.toStringWithSourceMap({file:r.destName}),A.map=A.map&&A.map.toString()):A=A.toString()),A},"compile"),preamble:o(function(){this.lastContext=0,this.source=new fre.default(this.options.srcName),this.decorators=new fre.default(this.options.srcName)},"preamble"),createFunctionContext:o(function(e){var r=this,s="",n=this.stackVars.concat(this.registers.list);n.length>0&&(s+=", "+n.join(", "));var i=0;Object.keys(this.aliases).forEach(function(l){var u=r.aliases[l];u.children&&u.referenceCount>1&&(s+=", alias"+ ++i+"="+l,u.children[0]="alias"+i)}),this.lookupPropertyFunctionIsUsed&&(s+=", "+this.lookupPropertyFunctionVarDeclaration());var a=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&a.push("blockParams"),this.useDepths&&a.push("depths");var c=this.mergeSource(s);return e?(a.push(c),Function.apply(this,a)):this.source.wrap(["function(",a.join(","),`) {
|
|
|
|
|
`,c,"}"])},"createFunctionContext"),mergeSource:o(function(e){var r=this.environment.isSimple,s=!this.forceBuffer,n=void 0,i=void 0,a=void 0,c=void 0;return this.source.each(function(l){l.appendToBuffer?(a?l.prepend(" + "):a=l,c=l):(a&&(i?a.prepend("buffer += "):n=!0,c.add(";"),a=c=void 0),i=!0,r||(s=!1))}),s?a?(a.prepend("return "),c.add(";")):i||this.source.push('return "";'):(e+=", buffer = "+(n?"":this.initializeBuffer()),a?(a.prepend("return buffer + "),c.add(";")):this.source.push("return buffer;")),e&&this.source.prepend("var "+e.substring(2)+(n?"":`;
|
|
|
|
|
`)),this.source.merge()},"mergeSource"),lookupPropertyFunctionVarDeclaration:o(function(){return`
|
|
|
|
|
lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
|
|
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
|
|
|
return parent[propertyName];
|
|
|
|
|
}
|
|
|
|
|
return undefined
|
|
|
|
|
}
|
|
|
|
|
`.trim()},"lookupPropertyFunctionVarDeclaration"),blockValue:o(function(e){var r=this.aliasable("container.hooks.blockHelperMissing"),s=[this.contextName(0)];this.setupHelperArgs(e,0,s);var n=this.popStack();s.splice(1,0,n),this.push(this.source.functionCall(r,"call",s))},"blockValue"),ambiguousBlockValue:o(function(){var e=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var s=this.topStack();r.splice(1,0,s),this.pushSource(["if (!",this.lastHelper,") { ",s," = ",this.source.functionCall(e,"call",r),"}"])},"ambiguousBlockValue"),appendContent:o(function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},"appendContent"),append:o(function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},"append"),appendEscaped:o(function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},"appendEscaped"),getContext:o(function(e){this.lastContext=e},"getContext"),pushContext:o(function(){this.pushStackLiteral(this.contextName(this.lastContext))},"pushContext"),lookupOnContext:o(function(e,r,s,n){var i=0;!n&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(e[i++])):this.pushContext(),this.resolvePath("context",e,i,r,s)},"lookupOnContext"),lookupBlockParam:o(function(e,r){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",r,1)},"lookupBlockParam"),lookupData:o(function(e,r,s){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,s)},"lookupData"),resolvePath:o(function(e,r,s,n,i){var a=this;if(this.options.strict||this.options.assumeObjects){this.push(XUe(this.options.strict&&i,this,r,s,e));return}for(var c=r.length,l=o(function(d){a.replaceStack(function(A){var p=a.nameLookup(A,r[d],e);return n?[" && ",p]:[" != null ? ",p," : ",A]})},"_loop"),u=s;u<c;u++)l(u)},"resolvePath"),resolvePossibleLambda:o(function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},"resolvePossibleLambda"),pushStringParam:o(function(e,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof e=="string"?this.pushString(e):this.pushStackLiteral(e))},"pushStringParam"),emptyHash:o(function(e){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(e?"undefined":"{}")},"emptyHash"),pushHash:o(function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},"pushHash"),popHash:o(function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},"popHash"),pushString:o(function(e){this.pushStackLiteral(this.quotedString(e))},"pushString"),pushLiteral:o(function(e){this.pushStackLiteral(e)},"pushLiteral"),pushProgram:o(function(e){e!=null?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},"pushProgram"),registerDecorator:o(function(e,r){var s=this.nameLookup("decorators",r,"decorator"),n=this.setupHelperArgs(r,e);this.decorators.push(["var decorator = ",s,";"]),this.decorators.push(['if (typeof decorator !== "function") { throw new Error(',this.quotedString('Missing decorator: "'+r+'"'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",n])," || fn;"])},"registerDecorator"),invokeHelper:o(function(e,r,s){var n=this.popStack(),i=this.setupHelper(e,r),a=[];s&&a.push(i.name),a.push(n),this.options.strict||a.push(this.aliasable("container.hooks.helperMissing"));var c=["(",this.itemsSeparatedBy(a,"||"),")"],l=this.source.functionCall(c,"call",i.callParams);this.push(l)},"invokeHelper"),itemsSeparatedBy:o(function(e,r){var s=[];s.push(e[0]);for(var n=1;n<e.length;n++)s.push(r,e[n]);return s},"itemsSeparatedBy"),invokeKnownHelper:o(function(e,r){var s=this.setupHelper(e,r);this.push(this.source.functionCall(s.name,"call",s.callParams))},"invokeKnownHelper"),invokeAmbiguous:o(function(e,r){this.useRegister("helper");var s=this.popStack();this.emptyHash();var n=this.setupHelper(0,e,r),i=this.lastHelper=this.nameLookup("helpers",e,"helper"),a=["(","(helper = ",i," || ",s,")"];this.options.strict||(a[0]="(helper = ",a.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",a,n.paramsInit?["),(",n.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("h
Line truncated
|
|
|
|
|
`,e};Nt.prototype.Program=function(t){var e="",r=t.body,s=void 0,n=void 0;if(t.blockParams){var i="BLOCK PARAMS: [";for(s=0,n=t.blockParams.length;s<n;s++)i+=" "+t.blockParams[s];i+=" ]",e+=this.pad(i)}for(s=0,n=r.length;s<n;s++)e+=this.accept(r[s]);return this.padding--,e};Nt.prototype.MustacheStatement=function(t){return this.pad("{{ "+this.SubExpression(t)+" }}")};Nt.prototype.Decorator=function(t){return this.pad("{{ DIRECTIVE "+this.SubExpression(t)+" }}")};Nt.prototype.BlockStatement=Nt.prototype.DecoratorBlock=function(t){var e="";return e+=this.pad((t.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,e+=this.pad(this.SubExpression(t)),t.program&&(e+=this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--),t.inverse&&(t.program&&this.padding++,e+=this.pad("{{^}}"),this.padding++,e+=this.accept(t.inverse),this.padding--,t.program&&this.padding--),this.padding--,e};Nt.prototype.PartialStatement=function(t){var e="PARTIAL:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),this.pad("{{> "+e+" }}")};Nt.prototype.PartialBlockStatement=function(t){var e="PARTIAL BLOCK:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),e+=" "+this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--,this.pad("{{> "+e+" }}")};Nt.prototype.ContentStatement=function(t){return this.pad("CONTENT[ '"+t.value+"' ]")};Nt.prototype.CommentStatement=function(t){return this.pad("{{! '"+t.value+"' }}")};Nt.prototype.SubExpression=function(t){for(var e=t.params,r=[],s=void 0,n=0,i=e.length;n<i;n++)r.push(this.accept(e[n]));return e="["+r.join(", ")+"]",s=t.hash?" "+this.accept(t.hash):"",this.accept(t.path)+" "+e+s};Nt.prototype.PathExpression=function(t){var e=t.parts.join("/");return(t.data?"@":"")+"PATH:"+e};Nt.prototype.StringLiteral=function(t){return'"'+t.value+'"'};Nt.prototype.NumberLiteral=function(t){return"NUMBER{"+t.value+"}"};Nt.prototype.BooleanLiteral=function(t){return"BOOLEAN{"+t.value+"}"};Nt.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Nt.prototype.NullLiteral=function(){return"NULL"};Nt.prototype.Hash=function(t){for(var e=t.pairs,r=[],s=0,n=e.length;s<n;s++)r.push(this.accept(e[s]));return"HASH{"+r.join(", ")+"}"};Nt.prototype.HashPair=function(t){return t.key+"="+this.accept(t.value)}});var Sre=h((O0t,wre)=>{var Xw=Cre().default,bre=Ire();Xw.PrintVisitor=bre.PrintVisitor;Xw.print=bre.print;wre.exports=Xw;function Bre(t,e){var r=require("fs"),s=r.readFileSync(e,"utf8");t.exports=Xw.compile(s)}o(Bre,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=Bre,require.extensions[".hbs"]=Bre)});var Ore=h(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.getProxyUrl=g2e;s0.checkBypass=Dre;function g2e(t){let e=t.protocol==="https:";if(Dre(t))return;let r=e?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(r)try{return new r0(r)}catch{if(!r.startsWith("http://")&&!r.startsWith("https://"))return new r0(`http://${r}`)}else return}o(g2e,"getProxyUrl");function Dre(t){if(!t.hostname)return!1;let e=t.hostname;if(E2e(e))return!0;let r=process.env.no_proxy||process.env.NO_PROXY||"";if(!r)return!1;let s;t.port?s=Number(t.port):t.protocol==="http:"?s=80:t.protocol==="https:"&&(s=443);let n=[t.hostname.toUpperCase()];typeof s=="number"&&n.push(`${n[0]}:${s}`);for(let i of r.split(",").map(a=>a.trim().toUpperCase()).filter(a=>a))if(i==="*"||n.some(a=>a===i||a.endsWith(`.${i}`)||i.startsWith(".")&&a.endsWith(`${i}`)))return!0;return!1}o(Dre,"checkBypass");function E2e(t){let e=t.toLowerCase();return e==="localhost"||e.startsWith("127.")||e.startsWith("[::1]")||e.startsWith("[0:0:0:0:0:0:0:1]")}o(E2e,"isLoopbackAddress");var r0=class extends URL{static{o(this,"DecodedURL")}constructor(e,r){super(e,r),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}});var Lre=h(At=>{"use strict";var y2e=At&&At.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),C2e=At&&At.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),a0=At&&At.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[s.length]=n);return s},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),n=0;n<s.length;n++)s[n]!=="default"&&y2e(r,e,s[n]);return C2e(r,e),
Line truncated
|
|
|
|
|
`).join(`
|
|
|
|
|
`+i),t.push(n+"m+"+ES.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=u$e()+e+" "+t[0]}o(l$e,"formatArgs");function u$e(){return Ar.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(u$e,"getDate");function d$e(...t){return process.stderr.write(gS.formatWithOptions(Ar.inspectOpts,...t)+`
|
|
|
|
|
`)}o(d$e,"log");function A$e(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(A$e,"save");function p$e(){return process.env.DEBUG}o(p$e,"load");function f$e(t){t.inspectOpts={};let e=Object.keys(Ar.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Ar.inspectOpts[e[r]]}o(f$e,"init");ES.exports=fU()(Ar);var{formatters:Koe}=ES.exports;Koe.o=function(t){return this.inspectOpts.colors=this.useColors,gS.inspect(t,this.inspectOpts).split(`
|
|
|
|
|
`).map(e=>e.trim()).join(" ")};Koe.O=function(t){return this.inspectOpts.colors=this.useColors,gS.inspect(t,this.inspectOpts)}});var mU=h((JTt,hU)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?hU.exports=joe():hU.exports=Xoe()});var CS=h(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.DownloadHTTPError=xt.DownloadLengthMismatchError=xt.DownloadError=xt.ExpiredMetadataError=xt.EqualVersionError=xt.BadVersionError=xt.RepositoryError=xt.PersistError=xt.RuntimeError=xt.ValueError=void 0;var gU=class extends Error{static{o(this,"ValueError")}};xt.ValueError=gU;var EU=class extends Error{static{o(this,"RuntimeError")}};xt.RuntimeError=EU;var yU=class extends Error{static{o(this,"PersistError")}};xt.PersistError=yU;var Ug=class extends Error{static{o(this,"RepositoryError")}};xt.RepositoryError=Ug;var yS=class extends Ug{static{o(this,"BadVersionError")}};xt.BadVersionError=yS;var CU=class extends yS{static{o(this,"EqualVersionError")}};xt.EqualVersionError=CU;var IU=class extends Ug{static{o(this,"ExpiredMetadataError")}};xt.ExpiredMetadataError=IU;var qg=class extends Error{static{o(this,"DownloadError")}};xt.DownloadError=qg;var BU=class extends qg{static{o(this,"DownloadLengthMismatchError")}};xt.DownloadLengthMismatchError=BU;var bU=class extends qg{static{o(this,"DownloadHTTPError")}statusCode;constructor(e,r){super(e),this.statusCode=r}};xt.DownloadHTTPError=bU});var eae=h(Pp=>{"use strict";var SU=Pp&&Pp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.withTempFile=void 0;var wU=SU(require("fs/promises")),h$e=SU(require("os")),Zoe=SU(require("path")),m$e=o(async t=>g$e(async e=>t(Zoe.default.join(e,"tempfile"))),"withTempFile");Pp.withTempFile=m$e;var g$e=o(async t=>{let e=await wU.default.realpath(h$e.default.tmpdir()),r=await wU.default.mkdtemp(e+Zoe.default.sep);try{return await t(r)}finally{await wU.default.rm(r,{force:!0,recursive:!0,maxRetries:3})}},"withTempDir")});var rae=h((KTt,tae)=>{var NU=class{static{o(this,"RetryOperation")}#e=1;#t=null;#s=[];#r=null;#n;#i=null;#a;#o;#l=null;#c;constructor(e,r={}){this.#a=[...e],this.#o=[...e],this.#c=r.unref,this.#n=r.maxRetryTime||1/0,r.forever&&(this.#t=[...this.#o])}get timeouts(){return[...this.#o]}get errors(){return[...this.#s]}get attempts(){return this.#e}get mainError(){let e=null;if(this.#s.length){let r=0,s={};for(let n=0;n<this.#s.length;n++){let i=this.#s[n],{message:a}=i;s[a]||(s[a]=0),s[a]++,s[a]>=r&&(e=i,r=s[a])}}return e}reset(){this.#e=1,this.#o=[...this.#a]}stop(){this.#l&&clearTimeout(this.#l),this.#o=[],this.#t=null}retry(e){if(this.#s.push(e),new Date().getTime()-this.#i>=this.#n)return this.#s.unshift(new Error("RetryOperation timeout occurred")),!1;let r=this.#o.shift();if(r===void 0)if(this.#t)this.#s.pop(),r=this.#t.at(-1);else return!1;return this.#l=setTimeout(()=>{this.#e++,this.#r(this.#e)},r),this.#c&&this.#l.unref(),!0}attempt(e){this.#r=e,this.#i=new Date().getTime(),this.#r(this.#e)}};tae.exports={RetryOperation:NU}});var iae=h((ZTt,nae)=>{var{RetryOperation:E$e}=rae(),sae=o((t,e)=>Math.min(Math.round((1+(e.randomize?Math.random():0))*Math.max(e.minTimeout,1)*Math.pow(e.factor,t)),e.maxTimeout),"createTimeout"),y$e=o(t=>t?.code==="EPROMISERETRY"&&Object.hasOwn(t,"retried"),"isRetryError"),C$e=o(async(t,e={})=>{let r=[];if(e instanceof Array)r=[...e];else{e.retries===1/0&&(e.forever=!0,delete e.retries);let n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1,...e};if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");if(n.retries){for(let i=0;i<n.retries;i++)r.push(sae(i,n));r.sort((i,a)=>i-a)}else e.forever&&r.push(sae(0,n))}let s=new E$e(r,{forever:e.forever,unref:e.unref,maxRetryTime:e.maxRetryTime});return new Promise(function(n,i){s.attempt(async a=>{try{let c=await t(l=>{throw Object.assign(new Error("Retrying"),{code:"EPROMISERETRY",retried:l})},a,s);return n(c)}catch(c){if(!y$e(c))return i(c);if(!s.retry(c.retried||new Error))return i(c.retried)}})})},"promiseRetry");nae.exports={promiseRetry:C$e}});var RU=h(Hc=>{"use strict";var QU=Hc&&Hc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.DefaultFetcher=Hc.BaseFetcher=void 0;var I$e=QU(mU()),oae=QU(require("fs")),B$e=QU(require("util")),aae=CS(),b$e=eae(),w$e=iae(),S$e=(0,I$e.default)("tuf:fetch"),N$e="User-Agent",IS=class{static{o(this,"BaseFetcher")}async downloadFile(e,r,s){return(0,b$e.withTempFile)(async n=>{let i=await this.fetch(e),a=0,c=oae.default.createWriteStream(n),l=i.getReader();try{for(;;){let{done:u,value:d}=await l.read();if(u)break;if(a+=d.length,a>r)throw new aae.DownloadLengthMismatchError("Max length reached");await x$e(c,Buffer.from(d))}}finally{l.releaseLock(),await B$e.default.promisify(c.close).bind(c)()}return s(n)})}async downloadBytes(e,r){return this.downloadFile(e,r,async s=>{let n=oae.defau
Line truncated
|
|
|
|
|
`).forEach(r=>{r.match(P3e)||r.match(_3e)||(e+=r)}),Buffer.from(e,"base64")}o(k3e,"toDER");function D3e(t,e="CERTIFICATE"){let s=t.toString("base64").match(/.{1,64}/g)||"";return[`-----BEGIN ${e}-----`,...s,`-----END ${e}-----`].join(`
|
|
|
|
|
`).concat(`
|
|
|
|
|
`)}o(D3e,"fromDER")});var MS=h($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.SHA2_HASH_ALGOS=$c.RSA_SIGNATURE_ALGOS=$c.ECDSA_SIGNATURE_ALGOS=void 0;$c.ECDSA_SIGNATURE_ALGOS={"1.2.840.10045.4.3.1":"sha224","1.2.840.10045.4.3.2":"sha256","1.2.840.10045.4.3.3":"sha384","1.2.840.10045.4.3.4":"sha512"};$c.RSA_SIGNATURE_ALGOS={"1.2.840.113549.1.1.14":"sha224","1.2.840.113549.1.1.11":"sha256","1.2.840.113549.1.1.12":"sha384","1.2.840.113549.1.1.13":"sha512"};$c.SHA2_HASH_ALGOS={"2.16.840.1.101.3.4.2.1":"sha256","2.16.840.1.101.3.4.2.2":"sha384","2.16.840.1.101.3.4.2.3":"sha512"}});var ZU=h(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});LS.RFC3161TimestampVerificationError=void 0;var XU=class extends Error{static{o(this,"RFC3161TimestampVerificationError")}};LS.RFC3161TimestampVerificationError=XU});var Mae=h(To=>{"use strict";var O3e=To&&To.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),M3e=To&&To.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),L3e=To&&To.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[s.length]=n);return s},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),n=0;n<s.length;n++)s[n]!=="default"&&O3e(r,e,s[n]);return M3e(r,e),r}})();Object.defineProperty(To,"__esModule",{value:!0});To.TSTInfo=void 0;var Oae=L3e(Lp()),F3e=MS(),U3e=ZU(),e2=class{static{o(this,"TSTInfo")}root;constructor(e){this.root=e}get version(){return this.root.subs[0].toInteger()}get genTime(){return this.root.subs[4].toDate()}get messageImprintHashAlgorithm(){let e=this.messageImprintObj.subs[0].subs[0].toOID();return F3e.SHA2_HASH_ALGOS[e]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(e){let r=Oae.digest(this.messageImprintHashAlgorithm,e);if(!Oae.bufferEqual(r,this.messageImprintHashedMessage))throw new U3e.RFC3161TimestampVerificationError("message imprint does not match artifact")}get messageImprintObj(){return this.root.subs[2]}};To.TSTInfo=e2});var Fae=h(vo=>{"use strict";var q3e=vo&&vo.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),G3e=vo&&vo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),H3e=vo&&vo.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[s.length]=n);return s},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),n=0;n<s.length;n++)s[n]!=="default"&&q3e(r,e,s[n]);return G3e(r,e),r}})();Object.defineProperty(vo,"__esModule",{value:!0});vo.RFC3161Timestamp=void 0;var V3e=kS(),t2=H3e(Lp()),Lae=MS(),Yg=ZU(),z3e=Mae(),J3e="1.2.840.113549.1.7.2",Y3e="1.2.840.113549.1.9.16.1.4",$3e="1.2.840.113549.1.9.4",r2=class t{static{o(this,"RFC3161Timestamp")}root;constructor(e){this.root=e}static parse(e){let r=V3e.ASN1Obj.parseBuffer(e);return new t(r)}get status(){return this.pkiStatusInfoObj.subs[0].toInteger()}get contentType(){return this.contentTypeObj.toOID()}get eContentType(){return this.eContentTypeObj.toOID()}get signingTime(){return this.tstInfo.genTime}get signerIssuer(){return this.signerSidObj.subs[0].value}get signerSerialNumber(){return this.signerSidObj.subs[1].value}get signerDigestAlgorithm(){let e=this.signerDigestAlgorithmObj.subs[0].toOID();return Lae.SHA2_HASH_ALGOS[e]}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return Lae.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new z3e.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(e,r){if(!this.timeStampTokenObj)throw new Yg.RFC3161TimestampVerificationError("timeStampToken is missing");if(this.contentType!==J3e)throw new Yg.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==Y3e)throw new Yg.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(e),this.verifyMessageDigest(),this.verifySignature(r)}verifyMessageDigest(){let e=t2.digest(this.signerDigestAlgorithm,this.tstInfo.raw),r=this.messageDigestAttributeObj.subs[1].subs[0].valu
Line truncated
|
|
|
|
|
|
|
|
|
|
`,fje=/\u2014 (\S+) (\S+)\n/g;function hje(t,e){let r=t.inclusionProof,s=P2.fromString(r.checkpoint.envelope),n=nN.fromString(s.note);if(!mje(s,e))throw new Xg.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid checkpoint signature"});return n}o(hje,"verifyCheckpoint");function mje(t,e){let r=Buffer.from(t.note,"utf-8");return t.signatures.some(s=>{let n=e.find(i=>yce.crypto.bufferEqual(i.logID.subarray(0,4),s.keyHint)&&i.baseURL.match(s.name));return n?yce.crypto.verify(r,n.publicKey,s.signature):!1})}o(mje,"verifySignedNote");var P2=class t{static{o(this,"SignedNote")}note;signatures;constructor(e,r){this.note=e,this.signatures=r}static fromString(e){if(!e.includes(v2))throw new Xg.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"missing checkpoint separator"});let r=e.indexOf(v2),s=e.slice(0,r+1),i=e.slice(r+v2.length).matchAll(fje),a=Array.from(i,c=>{let[,l,u]=c,d=Buffer.from(u,"base64");if(d.length<5)throw new Xg.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 Xg.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"no signatures found in checkpoint"});return new t(s,a)}},nN=class t{static{o(this,"LogCheckpoint")}origin;logSize;logHash;rest;constructor(e,r,s,n){this.origin=e,this.logSize=r,this.logHash=s,this.rest=n}static fromString(e){let r=e.trimEnd().split(`
|
|
|
|
|
`);if(r.length<3)throw new Xg.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"too few lines in checkpoint header"});let s=r[0],n=BigInt(r[1]),i=Buffer.from(r[2],"base64"),a=r.slice(3);return new t(s,n,i,a)}};Zg.LogCheckpoint=nN});var Ice=h(O2=>{"use strict";Object.defineProperty(O2,"__esModule",{value:!0});O2.verifyMerkleInclusion=yje;var D2=gi(),_2=Tr(),gje=Buffer.from([0]),Eje=Buffer.from([1]);function yje(t,e){let r=t.inclusionProof,s=BigInt(r.logIndex),n=BigInt(e.logSize);if(s<0n||s>=n)throw new _2.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalid index: ${s}`});let{inner:i,border:a}=Cje(s,n);if(r.hashes.length!==i+a)throw new _2.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid hash count"});let c=r.hashes.slice(0,i),l=r.hashes.slice(i),u=Nje(t.canonicalizedBody),d=Bje(Ije(u,c,s),l);if(!D2.crypto.bufferEqual(d,e.logHash))throw new _2.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}o(yje,"verifyMerkleInclusion");function Cje(t,e){let r=bje(t,e),s=wje(t>>BigInt(r));return{inner:r,border:s}}o(Cje,"decompInclProof");function Ije(t,e,r){return e.reduce((s,n,i)=>r>>BigInt(i)&BigInt(1)?k2(n,s):k2(s,n),t)}o(Ije,"chainInner");function Bje(t,e){return e.reduce((r,s)=>k2(s,r),t)}o(Bje,"chainBorderRight");function bje(t,e){return Sje(t^e-BigInt(1))}o(bje,"innerProofSize");function wje(t){return t.toString(2).split("1").length-1}o(wje,"onesCount");function Sje(t){return t===0n?0:t.toString(2).length}o(Sje,"bitLength");function k2(t,e){return D2.crypto.digest("sha256",Eje,t,e)}o(k2,"hashChildren");function Nje(t){return D2.crypto.digest("sha256",gje,t)}o(Nje,"hashLeaf")});var bce=h(M2=>{"use strict";Object.defineProperty(M2,"__esModule",{value:!0});M2.verifyTLogSET=Rje;var Bce=gi(),xje=Tr(),Qje=qp();function Rje(t,e){if(!(0,Qje.filterTLogAuthorities)(e,{logID:t.logId.keyId,targetDate:new Date(Number(t.integratedTime)*1e3)}).some(n=>{let i=Tje(t),a=Buffer.from(Bce.json.canonicalize(i),"utf8"),c=t.inclusionPromise.signedEntryTimestamp;return Bce.crypto.verify(a,n.publicKey,c)}))throw new xje.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}o(Rje,"verifyTLogSET");function Tje(t){let{integratedTime:e,logIndex:r,logId:s,canonicalizedBody:n}=t;return{body:n.toString("base64"),integratedTime:Number(e),logIndex:Number(r),logID:s.keyId.toString("hex")}}o(Tje,"toVerificationPayload")});var Sce=h(iN=>{"use strict";Object.defineProperty(iN,"__esModule",{value:!0});iN.verifyTLogBody=Dje;iN.verifyTLogInclusion=Oje;var wce=hce(),U2=Tr(),L2=mce(),F2=gce(),vje=Ece(),Pje=Cce(),_je=Ice(),kje=bce();function Dje(t,e){let{kind:r,version:s}=t.kindVersion,n=JSON.parse(t.canonicalizedBody.toString("utf8"));if(r!==n.kind||s!==n.apiVersion)throw new U2.VerificationError({code:"TLOG_BODY_ERROR",message:`kind/version mismatch - expected: ${r}/${s}, received: ${n.kind}/${n.apiVersion}`});switch(r){case"dsse":if(s==L2.DSSE_API_VERSION_V1)return(0,L2.verifyDSSETLogBody)(n,e);{let i=wce.Entry.fromJSON(n);return(0,L2.verifyDSSETLogBodyV2)(i,e)}case"intoto":return(0,vje.verifyIntotoTLogBody)(n,e);case"hashedrekord":if(s==F2.HASHEDREKORD_API_VERSION_V1)return(0,F2.verifyHashedRekordTLogBody)(n,e);{let i=wce.Entry.fromJSON(n);return(0,F2.verifyHashedRekordTLogBodyV2)(i,e)}default:throw new U2.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported kind: ${r}`})}}o(Dje,"verifyTLogBody");function Oje(t,e){let r=!1;if(Mje(t)&&((0,kje.verifyTLogSET)(t,e),r=!0),Lje(t)){let s=(0,Pje.verifyCheckpoint)(t,e);(0,_je.verifyMerkleInclusion)(t,s),r=!0}if(!r)throw new U2.VerificationError({code:"TLOG_MISSING_INCLUSION_ERROR",message:"inclusion could not be verified"})}o(Oje,"verifyTLogInclusion");function Mje(t){return t.inclusionPromise!==void 0}o(Mje,"isTLogEntryWithInclusionPromise");function Lje(t){return t.inclusionProof!==void 0}o(Lje,"isTLogEntryWithInclusionProof")});var Tce=h(oN=>{"use strict";Object.defineProperty(oN,"__esModule",{value:!0});oN.Verifier=void 0;var Fje=require("util"),zp=Tr(),Nce=sce(),q2=nce(),xce=ace(),Qce=Sce(),G2=class{static{o(this,"Verifier")}trustMaterial;options;constructor(e,r={}){this.trustMaterial=e,this.options={ctlogThreshold:r.ctlogThreshold??1,tlogThreshold:r.tlogThreshold??1,timestampThreshold:r.timestampThreshold??r.tsaThreshold??1,tsaThreshold:0}}verify(e,r){let s=this.verifyTimestamps(e),n=this.verifySigningKey(e,s);return this.verifyTLogs(e),this.verifySignature(e,n),r&&this.verifyPolicy(r,n.identity||{}),n}verifyTimestamps(e){let r=[];for(let s of e.timestamps)switch(s.$case){case"timestamp-authority":r.push((0,xce.getTSATimestamp)(s.timestamp,e.signature.signature,this.trustMaterial.timestampAuthorities));break;case"transparency-log":{let n=(0,xce.getTLogTimestamp)(s.tlogEntry);n&&r.push(n);break}}if(Rce(r))throw new zp.VerificationError({code:"TIMESTAMP_ERROR",message:"duplicate timestamp"});if(r.length<this.options.timestampThresho
Line truncated
|
|
|
|
|
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}o(cC,"getBooleanInput");function tW(t){process.exitCode=fT.Failure,Vd(t)}o(tW,"setFailed");function Rl(){return process.env.RUNNER_DEBUG==="1"}o(Rl,"isDebug");function b(t){Ua("debug",{},t)}o(b,"debug");function Vd(t,e={}){Ua("error",wN(e),t instanceof Error?t.toString():t)}o(Vd,"error");function et(t,e={}){Ua("warning",wN(e),t instanceof Error?t.toString():t)}o(et,"warning");function S(t){process.stdout.write(t+Z3.EOL)}o(S,"info");function RBe(t){NN("group",t)}o(RBe,"startGroup");function TBe(){NN("endgroup")}o(TBe,"endGroup");function Ms(t,e){return QBe(this,void 0,void 0,function*(){RBe(t);let r;try{r=yield e()}finally{TBe()}return r})}o(Ms,"group");function lC(t,e){if(process.env.GITHUB_STATE||"")return xN("STATE",eq(t,e));Ua("save-state",{name:t},Fa(e))}o(lC,"saveState");function rW(t){return process.env[`STATE_${t}`]||""}o(rW,"getState");var pw=w(require("fs"),1),IL=w(require("os"),1),BL=w(require("path"),1);var nW=w(require("os"),1);function ch(t){return t==null?"":typeof t=="string"||t instanceof String?t:JSON.stringify(t)}o(ch,"toCommandValue");function iW(t,e,r){let s=new hT(t,e,r);process.stdout.write(s.toString()+nW.EOL)}o(iW,"issueCommand");var sW="::",hT=class{static{o(this,"Command")}constructor(e,r,s){e||(e="missing.command"),this.command=e,this.properties=r,this.message=s}toString(){let e=sW+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let r=!0;for(let s in this.properties)if(this.properties.hasOwnProperty(s)){let n=this.properties[s];n&&(r?r=!1:e+=",",e+=`${s}=${PBe(n)}`)}}return e+=`${sW}${vBe(this.message)}`,e}};function vBe(t){return ch(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}o(vBe,"escapeData");function PBe(t){return ch(t).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}o(PBe,"escapeProperty");var lW=w(require("os"),1);var aW=require("os"),lh=require("fs");var mT=function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return o(n,"adopt"),new(r||(r=Promise))(function(i,a){function c(d){try{u(s.next(d))}catch(A){a(A)}}o(c,"fulfilled");function l(d){try{u(s.throw(d))}catch(A){a(A)}}o(l,"rejected");function u(d){d.done?i(d.value):n(d.value).then(c,l)}o(u,"step"),u((s=s.apply(t,e||[])).next())})},{access:_Be,appendFile:kBe,writeFile:DBe}=lh.promises,oW="GITHUB_STEP_SUMMARY";var gT=class{static{o(this,"Summary")}constructor(){this._buffer=""}filePath(){return mT(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let e=process.env[oW];if(!e)throw new Error(`Unable to find environment variable for $${oW}. Check if your runtime environment supports job summaries.`);try{yield _Be(e,lh.constants.R_OK|lh.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}return this._filePath=e,this._filePath})}wrap(e,r,s={}){let n=Object.entries(s).map(([i,a])=>` ${i}="${a}"`).join("");return r?`<${e}${n}>${r}</${e}>`:`<${e}${n}>`}write(e){return mT(this,void 0,void 0,function*(){let r=!!e?.overwrite,s=yield this.filePath();return yield(r?DBe:kBe)(s,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return mT(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(e,r=!1){return this._buffer+=e,r?this.addEOL():this}addEOL(){return this.addRaw(aW.EOL)}addCodeBlock(e,r){let s=Object.assign({},r&&{lang:r}),n=this.wrap("pre",this.wrap("code",e),s);return this.addRaw(n).addEOL()}addList(e,r=!1){let s=r?"ol":"ul",n=e.map(a=>this.wrap("li",a)).join(""),i=this.wrap(s,n);return this.addRaw(i).addEOL()}addTable(e){let r=e.map(n=>{let i=n.map(a=>{if(typeof a=="string")return this.wrap("td",a);let{header:c,data:l,colspan:u,rowspan:d}=a,A=c?"th":"td",p=Object.assign(Object.assign({},u&&{colspan:u}),d&&{rowspan:d});return this.wrap(A,l,p)}).join("");return this.wrap("tr",i)}).join(""),s=this.wrap("table",r);return this.addRaw(s).addEOL()}addDetails(e,r){let s=this.wrap("details",this.wrap("summary",e)+r);return this.addRaw(s).addEOL()}addImage(e,r,s){let{width:n,height:i}=s||{},a=Object.assign(Object.assign({},n&&{width:n}),i&&{height:i}),c=this.wrap("img",null,Object.assign({src:e,alt:r},a));return this.addRaw(c).addEOL()}addHeading(e,r){let s=`h${r}`,n=["h1","h2","h3","h4","h5","h6"].includes(s)?s:"h1",i=this.wrap(n,e);return this.addRaw(i).addEOL()}addSeparator(){let e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){let e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,r){let s=Object.assign({},r&&{cite:r}),n=this.wrap("blockquote",e,s);return this.addRaw(n).addEOL()}addLink(e,r){let s=this.wrap("a",e,{href:r});return this.addRaw(s).addEOL()}},b9e=new gT;var ET=w(require("os"),1);var Q9e=ET.default.platform(),R9e=ET.defauLine truncated
|
|
|
|
|
`),e=e.replace(/\r/g,`
|
|
|
|
|
`));let n=e.split(`
|
|
|
|
|
`).map(i=>i.trim());for(let i of n)!i||i.startsWith("#")||s.patterns.push(new Bh(i));return s.searchPaths.push(...XT(s.patterns)),s})}static stat(e,r,s){return sv(this,void 0,void 0,function*(){let n;if(r.followSymbolicLinks)try{n=yield Kd.promises.stat(e.path)}catch(i){if(i.code==="ENOENT"){if(r.omitBrokenSymbolicLinks){hn(`Broken symlink '${e.path}'`);return}throw new Error(`No information found for the path '${e.path}'. This may indicate a broken symbolic link.`)}throw i}else n=yield Kd.promises.lstat(e.path);if(n.isDirectory()&&r.followSymbolicLinks){let i=yield Kd.promises.realpath(e.path);for(;s.length>=e.level;)s.pop();if(s.some(a=>a===i)){hn(`Symlink cycle detected for path '${e.path}' and realpath '${i}'`);return}s.push(i)}return n})}};var BSe=function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return o(n,"adopt"),new(r||(r=Promise))(function(i,a){function c(d){try{u(s.next(d))}catch(A){a(A)}}o(c,"fulfilled");function l(d){try{u(s.throw(d))}catch(A){a(A)}}o(l,"rejected");function u(d){d.done?i(d.value):n(d.value).then(c,l)}o(u,"step"),u((s=s.apply(t,e||[])).next())})};function q4(t,e){return BSe(this,void 0,void 0,function*(){return yield RC.create(t,e)})}o(q4,"create");var zC=w(require("crypto"),1),eA=w(require("fs"),1),Dl=w(require("path"),1),P8=w(T8(),1),_8=w(require("util"),1);var vh;(function(t){t.Gzip="cache.tgz",t.Zstd="cache.tzst"})(vh||(vh={}));var Ur;(function(t){t.Gzip="gzip",t.ZstdWithoutLong="zstd-without-long",t.Zstd="zstd"})(Ur||(Ur={}));var Fs;(function(t){t.GNU="gnu",t.BSD="bsd"})(Fs||(Fs={}));var HC=2,VC=5e3,bv=5e3,wv=`${process.env.PROGRAMFILES}\\Git\\usr\\bin\\tar.exe`,v8=`${process.env.SYSTEMDRIVE}\\Windows\\System32\\tar.exe`,Ph="cache.tar",Sv="manifest.txt",Pet=10*Math.pow(1024,3);var Zd=function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return o(n,"adopt"),new(r||(r=Promise))(function(i,a){function c(d){try{u(s.next(d))}catch(A){a(A)}}o(c,"fulfilled");function l(d){try{u(s.throw(d))}catch(A){a(A)}}o(l,"rejected");function u(d){d.done?i(d.value):n(d.value).then(c,l)}o(u,"step"),u((s=s.apply(t,e||[])).next())})},yQe=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r);function s(i){r[i]=t[i]&&function(a){return new Promise(function(c,l){a=t[i](a),n(c,l,a.done,a.value)})}}function n(i,a,c,l){Promise.resolve(l).then(function(u){i({value:u,done:c})},a)}},CQe="1.0";function _h(){return Zd(this,void 0,void 0,function*(){let t=process.platform==="win32",e=process.env.RUNNER_TEMP||"";if(!e){let s;t?s=process.env.USERPROFILE||"C:\\":process.platform==="darwin"?s="/Users":s="/home",e=Dl.join(s,"actions","temp")}let r=Dl.join(e,zC.randomUUID());return yield ra(r),r})}o(_h,"createTempDirectory");function Li(t){return eA.statSync(t).size}o(Li,"getArchiveFileSizeInBytes");function Nv(t){return Zd(this,void 0,void 0,function*(){var e,r,s,n,i;let a=[],c=(i=process.env.GITHUB_WORKSPACE)!==null&&i!==void 0?i:process.cwd(),l=yield q4(t.join(`
|
|
|
|
|
`),{implicitDescendants:!1});try{for(var u=!0,d=yQe(l.globGenerator()),A;A=yield d.next(),e=A.done,!e;u=!0){n=A.value,u=!1;let f=Dl.relative(c,n).replace(new RegExp(`\\${Dl.sep}`,"g"),"/");b(`Matched: ${f}`),f===""?a.push("."):a.push(`${f}`)}}catch(p){r={error:p}}finally{try{!u&&!e&&(s=d.return)&&(yield s.call(d))}finally{if(r)throw r.error}}return a})}o(Nv,"resolvePaths");function kh(t){return Zd(this,void 0,void 0,function*(){return _8.promisify(eA.unlink)(t)})}o(kh,"unlinkFile");function k8(t){return Zd(this,arguments,void 0,function*(e,r=[]){let s="";r.push("--version"),b(`Checking ${e} ${r.join(" ")}`);try{yield Os(`${e}`,r,{ignoreReturnCode:!0,silent:!0,listeners:{stdout:o(n=>s+=n.toString(),"stdout"),stderr:o(n=>s+=n.toString(),"stderr")}})}catch(n){b(n.message)}return s=s.trim(),b(s),s})}o(k8,"getVersion");function Dh(){return Zd(this,void 0,void 0,function*(){let t=yield k8("zstd",["--quiet"]),e=P8.clean(t);return b(`zstd version: ${e}`),t===""?Ur.Gzip:Ur.ZstdWithoutLong})}o(Dh,"getCompressionMethod");function pc(t){return t===Ur.Gzip?vh.Gzip:vh.Zstd}o(pc,"getCacheFileName");function D8(){return Zd(this,void 0,void 0,function*(){return eA.existsSync(wv)?wv:(yield k8("tar")).toLowerCase().includes("gnu tar")?fr("tar"):""})}o(D8,"getGnuTarPathOnWindows");function xv(t,e){if(e===void 0)throw Error(`Expected ${t} but value was undefiend`);return e}o(xv,"assertDefined");function tA(t,e,r=!1){let s=t.slice();return e&&s.push(e),process.platform==="win32"&&!r&&s.push("windows-only"),s.push(CQe),zC.createHash("sha256").update(s.join("|")).digest("hex")}o(tA,"getCacheVersion");function O8(){let t=process.env.ACTIONS_RUNTIME_TOKEN;if(!t)throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable");return t}o(O8,"getRuntimeToken");var Mh=w(require("http"),1),Tv=w(require("https"),1);function Qv(t){let e=t.protocol==="https:";if(IQe(t))return;let r=e?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY;if(r)try{return new YC(r)}catch{if(!r.startsWith("http://")&&!r.startsWith("https://"))return new YC(`http://${r}`)}else return}o(Qv,"getProxyUrl");function IQe(t){if(!t.hostname)return!1;let e=t.hostname;if(BQe(e))return!0;let r=process.env.no_proxy||process.env.NO_PROXY||"";if(!r)return!1;let s;t.port?s=Number(t.port):t.protocol==="http:"?s=80:t.protocol==="https:"&&(s=443);let n=[t.hostname.toUpperCase()];typeof s=="number"&&n.push(`${n[0]}:${s}`);for(let i of r.split(",").map(a=>a.trim().toUpperCase()).filter(a=>a))if(i==="*"||n.some(a=>a===i||a.endsWith(`.${i}`)||i.startsWith(".")&&a.endsWith(`${i}`)))return!0;return!1}o(IQe,"checkBypass");function BQe(t){let e=t.toLowerCase();return e==="localhost"||e.startsWith("127.")||e.startsWith("[::1]")||e.startsWith("[0:0:0:0:0:0:0:1]")}o(BQe,"isLoopbackAddress");var YC=class extends URL{static{o(this,"DecodedURL")}constructor(e,r){super(e,r),this._decodedUsername=decodeURIComponent(super.username),this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}};var fc=w(Zp(),1),M8=w(qd(),1);var vt=function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return o(n,"adopt"),new(r||(r=Promise))(function(i,a){function c(d){try{u(s.next(d))}catch(A){a(A)}}o(c,"fulfilled");function l(d){try{u(s.throw(d))}catch(A){a(A)}}o(l,"rejected");function u(d){d.done?i(d.value):n(d.value).then(c,l)}o(u,"step"),u((s=s.apply(t,e||[])).next())})},yt;(function(t){t[t.OK=200]="OK",t[t.MultipleChoices=300]="MultipleChoices",t[t.MovedPermanently=301]="MovedPermanently",t[t.ResourceMoved=302]="ResourceMoved",t[t.SeeOther=303]="SeeOther",t[t.NotModified=304]="NotModified",t[t.UseProxy=305]="UseProxy",t[t.SwitchProxy=306]="SwitchProxy",t[t.TemporaryRedirect=307]="TemporaryRedirect",t[t.PermanentRedirect=308]="PermanentRedirect",t[t.BadRequest=400]="BadRequest",t[t.Unauthorized=401]="Unauthorized",t[t.PaymentRequired=402]="PaymentRequired",t[t.Forbidden=403]="Forbidden",t[t.NotFound=404]="NotFound",t[t.MethodNotAllowed=405]="MethodNotAllowed",t[t.NotAcceptable=406]="NotAcceptable",t[t.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",t[t.RequestTimeout=408]="RequestTimeout",t[t.Conflict=409]="Conflict",t[t.Gone=410]="Gone",t[t.TooManyRequests=429]="TooManyRequests",t[t.InternalServerError=500]="InternalServerError",t[t.NotImplemented=501]="NotImplemented",t[t.BadGateway=502]="BadGateway",t[t.ServiceUnavailable=503]="ServiceUnavailable",t[t.GatewayTimeout=504]="GatewayTimeout"})(yt||(yt={}));var qr;(function(t){t.Accept="accept",t.ContentType="content-type"})(qr||(qr={}));var oa;(function(t){t.ApplicationJson="application/json"})(oa||(oa={}));var wQe=[yt.MovedPermanently,yt.ResourceMoved,yt.SeeOther,yt.TemporaryRedirect,yt.PermanentRedirect],SQe=[yt.BadGateway,yt.ServiceUnavailable,yt.GatewayTimeout],NQe=["OPTIONS","GET","DELETE","HEAD"],xQe=10,QQe=5,Fi=class t extends Error{static{o(this,"HttpClientError")}constructor(e,r)
Line truncated
|
|
|
|
|
${MQe.sanitize({...this,request:{...this.request,agent:s},response:this.response})}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};function ZC(t){return t instanceof Gr?!0:Ml(t)&&t.name==="RestError"}o(ZC,"isRestError");function is(t,e){return Buffer.from(t,e)}o(is,"stringToUint8Array");var eI=w(require("node:http"),1),tI=w(require("node:https"),1),Uv=w(require("node:zlib"),1),t6=require("node:stream");var En=Lh("ts-http-runtime");var LQe={};function Fh(t){return t&&typeof t.pipe=="function"}o(Fh,"isReadableStream");function e6(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(e6,"isStreamComplete");function r6(t){return t&&typeof t.byteLength=="number"}o(r6,"isArrayBuffer");var rI=class extends t6.Transform{static{o(this,"ReportTransform")}loadedBytes=0;progressCallback;_transform(e,r,s){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),s()}catch(n){s(n)}}constructor(e){super(),this.progressCallback=e}},qv=class{static{o(this,"NodeHttpClient")}cachedHttpAgent;cachedHttpsAgents=new WeakMap;async sendRequest(e){let r=new AbortController,s;if(e.abortSignal){if(e.abortSignal.aborted)throw new Ui("The operation was aborted. Request has already been canceled.");s=o(u=>{u.type==="abort"&&r.abort()},"abortListener"),e.abortSignal.addEventListener("abort",s)}let n;e.timeout>0&&(n=setTimeout(()=>{let u=new ni;En.info(`request to '${u.sanitizeUrl(e.url)}' timed out. canceling...`),r.abort()},e.timeout));let i=e.headers.get("Accept-Encoding"),a=i?.includes("gzip")||i?.includes("deflate"),c=typeof e.body=="function"?e.body():e.body;if(c&&!e.headers.has("Content-Length")){let u=GQe(c);u!==null&&e.headers.set("Content-Length",u)}let l;try{if(c&&e.onUploadProgress){let m=e.onUploadProgress,g=new rI(m);g.on("error",y=>{En.error("Error in upload progress",y)}),Fh(c)?c.pipe(g):g.end(c),c=g}let u=await this.makeRequest(e,r,c);n!==void 0&&clearTimeout(n);let d=FQe(u),p={status:u.statusCode??0,headers:d,request:e};if(e.method==="HEAD")return u.resume(),p;l=a?UQe(u,d):u;let f=e.onDownloadProgress;if(f){let m=new rI(f);m.on("error",g=>{En.error("Error in download progress",g)}),l.pipe(m),l=m}return e.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY)||e.streamResponseStatusCodes?.has(p.status)?p.readableStreamBody=l:p.bodyAsText=await qQe(l),p}finally{if(e.abortSignal&&s){let u=Promise.resolve();Fh(c)&&(u=e6(c));let d=Promise.resolve();Fh(l)&&(d=e6(l)),Promise.all([u,d]).then(()=>{s&&e.abortSignal?.removeEventListener("abort",s)}).catch(A=>{En.warning("Error when cleaning up abortListener on httpRequest",A)})}}}makeRequest(e,r,s){let n=new URL(e.url),i=n.protocol!=="https:";if(i&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let c={agent:e.agent??this.getOrCreateAgent(e,i),hostname:n.hostname,path:`${n.pathname}${n.search}`,port:n.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0}),...e.requestOverrides};return new Promise((l,u)=>{let d=i?eI.default.request(c,l):tI.default.request(c,l);d.once("error",A=>{u(new Gr(A.message,{code:A.code??Gr.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let A=new Ui("The operation was aborted. Rejecting from abort signal callback while making request.");d.destroy(A),u(A)}),s&&Fh(s)?s.pipe(d):s?typeof s=="string"||Buffer.isBuffer(s)?d.end(s):r6(s)?d.end(ArrayBuffer.isView(s)?Buffer.from(s.buffer):Buffer.from(s)):(En.error("Unrecognized body type",s),u(new Gr("Unrecognized body type"))):d.end()})}getOrCreateAgent(e,r){let s=e.disableKeepAlive;if(r)return s?eI.default.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new eI.default.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(s&&!e.tlsSettings)return tI.default.globalAgent;let n=e.tlsSettings??LQe,i=this.cachedHttpsAgents.get(n);return i&&i.options.keepAlive===!s||(En.info("No cached TLS Agent exist, creating a new Agent"),i=new tI.default.Agent({keepAlive:!s,...n}),this.cachedHttpsAgents.set(n,i)),i}}};function FQe(t){let e=Us();for(let r of Object.keys(t.headers)){let s=t.headers[r];Array.isArray(s)?s.length>0&&e.set(r,s[0]):s&&e.set(r,s)}return e}o(FQe,"getResponseHeaders");function UQe(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let s=Uv.default.createGunzip();return t.pipe(s),s}else if(r==="deflate"){let s=Uv.default.createInflate();return t.pipe(s),s}return t}o(UQe,"getDecodedResponseStream");function qQe(t){return new Promise((e,r)=>{let s=[];t.on("data",n=>{Buffer.isBuffer(n)?s.push(n):s.push(Buffer.from(n))}),t.on("end",()=>{e(Buffer.concat(s).toString("utf8"))}),t.on("error",n=>{n&&n?.name==="AbortError"?r(n):r(new Gr(`Error reading response as text: ${n.message}`,{code:Gr.PARSE_ERROR}))})})}o(qQe,"streamToText");function GQe(t){return t?Buffer.isBuffer(t)?t.length:Fh(t)?nul
Line truncated
|
|
|
|
|
`;return e}o(yTe,"encodeHeaders");function CTe(t){return t instanceof Uint8Array?t.byteLength:NI(t)?t.size===-1?void 0:t.size:void 0}o(CTe,"getLength");function ITe(t){let e=0;for(let r of t){let s=CTe(r);if(s===void 0)return;e+=s}return e}o(ITe,"getTotalLength");async function BTe(t,e,r){let s=[is(`--${r}`,"utf-8"),...e.flatMap(i=>[is(`\r
|
|
|
|
|
`,"utf-8"),is(yTe(i.headers),"utf-8"),is(`\r
|
|
|
|
|
`,"utf-8"),i.body,is(`\r
|
|
|
|
|
--${r}`,"utf-8")]),is(`--\r
|
|
|
|
|
\r
|
|
|
|
|
`,"utf-8")],n=ITe(s);n&&t.headers.set("Content-Length",n),t.body=await o9(s)}o(BTe,"buildRequestBody");var Gh="multipartPolicy",bTe=70,wTe=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function STe(t){if(t.length>bTe)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!wTe.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}o(STe,"assertValidBoundary");function QI(){return{name:Gh,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,s=t.headers.get("Content-Type")??"multipart/mixed",n=s.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!n)throw new Error(`Got multipart request body, but content-type header was not multipart: ${s}`);let[,i,a]=n;if(a&&r&&a!==r)throw new Error(`Multipart boundary was specified as ${a} in the header, but got ${r} in the request body`);return r??=a,r?STe(r):r=ETe(),t.headers.set("Content-Type",`${i}; boundary=${r}`),await BTe(t,t.multipartBody.parts,r),t.multipartBody=void 0,e(t)}}}o(QI,"multipartPolicy");function RI(){return XC()}o(RI,"createEmptyPipeline");var a9=WC({logLevelEnvVarName:"AZURE_LOG_LEVEL",namespace:"azure"}),Tit=a9.logger;function Hi(t){return a9.createClientLogger(t)}o(Hi,"createClientLogger");var Vi=Hi("core-rest-pipeline");function oP(t={}){return nI({logger:Vi.info,...t})}o(oP,"logPolicy");var aP=iI;function cP(t={}){return oI(t)}o(cP,"redirectPolicy");var TI=w(require("node:os"),1),vI=w(require("node:process"),1);function c9(){return"User-Agent"}o(c9,"getHeaderName");async function l9(t){if(vI.default&&vI.default.versions){let e=`${TI.default.type()} ${TI.default.release()}; ${TI.default.arch()}`,r=vI.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(l9,"setPlatformSpecificData");var PI="1.22.2";function _Te(t){let e=[];for(let[r,s]of t){let n=s?`${r}/${s}`:r;e.push(n)}return e.join(" ")}o(_Te,"getUserAgentString");function u9(){return c9()}o(u9,"getUserAgentHeaderName");async function _I(t){let e=new Map;e.set("core-rest-pipeline",PI),await l9(e);let r=_Te(e);return t?`${t} ${r}`:r}o(_I,"getUserAgentValue");var d9=u9(),A9="userAgentPolicy";function lP(t={}){let e=_I(t.userAgentPrefix);return{name:A9,async sendRequest(r,s){return r.headers.has(d9)||r.headers.set(d9,await e),s(r)}}}o(lP,"userAgentPolicy");var Vs=class extends Error{static{o(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function uP(t,e){let{cleanupBeforeAbort:r,abortSignal:s,abortErrorMsg:n}=e??{};return new Promise((i,a)=>{function c(){a(new Vs(n??"The operation was aborted."))}o(c,"rejectOnAbort");function l(){s?.removeEventListener("abort",u)}o(l,"removeListeners");function u(){r?.(),l(),c()}if(o(u,"onAbort"),s?.aborted)return c();try{t(d=>{l(),i(d)},d=>{l(),a(d)})}catch(d){a(d)}s?.addEventListener("abort",u)})}o(uP,"createAbortablePromise");var LTe="The delay was aborted.";function Hh(t,e){let r,{abortSignal:s,abortErrorMsg:n}=e??{};return uP(i=>{r=setTimeout(i,t)},{cleanupBeforeAbort:o(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:s,abortErrorMsg:n??LTe})}o(Hh,"delay");function mc(t){if(Ml(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`Unknown error ${e}`}}o(mc,"getErrorMessage");function p9(t){return Ml(t)}o(p9,"isError");function uA(){return Ol()}o(uA,"randomUUID");var ke=Ul;var f9=Symbol("rawContent");function AP(t){return typeof t[f9]=="function"}o(AP,"hasRawContent");function h9(t){return AP(t)?t[f9]():t}o(h9,"getRawContent");var kI=Gh;function pP(){let t=QI();return{name:kI,sendRequest:o(async(e,r)=>{if(e.multipartBody)for(let s of e.multipartBody.parts)AP(s.body)&&(s.body=h9(s.body));return t.sendRequest(e,r)},"sendRequest")}}o(pP,"multipartPolicy");var fP=aI;function hP(){return cI()}o(hP,"decompressResponsePolicy");function mP(t={}){return dI(t)}o(mP,"defaultRetryPolicy");function gP(){return AI()}o(gP,"formDataPolicy");function gc(t){return tP(t)}o(gc,"getDefaultProxySettings");function EP(t,e){return bI(t,e)}o(EP,"proxyPolicy");var m9="setClientRequestIdPolicy";function yP(t="x-ms-client-request-id"){return{name:m9,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}o(yP,"setClientRequestIdPolicy");function CP(t){return wI(t)}o(CP,"agentPolicy");function IP(t){return SI(t)}o(IP,"tlsPolicy");var dA={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function g9(t={}){let e=new BP(t.parentContext);return t.span&&(e=e.setValue(dA.span,t.span)),t.namespace&&(e=e.setValue(dA.namespace,t.namespace)),e}o(g9,"createTracingContext");var BP=class t{static{o(this,"TracingContextImpl")}_contextMap;constructor(e){this._contextMap=e instanceof t?new Map(e._context
Line truncated
|
|
|
|
|
`&&t[i]!=="\r";i++)l+=t[i];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),i--),!cPe(l)){let A;return l.trim().length===0?A="Invalid space after '<'.":A="Tag '"+l+"' is an invalid name.",Pt("InvalidTag",A,Hr(t,i))}let u=sPe(t,i);if(u===!1)return Pt("InvalidAttr","Attributes for '"+l+"' have open quote.",Hr(t,i));let d=u.value;if(i=u.index,d[d.length-1]==="/"){let A=i-d.length;d=d.substring(0,d.length-1);let p=eK(d,e);if(p===!0)s=!0;else return Pt(p.err.code,p.err.msg,Hr(t,A+p.err.line))}else if(c)if(u.tagClosed){if(d.trim().length>0)return Pt("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Hr(t,a));if(r.length===0)return Pt("InvalidTag","Closing tag '"+l+"' has not been opened.",Hr(t,a));{let A=r.pop();if(l!==A.tagName){let p=Hr(t,A.tagStartPos);return Pt("InvalidTag","Expected closing tag '"+A.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+l+"'.",Hr(t,a))}r.length==0&&(n=!0)}}else return Pt("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Hr(t,i));else{let A=eK(d,e);if(A!==!0)return Pt(A.err.code,A.err.msg,Hr(t,i-d.length+A.err.line));if(n===!0)return Pt("InvalidXml","Multiple possible root nodes found.",Hr(t,i));e.unpairedTags.indexOf(l)!==-1||r.push({tagName:l,tagStartPos:a}),s=!0}for(i++;i<t.length;i++)if(t[i]==="<")if(t[i+1]==="!"){i++,i=Z9(t,i);continue}else if(t[i+1]==="?"){if(i=X9(t,++i),i.err)return i}else break;else if(t[i]==="&"){let A=oPe(t,i);if(A==-1)return Pt("InvalidChar","char '&' is not expected.",Hr(t,i));i=A}else if(n===!0&&!K9(t[i]))return Pt("InvalidXml","Extra text at the end",Hr(t,i));t[i]==="<"&&i--}}else{if(K9(t[i]))continue;return Pt("InvalidChar","char '"+t[i]+"' is not expected.",Hr(t,i))}if(s){if(r.length==1)return Pt("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",Hr(t,r[0].tagStartPos));if(r.length>0)return Pt("InvalidXml","Invalid '"+JSON.stringify(r.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Pt("InvalidXml","Start tag expected.",1);return!0}o(YI,"validate");function K9(t){return t===" "||t===" "||t===`
|
|
|
|
|
`||t==="\r"}o(K9,"isWhiteSpace");function X9(t,e){let r=e;for(;e<t.length;e++)if(t[e]=="?"||t[e]==" "){let s=t.substr(r,e-r);if(e>5&&s==="xml")return Pt("InvalidXml","XML declaration allowed only at the start of the document.",Hr(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}o(X9,"readPI");function Z9(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(Z9,"readCommentAndCDATA");var tPe='"',rPe="'";function sPe(t,e){let r="",s="",n=!1;for(;e<t.length;e++){if(t[e]===tPe||t[e]===rPe)s===""?s=t[e]:s!==t[e]||(s="");else if(t[e]===">"&&s===""){n=!0;break}r+=t[e]}return s!==""?!1:{value:r,index:e,tagClosed:n}}o(sPe,"readAttributeStr");var nPe=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function eK(t,e){let r=zI(t,nPe),s={};for(let n=0;n<r.length;n++){if(r[n][1].length===0)return Pt("InvalidAttr","Attribute '"+r[n][2]+"' has no space in starting.",tm(r[n]));if(r[n][3]!==void 0&&r[n][4]===void 0)return Pt("InvalidAttr","Attribute '"+r[n][2]+"' is without value.",tm(r[n]));if(r[n][3]===void 0&&!e.allowBooleanAttributes)return Pt("InvalidAttr","boolean attribute '"+r[n][2]+"' is not allowed.",tm(r[n]));let i=r[n][2];if(!aPe(i))return Pt("InvalidAttr","Attribute '"+i+"' is an invalid name.",tm(r[n]));if(!Object.prototype.hasOwnProperty.call(s,i))s[i]=1;else return Pt("InvalidAttr","Attribute '"+i+"' is repeated.",tm(r[n]))}return!0}o(eK,"validateAttributeString");function iPe(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(iPe,"validateNumberAmpersand");function oPe(t,e){if(e++,t[e]===";")return-1;if(t[e]==="#")return e++,iPe(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(oPe,"validateAmpersand");function Pt(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}o(Pt,"getErrorObject");function aPe(t){return UP(t)}o(aPe,"validateAttrName");function cPe(t){return UP(t)}o(cPe,"validateTagName");function Hr(t,e){let r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}o(Hr,"getLineNumberForPosition");function tm(t){return t.startIndex+t[1].length}o(tm,"getPositionFromMatch");var tK={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"},rK={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",ntilde:"\xF1",Ograve:"\xD2",ograve:"\xF2",Oacute:"\xD3",oacute:"\xF3",Ocirc:"\xD4",ocirc:"\xF4",Otilde:"\xD5",otilde:"\xF5",Ouml:"\xD6",ouml:"\xF6",Oslash:"\xD8",oslash:"\xF8",Ugrave:"\xD9",ugrave:"\xF9",Uacute:"\xDA",uacute:"\xFA",Ucirc:"\xDB",ucirc:"\xFB",Uuml:"\xDC",uuml:"\xFC",Yacute:"\xDD",yacute:"\xFD",THORN:"\xDE",thorn:"\xFE",szlig:"\xDF",yuml:"\xFF",Yuml:"\u0178"},sK={Amacr:"\u0100",amacr:"\u0101",Abreve:"\u0102",abreve:"\u0103",Aogon:"\u0104",aogon:"\u0105",Cacute:"\u0106",cacute:"\u0107",Ccirc:"\u0108",ccirc:"\u0109",Cdot:"\u010A",cdot:"\u010B",Ccaron:"\u010C",ccaron:"\u010D",Dcaron:"\u010E",dcaron:"\u010F",Dstrok:"\u0110",dstrok:"\u0111",Emacr:"\u0112",emacr:"\u0113",Ecaron:"\u011A",ecaron:"\u011B",Edot:"\u0116",edot:"\u0117",Eogon:"\u0118",eogon:"\u0119",Gcirc:"\u011C",gcirc:"\u011D",Gbreve:"\u011E",gbreve:"\u011F",Gdot:"\u0120",gdot:"\u0121",Gcedil:"\u0122",Hcirc:"\u0124",hcirc:"\u0125",HstLine truncated
|
|
|
|
|
`);let e=new ls("!xml"),r=e,s="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let n=this.options,i=new nm(n.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=mA(t,">",c,"Closing Tag is not closed."),A=t.substring(c+2,d).trim();if(n.removeNSPrefix){let f=A.indexOf(":");f!==-1&&(A=A.substr(f+1))}A=$P(n.transformTagName,A,"",n).tagName,r&&(s=this.saveTextToParentTag(s,r,this.readonlyMatcher));let p=this.matcher.getCurrentTag();if(A&&n.unpairedTagsSet.has(A))throw new Error(`Unpaired tag can not be used as closing tag: </${A}>`);p&&n.unpairedTagsSet.has(p)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,r=this.tagsNodeStack.pop(),s="",c=d}else if(u===63){let d=WP(t,c,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");s=this.saveTextToParentTag(s,r,this.readonlyMatcher);let A=this.buildAttributesMap(d.tagExp,this.matcher,d.tagName,!0);if(A){let p=A[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(p)||1),i.setXmlVersion(Number(p)||1)}if(!(n.ignoreDeclaration&&d.tagName==="?xml"||n.ignorePiTags)){let p=new ls(d.tagName);p.add(n.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&n.ignoreAttributes!==!0&&(p[":@"]=A),this.addChild(r,p,this.readonlyMatcher,c)}c=d.closeIndex+1}else if(u===33&&t.charCodeAt(c+2)===45&&t.charCodeAt(c+3)===45){let d=mA(t,"-->",c+4,"Comment is not closed.");if(n.commentPropName){let A=t.substring(c+4,d-2);s=this.saveTextToParentTag(s,r,this.readonlyMatcher),r.add(n.commentPropName,[{[n.textNodeName]:A}])}c=d}else if(u===33&&t.charCodeAt(c+2)===68){let d=i.readDocType(t,c);this.entityDecoder.addInputEntities(d.entities),c=d.i}else if(u===33&&t.charCodeAt(c+2)===91){let d=mA(t,"]]>",c,"CDATA is not closed.")-2,A=t.substring(c+9,d);s=this.saveTextToParentTag(s,r,this.readonlyMatcher);let p=this.parseTextData(A,r.tagname,this.readonlyMatcher,!0,!1,!0,!0);p==null&&(p=""),n.cdataPropName?r.add(n.cdataPropName,[{[n.textNodeName]:A}]):r.add(n.textNodeName,p),c=d+2}else{let d=WP(t,c,n.removeNSPrefix);if(!d){let Q=t.substring(Math.max(0,c-50),Math.min(a,c+50));throw new Error(`readTagExp returned undefined at position ${c}. Context: "${Q}"`)}let A=d.tagName,p=d.rawTagName,f=d.tagExp,m=d.attrExpPresent,g=d.closeIndex;if({tagName:A,tagExp:f}=$P(n.transformTagName,A,f,n),n.strictReservedNames&&(A===n.commentPropName||A===n.cdataPropName||A===n.textNodeName||A===n.attributesGroupName))throw new Error(`Invalid tag name: ${A}`);r&&s&&r.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,r,this.readonlyMatcher,!1));let y=r;y&&n.unpairedTagsSet.has(y.tagname)&&(r=this.tagsNodeStack.pop(),this.matcher.pop());let E=!1;f.length>0&&f.lastIndexOf("/")===f.length-1&&(E=!0,A[A.length-1]==="/"?(A=A.substr(0,A.length-1),f=A):f=f.substr(0,f.length-1),m=A!==f);let C=null,I={},B;B=vPe(p),A!==e.tagname&&this.matcher.push(A,{},B),A!==f&&m&&(C=this.buildAttributesMap(f,this.matcher,A),C&&(I=TPe(C,n))),A!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let N=c;if(this.isCurrentNodeStopNode){let Q="";if(E)c=d.closeIndex;else if(n.unpairedTagsSet.has(A))c=d.closeIndex;else{let le=this.readStopNodeData(t,p,g+1);if(!le)throw new Error(`Unexpected end of ${p}`);c=le.i,Q=le.tagContent}let D=new ls(A);C&&(D[":@"]=C),D.add(n.textNodeName,Q),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(r,D,this.readonlyMatcher,N)}else{if(E){({tagName:A,tagExp:f}=$P(n.transformTagName,A,f,n));let Q=new ls(A);C&&(Q[":@"]=C),this.addChild(r,Q,this.readonlyMatcher,N),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(n.unpairedTagsSet.has(A)){let Q=new ls(A);C&&(Q[":@"]=C),this.addChild(r,Q,this.readonlyMatcher,N),this.matcher.pop(),this.isCurrentNodeStopNode=!1,c=d.closeIndex;continue}else{let Q=new ls(A);if(this.tagsNodeStack.length>n.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(r),C&&(Q[":@"]=C),this.addChild(r,Q,this.readonlyMatcher,N),r=Q}s="",c=g}}}else s+=t[c];return e.child},"parseXml");function MPe(t,e,r,s){this.options.captureMetaData||(s=void 0);let n=this.options.jPath?r.toString():r,i=this.options.updateTag(e.tagname,n,e[":@"]);i===!1||(typeof i=="string"&&(e.tagname=i),t.addChild(e,s))}o(MPe,"addChild");function LPe(t,e,r){let s=this.options.processEntities;if(!s||!s.enabled)return t;if(s.allowedTags){let n=this.options.jPath?r.toString():r;if(!(Array.isArray(s.allowedTags)?s.allowedTags.includes(e):s.allowedTags(e,n)))return t}if(s.tagFilter){let n=this.options.jPath?r.toString():r;if(!s.tagFilter(e,n))return t}return this.entityDecoder.decode(t)}o(LPe,"replaceEntitiesValue");function FPe(t,e,r,s){return t&&(s===void 0&&(s=e.child.length===0),t=this.parseTextData(t,e.tagname,r,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}o(FPe,"saveTextToParentTag");function UPe(){return this.stopNodeExpressionsLine truncated
|
|
|
|
|
`;function WPe(t,e){if(!Array.isArray(t)||t.length===0)return"1.0";let r=t[0];if(t_(r)==="?xml"){let n=r[":@"];if(n){let i=e.attributeNamePrefix+"version";if(n[i])return n[i]}}return"1.0"}o(WPe,"detectXmlVersionFromArray");function bK(t,e,r,s,n){return!r.sanitizeName||zl(t,{xmlVersion:n})?t:r.sanitizeName(t,{isAttribute:e,matcher:s.readOnly()})}o(bK,"resolveTagName");function e_(t,e){let r="";e.format&&(r=$Pe);let s=[];if(e.stopNodes&&Array.isArray(e.stopNodes))for(let a=0;a<e.stopNodes.length;a++){let c=e.stopNodes[a];typeof c=="string"?s.push(new Ys(c)):c instanceof Ys&&s.push(c)}let n=WPe(t,e),i=new Yi;return wK(t,e,r,i,s,n)}o(e_,"toXml");function wK(t,e,r,s,n,i){let a="",c=!1;if(e.maxNestedTags&&s.getDepth()>e.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(t)){if(t!=null){let l=t.toString();return l=ZP(l,e),l}return""}for(let l=0;l<t.length;l++){let u=t[l],d=t_(u);if(d===void 0)continue;let p=d===e.textNodeName||d===e.cdataPropName||d===e.commentPropName||d[0]==="?"?d:bK(d,!1,e,s,i),f=jPe(u[":@"],e);s.push(p,f);let m=XPe(s,n);if(p===e.textNodeName){let I=u[d];m||(I=e.tagValueProcessor(p,I),I=ZP(I,e)),c&&(a+=r),a+=I,c=!1,s.pop();continue}else if(p===e.cdataPropName){c&&(a+=r);let I=u[d][0][e.textNodeName],B=XI(I);a+=`<![CDATA[${B}]]>`,c=!1,s.pop();continue}else if(p===e.commentPropName){let I=u[d][0][e.textNodeName],B=KI(I);a+=r+`<!--${B}-->`,c=!0,s.pop();continue}else if(p[0]==="?"){let I=BK(u[":@"],e,m,s,i);a+=(p==="?xml"?"":r)+`<${p}${I}?>`,c=!0,s.pop();continue}let g=r;g!==""&&(g+=e.indentBy);let y=BK(u[":@"],e,m,s,i),E=r+`<${p}${y}`,C;m?C=SK(u[d],e):C=wK(u[d],e,g,s,n,i),e.unpairedTags.indexOf(p)!==-1?e.suppressUnpairedNode?a+=E+">":a+=E+"/>":(!C||C.length===0)&&e.suppressEmptyNode?a+=E+"/>":C&&C.endsWith(">")?a+=E+`>${C}${r}</${p}>`:(a+=E+">",C&&r!==""&&(C.includes("/>")||C.includes("</"))?a+=r+e.indentBy+C+r:a+=C,a+=`</${p}>`),c=!0,s.pop()}return a}o(wK,"arrToStr");function jPe(t,e){if(!t||e.ignoreAttributes)return null;let r={},s=!1;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let i=n.startsWith(e.attributeNamePrefix)?n.substr(e.attributeNamePrefix.length):n;r[i]=Cc(t[n]),s=!0}return s?r:null}o(jPe,"extractAttributeValues");function SK(t,e){if(!Array.isArray(t))return t!=null?t.toString():"";let r="";for(let s=0;s<t.length;s++){let n=t[s],i=t_(n);if(i===e.textNodeName)r+=n[i];else if(i===e.cdataPropName)r+=n[i][0][e.textNodeName];else if(i===e.commentPropName)r+=n[i][0][e.textNodeName];else{if(i&&i[0]==="?")continue;if(i){let a=KPe(n[":@"],e),c=SK(n[i],e);!c||c.length===0?r+=`<${i}${a}/>`:r+=`<${i}${a}>${c}</${i}>`}}}return r}o(SK,"getRawContent");function KPe(t,e){let r="";if(t&&!e.ignoreAttributes)for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;let n=t[s];n===!0&&e.suppressBooleanAttributes?r+=` ${s.substr(e.attributeNamePrefix.length)}`:r+=` ${s.substr(e.attributeNamePrefix.length)}="${Cc(n)}"`}return r}o(KPe,"attr_to_str_raw");function t_(t){let e=Object.keys(t);for(let r=0;r<e.length;r++){let s=e[r];if(Object.prototype.hasOwnProperty.call(t,s)&&s!==":@")return s}}o(t_,"propName");function BK(t,e,r,s,n){let i="";if(t&&!e.ignoreAttributes)for(let a in t){if(!Object.prototype.hasOwnProperty.call(t,a))continue;let c=a.substr(e.attributeNamePrefix.length),l=r?c:bK(c,!0,e,s,n),u;r?u=t[a]:(u=e.attributeValueProcessor(a,t[a]),u=ZP(u,e)),u===!0&&e.suppressBooleanAttributes?i+=` ${l}`:i+=` ${l}="${Cc(u)}"`}return i}o(BK,"attr_to_str");function XPe(t,e){if(!e||e.length===0)return!1;for(let r=0;r<e.length;r++)if(t.matches(e[r]))return!0;return!1}o(XPe,"checkStopNode");function ZP(t,e){if(t&&t.length>0&&e.processEntities)for(let r=0;r<e.entities.length;r++){let s=e.entities[r];t=t.replace(s.regex,s.val)}return t}o(ZP,"replaceEntitiesValue");function r_(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(let r of t)if(typeof r=="string"&&e===r||r instanceof RegExp&&r.test(e))return!0}:()=>!1}o(r_,"getIgnoreAttributesFn");var ZPe={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:o(function(t,e){return e},"tagValueProcessor"),attributeValueProcessor:o(function(t,e){return e},"attributeValueProcessor"),preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0,sanitizeName:!1};function ds(t){if(this.options=Object.assign({},ZPe,t),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e=="string"&&e.startsWith("*.")?".."+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.oLine truncated
|
|
|
|
|
`,this.newLine=`
|
|
|
|
|
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}o(ds,"Builder");function e_e(t,e){let r=t["?xml"];if(r&&typeof r=="object"){if(e.attributesGroupName&&r[e.attributesGroupName]){let n=r[e.attributesGroupName][e.attributeNamePrefix+"version"];if(n)return n}let s=r[e.attributeNamePrefix+"version"];if(s)return s}return"1.0"}o(e_e,"detectXmlVersionFromObj");function s_(t,e,r,s,n){return!r.sanitizeName||zl(t,{xmlVersion:n})?t:r.sanitizeName(t,{isAttribute:e,matcher:s.readOnly()})}o(s_,"resolveTagName");ds.prototype.build=function(t){if(this.options.preserveOrder)return e_(t,this.options);{Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t});let e=new Yi,r=e_e(t,this.options);return this.j2x(t,0,e,r).val}};ds.prototype.j2x=function(t,e,r,s){let n="",i="";if(this.options.maxNestedTags&&r.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");let a=this.options.jPath?r.toString():r,c=this.checkStopNode(r);for(let l in t){if(!Object.prototype.hasOwnProperty.call(t,l))continue;let d=l===this.options.textNodeName||l===this.options.cdataPropName||l===this.options.commentPropName||this.options.attributesGroupName&&l===this.options.attributesGroupName||this.isAttribute(l)||l[0]==="?"?l:s_(l,!1,this.options,r,s);if(typeof t[l]>"u")this.isAttribute(l)&&(i+="");else if(t[l]===null)this.isAttribute(l)||d===this.options.cdataPropName||d===this.options.commentPropName?i+="":d[0]==="?"?i+=this.indentate(e)+"<"+d+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+d+"/"+this.tagEndChar;else if(t[l]instanceof Date)i+=this.buildTextValNode(t[l],d,"",e,r);else if(typeof t[l]!="object"){let A=this.isAttribute(l);if(A&&!this.ignoreAttributesFn(A,a)){let p=s_(A,!0,this.options,r,s);n+=this.buildAttrPairStr(p,""+t[l],c)}else if(!A)if(l===this.options.textNodeName){let p=this.options.tagValueProcessor(l,""+t[l]);i+=this.replaceEntitiesValue(p)}else{r.push(d);let p=this.checkStopNode(r);if(r.pop(),p){let f=""+t[l];f===""?i+=this.indentate(e)+"<"+d+this.closeTag(d)+this.tagEndChar:i+=this.indentate(e)+"<"+d+">"+f+"</"+d+this.tagEndChar}else i+=this.buildTextValNode(t[l],d,"",e,r)}}else if(Array.isArray(t[l])){let A=t[l].length,p="",f="";for(let m=0;m<A;m++){let g=t[l][m];if(!(typeof g>"u"))if(g===null)d[0]==="?"?i+=this.indentate(e)+"<"+d+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+d+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){r.push(d);let y=this.j2x(g,e+1,r,s);r.pop(),p+=y.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(f+=y.attrStr)}else p+=this.processTextOrObjNode(g,d,e,r,s);else if(this.options.oneListGroup){let y=this.options.tagValueProcessor(d,g);y=this.replaceEntitiesValue(y),p+=y}else{r.push(d);let y=this.checkStopNode(r);if(r.pop(),y){let E=""+g;E===""?p+=this.indentate(e)+"<"+d+this.closeTag(d)+this.tagEndChar:p+=this.indentate(e)+"<"+d+">"+E+"</"+d+this.tagEndChar}else p+=this.buildTextValNode(g,d,"",e,r)}}this.options.oneListGroup&&(p=this.buildObjectNode(p,d,f,e)),i+=p}else if(this.options.attributesGroupName&&l===this.options.attributesGroupName){let A=Object.keys(t[l]),p=A.length;for(let f=0;f<p;f++){let m=s_(A[f],!0,this.options,r,s);n+=this.buildAttrPairStr(m,""+t[l][A[f]],c)}}else i+=this.processTextOrObjNode(t[l],d,e,r,s)}return{attrStr:n,val:i}};ds.prototype.buildAttrPairStr=function(t,e,r){return r||(e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e)),this.options.suppressBooleanAttributes&&e==="true"?" "+t:" "+t+'="'+Cc(e)+'"'};function t_e(t,e,r,s,n){let i=this.extractAttributes(t);if(s.push(e,i),this.checkStopNode(s)){let l=this.buildRawContent(t),u=this.buildAttributesForStopNode(t);return s.pop(),this.buildObjectNode(l,e,u,r)}let c=this.j2x(t,r+1,s,n);return s.pop(),e[0]==="?"?this.buildTextValNode("",e,c.attrStr,r,s):t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1?this.buildTextValNode(t[this.options.textNodeName],e,c.attrStr,r,s):this.buildObjectNode(c.val,e,c.attrStr,r)}o(t_e,"processTextOrObjNode");ds.prototype.extractAttributes=function(t){if(!t||typeof t!="object")return null;let e={},r=!1;if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){let s=t[this.options.attributesGroupName];for(let n in s){if(!Object.prototype.hasOwnProperty.call(s,n))continue;let i=n.startsWith(this.options.attributeNamePrefix)?n.substring(this.options.attributeNamePrefix.length):n;e[i]=Cc(s[n]),r=!0}}else for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;let n=this.isAttribute(s);n&&(e[n]=Cc(t[s]),r=!0)}return r?e:null};ds.prototype.buildRawContent=function(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return String(t);if(t[this.options.textNodeName]!==void 0)return t[this.options.textNodeName];let e="";for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||this.isAttribute(r)||this.options.attributesGroupName&&r===this.o
Line truncated
|
|
|
|
|
`)+`
|
|
|
|
|
`+this.getCanonicalizedHeadersString(e)+this.getCanonicalizedResourceString(e),s=this.factory.computeHMACSHA256(r);return e.headers.set(oe.AUTHORIZATION,`SharedKey ${this.factory.accountName}:${s}`),e}getHeaderValueToSign(e,r){let s=e.headers.get(r);return!s||r===oe.CONTENT_LENGTH&&s==="0"?"":s}getCanonicalizedHeadersString(e){let r=e.headers.headersArray().filter(n=>n.name.toLowerCase().startsWith(oe.PREFIX_FOR_STORAGE));r.sort((n,i)=>lB(n.name.toLowerCase(),i.name.toLowerCase())),r=r.filter((n,i,a)=>!(i>0&&n.name.toLowerCase()===a[i-1].name.toLowerCase()));let s="";return r.forEach(n=>{s+=`${n.name.toLowerCase().trimRight()}:${n.value.trimLeft()}
|
|
|
|
|
`}),s}getCanonicalizedResourceString(e){let r=oB(e.url)||"/",s="";s+=`/${this.factory.accountName}${r}`;let n=aB(e.url),i={};if(n){let a=[];for(let c in n)if(Object.prototype.hasOwnProperty.call(n,c)){let l=c.toLowerCase();i[l]=n[c],a.push(l)}a.sort();for(let c of a)s+=`
|
|
|
|
|
${c}:${decodeURIComponent(i[c])}`}return s}};var Ct=class extends $l{static{o(this,"StorageSharedKeyCredential")}accountName;accountKey;constructor(e,r){super(),this.accountName=e,this.accountKey=Buffer.from(r,"base64")}create(e,r){return new lm(e,r,this)}computeHMACSHA256(e){return(0,_K.createHmac)("sha256",this.accountKey).update(e,"utf8").digest("base64")}};var Wt=Hi("storage-common");var Bn;(function(t){t[t.EXPONENTIAL=0]="EXPONENTIAL",t[t.FIXED=1]="FIXED"})(Bn||(Bn={}));var Bc={maxRetryDelayInMs:120*1e3,maxTries:4,retryDelayInMs:4*1e3,retryPolicyType:Bn.EXPONENTIAL,secondaryHost:"",tryTimeoutInMs:void 0},u_e=new Vs("The operation was aborted."),um=class extends $i{static{o(this,"StorageRetryPolicy")}retryOptions;constructor(e,r,s=Bc){super(e,r),this.retryOptions={retryPolicyType:s.retryPolicyType?s.retryPolicyType:Bc.retryPolicyType,maxTries:s.maxTries&&s.maxTries>=1?Math.floor(s.maxTries):Bc.maxTries,tryTimeoutInMs:s.tryTimeoutInMs&&s.tryTimeoutInMs>=0?s.tryTimeoutInMs:Bc.tryTimeoutInMs,retryDelayInMs:s.retryDelayInMs&&s.retryDelayInMs>=0?Math.min(s.retryDelayInMs,s.maxRetryDelayInMs?s.maxRetryDelayInMs:Bc.maxRetryDelayInMs):Bc.retryDelayInMs,maxRetryDelayInMs:s.maxRetryDelayInMs&&s.maxRetryDelayInMs>=0?s.maxRetryDelayInMs:Bc.maxRetryDelayInMs,secondaryHost:s.secondaryHost?s.secondaryHost:Bc.secondaryHost}}async sendRequest(e){return this.attemptSendRequest(e,!1,1)}async attemptSendRequest(e,r,s){let n=e.clone(),i=r||!this.retryOptions.secondaryHost||!(e.method==="GET"||e.method==="HEAD"||e.method==="OPTIONS")||s%2===1;i||(n.url=iB(n.url,this.retryOptions.secondaryHost)),this.retryOptions.tryTimeoutInMs&&(n.url=Ic(n.url,da.Parameters.TIMEOUT,Math.floor(this.retryOptions.tryTimeoutInMs/1e3).toString()));let a;try{if(Wt.info(`RetryPolicy: =====> Try=${s} ${i?"Primary":"Secondary"}`),a=await this._nextPolicy.sendRequest(n),!this.shouldRetry(i,s,a))return a;r=r||!i&&a.status===404}catch(c){if(Wt.error(`RetryPolicy: Caught error, message: ${c.message}, code: ${c.code}`),!this.shouldRetry(i,s,a,c))throw c}return await this.delay(i,s,e.abortSignal),this.attemptSendRequest(e,r,++s)}shouldRetry(e,r,s,n){if(r>=this.retryOptions.maxTries)return Wt.info(`RetryPolicy: Attempt(s) ${r} >= maxTries ${this.retryOptions.maxTries}, no further try.`),!1;let i=["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNREFUSED","ECONNRESET","ENOENT","ENOTFOUND","TIMEOUT","EPIPE","REQUEST_SEND_ERROR"];if(n){for(let a of i)if(n.name.toUpperCase().includes(a)||n.message.toUpperCase().includes(a)||n.code&&n.code.toString().toUpperCase()===a)return Wt.info(`RetryPolicy: Network error ${a} found, will retry.`),!0}if(s||n){let a=s?s.status:n?n.statusCode:0;if(!e&&a===404)return Wt.info("RetryPolicy: Secondary access with 404, will retry."),!0;if(a===503||a===500)return Wt.info(`RetryPolicy: Will retry for status code ${a}.`),!0}if(s&&s?.status>=400){let a=s.headers.get(oe.X_MS_CopySourceErrorCode);if(a!==void 0)switch(a){case"InternalError":case"OperationTimedOut":case"ServerBusy":return!0}}return n?.code==="PARSE_ERROR"&&n?.message.startsWith('Error "Error: Unclosed root tag')?(Wt.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."),!0):!1}async delay(e,r,s){let n=0;if(e)switch(this.retryOptions.retryPolicyType){case Bn.EXPONENTIAL:n=Math.min((Math.pow(2,r-1)-1)*this.retryOptions.retryDelayInMs,this.retryOptions.maxRetryDelayInMs);break;case Bn.FIXED:n=this.retryOptions.retryDelayInMs;break}else n=Math.random()*1e3;return Wt.info(`RetryPolicy: Delay for ${n}ms`),cB(n,s,u_e)}};var dm=class{static{o(this,"StorageRetryPolicyFactory")}retryOptions;constructor(e){this.retryOptions=e}create(e,r){return new um(e,r,this.retryOptions)}};var d_e="storageBrowserPolicy";function kK(){return{name:d_e,async sendRequest(t,e){return ke||((t.method==="GET"||t.method==="HEAD")&&(t.url=Ic(t.url,da.Parameters.FORCE_BROWSER_NO_CACHE,new Date().getTime().toString())),t.headers.delete(oe.COOKIE),t.headers.delete(oe.CONTENT_LENGTH)),e(t)}}}o(kK,"storageBrowserPolicy");var A_e="StorageCorrectContentLengthPolicy";function DK(){function t(e){e.body&&(typeof e.body=="string"||Buffer.isBuffer(e.body))&&e.body.length>0&&e.headers.set(oe.CONTENT_LENGTH,Buffer.byteLength(e.body))}return o(t,"correctContentLength"),{name:A_e,async sendRequest(e,r){return t(e),r(e)}}}o(DK,"storageCorrectContentLengthPolicy");var p_e="storageRetryPolicy",EA={maxRetryDelayInMs:120*1e3,maxTries:4,retryDelayInMs:4*1e3,retryPolicyType:Bn.EXPONENTIAL,secondaryHost:"",tryTimeoutInMs:void 0},f_e=["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNREFUSED","ECONNRESET","ENOENT","ENOTFOUND","TIMEOUT","EPIPE","REQUEST_SEND_ERROR"],h_e=new Vs("The operation was aborted.");function OK(t={}){let e=t.retryPolicyType??EA.retryPolicyType,r=t.maxTries??EA.maxTries,s=t.retryDelayInMs??EA.retryDelayInMs,n=t.maxRetryDelayInMs??EA.maxRetryDelayInMs,i=t.secondaryHost??EA.secondaryHost,a=t.tryTimeoutInMs??EA.tryTimeoutInMs;function c({isPrimaryRetry:u,attempt:d,response:A,error:p}){if(d>=r)return Wt.inf
Line truncated
|
|
|
|
|
`)+`
|
|
|
|
|
`+s(i)+n(i),c=(0,MK.createHmac)("sha256",t.accountKey).update(a,"utf8").digest("base64");i.headers.set(oe.AUTHORIZATION,`SharedKey ${t.accountName}:${c}`)}o(e,"signRequest");function r(i,a){let c=i.headers.get(a);return!c||a===oe.CONTENT_LENGTH&&c==="0"?"":c}o(r,"getHeaderValueToSign");function s(i){let a=[];for(let[l,u]of i.headers)l.toLowerCase().startsWith(oe.PREFIX_FOR_STORAGE)&&a.push({name:l,value:u});a.sort((l,u)=>lB(l.name.toLowerCase(),u.name.toLowerCase())),a=a.filter((l,u,d)=>!(u>0&&l.name.toLowerCase()===d[u-1].name.toLowerCase()));let c="";return a.forEach(l=>{c+=`${l.name.toLowerCase().trimRight()}:${l.value.trimLeft()}
|
|
|
|
|
`}),c}o(s,"getCanonicalizedHeadersString");function n(i){let a=oB(i.url)||"/",c="";c+=`/${t.accountName}${a}`;let l=aB(i.url),u={};if(l){let d=[];for(let A in l)if(Object.prototype.hasOwnProperty.call(l,A)){let p=A.toLowerCase();u[p]=l[A],d.push(p)}d.sort();for(let A of d)c+=`
|
|
|
|
|
${A}:${decodeURIComponent(u[A])}`}return c}return o(n,"getCanonicalizedResourceString"),{name:m_e,async sendRequest(i,a){return e(i),a(i)}}}o(c_,"storageSharedKeyCredentialPolicy");var g_e="storageRequestFailureDetailsParserPolicy";function LK(){return{name:g_e,async sendRequest(t,e){try{return await e(t)}catch(r){throw typeof r=="object"&&r!==null&&r.response&&r.response.parsedBody&&r.response.parsedBody.code==="InvalidHeaderValue"&&r.response.parsedBody.HeaderName==="x-ms-version"&&(r.message=`The provided service version is not enabled on this storage account. Please see https://learn.microsoft.com/rest/api/storageservices/versioning-for-the-azure-storage-services for additional information.
|
|
|
|
|
`),r}}}}o(LK,"storageRequestFailureDetailsParserPolicy");var FK=require("node:crypto");var uB=class{static{o(this,"UserDelegationKeyCredential")}accountName;userDelegationKey;key;constructor(e,r){this.accountName=e,this.userDelegationKey=r,this.key=Buffer.from(r.value,"base64")}computeHMACSHA256(e){return(0,FK.createHmac)("sha256",this.key).update(e,"utf8").digest("base64")}};var dB="12.31.0",AB="2026-02-06";var pB="https://storage.azure.com/.default",Aa={Parameters:{FORCE_BROWSER_NO_CACHE:"_",SIGNATURE:"sig",SNAPSHOT:"snapshot",VERSIONID:"versionid",TIMEOUT:"timeout"}};var ii="",l_="*",E_e=1*1024*1024;var y_e=4*E_e;var UK="AES256",qK="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;",GK=["Access-Control-Allow-Origin","Cache-Control","Content-Length","Content-Type","Date","Request-Id","traceparent","Transfer-Encoding","User-Agent","x-ms-client-request-id","x-ms-date","x-ms-error-code","x-ms-request-id","x-ms-return-client-request-id","x-ms-version","Accept-Ranges","Content-Disposition","Content-Encoding","Content-Language","Content-MD5","Content-Range","ETag","Last-Modified","Server","Vary","x-ms-content-crc64","x-ms-copy-action","x-ms-copy-completion-time","x-ms-copy-id","x-ms-copy-progress","x-ms-copy-status","x-ms-has-immutability-policy","x-ms-has-legal-hold","x-ms-lease-state","x-ms-lease-status","x-ms-range","x-ms-request-server-encrypted","x-ms-server-encrypted","x-ms-snapshot","x-ms-source-range","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","x-ms-access-tier","x-ms-access-tier-change-time","x-ms-access-tier-inferred","x-ms-account-kind","x-ms-archive-status","x-ms-blob-append-offset","x-ms-blob-cache-control","x-ms-blob-committed-block-count","x-ms-blob-condition-appendpos","x-ms-blob-condition-maxsize","x-ms-blob-content-disposition","x-ms-blob-content-encoding","x-ms-blob-content-language","x-ms-blob-content-length","x-ms-blob-content-md5","x-ms-blob-content-type","x-ms-blob-public-access","x-ms-blob-sequence-number","x-ms-blob-type","x-ms-copy-destination-snapshot","x-ms-creation-time","x-ms-default-encryption-scope","x-ms-delete-snapshots","x-ms-delete-type-permanent","x-ms-deny-encryption-scope-override","x-ms-encryption-algorithm","x-ms-if-sequence-number-eq","x-ms-if-sequence-number-le","x-ms-if-sequence-number-lt","x-ms-incremental-copy","x-ms-lease-action","x-ms-lease-break-period","x-ms-lease-duration","x-ms-lease-id","x-ms-lease-time","x-ms-page-write","x-ms-proposed-lease-id","x-ms-range-get-content-md5","x-ms-rehydrate-priority","x-ms-sequence-number-action","x-ms-sku-name","x-ms-source-content-md5","x-ms-source-if-match","x-ms-source-if-modified-since","x-ms-source-if-none-match","x-ms-source-if-unmodified-since","x-ms-tag-count","x-ms-encryption-key-sha256","x-ms-copy-source-error-code","x-ms-copy-source-status-code","x-ms-if-tags","x-ms-source-if-tags"],HK=["comp","maxresults","rscc","rscd","rsce","rscl","rsct","se","si","sip","sp","spr","sr","srt","ss","st","sv","include","marker","prefix","copyid","restype","blockid","blocklisttype","delimiter","prevsnapshot","ske","skoid","sks","skt","sktid","skv","snapshot"],VK="BlobUsesCustomerSpecifiedEncryption",zK="BlobDoesNotUseCustomerSpecifiedEncryption",JK=["10000","10001","10002","10003","10004","10100","10101","10102","10103","10104","11000","11001","11002","11003","11004","11100","11101","11102","11103","11104"];function pa(t){if(!t||typeof t!="object")return!1;let e=t;return Array.isArray(e.factories)&&typeof e.options=="object"&&typeof e.toServiceClientOptions=="function"}o(pa,"isPipelineLike");var Am=class{static{o(this,"Pipeline")}factories;options;constructor(e,r={}){this.factories=e,this.options=r}toServiceClientOptions(){return{httpClient:this.options.httpClient,requestPolicyFactories:this.factories}}};function _t(t,e={}){t||(t=new lt);let r=new Am([],e);return r._credential=t,r}o(_t,"newPipeline");function C_e(t){let e=[I_e,YK,B_e,b_e,w_e,S_e,x_e];if(t.factories.length){let r=t.factories.filter(s=>!e.some(n=>n(s)));if(r.length){let s=r.some(n=>N_e(n));return{wrappedPolicies:LP(r),afterRetry:s}}}}o(C_e,"processDownlevelPipeline");function u_(t){let{httpClient:e,...r}=t.options,s=t._coreHttpClient;s||(s=e?FP(e):a_(),t._coreHttpClient=s);let n=t._corePipeline;if(!n){let i=`azsdk-js-azure-storage-blob/${dB}`,a=r.userAgentOptions&&r.userAgentOptions.userAgentPrefix?`${r.userAgentOptions.userAgentPrefix} ${i}`:`${i}`;n=$h({...r,loggingOptions:{additionalAllowedHeaderNames:GK,additionalAllowedQueryParameters:HK,logger:eB.info},userAgentOptions:{userAgentPrefix:a},serializationOptions:{stringifyXML:ZI,serializerOptions:{xml:{xmlCharKey:"#"}}},deserializationOptions:{parseXML:i_,serializerOptions:{xml:{xmlCharKey:"#"}}}}),n.removePolicy({phase:"Retry"}),n.removePolicy({name:fP}),n.addPolicy(DK()),n.addPolicy(OK(r.retryOptions),{phase:"Retry"}),n.addPo
Line truncated
|
|
|
|
|
`),i=e.computeHMACSHA256(n);return{sasQueryParameters:new ui(t.version,i,s,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:n}}o(CDe,"generateBlobSASQueryParameters20150405");function IDe(t,e){if(t=su(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",s=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",s=t.versionId));let n;t.permissions&&(t.blobName?n=Ao.parse(t.permissions.toString()).toString():n=po.parse(t.permissions.toString()).toString());let i=[n||"",t.startsOn?De(t.startsOn,!1):"",t.expiresOn?De(t.expiresOn,!1):"",ru(e.accountName,t.containerName,t.blobName),t.identifier,t.ipRange?li(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,s,t.cacheControl?t.cacheControl:"",t.contentDisposition?t.contentDisposition:"",t.contentEncoding?t.contentEncoding:"",t.contentLanguage?t.contentLanguage:"",t.contentType?t.contentType:""].join(`
|
|
|
|
|
`),a=e.computeHMACSHA256(i);return{sasQueryParameters:new ui(t.version,a,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(IDe,"generateBlobSASQueryParameters20181109");function BDe(t,e){if(t=su(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",s=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",s=t.versionId));let n;t.permissions&&(t.blobName?n=Ao.parse(t.permissions.toString()).toString():n=po.parse(t.permissions.toString()).toString());let i=[n||"",t.startsOn?De(t.startsOn,!1):"",t.expiresOn?De(t.expiresOn,!1):"",ru(e.accountName,t.containerName,t.blobName),t.identifier,t.ipRange?li(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,s,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(i);return{sasQueryParameters:new ui(t.version,a,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,void 0,void 0,void 0,t.encryptionScope),stringToSign:i}}o(BDe,"generateBlobSASQueryParameters20201206");function bDe(t,e){if(t=su(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",s=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",s=t.versionId));let n;t.permissions&&(t.blobName?n=Ao.parse(t.permissions.toString()).toString():n=po.parse(t.permissions.toString()).toString());let i=[n||"",t.startsOn?De(t.startsOn,!1):"",t.expiresOn?De(t.expiresOn,!1):"",ru(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?De(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?De(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.ipRange?li(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,s,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
|
|
|
|
|
`),a=e.computeHMACSHA256(i);return{sasQueryParameters:new ui(t.version,a,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,e.userDelegationKey),stringToSign:i}}o(bDe,"generateBlobSASQueryParametersUDK20181109");function wDe(t,e){if(t=su(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",s=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",s=t.versionId));let n;t.permissions&&(t.blobName?n=Ao.parse(t.permissions.toString()).toString():n=po.parse(t.permissions.toString()).toString());let i=[n||"",t.startsOn?De(t.startsOn,!1):"",t.expiresOn?De(t.expiresOn,!1):"",ru(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?De(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?De(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.preauthorizedAgentObjectId,void 0,t.correlationId,t.ipRange?li(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,s,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
|
|
|
|
|
`),a=e.computeHMACSHA256(i);return{sasQueryParameters:new ui(t.version,a,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,e.userDelegationKey,t.preauthorizedAgentObjectId,t.correlationId),stringToSign:i}}o(wDe,"generateBlobSASQueryParametersUDK20200210");function SDe(t,e){if(t=su(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",s=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",s=t.versionId));let n;t.permissions&&(t.blobName?n=Ao.parse(t.permissions.toString()).toString():n=po.parse(t.permissions.toString()).toString());let i=[n||"",t.startsOn?De(t.startsOn,!1):"",t.expiresOn?De(t.expiresOn,!1):"",ru(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?De(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?De(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.preauthorizedAgentObjectId,void 0,t.correlationId,t.ipRange?li(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,s,t.encryptionScope,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
|
|
|
|
|
`),a=e.computeHMACSHA256(i);return{sasQueryParameters:new ui(t.version,a,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,e.userDelegationKey,t.preauthorizedAgentObjectId,t.correlationId,t.encryptionScope),stringToSign:i}}o(SDe,"generateBlobSASQueryParametersUDK20201206");function NDe(t,e){if(t=su(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",s=t.snapshotTime;t.blobName&&(r="b",t.snapshotTime?r="bs":t.versionId&&(r="bv",s=t.versionId));let n;t.permissions&&(t.blobName?n=Ao.parse(t.permissions.toString()).toString():n=po.parse(t.permissions.toString()).toString());let i=[n||"",t.startsOn?De(t.startsOn,!1):"",t.expiresOn?De(t.expiresOn,!1):"",ru(e.accountName,t.containerName,t.blobName),e.userDelegationKey.signedObjectId,e.userDelegationKey.signedTenantId,e.userDelegationKey.signedStartsOn?De(e.userDelegationKey.signedStartsOn,!1):"",e.userDelegationKey.signedExpiresOn?De(e.userDelegationKey.signedExpiresOn,!1):"",e.userDelegationKey.signedService,e.userDelegationKey.signedVersion,t.preauthorizedAgentObjectId,void 0,t.correlationId,void 0,t.delegatedUserObjectId,t.ipRange?li(t.ipRange):"",t.protocol?t.protocol:"",t.version,r,s,t.encryptionScope,t.cacheControl,t.contentDisposition,t.contentEncoding,t.contentLanguage,t.contentType].join(`
|
|
|
|
|
`),a=e.computeHMACSHA256(i);return{sasQueryParameters:new ui(t.version,a,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,e.userDelegationKey,t.preauthorizedAgentObjectId,t.correlationId,t.encryptionScope,t.delegatedUserObjectId),stringToSign:i}}o(NDe,"generateBlobSASQueryParametersUDK20250705");function ru(t,e,r){let s=[`/blob/${t}/${e}`];return r&&s.push(`/${r}`),s.join("")}o(ru,"getCanonicalName");function su(t){let e=t.version?t.version:AB;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(su,"SASSignatureValuesSanityCheckAndAutofill");var wm=class{static{o(this,"BlobLeaseClient")}_leaseId;_url;_containerOrBlobOperation;_isContainer;get leaseId(){return this._leaseId}get url(){return this._url}constructor(e,r){let s=e.storageClientContext;this._url=e.url,e.name===void 0?(this._isContainer=!0,this._containerOrBlobOperation=s.container):(this._isContainer=!1,this._containerOrBlobOperation=s.blob),r||(r=uA()),this._leaseId=r}async acquireLease(e,r={}){if(this._isContainer&&(r.conditions?.ifMatch&&r.conditions?.ifMatch!==ii||r.conditions?.ifNoneMatch&&r.conditions?.ifNoneMatch!==ii||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 z.withSpan("BlobLeaseClient-acquireLease",r,async s=>W(await this._containerOrBlobOperation.acquireLease({abortSignal:r.abortSignal,duration:e,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},proposedLeaseId:this._leaseId,tracingOptions:s.tracingOptions})))}async changeLease(e,r={}){if(this._isContainer&&(r.conditions?.ifMatch&&r.conditions?.ifMatch!==ii||r.conditions?.ifNoneMatch&&r.conditions?.ifNoneMatch!==ii||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 z.withSpan("BlobLeaseClient-changeLease",r,async s=>{let n=W(await this._containerOrBlobOperation.changeLease(this._leaseId,e,{abortSignal:r.abortSignal,modifiedAccessConditions:{...r.conditions,ifTags:r.conditions?.tagConditions},tracingOptions:s.tracingOptions}));return this._leaseId=e,n})}async releaseLease(e={}){if(this._isContainer&&(e.conditions?.ifMatch&&e.conditions?.ifMatch!==ii||e.conditions?.ifNoneMatch&&e.conditions?.ifNoneMatch!==ii||e.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 z.withSpan("BlobLeaseClient-releaseLease",e,async r=>W(await this._containerOrBlobOperation.releaseLease(this._leaseId,{abortSignal:e.abortSignal,modifiedAccessConditions:{...e.conditions,ifTags:e.conditions?.tagConditions},tracingOptions:r.tracingOptions})))}async renewLease(e={}){if(this._isContainer&&(e.conditions?.ifMatch&&e.conditions?.ifMatch!==ii||e.conditions?.ifNoneMatch&&e.conditions?.ifNoneMatch!==ii||e.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 ar
Line truncated
|
|
|
|
|
If you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: 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"}};TA.isNetworkErrorCode=t=>t?["ECONNRESET","ENOTFOUND","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH"].includes(t):!1;var au=class extends Error{static{o(this,"UsageError")}constructor(){super(`Cache storage quota has been hit. Unable to upload any new cache entries.
|
|
|
|
|
More info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`),this.name="UsageError"}};au.isUsageErrorMessage=t=>t?t.includes("insufficient usage"):!1;var km=class extends Error{static{o(this,"RateLimitError")}constructor(e){super(e),this.name="RateLimitError"}};var bOe=function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return o(n,"adopt"),new(r||(r=Promise))(function(i,a){function c(d){try{u(s.next(d))}catch(A){a(A)}}o(c,"fulfilled");function l(d){try{u(s.throw(d))}catch(A){a(A)}}o(l,"rejected");function u(d){d.done?i(d.value):n(d.value).then(c,l)}o(u,"step"),u((s=s.apply(t,e||[])).next())})},KO=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),s=Date.now()-this.startTime,n=(e/(1024*1024)/(s/1e3)).toFixed(1);S(`Sent ${e} of ${this.contentLength} (${r}%), ${n} 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 jZ(t,e,r){return bOe(this,void 0,void 0,function*(){var s;let n=new Ca(t),i=n.getBlockBlobClient(),a=new KO((s=r?.archiveSizeBytes)!==null&&s!==void 0?s:0),c={blockSize:r?.uploadChunkSize,concurrency:r?.uploadConcurrency,maxSingleShotSize:128*1024*1024,onProgress:a.onProgress()};try{a.startDisplayTimer(),b(`BlobClient: ${n.name}:${n.accountName}:${n.containerName}`);let l=yield i.uploadFile(e,c);if(l._response.status>=400)throw new gb(`uploadCacheArchiveSDK: upload failed with status code ${l._response.status}`);return l}catch(l){throw et(`uploadCacheArchiveSDK: internal error uploading cache archive: ${l.message}`),l}finally{a.stopDisplayTimer()}})}o(jZ,"uploadCacheArchiveSDK");var XZ=w(require("buffer"),1),fo=w(require("fs"),1),ZZ=w(require("stream"),1),e7=w(require("util"),1);var Eb=function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return o(n,"adopt"),new(r||(r=Promise))(function(i,a){function c(d){try{u(s.next(d))}catch(A){a(A)}}o(c,"fulfilled");function l(d){try{u(s.throw(d))}catch(A){a(A)}}o(l,"rejected");function u(d){d.done?i(d.value):n(d.value).then(c,l)}o(u,"step"),u((s=s.apply(t,e||[])).next())})};function yb(t){return t?t>=200&&t<300:!1}o(yb,"isSuccessStatusCode");function wOe(t){return t?t>=500:!0}o(wOe,"isServerErrorStatusCode");function SOe(t){return t?[yt.BadGateway,yt.ServiceUnavailable,yt.GatewayTimeout].includes(t):!1}o(SOe,"isRetryableStatusCode");function NOe(t){return Eb(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}o(NOe,"sleep");function KZ(t,e,r){return Eb(this,arguments,void 0,function*(s,n,i,a=HC,c=VC,l=void 0){let u="",d=1;for(;d<=a;){let A,p,f=!1;try{A=yield n()}catch(m){l&&(A=l(m)),f=!0,u=m.message}if(A&&(p=i(A),!wOe(p)))return A;if(p&&(f=SOe(p),u=`Cache service responded with ${p}`),b(`${s} - Attempt ${d} of ${a} failed with error: ${u}`),!f){b(`${s} - Error is not retryable`);break}yield NOe(c),d++}throw Error(`${s} failed: ${u}`)})}o(KZ,"retry");function Dm(t,e){return Eb(this,arguments,void 0,function*(r,s,n=HC,i=VC){return yield KZ(r,s,a=>a.statusCode,n,i,a=>{if(a instanceof Fi)return{statusCode:a.statusCode,result:null,headers:{},error:a}})})}o(Dm,"retryTypedResponse");function vA(t,e){return Eb(this,arguments,void 0,function*(r,s,n=HC,i=VC){return yield KZ(r,s,a=>a.message.statusCode,n,i)})}o(vA,"retryHttpClientResponse");var xn=function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return o(n,"adopt"),new(r||(r=Promise))(function(i,a){function c(d){try{u(s.next(d))}catch(A){a(A)}}o(c,"fulfilled");function l(d){try{u(s.throw(d))}catch(A){a(A)}}o(l,"rejected");function u(d){d.done?i(d.value):n(d.value).then(c,l)}o(u,"step"),u((s=s.apply(t,e||[])).next())})};function xOe(t,e){return xn(this,void 0,void 0,function*(){yield e7.promisify(ZZ.pipeline)(t.message,e)})}o(xOe,"pipeResponseToStream");var Cb=class{static{o(this,"DownloadProgress")}constructor(e){this.contentLength=e,this.segmentIndex=0,this.segmentSize=0,this.segmentOffset=0,this.receivedBytes=0,this.displayedComplete=!1,this.startTime=Date.now()}nextSegment(e){this.segmentOffset=this.segmentOffset+this.segmentSize,this.segmentIndex=this.segmentIndex+1,this.segmentSize=e,this.receivedBytes=0,b(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`)}setReceivedBytes(e){this.received
Line truncated
|
|
|
|
|
Other caches with similar key:`);for(let c of i?.artifactCaches||[])b(`Cache Key: ${c?.cacheKey}, Cache Version: ${c?.cacheVersion}, Cache Scope: ${c?.scope}, Cache Created: ${c?.creationTime}`)}}})}o(kOe,"printCachesListForDiagnostics");function tM(t,e,r){return ps(this,void 0,void 0,function*(){let s=new u7.URL(t),n=n7(r);s.hostname.endsWith(".blob.core.windows.net")?n.useAzureSdk?yield r7(t,e,n):n.concurrentBlobDownloads?yield t7(t,e,n):yield Ib(t,e):yield Ib(t,e)})}o(tM,"downloadCache");function A7(t,e,r){return ps(this,void 0,void 0,function*(){let s=eM(),n=tA(e,r?.compressionMethod,r?.enableCrossOsArchive),i={key:t,version:n,cacheSize:r?.cacheSize};return yield Dm("reserveCache",()=>ps(this,void 0,void 0,function*(){return s.postJson(Mm("caches"),i)}))})}o(A7,"reserveCache");function l7(t,e){return`bytes ${t}-${e}/*`}o(l7,"getContentRange");function DOe(t,e,r,s,n){return ps(this,void 0,void 0,function*(){b(`Uploading chunk of size ${n-s+1} bytes at offset ${s} with content range: ${l7(s,n)}`);let i={"Content-Type":"application/octet-stream","Content-Range":l7(s,n)},a=yield vA(`uploadChunk (start: ${s}, end: ${n})`,()=>ps(this,void 0,void 0,function*(){return t.sendStream("PATCH",e,r(),i)}));if(!yb(a.message.statusCode))throw new Error(`Cache service responded with ${a.message.statusCode} during upload chunk.`)})}o(DOe,"uploadChunk");function OOe(t,e,r,s){return ps(this,void 0,void 0,function*(){let n=Li(r),i=Mm(`caches/${e.toString()}`),a=PA.openSync(r,"r"),c=XO(s),l=xv("uploadConcurrency",c.uploadConcurrency),u=xv("uploadChunkSize",c.uploadChunkSize),d=[...new Array(l).keys()];b("Awaiting all uploads");let A=0;try{yield Promise.all(d.map(()=>ps(this,void 0,void 0,function*(){for(;A<n;){let p=Math.min(n-A,u),f=A,m=A+p-1;A+=u,yield DOe(t,i,()=>PA.createReadStream(r,{fd:a,start:f,end:m,autoClose:!1}).on("error",g=>{throw new Error(`Cache upload failed because file read failed with ${g.message}`)}),f,m)}})))}finally{PA.closeSync(a)}})}o(OOe,"uploadFile");function MOe(t,e,r){return ps(this,void 0,void 0,function*(){let s={size:r};return yield Dm("commitCache",()=>ps(this,void 0,void 0,function*(){return t.postJson(Mm(`caches/${e.toString()}`),s)}))})}o(MOe,"commitCache");function rM(t,e,r,s){return ps(this,void 0,void 0,function*(){if(XO(s).useAzureSdk){if(!r)throw new Error("Azure Storage SDK can only be used when a signed URL is provided.");yield jZ(r,e,s)}else{let i=eM();b("Upload cache"),yield OOe(i,t,e,s),b("Commiting cache");let a=Li(e);S(`Cache Size: ~${Math.round(a/(1024*1024))} MB (${a} B)`);let c=yield MOe(i,t,a);if(!yb(c.statusCode))throw new Error(`Cache service responded with ${c.statusCode} during commit cache.`);S("Cache saved successfully")}})}o(rM,"saveCache");var oee=w(Z7(),1),Ot=w(Dt(),1),js=w(Dt(),1),Au=w(Dt(),1),pu=w(Dt(),1),fu=w(Dt(),1);var jM=w(Dt(),1),KM=w(Dt(),1),see=w(Dt(),1),nee=w(Dt(),1),iee=w(Dt(),1);var YM=w(Dt(),1),$M=w(Dt(),1),eee=w(Dt(),1),tee=w(Dt(),1),ree=w(Dt(),1);var WM=class extends ree.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,tee.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,eee.reflectionMergePartial)(this,r,e),r}internalBinaryRead(e,r,s,n){let i=n??this.create(),a=e.pos+r;for(;e.pos<a;){let[c,l]=e.tag();switch(c){case 1:i.scope=e.string();break;case 2:i.permission=e.int64().toString();break;default:let u=s.readUnknownField;if(u==="throw")throw new globalThis.Error(`Unknown field ${c} (wire type ${l}) for ${this.typeName}`);let d=e.skip(l);u!==!1&&(u===!0?$M.UnknownFieldHandler.onRead:u)(this.typeName,i,c,l,d)}}return i}internalBinaryWrite(e,r,s){e.scope!==""&&r.tag(1,YM.WireType.LengthDelimited).string(e.scope),e.permission!=="0"&&r.tag(2,YM.WireType.Varint).int64(e.permission);let n=s.writeUnknownFields;return n!==!1&&(n==!0?$M.UnknownFieldHandler.onWrite:n)(this.typeName,e,r),r}},cw=new WM;var XM=class extends iee.MessageType{static{o(this,"CacheMetadata$Type")}constructor(){super("github.actions.results.entities.v1.CacheMetadata",[{no:1,name:"repository_id",kind:"scalar",T:3},{no:2,name:"scope",kind:"message",repeat:1,T:o(()=>cw,"T")}])}create(e){let r={repositoryId:"0",scope:[]};return globalThis.Object.defineProperty(r,nee.MESSAGE_TYPE,{enumerable:!1,value:this}),e!==void 0&&(0,see.reflectionMergePartial)(this,r,e),r}internalBinaryRead(e,r,s,n){let i=n??this.create(),a=e.pos+r;for(;e.pos<a;){let[c,l]=e.tag();switch(c){case 1:i.repositoryId=e.int64().toString();break;case 2:i.scope.push(cw.internalBinaryRead(e,e.uint32(),s));break;default:let u=s.readUnknownField;if(u==="throw")throw new globalThis.Error(`Unknown field ${c} (wire type ${l}) for ${this.typeName}`);let d=e.skip(l);u!==!1&&(u===!0?KM.UnknownFieldHandler.onRead:u)(this.typeName,i,c,l,d)}}return i}internalBinaryWrite(e,r,s){e.repositoryId!=="0"&&r.tag(1
Line truncated
|
|
|
|
|
`));let s=yield pL(r,"create");yield fL(s,t)})}o(mL,"createTar");var WA=function(t,e,r,s){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return o(n,"adopt"),new(r||(r=Promise))(function(i,a){function c(d){try{u(s.next(d))}catch(A){a(A)}}o(c,"fulfilled");function l(d){try{u(s.throw(d))}catch(A){a(A)}}o(l,"rejected");function u(d){d.done?i(d.value):n(d.value).then(c,l)}o(u,"step"),u((s=s.apply(t,e||[])).next())})},pi=class t extends Error{static{o(this,"ValidationError")}constructor(e){super(e),this.name="ValidationError",Object.setPrototypeOf(this,t.prototype)}},hu=class t extends Error{static{o(this,"ReserveCacheError")}constructor(e){super(e),this.name="ReserveCacheError",Object.setPrototypeOf(this,t.prototype)}},gL="cache write denied:",$A=class t extends hu{static{o(this,"CacheWriteDeniedError")}constructor(e){super(e),this.name="CacheWriteDeniedError",Object.setPrototypeOf(this,t.prototype)}},Aw=class t extends Error{static{o(this,"FinalizeCacheError")}constructor(e){super(e),this.name="FinalizeCacheError",Object.setPrototypeOf(this,t.prototype)}};function uee(t){if(!t||t.length===0)throw new pi("Path Validation Error: At least one directory or file path is required")}o(uee,"checkPaths");function EL(t){if(t.length>512)throw new pi(`Key Validation Error: ${t} cannot be larger than 512 characters.`);if(!/^[^,]*$/.test(t))throw new pi(`Key Validation Error: ${t} cannot contain commas.`)}o(EL,"checkKey");function yL(){return Om()==="v2"?!!process.env.ACTIONS_RESULTS_URL:!!process.env.ACTIONS_CACHE_URL}o(yL,"isFeatureAvailable");function dee(t,e,r,s){return WA(this,arguments,void 0,function*(n,i,a,c,l=!1){let u=Om();return b(`Cache service version: ${u}`),uee(n),u==="v2"?yield XLe(n,i,a,c,l):yield KLe(n,i,a,c,l)})}o(dee,"restoreCache");function KLe(t,e,r,s){return WA(this,arguments,void 0,function*(n,i,a,c,l=!1){a=a||[];let u=[i,...a];if(b("Resolved Keys:"),b(JSON.stringify(u)),u.length>10)throw new pi("Key Validation Error: Keys are limited to a maximum of 10.");for(let p of u)EL(p);let d=yield Dh(),A="";try{let p=yield d7(u,n,{compressionMethod:d,enableCrossOsArchive:l});if(!p?.archiveLocation)return;if(c?.lookupOnly)return S("Lookup only - skipping download"),p.cacheKey;A=Zm.join(yield _h(),pc(d)),b(`Archive Path: ${A}`),yield tM(p.archiveLocation,A,c),Rl()&&(yield Xm(A,d));let f=Li(A);return S(`Cache Size: ~${Math.round(f/(1024*1024))} MB (${f} B)`),yield hL(A,d),S("Cache restored successfully"),p.cacheKey}catch(p){let f=p;if(f.name===pi.name)throw p;f instanceof Fi&&typeof f.statusCode=="number"&&f.statusCode>=500?Vd(`Failed to restore: ${p.message}`):et(`Failed to restore: ${p.message}`)}finally{try{yield kh(A)}catch(p){b(`Failed to delete archive: ${p}`)}}})}o(KLe,"restoreCacheV1");function XLe(t,e,r,s){return WA(this,arguments,void 0,function*(n,i,a,c,l=!1){c=Object.assign(Object.assign({},c),{useAzureSdk:!0}),a=a||[];let u=[i,...a];if(b("Resolved Keys:"),b(JSON.stringify(u)),u.length>10)throw new pi("Key Validation Error: Keys are limited to a maximum of 10.");for(let A of u)EL(A);let d="";try{let A=AL(),p=yield Dh(),f={key:i,restoreKeys:a,version:tA(n,p,l)},m=yield A.GetCacheEntryDownloadURL(f);if(!m.ok){b(`Cache not found for version ${f.version} of keys: ${u.join(", ")}`);return}if(f.key!==m.matchedKey?S(`Cache hit for restore-key: ${m.matchedKey}`):S(`Cache hit for: ${m.matchedKey}`),c?.lookupOnly)return S("Lookup only - skipping download"),m.matchedKey;d=Zm.join(yield _h(),pc(p)),b(`Archive path: ${d}`),b(`Starting download of archive to: ${d}`),yield tM(m.signedDownloadUrl,d,c);let y=Li(d);return S(`Cache Size: ~${Math.round(y/(1024*1024))} MB (${y} B)`),Rl()&&(yield Xm(d,p)),yield hL(d,p),S("Cache restored successfully"),m.matchedKey}catch(A){let p=A;if(p.name===pi.name)throw A;p instanceof Fi&&typeof p.statusCode=="number"&&p.statusCode>=500?Vd(`Failed to restore: ${A.message}`):et(`Failed to restore: ${A.message}`)}finally{try{d&&(yield kh(d))}catch(A){b(`Failed to delete archive: ${A}`)}}})}o(XLe,"restoreCacheV2");function CL(t,e,r){return WA(this,arguments,void 0,function*(s,n,i,a=!1){let c=Om();return b(`Cache service version: ${c}`),uee(s),EL(n),c==="v2"?yield eFe(s,n,i,a):yield ZLe(s,n,i,a)})}o(CL,"saveCache");function ZLe(t,e,r){return WA(this,arguments,void 0,function*(s,n,i,a=!1){var c,l,u,d,A,p;let f=yield Dh(),m=-1,g=yield Nv(s);if(b("Cache Paths:"),b(`${JSON.stringify(g)}`),g.length===0)throw new Error("Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.");let y=yield _h(),E=Zm.join(y,pc(f));b(`Archive Path: ${E}`);try{yield mL(y,g,f),Rl()&&(yield Xm(E,f));let C=10*1024*1024*1024,I=Li(E);if(b(`File Size: ${I}`),I>C&&!ZO())throw new Error(`Cache size of ~${Math.round(I/(1024*1024))} MB (${I} B) is over the 10GB limit, not saving cache.`);b("Reserving Cache");let B=yield A7(n,s,{compressionMethod:f,enableCrossOsArchive:a,cacheSize:I});if(!((c=B?.result)===null||c===void 0)&&c.cacheId)m=(l=B?.result)===
Line truncated
|
|
|
|
|
`,a).length:A,u?(c===null?0:c.length)+l.length:0,u?l.length+A:0);return p<f},"__needMoreData"),parse:o(function(s,n,i,a){let{bom:c,comment_no_infix:l,delimiter_auto:u,encoding:d,from_line:A,ltrim:p,max_record_size:f,raw:m,relax_quotes:g,rtrim:y,skip_empty_lines:E,to:C,to_line:I}=this.options,{comment:B,escape:N,quote:Q,record_delimiter:D}=this.options,{bomSkipped:le,delimiterDiscovered:Se,delimiterBufPrevious:Re,rawBuffer:Oe,escapeIsQuote:me}=this.state;if(!Se&&u){let Me;if(Re===void 0?Me=s:Re!==void 0&&s===void 0?Me=Re:Me=Buffer.concat([Re,s]),s=void 0,n||Me.length>u.size)this.options.delimiter=[Buffer.from(Qre(Me,this.options.delimiter_auto))],this.state.previousBuf=Me,this.state.delimiterBufPrevious=void 0,this.state.delimiterDiscovered=!0;else{this.state.delimiterBufPrevious=Me;return}}let{previousBuf:Je}=this.state,ue;if(Je===void 0)if(s===void 0){a();return}else ue=s;else Je!==void 0&&s===void 0?ue=Je:ue=Buffer.concat([Je,s]);if(le===!1)if(c===!1)this.state.bomSkipped=!0;else if(ue.length<3){if(n===!1){this.state.previousBuf=ue;return}}else{for(let Me in lp)if(lp[Me].compare(ue,0,lp[Me].length)===0){let Ci=lp[Me].length;this.state.bufBytesStart+=Ci,ue=ue.slice(Ci);let La=cp({...this.original_options,encoding:Me});for(let gt in La)this.options[gt]=La[gt];({comment:B,escape:N,quote:Q}=this.options);break}this.state.bomSkipped=!0}let vr=ue.length,J;for(J=0;J<vr&&!this.__needMoreData(J,vr,n);J++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),I!==-1&&this.info.lines>I){this.state.stop=!0,a();return}this.state.quoting===!1&&D.length===0&&this.__autoDiscoverRecordDelimiter(ue,J)&&(D=this.options.record_delimiter);let Me=ue[J];if(m===!0&&Oe.append(Me),(Me===h2e||Me===m2e)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(N!==null&&this.state.quoting===!0&&this.__isEscape(ue,J,Me)&&J+N.length<vr)if(me){if(this.__isQuote(ue,J+N.length)){this.state.escaping=!0,J+=N.length-1;continue}}else{this.state.escaping=!0,J+=N.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(ue,J))if(this.state.quoting===!0){let gt=ue[J+Q.length],Ii=y&&this.__isCharTrimable(ue,J+Q.length),ws=B!==null&&this.__compareBytes(B,ue,J+Q.length,gt),Zc=this.__isDelimiter(ue,J+Q.length,gt),nE=D.length===0?this.__autoDiscoverRecordDelimiter(ue,J+Q.length):this.__isRecordDelimiter(gt,ue,J+Q.length);if(N!==null&&this.__isEscape(ue,J,Me)&&this.__isQuote(ue,J+N.length))J+=N.length-1;else if(!gt||Zc||nE||ws||Ii){this.state.quoting=!1,this.state.wasQuoting=!0,J+=Q.length-1;continue}else if(g===!1){let j2=this.__error(new Be("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(gt)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(j2!==void 0)return j2}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(Q),J+=Q.length-1}else if(this.state.field.length!==0){if(g===!1){let gt=this.__infoField(),Ii=Object.keys(lp).map(Zc=>lp[Zc].equals(this.state.field.toString())?Zc:!1).filter(Boolean)[0],ws=this.__error(new Be("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(gt.column)} at line ${gt.lines}, value is ${JSON.stringify(this.state.field.toString(d))}`,Ii?`(${Ii} bom)`:void 0],this.options,gt,{field:this.state.field}));if(ws!==void 0)return ws}}else{this.state.quoting=!0,J+=Q.length-1;continue}if(this.state.quoting===!1){let gt=this.__isRecordDelimiter(Me,ue,J);if(gt!==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)>=A){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),J+=gt-1;continue}if(E===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,J+=gt-1;continue}this.info.bytes=this.state.bufBytesStart+J;let Zc=this.__onField();if(Zc!==void 0)return Zc;this.info.bytes=this.state.bufBytesStart+J+gt;let nE=this.__onRecord(i);if(nE!==void 0)return nE;if(C!==-1&&this.info.records>=C){this.state.stop=!0,a();return}}this.state.commenting=!1,J+=gt-1;continue}if(this.state.commenting)continue;if(B!==null&&(l===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(B,ue,J,Me)!==0){this.state.commenting=!0;continue}let Ii=this.__isDelimiter(ue,J,Me);if(Ii!==0){this.info.bytes=this.state.bufBytesStart+J;let ws=this.__onField();if(ws!==void 0)return ws;J+=Ii-1;continue}}}if(this.state.commenting===!1&&f!==0&&this.state.record_length+this.state.field.length>f)return this.__error(new Be("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${f}`,`at line ${this.info.lines}`],this.options,this.__infoField()));let Ci=p===!1||th
Line truncated
|
|
|
|
|
`,i),Buffer.from(`
|
|
|
|
|
`,i),Buffer.from("\r",i)];e:for(let c=0;c<a.length;c++){let l=a[c].length;for(let u=0;u<l;u++)if(a[c][u]!==s[n+u])continue e;return this.options.record_delimiter.push(a[c]),this.state.recordDelimiterMaxLength=a[c].length,a[c].length}return 0},"__autoDiscoverRecordDelimiter"),__error:o(function(s){let{encoding:n,raw:i,skip_records_with_error:a}=this.options,c=typeof s=="string"?new Error(s):s;if(a){if(this.state.recordHasError=!0,this.options.on_skip!==void 0)try{this.options.on_skip(c,i?this.state.rawBuffer.toString(n):void 0)}catch(l){return l}return}else return c},"__error"),__infoDataSet:o(function(){return{...this.info,columns:this.options.columns}},"__infoDataSet"),__infoRecord:o(function(){let{columns:s,raw:n,encoding:i}=this.options;return{...this.__infoDataSet(),bytes_records:this.info.bytes,error:this.state.error,header:s===!0,index:this.state.record.length,raw:n?this.state.rawBuffer.toString(i):void 0}},"__infoRecord"),__infoField:o(function(){let{columns:s}=this.options,n=Array.isArray(s),i=this.info.bytes_records;return{...this.__infoRecord(),bytes_records:i,column:n===!0?s.length>this.state.record.length?s[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}},"__infoField")}},"transform");var tn=o(function(t,e={}){typeof t=="string"&&(t=Buffer.from(t));let r=e&&e.objname?Object.create(null):[],s=e0(e),n=o(c=>{s.options.objname===void 0?r.push(c):r[c[0]]=c[1]},"push"),i=o(()=>{},"close"),a=s.parse(t,!0,n,i);if(a!==void 0)throw a;return r},"parse");var nt=class t{static{o(this,"Util")}static getInputList(e,r){return this.getList(ac(e,{trimWhitespace:r?.trimWhitespace!==!1}),r)}static getList(e,r){let s=[];if(e=="")return s;let n=tn(e,{columns:!1,relaxQuotes:!0,comment:r?.comment,comment_no_infix:r?.commentNoInfix,relaxColumnCount:!0,skipEmptyLines:!0,quote:r?.quote});for(let i of n)i.length==1?r?.ignoreComma?s.push(i[0]):s.push(...i[0].split(",")):r?.ignoreComma?s.push(i.join(",")):s.push(...i);return s.filter(i=>i).map(i=>r?.trimWhitespace===!1?i:i.trim())}static getInputNumber(e){let r=ac(e);if(r)return parseInt(r)}static async asyncForEach(e,r){for(let s=0;s<e.length;s++)await r(e[s],s,e)}static isValidURL(e){let r;try{r=new URL(e)}catch{return!1}return r.protocol==="http:"||r.protocol==="https:"}static isValidRef(e){if(t.isValidURL(e))return!0;for(let r of["git://","github.com/","git@"])if(e.startsWith(r))return!0;return!1}static async powershellCommand(e,r){let s=await fr("powershell",!0),n=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),i=[];if(r)for(let a in r)i.push(`-${a} '${r[a].replace(/'/g,"''").replace(/"|\n|\r/g,"")}'`);return{command:`"${s}"`,args:["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${n}' ${i.join(" ")}`]}}static isDirectory(e){try{return Tre.default.lstatSync(e).isDirectory()}catch{}return!1}static trimPrefix(e,r){return!e||!r||e.indexOf(r)!==0?e:e.substring(r.length)}static trimSuffix(e,r){if(!e||!r)return e;let s=e.lastIndexOf(r);return s===-1||s+r.length!==e.length?e:e.substring(0,s)}static sleep(e){return new Promise(r=>setTimeout(r,e*1e3))}static hash(e){return bF.default.createHash("sha256").update(e).digest("hex")}static parseBool(e){if(e===void 0)return!1;switch(e){case"1":case"t":case"T":case"true":case"TRUE":case"True":return!0;case"0":case"f":case"F":case"false":case"FALSE":case"False":return!1;default:throw new Error(`parseBool syntax error: ${e}`)}}static parseBoolOrDefault(e,r=!1){try{return this.parseBool(e)}catch{return r}}static formatFileSize(e){if(e===0)return"0 Bytes";let r=1024,s=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.floor(Math.log(e)/Math.log(r));return parseFloat((e/Math.pow(r,n)).toFixed(2))+" "+s[n]}static generateRandomString(e=10){return bF.default.randomBytes(Math.ceil(e/2)).toString("hex").slice(0,e)}static compileHandlebars(e,r,s){return vre.default.compile(e,r)(s)}static stringToUnicodeEntities(e){return Array.from(e).map(r=>`&#x${r.charCodeAt(0).toString(16)};`).join("")}static countLines(e){return e.split(/\r\n|\r|\n/).length}static isPathRelativeTo(e,r){let s=hg.default.resolve(e);return hg.default.resolve(r).startsWith(s.endsWith(hg.default.sep)?s:`${s}${hg.default.sep}`)}static formatDuration(e){if(e===0)return"0s";let r=Math.floor(e/1e9),s=Math.floor(r/3600),n=Math.floor(r%3600/60),i=r%60,a=[];return s&&a.push(`${s}h`),n&&a.push(`${n}m`),(i||a.length===0)&&a.push(`${i}s`),a.join("")}};var tr=class t{static{o(this,"Docker")}static get configDir(){return process.env.DOCKER_CONFIG||mg.default.join(Pre.default.homedir(),".docker")}static configFile(){let e=mg.default.join(t.configDir,"config.json");if(wF.default.existsSync(e))return JSON.parse(wF.default.readFileSync(e,{encoding:"utf-8"}))}static async isAvailable(){return await fr("docker",!0).then(e=>(b(`Docker.isAvailable ok: ${e}`),!0)).catch(e=>(b(`Docker.isAvailable error: ${e}`),!1))}static async isDaemonRunning(){try{return await t.getExecOutput(["version"],{silent:!0}),!0}ca
Line truncated
|
|
|
|
|
`+t.errors.map(e=>` - ${e.message}`).join(`
|
|
|
|
|
`)}o(tqe,"_buildMessageForResponseErrors");var rqe=class extends Error{static{o(this,"GraphqlResponseError")}constructor(t,e,r){super(tqe(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},sqe=["method","baseUrl","url","headers","request","query","mediaType","operationName"],nqe=["query","method","url"],fse=/\/api\/v3\/?$/;function iqe(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(nqe.includes(a))return Promise.reject(new Error(`[@octokit/graphql] "${a}" cannot be used as variable name`))}let s=typeof e=="string"?Object.assign({query:e},r):e,n=Object.keys(s).reduce((a,c)=>sqe.includes(c)?(a[c]=s[c],a):(a.variables||(a.variables={}),a.variables[c]=s[c],a),{}),i=s.baseUrl||t.endpoint.DEFAULTS.baseUrl;return fse.test(i)&&(n.url=i.replace(fse,"/api/graphql")),t(n).then(a=>{if(a.data.errors){let c={};for(let l of Object.keys(a.headers))c[l]=a.headers[l];throw new rqe(n,c,a.data)}return a.data.data})}o(iqe,"graphql");function DF(t,e){let r=t.defaults(e);return Object.assign(o((n,i)=>iqe(r,n,i),"newApi"),{defaults:DF.bind(null,r),endpoint:r.endpoint})}o(DF,"withDefaults");var dNt=DF(Cg,{headers:{"user-agent":`octokit-graphql.js/${eqe} ${_c()}`},method:"POST",url:"/graphql"});function hse(t){return DF(t,{method:"POST",url:"/graphql"})}o(hse,"withCustomRequest");var OF="(?:[a-zA-Z0-9_-]+)",mse="\\.",gse=new RegExp(`^${OF}${mse}${OF}${mse}${OF}$`),oqe=gse.test.bind(gse);async function aqe(t){let e=oqe(t),r=t.startsWith("v1.")||t.startsWith("ghs_"),s=t.startsWith("ghu_");return{type:"token",token:t,tokenType:e?"app":r?"installation":s?"user-to-server":"oauth"}}o(aqe,"auth");function cqe(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}o(cqe,"withAuthorizationPrefix");async function lqe(t,e,r,s){let n=e.endpoint.merge(r,s);return n.headers.authorization=cqe(t),e(n)}o(lqe,"hook");var Ese=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(aqe.bind(null,e),{hook:lqe.bind(null,e)})},"createTokenAuth2");var MF="7.0.6";var yse=o(()=>{},"noop"),uqe=console.warn.bind(console),dqe=console.error.bind(console);function Aqe(t={}){return typeof t.debug!="function"&&(t.debug=yse),typeof t.info!="function"&&(t.info=yse),typeof t.warn!="function"&&(t.warn=uqe),typeof t.error!="function"&&(t.error=dqe),t}o(Aqe,"createLogger");var Cse=`octokit-core.js/${MF} ${_c()}`,A0=class{static{o(this,"Octokit")}static VERSION=MF;static defaults(e){return class extends this{static{o(this,"OctokitWithDefaults")}constructor(...s){let n=s[0]||{};if(typeof e=="function"){super(e(n));return}super(Object.assign({},e,n,n.userAgent&&e.userAgent?{userAgent:`${n.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(n=>!r.includes(n)))}}constructor(e={}){let r=new Wre.Collection,s={baseUrl:Cg.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:r.bind(null,"request")}),mediaType:{previews:[],format:""}};if(s.headers["user-agent"]=e.userAgent?`${e.userAgent} ${Cse}`:Cse,e.baseUrl&&(s.baseUrl=e.baseUrl),e.previews&&(s.mediaType.previews=e.previews),e.timeZone&&(s.headers["time-zone"]=e.timeZone),this.request=Cg.defaults(s),this.graphql=hse(this.request).defaults(s),this.log=Aqe(e.log),this.hook=r,e.authStrategy){let{authStrategy:i,...a}=e,c=i(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 i=Ese(e.auth);r.wrap("request",i.hook),this.auth=i}let n=this.constructor;for(let i=0;i<n.plugins.length;++i)Object.assign(this,n.plugins[i](this,e))}request;graphql;log;hook;auth};var LF="17.0.0";var pqe={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"
Line truncated
|
|
|
|
|
More info: ${l.url}`);let f=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:A,message:p,file:g.path,startLine:f}),m=!0;break}m||b(`Buildx.convertWarningsToGitHubAnnotations: skipping warning without matching Dockerfile ${u}: ${A}`)}return c}};var Nu=w(require("fs"),1),h1=w(require("path"),1);var R0=class t{static{o(this,"Build")}buildx;iidFilename;metadataFilename;constructor(e){this.buildx=e?.buildx||new Ke,this.iidFilename=`build-iidfile-${nt.generateRandomString()}.txt`,this.metadataFilename=`build-metadata-${nt.generateRandomString()}.json`}async gitContext(e){let r=new Set(["ref","checksum","subdir"]),s=e?.attrs||{},n=Object.entries(s).filter(([f])=>!r.has(f)),i=nt.parseBoolOrDefault(s["fetch-by-commit"]),a=e?.ref||s.ref||Wr.ref;a.startsWith("refs/")?a.startsWith("refs/pull/")&&nt.parseBoolOrDefault(process.env.DOCKER_DEFAULT_GIT_CONTEXT_PR_HEAD_REF)&&(a=a.replace(/\/merge$/g,"/head")):a=`refs/heads/${a}`;let c=`${He.serverURL}/${Wr.repo.owner}/${Wr.repo.repo}.git`,l=e?.checksum||s.checksum,u=e?.subdir||s.subdir,d=e?.format;if(!d){if(d="fragment",n.length>0)d="query";else if(nt.parseBoolOrDefault(process.env.BUILDX_SEND_GIT_QUERY_AS_INPUT))try{await this.buildx.versionSatisfies(">=0.29.0")&&(d="query")}catch{}}let A=Wr.sha||a;a.startsWith("refs/pull/")&&a.endsWith("/head")&&(A=typeof Wr.payload.pull_request?.head?.sha=="string"?Wr.payload.pull_request.head.sha:a);let p=l||A;if(d==="query"){let f=[`ref=${i||l?a:p}`],m=i?p:l;m&&f.push(`checksum=${m}`),u&&u!=="."&&f.push(`subdir=${u}`);for(let[g,y]of n)f.push(`${g}=${y}`);return`${c}?${f.join("&")}`}return`${c}#${p}${u&&u!=="."?`:${u}`:""}`}getImageIDFilePath(){return h1.default.join(ve.tmpDir(),this.iidFilename)}resolveImageID(){let e=this.getImageIDFilePath();if(Nu.default.existsSync(e))return Nu.default.readFileSync(e,{encoding:"utf-8"}).trim()}getMetadataFilePath(){return h1.default.join(ve.tmpDir(),this.metadataFilename)}resolveMetadata(){let e=this.getMetadataFilePath();if(!Nu.default.existsSync(e))return;let r=Nu.default.readFileSync(e,{encoding:"utf-8"}).trim();if(r!=="null")return JSON.parse(r)}resolveRef(e){if(!(!e&&(e=this.resolveMetadata(),!e))&&"buildx.build.ref"in e)return e["buildx.build.ref"]}resolveProvenance(e){if(!(!e&&(e=this.resolveMetadata(),!e))&&"buildx.build.provenance"in e)return e["buildx.build.provenance"]}resolveWarnings(e){if(!(!e&&(e=this.resolveMetadata(),!e))&&"buildx.build.warnings"in e)return e["buildx.build.warnings"]}resolveDigest(e){if(!(!e&&(e=this.resolveMetadata(),!e))&&"containerimage.digest"in e)return e["containerimage.digest"]}static resolveSecretString(e){let[r,s]=t.resolveSecret(e,{redact:!0});return`id=${r},src=${s}`}static resolveSecretFile(e){let[r,s]=t.resolveSecret(e,{asFile:!0});return`id=${r},src=${s}`}static resolveSecretEnv(e){let[r,s]=t.parseSecretKvp(e);return`id=${r},env=${s}`}static resolveSecret(e,r){let[s,n]=t.parseSecretKvp(e,r?.redact);if(r?.asFile){if(!Nu.default.existsSync(n))throw new Error(`secret file ${n} not found`);return[s,n]}let i=ve.tmpName({tmpdir:ve.tmpDir()});return Nu.default.writeFileSync(i,n),[s,i]}static getProvenanceInput(e){let r=ac(e);if(!r)return r;try{return cC(e)?`builder-id=${He.workflowRunURL(!0)}`:"false"}catch{return t.resolveProvenanceAttrs(r)}}static resolveProvenanceAttrs(e){if(!e)return`builder-id=${He.workflowRunURL(!0)}`;let r=tn(e,{relaxColumnCount:!0,skipEmptyLines:!0})[0];for(let s of r)if(s.toString().split(/(?<=^[^=]+?)=/).map(i=>i.trim())[0]=="builder-id")return e;return`${e},builder-id=${He.workflowRunURL(!0)}`}static resolveCacheToAttrs(e,r){if(!e)return e;let s="registry",n="",i="",a=tn(e,{relaxColumnCount:!0,skipEmptyLines:!0})[0];for(let c of a){let l=c.toString().split(/(?<=^[^=]+?)=/).map(u=>u.trim());l[0]==="type"?s=l[1]:l[0]==="repository"?n=l[1]:l[0]==="ghtoken"&&(i=l[1])}return s==="gha"&&(n||(e=`${e},repository=${He.repository}`),!i&&r&&(e=`${e},ghtoken=${r}`)),e}static hasLocalExporter(e){return t.hasExporterType("local",e)}static hasTarExporter(e){return t.hasExporterType("tar",e)}static hasDockerExporter(e,r){return r||t.hasExporterType("docker",e)}static hasExporterType(e,r){let s=tn(r.join(`
|
|
|
|
|
`),{delimiter:",",trim:!0,columns:!1,relaxColumnCount:!0});for(let n of s){if(n.length==1&&!n[0].startsWith("type="))return e=="local";for(let[i,a]of n.map(c=>c.split("=").map(l=>l.trim())))if(i=="type"&&a==e)return!0}return!1}static hasAttestationType(e,r){let s=tn(r,{delimiter:",",trim:!0,columns:!1,relaxColumnCount:!0});for(let n of s)for(let[i,a]of n.map(c=>c.split("=").map(l=>l.trim())))if(i=="type"&&a==e)return!0;return!1}static resolveAttestationAttrs(e){let r=tn(e,{delimiter:",",trim:!0,columns:!1,relaxColumnCount:!0}),s=[];for(let n of r)for(let i of n)try{let a=nt.parseBool(i);s.push(`disabled=${!a}`)}catch{s.push(i)}return s.join(",")}static hasGitAuthTokenSecret(e,r){for(let s of e){if(r&&s.startsWith(`GIT_AUTH_TOKEN.${r}=`))return!0;if(s.startsWith("GIT_AUTH_TOKEN="))return!0}return!1}static parseSecretKvp(e,r){let s=e.indexOf("="),n=e.substring(0,s),i=e.substring(s+1);if(n.length==0||i.length==0)throw new Error(`${e} is not a valid secret`);return r&&Pi(i),[n,i]}};var m1=w(require("fs"),1),Cie=w(require("path"),1);var T0=class t{static{o(this,"Bake")}buildx;metadataFilename;constructor(e){this.buildx=e?.buildx||new Ke,this.metadataFilename=`bake-metadata-${nt.generateRandomString()}.json`}getMetadataFilePath(){return Cie.default.join(ve.tmpDir(),this.metadataFilename)}resolveMetadata(){let e=this.getMetadataFilePath();if(!m1.default.existsSync(e))return;let r=m1.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 s in e)"buildx.build.ref"in e[s]&&r.push(e[s]["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 s=["bake"],n,i=[],a=[...e.files||[],e.source];if(a){for(let l of a.map(u=>u?u.trim():""))if(l.length!=0){if(!nt.isValidRef(l)){i.push(l);continue}if(n)throw new Error("Only one remote bake definition can be defined");n=l}}n&&s.push(n);for(let l of i)s.push("--file",l);if(e.overrides)for(let l of e.overrides)s.push("--set",l);if(e.vars)for(let l of e.vars)s.push("--var",l);if(e.allow)for(let l of e.allow)s.push("--allow",l);e.call&&s.push("--call",e.call),e.load&&s.push("--load"),e.noCache&&s.push("--no-cache"),e.provenance&&s.push("--provenance",e.provenance),e.push&&s.push("--push"),e.sbom&&s.push("--sbom",e.sbom);let c=await this.buildx.getCommand([...s,"--print",...e.targets||[]]);return await re.getExecOutput(c.command,c.args,r).then(l=>{if(l.stderr.length>0&&l.exitCode!=0)throw new Error(`cannot parse bake definitions: ${l.stderr.match(/(.*)\s*$/)?.[0]?.trim()??"unknown error"}`);return t.parseDefinition(l.stdout.trim())})}static parseDefinition(e){let r=JSON.parse(e);for(let s in r.target){let n=r.target[s];n.attest&&Array.isArray(n.attest)&&(n.attest=n.attest.map(i=>t.parseAttestEntry(i))),n["cache-from"]&&Array.isArray(n["cache-from"])&&(n["cache-from"]=n["cache-from"].map(i=>t.parseCacheEntry(i))),n["cache-to"]&&Array.isArray(n["cache-to"])&&(n["cache-to"]=n["cache-to"].map(i=>t.parseCacheEntry(i))),n.output&&Array.isArray(n.output)&&(n.output=n.output.map(i=>t.parseExportEntry(i))),n.secret&&Array.isArray(n.secret)&&(n.secret=n.secret.map(i=>t.parseSecretEntry(i))),n.ssh&&Array.isArray(n.ssh)&&(n.ssh=n.ssh.map(i=>t.parseSSHEntry(i)))}return r}static parseAttestEntry(e){if(typeof e!="string")return e;let r={type:""},s=tn(e,{relaxColumnCount:!0,skipEmptyLines:!0})[0];for(let n of s){let[i,a]=n.toString().split(/(?<=^[^=]+?)=/).map(c=>c.trim());switch(i){case"type":r.type=a;break;case"disabled":r.disabled=nt.parseBool(a);break;default:r[i]=a}}return r}static parseCacheEntry(e){if(typeof e!="string")return e;let r={type:""},s=tn(e,{relaxColumnCount:!0,skipEmptyLines:!0})[0];if(s.length===1&&!s[0].includes("="))return r.type="registry",r.ref=s[0],r;for(let n of s){let[i,a]=n.toString().split(/(?<=^[^=]+?)=/).map(c=>c.trim());i==="type"?r.type=a:r[i]=a}return r}static parseExportEntry(e){if(typeof e!="string")return e;let r={type:""},s=tn(e,{relaxColumnCount:!0,skipEmptyLines:!0})[0];if(s.length===1&&s[0]===e&&!e.startsWith("type="))return e!=="-"?(r.type="local",r.dest=e,r):(r.type="tar",r.dest=e,r);for(let n of s){let[i,a]=n.toString().split(/(?<=^[^=]+?)=/).map(c=>c.trim());i==="type"?r.type=a:r[i]=a}return r}static parseSecretEntry(e){if(typeof e!="string")return e;let r={},s=tn(e,{relaxColumnCount:!0,skipEmptyLines:!0})[0],n="";for(let i of s){let[a,c]=i.toString().split(/(?<=^[^=]+?)=/).map(l=>l.trim());switch(a){case"type":n=c;break;case"id":r.id=c;break;case"source":case"src":r.src=c;break;case"env":r.env=c;break}}return n==="env"&&!r.env&&(r.env=r.src,r.src=void 0),r}static parseSSHEntry(e){if(typeof e!="string")return e;let r={},[s,n]=e.split("=",2);return r.id=s,
Line truncated
|
|
|
|
|
`)[0])}static async isHeadDetached(){return await t.exec(["branch","--show-current"]).then(e=>e.length==0)}static async getDetachedRef(){let e=await t.exec(["show","-s","--pretty=%D"]);b(`detached HEAD ref: ${e}`);let r=e.replace(/^grafted, /,"").trim();if(r==="HEAD")return await t.inferRefFromHead();let s=r.match(/^HEAD, (.*)$/);if(!s||!s[1])throw new Error(`Cannot find detached HEAD ref in "${e}"`);let n=s[1].trim();if(n.startsWith("tag: "))return await t.findDetachedTagRef(n,e);if(n.match(/^pull\/\d+\/(head|merge)$/))return`refs/${n}`;let a=n.match(/^[^/]+\/[^/]+, (.+)$/);if(a)return`refs/heads/${a[1].trim()}`;let c=n.match(/^[^/]+\/(.+)$/);if(c)return`refs/heads/${c[1].trim()}`;throw new Error(`Unsupported detached HEAD ref in "${e}"`)}static async exec(e=[]){return await re.getExecOutput("git",e,{ignoreReturnCode:!0,silent:!0}).then(r=>{if(r.stderr.length>0&&r.exitCode!=0)throw new Error(r.stderr);return r.stdout.trim()})}static async inferRefFromHead(){let e=await t.findContainingRef("refs/heads/");if(e)return e;let r=await t.findContainingRef("refs/remotes/");if(r){let i=r.match(/^refs\/remotes\/[^/]+\/(.+)$/);return i?`refs/heads/${i[1]}`:r}let s=await t.exec(["tag","--contains","HEAD"]),[n]=s.split(`
|
|
|
|
|
`).map(i=>i.trim()).filter(i=>i.length>0);if(n)return`refs/tags/${n}`;throw new Error("Cannot infer ref from detached HEAD")}static async findDetachedTagRef(e,r){let n=(await t.exec(["for-each-ref","--format=%(refname)","--points-at","HEAD","refs/tags/"])).split(`
|
|
|
|
|
`).map(i=>i.trim()).filter(i=>i.length>0).sort((i,a)=>a.length-i.length);for(let i of n){let a=`tag: ${i.slice(10)}`;if(e===a||e.startsWith(`${a}, `))return i}if(n.length===1)return n[0];throw new Error(`Cannot find detached tag ref in "${r}"`)}static async findContainingRef(e){let r=await t.exec(["for-each-ref","--format=%(refname)","--contains","HEAD","--sort=-committerdate",e]),[s]=r.split(`
|
|
|
|
|
`).map(n=>n.trim()).filter(n=>n.length>0);return s}static async commitDate(e){return new Date(await t.exec(["show","-s",'--format="%ci"',e]))}};var Oce=require("crypto"),Oo=w(require("fs"),1),Mo=w(require("path"),1);var Jp=w(w1(),1),Mce=w(FU(),1),Yp=w(Pce(),1);var H2=w(w1(),1);var kce=w(hi(),1);var _ce="application/vnd.oci.empty.v1+json";var Do=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 re.getExecOutput(this.binPath,[],{ignoreReturnCode:!0,silent:!0}).then(r=>r.stderr.length>0&&r.exitCode!=0?(b(`Cosign.isAvailable cmd err: ${r.stderr.trim()}`),!1):r.exitCode==0).catch(r=>(b(`Cosign.isAvailable error: ${r}`),!1));return b(`Cosign.isAvailable: ${e}`),e}async version(){return this._versionOnce?this._version:(this._versionOnce=!0,this._version=await re.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 re.exec(this.binPath,["version","--json"],{failOnStdErr:!1})}async versionSatisfies(e,r){let s=r??await this.version();if(!s)return b("Cosign.versionSatisfies false: undefined version"),!1;let n=kce.satisfies(s,e)||/^[0-9a-f]{7}$/.exec(s)!==null;return b(`Cosign.versionSatisfies ${s} statisfies ${e}: ${n}`),n}static parseCommandOutput(e){let r,s,n,i;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&&(i=l.errors),!r&&l&&Array.isArray(l.manifests)&&l.manifests.length>0){let u=l.manifests[0];u?.artifactType===H2.BUNDLE_V03_MEDIA_TYPE&&typeof u.digest=="string"?r=u.digest:u?.artifactType===_ce&&typeof u.digest=="string"&&(s=u.digest)}if(!n&&l&&l.mediaType===H2.BUNDLE_V03_MEDIA_TYPE&&(n=l),n&&(r||s)){i=void 0;break}}return{bundle:n,signatureManifestDigest:r||s,errors:i}}};var V2=w(require("fs"),1);var aN=class t{static{o(this,"ImageTools")}buildx;constructor(e){this.buildx=e?.buildx||new Ke}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(`No descriptor found for ${e.name}`);let s=r.manifests.filter(a=>a.annotations?.["vnd.docker.reference.type"]==="attestation-manifest");if(!e.platform)return s;let n=e.platform,i=new Map;for(let a of r.manifests)a.digest&&i.set(a.digest,a);return s.filter(a=>{let c=a.annotations?.["vnd.docker.reference.digest"];if(!c)return!1;let l=i.get(c);return l?l.platform?.os===n.os&&l.platform?.architecture===n.architecture&&(l.platform?.variant??"")===(n.variant??""):!1})}async attestationDigests(e){return(await this.attestationDescriptors(e)).map(r=>r.digest)}async create(e){let r=[],s=ve.tmpName({tmpdir:ve.tmpDir(),template:"imagetools-metadata-XXXXXX"}),n=[],i=[];for(let c of e.sources){if(c.startsWith("cwd://")){let l=c.substring(6);l.length>0&&n.push(l);continue}i.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",s);for(let c of n)r.push("--file",c);for(let c of i)r.push(c);let a=await this.getCreateCommand(r);if(e.skipExec){S(`[command]${a.command} ${a.args.join(" ")}`),S("Skipped create command");return}return await re.getExecOutput(a.command,a.args,{ignoreReturnCode:!0,silent:e.silent}).then(c=>{if(c.stderr.length>0&&c.exitCode!=0)throw new Error(c.stderr.trim());if(!e.dryRun){if(!V2.default.existsSync(s))return;let l=V2.default.readFileSync(s,{encoding:"utf-8"}).trim();if(l===""||l==="null")return;let u=JSON.parse(l),d=u["containerimage.descriptor"];return d?{digest:u["containerimage.digest"]||d.digest,descriptor:d,imageNames:u["image.name"]?u["image.name"].split(",").map(A=>A.trim()):[]}:void 0}})}async inspect(e,r,s){let n=await this.getInspectCommand([e.name,"--format",r]);if(!e.retryOnManifestUnknown)return await this.execInspect(n.command,n.args,s);let i=e.retryLimit??15,a;for(let c=0;c<i;c++)try{return await this.execInspect(n.command,n.args,s
Line truncated
|
|
|
|
|
${a.message}`),await new Promise(u=>setTimeout(u,Math.pow(2,c)*100))}throw a??new Error(`ImageTools inspect command failed for ${e.name}`)}async execInspect(e,r,s){return await re.getExecOutput(e,r,{ignoreReturnCode:!0,silent:!0}).then(n=>{if(n.stderr.length>0&&n.exitCode!=0)throw new Error(n.stderr.trim());return s(JSON.parse(n.stdout))})}static isManifestUnknownError(e){return/(MANIFEST_UNKNOWN|manifest unknown)/i.test(e)||/:\s*not found$/i.test(e)}};var Vu="https://search.sigstore.dev";var Dce="slsaprovenance1",Kc=class t{static{o(this,"Sigstore")}cosign;imageTools;constructor(e){this.cosign=e?.cosign||new Do,this.imageTools=e?.imageTools||new aN}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 s=await this.cosignSigningConfigArgs(e.noTransparencyLog);for(let n of e.imageNames){let i=await this.imageTools.attestationDigests({name:`${n}@${e.imageDigest}`,retryOnManifestUnknown:e.retryOnManifestUnknown,retryLimit:e.retryLimit});for(let a of i){let c=`${n}@${a}`;await Ms(`Signing attestation manifest ${c}`,async()=>{let l=["sign","--yes","--oidc-provider","github-actions","--registry-referrers-mode","oci-1-1","--new-bundle-format",...s];S(`[command]${this.cosign.binPath} ${[...l,c].join(" ")}`);let u=await re.getExecOutput(this.cosign.binPath,["--verbose",...l,c],{ignoreReturnCode:!0,silent:!0,env:Object.assign({},process.env,{COSIGN_EXPERIMENTAL:"1"})}),d=Do.parseCommandOutput(u.stderr.trim());if(u.exitCode!=0)if(d.errors&&d.errors.length>0){let p=d.errors.map(f=>`- [${f.code}] ${f.message} : ${f.detail}`).join(`
|
|
|
|
|
`);throw new Error(`Cosign sign command failed with errors:
|
|
|
|
|
${p}`)}else throw new Error(`Cosign sign command failed with: ${u.stderr.trim().split(/\r?\n/).filter(p=>p.length>0).pop()??"unknown error"}`);let A=t.parseBundle((0,Jp.bundleFromJSON)(d.bundle));A.tlogID&&S(`Uploaded to Rekor transparency log: ${Vu}?logIndex=${A.tlogID}`),S(`Signature manifest pushed: https://oci.dag.dev/?referrers=${c}`),r[c]={...A,imageName:n}})}}}catch(s){throw new Error(`Signing BuildKit attestation manifests failed: ${s.message}`)}return r}async verifySignedManifests(e,r){let s={};for(let[n,i]of Object.entries(e))await Ms(`Verifying signature of ${n}`,async()=>{let a=await this.verifyImageAttestation(n,{certificateIdentityRegexp:r.certificateIdentityRegexp,noTransparencyLog:r.noTransparencyLog||!i.tlogID,retryOnManifestUnknown:r.retryOnManifestUnknown,retryLimit:r.retryLimit});S(`Signature manifest verified: https://oci.dag.dev/?image=${i.imageName}@${a.signatureManifestDigest}`),s[n]=a});return s}async verifyImageAttestations(e,r){let s={},n=await this.imageTools.attestationDigests({name:e,platform:r.platform,retryOnManifestUnknown:r.retryOnManifestUnknown,retryLimit:r.retryLimit});if(n.length===0)throw new Error(`No attestation manifests found for ${e}`);let i=e.split(":",1)[0];for(let a of n){let c=`${i}@${a}`,l=await this.verifyImageAttestation(c,r);S(`Signature manifest verified: https://oci.dag.dev/?image=${i}@${l.signatureManifestDigest}`),s[c]=l}return s}async verifyImageAttestation(e,r){if(!await this.cosign.isAvailable())throw new Error("Cosign is required to verify signed manifests");let s=["verify","--experimental-oci11","--new-bundle-format","--certificate-oidc-issuer","https://token.actions.githubusercontent.com","--certificate-identity-regexp",r.certificateIdentityRegexp];if(r.noTransparencyLog&&s.push("--use-signed-timestamps","--insecure-ignore-tlog"),!r.retryOnManifestUnknown){S(`[command]${this.cosign.binPath} ${[...s,e].join(" ")}`);let a=await re.getExecOutput(this.cosign.binPath,["--verbose",...s,e],{ignoreReturnCode:!0,silent:!0,env:Object.assign({},process.env,{COSIGN_EXPERIMENTAL:"1"})});if(a.exitCode!==0)throw new Error(`Cosign verify command failed with: ${a.stderr.trim().split(/\r?\n/).filter(l=>l.length>0).pop()??"unknown error"}`);let c=Do.parseCommandOutput(a.stderr.trim());return{cosignArgs:s,signatureManifestDigest:c.signatureManifestDigest}}let n=r.retryLimit??15,i;S(`[command]${this.cosign.binPath} ${[...s,e].join(" ")}`);for(let a=0;a<n;a++){let c=await re.getExecOutput(this.cosign.binPath,["--verbose",...s,e],{ignoreReturnCode:!0,silent:!0,env:Object.assign({},process.env,{COSIGN_EXPERIMENTAL:"1"})}),l=Do.parseCommandOutput(c.stderr.trim());if(c.exitCode===0)return{cosignArgs:s,signatureManifestDigest:l.signatureManifestDigest};if(l.errors&&l.errors.length>0){let u=l.errors.map(d=>`- [${d.code}] ${d.message} : ${d.detail}`).join(`
|
|
|
|
|
`);if(i=new Error(`Cosign verify command failed with errors:
|
|
|
|
|
${u}`),l.errors.some(d=>d.code==="MANIFEST_UNKNOWN"))S(`Cosign verify command failed with MANIFEST_UNKNOWN, retrying attempt ${a+1}/${n}...
|
|
|
|
|
${u}`),await new Promise(d=>setTimeout(d,Math.pow(2,a)*100));else throw i}else throw new Error(`Cosign verify command failed with: ${c.stderr.trim().split(/\r?\n/).filter(u=>u.length>0).pop()??"unknown error"}`)}throw i}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 s=await this.cosignSigningConfigArgs(e.noTransparencyLog),n=t.getProvenanceBlobs(e);for(let i of Object.keys(n))await Ms(`Signing ${i}`,async()=>{let a=n[i],c=Mo.default.join(Mo.default.dirname(i),`${e.name??"provenance"}.sigstore.json`),l=t.getProvenanceSubjects(a);if(l.length===0){et(`No subjects found in provenance ${i}, skip signing.`);return}let u=Mo.default.join(Mo.default.dirname(i),l[0].name),d=["attest-blob","--yes","--oidc-provider","github-actions","--new-bundle-format","--statement",i,"--type",Dce,"--bundle",c,...s];S(`[command]${this.cosign.binPath} ${[...d,u].join(" ")}`);let A=await re.getExecOutput(this.cosign.binPath,["--verbose",...d,u],{ignoreReturnCode:!0,silent:!0,env:Object.assign({},process.env,{COSIGN_EXPERIMENTAL:"1"})}),p=Do.parseCommandOutput(A.stderr.trim());if(A.exitCode!=0)if(p.errors&&p.errors.length>0){let m=p.errors.map(g=>`- [${g.code}] ${g.message} : ${g.detail}`).join(`
|
|
|
|
|
`);throw new Error(`Cosign attest-blob command failed with errors:
|
|
|
|
|
${m}`)}else throw new Error(`Cosign attest-blob command failed with: ${A.stderr.trim().split(/\r?\n/).filter(m=>m.length>0).pop()??"unknown error"}`);let f=t.parseBundle((0,Jp.bundleFromJSON)(JSON.parse(Oo.default.readFileSync(c,{encoding:"utf-8"}))));S("Provenance blob signed for:");for(let m of l){let[g,y]=Object.entries(m.digest)[0]||[];S(` - ${m.name} (${g}:${y})`)}f.tlogID&&S(`Attestation signature uploaded to Rekor transparency log: ${Vu}?logIndex=${f.tlogID}`),S(`Sigstore bundle written to: ${c}`),r[i]={...f,bundlePath:c,subjects:l}})}catch(s){throw new Error(`Signing BuildKit provenance blobs failed: ${s.message}`)}return r}async verifySignedArtifacts(e,r){let s={};if(!await this.cosign.isAvailable())throw new Error("Cosign is required to verify signed artifacts");for(let[n,i]of Object.entries(e)){let a=Mo.default.dirname(n);await Ms(`Verifying signature bundle ${i.bundlePath}`,async()=>{for(let c of i.subjects){let l=Mo.default.join(a,c.name);S(`Verifying signed artifact ${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??Dce];(r.noTransparencyLog||!i.tlogID)&&u.push("--use-signed-timestamps","--insecure-ignore-tlog");let d=await re.getExecOutput(this.cosign.binPath,[...u,"--bundle",i.bundlePath,l],{ignoreReturnCode:!0});if(d.stderr.length>0&&d.exitCode!=0)throw new Error(d.stderr);s[l]={bundlePath:i.bundlePath,cosignArgs:u}}})}return s}async verifyArtifact(e,r,s){S("Verifying keyless verification bundle signature");let n=JSON.parse(Oo.default.readFileSync(r,"utf-8")),i=(0,Jp.bundleFromJSON)(n);S("Fetching Sigstore TUF trusted root metadata");let a=await Mce.getTrustedRoot(),c=(0,Yp.toTrustMaterial)(a);try{S("Verifying artifact signature");let l=(0,Yp.toSignedEntity)(i,Oo.default.readFileSync(e)),u=t.parseCertificate(i),d=i.verificationMaterial.tlogEntries,A=d.length>0?d[0].logIndex:void 0;if(s?.subjectAlternativeName&&s?.subjectAlternativeName instanceof RegExp){let m=u.subjectAltName?.replace(/^uri:/i,"");if(m){if(!m.match(s.subjectAlternativeName))throw new Error(`Signing certificate subjectAlternativeName "${m}" does not match expected pattern`)}else throw new Error("Signing certificate does not contain subjectAltName")}let f=new Yp.Verifier(c).verify(l,{subjectAlternativeName:s?.subjectAlternativeName&&typeof s.subjectAlternativeName=="string"?s.subjectAlternativeName:void 0,extensions:s?.issuer?{issuer:s.issuer}:void 0});return b(`Sigstore.verifyArtifact signer: ${JSON.stringify(f)}`),{payload:n,certificate:u.toString(),tlogID:A}}catch(l){throw new Error(`Failed to verify artifact signature: ${l}`)}}static noTransparencyLog(e){return e??He.context.payload.repository?.private??!1}async cosignSigningConfigArgs(e){let r=[],s=t.noTransparencyLog(e);return S(`Upload to transparency log: ${s?"disabled":"enabled"}`),await this.cosign.versionSatisfies(">=3.0.4")?await Ms("Creating Sigstore protobuf signing config",async()=>{let n=ve.tmpName({template:"signing-config-XXXXXX.json",tmpdir:ve.tmpDir()}),i=["signing-config","create","--with-default-services=true",`--out=${n}`];s&&i.push("--no-default-rekor=true"),await re.exec(this.cosign.binPath,i,{env:Object.assign({},process.env,{COSIGN_EXPERIMENTAL:"1"})}),S(JSON.stringify(JSON.parse(Oo.default.readFileSync(n,{encoding:"utf-8"})),null,2)),r.push(`--signing-config=${n}`)}):(r.push("--use-signing-config"),s&&r.push("--tlog-upload=false")),r}static getProvenanceBlobs(e){let r=Mo.default.join(e.localExportDir,"provenance.json");if(Oo.default.existsSync(r))return{[r]:Oo.default.readFileSync(r)};let s=Oo.default.readdirSync(e.localExportDir,{withFileTypes:!0}),n=s.filter(i=>i.isDirectory());if(n.length>0&&n.length===s.length&&n.every(i=>Oo.default.existsSync(Mo.default.join(e.localExportDir,i.name,"provenance.json")))){let i={};for(let a of n){let c=Mo.default.join(e.localExportDir,a.name,"provenance.json");i[c]=Oo.default.readFileSync(c)}return i}throw new Error(`No valid provenance.json found in ${e.localExportDir}`)}static getProvenanceSubjects(e){return JSON.parse(e.toString()).subject.map(s=>({name:s.name,digest:s.digest}))}static parseBundle(e){let r=t.parseCertificate(e),s=e.verificationMaterial.tlogEntries,n=s.length>0?s[0].logIndex:void 0;return{payload:(0,Jp.bundleToJSON)(e),certificate:r.toString(),tlogID:n}}static parseCertificate(e){let r;switch(e.verificationMaterial.content.$case){case"x509CertificateChain":r=e.verificationMaterial.content.x509CertificateChain.certificates[0].rawBytes;break;case"certificate":r=e.verificationMaterial.content.certificate.rawBytes;break;default:throw new Error("Bundle must contain an x509 certificate")}return new Oce.X509Certificate(r)}};var cN=class t{static{o(this,"Install")}standalone;githubToken;sigstore;constructor(e){this.standalone=e?.standalone,this.githubToken=e?.githubToken||process.env.GITHUB_TOKEN,this.sigstore=e?.sigstore||new Kc}
Line truncated
|
|
|
|
|
`)){let[u,...d]=l.split(":"),A=u.toLowerCase(),p=d.map(f=>f.trim()).join(":");if(u.length!=0)switch(!0){case A=="name":s=void 0,r.name==null?r.name=p:(i&&n.gcPolicy&&(n.gcPolicy.push(i),i=void 0),n.name&&r.nodes.push(n),n={name:p});break;case A=="driver":s=void 0,r.driver=p;break;case A=="last activity":s=void 0,r.lastActivity=new Date(p);break;case A=="endpoint":s=void 0,n.endpoint=p;break;case A=="driver options":s=void 0,n["driver-opts"]=(p.match(/([a-zA-Z0-9_.]+)="([^"]*)"/g)||[]).map(f=>f.replace(/^(.*)="(.*)"$/g,"$1=$2"));break;case A=="status":s=void 0,n.status=p;break;case A=="buildkit daemon flags":case A=="flags":s=void 0,n["buildkitd-flags"]=p;break;case A=="buildkit version":case A=="buildkit":s=void 0,n.buildkit=p;break;case A=="platforms":{if(s=void 0,!p)break;let f=[];if(p.includes("*"))for(let m of p.split(", "))m.includes("*")&&f.push(m.replace(/\*/g,""));else f=p.split(", ");n.platforms=f.join(",");break}case A=="features":s="features",n.features={};break;case A=="labels":s="label",n.labels={};break;case A=="devices":s="devices",n.devices=n.devices||[];break;case A.startsWith("gc policy rule#"):s="gcpolicy",n.gcPolicy&&i&&(n.gcPolicy.push(i),i=void 0);break;case A.startsWith("file#"):s="file",c=u.split("#")[1],n.files=n.files||{},n.files[c]="";break;default:switch(s&&s!=="devices"&&n.devices&&a&&(n.devices.push(a),a=void 0),s||""){case"features":{n.features=n.features||{},n.features[u.trim()]=!!p;break}case"label":{n.labels=n.labels||{},n.labels[u.trim()]=p;break}case"devices":{switch(A.trim()){case"name":{n.devices&&a&&n.devices.push(a),a={},a.name=p;break}case"on-demand":{a&&p&&(a.onDemand=p=="true");break}case"automatically allowed":{a&&p&&(a.autoAllow=p=="true");break}case"annotations":{a&&(a.annotations=a.annotations||{});break}default:a&&a.annotations&&(a.annotations[u.trim()]=p)}break}case"gcpolicy":{switch(n.gcPolicy=n.gcPolicy||[],i=i||{},A.trim()){case"all":{i.all=p=="true";break}case"filters":{p&&(i.filter=p.split(","));break}case"keep duration":{i.keepDuration=p;break}case"keep bytes":{i.keepBytes=p;break}case"reserved space":{i.reservedSpace=p;break}case"max used space":{i.maxUsedSpace=p;break}case"min free space":{i.minFreeSpace=p;break}}break}case"file":{c&&n.files&&(n.files[c].length>0&&(n.files[c]+=`
|
|
|
|
|
`),n.files[c]+=l.replace(/^\s>\s?/,""));break}}}}return a&&n.devices&&n.devices.push(a),i&&n.gcPolicy&&n.gcPolicy.push(i),n.name&&r.nodes.push(n),r}};var Lce=w(hi(),1);var lN=w(require("fs"),1);var uN=class{static{o(this,"Config")}resolveFromString(e){return this.resolve(e,!1)}resolveFromFile(e){return this.resolve(e,!0)}resolve(e,r){if(r){if(!lN.default.existsSync(e))throw new Error(`config file ${e} not found`);e=lN.default.readFileSync(e,{encoding:"utf-8"})}let s=ve.tmpName({tmpdir:ve.tmpDir()});return lN.default.writeFileSync(s,e),s}};var dN=class{static{o(this,"BuildKit")}buildx;config;constructor(e){this.config=new uN,this.buildx=e?.buildx||new Ke}async getVersion(e){if(!e.buildkit&&e.name)try{return await this.getVersionWithinImage(e.name)}catch(r){et(r)}return e.buildkit}async getVersionWithinImage(e){return b(`BuildKit.getVersionWithinImage nodeName: ${e}`),tr.getExecOutput(["inspect","--format","{{.Config.Image}}",`${Ke.containerNamePrefix}${e}`],{ignoreReturnCode:!0,silent:!0}).then(r=>{if(r.exitCode==0&&r.stdout.length>0)return b(`BuildKit.getVersionWithinImage image: ${r.stdout.trim()}`),tr.getExecOutput(["run","--rm",r.stdout.trim(),"--version"],{ignoreReturnCode:!0,silent:!0}).then(s=>{if(s.exitCode==0&&s.stdout.length>0)return`${r.stdout.trim()} => ${s.stdout.trim()}`;if(s.stderr.length>0)throw new Error(r.stderr.trim());return s.stdout.trim()});if(r.stderr.length>0)throw new Error(r.stderr.trim());return r.stdout.trim()})}async versionSatisfies(e,r,s){s||(s=await new Wp({buildx:this.buildx}).inspect(e));for(let n of s.nodes){let i=n.buildkit;if(b(`BuildKit.versionSatisfies ${i}: ${r}`),!i)try{i=await this.getVersionWithinImage(n.name||"")}catch{return b(`BuildKit.versionSatisfies ${n.name}: can't get version`),!1}if(b(`BuildKit.versionSatisfies ${n.name}: version ${i}`),s.driver=="docker"&&!i.endsWith("-moby")||!Lce.satisfies(i.replace(/-moby$/,""),r))return!1}return!0}};var AN=class t{static{o(this,"Compose")}_version;_versionOnce;_standalone;constructor(e){this._standalone=e?.standalone,this._version="",this._versionOnce=!1}async isStandalone(){let e=this._standalone??!await tr.isAvailable();return b(`Compose.isStandalone: ${e}`),e}async getCommand(e){let r=await this.isStandalone();return{command:r?"compose":"docker",args:r?e:["compose",...e]}}async isAvailable(){let e=await this.getCommand([]),r=await re.getExecOutput(e.command,e.args,{ignoreReturnCode:!0,silent:!0}).then(s=>s.stderr.length>0&&s.exitCode!=0?(b(`Compose.isAvailable cmd err: ${s.stderr.trim()}`),!1):s.exitCode==0).catch(s=>(b(`Compose.isAvailable error: ${s}`),!1));return b(`Compose.isAvailable: ${r}`),r}async version(){if(this._versionOnce)return this._version;this._versionOnce=!0;let e=await this.getCommand(["version"]);return this._version=await re.getExecOutput(e.command,e.args,{ignoreReturnCode:!0,silent:!0}).then(r=>{if(r.stderr.length>0&&r.exitCode!=0)throw new Error(r.stderr.trim());return t.parseVersion(r.stdout.trim())}),this._version}async printVersion(){let e=await this.getCommand(["version"]);await re.exec(e.command,e.args,{failOnStdErr:!1})}static parseVersion(e){let r=/\sv?([0-9a-f]{7}|[0-9.]+)/.exec(e);if(!r)throw new Error("Cannot parse compose version");return r[1]}};var Oa=w(require("fs"),1),Fo=w(require("os"),1),jp=w(require("path"),1);var fN=w(hi(),1),J2=w(require("util"),1);var pN=class t{static{o(this,"Install")}standalone;githubToken;constructor(e){this.standalone=e?.standalone,this.githubToken=e?.githubToken||process.env.GITHUB_TOKEN}async download(e,r){let s=await t.getDownloadVersion(e);b(`Install.download version: ${s.version}`);let n=await t.getRelease(s,this.githubToken);b(`Install.download release tag name: ${n.tag_name}`);let i=await this.vspec(n.tag_name);b(`Install.download vspec: ${i}`);let a=fN.clean(i)||"";if(!fN.valid(a))throw new Error(`Invalid Compose version "${i}".`);let c=new dr({htcName:s.key!="official"?`compose-dl-bin-${s.key}`:"compose-dl-bin",htcVersion:i,baseCacheDir:jp.default.join(Fo.default.homedir(),".bin","docker-compose"),cacheFile:Fo.default.platform()=="win32"?"docker-compose.exe":"docker-compose",ghaNoCache:r}),l=await c.find();if(l)return S(`Compose binary found in ${l}`),l;let u=J2.format(s.downloadURL,i,this.filename());S(`Downloading ${u}`);let d=await fn(u,void 0,this.githubToken);b(`Install.download htcDownloadPath: ${d}`);let A=await c.save(d);return S(`Cached to ${A}`),A}async installStandalone(e,r){S("Standalone mode"),r=r||ve.tmpDir();let s=jp.default.join(r,"compose-bin-standalone");Oa.default.existsSync(s)||Oa.default.mkdirSync(s,{recursive:!0});let n=Fo.default.platform()=="win32"?"compose.exe":"compose",i=jp.default.join(s,n);return Oa.default.copyFileSync(e,i),S("Fixing perms"),Oa.default.chmodSync(i,"0755"),ki(s),S("Added Compose to PATH"),S(`Binary path: ${i}`),i}async installPlugin(e,r){S("Docker plugin mode"),r=r||tr.configDir;let s=jp.default.join(r,"cli-plugins");Oa.default.existsSync(s)||Oa.default.mkdirSync(s,{recursive:!0});let n=Fo.default
Line truncated
|
|
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
|
|
|
|
|
ARG GO_VERSION="1.24"
|
|
|
|
|
ARG ALPINE_VERSION="3.22"
|
|
|
|
|
|
|
|
|
|
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.7.0 AS xx
|
|
|
|
|
|
|
|
|
|
FROM --platform=$BUILDPLATFORM golang:\${GO_VERSION}-alpine\${ALPINE_VERSION} AS builder-base
|
|
|
|
|
COPY --from=xx / /
|
|
|
|
|
RUN apk add --no-cache git
|
|
|
|
|
ENV GOTOOLCHAIN=auto
|
|
|
|
|
ENV CGO_ENABLED=0
|
|
|
|
|
WORKDIR /src
|
|
|
|
|
RUN --mount=type=cache,target=/go/pkg/mod \\
|
|
|
|
|
--mount=type=bind,source=go.mod,target=go.mod \\
|
|
|
|
|
--mount=type=bind,source=go.sum,target=go.sum \\
|
|
|
|
|
go mod download
|
|
|
|
|
|
|
|
|
|
FROM builder-base AS version
|
|
|
|
|
RUN --mount=type=bind,target=. <<'EOT'
|
|
|
|
|
git rev-parse HEAD 2>/dev/null || {
|
|
|
|
|
echo >&2 "Failed to get git revision, make sure --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 is set when building from Git directly"
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
set -ex
|
|
|
|
|
export PKG=sigs.k8s.io BUILDDATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") TREESTATE=$(if ! git diff --no-ext-diff --quiet --exit-code; then echo dirty; else echo clean; fi) VERSION=$(git describe --match 'v[0-9]*' --dirty='.m' --always --tags) COMMIT=$(git rev-parse HEAD)$(if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi);
|
|
|
|
|
echo "-X \${PKG}/release-utils/version.gitVersion=\${VERSION} -X \${PKG}/release-utils/version.gitCommit=\${COMMIT} -X \${PKG}/release-utils/version.gitTreeState=\${TREESTATE} -X \${PKG}/release-utils/version.buildDate=\${BUILDDATE}" > /tmp/.ldflags;
|
|
|
|
|
echo -n "\${VERSION}" > /tmp/.version;
|
|
|
|
|
EOT
|
|
|
|
|
|
|
|
|
|
FROM builder-base AS builder
|
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
|
RUN --mount=type=bind,target=. \\
|
|
|
|
|
--mount=type=cache,target=/root/.cache,id=cosign-$TARGETPLATFORM \\
|
|
|
|
|
--mount=source=/tmp/.ldflags,target=/tmp/.ldflags,from=version \\
|
|
|
|
|
--mount=type=cache,target=/go/pkg/mod <<EOT
|
|
|
|
|
set -ex
|
|
|
|
|
xx-go build -trimpath -ldflags "-s -w $(cat /tmp/.ldflags)" -o /out/cosign ./cmd/cosign
|
|
|
|
|
xx-verify --static /out/cosign
|
|
|
|
|
EOT
|
|
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
|
COPY --from=builder /out /
|
|
|
|
|
`;var hN=class t{static{o(this,"Install")}githubToken;buildx;sigstore;constructor(e){this.githubToken=e?.githubToken||process.env.GITHUB_TOKEN,this.buildx=e?.buildx||new Ke,this.sigstore=e?.sigstore||new Kc}async download(e){let r=await t.getDownloadVersion(e.version);b(`Install.download version: ${r.version}`);let s=await t.getRelease(r,this.githubToken);b(`Install.download release tag name: ${s.tag_name}`);let n=await this.vspec(s.tag_name);b(`Install.download vspec: ${n}`);let i=Xp.clean(n)||"";if(!Xp.valid(i))throw new Error(`Invalid Cosign version "${n}".`);let a=new dr({htcName:"cosign-dl-bin",htcVersion:n,baseCacheDir:Kp.default.join(Ei.default.homedir(),".bin"),cacheFile:Ei.default.platform()=="win32"?"cosign.exe":"cosign",ghaNoCache:e.ghaNoCache}),c=await a.find();if(c)return S(`Cosign binary found in ${c}`),c;let l=Y2.format(r.downloadURL,n,this.filename());S(`Downloading ${l}`);let u=await fn(l,void 0,this.githubToken);b(`Install.download htcDownloadPath: ${u}`),e.verifySignature&&Xp.satisfies(n,">=3.0.1")&&await this.verifySignature(u,l);let d=await a.save(u,e.skipState);return S(`Cached to ${d}`),d}async build(e,r,s){let n=await this.vspec(e);b(`Install.build vspec: ${n}`);let i=new dr({htcName:"cosign-build-bin",htcVersion:n,baseCacheDir:Kp.default.join(Ei.default.homedir(),".bin"),cacheFile:Ei.default.platform()=="win32"?"cosign.exe":"cosign",ghaNoCache:r}),a=await i.find();if(a)return S(`Cosign binary found in ${a}`),a;let c=Kp.default.join(ve.tmpDir(),"cosign-build-cache"),l=await this.buildCommand(e,c),u=await re.getExecOutput(l.command,l.args,{ignoreReturnCode:!0,input:Buffer.from(Fce)}).then(A=>{if(A.stderr.length>0&&A.exitCode!=0)throw new Error(`build failed with: ${A.stderr.match(/(.*)\s*$/)?.[0]?.trim()??"unknown error"}`);return`${c}/cosign`}),d=await i.save(u,s);return S(`Cached to ${d}`),d}async install(e,r){r=r||ve.tmpDir();let s=Kp.default.join(r,"cosign-bin");eE.default.existsSync(s)||eE.default.mkdirSync(s,{recursive:!0});let n=Ei.default.platform()=="win32"?"cosign.exe":"cosign",i=Kp.default.join(s,n);return eE.default.copyFileSync(e,i),S("Fixing perms"),eE.default.chmodSync(i,"0755"),ki(s),S("Added Cosign to PATH"),S(`Binary path: ${i}`),i}async buildCommand(e,r){let s=await new Ke({standalone:!0}).isAvailable(),n=await new Ke({standalone:!1}).isAvailable(),i=!1;if(await this.buildx.isStandalone()&&s)b("Install.buildCommand: Buildx standalone found, build with it"),i=!0;else if(!await this.buildx.isStandalone()&&n)b("Install.buildCommand: Buildx plugin found, build with it"),i=!1;else if(s)b("Install.buildCommand: Buildx plugin not found, but standalone found so trying to build with it"),i=!0;else if(n)b("Install.buildCommand: Buildx standalone not found, but plugin found so trying to build with it"),i=!1;else throw new Error(`Neither buildx standalone or plugin have been found to build from ref ${e}`);let a=["build","--platform","local","--build-arg","BUILDKIT_CONTEXT_KEEP_GIT_DIR=1","--output",`type=local,dest=${r}`];return process.env.GIT_AUTH_TOKEN&&a.push("--secret","id=GIT_AUTH_TOKEN"),a.push("-f-",e),await new Ke({standalone:i}).getCommand(a)}async verifySignature(e,r){let s=`${r}.sigstore.json`;S(`Downloading keyless verification bundle at ${s}`);let n=await fn(s,void 0,this.githubToken);b(`Install.verifySignature bundlePath: ${n}`);let i=await this.sigstore.verifyArtifact(e,n,{subjectAlternativeName:"keyless@projectsigstore.iam.gserviceaccount.com",issuer:"https://accounts.google.com"});S(`Cosign binary signature verified! ${i.tlogID?`${Vu}?logIndex=${i.tlogID}`:""}`)}filename(){let e;switch(Ei.default.arch()){case"x64":{e="amd64";break}case"ppc64":{e="ppc64le";break}default:{e=Ei.default.arch();break}}let r=Ei.default.platform()=="win32"?"windows":Ei.default.platform(),s=Ei.default.platform()=="win32"?".exe":"";return Y2.format("cosign-%s-%s%s",r,e,s)}async vspec(e){if(!nt.isValidRef(e)){let u=e.replace(/^v+|v+$/g,"");return S(`Use ${u} version spec cache key for ${e}`),u}let[r,s]=e.split("#");s.length==0&&(s="master");let n;s.match(/^[0-9a-fA-F]{40}$/)?n=s:n=await hp.remoteSha(r,s,process.env.GIT_AUTH_TOKEN);let[i,a]=r.substring(19).split("/"),c=`${i}/${nt.trimSuffix(a,".git")}/${n}`,l=nt.hash(c);return S(`Use ${l} version spec cache key for ${c}`),l}static async getDownloadVersion(e){return{version:e,downloadURL:"https://github.com/sigstore/cosign/releases/download/v%s/%s",contentOpts:{owner:"docker",repo:"actions-toolkit",ref:"main",path:".github/cosign-releases.json"}}}static async getRelease(e,r){let n=await new He({token:r}).releases("Cosign",e.contentOpts);if(!n[e.version])throw new Error(`Cannot find Cosign release ${e.version} in releases JSON`);return n[e.version]}};var Uce=w(hi(),1);var mN=class{static{o(this,"Regctl")}binPath;_version;_versionOnce;constructor(e){this.binPath=e?.binPath||"regctl",this._version="",this._versionOnce=!1}async blobGet(e){return await re.getExecOutput(this.binPath,["blob","get",e.repository,e.digest],{ignoreReturnCode:!0,sil
Line truncated
|
|
|
|
|
/*! Bundled license information:
|
|
|
|
|
|
|
|
|
|
undici/lib/web/fetch/body.js:
|
|
|
|
|
(*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
|
|
|
|
|
|
|
|
undici/lib/web/websocket/frame.js:
|
|
|
|
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
|
|
|
|
|
|
|
|
|
tmp/lib/tmp.js:
|
|
|
|
|
(*!
|
|
|
|
|
* Tmp
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
|
|
|
|
*
|
|
|
|
|
* MIT Licensed
|
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
|
@octokit/request-error/dist-src/index.js:
|
|
|
|
|
(* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist *)
|
|
|
|
|
|
|
|
|
|
@octokit/request/dist-bundle/index.js:
|
|
|
|
|
(* v8 ignore next -- @preserve *)
|
|
|
|
|
(* v8 ignore else -- @preserve *)
|
|
|
|
|
*/
|
|
|
|
|
//# sourceMappingURL=index.cjs.map
|