@coalescesoftware/coa 7.20.1 → 7.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/coa.js CHANGED
@@ -139,7 +139,7 @@ ${t}`;return Object.assign(new Error(n),r,{stack:o})}_w.callErrorFromStatus=rRa;
139
139
  `)+1))),this.lastActivityTimestamp=new Date}getChannelzInfo(){return{target:this.originalTarget,state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}}trace(t,n){(0,Cdr.trace)(n??NNe.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,Out.uriToString)(this.target)+" "+t)}callRefTimerRef(){var t,n,i,o;!((n=(t=this.callRefTimer).hasRef)===null||n===void 0)&&n.call(t)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(o=(i=this.callRefTimer).ref)===null||o===void 0||o.call(i))}callRefTimerUnref(){var t,n;(!this.callRefTimer.hasRef||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(n=(t=this.callRefTimer).unref)===null||n===void 0||n.call(t))}removeConnectivityStateWatcher(t){let n=this.connectivityStateWatchers.findIndex(i=>i===t);n>=0&&this.connectivityStateWatchers.splice(n,1)}updateState(t){(0,Cdr.trace)(NNe.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,Out.uriToString)(this.target)+" "+yD.ConnectivityState[this.connectivityState]+" -> "+yD.ConnectivityState[t]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+yD.ConnectivityState[t]),this.connectivityState=t;let n=this.connectivityStateWatchers.slice();for(let i of n)t!==i.currentState&&(i.timer&&clearTimeout(i.timer),this.removeConnectivityStateWatcher(i),i.callback());t!==yD.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(t){if(t>this.keepaliveTime){this.keepaliveTime=t;for(let n of this.wrappedSubchannels)n.throttleKeepalive(t)}}removeWrappedSubchannel(t){this.wrappedSubchannels.delete(t)}doPick(t,n){return this.currentPicker.pick({metadata:t,extraPickInfo:n})}queueCallForPick(t){this.pickQueue.push(t),this.callRefTimerRef()}getConfig(t,n){return this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector(t,n)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(t){this.configSelectionQueue.push(t),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(yD.ConnectivityState.IDLE),this.currentPicker=new eYn.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null)}startIdleTimeout(t){var n,i;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let s=new Date().valueOf()-this.lastActivityTimestamp.valueOf();s>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-s)},t),(i=(n=this.idleTimer).unref)===null||i===void 0||i.call(n)}maybeStartIdleTimer(){this.connectivityState!==yD.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(t){this.channelzEnabled&&(t.code===NNe.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(t,n,i,o,s){let a=(0,Idr.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+a+'] method="'+n+'"'),new Jxa.LoadBalancingCall(this,t,n,i,o,s,a)}createRetryingCall(t,n,i,o,s){let a=(0,Idr.getNextCallNumber)();return this.trace("createRetryingCall ["+a+'] method="'+n+'"'),new vdr.RetryingCall(this,t,n,i,o,s,a,this.retryBufferTracker,wut.get(this.getTarget()))}createInnerCall(t,n,i,o,s){return this.options["grpc.enable_retries"]===0?this.createLoadBalancingCall(t,n,i,o,s):this.createRetryingCall(t,n,i,o,s)}createResolvingCall(t,n,i,o,s){let a=(0,Idr.getNextCallNumber)();this.trace("createResolvingCall ["+a+'] method="'+t+'", deadline='+(0,$xa.deadlineToString)(n));let l={deadline:n,flags:s??NNe.Propagate.DEFAULTS,host:i??this.defaultAuthority,parentCall:o},u=new Xxa.ResolvingCall(this,t,l,this.filterStackFactory.clone(),this.credentials._getCallCredentials(),a);return this.onCallStart(),u.addStatusWatcher(c=>{this.onCallEnd(c)}),u}close(){this.resolvingLoadBalancer.destroy(),this.updateState(yD.ConnectivityState.SHUTDOWN),clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,kNe.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels()}getTarget(){return(0,Out.uriToString)(this.target)}getConnectivityState(t){let n=this.connectivityState;return t&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),n}watchConnectivityState(t,n,i){if(this.connectivityState===yD.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let o=null;if(n!==1/0){let a=n instanceof Date?n:new Date(n),l=new Date;if(n===-1/0||a<=l){process.nextTick(i,new Error("Deadline passed without connectivity state change"));return}o=setTimeout(()=>{this.removeConnectivityStateWatcher(s),i(new Error("Deadline passed without connectivity state change"))},a.getTime()-l.getTime())}let s={currentState:t,callback:i,timer:o};this.connectivityStateWatchers.push(s)}getChannelzRef(){return this.channelzRef}createCall(t,n,i,o,s){if(typeof t!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof n=="number"||n instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===yD.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(t,n,i,o,s)}};_ut.InternalChannel=Odr});var Rur=I(Tut=>{"use strict";Object.defineProperty(Tut,"__esModule",{value:!0});Tut.ChannelImplementation=void 0;var sDa=lct(),aDa=rYn(),wdr=class{constructor(t,n,i){if(typeof t!="string")throw new TypeError("Channel target must be a string");if(!(n instanceof sDa.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(i&&typeof i!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new aDa.InternalChannel(t,n,i)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(t){return this.internalChannel.getConnectivityState(t)}watchConnectivityState(t,n,i){this.internalChannel.watchConnectivityState(t,n,i)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(t,n,i,o,s){if(typeof t!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof n=="number"||n instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(t,n,i,o,s)}};Tut.ChannelImplementation=wdr});var pYn=I(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});Nw.Http2ServerCallStream=Nw.ServerDuplexStreamImpl=Nw.ServerWritableStreamImpl=Nw.ServerReadableStreamImpl=Nw.ServerUnaryCallImpl=void 0;var aYn=require("events"),Yhe=require("http2"),Rdr=require("stream"),lYn=require("zlib"),cYn=require("util"),E1=Du(),Bdr=NE(),lDa=J0r(),uYn=Gf(),QNe=rct(),dYn="server_call",cDa=(0,cYn.promisify)(lYn.unzip),uDa=(0,cYn.promisify)(lYn.inflate);function PNe(r){uYn.trace(E1.LogVerbosity.DEBUG,dYn,r)}var dDa="grpc-accept-encoding",pDa="grpc-encoding",nYn="grpc-message",iYn="grpc-status",oYn="grpc-timeout",fDa=/(\d{1,8})\s*([HMSmun])/,ADa={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},hDa={[dDa]:"identity,deflate,gzip",[pDa]:"identity"},sYn={[Yhe.constants.HTTP2_HEADER_STATUS]:Yhe.constants.HTTP_STATUS_OK,[Yhe.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},gDa={waitForTrailers:!0},_dr=class extends aYn.EventEmitter{constructor(t,n,i){super(),this.call=t,this.metadata=n,this.request=i,this.cancelled=!1,this.call.setupSurfaceCall(this)}getPeer(){return this.call.getPeer()}sendMetadata(t){this.call.sendMetadata(t)}getDeadline(){return this.call.getDeadline()}getPath(){return this.call.getPath()}};Nw.ServerUnaryCallImpl=_dr;var Rut=class extends Rdr.Readable{constructor(t,n,i,o){super({objectMode:!0}),this.call=t,this.metadata=n,this.deserialize=i,this.cancelled=!1,this.call.setupSurfaceCall(this),this.call.setupReadable(this,o)}_read(t){this.call.consumeUnpushedMessages(this)&&this.call.resume()}getPeer(){return this.call.getPeer()}sendMetadata(t){this.call.sendMetadata(t)}getDeadline(){return this.call.getDeadline()}getPath(){return this.call.getPath()}};Nw.ServerReadableStreamImpl=Rut;var FNe=class extends Rdr.Writable{constructor(t,n,i,o){super({objectMode:!0}),this.call=t,this.metadata=n,this.serialize=i,this.request=o,this.cancelled=!1,this.trailingMetadata=new Bdr.Metadata,this.call.setupSurfaceCall(this),this.on("error",s=>{this.call.sendError(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(t){this.call.sendMetadata(t)}getDeadline(){return this.call.getDeadline()}getPath(){return this.call.getPath()}_write(t,n,i){try{let o=this.call.serializeMessage(t);if(!this.call.write(o)){this.call.once("drain",i);return}}catch(o){this.emit("error",{details:(0,QNe.getErrorMessage)(o),code:E1.Status.INTERNAL})}i()}_final(t){this.call.sendStatus({code:E1.Status.OK,details:"OK",metadata:this.trailingMetadata}),t(null)}end(t){return t&&(this.trailingMetadata=t),super.end()}};Nw.ServerWritableStreamImpl=FNe;var Jhe=class extends Rdr.Duplex{constructor(t,n,i,o,s){super({objectMode:!0}),this.call=t,this.metadata=n,this.serialize=i,this.deserialize=o,this.cancelled=!1,this.trailingMetadata=new Bdr.Metadata,this.call.setupSurfaceCall(this),this.call.setupReadable(this,s),this.on("error",a=>{this.call.sendError(a),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(t){this.call.sendMetadata(t)}getDeadline(){return this.call.getDeadline()}getPath(){return this.call.getPath()}end(t){return t&&(this.trailingMetadata=t),super.end()}};Nw.ServerDuplexStreamImpl=Jhe;Jhe.prototype._read=Rut.prototype._read;Jhe.prototype._write=FNe.prototype._write;Jhe.prototype._final=FNe.prototype._final;var Tdr=class extends aYn.EventEmitter{constructor(t,n,i){super(),this.stream=t,this.handler=n,this.cancelled=!1,this.deadlineTimer=null,this.statusSent=!1,this.deadline=1/0,this.wantTrailers=!1,this.metadataSent=!1,this.canPush=!1,this.isPushPending=!1,this.bufferedMessages=[],this.messagesToPush=[],this.maxSendMessageSize=E1.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=E1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.stream.once("error",o=>{}),this.stream.once("close",()=>{var o;PNe("Request to method "+((o=this.handler)===null||o===void 0?void 0:o.path)+" stream closed with rstCode "+this.stream.rstCode),this.statusSent||(this.cancelled=!0,this.emit("cancelled","cancelled"),this.emit("streamEnd",!1),this.sendStatus({code:E1.Status.CANCELLED,details:"Cancelled by client",metadata:null}),this.deadlineTimer&&clearTimeout(this.deadlineTimer))}),this.stream.on("drain",()=>{this.emit("drain")}),"grpc.max_send_message_length"in i&&(this.maxSendMessageSize=i["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in i&&(this.maxReceiveMessageSize=i["grpc.max_receive_message_length"])}checkCancelled(){return(this.stream.destroyed||this.stream.closed)&&(this.cancelled=!0),this.cancelled}getDecompressedMessage(t,n){return n==="deflate"?uDa(t.subarray(5)):n==="gzip"?cDa(t.subarray(5)):n==="identity"?t.subarray(5):Promise.reject({code:E1.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${n}"`})}sendMetadata(t){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let n=t?t.toHttp2Headers():null,i=Object.assign(Object.assign(Object.assign({},sYn),hDa),n);this.stream.respond(i,gDa)}receiveMetadata(t){let n=Bdr.Metadata.fromHttp2Headers(t);uYn.isTracerEnabled(dYn)&&PNe("Request to "+this.handler.path+" received headers "+JSON.stringify(n.toJSON()));let i=n.get(oYn);if(i.length>0){let o=i[0].toString().match(fDa);if(o===null){let l=new Error("Invalid deadline");return l.code=E1.Status.OUT_OF_RANGE,this.sendError(l),n}let s=+o[1]*ADa[o[2]]|0,a=new Date;this.deadline=a.setMilliseconds(a.getMilliseconds()+s),this.deadlineTimer=setTimeout(mDa,s,this),n.remove(oYn)}return n.remove(Yhe.constants.HTTP2_HEADER_ACCEPT_ENCODING),n.remove(Yhe.constants.HTTP2_HEADER_TE),n.remove(Yhe.constants.HTTP2_HEADER_CONTENT_TYPE),n.remove("grpc-accept-encoding"),n}receiveUnaryMessage(t){return new Promise((n,i)=>{let{stream:o}=this,s=0,a=this,l=[],u=this.maxReceiveMessageSize;this.stream.on("data",c),this.stream.on("end",d),this.stream.on("error",d);function c(p){if(s+=p.byteLength,u!==-1&&s>u){o.removeListener("data",c),o.removeListener("end",d),o.removeListener("error",d),i({code:E1.Status.RESOURCE_EXHAUSTED,details:`Received message larger than max (${s} vs. ${u})`});return}l.push(p)}function d(p){if(o.removeListener("data",c),o.removeListener("end",d),o.removeListener("error",d),p!==void 0){i({code:E1.Status.INTERNAL,details:p.message});return}if(s===0){i({code:E1.Status.INTERNAL,details:"received empty unary message"});return}a.emit("receiveMessage");let f=Buffer.concat(l,s),h=f.readUInt8(0)===1?t:"identity",y=a.getDecompressedMessage(f,h);if(Buffer.isBuffer(y)){n(a.deserializeMessageWithInternalError(y));return}y.then(C=>n(a.deserializeMessageWithInternalError(C)),C=>i(C.code?C:{code:E1.Status.INTERNAL,details:`Received "grpc-encoding" header "${t}" but ${t} decompression failed`}))}})}async deserializeMessageWithInternalError(t){try{return this.deserializeMessage(t)}catch(n){throw{details:(0,QNe.getErrorMessage)(n),code:E1.Status.INTERNAL}}}serializeMessage(t){let n=this.handler.serialize(t),i=n.byteLength,o=Buffer.allocUnsafe(i+5);return o.writeUInt8(0,0),o.writeUInt32BE(i,1),n.copy(o,5),o}deserializeMessage(t){return this.handler.deserialize(t)}async sendUnaryMessage(t,n,i,o){if(!this.checkCancelled()){if(i===void 0&&(i=null),t){!Object.prototype.hasOwnProperty.call(t,"metadata")&&i&&(t.metadata=i),this.sendError(t);return}try{let s=this.serializeMessage(n);this.write(s),this.sendStatus({code:E1.Status.OK,details:"OK",metadata:i})}catch(s){this.sendError({details:(0,QNe.getErrorMessage)(s),code:E1.Status.INTERNAL})}}}sendStatus(t){var n,i;if(this.emit("callEnd",t.code),this.emit("streamEnd",t.code===E1.Status.OK),!this.checkCancelled())if(PNe("Request to method "+((n=this.handler)===null||n===void 0?void 0:n.path)+" ended with status code: "+E1.Status[t.code]+" details: "+t.details),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.headersSent)this.wantTrailers||(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{var o;let s=Object.assign({[iYn]:t.code,[nYn]:encodeURI(t.details)},(o=t.metadata)===null||o===void 0?void 0:o.toHttp2Headers());this.stream.sendTrailers(s),this.statusSent=!0}),this.stream.end());else{let o=Object.assign(Object.assign({[iYn]:t.code,[nYn]:encodeURI(t.details)},sYn),(i=t.metadata)===null||i===void 0?void 0:i.toHttp2Headers());this.stream.respond(o,{endStream:!0}),this.statusSent=!0}}sendError(t){let n={code:E1.Status.UNKNOWN,details:"message"in t?t.message:"Unknown Error",metadata:"metadata"in t&&t.metadata!==void 0?t.metadata:null};"code"in t&&typeof t.code=="number"&&Number.isInteger(t.code)&&(n.code=t.code,"details"in t&&typeof t.details=="string"&&(n.details=t.details)),this.sendStatus(n)}write(t){if(!this.checkCancelled()){if(this.maxSendMessageSize!==-1&&t.length>this.maxSendMessageSize){this.sendError({code:E1.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${t.length} vs. ${this.maxSendMessageSize})`});return}return this.sendMetadata(),this.emit("sendMessage"),this.stream.write(t)}}resume(){this.stream.resume()}setupSurfaceCall(t){this.once("cancelled",n=>{t.cancelled=!0,t.emit("cancelled",n)}),this.once("callEnd",n=>t.emit("callEnd",n))}setupReadable(t,n){let i=new lDa.StreamDecoder,o=!1,s=!1,a=!1,l=async()=>{!a&&o&&!s&&(a=!0,await this.pushOrBufferMessage(t,null))};this.stream.on("data",async u=>{let c=i.write(u);s=!0,this.stream.pause();for(let d of c){if(this.maxReceiveMessageSize!==-1&&d.length>this.maxReceiveMessageSize){this.sendError({code:E1.Status.RESOURCE_EXHAUSTED,details:`Received message larger than max (${d.length} vs. ${this.maxReceiveMessageSize})`});return}this.emit("receiveMessage");let f=d.readUInt8(0)===1?n:"identity",A=await this.getDecompressedMessage(d,f);if(!A)return;await this.pushOrBufferMessage(t,A)}s=!1,this.stream.resume(),await l()}),this.stream.once("end",async()=>{o=!0,await l()})}consumeUnpushedMessages(t){for(this.canPush=!0;this.messagesToPush.length>0;){let n=this.messagesToPush.shift(),i=t.push(n);if(n===null||i===!1){this.canPush=!1;break}}return this.canPush}async pushOrBufferMessage(t,n){this.isPushPending?this.bufferedMessages.push(n):await this.pushMessage(t,n)}async pushMessage(t,n){if(n===null){PNe("Received end of stream"),this.canPush?t.push(null):this.messagesToPush.push(null);return}PNe("Received message of length "+n.length),this.isPushPending=!0;try{let i=await this.deserializeMessage(n);this.canPush?t.push(i)||(this.canPush=!1,this.stream.pause()):this.messagesToPush.push(i)}catch(i){this.bufferedMessages.length=0;let o=(0,QNe.getErrorCode)(i);(o===null||o<E1.Status.OK||o>E1.Status.UNAUTHENTICATED)&&(o=E1.Status.INTERNAL),t.emit("error",{details:(0,QNe.getErrorMessage)(i),code:o})}this.isPushPending=!1,this.bufferedMessages.length>0&&await this.pushMessage(t,this.bufferedMessages.shift())}getPeer(){var t;let n=(t=this.stream.session)===null||t===void 0?void 0:t.socket;return n?.remoteAddress?n.remotePort?`${n.remoteAddress}:${n.remotePort}`:n.remoteAddress:"unknown"}getDeadline(){return this.deadline}getPath(){return this.handler.path}};Nw.Http2ServerCallStream=Tdr;function mDa(r){let t=new Error("Deadline exceeded");t.code=E1.Status.DEADLINE_EXCEEDED,r.sendError(t),r.cancelled=!0,r.emit("cancelled","deadline")}});var Ddr=I(But=>{"use strict";Object.defineProperty(But,"__esModule",{value:!0});But.ServerCredentials=void 0;var fYn=Zcr(),LNe=class{static createInsecure(){return new Mdr}static createSsl(t,n,i=!1){if(t!==null&&!Buffer.isBuffer(t))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(n))throw new TypeError("keyCertPairs must be an array");if(typeof i!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let o=[],s=[];for(let a=0;a<n.length;a++){let l=n[a];if(l===null||typeof l!="object")throw new TypeError(`keyCertPair[${a}] must be an object`);if(!Buffer.isBuffer(l.private_key))throw new TypeError(`keyCertPair[${a}].private_key must be a Buffer`);if(!Buffer.isBuffer(l.cert_chain))throw new TypeError(`keyCertPair[${a}].cert_chain must be a Buffer`);o.push(l.cert_chain),s.push(l.private_key)}return new xdr({ca:t||(0,fYn.getDefaultRootsData)()||void 0,cert:o,key:s,requestCert:i,ciphers:fYn.CIPHER_SUITES})}};But.ServerCredentials=LNe;var Mdr=class extends LNe{_isSecure(){return!1}_getSettings(){return null}},xdr=class extends LNe{constructor(t){super(),this.options=t}_isSecure(){return!0}_getSettings(){return this.options}}});var gYn=I(Dut=>{"use strict";Object.defineProperty(Dut,"__esModule",{value:!0});Dut.Server=void 0;var yG=require("http2"),LF=Du(),ooe=pYn(),yDa=Ddr(),AYn=nD(),Mut=Gf(),LR=oD(),bDa=vS(),jI=noe(),xut=~(1<<31),EDa=~(1<<31),CDa=2e4,{HTTP2_HEADER_PATH:hYn}=yG.constants,IDa="server";function vDa(){}function Ndr(r){return{code:LF.Status.UNIMPLEMENTED,details:`The server does not implement the method ${r}`}}function SDa(r,t){let n=Ndr(t);switch(r){case"unary":return(i,o)=>{o(n,null)};case"clientStream":return(i,o)=>{o(n,null)};case"serverStream":return i=>{i.emit("error",n)};case"bidi":return i=>{i.emit("error",n)};default:throw new Error(`Invalid handlerType ${r}`)}}var kdr=class{constructor(t){var n,i,o,s;this.http2ServerList=[],this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.channelzTrace=new jI.ChannelzTrace,this.callTracker=new jI.ChannelzCallTracker,this.listenerChildrenTracker=new jI.ChannelzChildrenTracker,this.sessionChildrenTracker=new jI.ChannelzChildrenTracker,this.options=t??{},this.options["grpc.enable_channelz"]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,jI.registerChannelzServer)(()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(n=this.options["grpc.max_connection_age_ms"])!==null&&n!==void 0?n:xut,this.maxConnectionAgeGraceMs=(i=this.options["grpc.max_connection_age_grace_ms"])!==null&&i!==void 0?i:xut,this.keepaliveTimeMs=(o=this.options["grpc.keepalive_time_ms"])!==null&&o!==void 0?o:EDa,this.keepaliveTimeoutMs=(s=this.options["grpc.keepalive_timeout_ms"])!==null&&s!==void 0?s:CDa,this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfoGetter(t){return()=>{var n,i,o;let s=this.sessions.get(t),a=t.socket,l=a.remoteAddress?(0,LR.stringToSubchannelAddress)(a.remoteAddress,a.remotePort):null,u=a.localAddress?(0,LR.stringToSubchannelAddress)(a.localAddress,a.localPort):null,c;if(t.encrypted){let p=a,f=p.getCipher(),A=p.getCertificate(),h=p.getPeerCertificate();c={cipherSuiteStandardName:(n=f.standardName)!==null&&n!==void 0?n:null,cipherSuiteOtherName:f.standardName?null:f.name,localCertificate:A&&"raw"in A?A.raw:null,remoteCertificate:h&&"raw"in h?h.raw:null}}else c=null;return{remoteAddress:l,localAddress:u,security:c,remoteName:null,streamsStarted:s.streamTracker.callsStarted,streamsSucceeded:s.streamTracker.callsSucceeded,streamsFailed:s.streamTracker.callsFailed,messagesSent:s.messagesSent,messagesReceived:s.messagesReceived,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:s.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:s.lastMessageSentTimestamp,lastMessageReceivedTimestamp:s.lastMessageReceivedTimestamp,localFlowControlWindow:(i=t.state.localWindowSize)!==null&&i!==void 0?i:null,remoteFlowControlWindow:(o=t.state.remoteWindowSize)!==null&&o!==void 0?o:null}}}trace(t){Mut.trace(LF.LogVerbosity.DEBUG,IDa,"("+this.channelzRef.id+") "+t)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(t,n){if(t===null||typeof t!="object"||n===null||typeof n!="object")throw new Error("addService() requires two objects as arguments");let i=Object.keys(t);if(i.length===0)throw new Error("Cannot add an empty service to a server");i.forEach(o=>{let s=t[o],a;s.requestStream?s.responseStream?a="bidi":a="clientStream":s.responseStream?a="serverStream":a="unary";let l=n[o],u;if(l===void 0&&typeof s.originalName=="string"&&(l=n[s.originalName]),l!==void 0?u=l.bind(n):u=SDa(a,o),this.register(s.path,u,s.responseSerialize,s.requestDeserialize,a)===!1)throw new Error(`Method handler for ${s.path} already provided.`)})}removeService(t){if(t===null||typeof t!="object")throw new Error("removeService() requires object as argument");Object.keys(t).forEach(i=>{let o=t[i];this.unregister(o.path)})}bind(t,n){throw new Error("Not implemented. Use bindAsync() instead")}bindAsync(t,n,i){if(this.started===!0)throw new Error("server is already started");if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof t!="string")throw new TypeError("port must be a string");if(n===null||!(n instanceof yDa.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof i!="function")throw new TypeError("callback must be a function");let o=(0,bDa.parseUri)(t);if(o===null)throw new Error(`Could not parse port "${t}"`);let s=(0,AYn.mapUriDefaultScheme)(o);if(s===null)throw new Error(`Could not get a default scheme for port "${t}"`);let a={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER};"grpc-node.max_session_memory"in this.options?a.maxSessionMemory=this.options["grpc-node.max_session_memory"]:a.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(a.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]});let l=(A,h)=>{process.nextTick(()=>i(A,h))},u=()=>{let A;if(n._isSecure()){let h=Object.assign(a,n._getSettings());h.enableTrace=this.options["grpc-node.tls_enable_trace"]===1,A=yG.createSecureServer(h),A.on("secureConnection",y=>{y.on("error",C=>{this.trace("An incoming TLS connection closed with error: "+C.message)})})}else A=yG.createServer(a);return A.setTimeout(0,vDa),this._setupHandlers(A),A},c=(A,h,y)=>A.length===0?Promise.resolve({port:h,count:y}):Promise.all(A.map(C=>{this.trace("Attempting to bind "+(0,LR.subchannelAddressToString)(C));let v;(0,LR.isTcpSubchannelAddress)(C)?v={host:C.host,port:h}:v=C;let w=u();return new Promise((_,R)=>{let N=L=>{this.trace("Failed to bind "+(0,LR.subchannelAddressToString)(C)+" with error "+L.message),_(L)};w.once("error",N),w.listen(v,()=>{if(this.shutdown){w.close(),_(new Error("bindAsync failed because server is shutdown"));return}let L=w.address(),G;typeof L=="string"?G={path:L}:G={host:L.address,port:L.port};let Y=(0,jI.registerChannelzSocket)((0,LR.subchannelAddressToString)(G),()=>({localAddress:G,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled);this.channelzEnabled&&this.listenerChildrenTracker.refChild(Y),this.http2ServerList.push({server:w,channelzRef:Y}),this.trace("Successfully bound "+(0,LR.subchannelAddressToString)(G)),_("port"in G?G.port:h),w.removeListener("error",N)})})})).then(C=>{let v=0;for(let w of C)if(typeof w=="number"&&(v+=1,w!==h))throw new Error("Invalid state: multiple port numbers added from single address");return{port:h,count:v+y}}),d=A=>{if(A.length===0)return Promise.resolve({port:0,count:0});let h=A[0],y=u();return new Promise((C,v)=>{let w=_=>{this.trace("Failed to bind "+(0,LR.subchannelAddressToString)(h)+" with error "+_.message),C(d(A.slice(1)))};y.once("error",w),y.listen(h,()=>{if(this.shutdown){y.close(),C({port:0,count:0});return}let _=y.address(),R={host:_.address,port:_.port},N=(0,jI.registerChannelzSocket)((0,LR.subchannelAddressToString)(R),()=>({localAddress:R,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled);this.channelzEnabled&&this.listenerChildrenTracker.refChild(N),this.http2ServerList.push({server:y,channelzRef:N}),this.trace("Successfully bound "+(0,LR.subchannelAddressToString)(R)),C(c(A.slice(1),_.port,1)),y.removeListener("error",w)})})},p={onSuccessfulResolution:(A,h,y)=>{if(p.onSuccessfulResolution=()=>{},this.shutdown&&l(new Error("bindAsync failed because server is shutdown"),0),A.length===0){l(new Error(`No addresses resolved for port ${t}`),0);return}let C;(0,LR.isTcpSubchannelAddress)(A[0])?A[0].port===0?C=d(A):C=c(A,A[0].port,0):C=c(A,1,0),C.then(v=>{if(v.count===0){let w=`No address added out of total ${A.length} resolved`;Mut.log(LF.LogVerbosity.ERROR,w),l(new Error(w),0)}else v.count<A.length&&Mut.log(LF.LogVerbosity.INFO,`WARNING Only ${v.count} addresses added out of total ${A.length} resolved`),l(null,v.port)},v=>{let w=`No address added out of total ${A.length} resolved`;Mut.log(LF.LogVerbosity.ERROR,w),l(new Error(w),0)})},onError:A=>{l(new Error(A.details),0)}};(0,AYn.createResolver)(s,p,this.options).updateResolution()}forceShutdown(){for(let{server:t,channelzRef:n}of this.http2ServerList)t.listening&&t.close(()=>{this.channelzEnabled&&(this.listenerChildrenTracker.unrefChild(n),(0,jI.unregisterChannelzRef)(n))});this.started=!1,this.shutdown=!0,this.sessions.forEach((t,n)=>{n.destroy(yG.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),this.channelzEnabled&&(0,jI.unregisterChannelzRef)(this.channelzRef)}register(t,n,i,o,s){return this.handlers.has(t)?!1:(this.handlers.set(t,{func:n,serialize:i,deserialize:o,type:s,path:t}),!0)}unregister(t){return this.handlers.delete(t)}start(){if(this.http2ServerList.length===0||this.http2ServerList.every(({server:t})=>t.listening!==!0))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Starting"),this.started=!0}tryShutdown(t){let n=s=>{this.channelzEnabled&&(0,jI.unregisterChannelzRef)(this.channelzRef),t(s)},i=0;function o(){i--,i===0&&n()}this.started=!1,this.shutdown=!0;for(let{server:s,channelzRef:a}of this.http2ServerList)s.listening&&(i++,s.close(()=>{this.channelzEnabled&&(this.listenerChildrenTracker.unrefChild(a),(0,jI.unregisterChannelzRef)(a)),o()}));this.sessions.forEach((s,a)=>{a.closed||(i+=1,a.close(o))}),i===0&&n()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(t,n){let i=n[yG.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof i!="string"||!i.startsWith("application/grpc")?(t.respond({[yG.constants.HTTP2_HEADER_STATUS]:yG.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(t){this.trace("Received call to method "+t+" at address "+this.serverAddressString);let n=this.handlers.get(t);return n===void 0?(this.trace("No handler registered for method "+t+". Sending UNIMPLEMENTED status."),null):n}_respondWithError(t,n,i=null){let o=new ooe.Http2ServerCallStream(n,null,this.options);t.code===void 0&&(t.code=LF.Status.INTERNAL),this.channelzEnabled&&(this.callTracker.addCallFailed(),i?.streamTracker.addCallFailed()),o.sendError(t)}_channelzHandler(t,n){let i=this.sessions.get(t.session);if(this.callTracker.addCallStarted(),i?.streamTracker.addCallStarted(),!this._verifyContentType(t,n)){this.callTracker.addCallFailed(),i?.streamTracker.addCallFailed();return}let o=n[hYn],s=this._retrieveHandler(o);if(!s){this._respondWithError(Ndr(o),t,i);return}let a=new ooe.Http2ServerCallStream(t,s,this.options);a.once("callEnd",l=>{l===LF.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}),i&&(a.once("streamEnd",l=>{l?i.streamTracker.addCallSucceeded():i.streamTracker.addCallFailed()}),a.on("sendMessage",()=>{i.messagesSent+=1,i.lastMessageSentTimestamp=new Date}),a.on("receiveMessage",()=>{i.messagesReceived+=1,i.lastMessageReceivedTimestamp=new Date})),this._runHandlerForCall(a,s,n)||(this.callTracker.addCallFailed(),i?.streamTracker.addCallFailed(),a.sendError({code:LF.Status.INTERNAL,details:`Unknown handler type: ${s.type}`}))}_streamHandler(t,n){if(this._verifyContentType(t,n)!==!0)return;let i=n[hYn],o=this._retrieveHandler(i);if(!o){this._respondWithError(Ndr(i),t,null);return}let s=new ooe.Http2ServerCallStream(t,o,this.options);this._runHandlerForCall(s,o,n)||s.sendError({code:LF.Status.INTERNAL,details:`Unknown handler type: ${o.type}`})}_runHandlerForCall(t,n,i){var o;let s=t.receiveMetadata(i),a=(o=s.get("grpc-encoding")[0])!==null&&o!==void 0?o:"identity";s.remove("grpc-encoding");let{type:l}=n;if(l==="unary")ODa(t,n,s,a);else if(l==="clientStream")wDa(t,n,s,a);else if(l==="serverStream")_Da(t,n,s,a);else if(l==="bidi")TDa(t,n,s,a);else return!1;return!0}_setupHandlers(t){if(t===null)return;let n=t.address(),i="null";n&&(typeof n=="string"?i=n:i=n.address+":"+n.port),this.serverAddressString=i;let o=this.channelzEnabled?this._channelzHandler:this._streamHandler;t.on("stream",o.bind(this)),t.on("session",s=>{var a,l,u,c,d;if(!this.started){s.destroy();return}let p=(0,jI.registerChannelzSocket)((a=s.socket.remoteAddress)!==null&&a!==void 0?a:"unknown",this.getChannelzSessionInfoGetter(s),this.channelzEnabled),f={ref:p,streamTracker:new jI.ChannelzCallTracker,messagesSent:0,messagesReceived:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};this.sessions.set(s,f);let A=s.socket.remoteAddress;this.channelzEnabled&&(this.channelzTrace.addTrace("CT_INFO","Connection established by client "+A),this.sessionChildrenTracker.refChild(p));let h=null,y=null,C=!1;if(this.maxConnectionAgeMs!==xut){let w=this.maxConnectionAgeMs/10,_=Math.random()*w*2-w;h=(u=(l=setTimeout(()=>{var R,N;C=!0,this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+A);try{s.goaway(yG.constants.NGHTTP2_NO_ERROR,~(1<<31),Buffer.from("max_age"))}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==xut&&(y=(N=(R=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs)).unref)===null||N===void 0?void 0:N.call(R))},this.maxConnectionAgeMs+_)).unref)===null||u===void 0?void 0:u.call(l)}let v=(d=(c=setInterval(()=>{var w,_;let R=(_=(w=setTimeout(()=>{C=!0,this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+A),s.close()},this.keepaliveTimeoutMs)).unref)===null||_===void 0?void 0:_.call(w);try{s.ping((N,L,G)=>{clearTimeout(R)})}catch{s.destroy()}},this.keepaliveTimeMs)).unref)===null||d===void 0?void 0:d.call(c);s.on("close",()=>{this.channelzEnabled&&(C||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+A),this.sessionChildrenTracker.unrefChild(p),(0,jI.unregisterChannelzRef)(p)),h&&clearTimeout(h),y&&clearTimeout(y),v&&clearTimeout(v),this.sessions.delete(s)})})}};Dut.Server=kdr;async function ODa(r,t,n,i){try{let o=await r.receiveUnaryMessage(i);if(o===void 0||r.cancelled)return;let s=new ooe.ServerUnaryCallImpl(r,n,o);t.func(s,(a,l,u,c)=>{r.sendUnaryMessage(a,l,u,c)})}catch(o){r.sendError(o)}}function wDa(r,t,n,i){let o=new ooe.ServerReadableStreamImpl(r,n,t.deserialize,i);function s(a,l,u,c){o.destroy(),r.sendUnaryMessage(a,l,u,c)}r.cancelled||(o.on("error",s),t.func(o,s))}async function _Da(r,t,n,i){try{let o=await r.receiveUnaryMessage(i);if(o===void 0||r.cancelled)return;let s=new ooe.ServerWritableStreamImpl(r,n,t.serialize,o);t.func(s)}catch(o){r.sendError(o)}}function TDa(r,t,n,i){let o=new ooe.ServerDuplexStreamImpl(r,n,t.serialize,t.deserialize,i);r.cancelled||t.func(o)}});var mYn=I(Nut=>{"use strict";Object.defineProperty(Nut,"__esModule",{value:!0});Nut.StatusBuilder=void 0;var Pdr=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(t){return this.code=t,this}withDetails(t){return this.details=t,this}withMetadata(t){return this.metadata=t,this}build(){let t={};return this.code!==null&&(t.code=this.code),this.details!==null&&(t.details=this.details),this.metadata!==null&&(t.metadata=this.metadata),t}};Nut.StatusBuilder=Pdr});var Qdr=I(bG=>{"use strict";Object.defineProperty(bG,"__esModule",{value:!0});bG.isDuration=bG.durationToMs=bG.msToDuration=void 0;function RDa(r){return{seconds:r/1e3|0,nanos:r%1e3*1e6|0}}bG.msToDuration=RDa;function BDa(r){return r.seconds*1e3+r.nanos/1e6|0}bG.durationToMs=BDa;function MDa(r){return typeof r.seconds=="number"&&typeof r.nanos=="number"}bG.isDuration=MDa});var Gdr=I(EG=>{"use strict";var Fdr;Object.defineProperty(EG,"__esModule",{value:!0});EG.setup=EG.OutlierDetectionLoadBalancer=EG.OutlierDetectionLoadBalancingConfig=void 0;var Put=Ow(),bYn=Du(),soe=Qdr(),EYn=Vdr(),CYn=YW(),xDa=hct(),DDa=ZW(),yYn=oD(),NDa=Sut(),kDa=Gf(),PDa="outlier_detection";function Dm(r){kDa.trace(bYn.LogVerbosity.DEBUG,PDa,r)}var Wdr="outlier_detection",QDa=((Fdr=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&Fdr!==void 0?Fdr:"true")==="true",FDa={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},LDa={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function $he(r,t,n,i){if(t in r&&typeof r[t]!==n){let o=i?`${i}.${t}`:t;throw new Error(`outlier detection config ${o} parse error: expected ${n}, got ${typeof r[t]}`)}}function Ldr(r,t,n){let i=n?`${n}.${t}`:t;if(t in r){if(!(0,soe.isDuration)(r[t]))throw new Error(`outlier detection config ${i} parse error: expected Duration, got ${typeof r[t]}`);if(!(r[t].seconds>=0&&r[t].seconds<=315576e6&&r[t].nanos>=0&&r[t].nanos<=999999999))throw new Error(`outlier detection config ${i} parse error: values out of range for non-negative Duaration`)}}function kut(r,t,n){let i=n?`${n}.${t}`:t;if($he(r,t,"number",n),t in r&&!(r[t]>=0&&r[t]<=100))throw new Error(`outlier detection config ${i} parse error: value out of range for percentage (0-100)`)}var zNe=class r{constructor(t,n,i,o,s,a,l){if(this.childPolicy=l,l.length>0&&l[0].getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=t??1e4,this.baseEjectionTimeMs=n??3e4,this.maxEjectionTimeMs=i??3e5,this.maxEjectionPercent=o??10,this.successRateEjection=s?Object.assign(Object.assign({},FDa),s):null,this.failurePercentageEjection=a?Object.assign(Object.assign({},LDa),a):null}getLoadBalancerName(){return Wdr}toJsonObject(){return{interval:(0,soe.msToDuration)(this.intervalMs),base_ejection_time:(0,soe.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,soe.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:this.successRateEjection,failure_percentage_ejection:this.failurePercentageEjection,child_policy:this.childPolicy.map(t=>t.toJsonObject())}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}copyWithChildPolicy(t){return new r(this.intervalMs,this.baseEjectionTimeMs,this.maxEjectionTimeMs,this.maxEjectionPercent,this.successRateEjection,this.failurePercentageEjection,t)}static createFromJson(t){var n;if(Ldr(t,"interval"),Ldr(t,"base_ejection_time"),Ldr(t,"max_ejection_time"),kut(t,"max_ejection_percent"),"success_rate_ejection"in t){if(typeof t.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");$he(t.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),kut(t.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),$he(t.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),$he(t.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in t){if(typeof t.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");kut(t.failure_percentage_ejection,"threshold","failure_percentage_ejection"),kut(t.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),$he(t.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),$he(t.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}return new r(t.interval?(0,soe.durationToMs)(t.interval):null,t.base_ejection_time?(0,soe.durationToMs)(t.base_ejection_time):null,t.max_ejection_time?(0,soe.durationToMs)(t.max_ejection_time):null,(n=t.max_ejection_percent)!==null&&n!==void 0?n:null,t.success_rate_ejection,t.failure_percentage_ejection,t.child_policy.map(CYn.validateLoadBalancingConfig))}};EG.OutlierDetectionLoadBalancingConfig=zNe;var qdr=class extends NDa.BaseSubchannelWrapper{constructor(t,n){super(t),this.mapEntry=n,this.stateListeners=[],this.ejected=!1,this.refCount=0,this.childSubchannelState=t.getConnectivityState(),t.addConnectivityStateListener((i,o,s,a)=>{if(this.childSubchannelState=s,!this.ejected)for(let l of this.stateListeners)l(this,o,s,a)})}getConnectivityState(){return this.ejected?Put.ConnectivityState.TRANSIENT_FAILURE:this.childSubchannelState}addConnectivityStateListener(t){this.stateListeners.push(t)}removeConnectivityStateListener(t){let n=this.stateListeners.indexOf(t);n>-1&&this.stateListeners.splice(n,1)}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let t=this.mapEntry.subchannelWrappers.indexOf(this);t>=0&&this.mapEntry.subchannelWrappers.splice(t,1)}}eject(){this.ejected=!0;for(let t of this.stateListeners)t(this,this.childSubchannelState,Put.ConnectivityState.TRANSIENT_FAILURE,-1)}uneject(){this.ejected=!1;for(let t of this.stateListeners)t(this,Put.ConnectivityState.TRANSIENT_FAILURE,this.childSubchannelState,-1)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function zdr(){return{success:0,failure:0}}var Udr=class{constructor(){this.activeBucket=zdr(),this.inactiveBucket=zdr()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=zdr()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},jdr=class{constructor(t,n){this.wrappedPicker=t,this.countCalls=n}pick(t){let n=this.wrappedPicker.pick(t);if(n.pickResultType===DDa.PickResultType.COMPLETE){let i=n.subchannel,o=i.getMapEntry();if(o){let s=n.onCallEnded;return this.countCalls&&(s=a=>{var l;a===bYn.Status.OK?o.counter.addSuccess():o.counter.addFailure(),(l=n.onCallEnded)===null||l===void 0||l.call(n,a)}),Object.assign(Object.assign({},n),{subchannel:i.getWrappedSubchannel(),onCallEnded:s})}else return Object.assign(Object.assign({},n),{subchannel:i.getWrappedSubchannel()})}else return n}},Qut=class{constructor(t){this.addressMap=new Map,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new xDa.ChildLoadBalancerHandler((0,EYn.createChildChannelControlHelper)(t,{createSubchannel:(n,i)=>{let o=t.createSubchannel(n,i),s=this.addressMap.get((0,yYn.subchannelAddressToString)(n)),a=new qdr(o,s);return s?.currentEjectionTimestamp!==null&&a.eject(),s?.subchannelWrappers.push(a),a},updateState:(n,i)=>{n===Put.ConnectivityState.READY?t.updateState(n,new jdr(i,this.isCountingEnabled())):t.updateState(n,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let t=0;for(let n of this.addressMap.values())n.currentEjectionTimestamp!==null&&(t+=1);return t*100/this.addressMap.size}runSuccessRateCheck(t){if(!this.latestConfig)return;let n=this.latestConfig.getSuccessRateEjectionConfig();if(!n)return;Dm("Running success rate check");let i=n.request_volume,o=0,s=[];for(let[p,f]of this.addressMap){let A=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();Dm("Stats for "+p+": successes="+A+" failures="+h+" targetRequestVolume="+i),A+h>=i&&(o+=1,s.push(A/(A+h)))}if(Dm("Found "+o+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+s+"]"),o<n.minimum_hosts)return;let a=s.reduce((p,f)=>p+f)/s.length,l=0;for(let p of s){let f=p-a;l+=f*f}let u=l/s.length,c=Math.sqrt(u),d=a-c*(n.stdev_factor/1e3);Dm("stdev="+c+" ejectionThreshold="+d);for(let[p,f]of this.addressMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let A=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();if(A+h<i)continue;let y=A/(A+h);if(Dm("Checking candidate "+p+" successRate="+y),y<d){let C=Math.random()*100;Dm("Candidate "+p+" randomNumber="+C+" enforcement_percentage="+n.enforcement_percentage),C<n.enforcement_percentage&&(Dm("Ejecting candidate "+p),this.eject(f,t))}}}runFailurePercentageCheck(t){if(!this.latestConfig)return;let n=this.latestConfig.getFailurePercentageEjectionConfig();if(!n)return;Dm("Running failure percentage check. threshold="+n.threshold+" request volume threshold="+n.request_volume);let i=0;for(let o of this.addressMap.values()){let s=o.counter.getLastSuccesses(),a=o.counter.getLastFailures();s+a>=n.request_volume&&(i+=1)}if(!(i<n.minimum_hosts))for(let[o,s]of this.addressMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let a=s.counter.getLastSuccesses(),l=s.counter.getLastFailures();if(Dm("Candidate successes="+a+" failures="+l),a+l<n.request_volume)continue;if(l*100/(l+a)>n.threshold){let c=Math.random()*100;Dm("Candidate "+o+" randomNumber="+c+" enforcement_percentage="+n.enforcement_percentage),c<n.enforcement_percentage&&(Dm("Ejecting candidate "+o),this.eject(s,t))}}}eject(t,n){t.currentEjectionTimestamp=new Date,t.ejectionTimeMultiplier+=1;for(let i of t.subchannelWrappers)i.eject()}uneject(t){t.currentEjectionTimestamp=null;for(let n of t.subchannelWrappers)n.uneject()}switchAllBuckets(){for(let t of this.addressMap.values())t.counter.switchBuckets()}startTimer(t){var n,i;this.ejectionTimer=setTimeout(()=>this.runChecks(),t),(i=(n=this.ejectionTimer).unref)===null||i===void 0||i.call(n)}runChecks(){let t=new Date;if(Dm("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=t,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(t),this.runFailurePercentageCheck(t);for(let[n,i]of this.addressMap.entries())if(i.currentEjectionTimestamp===null)i.ejectionTimeMultiplier>0&&(i.ejectionTimeMultiplier-=1);else{let o=this.latestConfig.getBaseEjectionTimeMs(),s=this.latestConfig.getMaxEjectionTimeMs(),a=new Date(i.currentEjectionTimestamp.getTime());a.setMilliseconds(a.getMilliseconds()+Math.min(o*i.ejectionTimeMultiplier,Math.max(o,s))),a<new Date&&(Dm("Unejecting "+n),this.uneject(i))}}}updateAddressList(t,n,i){if(!(n instanceof zNe))return;let o=new Set;for(let a of t)o.add((0,yYn.subchannelAddressToString)(a));for(let a of o)this.addressMap.has(a)||(Dm("Adding map entry for "+a),this.addressMap.set(a,{counter:new Udr,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));for(let a of this.addressMap.keys())o.has(a)||(Dm("Removing map entry for "+a),this.addressMap.delete(a));let s=(0,CYn.getFirstUsableConfig)(n.getChildPolicy(),!0);if(this.childBalancer.updateAddressList(t,s,i),n.getSuccessRateEjectionConfig()||n.getFailurePercentageEjectionConfig())if(this.timerStartTime){Dm("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let a=n.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(a)}else Dm("Starting new timer"),this.timerStartTime=new Date,this.startTimer(n.getIntervalMs()),this.switchAllBuckets();else{Dm("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let a of this.addressMap.values())this.uneject(a),a.ejectionTimeMultiplier=0}this.latestConfig=n}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return Wdr}};EG.OutlierDetectionLoadBalancer=Qut;function zDa(){QDa&&(0,EYn.registerLoadBalancerType)(Wdr,Qut,zNe)}EG.setup=zDa});var Vdr=I(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.OutlierDetectionLoadBalancingConfig=Na.BaseSubchannelWrapper=Na.registerAdminService=Na.FilterStackFactory=Na.BaseFilter=Na.PickResultType=Na.QueuePicker=Na.UnavailablePicker=Na.ChildLoadBalancerHandler=Na.subchannelAddressToString=Na.validateLoadBalancingConfig=Na.getFirstUsableConfig=Na.registerLoadBalancerType=Na.createChildChannelControlHelper=Na.BackoffTimeout=Na.durationToMs=Na.uriToString=Na.createResolver=Na.registerResolver=Na.log=Na.trace=void 0;var IYn=Gf();Object.defineProperty(Na,"trace",{enumerable:!0,get:function(){return IYn.trace}});Object.defineProperty(Na,"log",{enumerable:!0,get:function(){return IYn.log}});var vYn=nD();Object.defineProperty(Na,"registerResolver",{enumerable:!0,get:function(){return vYn.registerResolver}});Object.defineProperty(Na,"createResolver",{enumerable:!0,get:function(){return vYn.createResolver}});var qDa=vS();Object.defineProperty(Na,"uriToString",{enumerable:!0,get:function(){return qDa.uriToString}});var UDa=Qdr();Object.defineProperty(Na,"durationToMs",{enumerable:!0,get:function(){return UDa.durationToMs}});var jDa=aNe();Object.defineProperty(Na,"BackoffTimeout",{enumerable:!0,get:function(){return jDa.BackoffTimeout}});var Fut=YW();Object.defineProperty(Na,"createChildChannelControlHelper",{enumerable:!0,get:function(){return Fut.createChildChannelControlHelper}});Object.defineProperty(Na,"registerLoadBalancerType",{enumerable:!0,get:function(){return Fut.registerLoadBalancerType}});Object.defineProperty(Na,"getFirstUsableConfig",{enumerable:!0,get:function(){return Fut.getFirstUsableConfig}});Object.defineProperty(Na,"validateLoadBalancingConfig",{enumerable:!0,get:function(){return Fut.validateLoadBalancingConfig}});var WDa=oD();Object.defineProperty(Na,"subchannelAddressToString",{enumerable:!0,get:function(){return WDa.subchannelAddressToString}});var GDa=hct();Object.defineProperty(Na,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return GDa.ChildLoadBalancerHandler}});var Hdr=ZW();Object.defineProperty(Na,"UnavailablePicker",{enumerable:!0,get:function(){return Hdr.UnavailablePicker}});Object.defineProperty(Na,"QueuePicker",{enumerable:!0,get:function(){return Hdr.QueuePicker}});Object.defineProperty(Na,"PickResultType",{enumerable:!0,get:function(){return Hdr.PickResultType}});var VDa=cut();Object.defineProperty(Na,"BaseFilter",{enumerable:!0,get:function(){return VDa.BaseFilter}});var HDa=odr();Object.defineProperty(Na,"FilterStackFactory",{enumerable:!0,get:function(){return HDa.FilterStackFactory}});var KDa=mct();Object.defineProperty(Na,"registerAdminService",{enumerable:!0,get:function(){return KDa.registerAdminService}});var YDa=Sut();Object.defineProperty(Na,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return YDa.BaseSubchannelWrapper}});var JDa=Gdr();Object.defineProperty(Na,"OutlierDetectionLoadBalancingConfig",{enumerable:!0,get:function(){return JDa.OutlierDetectionLoadBalancingConfig}})});var SYn=I(Lut=>{"use strict";Object.defineProperty(Lut,"__esModule",{value:!0});Lut.setup=void 0;var $Da=nD(),Kdr=class{constructor(t,n,i){this.listener=n,this.addresses=[],this.hasReturnedResult=!1;let o;t.authority===""?o="/"+t.path:o=t.path,this.addresses=[{path:o}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener.onSuccessfulResolution,this.addresses,null,null,null,{}))}destroy(){}static getDefaultAuthority(t){return"localhost"}};function XDa(){(0,$Da.registerResolver)("unix",Kdr)}Lut.setup=XDa});var RYn=I(Uut=>{"use strict";Object.defineProperty(Uut,"__esModule",{value:!0});Uut.setup=void 0;var OYn=require("net"),zut=Du(),Ydr=NE(),wYn=nD(),_Yn=vS(),ZDa=Gf(),e9a="ip_resolver";function TYn(r){ZDa.trace(zut.LogVerbosity.DEBUG,e9a,r)}var Jdr="ipv4",$dr="ipv6",t9a=443,qut=class{constructor(t,n,i){var o;this.listener=n,this.addresses=[],this.error=null,this.hasReturnedResult=!1,TYn("Resolver constructed for target "+(0,_Yn.uriToString)(t));let s=[];if(!(t.scheme===Jdr||t.scheme===$dr)){this.error={code:zut.Status.UNAVAILABLE,details:`Unrecognized scheme ${t.scheme} in IP resolver`,metadata:new Ydr.Metadata};return}let a=t.path.split(",");for(let l of a){let u=(0,_Yn.splitHostPort)(l);if(u===null){this.error={code:zut.Status.UNAVAILABLE,details:`Failed to parse ${t.scheme} address ${l}`,metadata:new Ydr.Metadata};return}if(t.scheme===Jdr&&!(0,OYn.isIPv4)(u.host)||t.scheme===$dr&&!(0,OYn.isIPv6)(u.host)){this.error={code:zut.Status.UNAVAILABLE,details:`Failed to parse ${t.scheme} address ${l}`,metadata:new Ydr.Metadata};return}s.push({host:u.host,port:(o=u.port)!==null&&o!==void 0?o:t9a})}this.addresses=s,TYn("Parsed "+t.scheme+" address list "+this.addresses)}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener.onError(this.error):this.listener.onSuccessfulResolution(this.addresses,null,null,null,{})}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(t){return t.path.split(",")[0]}};function r9a(){(0,wYn.registerResolver)(Jdr,qut),(0,wYn.registerResolver)($dr,qut)}Uut.setup=r9a});var xYn=I(bD=>{"use strict";Object.defineProperty(bD,"__esModule",{value:!0});bD.setup=bD.PickFirstLoadBalancer=bD.shuffled=bD.PickFirstLoadBalancingConfig=void 0;var BYn=YW(),V3=Ow(),jut=ZW(),n9a=Gf(),i9a=Du(),o9a="pick_first";function Xdr(r){n9a.trace(i9a.LogVerbosity.DEBUG,o9a,r)}var qNe="pick_first",s9a=250,UNe=class r{constructor(t){this.shuffleAddressList=t}getLoadBalancerName(){return qNe}toJsonObject(){return{[qNe]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(t){if("shuffleAddressList"in t&&typeof t.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new r(t.shuffleAddressList===!0)}};bD.PickFirstLoadBalancingConfig=UNe;var Zdr=class{constructor(t){this.subchannel=t}pick(t){return{pickResultType:jut.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function MYn(r){let t=r.slice();for(let n=t.length-1;n>1;n--){let i=Math.floor(Math.random()*(n+1)),o=t[n];t[n]=t[i],t[i]=o}return t}bD.shuffled=MYn;var Wut=class{constructor(t){this.channelControlHelper=t,this.children=[],this.currentState=V3.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(n,i,o,s,a)=>{this.onSubchannelStateUpdate(n,i,o,a)},this.triedAllSubchannels=!1,this.stickyTransientFailureMode=!1,this.requestedResolutionSinceLastUpdate=!1,this.lastError=null,this.latestAddressList=null,this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(t=>t.hasReportedTransientFailure)}calculateAndReportNewState(){this.currentPick?this.updateState(V3.ConnectivityState.READY,new Zdr(this.currentPick)):this.children.length===0?this.updateState(V3.ConnectivityState.IDLE,new jut.QueuePicker(this)):this.stickyTransientFailureMode?this.updateState(V3.ConnectivityState.TRANSIENT_FAILURE,new jut.UnavailablePicker({details:`No connection established. Last error: ${this.lastError}`})):this.updateState(V3.ConnectivityState.CONNECTING,new jut.QueuePicker(this))}requestReresolution(){this.requestedResolutionSinceLastUpdate=!0,this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()&&(this.requestedResolutionSinceLastUpdate||this.requestReresolution(),!this.stickyTransientFailureMode)){this.stickyTransientFailureMode=!0;for(let{subchannel:t}of this.children)t.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){if(this.currentPick!==null){let t=this.currentPick;this.currentPick=null,t.unref(),t.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(t.getChannelzRef())}}onSubchannelStateUpdate(t,n,i,o){var s;if(!((s=this.currentPick)===null||s===void 0)&&s.realSubchannelEquals(t)){i!==V3.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState(),this.requestReresolution());return}for(let[a,l]of this.children.entries())if(t.realSubchannelEquals(l.subchannel)){i===V3.ConnectivityState.READY&&this.pickSubchannel(l.subchannel),i===V3.ConnectivityState.TRANSIENT_FAILURE&&(l.hasReportedTransientFailure=!0,o&&(this.lastError=o),this.maybeEnterStickyTransientFailureMode(),a===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(a+1)),l.subchannel.startConnecting();return}}startNextSubchannelConnecting(t){if(clearTimeout(this.connectionDelayTimeout),!this.triedAllSubchannels){for(let[n,i]of this.children.entries())if(n>=t){let o=i.subchannel.getConnectivityState();if(o===V3.ConnectivityState.IDLE||o===V3.ConnectivityState.CONNECTING){this.startConnecting(n);return}}this.triedAllSubchannels=!0,this.maybeEnterStickyTransientFailureMode()}}startConnecting(t){var n,i;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=t,this.children[t].subchannel.getConnectivityState()===V3.ConnectivityState.IDLE&&(Xdr("Start connecting to subchannel with address "+this.children[t].subchannel.getAddress()),process.nextTick(()=>{var o;(o=this.children[t])===null||o===void 0||o.subchannel.startConnecting()})),this.connectionDelayTimeout=(i=(n=setTimeout(()=>{this.startNextSubchannelConnecting(t+1)},s9a)).unref)===null||i===void 0?void 0:i.call(n)}pickSubchannel(t){this.currentPick&&t.realSubchannelEquals(this.currentPick)||(Xdr("Pick subchannel with address "+t.getAddress()),this.stickyTransientFailureMode=!1,this.currentPick!==null&&(this.currentPick.unref(),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeConnectivityStateListener(this.subchannelStateListener)),this.currentPick=t,t.ref(),this.channelControlHelper.addChannelzChild(t.getChannelzRef()),this.resetSubchannelList(),clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState())}updateState(t,n){Xdr(V3.ConnectivityState[this.currentState]+" -> "+V3.ConnectivityState[t]),this.currentState=t,this.channelControlHelper.updateState(t,n)}resetSubchannelList(){for(let t of this.children)this.currentPick&&t.subchannel.realSubchannelEquals(this.currentPick)||t.subchannel.removeConnectivityStateListener(this.subchannelStateListener),t.subchannel.unref(),this.channelControlHelper.removeChannelzChild(t.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[],this.triedAllSubchannels=!1,this.requestedResolutionSinceLastUpdate=!1}connectToAddressList(t){let n=t.map(i=>({subchannel:this.channelControlHelper.createSubchannel(i,{}),hasReportedTransientFailure:!1}));for(let{subchannel:i}of n)i.ref(),this.channelControlHelper.addChannelzChild(i.getChannelzRef());this.resetSubchannelList(),this.children=n;for(let{subchannel:i}of this.children)if(i.addConnectivityStateListener(this.subchannelStateListener),i.getConnectivityState()===V3.ConnectivityState.READY){this.pickSubchannel(i);return}for(let i of this.children)i.subchannel.getConnectivityState()===V3.ConnectivityState.TRANSIENT_FAILURE&&(i.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(t,n){n instanceof UNe&&(n.getShuffleAddressList()&&(t=MYn(t)),this.latestAddressList=t,this.connectToAddressList(t))}exitIdle(){this.currentState===V3.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return qNe}};bD.PickFirstLoadBalancer=Wut;function a9a(){(0,BYn.registerLoadBalancerType)(qNe,Wut,UNe),(0,BYn.registerDefaultLoadBalancerType)(qNe)}bD.setup=a9a});var NYn=I(Xhe=>{"use strict";Object.defineProperty(Xhe,"__esModule",{value:!0});Xhe.setup=Xhe.RoundRobinLoadBalancer=void 0;var l9a=YW(),H3=Ow(),Gut=ZW(),c9a=oD(),u9a=Gf(),d9a=Du(),p9a="round_robin";function DYn(r){u9a.trace(d9a.LogVerbosity.DEBUG,p9a,r)}var Vut="round_robin",epr=class r{getLoadBalancerName(){return Vut}constructor(){}toJsonObject(){return{[Vut]:{}}}static createFromJson(t){return new r}},tpr=class{constructor(t,n=0){this.subchannelList=t,this.nextIndex=n}pick(t){let n=this.subchannelList[this.nextIndex];return this.nextIndex=(this.nextIndex+1)%this.subchannelList.length,{pickResultType:Gut.PickResultType.COMPLETE,subchannel:n,status:null,onCallStarted:null,onCallEnded:null}}peekNextSubchannel(){return this.subchannelList[this.nextIndex]}},Hut=class{constructor(t){this.channelControlHelper=t,this.subchannels=[],this.currentState=H3.ConnectivityState.IDLE,this.currentReadyPicker=null,this.lastError=null,this.subchannelStateListener=(n,i,o,s,a)=>{this.calculateAndUpdateState(),(o===H3.ConnectivityState.TRANSIENT_FAILURE||o===H3.ConnectivityState.IDLE)&&(a&&(this.lastError=a),this.channelControlHelper.requestReresolution(),n.startConnecting())}}countSubchannelsWithState(t){return this.subchannels.filter(n=>n.getConnectivityState()===t).length}calculateAndUpdateState(){if(this.countSubchannelsWithState(H3.ConnectivityState.READY)>0){let t=this.subchannels.filter(i=>i.getConnectivityState()===H3.ConnectivityState.READY),n=0;this.currentReadyPicker!==null&&(n=t.indexOf(this.currentReadyPicker.peekNextSubchannel()),n<0&&(n=0)),this.updateState(H3.ConnectivityState.READY,new tpr(t,n))}else this.countSubchannelsWithState(H3.ConnectivityState.CONNECTING)>0?this.updateState(H3.ConnectivityState.CONNECTING,new Gut.QueuePicker(this)):this.countSubchannelsWithState(H3.ConnectivityState.TRANSIENT_FAILURE)>0?this.updateState(H3.ConnectivityState.TRANSIENT_FAILURE,new Gut.UnavailablePicker({details:`No connection established. Last error: ${this.lastError}`})):this.updateState(H3.ConnectivityState.IDLE,new Gut.QueuePicker(this))}updateState(t,n){DYn(H3.ConnectivityState[this.currentState]+" -> "+H3.ConnectivityState[t]),t===H3.ConnectivityState.READY?this.currentReadyPicker=n:this.currentReadyPicker=null,this.currentState=t,this.channelControlHelper.updateState(t,n)}resetSubchannelList(){for(let t of this.subchannels)t.removeConnectivityStateListener(this.subchannelStateListener),t.unref(),this.channelControlHelper.removeChannelzChild(t.getChannelzRef());this.subchannels=[]}updateAddressList(t,n){this.resetSubchannelList(),DYn("Connect to address list "+t.map(i=>(0,c9a.subchannelAddressToString)(i))),this.subchannels=t.map(i=>this.channelControlHelper.createSubchannel(i,{}));for(let i of this.subchannels){i.ref(),i.addConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.addChannelzChild(i.getChannelzRef());let o=i.getConnectivityState();(o===H3.ConnectivityState.IDLE||o===H3.ConnectivityState.TRANSIENT_FAILURE)&&i.startConnecting()}this.calculateAndUpdateState()}exitIdle(){for(let t of this.subchannels)t.startConnecting()}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return Vut}};Xhe.RoundRobinLoadBalancer=Hut;function f9a(){(0,l9a.registerLoadBalancerType)(Vut,Hut,epr)}Xhe.setup=f9a});var FYn=I(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.experimental=Bo.addAdminServicesToServer=Bo.getChannelzHandlers=Bo.getChannelzServiceDefinition=Bo.InterceptorConfigurationError=Bo.InterceptingCall=Bo.RequesterBuilder=Bo.ListenerBuilder=Bo.StatusBuilder=Bo.getClientChannel=Bo.ServerCredentials=Bo.Server=Bo.setLogVerbosity=Bo.setLogger=Bo.load=Bo.loadObject=Bo.CallCredentials=Bo.ChannelCredentials=Bo.waitForClientReady=Bo.closeClient=Bo.Channel=Bo.makeGenericClientConstructor=Bo.makeClientConstructor=Bo.loadPackageDefinition=Bo.Client=Bo.compressionAlgorithms=Bo.propagate=Bo.connectivityState=Bo.status=Bo.logVerbosity=Bo.Metadata=Bo.credentials=void 0;var Kut=$cr();Object.defineProperty(Bo,"CallCredentials",{enumerable:!0,get:function(){return Kut.CallCredentials}});var A9a=Rur();Object.defineProperty(Bo,"Channel",{enumerable:!0,get:function(){return A9a.ChannelImplementation}});var h9a=sdr();Object.defineProperty(Bo,"compressionAlgorithms",{enumerable:!0,get:function(){return h9a.CompressionAlgorithms}});var g9a=Ow();Object.defineProperty(Bo,"connectivityState",{enumerable:!0,get:function(){return g9a.ConnectivityState}});var Yut=lct();Object.defineProperty(Bo,"ChannelCredentials",{enumerable:!0,get:function(){return Yut.ChannelCredentials}});var kYn=Tur();Object.defineProperty(Bo,"Client",{enumerable:!0,get:function(){return kYn.Client}});var rpr=Du();Object.defineProperty(Bo,"logVerbosity",{enumerable:!0,get:function(){return rpr.LogVerbosity}});Object.defineProperty(Bo,"status",{enumerable:!0,get:function(){return rpr.Status}});Object.defineProperty(Bo,"propagate",{enumerable:!0,get:function(){return rpr.Propagate}});var PYn=Gf(),npr=Mur();Object.defineProperty(Bo,"loadPackageDefinition",{enumerable:!0,get:function(){return npr.loadPackageDefinition}});Object.defineProperty(Bo,"makeClientConstructor",{enumerable:!0,get:function(){return npr.makeClientConstructor}});Object.defineProperty(Bo,"makeGenericClientConstructor",{enumerable:!0,get:function(){return npr.makeClientConstructor}});var m9a=NE();Object.defineProperty(Bo,"Metadata",{enumerable:!0,get:function(){return m9a.Metadata}});var y9a=gYn();Object.defineProperty(Bo,"Server",{enumerable:!0,get:function(){return y9a.Server}});var b9a=Ddr();Object.defineProperty(Bo,"ServerCredentials",{enumerable:!0,get:function(){return b9a.ServerCredentials}});var E9a=mYn();Object.defineProperty(Bo,"StatusBuilder",{enumerable:!0,get:function(){return E9a.StatusBuilder}});Bo.credentials={combineChannelCredentials:(r,...t)=>t.reduce((n,i)=>n.compose(i),r),combineCallCredentials:(r,...t)=>t.reduce((n,i)=>n.compose(i),r),createInsecure:Yut.ChannelCredentials.createInsecure,createSsl:Yut.ChannelCredentials.createSsl,createFromSecureContext:Yut.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:Kut.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:Kut.CallCredentials.createFromGoogleCredential,createEmpty:Kut.CallCredentials.createEmpty};var C9a=r=>r.close();Bo.closeClient=C9a;var I9a=(r,t,n)=>r.waitForReady(t,n);Bo.waitForClientReady=I9a;var v9a=(r,t)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};Bo.loadObject=v9a;var S9a=(r,t,n)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};Bo.load=S9a;var O9a=r=>{PYn.setLogger(r)};Bo.setLogger=O9a;var w9a=r=>{PYn.setLoggerVerbosity(r)};Bo.setLogVerbosity=w9a;var _9a=r=>kYn.Client.prototype.getChannel.call(r);Bo.getClientChannel=_9a;var Jut=Our();Object.defineProperty(Bo,"ListenerBuilder",{enumerable:!0,get:function(){return Jut.ListenerBuilder}});Object.defineProperty(Bo,"RequesterBuilder",{enumerable:!0,get:function(){return Jut.RequesterBuilder}});Object.defineProperty(Bo,"InterceptingCall",{enumerable:!0,get:function(){return Jut.InterceptingCall}});Object.defineProperty(Bo,"InterceptorConfigurationError",{enumerable:!0,get:function(){return Jut.InterceptorConfigurationError}});var QYn=noe();Object.defineProperty(Bo,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return QYn.getChannelzServiceDefinition}});Object.defineProperty(Bo,"getChannelzHandlers",{enumerable:!0,get:function(){return QYn.getChannelzHandlers}});var T9a=mct();Object.defineProperty(Bo,"addAdminServicesToServer",{enumerable:!0,get:function(){return T9a.addAdminServicesToServer}});var R9a=Vdr();Bo.experimental=R9a;var B9a=H0r(),M9a=SYn(),x9a=RYn(),D9a=xYn(),N9a=NYn(),k9a=Gdr(),P9a=noe();B9a.setup(),M9a.setup(),x9a.setup(),D9a.setup(),N9a.setup(),k9a.setup(),P9a.setup()});var Uei,jei=ut(()=>{Uei=typeof globalThis=="object"?globalThis:global});var Wei=ut(()=>{jei()});var Gei=ut(()=>{Wei()});var JF,DAr=ut(()=>{JF="1.9.0"});function iUa(r){var t=new Set([r]),n=new Set,i=r.match(Vei);if(!i)return function(){return!1};var o={major:+i[1],minor:+i[2],patch:+i[3],prerelease:i[4]};if(o.prerelease!=null)return function(u){return u===r};function s(l){return n.add(l),!1}function a(l){return t.add(l),!0}return function(u){if(t.has(u))return!0;if(n.has(u))return!1;var c=u.match(Vei);if(!c)return s(u);var d={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return d.prerelease!=null||o.major!==d.major?s(u):o.major===0?o.minor===d.minor&&o.patch<=d.patch?a(u):s(u):o.minor<=d.minor?a(u):s(u)}}var Vei,Hei,Kei=ut(()=>{DAr();Vei=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;Hei=iUa(JF)});function xD(r,t,n,i){var o;i===void 0&&(i=!1);var s=W7e[j7e]=(o=W7e[j7e])!==null&&o!==void 0?o:{version:JF};if(!i&&s[r]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+r);return n.error(a.stack||a.message),!1}if(s.version!==JF){var a=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+r+" does not match previously registered API v"+JF);return n.error(a.stack||a.message),!1}return s[r]=t,n.debug("@opentelemetry/api: Registered a global for "+r+" v"+JF+"."),!0}function RS(r){var t,n,i=(t=W7e[j7e])===null||t===void 0?void 0:t.version;if(!(!i||!Hei(i)))return(n=W7e[j7e])===null||n===void 0?void 0:n[r]}function DD(r,t){t.debug("@opentelemetry/api: Unregistering a global for "+r+" v"+JF+".");var n=W7e[j7e];n&&delete n[r]}var oUa,j7e,W7e,Uoe=ut(()=>{Gei();DAr();Kei();oUa=JF.split(".")[0],j7e=Symbol.for("opentelemetry.js.api."+oUa),W7e=Uei});function G7e(r,t,n){var i=RS("diag");if(i)return n.unshift(t),i[r].apply(i,aUa([],sUa(n),!1))}var sUa,aUa,Yei,Jei=ut(()=>{Uoe();sUa=function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},aUa=function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))},Yei=function(){function r(t){this._namespace=t.namespace||"DiagComponentLogger"}return r.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return G7e("debug",this._namespace,t)},r.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return G7e("error",this._namespace,t)},r.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return G7e("info",this._namespace,t)},r.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return G7e("warn",this._namespace,t)},r.prototype.verbose=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return G7e("verbose",this._namespace,t)},r}()});var gy,Bdt=ut(()=>{(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(gy||(gy={}))});function $ei(r,t){r<gy.NONE?r=gy.NONE:r>gy.ALL&&(r=gy.ALL),t=t||{};function n(i,o){var s=t[i];return typeof s=="function"&&r>=o?s.bind(t):function(){}}return{error:n("error",gy.ERROR),warn:n("warn",gy.WARN),info:n("info",gy.INFO),debug:n("debug",gy.DEBUG),verbose:n("verbose",gy.VERBOSE)}}var Xei=ut(()=>{Bdt()});var lUa,cUa,uUa,$3,joe=ut(()=>{Jei();Xei();Bdt();Uoe();lUa=function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},cUa=function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))},uUa="diag",$3=function(){function r(){function t(o){return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];var l=RS("diag");if(l)return l[o].apply(l,cUa([],lUa(s),!1))}}var n=this,i=function(o,s){var a,l,u;if(s===void 0&&(s={logLevel:gy.INFO}),o===n){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((a=c.stack)!==null&&a!==void 0?a:c.message),!1}typeof s=="number"&&(s={logLevel:s});var d=RS("diag"),p=$ei((l=s.logLevel)!==null&&l!==void 0?l:gy.INFO,o);if(d&&!s.suppressOverrideMessage){var f=(u=new Error().stack)!==null&&u!==void 0?u:"<failed to generate stacktrace>";d.warn("Current logger will be overwritten from "+f),p.warn("Current logger will overwrite one already registered from "+f)}return xD("diag",p,n,!0)};n.setLogger=i,n.disable=function(){DD(uUa,n)},n.createComponentLogger=function(o){return new Yei(o)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return r.instance=function(){return this._instance||(this._instance=new r),this._instance},r}()});var dUa,pUa,Zei,eti=ut(()=>{dUa=function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},pUa=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&r[t],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Zei=function(){function r(t){this._entries=t?new Map(t):new Map}return r.prototype.getEntry=function(t){var n=this._entries.get(t);if(n)return Object.assign({},n)},r.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(t){var n=dUa(t,2),i=n[0],o=n[1];return[i,o]})},r.prototype.setEntry=function(t,n){var i=new r(this._entries);return i._entries.set(t,n),i},r.prototype.removeEntry=function(t){var n=new r(this._entries);return n._entries.delete(t),n},r.prototype.removeEntries=function(){for(var t,n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var s=new r(this._entries);try{for(var a=pUa(i),l=a.next();!l.done;l=a.next()){var u=l.value;s._entries.delete(u)}}catch(c){t={error:c}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return s},r.prototype.clear=function(){return new r},r}()});var tti,rti=ut(()=>{tti=Symbol("BaggageEntryMetadata")});function nti(r){return r===void 0&&(r={}),new Zei(new Map(Object.entries(r)))}function iti(r){return typeof r!="string"&&(fUa.error("Cannot create baggage metadata from unknown type: "+typeof r),r=""),{__TYPE__:tti,toString:function(){return r}}}var fUa,NAr=ut(()=>{joe();eti();rti();fUa=$3.instance()});function nme(r){return Symbol.for(r)}var AUa,Mdt,V7e=ut(()=>{AUa=function(){function r(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(i){return n._currentContext.get(i)},n.setValue=function(i,o){var s=new r(n._currentContext);return s._currentContext.set(i,o),s},n.deleteValue=function(i){var o=new r(n._currentContext);return o._currentContext.delete(i),o}}return r}(),Mdt=new AUa});var kAr,oti,sti=ut(()=>{kAr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],oti=function(){function r(){function t(i){return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];if(console){var a=console[i];if(typeof a!="function"&&(a=console.log),typeof a=="function")return a.apply(console,o)}}}for(var n=0;n<kAr.length;n++)this[kAr[n].n]=t(kAr[n].c)}return r}()});function ati(){return QAr}var Woe,hUa,xdt,gUa,mUa,yUa,bUa,PAr,EUa,CUa,IUa,QAr,vUa,SUa,OUa,wUa,_Ua,TUa,RUa,FAr=ut(()=>{Woe=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[s]=o[s])},r(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");r(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),hUa=function(){function r(){}return r.prototype.createGauge=function(t,n){return SUa},r.prototype.createHistogram=function(t,n){return OUa},r.prototype.createCounter=function(t,n){return vUa},r.prototype.createUpDownCounter=function(t,n){return wUa},r.prototype.createObservableGauge=function(t,n){return TUa},r.prototype.createObservableCounter=function(t,n){return _Ua},r.prototype.createObservableUpDownCounter=function(t,n){return RUa},r.prototype.addBatchObservableCallback=function(t,n){},r.prototype.removeBatchObservableCallback=function(t){},r}(),xdt=function(){function r(){}return r}(),gUa=function(r){Woe(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.add=function(n,i){},t}(xdt),mUa=function(r){Woe(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.add=function(n,i){},t}(xdt),yUa=function(r){Woe(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.record=function(n,i){},t}(xdt),bUa=function(r){Woe(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.record=function(n,i){},t}(xdt),PAr=function(){function r(){}return r.prototype.addCallback=function(t){},r.prototype.removeCallback=function(t){},r}(),EUa=function(r){Woe(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(PAr),CUa=function(r){Woe(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(PAr),IUa=function(r){Woe(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(PAr),QAr=new hUa,vUa=new gUa,SUa=new yUa,OUa=new bUa,wUa=new mUa,_Ua=new EUa,TUa=new CUa,RUa=new IUa});var Ddt,lti=ut(()=>{(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(Ddt||(Ddt={}))});var Ndt,kdt,LAr=ut(()=>{Ndt={get:function(r,t){if(r!=null)return r[t]},keys:function(r){return r==null?[]:Object.keys(r)}},kdt={set:function(r,t,n){r!=null&&(r[t]=n)}}});var BUa,MUa,cti,uti=ut(()=>{V7e();BUa=function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},MUa=function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))},cti=function(){function r(){}return r.prototype.active=function(){return Mdt},r.prototype.with=function(t,n,i){for(var o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return n.call.apply(n,MUa([i],BUa(o),!1))},r.prototype.bind=function(t,n){return n},r.prototype.enable=function(){return this},r.prototype.disable=function(){return this},r}()});var xUa,DUa,zAr,NUa,GG,H7e=ut(()=>{uti();Uoe();joe();xUa=function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},DUa=function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))},zAr="context",NUa=new cti,GG=function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalContextManager=function(t){return xD(zAr,t,$3.instance())},r.prototype.active=function(){return this._getContextManager().active()},r.prototype.with=function(t,n,i){for(var o,s=[],a=3;a<arguments.length;a++)s[a-3]=arguments[a];return(o=this._getContextManager()).with.apply(o,DUa([t,n,i],xUa(s),!1))},r.prototype.bind=function(t,n){return this._getContextManager().bind(t,n)},r.prototype._getContextManager=function(){return RS(zAr)||NUa},r.prototype.disable=function(){this._getContextManager().disable(),DD(zAr,$3.instance())},r}()});var ime,qAr=ut(()=>{(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(ime||(ime={}))});var K7e,Y7e,Pdt,Qdt=ut(()=>{qAr();K7e="0000000000000000",Y7e="00000000000000000000000000000000",Pdt={traceId:Y7e,spanId:K7e,traceFlags:ime.NONE}});var VG,Fdt=ut(()=>{Qdt();VG=function(){function r(t){t===void 0&&(t=Pdt),this._spanContext=t}return r.prototype.spanContext=function(){return this._spanContext},r.prototype.setAttribute=function(t,n){return this},r.prototype.setAttributes=function(t){return this},r.prototype.addEvent=function(t,n){return this},r.prototype.addLink=function(t){return this},r.prototype.addLinks=function(t){return this},r.prototype.setStatus=function(t){return this},r.prototype.updateName=function(t){return this},r.prototype.end=function(t){},r.prototype.isRecording=function(){return!1},r.prototype.recordException=function(t,n){},r}()});function Ldt(r){return r.getValue(UAr)||void 0}function dti(){return Ldt(GG.getInstance().active())}function J7e(r,t){return r.setValue(UAr,t)}function pti(r){return r.deleteValue(UAr)}function fti(r,t){return J7e(r,new VG(t))}function zdt(r){var t;return(t=Ldt(r))===null||t===void 0?void 0:t.spanContext()}var UAr,jAr=ut(()=>{V7e();Fdt();H7e();UAr=nme("OpenTelemetry Context Key SPAN")});function WAr(r){return kUa.test(r)&&r!==Y7e}function GAr(r){return PUa.test(r)&&r!==K7e}function ome(r){return WAr(r.traceId)&&GAr(r.spanId)}function Ati(r){return new VG(r)}var kUa,PUa,qdt=ut(()=>{Qdt();Fdt();kUa=/^([0-9a-f]{32})$/i,PUa=/^[0-9a-f]{16}$/i});function QUa(r){return typeof r=="object"&&typeof r.spanId=="string"&&typeof r.traceId=="string"&&typeof r.traceFlags=="number"}var VAr,Udt,HAr=ut(()=>{H7e();jAr();Fdt();qdt();VAr=GG.getInstance(),Udt=function(){function r(){}return r.prototype.startSpan=function(t,n,i){i===void 0&&(i=VAr.active());var o=!!n?.root;if(o)return new VG;var s=i&&zdt(i);return QUa(s)&&ome(s)?new VG(s):new VG},r.prototype.startActiveSpan=function(t,n,i,o){var s,a,l;if(!(arguments.length<2)){arguments.length===2?l=n:arguments.length===3?(s=n,l=i):(s=n,a=i,l=o);var u=a??VAr.active(),c=this.startSpan(t,s,u),d=J7e(u,c);return VAr.with(d,l,void 0,c)}},r}()});var FUa,jdt,KAr=ut(()=>{HAr();FUa=new Udt,jdt=function(){function r(t,n,i,o){this._provider=t,this.name=n,this.version=i,this.options=o}return r.prototype.startSpan=function(t,n,i){return this._getTracer().startSpan(t,n,i)},r.prototype.startActiveSpan=function(t,n,i,o){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},r.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):FUa},r}()});var hti,gti=ut(()=>{HAr();hti=function(){function r(){}return r.prototype.getTracer=function(t,n,i){return new Udt},r}()});var LUa,$7e,YAr=ut(()=>{KAr();gti();LUa=new hti,$7e=function(){function r(){}return r.prototype.getTracer=function(t,n,i){var o;return(o=this.getDelegateTracer(t,n,i))!==null&&o!==void 0?o:new jdt(this,t,n,i)},r.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:LUa},r.prototype.setDelegate=function(t){this._delegate=t},r.prototype.getDelegateTracer=function(t,n,i){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(t,n,i)},r}()});var Wdt,mti=ut(()=>{(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Wdt||(Wdt={}))});var Gdt,yti=ut(()=>{(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(Gdt||(Gdt={}))});var Vdt,bti=ut(()=>{(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(Vdt||(Vdt={}))});function Eti(r){return UUa.test(r)}function Cti(r){return jUa.test(r)&&!WUa.test(r)}var JAr,zUa,qUa,UUa,jUa,WUa,Iti=ut(()=>{JAr="[_0-9a-z-*/]",zUa="[a-z]"+JAr+"{0,255}",qUa="[a-z0-9]"+JAr+"{0,240}@[a-z]"+JAr+"{0,13}",UUa=new RegExp("^(?:"+zUa+"|"+qUa+")$"),jUa=/^[ -~]{0,255}[!-~]$/,WUa=/,|=/});var vti,GUa,Sti,Oti,wti,_ti=ut(()=>{Iti();vti=32,GUa=512,Sti=",",Oti="=",wti=function(){function r(t){this._internalState=new Map,t&&this._parse(t)}return r.prototype.set=function(t,n){var i=this._clone();return i._internalState.has(t)&&i._internalState.delete(t),i._internalState.set(t,n),i},r.prototype.unset=function(t){var n=this._clone();return n._internalState.delete(t),n},r.prototype.get=function(t){return this._internalState.get(t)},r.prototype.serialize=function(){var t=this;return this._keys().reduce(function(n,i){return n.push(i+Oti+t.get(i)),n},[]).join(Sti)},r.prototype._parse=function(t){t.length>GUa||(this._internalState=t.split(Sti).reverse().reduce(function(n,i){var o=i.trim(),s=o.indexOf(Oti);if(s!==-1){var a=o.slice(0,s),l=o.slice(s+1,i.length);Eti(a)&&Cti(l)&&n.set(a,l)}return n},new Map),this._internalState.size>vti&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,vti))))},r.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},r.prototype._clone=function(){var t=new r;return t._internalState=new Map(this._internalState),t},r}()});function Tti(r){return new wti(r)}var Rti=ut(()=>{_ti()});var $Ar,Bti=ut(()=>{H7e();$Ar=GG.getInstance()});var XAr,Mti=ut(()=>{joe();XAr=$3.instance()});var VUa,xti,Dti=ut(()=>{FAr();VUa=function(){function r(){}return r.prototype.getMeter=function(t,n,i){return QAr},r}(),xti=new VUa});var ZAr,Nti,kti=ut(()=>{Dti();Uoe();joe();ZAr="metrics",Nti=function(){function r(){}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalMeterProvider=function(t){return xD(ZAr,t,$3.instance())},r.prototype.getMeterProvider=function(){return RS(ZAr)||xti},r.prototype.getMeter=function(t,n,i){return this.getMeterProvider().getMeter(t,n,i)},r.prototype.disable=function(){DD(ZAr,$3.instance())},r}()});var ehr,Pti=ut(()=>{kti();ehr=Nti.getInstance()});var Qti,Fti=ut(()=>{Qti=function(){function r(){}return r.prototype.inject=function(t,n){},r.prototype.extract=function(t,n){return t},r.prototype.fields=function(){return[]},r}()});function rhr(r){return r.getValue(thr)||void 0}function Lti(){return rhr(GG.getInstance().active())}function zti(r,t){return r.setValue(thr,t)}function qti(r){return r.deleteValue(thr)}var thr,Uti=ut(()=>{H7e();V7e();thr=nme("OpenTelemetry Baggage Key")});var nhr,HUa,jti,Wti=ut(()=>{Uoe();Fti();LAr();Uti();NAr();joe();nhr="propagation",HUa=new Qti,jti=function(){function r(){this.createBaggage=nti,this.getBaggage=rhr,this.getActiveBaggage=Lti,this.setBaggage=zti,this.deleteBaggage=qti}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalPropagator=function(t){return xD(nhr,t,$3.instance())},r.prototype.inject=function(t,n,i){return i===void 0&&(i=kdt),this._getGlobalPropagator().inject(t,n,i)},r.prototype.extract=function(t,n,i){return i===void 0&&(i=Ndt),this._getGlobalPropagator().extract(t,n,i)},r.prototype.fields=function(){return this._getGlobalPropagator().fields()},r.prototype.disable=function(){DD(nhr,$3.instance())},r.prototype._getGlobalPropagator=function(){return RS(nhr)||HUa},r}()});var ihr,Gti=ut(()=>{Wti();ihr=jti.getInstance()});var ohr,Vti,Hti=ut(()=>{Uoe();YAr();qdt();jAr();joe();ohr="trace",Vti=function(){function r(){this._proxyTracerProvider=new $7e,this.wrapSpanContext=Ati,this.isSpanContextValid=ome,this.deleteSpan=pti,this.getSpan=Ldt,this.getActiveSpan=dti,this.getSpanContext=zdt,this.setSpan=J7e,this.setSpanContext=fti}return r.getInstance=function(){return this._instance||(this._instance=new r),this._instance},r.prototype.setGlobalTracerProvider=function(t){var n=xD(ohr,this._proxyTracerProvider,$3.instance());return n&&this._proxyTracerProvider.setDelegate(t),n},r.prototype.getTracerProvider=function(){return RS(ohr)||this._proxyTracerProvider},r.prototype.getTracer=function(t,n){return this.getTracerProvider().getTracer(t,n)},r.prototype.disable=function(){DD(ohr,$3.instance()),this._proxyTracerProvider=new $7e},r}()});var BS,Kti=ut(()=>{Hti();BS=Vti.getInstance()});var Yti={};SI(Yti,{DiagConsoleLogger:()=>oti,DiagLogLevel:()=>gy,INVALID_SPANID:()=>K7e,INVALID_SPAN_CONTEXT:()=>Pdt,INVALID_TRACEID:()=>Y7e,ProxyTracer:()=>jdt,ProxyTracerProvider:()=>$7e,ROOT_CONTEXT:()=>Mdt,SamplingDecision:()=>Wdt,SpanKind:()=>Gdt,SpanStatusCode:()=>Vdt,TraceFlags:()=>ime,ValueType:()=>Ddt,baggageEntryMetadataFromString:()=>iti,context:()=>$Ar,createContextKey:()=>nme,createNoopMeter:()=>ati,createTraceState:()=>Tti,default:()=>KUa,defaultTextMapGetter:()=>Ndt,defaultTextMapSetter:()=>kdt,diag:()=>XAr,isSpanContextValid:()=>ome,isValidSpanId:()=>GAr,isValidTraceId:()=>WAr,metrics:()=>ehr,propagation:()=>ihr,trace:()=>BS});var KUa,Goe=ut(()=>{NAr();V7e();sti();Bdt();FAr();lti();LAr();KAr();YAr();mti();yti();bti();qAr();Rti();qdt();Qdt();Bti();Mti();Pti();Gti();Kti();KUa={context:$Ar,diag:XAr,metrics:ehr,propagation:ihr,trace:BS}});function $Ua(){let r,t;return{promise:new Promise((n,i)=>{r=n,t=i}),resolve:r,reject:t}}function XUa(r,t){return[...r,t]}function ZUa(r,t){return[...r.slice(0,t),...r.slice(t+1)]}function eja(r,t){let n=r.indexOf(t);return n!==-1?ZUa(r,n):r}var $ti,shr,YUa,JUa,Hdt,ahr=ut(()=>{shr=new WeakMap,YUa=()=>{},JUa=class HG{constructor(t){this.subscribers=[],this.settlement=null,this[$ti]="Unpromise",t instanceof Promise?this.promise=t:this.promise=new Promise(t),this.promise.then(n=>{let{subscribers:i}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:n},i?.forEach(({resolve:o})=>{o(n)})}).catch(n=>{let{subscribers:i}=this;this.subscribers=null,this.settlement={status:"rejected",reason:n},i?.forEach(({reject:o})=>{o(n)})})}subscribe(){let t,n,{settlement:i}=this;if(i===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");let o=$Ua();this.subscribers=XUa(this.subscribers,o),t=o.promise,n=()=>{this.subscribers!==null&&(this.subscribers=eja(this.subscribers,o))}}else{let{status:o}=i;o==="fulfilled"?t=Promise.resolve(i.value):t=Promise.reject(i.reason),n=YUa}return Object.assign(t,{unsubscribe:n})}then(t,n){let i=this.subscribe(),{unsubscribe:o}=i;return Object.assign(i.then(t,n),{unsubscribe:o})}catch(t){let n=this.subscribe(),{unsubscribe:i}=n;return Object.assign(n.catch(t),{unsubscribe:i})}finally(t){let n=this.subscribe(),{unsubscribe:i}=n;return Object.assign(n.finally(t),{unsubscribe:i})}static proxy(t){let n=HG.getSubscribablePromise(t);return typeof n<"u"?n:HG.createSubscribablePromise(t)}static createSubscribablePromise(t){let n=new HG(t);return shr.set(t,n),shr.set(n,n),n}static getSubscribablePromise(t){return shr.get(t)}static resolve(t){return HG.proxy(t).subscribe()}static async any(t){let n=t.map(HG.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:i})=>{i()})}}static async race(t){let n=t.map(HG.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:i})=>{i()})}}static async raceSingletons(t){let n=t.map(i=>HG.proxy(i).then(()=>[i]));try{return await Promise.race(n)}finally{for(let i of n)i.unsubscribe()}}};$ti=Symbol.toStringTag;Hdt=JUa});var Voe,Pm,tja,Xti=ut(()=>{"use strict";fr();ahr();Cot();Voe=class extends ft{},Pm=async(r,t,n)=>{let i=tja(r),o=i.promise.then(()=>{throw new Voe(t)});return await Hdt.race([n,o]).finally(i.cancel)},tja=r=>{let t=vE(),n=setTimeout(t.resolve,r),i=()=>clearTimeout(n);return{promise:t.promise,cancel:i}}});var obd,Zti=ut(()=>{"use strict";obd=global.setImmediate??setTimeout});var VR=ut(()=>{"use strict";Xti();Zti()});var lhr,eri=ut(()=>{"use strict";QA();lhr=(r,t,n,...i)=>{let o=wc(),s={...t,area:r};o[n](...i,s)}});var KG,Kdt,zw,sme,Ydt=ut(()=>{"use strict";fr();QA();eri();KG=class{valid=!1;failures;originalValue;constructor(t,n){this.originalValue=Dx(t),this.failures=n}get failureMessage(){return this.failures.map(t=>t.path.length>0?`${t.path}: ${t.message}`:t.message).join(`
140
140
  `)}},Kdt=null,zw=class extends ft{code;result;constructor(t,n,i=400){super(t,typeof n=="string"?n:n?.failureMessage),this.result=typeof n=="string"?void 0:n,this.code=i}statusCode(){return this.code}get validationResult(){return this.result}get failureDetails(){return this.result?`${this.message}: ${this.result.failureMessage}`:this.message}},sme=class{constructor(t){this.name=t}is(t){return this.validate(t).valid}assert(t,n){return this.doAssert(t,!0,n)}verify(t,n){let i=!!(n?.throwOnVerify??!1);return this.doAssert(t,i,n)}doAssert(t,n,i){let{logContext:o,logArea:s,failureLogLevel:a,successLogLevel:l,statusCode:u,errorMessage:c}=i||{},d=this.validate(t),p=i?.additionalValidation?.(t)||{valid:!0},f=p.valid?d:p;if(!f.valid){let A=typeof c=="function"?c(f):c??`Found ${f.failures.length} validation failure(s) for ${this.name}`,h=new zw(A,f,u);if(a!==Kdt){let y=t;y&&typeof y=="object"&&(y=Dx(y)),lhr(s,o,a||"error",h,y)}if(n)throw h;return t}return l&&lhr(s,o,l,`${this.name} validation succeeded`,t),f.value}}});var chr,GI,uhr=ut(()=>{"use strict";QA();fr();Ydt();chr=class extends sme{constructor(n,i){super(n);this.runtype=i;if(!i)throw new ft(`Missing runtype for ${n} validator. Did you use a circular import?`)}validate(n){try{let i=this.runtype.validate(n);return i.success?{valid:!0,value:n}:this.createValidationFailedResult(i,n)}catch(i){return wc().error(`RuntypesValidator: Unable to validate ${this.name} value. `,`
141
141
  Error: `,i,`
142
- Value: `,n),new KG(n,[{path:"",message:"value triggered unknown runtypes error"}])}}createValidationFailedResult(n,i){let o=[],s=(a,l)=>{for(let[u,c]of Object.entries(l)){let d=a.concat(u);typeof c=="string"?o.push({path:d.join("."),message:c}):s(d,c)}};if(n.code==="TYPE_INCORRECT"||n.code==="CONSTRAINT_FAILED")o.push({path:"",message:n.message});else{let a=n.details;a&&s([],a)}return new KG(i,o)}},GI=(r,t)=>new chr(r,t)});var phr,rja,nja,dhr,ir,tri=ut(()=>{"use strict";phr=yt(wo());fr();QA();Ydt();Wr();rja=r=>r.code==="unrecognized_keys"?r.keys.length:r.code==="invalid_type"&&r.received==="undefined"&&r.message==="Required"?1:r.code==="invalid_literal"?10:0,nja=r=>phr.default.sum(r.issues.map(t=>rja(t))),dhr=class extends sme{constructor(n,i){super(n);this.zodType=i;if(!i)throw new ft(`Missing Zod type for ${n} validator. Did you use a circular import?`)}convertZodError=n=>{let i=[];for(let o of n.issues)if(o.code==="invalid_union"){let s=phr.default.minBy(o.unionErrors,a=>nja(a));s&&i.push(...this.convertZodError(s))}else i.push({path:o.path.join("."),message:o.message});return i};validate(n){try{let i=this.zodType.safeParse(n);if(i.success)return{valid:!0,value:i.data};let o=this.convertZodError(i.error);return new KG(n,o)}catch(i){let o=i instanceof T.ZodError?[i.flatten(),i.issues]:[];return wc().error(`ZodValidator: Unable to validate ${this.name} value`,"error: ",i,"value: ",n,...o),new KG(n,[{path:"",message:"value triggered unknown Zod error"}])}}},ir=(r,t)=>new dhr(r,t)});var Hoe=ut(()=>{"use strict";uhr();Ydt();tri()});var Xdt,Zdt,ori,Koe=ut(()=>{"use strict";Xdt={emerg:"emerg",info:"info",error:"error",debug:"debug",assert:"assert",warn:"warn",alert:"alert",app:"app"},Zdt={LEVELS:{emerg:0,assert:1,alert:2,error:3,app:4,info:5,debug:6,warn:4},COLORS:{emerg:"red",assert:"yellow",alert:"yellow",warn:"yellow",error:"cyan",app:"blue",info:"green",debug:"magenta"}},ori=["Authorization","Token","Password","Secret","idToken","id_token","clientID","clientSecret","apiKey"]});var Ehr,MS,X7e=ut(()=>{"use strict";Ehr=["ACTUAL_STATE","ADVANCED_DEPLOY","APP","AUTH","BULK_WRITE","CLEANUP_TOOL","CLI","CLI_INTERNAL","COLUMN_LINEAGE","COLUMN_METADATA","COMMON","CONNECTION","DEBUG","DEPLOY","DNS","DOCS","DRAG","ENTITY_API","ENV","ENVIRONMENTS","ERROR_OPERATIONS","FIREBASE","FOLDERS","GIT","GIT_SETTINGS","GOOGLE_DEBUG","GRAPH","HEARTBEAT","INTEGRATIONS","JDBC_SERVICE","JEST","JOBS","JSON_PARSER","LIGHTNING_FS","LISTENERS","MACROS","MAPPING_GRID","METADATA_HYDRATION","METADATA_OPERATIONS","NARROW_METADATA","NODE_TYPES","ORGS","ORG_BOOTSTRAP","ORG_SCANNER","ORG_SETTINGS","ORG_UPGRADE","PACKAGES","PACKAGES_BACKEND","PACKAGE_NAMESPACES","PACKAGE_REGISTRY","PALETTE","PARTNER_CONNECT","PENDO","PERFORMANCE","PIPELINE","PLAN","PLATFORM","PRESYNC","PROBLEM_SCANNER","PROJECTS","RBAC","RENDERER","RUNNER","RUNNER_BACKEND","RUN_RESULTS","RUN_TRANSACTION","SEARCH","SECRETS","SECURE_RUN_AND_WORKSPACE","SQL_PARSING","SQL_TESTING","STATE","STEPS","STORAGE_LOCATIONS","STRUMENTA","SYSTEM_EMAILS","TEMPLATE_EDITOR","TESTING","TIMING_UTILS","TREE_OPERATIONS","TYPESENSE","UI","USERS","USER_ACTIVATION","USER_MANAGEMENT","USER_SETTINGS","VERSIONING","VERSION_CONTROL_ACTIONS","WORKSPACES","XML_PARSER","YAML","ZIP","AI_COLUMN_DESCRIPTIONS","AI_NODE_DESCRIPTIONS","AI_GIT_COMMIT_MESSAGE","AI_COPILOT"],MS={...Object.fromEntries(Ehr.map(r=>[r,{level:"info"}]))}});var Yoe,ame,X3,ept=ut(()=>{"use strict";Yoe=(r,t,n,i,o)=>({orgID:r,workspaceID:t,userID:n,runID:i,nodeID:o}),ame=(r,t)=>{r.runID=t},X3={}});var ari=I(sri=>{"use strict";Object.defineProperty(sri,"__esModule",{value:!0})});var Chr=I(tpt=>{"use strict";Object.defineProperty(tpt,"__esModule",{value:!0});tpt.Failcode=void 0;tpt.Failcode={TYPE_INCORRECT:"TYPE_INCORRECT",VALUE_INCORRECT:"VALUE_INCORRECT",KEY_INCORRECT:"KEY_INCORRECT",CONTENT_INCORRECT:"CONTENT_INCORRECT",ARGUMENT_INCORRECT:"ARGUMENT_INCORRECT",RETURN_INCORRECT:"RETURN_INCORRECT",CONSTRAINT_FAILED:"CONSTRAINT_FAILED",PROPERTY_MISSING:"PROPERTY_MISSING",PROPERTY_PRESENT:"PROPERTY_PRESENT",NOTHING_EXPECTED:"NOTHING_EXPECTED"}});var cme=I(lme=>{"use strict";var aja=lme&&lme.__extends||function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[s]=o[s])},r(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");r(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(lme,"__esModule",{value:!0});lme.ValidationError=void 0;var lja=function(r){aja(t,r);function t(n){var i=r.call(this,n.message)||this;return i.name="ValidationError",i.code=n.code,n.details!==void 0&&(i.details=n.details),Object.setPrototypeOf(i,t.prototype),i}return t}(Error);lme.ValidationError=lja});var Z7e=I(Ihr=>{"use strict";Object.defineProperty(Ihr,"__esModule",{value:!0});var rpt=function(r){return function(t){switch(t.tag){case"literal":return'"'.concat(String(t.value),'"');case"string":return"string";case"brand":return t.brand;case"constraint":return t.name||rpt(r)(t.underlying);case"union":return t.alternatives.map(rpt(r)).join(" | ");case"intersect":return t.intersectees.map(rpt(r)).join(" & ");default:break}return"`${".concat(xS(!1,r)(t),"}`")}},npt=function(r){return function(t){switch(t.tag){case"literal":return String(t.value);case"brand":return"${".concat(t.brand,"}");case"constraint":return t.name?"${".concat(t.name,"}"):npt(r)(t.underlying);case"union":if(t.alternatives.length===1){var n=t.alternatives[0];return npt(r)(n.reflect)}break;case"intersect":if(t.intersectees.length===1){var n=t.intersectees[0];return npt(r)(n.reflect)}break;default:break}return"${".concat(xS(!1,r)(t),"}")}},xS=function(r,t){return function(n){var i=function(c){return r?"(".concat(c,")"):c};if(t.has(n))return i("CIRCULAR ".concat(n.tag));t.add(n);try{switch(n.tag){case"unknown":case"never":case"void":case"boolean":case"number":case"bigint":case"string":case"symbol":case"function":return n.tag;case"literal":{var o=n.value;return typeof o=="string"?'"'.concat(o,'"'):String(o)}case"template":{if(n.strings.length===0)return'""';if(n.strings.length===1)return'"'.concat(n.strings[0],'"');if(n.strings.length===2&&n.strings.every(function(c){return c===""})){var s=n.runtypes[0];return rpt(t)(s.reflect)}var a=!1,l=n.strings.reduce(function(c,d,p){var f=c+d,A=n.runtypes[p];if(A){var h=npt(t)(A.reflect);return!a&&h.startsWith("$")&&(a=!0),f+h}else return f},"");return a?"`".concat(l,"`"):'"'.concat(l,'"')}case"array":return"".concat(lri(n)).concat(xS(!0,t)(n.element),"[]");case"dictionary":return"{ [_: ".concat(n.key,"]: ").concat(xS(!1,t)(n.value)," }");case"record":{var u=Object.keys(n.fields);return u.length?"{ ".concat(u.map(function(c){return"".concat(lri(n)).concat(c).concat(cja(n,c),": ").concat(n.fields[c].tag==="optional"?xS(!1,t)(n.fields[c].underlying):xS(!1,t)(n.fields[c]),";")}).join(" ")," }"):"{}"}case"tuple":return"[".concat(n.components.map(xS(!1,t)).join(", "),"]");case"union":return i("".concat(n.alternatives.map(xS(!0,t)).join(" | ")));case"intersect":return i("".concat(n.intersectees.map(xS(!0,t)).join(" & ")));case"optional":return xS(r,t)(n.underlying)+" | undefined";case"constraint":return n.name||xS(r,t)(n.underlying);case"instanceof":return n.ctor.name;case"brand":return xS(r,t)(n.entity)}}finally{t.delete(n)}throw Error("impossible")}};Ihr.default=xS(!1,new Set);function cja(r,t){var n=r.isPartial,i=r.fields;return n||t!==void 0&&i[t].tag==="optional"?"?":""}function lri(r){var t=r.isReadonly;return t?"readonly ":""}});var v1=I(J0=>{"use strict";var vhr=J0&&J0.__assign||function(){return vhr=Object.assign||function(r){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}return r},vhr.apply(this,arguments)};Object.defineProperty(J0,"__esModule",{value:!0});J0.FAILURE=J0.SUCCESS=J0.enumerableKeysOf=J0.typeOf=J0.hasKey=void 0;var kD=Chr(),Joe=Z7e();function uja(r,t){return typeof t=="object"&&t!==null&&r in t}J0.hasKey=uja;var dja=function(r){var t,n,i;return typeof r=="object"?r===null?"null":Array.isArray(r)?"array":((t=r.constructor)===null||t===void 0?void 0:t.name)==="Object"?"object":(i=(n=r.constructor)===null||n===void 0?void 0:n.name)!==null&&i!==void 0?i:typeof r:typeof r};J0.typeOf=dja;var pja=function(r){return typeof r=="object"&&r!==null?Reflect.ownKeys(r).filter(function(t){var n,i;return(i=(n=r.propertyIsEnumerable)===null||n===void 0?void 0:n.call(r,t))!==null&&i!==void 0?i:!0}):[]};J0.enumerableKeysOf=pja;function fja(r){return{success:!0,value:r}}J0.SUCCESS=fja;J0.FAILURE=Object.assign(function(r,t,n){return vhr({success:!1,code:r,message:t},n?{details:n}:{})},{TYPE_INCORRECT:function(r,t){var n="Expected ".concat(r.tag==="template"?"string ".concat((0,Joe.default)(r)):(0,Joe.default)(r),", but was ").concat((0,J0.typeOf)(t));return(0,J0.FAILURE)(kD.Failcode.TYPE_INCORRECT,n)},VALUE_INCORRECT:function(r,t,n){return(0,J0.FAILURE)(kD.Failcode.VALUE_INCORRECT,"Expected ".concat(r," ").concat(String(t),", but was ").concat(String(n)))},KEY_INCORRECT:function(r,t,n){return(0,J0.FAILURE)(kD.Failcode.KEY_INCORRECT,"Expected ".concat((0,Joe.default)(r)," key to be ").concat((0,Joe.default)(t),", but was ").concat((0,J0.typeOf)(n)))},CONTENT_INCORRECT:function(r,t){var n="Expected ".concat((0,Joe.default)(r),", but was incompatible");return(0,J0.FAILURE)(kD.Failcode.CONTENT_INCORRECT,n,t)},ARGUMENT_INCORRECT:function(r){return(0,J0.FAILURE)(kD.Failcode.ARGUMENT_INCORRECT,r)},RETURN_INCORRECT:function(r){return(0,J0.FAILURE)(kD.Failcode.RETURN_INCORRECT,r)},CONSTRAINT_FAILED:function(r,t){var n=t?": ".concat(t):"";return(0,J0.FAILURE)(kD.Failcode.CONSTRAINT_FAILED,"Failed constraint check for ".concat((0,Joe.default)(r)).concat(n))},PROPERTY_MISSING:function(r){var t="Expected ".concat((0,Joe.default)(r),", but was missing");return(0,J0.FAILURE)(kD.Failcode.PROPERTY_MISSING,t)},PROPERTY_PRESENT:function(r){var t="Expected nothing, but was ".concat((0,J0.typeOf)(r));return(0,J0.FAILURE)(kD.Failcode.PROPERTY_PRESENT,t)},NOTHING_EXPECTED:function(r){var t="Expected nothing, but was ".concat((0,J0.typeOf)(r));return(0,J0.FAILURE)(kD.Failcode.NOTHING_EXPECTED,t)}})});var cri=I(YG=>{"use strict";var Aja=YG&&YG.__read||function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},hja=YG&&YG.__spreadArray||function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))};Object.defineProperty(YG,"__esModule",{value:!0});YG.Contract=void 0;var gja=cme(),mja=v1();function yja(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r.length-1,i=r.slice(0,n),o=r[n];return{enforce:function(s){return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];if(a.length<i.length){var u="Expected ".concat(i.length," arguments but only received ").concat(a.length),c=mja.FAILURE.ARGUMENT_INCORRECT(u);throw new gja.ValidationError(c)}for(var d=0;d<i.length;d++)i[d].check(a[d]);return o.check(s.apply(void 0,hja([],Aja(a),!1)))}}}}YG.Contract=yja});var pri=I(JG=>{"use strict";var bja=JG&&JG.__read||function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},Eja=JG&&JG.__spreadArray||function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))};Object.defineProperty(JG,"__esModule",{value:!0});JG.AsyncContract=void 0;var uri=cme(),dri=v1();function Cja(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r.length-1,i=r.slice(0,n),o=r[n];return{enforce:function(s){return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];if(a.length<i.length){var u="Expected ".concat(i.length," arguments but only received ").concat(a.length),c=dri.FAILURE.ARGUMENT_INCORRECT(u);throw new uri.ValidationError(c)}for(var d=0;d<i.length;d++)i[d].check(a[d]);var p=s.apply(void 0,Eja([],bja(a),!1));if(!(p instanceof Promise)){var u="Expected function to return a promise, but instead got ".concat(p),c=dri.FAILURE.RETURN_INCORRECT(u);throw new uri.ValidationError(c)}return p.then(o.check)}}}}JG.AsyncContract=Cja});var fri=I(PD=>{"use strict";var Ija=PD&&PD.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&r[t],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vja=PD&&PD.__read||function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s};Object.defineProperty(PD,"__esModule",{value:!0});PD.when=PD.match=void 0;function Sja(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return function(n){var i,o;try{for(var s=Ija(r),a=s.next();!a.done;a=s.next()){var l=vja(a.value,2),u=l[0],c=l[1];if(u.guard(n))return c(n)}}catch(d){i={error:d}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}throw new Error("No alternatives were matched")}}PD.match=Sja;function Oja(r,t){return[r,t]}PD.when=Oja});var Kf=I(XG=>{"use strict";Object.defineProperty(XG,"__esModule",{value:!0});XG.innerValidate=XG.create=XG.isRuntype=void 0;var $G=qw(),wja=Z7e(),_ja=cme(),Ari=v1(),hri=Symbol(),Tja=function(r){return(0,Ari.hasKey)(hri,r)};XG.isRuntype=Tja;function Rja(r,t){return t[hri]=!0,t.check=n,t.assert=n,t._innerValidate=function(p,f){return f.has(p,t)?(0,Ari.SUCCESS)(p):r(p,f)},t.validate=function(p){return t._innerValidate(p,Mja())},t.guard=i,t.Or=o,t.And=s,t.optional=a,t.nullable=l,t.withConstraint=u,t.withGuard=c,t.withBrand=d,t.reflect=t,t.toString=function(){return"Runtype<".concat((0,wja.default)(t),">")},t;function n(p){var f=t.validate(p);if(f.success)return f.value;throw new _ja.ValidationError(f)}function i(p){return t.validate(p).success}function o(p){return(0,$G.Union)(t,p)}function s(p){return(0,$G.Intersect)(t,p)}function a(){return(0,$G.Optional)(t)}function l(){return(0,$G.Union)(t,$G.Null)}function u(p,f){return(0,$G.Constraint)(t,p,f)}function c(p,f){return(0,$G.Constraint)(t,p,f)}function d(p){return(0,$G.Brand)(p,t)}}XG.create=Rja;function Bja(r,t,n){return r._innerValidate(t,n)}XG.innerValidate=Bja;function Mja(){var r=new WeakMap,t=function(i,o){if(!(i===null||typeof i!="object")){var s=r.get(i);r.set(i,s?s.set(o,!0):new WeakMap().set(o,!0))}},n=function(i,o){var s=r.get(i),a=s&&s.get(o)||!1;return t(i,o),a};return{has:n}}});var opt=I(ipt=>{"use strict";Object.defineProperty(ipt,"__esModule",{value:!0});ipt.Unknown=void 0;var xja=Kf(),Dja=v1(),Nja={tag:"unknown"};ipt.Unknown=(0,xja.create)(function(r){return(0,Dja.SUCCESS)(r)},Nja)});var gri=I(spt=>{"use strict";Object.defineProperty(spt,"__esModule",{value:!0});spt.Never=void 0;var kja=Kf(),Pja=v1(),Qja={tag:"never"};spt.Never=(0,kja.create)(Pja.FAILURE.NOTHING_EXPECTED,Qja)});var mri=I(apt=>{"use strict";Object.defineProperty(apt,"__esModule",{value:!0});apt.Void=void 0;var Fja=opt();apt.Void=Fja.Unknown});var Shr=I(ume=>{"use strict";var lpt=ume&&ume.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&r[t],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(ume,"__esModule",{value:!0});ume.Union=void 0;var cpt=Kf(),eke=v1();function Lja(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return function(a){for(var l=0;l<r.length;l++)if(r[l].guard(a))return o[l](a)}},i={tag:"union",alternatives:r,match:n};return(0,cpt.create)(function(o,s){var a,l,u,c,d,p,f,A;if(typeof o!="object"||o===null){try{for(var h=lpt(r),y=h.next();!y.done;y=h.next()){var C=y.value;if((0,cpt.innerValidate)(C,o,s).success)return(0,eke.SUCCESS)(o)}}catch(J){a={error:J}}finally{try{y&&!y.done&&(l=h.return)&&l.call(h)}finally{if(a)throw a.error}}return eke.FAILURE.TYPE_INCORRECT(i,o)}var v={};try{for(var w=lpt(r),_=w.next();!_.done;_=w.next()){var C=_.value;if(C.reflect.tag==="record"){var R=function(K){var Q=C.reflect.fields[K];Q.tag==="literal"&&(v[K]?v[K].every(function($){return $!==Q.value})&&v[K].push(Q.value):v[K]=[Q.value])};for(var N in C.reflect.fields)R(N)}}}catch(J){u={error:J}}finally{try{_&&!_.done&&(c=w.return)&&c.call(w)}finally{if(u)throw u.error}}for(var N in v)if(v[N].length===r.length)try{for(var L=(d=void 0,lpt(r)),G=L.next();!G.done;G=L.next()){var C=G.value;if(C.reflect.tag==="record"){var Y=C.reflect.fields[N];if(Y.tag==="literal"&&(0,eke.hasKey)(N,o)&&o[N]===Y.value)return(0,cpt.innerValidate)(C,o,s)}}}catch(K){d={error:K}}finally{try{G&&!G.done&&(p=L.return)&&p.call(L)}finally{if(d)throw d.error}}try{for(var H=lpt(r),V=H.next();!V.done;V=H.next()){var F=V.value;if((0,cpt.innerValidate)(F,o,s).success)return(0,eke.SUCCESS)(o)}}catch(J){f={error:J}}finally{try{V&&!V.done&&(A=H.return)&&A.call(H)}finally{if(f)throw f.error}}return eke.FAILURE.TYPE_INCORRECT(i,o)},i)}ume.Union=Lja});var _hr=I(VI=>{"use strict";Object.defineProperty(VI,"__esModule",{value:!0});VI.Nullish=VI.Null=VI.Undefined=VI.Literal=VI.literal=void 0;var zja=Kf(),yri=v1(),qja=Shr();function Ohr(r){return Array.isArray(r)?String(r.map(String)):typeof r=="bigint"?String(r)+"n":String(r)}VI.literal=Ohr;function whr(r){var t={tag:"literal",value:r};return(0,zja.create)(function(n){return n===r?(0,yri.SUCCESS)(n):yri.FAILURE.VALUE_INCORRECT("literal","`".concat(Ohr(r),"`"),"`".concat(Ohr(n),"`"))},t)}VI.Literal=whr;VI.Undefined=whr(void 0);VI.Null=whr(null);VI.Nullish=(0,qja.Union)(VI.Null,VI.Undefined)});var vri=I(QD=>{"use strict";var ZG=QD&&QD.__read||function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},Thr=QD&&QD.__spreadArray||function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))},bri=QD&&QD.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&r[t],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(QD,"__esModule",{value:!0});QD.Template=void 0;var upt=Kf(),Eri=Z7e(),$F=v1(),Iri=_hr(),Rhr=function(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},Uja=function(r){if(0<r.length&&Array.isArray(r[0])){var t=ZG(r),n=t[0],i=t.slice(1);return[Array.from(n),i]}else{var o=r,n=o.reduce(function(l,u){return(0,upt.isRuntype)(u)?l.push(""):l.push(l.pop()+String(u)),l},[""]),i=o.filter(upt.isRuntype);return[n,i]}},jja=function(r,t){for(var n=0;n<t.length;)switch(t[n].reflect.tag){case"literal":{var i=t[n];t.splice(n,1);var o=String(i.value);r.splice(n,2,r[n]+o+r[n+1]);break}case"template":{var s=t[n];t.splice.apply(t,Thr([n,1],ZG(s.runtypes),!1));var a=s.strings;if(a.length===1)r.splice(n,2,r[n]+a[0]+r[n+1]);else{var l=a[0],u=a.slice(1,-1),c=a[a.length-1];r.splice.apply(r,Thr(Thr([n,2,r[n]+l],ZG(u),!1),[c+r[n+1]],!1))}break}case"union":{var d=t[n];if(d.alternatives.length===1)try{var p=nke(d);t.splice(n,1);var o=String(p.value);r.splice(n,2,r[n]+o+r[n+1]);break}catch{n++;break}else{n++;break}}case"intersect":{var f=t[n];if(f.intersectees.length===1)try{var A=nke(f);t.splice(n,1);var o=String(A.value);r.splice(n,2,r[n]+o+r[n+1]);break}catch{n++;break}else{n++;break}}default:n++;break}},Wja=function(r){var t=ZG(Uja(r),2),n=t[0],i=t[1];return jja(n,i),[n,i]},nke=function(r){switch(r.reflect.tag){case"literal":return r;case"brand":return nke(r.reflect.entity);case"union":if(r.reflect.alternatives.length===1)return nke(r.reflect.alternatives[0]);break;case"intersect":if(r.reflect.intersectees.length===1)return nke(r.reflect.intersectees[0]);break;default:break}throw void 0},Cri=function(r){return r},Bhr={string:[function(r){return globalThis.String(r)},".*"],number:[function(r){return globalThis.Number(r)},"[+-]?(?:\\d*\\.\\d+|\\d+\\.\\d*|\\d+)(?:[Ee][+-]?\\d+)?","0[Bb][01]+","0[Oo][0-7]+","0[Xx][0-9A-Fa-f]+"],bigint:[function(r){return globalThis.BigInt(r)},"-?[1-9]d*"],boolean:[function(r){return r!=="false"},"true","false"],null:[function(){return null},"null"],undefined:[function(){},"undefined"]},tke=function(r){switch(r.tag){case"literal":{var t=ZG(Bhr[(0,$F.typeOf)(r.value)]||[Cri],1),n=t[0];return n}case"brand":return tke(r.entity);case"constraint":return tke(r.underlying);case"union":return r.alternatives.map(tke);case"intersect":return r.intersectees.map(tke);default:var i=ZG(Bhr[r.tag]||[Cri],1),o=i[0];return o}},Mhr=function(r,t){return function(n){var i,o,s,a,l=tke(r);if(Array.isArray(l))switch(r.tag){case"union":try{for(var u=bri(r.alternatives),c=u.next();!c.done;c=u.next()){var d=c.value,p=Mhr(d.reflect,t)(n);if(p.success)return p}}catch(C){i={error:C}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return $F.FAILURE.TYPE_INCORRECT(r,n);case"intersect":try{for(var f=bri(r.intersectees),A=f.next();!A.done;A=f.next()){var h=A.value,p=Mhr(h.reflect,t)(n);if(!p.success)return p}}catch(C){s={error:C}}finally{try{A&&!A.done&&(a=f.return)&&a.call(f)}finally{if(s)throw s.error}}return(0,$F.SUCCESS)(n);default:throw Error("impossible")}else{var y=l,p=(0,upt.innerValidate)(r,y(n),t);return!p.success&&p.code==="VALUE_INCORRECT"&&r.tag==="literal"?$F.FAILURE.VALUE_INCORRECT("literal",'"'.concat((0,Iri.literal)(r.value),'"'),'"'.concat(n,'"')):p}}},rke=function(r){switch(r.tag){case"literal":return Rhr(String(r.value));case"brand":return rke(r.entity);case"constraint":return rke(r.underlying);case"union":return r.alternatives.map(rke).join("|");case"template":return r.strings.map(Rhr).reduce(function(i,o,s){var a=i+o,l=r.runtypes[s];return l?a+"(?:".concat(rke(l.reflect),")"):a},"");default:var t=ZG(Bhr[r.tag]||[void 0,".*"]),n=t.slice(1);return n.join("|")}},Gja=function(r){var t=r.strings.map(Rhr).reduce(function(n,i,o){var s=n+i,a=r.runtypes[o];return a?s+"(".concat(rke(a.reflect),")"):s},"");return new RegExp("^".concat(t,"$"),"su")};function Vja(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=ZG(Wja(r),2),i=n[0],o=n[1],s={tag:"template",strings:i,runtypes:o},a=Gja(s),l=function(u,c){var d=u.match(a);if(d){for(var p=d.slice(1),f=0;f<o.length;f++){var A=o[f],h=p[f],y=Mhr(A.reflect,c)(h);if(!y.success)return y}return(0,$F.SUCCESS)(u)}else return $F.FAILURE.VALUE_INCORRECT("string","".concat((0,Eri.default)(s)),'"'.concat((0,Iri.literal)(u),'"'))};return(0,upt.create)(function(u,c){if(typeof u!="string")return $F.FAILURE.TYPE_INCORRECT(s,u);var d=l(u,c);if(d.success)return(0,$F.SUCCESS)(u);var p=$F.FAILURE.VALUE_INCORRECT("string","".concat((0,Eri.default)(s)),'"'.concat(u,'"'));return p.message!==d.message&&(p.message+=" (inner: ".concat(d.message,")")),p},s)}QD.Template=Vja});var wri=I(dpt=>{"use strict";Object.defineProperty(dpt,"__esModule",{value:!0});dpt.Boolean=void 0;var Hja=Kf(),Sri=v1(),Ori={tag:"boolean"};dpt.Boolean=(0,Hja.create)(function(r){return typeof r=="boolean"?(0,Sri.SUCCESS)(r):Sri.FAILURE.TYPE_INCORRECT(Ori,r)},Ori)});var Rri=I(ppt=>{"use strict";Object.defineProperty(ppt,"__esModule",{value:!0});ppt.Number=void 0;var Kja=Kf(),_ri=v1(),Tri={tag:"number"};ppt.Number=(0,Kja.create)(function(r){return typeof r=="number"?(0,_ri.SUCCESS)(r):_ri.FAILURE.TYPE_INCORRECT(Tri,r)},Tri)});var xri=I(fpt=>{"use strict";Object.defineProperty(fpt,"__esModule",{value:!0});fpt.BigInt=void 0;var Yja=Kf(),Bri=v1(),Mri={tag:"bigint"};fpt.BigInt=(0,Yja.create)(function(r){return typeof r=="bigint"?(0,Bri.SUCCESS)(r):Bri.FAILURE.TYPE_INCORRECT(Mri,r)},Mri)});var xhr=I(Apt=>{"use strict";Object.defineProperty(Apt,"__esModule",{value:!0});Apt.String=void 0;var Jja=Kf(),Dri=v1(),Nri={tag:"string"};Apt.String=(0,Jja.create)(function(r){return typeof r=="string"?(0,Dri.SUCCESS)(r):Dri.FAILURE.TYPE_INCORRECT(Nri,r)},Nri)});var Fri=I(hpt=>{"use strict";Object.defineProperty(hpt,"__esModule",{value:!0});hpt.Symbol=void 0;var Qri=Kf(),ike=v1(),$ja=function(r){var t={tag:"symbol",key:r};return(0,Qri.create)(function(n){if(typeof n!="symbol")return ike.FAILURE.TYPE_INCORRECT(t,n);var i=globalThis.Symbol.keyFor(n);return i!==r?ike.FAILURE.VALUE_INCORRECT("symbol key",Pri(r),Pri(i)):(0,ike.SUCCESS)(n)},t)},kri={tag:"symbol"};hpt.Symbol=(0,Qri.create)(function(r){return typeof r=="symbol"?(0,ike.SUCCESS)(r):ike.FAILURE.TYPE_INCORRECT(kri,r)},Object.assign($ja,kri));var Pri=function(r){return r===void 0?"undefined":'"'.concat(r,'"')}});var qri=I(gpt=>{"use strict";Object.defineProperty(gpt,"__esModule",{value:!0});gpt.Array=void 0;var Lri=Kf(),oke=v1();function zri(r,t){var n={tag:"array",isReadonly:t,element:r};return Zja((0,Lri.create)(function(i,o){if(!Array.isArray(i))return oke.FAILURE.TYPE_INCORRECT(n,i);var s=(0,oke.enumerableKeysOf)(i),a=s.map(function(u){return(0,Lri.innerValidate)(r,i[u],o)}),l=s.reduce(function(u,c){var d=a[c];return d.success||(u[c]=d.details||d.message),u},[]);return(0,oke.enumerableKeysOf)(l).length!==0?oke.FAILURE.CONTENT_INCORRECT(n,l):(0,oke.SUCCESS)(i)},n))}function Xja(r){return zri(r,!1)}gpt.Array=Xja;function Zja(r){return r.asReadonly=t,r;function t(){return zri(r.element,!0)}}});var jri=I(mpt=>{"use strict";Object.defineProperty(mpt,"__esModule",{value:!0});mpt.Tuple=void 0;var Uri=Kf(),dme=v1();function eWa(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n={tag:"tuple",components:r};return(0,Uri.create)(function(i,o){if(!Array.isArray(i))return dme.FAILURE.TYPE_INCORRECT(n,i);if(i.length!==r.length)return dme.FAILURE.CONSTRAINT_FAILED(n,"Expected length ".concat(r.length,", but was ").concat(i.length));var s=(0,dme.enumerableKeysOf)(i),a=s.map(function(u){return(0,Uri.innerValidate)(r[u],i[u],o)}),l=s.reduce(function(u,c){var d=a[c];return d.success||(u[c]=d.details||d.message),u},[]);return(0,dme.enumerableKeysOf)(l).length!==0?dme.FAILURE.CONTENT_INCORRECT(n,l):(0,dme.SUCCESS)(i)},n)}mpt.Tuple=eWa});var Gri=I(Uw=>{"use strict";var Dhr=Uw&&Uw.__read||function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},Nhr=Uw&&Uw.__spreadArray||function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))};Object.defineProperty(Uw,"__esModule",{value:!0});Uw.Partial=Uw.Record=Uw.InternalRecord=void 0;var Wri=Kf(),HI=v1();function eV(r,t,n){var i={tag:"record",isPartial:t,isReadonly:n,fields:r};return nWa((0,Wri.create)(function(o,s){if(o==null)return HI.FAILURE.TYPE_INCORRECT(i,o);var a=(0,HI.enumerableKeysOf)(r);if(a.length!==0&&typeof o!="object")return HI.FAILURE.TYPE_INCORRECT(i,o);var l=Nhr([],Dhr(new Set(Nhr(Nhr([],Dhr(a),!1),Dhr((0,HI.enumerableKeysOf)(o)),!1))),!1),u=l.reduce(function(d,p){var f=(0,HI.hasKey)(p,r),A=(0,HI.hasKey)(p,o);if(f){var h=r[p],y=t||h.reflect.tag==="optional";if(A){var C=o[p];y&&C===void 0?d[p]=(0,HI.SUCCESS)(C):d[p]=(0,Wri.innerValidate)(h,C,s)}else y?d[p]=(0,HI.SUCCESS)(void 0):d[p]=HI.FAILURE.PROPERTY_MISSING(h.reflect)}else if(A){var C=o[p];d[p]=(0,HI.SUCCESS)(C)}else throw new Error("impossible");return d},{}),c=l.reduce(function(d,p){var f=u[p];return f.success||(d[p]=f.details||f.message),d},{});return(0,HI.enumerableKeysOf)(c).length!==0?HI.FAILURE.CONTENT_INCORRECT(i,c):(0,HI.SUCCESS)(o)},i))}Uw.InternalRecord=eV;function tWa(r){return eV(r,!1,!1)}Uw.Record=tWa;function rWa(r){return eV(r,!0,!1)}Uw.Partial=rWa;function nWa(r){return r.asPartial=t,r.asReadonly=n,r.pick=i,r.omit=o,r.extend=s,r;function t(){return eV(r.fields,!0,r.isReadonly)}function n(){return eV(r.fields,r.isPartial,!0)}function i(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u={};return a.forEach(function(c){u[c]=r.fields[c]}),eV(u,r.isPartial,r.isReadonly)}function o(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u={},c=(0,HI.enumerableKeysOf)(r.fields);return c.forEach(function(d){a.includes(d)||(u[d]=r.fields[d])}),eV(u,r.isPartial,r.isReadonly)}function s(a){return eV(Object.assign({},r.fields,a),r.isPartial,r.isReadonly)}}});var Phr=I(pme=>{"use strict";Object.defineProperty(pme,"__esModule",{value:!0});pme.Guard=pme.Constraint=void 0;var iWa=Kf(),khr=v1(),oWa=opt();function sWa(r,t,n){var i=n&&n.name,o=n&&n.args,s={tag:"constraint",underlying:r,constraint:t,name:i,args:o};return(0,iWa.create)(function(a){var l=r.validate(a);if(!l.success)return l;var u=t(l.value);return typeof u=="string"?khr.FAILURE.CONSTRAINT_FAILED(s,u):u?(0,khr.SUCCESS)(l.value):khr.FAILURE.CONSTRAINT_FAILED(s)},s)}pme.Constraint=sWa;var aWa=function(r,t){return oWa.Unknown.withGuard(r,t)};pme.Guard=aWa});var Hri=I(ypt=>{"use strict";Object.defineProperty(ypt,"__esModule",{value:!0});ypt.Dictionary=void 0;var Vri=Kf(),Qhr=xhr(),lWa=Phr(),cWa=Z7e(),$oe=v1(),uWa=(0,lWa.Constraint)(Qhr.String,function(r){return!isNaN(+r)},{name:"number"});function dWa(r,t){var n=t===void 0||t==="string"?Qhr.String:t==="number"?uWa:t,i=(0,cWa.default)(n),o={tag:"dictionary",key:i,value:r};return(0,Vri.create)(function(s,a){if(s==null||typeof s!="object"||Object.getPrototypeOf(s)!==Object.prototype&&(!Array.isArray(s)||i==="string"))return $oe.FAILURE.TYPE_INCORRECT(o,s);var l=/^(?:NaN|-?\d+(?:\.\d+)?)$/,u=(0,$oe.enumerableKeysOf)(s),c=u.reduce(function(p,f){var A=typeof f=="string"&&l.test(f),h=A?globalThis.Number(f):f;return(A?!n.guard(h)&&!n.guard(f):!n.guard(h))?p[f]=$oe.FAILURE.KEY_INCORRECT(o,n.reflect,h):p[f]=(0,Vri.innerValidate)(r,s[f],a),p},{}),d=u.reduce(function(p,f){var A=c[f];return A.success||(p[f]=A.details||A.message),p},{});return(0,$oe.enumerableKeysOf)(d).length!==0?$oe.FAILURE.CONTENT_INCORRECT(o,d):(0,$oe.SUCCESS)(s)},o)}ypt.Dictionary=dWa});var Yri=I(fme=>{"use strict";var pWa=fme&&fme.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&r[t],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(fme,"__esModule",{value:!0});fme.Intersect=void 0;var Kri=Kf(),fWa=v1();function AWa(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n={tag:"intersect",intersectees:r};return(0,Kri.create)(function(i,o){var s,a;try{for(var l=pWa(r),u=l.next();!u.done;u=l.next()){var c=u.value,d=(0,Kri.innerValidate)(c,i,o);if(!d.success)return d}}catch(p){s={error:p}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(s)throw s.error}}return(0,fWa.SUCCESS)(i)},n)}fme.Intersect=AWa});var Jri=I(bpt=>{"use strict";Object.defineProperty(bpt,"__esModule",{value:!0});bpt.Optional=void 0;var hWa=Kf(),gWa=v1();function mWa(r){var t={tag:"optional",underlying:r};return(0,hWa.create)(function(n){return n===void 0?(0,gWa.SUCCESS)(n):r.validate(n)},t)}bpt.Optional=mWa});var Zri=I(Ept=>{"use strict";Object.defineProperty(Ept,"__esModule",{value:!0});Ept.Function=void 0;var yWa=Kf(),$ri=v1(),Xri={tag:"function"};Ept.Function=(0,yWa.create)(function(r){return typeof r=="function"?(0,$ri.SUCCESS)(r):$ri.FAILURE.TYPE_INCORRECT(Xri,r)},Xri)});var tni=I(Cpt=>{"use strict";Object.defineProperty(Cpt,"__esModule",{value:!0});Cpt.InstanceOf=void 0;var bWa=Kf(),eni=v1();function EWa(r){var t={tag:"instanceof",ctor:r};return(0,bWa.create)(function(n){return n instanceof r?(0,eni.SUCCESS)(n):eni.FAILURE.TYPE_INCORRECT(t,n)},t)}Cpt.InstanceOf=EWa});var rni=I(Ipt=>{"use strict";Object.defineProperty(Ipt,"__esModule",{value:!0});Ipt.Lazy=void 0;var CWa=Kf();function IWa(r){var t={get tag(){return i().tag}},n;function i(){if(!n){n=r();for(var o in n)o!=="tag"&&(t[o]=n[o])}return n}return(0,CWa.create)(function(o){return i().validate(o)},t)}Ipt.Lazy=IWa});var nni=I(vpt=>{"use strict";Object.defineProperty(vpt,"__esModule",{value:!0});vpt.Brand=void 0;var vWa=Kf();function SWa(r,t){var n={tag:"brand",brand:r,entity:t};return(0,vWa.create)(function(i){return t.validate(i)},n)}vpt.Brand=SWa});var ini=I(Ame=>{"use strict";Object.defineProperty(Ame,"__esModule",{value:!0});Ame.checked=Ame.check=void 0;var OWa=cme(),wWa=v1(),Fhr=new WeakMap;function _Wa(r,t,n){var i=Fhr.get(r)||new Map;Fhr.set(r,i);var o=i.get(t)||[];i.set(t,o),o.push(n)}Ame.check=_Wa;function TWa(r,t,n){var i=Fhr.get(r),o=i&&i.get(t);if(o)return o;for(var s=[],a=0;a<n;a++)s.push(a);return s}function RWa(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];if(r.length===0)throw new Error("No runtype provided to `@checked`. Please remove the decorator.");return function(n,i,o){var s=o.value,a=(n.name||n.constructor.name+".prototype")+(typeof i=="string"?'["'.concat(i,'"]'):"[".concat(String(i),"]")),l=TWa(n,i,r.length);if(l.length!==r.length)throw new Error("Number of `@checked` runtypes and @check parameters not matched.");if(l.length>s.length)throw new Error("Number of `@checked` runtypes exceeds actual parameter length.");o.value=function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return r.forEach(function(d,p){var f=l[p],A=d.validate(u[f]);if(!A.success){var h="".concat(a,", argument #").concat(f,": ").concat(A.message),y=wWa.FAILURE.ARGUMENT_INCORRECT(h);throw new OWa.ValidationError(y)}}),s.apply(this,u)}}}Ame.checked=RWa});var qw=I(Ga=>{"use strict";var BWa=Ga&&Ga.__createBinding||(Object.create?function(r,t,n,i){i===void 0&&(i=n),Object.defineProperty(r,i,{enumerable:!0,get:function(){return t[n]}})}:function(r,t,n,i){i===void 0&&(i=n),r[i]=t[n]}),Ed=Ga&&Ga.__exportStar||function(r,t){for(var n in r)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&BWa(t,r,n)};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.InstanceOf=Ga.Nullish=Ga.Null=Ga.Undefined=Ga.Literal=void 0;Ed(ari(),Ga);Ed(Chr(),Ga);Ed(cri(),Ga);Ed(pri(),Ga);Ed(fri(),Ga);Ed(cme(),Ga);Ed(opt(),Ga);Ed(gri(),Ga);Ed(mri(),Ga);var Spt=_hr();Object.defineProperty(Ga,"Literal",{enumerable:!0,get:function(){return Spt.Literal}});Object.defineProperty(Ga,"Undefined",{enumerable:!0,get:function(){return Spt.Undefined}});Object.defineProperty(Ga,"Null",{enumerable:!0,get:function(){return Spt.Null}});Object.defineProperty(Ga,"Nullish",{enumerable:!0,get:function(){return Spt.Nullish}});Ed(vri(),Ga);Ed(wri(),Ga);Ed(Rri(),Ga);Ed(xri(),Ga);Ed(xhr(),Ga);Ed(Fri(),Ga);Ed(qri(),Ga);Ed(jri(),Ga);Ed(Gri(),Ga);Ed(Hri(),Ga);Ed(Shr(),Ga);Ed(Yri(),Ga);Ed(Jri(),Ga);Ed(Zri(),Ga);var MWa=tni();Object.defineProperty(Ga,"InstanceOf",{enumerable:!0,get:function(){return MWa.InstanceOf}});Ed(rni(),Ga);Ed(Phr(),Ga);Ed(nni(),Ga);Ed(ini(),Ga)});var ske=I((CEd,oni)=>{var xWa="2.0.0",DWa=Number.MAX_SAFE_INTEGER||9007199254740991,NWa=16,kWa=250,PWa=["major","premajor","minor","preminor","patch","prepatch","prerelease"];oni.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:NWa,MAX_SAFE_BUILD_LENGTH:kWa,MAX_SAFE_INTEGER:DWa,RELEASE_TYPES:PWa,SEMVER_SPEC_VERSION:xWa,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ake=I((IEd,sni)=>{var QWa=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};sni.exports=QWa});var hme=I((XF,ani)=>{var{MAX_SAFE_COMPONENT_LENGTH:Lhr,MAX_SAFE_BUILD_LENGTH:FWa,MAX_LENGTH:LWa}=ske(),zWa=ake();XF=ani.exports={};var qWa=XF.re=[],UWa=XF.safeRe=[],Go=XF.src=[],Vo=XF.t={},jWa=0,zhr="[a-zA-Z0-9-]",WWa=[["\\s",1],["\\d",LWa],[zhr,FWa]],GWa=r=>{for(let[t,n]of WWa)r=r.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return r},Bl=(r,t,n)=>{let i=GWa(t),o=jWa++;zWa(r,o,t),Vo[r]=o,Go[o]=t,qWa[o]=new RegExp(t,n?"g":void 0),UWa[o]=new RegExp(i,n?"g":void 0)};Bl("NUMERICIDENTIFIER","0|[1-9]\\d*");Bl("NUMERICIDENTIFIERLOOSE","\\d+");Bl("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${zhr}*`);Bl("MAINVERSION",`(${Go[Vo.NUMERICIDENTIFIER]})\\.(${Go[Vo.NUMERICIDENTIFIER]})\\.(${Go[Vo.NUMERICIDENTIFIER]})`);Bl("MAINVERSIONLOOSE",`(${Go[Vo.NUMERICIDENTIFIERLOOSE]})\\.(${Go[Vo.NUMERICIDENTIFIERLOOSE]})\\.(${Go[Vo.NUMERICIDENTIFIERLOOSE]})`);Bl("PRERELEASEIDENTIFIER",`(?:${Go[Vo.NUMERICIDENTIFIER]}|${Go[Vo.NONNUMERICIDENTIFIER]})`);Bl("PRERELEASEIDENTIFIERLOOSE",`(?:${Go[Vo.NUMERICIDENTIFIERLOOSE]}|${Go[Vo.NONNUMERICIDENTIFIER]})`);Bl("PRERELEASE",`(?:-(${Go[Vo.PRERELEASEIDENTIFIER]}(?:\\.${Go[Vo.PRERELEASEIDENTIFIER]})*))`);Bl("PRERELEASELOOSE",`(?:-?(${Go[Vo.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Go[Vo.PRERELEASEIDENTIFIERLOOSE]})*))`);Bl("BUILDIDENTIFIER",`${zhr}+`);Bl("BUILD",`(?:\\+(${Go[Vo.BUILDIDENTIFIER]}(?:\\.${Go[Vo.BUILDIDENTIFIER]})*))`);Bl("FULLPLAIN",`v?${Go[Vo.MAINVERSION]}${Go[Vo.PRERELEASE]}?${Go[Vo.BUILD]}?`);Bl("FULL",`^${Go[Vo.FULLPLAIN]}$`);Bl("LOOSEPLAIN",`[v=\\s]*${Go[Vo.MAINVERSIONLOOSE]}${Go[Vo.PRERELEASELOOSE]}?${Go[Vo.BUILD]}?`);Bl("LOOSE",`^${Go[Vo.LOOSEPLAIN]}$`);Bl("GTLT","((?:<|>)?=?)");Bl("XRANGEIDENTIFIERLOOSE",`${Go[Vo.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Bl("XRANGEIDENTIFIER",`${Go[Vo.NUMERICIDENTIFIER]}|x|X|\\*`);Bl("XRANGEPLAIN",`[v=\\s]*(${Go[Vo.XRANGEIDENTIFIER]})(?:\\.(${Go[Vo.XRANGEIDENTIFIER]})(?:\\.(${Go[Vo.XRANGEIDENTIFIER]})(?:${Go[Vo.PRERELEASE]})?${Go[Vo.BUILD]}?)?)?`);Bl("XRANGEPLAINLOOSE",`[v=\\s]*(${Go[Vo.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Go[Vo.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Go[Vo.XRANGEIDENTIFIERLOOSE]})(?:${Go[Vo.PRERELEASELOOSE]})?${Go[Vo.BUILD]}?)?)?`);Bl("XRANGE",`^${Go[Vo.GTLT]}\\s*${Go[Vo.XRANGEPLAIN]}$`);Bl("XRANGELOOSE",`^${Go[Vo.GTLT]}\\s*${Go[Vo.XRANGEPLAINLOOSE]}$`);Bl("COERCE",`(^|[^\\d])(\\d{1,${Lhr}})(?:\\.(\\d{1,${Lhr}}))?(?:\\.(\\d{1,${Lhr}}))?(?:$|[^\\d])`);Bl("COERCERTL",Go[Vo.COERCE],!0);Bl("LONETILDE","(?:~>?)");Bl("TILDETRIM",`(\\s*)${Go[Vo.LONETILDE]}\\s+`,!0);XF.tildeTrimReplace="$1~";Bl("TILDE",`^${Go[Vo.LONETILDE]}${Go[Vo.XRANGEPLAIN]}$`);Bl("TILDELOOSE",`^${Go[Vo.LONETILDE]}${Go[Vo.XRANGEPLAINLOOSE]}$`);Bl("LONECARET","(?:\\^)");Bl("CARETTRIM",`(\\s*)${Go[Vo.LONECARET]}\\s+`,!0);XF.caretTrimReplace="$1^";Bl("CARET",`^${Go[Vo.LONECARET]}${Go[Vo.XRANGEPLAIN]}$`);Bl("CARETLOOSE",`^${Go[Vo.LONECARET]}${Go[Vo.XRANGEPLAINLOOSE]}$`);Bl("COMPARATORLOOSE",`^${Go[Vo.GTLT]}\\s*(${Go[Vo.LOOSEPLAIN]})$|^$`);Bl("COMPARATOR",`^${Go[Vo.GTLT]}\\s*(${Go[Vo.FULLPLAIN]})$|^$`);Bl("COMPARATORTRIM",`(\\s*)${Go[Vo.GTLT]}\\s*(${Go[Vo.LOOSEPLAIN]}|${Go[Vo.XRANGEPLAIN]})`,!0);XF.comparatorTrimReplace="$1$2$3";Bl("HYPHENRANGE",`^\\s*(${Go[Vo.XRANGEPLAIN]})\\s+-\\s+(${Go[Vo.XRANGEPLAIN]})\\s*$`);Bl("HYPHENRANGELOOSE",`^\\s*(${Go[Vo.XRANGEPLAINLOOSE]})\\s+-\\s+(${Go[Vo.XRANGEPLAINLOOSE]})\\s*$`);Bl("STAR","(<|>)?=?\\s*\\*");Bl("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Bl("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Opt=I((vEd,lni)=>{var VWa=Object.freeze({loose:!0}),HWa=Object.freeze({}),KWa=r=>r?typeof r!="object"?VWa:r:HWa;lni.exports=KWa});var qhr=I((SEd,dni)=>{var cni=/^[0-9]+$/,uni=(r,t)=>{let n=cni.test(r),i=cni.test(t);return n&&i&&(r=+r,t=+t),r===t?0:n&&!i?-1:i&&!n?1:r<t?-1:1},YWa=(r,t)=>uni(t,r);dni.exports={compareIdentifiers:uni,rcompareIdentifiers:YWa}});var Z3=I((OEd,hni)=>{var wpt=ake(),{MAX_LENGTH:pni,MAX_SAFE_INTEGER:_pt}=ske(),{safeRe:fni,t:Ani}=hme(),JWa=Opt(),{compareIdentifiers:gme}=qhr(),Uhr=class r{constructor(t,n){if(n=JWa(n),t instanceof r){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>pni)throw new TypeError(`version is longer than ${pni} characters`);wpt("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=t.trim().match(n.loose?fni[Ani.LOOSE]:fni[Ani.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>_pt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>_pt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>_pt||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<_pt)return s}return o}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(wpt("SemVer.compare",this.version,this.options,t),!(t instanceof r)){if(typeof t=="string"&&t===this.version)return 0;t=new r(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof r||(t=new r(t,this.options)),gme(this.major,t.major)||gme(this.minor,t.minor)||gme(this.patch,t.patch)}comparePre(t){if(t instanceof r||(t=new r(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let i=this.prerelease[n],o=t.prerelease[n];if(wpt("prerelease compare",n,i,o),i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(i===o)continue;return gme(i,o)}while(++n)}compareBuild(t){t instanceof r||(t=new r(t,this.options));let n=0;do{let i=this.build[n],o=t.build[n];if(wpt("prerelease compare",n,i,o),i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(i===o)continue;return gme(i,o)}while(++n)}inc(t,n,i){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(i)?1:0;if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let s=[n,o];i===!1&&(s=[n]),gme(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};hni.exports=Uhr});var Xoe=I((wEd,mni)=>{var gni=Z3(),$Wa=(r,t,n=!1)=>{if(r instanceof gni)return r;try{return new gni(r,t)}catch(i){if(!n)return null;throw i}};mni.exports=$Wa});var bni=I((_Ed,yni)=>{var XWa=Xoe(),ZWa=(r,t)=>{let n=XWa(r,t);return n?n.version:null};yni.exports=ZWa});var Cni=I((TEd,Eni)=>{var eGa=Xoe(),tGa=(r,t)=>{let n=eGa(r.trim().replace(/^[=v]+/,""),t);return n?n.version:null};Eni.exports=tGa});var Sni=I((REd,vni)=>{var Ini=Z3(),rGa=(r,t,n,i,o)=>{typeof n=="string"&&(o=i,i=n,n=void 0);try{return new Ini(r instanceof Ini?r.version:r,n).inc(t,i,o).version}catch{return null}};vni.exports=rGa});var _ni=I((BEd,wni)=>{var Oni=Xoe(),nGa=(r,t)=>{let n=Oni(r,null,!0),i=Oni(t,null,!0),o=n.compare(i);if(o===0)return null;let s=o>0,a=s?n:i,l=s?i:n,u=!!a.prerelease.length;if(!!l.prerelease.length&&!u)return!l.patch&&!l.minor?"major":a.patch?"patch":a.minor?"minor":"major";let d=u?"pre":"";return n.major!==i.major?d+"major":n.minor!==i.minor?d+"minor":n.patch!==i.patch?d+"patch":"prerelease"};wni.exports=nGa});var Rni=I((MEd,Tni)=>{var iGa=Z3(),oGa=(r,t)=>new iGa(r,t).major;Tni.exports=oGa});var Mni=I((xEd,Bni)=>{var sGa=Z3(),aGa=(r,t)=>new sGa(r,t).minor;Bni.exports=aGa});var Dni=I((DEd,xni)=>{var lGa=Z3(),cGa=(r,t)=>new lGa(r,t).patch;xni.exports=cGa});var kni=I((NEd,Nni)=>{var uGa=Xoe(),dGa=(r,t)=>{let n=uGa(r,t);return n&&n.prerelease.length?n.prerelease:null};Nni.exports=dGa});var jw=I((kEd,Qni)=>{var Pni=Z3(),pGa=(r,t,n)=>new Pni(r,n).compare(new Pni(t,n));Qni.exports=pGa});var Lni=I((PEd,Fni)=>{var fGa=jw(),AGa=(r,t,n)=>fGa(t,r,n);Fni.exports=AGa});var qni=I((QEd,zni)=>{var hGa=jw(),gGa=(r,t)=>hGa(r,t,!0);zni.exports=gGa});var Tpt=I((FEd,jni)=>{var Uni=Z3(),mGa=(r,t,n)=>{let i=new Uni(r,n),o=new Uni(t,n);return i.compare(o)||i.compareBuild(o)};jni.exports=mGa});var Gni=I((LEd,Wni)=>{var yGa=Tpt(),bGa=(r,t)=>r.sort((n,i)=>yGa(n,i,t));Wni.exports=bGa});var Hni=I((zEd,Vni)=>{var EGa=Tpt(),CGa=(r,t)=>r.sort((n,i)=>EGa(i,n,t));Vni.exports=CGa});var lke=I((qEd,Kni)=>{var IGa=jw(),vGa=(r,t,n)=>IGa(r,t,n)>0;Kni.exports=vGa});var Rpt=I((UEd,Yni)=>{var SGa=jw(),OGa=(r,t,n)=>SGa(r,t,n)<0;Yni.exports=OGa});var jhr=I((jEd,Jni)=>{var wGa=jw(),_Ga=(r,t,n)=>wGa(r,t,n)===0;Jni.exports=_Ga});var Whr=I((WEd,$ni)=>{var TGa=jw(),RGa=(r,t,n)=>TGa(r,t,n)!==0;$ni.exports=RGa});var Bpt=I((GEd,Xni)=>{var BGa=jw(),MGa=(r,t,n)=>BGa(r,t,n)>=0;Xni.exports=MGa});var Mpt=I((VEd,Zni)=>{var xGa=jw(),DGa=(r,t,n)=>xGa(r,t,n)<=0;Zni.exports=DGa});var Ghr=I((HEd,eii)=>{var NGa=jhr(),kGa=Whr(),PGa=lke(),QGa=Bpt(),FGa=Rpt(),LGa=Mpt(),zGa=(r,t,n,i)=>{switch(t){case"===":return typeof r=="object"&&(r=r.version),typeof n=="object"&&(n=n.version),r===n;case"!==":return typeof r=="object"&&(r=r.version),typeof n=="object"&&(n=n.version),r!==n;case"":case"=":case"==":return NGa(r,n,i);case"!=":return kGa(r,n,i);case">":return PGa(r,n,i);case">=":return QGa(r,n,i);case"<":return FGa(r,n,i);case"<=":return LGa(r,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};eii.exports=zGa});var rii=I((KEd,tii)=>{var qGa=Z3(),UGa=Xoe(),{safeRe:xpt,t:Dpt}=hme(),jGa=(r,t)=>{if(r instanceof qGa)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;t=t||{};let n=null;if(!t.rtl)n=r.match(xpt[Dpt.COERCE]);else{let i;for(;(i=xpt[Dpt.COERCERTL].exec(r))&&(!n||n.index+n[0].length!==r.length);)(!n||i.index+i[0].length!==n.index+n[0].length)&&(n=i),xpt[Dpt.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;xpt[Dpt.COERCERTL].lastIndex=-1}return n===null?null:UGa(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};tii.exports=jGa});var iii=I((YEd,nii)=>{"use strict";nii.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}});var Vhr=I((JEd,oii)=>{"use strict";oii.exports=ku;ku.Node=Zoe;ku.create=ku;function ku(r){var t=this;if(t instanceof ku||(t=new ku),t.tail=null,t.head=null,t.length=0,r&&typeof r.forEach=="function")r.forEach(function(o){t.push(o)});else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}ku.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var t=r.next,n=r.prev;return t&&(t.prev=n),n&&(n.next=t),r===this.head&&(this.head=t),r===this.tail&&(this.tail=n),r.list.length--,r.next=null,r.prev=null,r.list=null,t};ku.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var t=this.head;r.list=this,r.next=t,t&&(t.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};ku.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var t=this.tail;r.list=this,r.prev=t,t&&(t.next=r),this.tail=r,this.head||(this.head=r),this.length++}};ku.prototype.push=function(){for(var r=0,t=arguments.length;r<t;r++)GGa(this,arguments[r]);return this.length};ku.prototype.unshift=function(){for(var r=0,t=arguments.length;r<t;r++)VGa(this,arguments[r]);return this.length};ku.prototype.pop=function(){if(this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};ku.prototype.shift=function(){if(this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};ku.prototype.forEach=function(r,t){t=t||this;for(var n=this.head,i=0;n!==null;i++)r.call(t,n.value,i,this),n=n.next};ku.prototype.forEachReverse=function(r,t){t=t||this;for(var n=this.tail,i=this.length-1;n!==null;i--)r.call(t,n.value,i,this),n=n.prev};ku.prototype.get=function(r){for(var t=0,n=this.head;n!==null&&t<r;t++)n=n.next;if(t===r&&n!==null)return n.value};ku.prototype.getReverse=function(r){for(var t=0,n=this.tail;n!==null&&t<r;t++)n=n.prev;if(t===r&&n!==null)return n.value};ku.prototype.map=function(r,t){t=t||this;for(var n=new ku,i=this.head;i!==null;)n.push(r.call(t,i.value,this)),i=i.next;return n};ku.prototype.mapReverse=function(r,t){t=t||this;for(var n=new ku,i=this.tail;i!==null;)n.push(r.call(t,i.value,this)),i=i.prev;return n};ku.prototype.reduce=function(r,t){var n,i=this.head;if(arguments.length>1)n=t;else if(this.head)i=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;i!==null;o++)n=r(n,i.value,o),i=i.next;return n};ku.prototype.reduceReverse=function(r,t){var n,i=this.tail;if(arguments.length>1)n=t;else if(this.tail)i=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=this.length-1;i!==null;o--)n=r(n,i.value,o),i=i.prev;return n};ku.prototype.toArray=function(){for(var r=new Array(this.length),t=0,n=this.head;n!==null;t++)r[t]=n.value,n=n.next;return r};ku.prototype.toArrayReverse=function(){for(var r=new Array(this.length),t=0,n=this.tail;n!==null;t++)r[t]=n.value,n=n.prev;return r};ku.prototype.slice=function(r,t){t=t||this.length,t<0&&(t+=this.length),r=r||0,r<0&&(r+=this.length);var n=new ku;if(t<r||t<0)return n;r<0&&(r=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;o!==null&&i<r;i++)o=o.next;for(;o!==null&&i<t;i++,o=o.next)n.push(o.value);return n};ku.prototype.sliceReverse=function(r,t){t=t||this.length,t<0&&(t+=this.length),r=r||0,r<0&&(r+=this.length);var n=new ku;if(t<r||t<0)return n;r<0&&(r=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;o!==null&&i>t;i--)o=o.prev;for(;o!==null&&i>r;i--,o=o.prev)n.push(o.value);return n};ku.prototype.splice=function(r,t,...n){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var i=0,o=this.head;o!==null&&i<r;i++)o=o.next;for(var s=[],i=0;o&&i<t;i++)s.push(o.value),o=this.removeNode(o);o===null&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(var i=0;i<n.length;i++)o=WGa(this,o,n[i]);return s};ku.prototype.reverse=function(){for(var r=this.head,t=this.tail,n=r;n!==null;n=n.prev){var i=n.prev;n.prev=n.next,n.next=i}return this.head=t,this.tail=r,this};function WGa(r,t,n){var i=t===r.head?new Zoe(n,null,t,r):new Zoe(n,t,t.next,r);return i.next===null&&(r.tail=i),i.prev===null&&(r.head=i),r.length++,i}function GGa(r,t){r.tail=new Zoe(t,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function VGa(r,t){r.head=new Zoe(t,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function Zoe(r,t,n,i){if(!(this instanceof Zoe))return new Zoe(r,t,n,i);this.list=i,this.value=r,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{iii()(ku)}catch{}});var bme=I(($Ed,cii)=>{"use strict";var HGa=Vhr(),ese=Symbol("max"),eL=Symbol("length"),mme=Symbol("lengthCalculator"),uke=Symbol("allowStale"),tse=Symbol("maxAge"),ZF=Symbol("dispose"),sii=Symbol("noDisposeOnSet"),Qm=Symbol("lruList"),HR=Symbol("cache"),lii=Symbol("updateAgeOnGet"),Hhr=()=>1,Yhr=class{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");let n=this[ese]=t.max||1/0,i=t.length||Hhr;if(this[mme]=typeof i!="function"?Hhr:i,this[uke]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[tse]=t.maxAge||0,this[ZF]=t.dispose,this[sii]=t.noDisposeOnSet||!1,this[lii]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[ese]=t||1/0,cke(this)}get max(){return this[ese]}set allowStale(t){this[uke]=!!t}get allowStale(){return this[uke]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[tse]=t,cke(this)}get maxAge(){return this[tse]}set lengthCalculator(t){typeof t!="function"&&(t=Hhr),t!==this[mme]&&(this[mme]=t,this[eL]=0,this[Qm].forEach(n=>{n.length=this[mme](n.value,n.key),this[eL]+=n.length})),cke(this)}get lengthCalculator(){return this[mme]}get length(){return this[eL]}get itemCount(){return this[Qm].length}rforEach(t,n){n=n||this;for(let i=this[Qm].tail;i!==null;){let o=i.prev;aii(this,t,i,n),i=o}}forEach(t,n){n=n||this;for(let i=this[Qm].head;i!==null;){let o=i.next;aii(this,t,i,n),i=o}}keys(){return this[Qm].toArray().map(t=>t.key)}values(){return this[Qm].toArray().map(t=>t.value)}reset(){this[ZF]&&this[Qm]&&this[Qm].length&&this[Qm].forEach(t=>this[ZF](t.key,t.value)),this[HR]=new Map,this[Qm]=new HGa,this[eL]=0}dump(){return this[Qm].map(t=>Npt(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[Qm]}set(t,n,i){if(i=i||this[tse],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let o=i?Date.now():0,s=this[mme](n,t);if(this[HR].has(t)){if(s>this[ese])return yme(this,this[HR].get(t)),!1;let u=this[HR].get(t).value;return this[ZF]&&(this[sii]||this[ZF](t,u.value)),u.now=o,u.maxAge=i,u.value=n,this[eL]+=s-u.length,u.length=s,this.get(t),cke(this),!0}let a=new Jhr(t,n,s,o,i);return a.length>this[ese]?(this[ZF]&&this[ZF](t,n),!1):(this[eL]+=a.length,this[Qm].unshift(a),this[HR].set(t,this[Qm].head),cke(this),!0)}has(t){if(!this[HR].has(t))return!1;let n=this[HR].get(t).value;return!Npt(this,n)}get(t){return Khr(this,t,!0)}peek(t){return Khr(this,t,!1)}pop(){let t=this[Qm].tail;return t?(yme(this,t),t.value):null}del(t){yme(this,this[HR].get(t))}load(t){this.reset();let n=Date.now();for(let i=t.length-1;i>=0;i--){let o=t[i],s=o.e||0;if(s===0)this.set(o.k,o.v);else{let a=s-n;a>0&&this.set(o.k,o.v,a)}}}prune(){this[HR].forEach((t,n)=>Khr(this,n,!1))}},Khr=(r,t,n)=>{let i=r[HR].get(t);if(i){let o=i.value;if(Npt(r,o)){if(yme(r,i),!r[uke])return}else n&&(r[lii]&&(i.value.now=Date.now()),r[Qm].unshiftNode(i));return o.value}},Npt=(r,t)=>{if(!t||!t.maxAge&&!r[tse])return!1;let n=Date.now()-t.now;return t.maxAge?n>t.maxAge:r[tse]&&n>r[tse]},cke=r=>{if(r[eL]>r[ese])for(let t=r[Qm].tail;r[eL]>r[ese]&&t!==null;){let n=t.prev;yme(r,t),t=n}},yme=(r,t)=>{if(t){let n=t.value;r[ZF]&&r[ZF](n.key,n.value),r[eL]-=n.length,r[HR].delete(n.key),r[Qm].removeNode(t)}},Jhr=class{constructor(t,n,i,o,s){this.key=t,this.value=n,this.length=i,this.now=o,this.maxAge=s||0}},aii=(r,t,n,i)=>{let o=n.value;Npt(r,o)&&(yme(r,n),r[uke]||(o=void 0)),o&&t.call(i,o.value,o.key,r)};cii.exports=Yhr});var Ww=I((XEd,fii)=>{var $hr=class r{constructor(t,n){if(n=YGa(n),t instanceof r)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new r(t.raw,n);if(t instanceof Xhr)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(o=>!dii(o[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&rVa(o[0])){this.set=[o];break}}}this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){let i=((this.options.includePrerelease&&eVa)|(this.options.loose&&tVa))+":"+t,o=uii.get(i);if(o)return o;let s=this.options.loose,a=s?KI[qE.HYPHENRANGELOOSE]:KI[qE.HYPHENRANGE];t=t.replace(a,pVa(this.options.includePrerelease)),Pp("hyphen replace",t),t=t.replace(KI[qE.COMPARATORTRIM],$Ga),Pp("comparator trim",t),t=t.replace(KI[qE.TILDETRIM],XGa),Pp("tilde trim",t),t=t.replace(KI[qE.CARETTRIM],ZGa),Pp("caret trim",t);let l=t.split(" ").map(p=>nVa(p,this.options)).join(" ").split(/\s+/).map(p=>dVa(p,this.options));s&&(l=l.filter(p=>(Pp("loose invalid filter",p,this.options),!!p.match(KI[qE.COMPARATORLOOSE])))),Pp("range list",l);let u=new Map,c=l.map(p=>new Xhr(p,this.options));for(let p of c){if(dii(p))return[p];u.set(p.value,p)}u.size>1&&u.has("")&&u.delete("");let d=[...u.values()];return uii.set(i,d),d}intersects(t,n){if(!(t instanceof r))throw new TypeError("a Range is required");return this.set.some(i=>pii(i,n)&&t.set.some(o=>pii(o,n)&&i.every(s=>o.every(a=>s.intersects(a,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new JGa(t,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(fVa(this.set[n],t,this.options))return!0;return!1}};fii.exports=$hr;var KGa=bme(),uii=new KGa({max:1e3}),YGa=Opt(),Xhr=dke(),Pp=ake(),JGa=Z3(),{safeRe:KI,t:qE,comparatorTrimReplace:$Ga,tildeTrimReplace:XGa,caretTrimReplace:ZGa}=hme(),{FLAG_INCLUDE_PRERELEASE:eVa,FLAG_LOOSE:tVa}=ske(),dii=r=>r.value==="<0.0.0-0",rVa=r=>r.value==="",pii=(r,t)=>{let n=!0,i=r.slice(),o=i.pop();for(;n&&i.length;)n=i.every(s=>o.intersects(s,t)),o=i.pop();return n},nVa=(r,t)=>(Pp("comp",r,t),r=sVa(r,t),Pp("caret",r),r=iVa(r,t),Pp("tildes",r),r=lVa(r,t),Pp("xrange",r),r=uVa(r,t),Pp("stars",r),r),UE=r=>!r||r.toLowerCase()==="x"||r==="*",iVa=(r,t)=>r.trim().split(/\s+/).map(n=>oVa(n,t)).join(" "),oVa=(r,t)=>{let n=t.loose?KI[qE.TILDELOOSE]:KI[qE.TILDE];return r.replace(n,(i,o,s,a,l)=>{Pp("tilde",r,i,o,s,a,l);let u;return UE(o)?u="":UE(s)?u=`>=${o}.0.0 <${+o+1}.0.0-0`:UE(a)?u=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:l?(Pp("replaceTilde pr",l),u=`>=${o}.${s}.${a}-${l} <${o}.${+s+1}.0-0`):u=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,Pp("tilde return",u),u})},sVa=(r,t)=>r.trim().split(/\s+/).map(n=>aVa(n,t)).join(" "),aVa=(r,t)=>{Pp("caret",r,t);let n=t.loose?KI[qE.CARETLOOSE]:KI[qE.CARET],i=t.includePrerelease?"-0":"";return r.replace(n,(o,s,a,l,u)=>{Pp("caret",r,o,s,a,l,u);let c;return UE(s)?c="":UE(a)?c=`>=${s}.0.0${i} <${+s+1}.0.0-0`:UE(l)?s==="0"?c=`>=${s}.${a}.0${i} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.0${i} <${+s+1}.0.0-0`:u?(Pp("replaceCaret pr",u),s==="0"?a==="0"?c=`>=${s}.${a}.${l}-${u} <${s}.${a}.${+l+1}-0`:c=`>=${s}.${a}.${l}-${u} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${l}-${u} <${+s+1}.0.0-0`):(Pp("no pr"),s==="0"?a==="0"?c=`>=${s}.${a}.${l}${i} <${s}.${a}.${+l+1}-0`:c=`>=${s}.${a}.${l}${i} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${l} <${+s+1}.0.0-0`),Pp("caret return",c),c})},lVa=(r,t)=>(Pp("replaceXRanges",r,t),r.split(/\s+/).map(n=>cVa(n,t)).join(" ")),cVa=(r,t)=>{r=r.trim();let n=t.loose?KI[qE.XRANGELOOSE]:KI[qE.XRANGE];return r.replace(n,(i,o,s,a,l,u)=>{Pp("xRange",r,i,o,s,a,l,u);let c=UE(s),d=c||UE(a),p=d||UE(l),f=p;return o==="="&&f&&(o=""),u=t.includePrerelease?"-0":"",c?o===">"||o==="<"?i="<0.0.0-0":i="*":o&&f?(d&&(a=0),l=0,o===">"?(o=">=",d?(s=+s+1,a=0,l=0):(a=+a+1,l=0)):o==="<="&&(o="<",d?s=+s+1:a=+a+1),o==="<"&&(u="-0"),i=`${o+s}.${a}.${l}${u}`):d?i=`>=${s}.0.0${u} <${+s+1}.0.0-0`:p&&(i=`>=${s}.${a}.0${u} <${s}.${+a+1}.0-0`),Pp("xRange return",i),i})},uVa=(r,t)=>(Pp("replaceStars",r,t),r.trim().replace(KI[qE.STAR],"")),dVa=(r,t)=>(Pp("replaceGTE0",r,t),r.trim().replace(KI[t.includePrerelease?qE.GTE0PRE:qE.GTE0],"")),pVa=r=>(t,n,i,o,s,a,l,u,c,d,p,f,A)=>(UE(i)?n="":UE(o)?n=`>=${i}.0.0${r?"-0":""}`:UE(s)?n=`>=${i}.${o}.0${r?"-0":""}`:a?n=`>=${n}`:n=`>=${n}${r?"-0":""}`,UE(c)?u="":UE(d)?u=`<${+c+1}.0.0-0`:UE(p)?u=`<${c}.${+d+1}.0-0`:f?u=`<=${c}.${d}.${p}-${f}`:r?u=`<${c}.${d}.${+p+1}-0`:u=`<=${u}`,`${n} ${u}`.trim()),fVa=(r,t,n)=>{for(let i=0;i<r.length;i++)if(!r[i].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let i=0;i<r.length;i++)if(Pp(r[i].semver),r[i].semver!==Xhr.ANY&&r[i].semver.prerelease.length>0){let o=r[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}});var dke=I((ZEd,bii)=>{var pke=Symbol("SemVer ANY"),tgr=class r{static get ANY(){return pke}constructor(t,n){if(n=Aii(n),t instanceof r){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),egr("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===pke?this.value="":this.value=this.operator+this.semver.version,egr("comp",this)}parse(t){let n=this.options.loose?hii[gii.COMPARATORLOOSE]:hii[gii.COMPARATOR],i=t.match(n);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new mii(i[2],this.options.loose):this.semver=pke}toString(){return this.value}test(t){if(egr("Comparator.test",t,this.options.loose),this.semver===pke||t===pke)return!0;if(typeof t=="string")try{t=new mii(t,this.options)}catch{return!1}return Zhr(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new yii(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new yii(this.value,n).test(t.semver):(n=Aii(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Zhr(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Zhr(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};bii.exports=tgr;var Aii=Opt(),{safeRe:hii,t:gii}=hme(),Zhr=Ghr(),egr=ake(),mii=Z3(),yii=Ww()});var fke=I((eCd,Eii)=>{var AVa=Ww(),hVa=(r,t,n)=>{try{t=new AVa(t,n)}catch{return!1}return t.test(r)};Eii.exports=hVa});var Iii=I((tCd,Cii)=>{var gVa=Ww(),mVa=(r,t)=>new gVa(r,t).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));Cii.exports=mVa});var Sii=I((rCd,vii)=>{var yVa=Z3(),bVa=Ww(),EVa=(r,t,n)=>{let i=null,o=null,s=null;try{s=new bVa(t,n)}catch{return null}return r.forEach(a=>{s.test(a)&&(!i||o.compare(a)===-1)&&(i=a,o=new yVa(i,n))}),i};vii.exports=EVa});var wii=I((nCd,Oii)=>{var CVa=Z3(),IVa=Ww(),vVa=(r,t,n)=>{let i=null,o=null,s=null;try{s=new IVa(t,n)}catch{return null}return r.forEach(a=>{s.test(a)&&(!i||o.compare(a)===1)&&(i=a,o=new CVa(i,n))}),i};Oii.exports=vVa});var Rii=I((iCd,Tii)=>{var rgr=Z3(),SVa=Ww(),_ii=lke(),OVa=(r,t)=>{r=new SVa(r,t);let n=new rgr("0.0.0");if(r.test(n)||(n=new rgr("0.0.0-0"),r.test(n)))return n;n=null;for(let i=0;i<r.set.length;++i){let o=r.set[i],s=null;o.forEach(a=>{let l=new rgr(a.semver.version);switch(a.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||_ii(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!n||_ii(n,s))&&(n=s)}return n&&r.test(n)?n:null};Tii.exports=OVa});var Mii=I((oCd,Bii)=>{var wVa=Ww(),_Va=(r,t)=>{try{return new wVa(r,t).range||"*"}catch{return null}};Bii.exports=_Va});var kpt=I((sCd,kii)=>{var TVa=Z3(),Nii=dke(),{ANY:RVa}=Nii,BVa=Ww(),MVa=fke(),xii=lke(),Dii=Rpt(),xVa=Mpt(),DVa=Bpt(),NVa=(r,t,n,i)=>{r=new TVa(r,i),t=new BVa(t,i);let o,s,a,l,u;switch(n){case">":o=xii,s=xVa,a=Dii,l=">",u=">=";break;case"<":o=Dii,s=DVa,a=xii,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(MVa(r,t,i))return!1;for(let c=0;c<t.set.length;++c){let d=t.set[c],p=null,f=null;if(d.forEach(A=>{A.semver===RVa&&(A=new Nii(">=0.0.0")),p=p||A,f=f||A,o(A.semver,p.semver,i)?p=A:a(A.semver,f.semver,i)&&(f=A)}),p.operator===l||p.operator===u||(!f.operator||f.operator===l)&&s(r,f.semver))return!1;if(f.operator===u&&a(r,f.semver))return!1}return!0};kii.exports=NVa});var Qii=I((aCd,Pii)=>{var kVa=kpt(),PVa=(r,t,n)=>kVa(r,t,">",n);Pii.exports=PVa});var Lii=I((lCd,Fii)=>{var QVa=kpt(),FVa=(r,t,n)=>QVa(r,t,"<",n);Fii.exports=FVa});var Uii=I((cCd,qii)=>{var zii=Ww(),LVa=(r,t,n)=>(r=new zii(r,n),t=new zii(t,n),r.intersects(t,n));qii.exports=LVa});var Wii=I((uCd,jii)=>{var zVa=fke(),qVa=jw();jii.exports=(r,t,n)=>{let i=[],o=null,s=null,a=r.sort((d,p)=>qVa(d,p,n));for(let d of a)zVa(d,t,n)?(s=d,o||(o=d)):(s&&i.push([o,s]),s=null,o=null);o&&i.push([o,null]);let l=[];for(let[d,p]of i)d===p?l.push(d):!p&&d===a[0]?l.push("*"):p?d===a[0]?l.push(`<=${p}`):l.push(`${d} - ${p}`):l.push(`>=${d}`);let u=l.join(" || "),c=typeof t.raw=="string"?t.raw:String(t);return u.length<c.length?u:t}});var Jii=I((dCd,Yii)=>{var Gii=Ww(),igr=dke(),{ANY:ngr}=igr,Ake=fke(),ogr=jw(),UVa=(r,t,n={})=>{if(r===t)return!0;r=new Gii(r,n),t=new Gii(t,n);let i=!1;e:for(let o of r.set){for(let s of t.set){let a=WVa(o,s,n);if(i=i||a!==null,a)continue e}if(i)return!1}return!0},jVa=[new igr(">=0.0.0-0")],Vii=[new igr(">=0.0.0")],WVa=(r,t,n)=>{if(r===t)return!0;if(r.length===1&&r[0].semver===ngr){if(t.length===1&&t[0].semver===ngr)return!0;n.includePrerelease?r=jVa:r=Vii}if(t.length===1&&t[0].semver===ngr){if(n.includePrerelease)return!0;t=Vii}let i=new Set,o,s;for(let A of r)A.operator===">"||A.operator===">="?o=Hii(o,A,n):A.operator==="<"||A.operator==="<="?s=Kii(s,A,n):i.add(A.semver);if(i.size>1)return null;let a;if(o&&s){if(a=ogr(o.semver,s.semver,n),a>0)return null;if(a===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let A of i){if(o&&!Ake(A,String(o),n)||s&&!Ake(A,String(s),n))return null;for(let h of t)if(!Ake(A,String(h),n))return!1;return!0}let l,u,c,d,p=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1;p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let A of t){if(d=d||A.operator===">"||A.operator===">=",c=c||A.operator==="<"||A.operator==="<=",o){if(f&&A.semver.prerelease&&A.semver.prerelease.length&&A.semver.major===f.major&&A.semver.minor===f.minor&&A.semver.patch===f.patch&&(f=!1),A.operator===">"||A.operator===">="){if(l=Hii(o,A,n),l===A&&l!==o)return!1}else if(o.operator===">="&&!Ake(o.semver,String(A),n))return!1}if(s){if(p&&A.semver.prerelease&&A.semver.prerelease.length&&A.semver.major===p.major&&A.semver.minor===p.minor&&A.semver.patch===p.patch&&(p=!1),A.operator==="<"||A.operator==="<="){if(u=Kii(s,A,n),u===A&&u!==s)return!1}else if(s.operator==="<="&&!Ake(s.semver,String(A),n))return!1}if(!A.operator&&(s||o)&&a!==0)return!1}return!(o&&c&&!s&&a!==0||s&&d&&!o&&a!==0||f||p)},Hii=(r,t,n)=>{if(!r)return t;let i=ogr(r.semver,t.semver,n);return i>0?r:i<0||t.operator===">"&&r.operator===">="?t:r},Kii=(r,t,n)=>{if(!r)return t;let i=ogr(r.semver,t.semver,n);return i<0?r:i>0||t.operator==="<"&&r.operator==="<="?t:r};Yii.exports=UVa});var Eme=I((pCd,Zii)=>{var sgr=hme(),$ii=ske(),GVa=Z3(),Xii=qhr(),VVa=Xoe(),HVa=bni(),KVa=Cni(),YVa=Sni(),JVa=_ni(),$Va=Rni(),XVa=Mni(),ZVa=Dni(),eHa=kni(),tHa=jw(),rHa=Lni(),nHa=qni(),iHa=Tpt(),oHa=Gni(),sHa=Hni(),aHa=lke(),lHa=Rpt(),cHa=jhr(),uHa=Whr(),dHa=Bpt(),pHa=Mpt(),fHa=Ghr(),AHa=rii(),hHa=dke(),gHa=Ww(),mHa=fke(),yHa=Iii(),bHa=Sii(),EHa=wii(),CHa=Rii(),IHa=Mii(),vHa=kpt(),SHa=Qii(),OHa=Lii(),wHa=Uii(),_Ha=Wii(),THa=Jii();Zii.exports={parse:VVa,valid:HVa,clean:KVa,inc:YVa,diff:JVa,major:$Va,minor:XVa,patch:ZVa,prerelease:eHa,compare:tHa,rcompare:rHa,compareLoose:nHa,compareBuild:iHa,sort:oHa,rsort:sHa,gt:aHa,lt:lHa,eq:cHa,neq:uHa,gte:dHa,lte:pHa,cmp:fHa,coerce:AHa,Comparator:hHa,Range:gHa,satisfies:mHa,toComparators:yHa,maxSatisfying:bHa,minSatisfying:EHa,minVersion:CHa,validRange:IHa,outside:vHa,gtr:SHa,ltr:OHa,intersects:wHa,simplifyRange:_Ha,subset:THa,SemVer:GVa,re:sgr.re,src:sgr.src,tokens:sgr.t,SEMVER_SPEC_VERSION:$ii.SEMVER_SPEC_VERSION,RELEASE_TYPES:$ii.RELEASE_TYPES,compareIdentifiers:Xii.compareIdentifiers,rcompareIdentifiers:Xii.rcompareIdentifiers}});var hke,RHa,fCd,BHa,jE,tV=ut(()=>{"use strict";hke=yt(qw()),RHa=yt(Eme()),fCd=(0,hke.Record)({version:hke.String,hash:hke.String}),BHa=()=>({version:"7.20.1-rc.1",hash:"7d03ff11b8b85b2398c88590c8c3ce9b57599d75"}),jE=BHa()});var DS,eoi,gke,Ppt=ut(()=>{"use strict";tV();eoi=r=>{DS=r},gke=r=>({coalesceSoftwareVersion:jE?.version||"",service:r,env:process.env.REACT_APP_OWNER??"",reactAppCoalesceDev:process.env.REACT_APP_COALESCE_DEV??""})});var toi,roi,NS,agr,noi,ioi,ooi,mke,lgr,Qpt,xHa,cgr,Cme,yke,Fpt,ugr,soi,Ime=ut(()=>{"use strict";toi=yt(nF()),roi=yt(Wit()),NS=yt(die());Koe();ept();Ppt();Zl();VR();fr();agr=null,noi=r=>{agr=r},ioi={emerg:"error",assert:"warn",alert:"warn",error:"warn",warn:"warn",app:"info",info:"info",debug:"debug"},ooi={emerg:"emerg",assert:"alert",alert:"alert",error:"error",app:"info",info:"info",warn:"warn",debug:"debug"},mke=class extends toi.default{baseContext;constructor(t){super(t),this.baseContext=gke(DS)}log(t,n){agr&&agr.log({...t,level:ooi[t.level]},{...this.baseContext,...X3},ioi[t.level]),n()}},Qpt=r=>{let t=gke(r);lgr={host:"http-intake.logs.datadoghq.com",path:`/v1/input/pub04bd017317b60c96b62874179d82ff97?ddtags=env:${t.env},coalesceSoftwareVersion:${t.coalesceSoftwareVersion}&ddsource=nodejs&service=${r}`,ssl:!0}},xHa=!1,cgr=()=>NS.format.combine(NS.format.timestamp(),NS.format.colorize({colors:Zdt.COLORS}),NS.format.printf(r=>{let t=[{key:"orgID",prefix:"org"},{key:"workspaceID",prefix:"env"},{key:"userID",prefix:"user"},{key:"runID",prefix:"run"},{key:"nodeID",prefix:"node"},{key:"kubernetesJobUuid",prefix:"k8s-job"},{key:"planID",prefix:"plan"}],n=process.env.JEST_WORKER_ID?`[SHARD:${process.env.JEST_WORKER_ID}]`:"",i=t.map(({key:o,prefix:s})=>r[o]?`|(${s}:${r[o]})`:"").join("");return`|${r.timestamp}|${n}[${r.loggingArea}]${i}|)|${r.level}:${r.message}`})),Cme=r=>new NS.transports.Console({format:process.env.CONSOLE_JSON_LOGS?NS.format.combine(NS.format.timestamp(),NS.format.json()):cgr(),level:r.level,silent:xHa}),yke=class extends roi.Http{running=0;rejectLogCalls=!1;constructor(){let t={batch:!1,...lgr,format:NS.format.combine(cgr(),NS.format.uncolorize())};super(t),this.on("logged",()=>{this.running-=1}),this.on("warn",()=>{this.running-=1})}log(t,n){if(this.rejectLogCalls)return;let i={...t,level:ooi[t.level],status:ioi[t.level]};this.running+=1,super.log?.(i,n)}async closeAndWait(t){this.rejectLogCalls=!0;let n=async()=>{let i=t>5e3?500:t/100,o=0;for(;o++*i<t;){if(this.running===0)return;await new Promise(s=>setTimeout(s,i))}if(this.running!==0)throw new ft("should not be reachable")};this.close&&this.close(),await Pm(t,"Close took too long",n())}},Fpt=()=>new yke,ugr=()=>new NS.transports.File({filename:process.env.JEST_WORKER_ID?`test-shard-${process.env.JEST_WORKER_ID}.log`:"test.log",dirname:"./test-logs",format:cgr(),level:Xdt.debug}),soi=r=>{let t=[];return t.push(Cme(r)),lgr&&t.push(Fpt()),_c().isTest&&t.push(ugr()),[new mke,...t]}});var aoi,dgr,pgr,DHa,NHa,bke,fgr=ut(()=>{"use strict";aoi=yt(die());Ppt();Koe();X7e();Ime();Zl();dgr=r=>r.includes("production")?"production":r.includes("staging")?"staging":r.includes("qa")?"qa":"development",pgr=()=>{if(m1()){let r=process.env.RUNTIME_ENVIRONMENT||"development";return wkn("coa")?bR()?dgr(r):void 0:dgr(r)}else{let r;try{r=self.ENVIRONMENT}catch{}return typeof r=="string"?dgr(r):void 0}},DHa=()=>{let r=_c();if(r.isTest)return{};let t=pgr();return r.isNode?{firebaseEnv:t}:{windowInfo:{frontendURLHost:self.location.host},firebaseEnv:t}},NHa=r=>{let t=gke(DS);return{appEnv:DHa(),loggingArea:r,...t}},bke=r=>{let t=MS[r];if(!t)throw new Error(`Logging area "${r}" is not a valid LoggingAreas key`);return t.logger||(t.logger=aoi.createLogger({levels:Zdt.LEVELS,defaultMeta:NHa(r),level:t.level,transports:soi(t)})),t.logger}});var loi,Lpt,zpt,Agr,qpt,tL,coi=ut(()=>{"use strict";loi=yt(wo()),Lpt=yt(die());X7e();Ime();Zl();fgr();Koe();QA();zpt=(r,t)=>{let n=r.toUpperCase(),i=[];if(n in MS||i.push(`invalid logging area '${n}'`),Xdt[t]||i.push("`invalid log level '${logLevel}'`"),i.length)throw i.forEach(l=>{console.error(l)}),new Error("Invalid logging area or log level: "+i.join(", "));let o=bke(n),s=o.transports.filter(l=>l instanceof Lpt.transports.Console),a=o.transports;s.length||(a=[...a,Cme(MS[n])]),a.filter(l=>l instanceof Lpt.transports.Console)[0].level=t,o.configure({...o,transports:o.transports})},Agr=()=>{Object.keys(MS).forEach(r=>{zpt(r,"debug")})},qpt=(r,t)=>{for(let n in r){let i=n,o=bke(i);r[i].defaultMeta={...o.defaultMeta,...r[i].defaultMeta,...t};let s=r[i].transports||o.transports,a;if(_c().isTest&&s.length>0){let l=s[s.length-1];l instanceof Lpt.transports.File&&(a=l,s=o.transports.slice(0,-1),s.push(ugr()))}o.configure({...o,...r[i],transports:s,level:r[i].level||o.level}),a&&a.close&&a.close()}},tL=r=>{let t=loi.default.mapValues(MS,(n,i)=>({}));qpt(t,r)}});function Eke(r,t){return function(){return r.apply(t,arguments)}}var hgr=ut(()=>{"use strict"});function PHa(r){return r!==null&&!Cke(r)&&r.constructor!==null&&!Cke(r.constructor)&&kS(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}function QHa(r){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&poi(r.buffer),t}function Ike(r,t,{allOwnKeys:n=!1}={}){if(r===null||typeof r>"u")return;let i,o;if(typeof r!="object"&&(r=[r]),vme(r))for(i=0,o=r.length;i<o;i++)t.call(null,r[i],i,r);else{let s=n?Object.getOwnPropertyNames(r):Object.keys(r),a=s.length,l;for(i=0;i<a;i++)l=s[i],t.call(null,r[l],l,r)}}function Aoi(r,t){t=t.toLowerCase();let n=Object.keys(r),i=n.length,o;for(;i-- >0;)if(o=n[i],t===o.toLowerCase())return o;return null}function mgr(){let{caseless:r}=hoi(this)&&this||{},t={},n=(i,o)=>{let s=r&&Aoi(t,o)||o;Upt(t[s])&&Upt(i)?t[s]=mgr(t[s],i):Upt(i)?t[s]=mgr({},i):vme(i)?t[s]=i.slice():t[s]=i};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&Ike(arguments[i],n);return t}function hKa(r){return!!(r&&kS(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}var kHa,ygr,jpt,KR,Wpt,vme,Cke,poi,FHa,kS,foi,Gpt,LHa,Upt,zHa,qHa,UHa,jHa,WHa,GHa,VHa,HHa,KHa,YHa,JHa,$Ha,rse,hoi,XHa,ZHa,eKa,tKa,rKa,nKa,iKa,oKa,sKa,aKa,lKa,uoi,cKa,goi,uKa,dKa,pKa,fKa,ggr,doi,moi,AKa,gKa,mKa,yKa,yoi,bKa,Xt,$0=ut(()=>{"use strict";hgr();({toString:kHa}=Object.prototype),{getPrototypeOf:ygr}=Object,jpt=(r=>t=>{let n=kHa.call(t);return r[n]||(r[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),KR=r=>(r=r.toLowerCase(),t=>jpt(t)===r),Wpt=r=>t=>typeof t===r,{isArray:vme}=Array,Cke=Wpt("undefined");poi=KR("ArrayBuffer");FHa=Wpt("string"),kS=Wpt("function"),foi=Wpt("number"),Gpt=r=>r!==null&&typeof r=="object",LHa=r=>r===!0||r===!1,Upt=r=>{if(jpt(r)!=="object")return!1;let t=ygr(r);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},zHa=KR("Date"),qHa=KR("File"),UHa=KR("Blob"),jHa=KR("FileList"),WHa=r=>Gpt(r)&&kS(r.pipe),GHa=r=>{let t;return r&&(typeof FormData=="function"&&r instanceof FormData||kS(r.append)&&((t=jpt(r))==="formdata"||t==="object"&&kS(r.toString)&&r.toString()==="[object FormData]"))},VHa=KR("URLSearchParams"),[HHa,KHa,YHa,JHa]=["ReadableStream","Request","Response","Headers"].map(KR),$Ha=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");rse=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hoi=r=>!Cke(r)&&r!==rse;XHa=(r,t,n,{allOwnKeys:i}={})=>(Ike(t,(o,s)=>{n&&kS(o)?r[s]=Eke(o,n):r[s]=o},{allOwnKeys:i}),r),ZHa=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),eKa=(r,t,n,i)=>{r.prototype=Object.create(t.prototype,i),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:t.prototype}),n&&Object.assign(r.prototype,n)},tKa=(r,t,n,i)=>{let o,s,a,l={};if(t=t||{},r==null)return t;do{for(o=Object.getOwnPropertyNames(r),s=o.length;s-- >0;)a=o[s],(!i||i(a,r,t))&&!l[a]&&(t[a]=r[a],l[a]=!0);r=n!==!1&&ygr(r)}while(r&&(!n||n(r,t))&&r!==Object.prototype);return t},rKa=(r,t,n)=>{r=String(r),(n===void 0||n>r.length)&&(n=r.length),n-=t.length;let i=r.indexOf(t,n);return i!==-1&&i===n},nKa=r=>{if(!r)return null;if(vme(r))return r;let t=r.length;if(!foi(t))return null;let n=new Array(t);for(;t-- >0;)n[t]=r[t];return n},iKa=(r=>t=>r&&t instanceof r)(typeof Uint8Array<"u"&&ygr(Uint8Array)),oKa=(r,t)=>{let i=(r&&r[Symbol.iterator]).call(r),o;for(;(o=i.next())&&!o.done;){let s=o.value;t.call(r,s[0],s[1])}},sKa=(r,t)=>{let n,i=[];for(;(n=r.exec(t))!==null;)i.push(n);return i},aKa=KR("HTMLFormElement"),lKa=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,o){return i.toUpperCase()+o}),uoi=(({hasOwnProperty:r})=>(t,n)=>r.call(t,n))(Object.prototype),cKa=KR("RegExp"),goi=(r,t)=>{let n=Object.getOwnPropertyDescriptors(r),i={};Ike(n,(o,s)=>{let a;(a=t(o,s,r))!==!1&&(i[s]=a||o)}),Object.defineProperties(r,i)},uKa=r=>{goi(r,(t,n)=>{if(kS(r)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let i=r[n];if(kS(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},dKa=(r,t)=>{let n={},i=o=>{o.forEach(s=>{n[s]=!0})};return vme(r)?i(r):i(String(r).split(t)),n},pKa=()=>{},fKa=(r,t)=>r!=null&&Number.isFinite(r=+r)?r:t,ggr="abcdefghijklmnopqrstuvwxyz",doi="0123456789",moi={DIGIT:doi,ALPHA:ggr,ALPHA_DIGIT:ggr+ggr.toUpperCase()+doi},AKa=(r=16,t=moi.ALPHA_DIGIT)=>{let n="",{length:i}=t;for(;r--;)n+=t[Math.random()*i|0];return n};gKa=r=>{let t=new Array(10),n=(i,o)=>{if(Gpt(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[o]=i;let s=vme(i)?[]:{};return Ike(i,(a,l)=>{let u=n(a,o+1);!Cke(u)&&(s[l]=u)}),t[o]=void 0,s}}return i};return n(r,0)},mKa=KR("AsyncFunction"),yKa=r=>r&&(Gpt(r)||kS(r))&&kS(r.then)&&kS(r.catch),yoi=((r,t)=>r?setImmediate:t?((n,i)=>(rse.addEventListener("message",({source:o,data:s})=>{o===rse&&s===n&&i.length&&i.shift()()},!1),o=>{i.push(o),rse.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",kS(rse.postMessage)),bKa=typeof queueMicrotask<"u"?queueMicrotask.bind(rse):typeof process<"u"&&process.nextTick||yoi,Xt={isArray:vme,isArrayBuffer:poi,isBuffer:PHa,isFormData:GHa,isArrayBufferView:QHa,isString:FHa,isNumber:foi,isBoolean:LHa,isObject:Gpt,isPlainObject:Upt,isReadableStream:HHa,isRequest:KHa,isResponse:YHa,isHeaders:JHa,isUndefined:Cke,isDate:zHa,isFile:qHa,isBlob:UHa,isRegExp:cKa,isFunction:kS,isStream:WHa,isURLSearchParams:VHa,isTypedArray:iKa,isFileList:jHa,forEach:Ike,merge:mgr,extend:XHa,trim:$Ha,stripBOM:ZHa,inherits:eKa,toFlatObject:tKa,kindOf:jpt,kindOfTest:KR,endsWith:rKa,toArray:nKa,forEachEntry:oKa,matchAll:sKa,isHTMLForm:aKa,hasOwnProperty:uoi,hasOwnProp:uoi,reduceDescriptors:goi,freezeMethods:uKa,toObjectSet:dKa,toCamelCase:lKa,noop:pKa,toFiniteNumber:fKa,findKey:Aoi,global:rse,isContextDefined:hoi,ALPHABET:moi,generateString:AKa,isSpecCompliantForm:hKa,toJSONObject:gKa,isAsyncFn:mKa,isThenable:yKa,setImmediate:yoi,asap:bKa}});function Sme(r,t,n,i,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),o&&(this.response=o,this.status=o.status?o.status:null)}var boi,Eoi,Gi,PS=ut(()=>{"use strict";$0();Xt.inherits(Sme,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Xt.toJSONObject(this.config),code:this.code,status:this.status}}});boi=Sme.prototype,Eoi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Eoi[r]={value:r}});Object.defineProperties(Sme,Eoi);Object.defineProperty(boi,"isAxiosError",{value:!0});Sme.from=(r,t,n,i,o,s)=>{let a=Object.create(boi);return Xt.toFlatObject(r,a,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),Sme.call(a,r.message,t,n,i,o),a.cause=r,a.name=r.name,s&&Object.assign(a,s),a};Gi=Sme});var Coi,Vpt,bgr=ut(()=>{Coi=yt(gDe(),1),Vpt=Coi.default});function Egr(r){return Xt.isPlainObject(r)||Xt.isArray(r)}function voi(r){return Xt.endsWith(r,"[]")?r.slice(0,-2):r}function Ioi(r,t,n){return r?r.concat(t).map(function(o,s){return o=voi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function EKa(r){return Xt.isArray(r)&&!r.some(Egr)}function IKa(r,t,n){if(!Xt.isObject(r))throw new TypeError("target must be an object");t=t||new(Vpt||FormData),n=Xt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,C){return!Xt.isUndefined(C[y])});let i=n.metaTokens,o=n.visitor||d,s=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&Xt.isSpecCompliantForm(t);if(!Xt.isFunction(o))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(Xt.isDate(h))return h.toISOString();if(!u&&Xt.isBlob(h))throw new Gi("Blob is not supported. Use a Buffer instead.");return Xt.isArrayBuffer(h)||Xt.isTypedArray(h)?u&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function d(h,y,C){let v=h;if(h&&!C&&typeof h=="object"){if(Xt.endsWith(y,"{}"))y=i?y:y.slice(0,-2),h=JSON.stringify(h);else if(Xt.isArray(h)&&EKa(h)||(Xt.isFileList(h)||Xt.endsWith(y,"[]"))&&(v=Xt.toArray(h)))return y=voi(y),v.forEach(function(_,R){!(Xt.isUndefined(_)||_===null)&&t.append(a===!0?Ioi([y],R,s):a===null?y:y+"[]",c(_))}),!1}return Egr(h)?!0:(t.append(Ioi(C,y,s),c(h)),!1)}let p=[],f=Object.assign(CKa,{defaultVisitor:d,convertValue:c,isVisitable:Egr});function A(h,y){if(!Xt.isUndefined(h)){if(p.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));p.push(h),Xt.forEach(h,function(v,w){(!(Xt.isUndefined(v)||v===null)&&o.call(t,v,Xt.isString(w)?w.trim():w,y,f))===!0&&A(v,y?y.concat(w):[w])}),p.pop()}}if(!Xt.isObject(r))throw new TypeError("data must be an object");return A(r),t}var CKa,rV,vke=ut(()=>{"use strict";$0();PS();bgr();CKa=Xt.toFlatObject(Xt,{},null,function(t){return/^is[A-Z]/.test(t)});rV=IKa});function Soi(r){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Ooi(r,t){this._pairs=[],r&&rV(r,this,t)}var woi,_oi,Toi=ut(()=>{"use strict";vke();woi=Ooi.prototype;woi.append=function(t,n){this._pairs.push([t,n])};woi.toString=function(t){let n=t?function(i){return t.call(this,i,Soi)}:Soi;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};_oi=Ooi});function vKa(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nse(r,t,n){if(!t)return r;let i=n&&n.encode||vKa,o=n&&n.serialize,s;if(o?s=o(t,n):s=Xt.isURLSearchParams(t)?t.toString():new _oi(t,n).toString(i),s){let a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+s}return r}var Hpt=ut(()=>{"use strict";$0();Toi()});var Cgr,Igr,Roi=ut(()=>{"use strict";$0();Cgr=class{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Xt.forEach(this.handlers,function(i){i!==null&&t(i)})}},Igr=Cgr});var Ome,Kpt=ut(()=>{"use strict";Ome={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var Boi,Moi,xoi=ut(()=>{"use strict";Boi=yt(require("url"),1),Moi=Boi.default.URLSearchParams});var Doi,Noi=ut(()=>{xoi();bgr();Doi={isNode:!0,classes:{URLSearchParams:Moi,FormData:Vpt,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]}});var Ogr={};SI(Ogr,{hasBrowserEnv:()=>Sgr,hasStandardBrowserEnv:()=>SKa,hasStandardBrowserWebWorkerEnv:()=>OKa,navigator:()=>vgr,origin:()=>wKa});var Sgr,vgr,SKa,OKa,wKa,koi=ut(()=>{Sgr=typeof window<"u"&&typeof document<"u",vgr=typeof navigator=="object"&&navigator||void 0,SKa=Sgr&&(!vgr||["ReactNative","NativeScript","NS"].indexOf(vgr.product)<0),OKa=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wKa=Sgr&&window.location.href||"http://localhost"});var Cd,FD=ut(()=>{Noi();koi();Cd={...Ogr,...Doi}});function wgr(r,t){return rV(r,new Cd.classes.URLSearchParams,Object.assign({visitor:function(n,i,o,s){return Cd.isNode&&Xt.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}var Poi=ut(()=>{"use strict";$0();vke();FD()});function _Ka(r){return Xt.matchAll(/\w+|\[(\w*)]/g,r).map(t=>t[0]==="[]"?"":t[1]||t[0])}function TKa(r){let t={},n=Object.keys(r),i,o=n.length,s;for(i=0;i<o;i++)s=n[i],t[s]=r[s];return t}function RKa(r){function t(n,i,o,s){let a=n[s++];if(a==="__proto__")return!0;let l=Number.isFinite(+a),u=s>=n.length;return a=!a&&Xt.isArray(o)?o.length:a,u?(Xt.hasOwnProp(o,a)?o[a]=[o[a],i]:o[a]=i,!l):((!o[a]||!Xt.isObject(o[a]))&&(o[a]=[]),t(n,i,o[a],s)&&Xt.isArray(o[a])&&(o[a]=TKa(o[a])),!l)}if(Xt.isFormData(r)&&Xt.isFunction(r.entries)){let n={};return Xt.forEachEntry(r,(i,o)=>{t(_Ka(i),o,n,0)}),n}return null}var Ypt,_gr=ut(()=>{"use strict";$0();Ypt=RKa});function BKa(r,t,n){if(Xt.isString(r))try{return(t||JSON.parse)(r),Xt.trim(r)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(r)}var Tgr,wme,Jpt=ut(()=>{"use strict";$0();PS();Kpt();vke();Poi();FD();_gr();Tgr={transitional:Ome,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i=n.getContentType()||"",o=i.indexOf("application/json")>-1,s=Xt.isObject(t);if(s&&Xt.isHTMLForm(t)&&(t=new FormData(t)),Xt.isFormData(t))return o?JSON.stringify(Ypt(t)):t;if(Xt.isArrayBuffer(t)||Xt.isBuffer(t)||Xt.isStream(t)||Xt.isFile(t)||Xt.isBlob(t)||Xt.isReadableStream(t))return t;if(Xt.isArrayBufferView(t))return t.buffer;if(Xt.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return wgr(t,this.formSerializer).toString();if((l=Xt.isFileList(t))||i.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return rV(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),BKa(t)):t}],transformResponse:[function(t){let n=this.transitional||Tgr.transitional,i=n&&n.forcedJSONParsing,o=this.responseType==="json";if(Xt.isResponse(t)||Xt.isReadableStream(t))return t;if(t&&Xt.isString(t)&&(i&&!this.responseType||o)){let a=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(l){if(a)throw l.name==="SyntaxError"?Gi.from(l,Gi.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Cd.classes.FormData,Blob:Cd.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Xt.forEach(["delete","get","head","post","put","patch"],r=>{Tgr.headers[r]={}});wme=Tgr});var MKa,Qoi,Foi=ut(()=>{"use strict";$0();MKa=Xt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Qoi=r=>{let t={},n,i,o;return r&&r.split(`
142
+ Value: `,n),new KG(n,[{path:"",message:"value triggered unknown runtypes error"}])}}createValidationFailedResult(n,i){let o=[],s=(a,l)=>{for(let[u,c]of Object.entries(l)){let d=a.concat(u);typeof c=="string"?o.push({path:d.join("."),message:c}):s(d,c)}};if(n.code==="TYPE_INCORRECT"||n.code==="CONSTRAINT_FAILED")o.push({path:"",message:n.message});else{let a=n.details;a&&s([],a)}return new KG(i,o)}},GI=(r,t)=>new chr(r,t)});var phr,rja,nja,dhr,ir,tri=ut(()=>{"use strict";phr=yt(wo());fr();QA();Ydt();Wr();rja=r=>r.code==="unrecognized_keys"?r.keys.length:r.code==="invalid_type"&&r.received==="undefined"&&r.message==="Required"?1:r.code==="invalid_literal"?10:0,nja=r=>phr.default.sum(r.issues.map(t=>rja(t))),dhr=class extends sme{constructor(n,i){super(n);this.zodType=i;if(!i)throw new ft(`Missing Zod type for ${n} validator. Did you use a circular import?`)}convertZodError=n=>{let i=[];for(let o of n.issues)if(o.code==="invalid_union"){let s=phr.default.minBy(o.unionErrors,a=>nja(a));s&&i.push(...this.convertZodError(s))}else i.push({path:o.path.join("."),message:o.message});return i};validate(n){try{let i=this.zodType.safeParse(n);if(i.success)return{valid:!0,value:i.data};let o=this.convertZodError(i.error);return new KG(n,o)}catch(i){let o=i instanceof T.ZodError?[i.flatten(),i.issues]:[];return wc().error(`ZodValidator: Unable to validate ${this.name} value`,"error: ",i,"value: ",n,...o),new KG(n,[{path:"",message:"value triggered unknown Zod error"}])}}},ir=(r,t)=>new dhr(r,t)});var Hoe=ut(()=>{"use strict";uhr();Ydt();tri()});var Xdt,Zdt,ori,Koe=ut(()=>{"use strict";Xdt={emerg:"emerg",info:"info",error:"error",debug:"debug",assert:"assert",warn:"warn",alert:"alert",app:"app"},Zdt={LEVELS:{emerg:0,assert:1,alert:2,error:3,app:4,info:5,debug:6,warn:4},COLORS:{emerg:"red",assert:"yellow",alert:"yellow",warn:"yellow",error:"cyan",app:"blue",info:"green",debug:"magenta"}},ori=["Authorization","Token","Password","Secret","idToken","id_token","clientID","clientSecret","apiKey"]});var Ehr,MS,X7e=ut(()=>{"use strict";Ehr=["ACTUAL_STATE","ADVANCED_DEPLOY","APP","AUTH","BULK_WRITE","CLEANUP_TOOL","CLI","CLI_INTERNAL","COLUMN_LINEAGE","COLUMN_METADATA","COMMON","CONNECTION","DEBUG","DEPLOY","DNS","DOCS","DRAG","ENTITY_API","ENV","ENVIRONMENTS","ERROR_OPERATIONS","FIREBASE","FOLDERS","GIT","GIT_SETTINGS","GOOGLE_DEBUG","GRAPH","HEARTBEAT","INTEGRATIONS","JDBC_SERVICE","JEST","JOBS","JSON_PARSER","LIGHTNING_FS","LISTENERS","MACROS","MAPPING_GRID","METADATA_HYDRATION","METADATA_OPERATIONS","NARROW_METADATA","NODE_TYPES","ORGS","ORG_BOOTSTRAP","ORG_SCANNER","ORG_SETTINGS","ORG_UPGRADE","PACKAGES","PACKAGES_BACKEND","PACKAGE_NAMESPACES","PACKAGE_REGISTRY","PALETTE","PARTNER_CONNECT","PENDO","PERFORMANCE","PIPELINE","PLAN","PLATFORM","PRESYNC","PROBLEM_SCANNER","PROJECTS","RBAC","RENDERER","RUNNER","RUNNER_BACKEND","RUN_RESULTS","RUN_TRANSACTION","SEARCH","SECRETS","SECURE_RUN_AND_WORKSPACE","SQL_PARSING","SQL_TESTING","STATE","STEPS","STORAGE_LOCATIONS","STRUMENTA","SYSTEM_EMAILS","TEMPLATE_EDITOR","TESTING","TIMING_UTILS","TREE_OPERATIONS","TYPESENSE","UI","USERS","USER_ACTIVATION","USER_MANAGEMENT","USER_SETTINGS","VERSIONING","VERSION_CONTROL_ACTIONS","WORKSPACES","XML_PARSER","YAML","ZIP","AI_COLUMN_DESCRIPTIONS","AI_NODE_DESCRIPTIONS","AI_GIT_COMMIT_MESSAGE","AI_COPILOT"],MS={...Object.fromEntries(Ehr.map(r=>[r,{level:"info"}]))}});var Yoe,ame,X3,ept=ut(()=>{"use strict";Yoe=(r,t,n,i,o)=>({orgID:r,workspaceID:t,userID:n,runID:i,nodeID:o}),ame=(r,t)=>{r.runID=t},X3={}});var ari=I(sri=>{"use strict";Object.defineProperty(sri,"__esModule",{value:!0})});var Chr=I(tpt=>{"use strict";Object.defineProperty(tpt,"__esModule",{value:!0});tpt.Failcode=void 0;tpt.Failcode={TYPE_INCORRECT:"TYPE_INCORRECT",VALUE_INCORRECT:"VALUE_INCORRECT",KEY_INCORRECT:"KEY_INCORRECT",CONTENT_INCORRECT:"CONTENT_INCORRECT",ARGUMENT_INCORRECT:"ARGUMENT_INCORRECT",RETURN_INCORRECT:"RETURN_INCORRECT",CONSTRAINT_FAILED:"CONSTRAINT_FAILED",PROPERTY_MISSING:"PROPERTY_MISSING",PROPERTY_PRESENT:"PROPERTY_PRESENT",NOTHING_EXPECTED:"NOTHING_EXPECTED"}});var cme=I(lme=>{"use strict";var aja=lme&&lme.__extends||function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i[s]=o[s])},r(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");r(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(lme,"__esModule",{value:!0});lme.ValidationError=void 0;var lja=function(r){aja(t,r);function t(n){var i=r.call(this,n.message)||this;return i.name="ValidationError",i.code=n.code,n.details!==void 0&&(i.details=n.details),Object.setPrototypeOf(i,t.prototype),i}return t}(Error);lme.ValidationError=lja});var Z7e=I(Ihr=>{"use strict";Object.defineProperty(Ihr,"__esModule",{value:!0});var rpt=function(r){return function(t){switch(t.tag){case"literal":return'"'.concat(String(t.value),'"');case"string":return"string";case"brand":return t.brand;case"constraint":return t.name||rpt(r)(t.underlying);case"union":return t.alternatives.map(rpt(r)).join(" | ");case"intersect":return t.intersectees.map(rpt(r)).join(" & ");default:break}return"`${".concat(xS(!1,r)(t),"}`")}},npt=function(r){return function(t){switch(t.tag){case"literal":return String(t.value);case"brand":return"${".concat(t.brand,"}");case"constraint":return t.name?"${".concat(t.name,"}"):npt(r)(t.underlying);case"union":if(t.alternatives.length===1){var n=t.alternatives[0];return npt(r)(n.reflect)}break;case"intersect":if(t.intersectees.length===1){var n=t.intersectees[0];return npt(r)(n.reflect)}break;default:break}return"${".concat(xS(!1,r)(t),"}")}},xS=function(r,t){return function(n){var i=function(c){return r?"(".concat(c,")"):c};if(t.has(n))return i("CIRCULAR ".concat(n.tag));t.add(n);try{switch(n.tag){case"unknown":case"never":case"void":case"boolean":case"number":case"bigint":case"string":case"symbol":case"function":return n.tag;case"literal":{var o=n.value;return typeof o=="string"?'"'.concat(o,'"'):String(o)}case"template":{if(n.strings.length===0)return'""';if(n.strings.length===1)return'"'.concat(n.strings[0],'"');if(n.strings.length===2&&n.strings.every(function(c){return c===""})){var s=n.runtypes[0];return rpt(t)(s.reflect)}var a=!1,l=n.strings.reduce(function(c,d,p){var f=c+d,A=n.runtypes[p];if(A){var h=npt(t)(A.reflect);return!a&&h.startsWith("$")&&(a=!0),f+h}else return f},"");return a?"`".concat(l,"`"):'"'.concat(l,'"')}case"array":return"".concat(lri(n)).concat(xS(!0,t)(n.element),"[]");case"dictionary":return"{ [_: ".concat(n.key,"]: ").concat(xS(!1,t)(n.value)," }");case"record":{var u=Object.keys(n.fields);return u.length?"{ ".concat(u.map(function(c){return"".concat(lri(n)).concat(c).concat(cja(n,c),": ").concat(n.fields[c].tag==="optional"?xS(!1,t)(n.fields[c].underlying):xS(!1,t)(n.fields[c]),";")}).join(" ")," }"):"{}"}case"tuple":return"[".concat(n.components.map(xS(!1,t)).join(", "),"]");case"union":return i("".concat(n.alternatives.map(xS(!0,t)).join(" | ")));case"intersect":return i("".concat(n.intersectees.map(xS(!0,t)).join(" & ")));case"optional":return xS(r,t)(n.underlying)+" | undefined";case"constraint":return n.name||xS(r,t)(n.underlying);case"instanceof":return n.ctor.name;case"brand":return xS(r,t)(n.entity)}}finally{t.delete(n)}throw Error("impossible")}};Ihr.default=xS(!1,new Set);function cja(r,t){var n=r.isPartial,i=r.fields;return n||t!==void 0&&i[t].tag==="optional"?"?":""}function lri(r){var t=r.isReadonly;return t?"readonly ":""}});var v1=I(J0=>{"use strict";var vhr=J0&&J0.__assign||function(){return vhr=Object.assign||function(r){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}return r},vhr.apply(this,arguments)};Object.defineProperty(J0,"__esModule",{value:!0});J0.FAILURE=J0.SUCCESS=J0.enumerableKeysOf=J0.typeOf=J0.hasKey=void 0;var kD=Chr(),Joe=Z7e();function uja(r,t){return typeof t=="object"&&t!==null&&r in t}J0.hasKey=uja;var dja=function(r){var t,n,i;return typeof r=="object"?r===null?"null":Array.isArray(r)?"array":((t=r.constructor)===null||t===void 0?void 0:t.name)==="Object"?"object":(i=(n=r.constructor)===null||n===void 0?void 0:n.name)!==null&&i!==void 0?i:typeof r:typeof r};J0.typeOf=dja;var pja=function(r){return typeof r=="object"&&r!==null?Reflect.ownKeys(r).filter(function(t){var n,i;return(i=(n=r.propertyIsEnumerable)===null||n===void 0?void 0:n.call(r,t))!==null&&i!==void 0?i:!0}):[]};J0.enumerableKeysOf=pja;function fja(r){return{success:!0,value:r}}J0.SUCCESS=fja;J0.FAILURE=Object.assign(function(r,t,n){return vhr({success:!1,code:r,message:t},n?{details:n}:{})},{TYPE_INCORRECT:function(r,t){var n="Expected ".concat(r.tag==="template"?"string ".concat((0,Joe.default)(r)):(0,Joe.default)(r),", but was ").concat((0,J0.typeOf)(t));return(0,J0.FAILURE)(kD.Failcode.TYPE_INCORRECT,n)},VALUE_INCORRECT:function(r,t,n){return(0,J0.FAILURE)(kD.Failcode.VALUE_INCORRECT,"Expected ".concat(r," ").concat(String(t),", but was ").concat(String(n)))},KEY_INCORRECT:function(r,t,n){return(0,J0.FAILURE)(kD.Failcode.KEY_INCORRECT,"Expected ".concat((0,Joe.default)(r)," key to be ").concat((0,Joe.default)(t),", but was ").concat((0,J0.typeOf)(n)))},CONTENT_INCORRECT:function(r,t){var n="Expected ".concat((0,Joe.default)(r),", but was incompatible");return(0,J0.FAILURE)(kD.Failcode.CONTENT_INCORRECT,n,t)},ARGUMENT_INCORRECT:function(r){return(0,J0.FAILURE)(kD.Failcode.ARGUMENT_INCORRECT,r)},RETURN_INCORRECT:function(r){return(0,J0.FAILURE)(kD.Failcode.RETURN_INCORRECT,r)},CONSTRAINT_FAILED:function(r,t){var n=t?": ".concat(t):"";return(0,J0.FAILURE)(kD.Failcode.CONSTRAINT_FAILED,"Failed constraint check for ".concat((0,Joe.default)(r)).concat(n))},PROPERTY_MISSING:function(r){var t="Expected ".concat((0,Joe.default)(r),", but was missing");return(0,J0.FAILURE)(kD.Failcode.PROPERTY_MISSING,t)},PROPERTY_PRESENT:function(r){var t="Expected nothing, but was ".concat((0,J0.typeOf)(r));return(0,J0.FAILURE)(kD.Failcode.PROPERTY_PRESENT,t)},NOTHING_EXPECTED:function(r){var t="Expected nothing, but was ".concat((0,J0.typeOf)(r));return(0,J0.FAILURE)(kD.Failcode.NOTHING_EXPECTED,t)}})});var cri=I(YG=>{"use strict";var Aja=YG&&YG.__read||function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},hja=YG&&YG.__spreadArray||function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))};Object.defineProperty(YG,"__esModule",{value:!0});YG.Contract=void 0;var gja=cme(),mja=v1();function yja(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r.length-1,i=r.slice(0,n),o=r[n];return{enforce:function(s){return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];if(a.length<i.length){var u="Expected ".concat(i.length," arguments but only received ").concat(a.length),c=mja.FAILURE.ARGUMENT_INCORRECT(u);throw new gja.ValidationError(c)}for(var d=0;d<i.length;d++)i[d].check(a[d]);return o.check(s.apply(void 0,hja([],Aja(a),!1)))}}}}YG.Contract=yja});var pri=I(JG=>{"use strict";var bja=JG&&JG.__read||function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},Eja=JG&&JG.__spreadArray||function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))};Object.defineProperty(JG,"__esModule",{value:!0});JG.AsyncContract=void 0;var uri=cme(),dri=v1();function Cja(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=r.length-1,i=r.slice(0,n),o=r[n];return{enforce:function(s){return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];if(a.length<i.length){var u="Expected ".concat(i.length," arguments but only received ").concat(a.length),c=dri.FAILURE.ARGUMENT_INCORRECT(u);throw new uri.ValidationError(c)}for(var d=0;d<i.length;d++)i[d].check(a[d]);var p=s.apply(void 0,Eja([],bja(a),!1));if(!(p instanceof Promise)){var u="Expected function to return a promise, but instead got ".concat(p),c=dri.FAILURE.RETURN_INCORRECT(u);throw new uri.ValidationError(c)}return p.then(o.check)}}}}JG.AsyncContract=Cja});var fri=I(PD=>{"use strict";var Ija=PD&&PD.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&r[t],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vja=PD&&PD.__read||function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s};Object.defineProperty(PD,"__esModule",{value:!0});PD.when=PD.match=void 0;function Sja(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return function(n){var i,o;try{for(var s=Ija(r),a=s.next();!a.done;a=s.next()){var l=vja(a.value,2),u=l[0],c=l[1];if(u.guard(n))return c(n)}}catch(d){i={error:d}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}throw new Error("No alternatives were matched")}}PD.match=Sja;function Oja(r,t){return[r,t]}PD.when=Oja});var Kf=I(XG=>{"use strict";Object.defineProperty(XG,"__esModule",{value:!0});XG.innerValidate=XG.create=XG.isRuntype=void 0;var $G=qw(),wja=Z7e(),_ja=cme(),Ari=v1(),hri=Symbol(),Tja=function(r){return(0,Ari.hasKey)(hri,r)};XG.isRuntype=Tja;function Rja(r,t){return t[hri]=!0,t.check=n,t.assert=n,t._innerValidate=function(p,f){return f.has(p,t)?(0,Ari.SUCCESS)(p):r(p,f)},t.validate=function(p){return t._innerValidate(p,Mja())},t.guard=i,t.Or=o,t.And=s,t.optional=a,t.nullable=l,t.withConstraint=u,t.withGuard=c,t.withBrand=d,t.reflect=t,t.toString=function(){return"Runtype<".concat((0,wja.default)(t),">")},t;function n(p){var f=t.validate(p);if(f.success)return f.value;throw new _ja.ValidationError(f)}function i(p){return t.validate(p).success}function o(p){return(0,$G.Union)(t,p)}function s(p){return(0,$G.Intersect)(t,p)}function a(){return(0,$G.Optional)(t)}function l(){return(0,$G.Union)(t,$G.Null)}function u(p,f){return(0,$G.Constraint)(t,p,f)}function c(p,f){return(0,$G.Constraint)(t,p,f)}function d(p){return(0,$G.Brand)(p,t)}}XG.create=Rja;function Bja(r,t,n){return r._innerValidate(t,n)}XG.innerValidate=Bja;function Mja(){var r=new WeakMap,t=function(i,o){if(!(i===null||typeof i!="object")){var s=r.get(i);r.set(i,s?s.set(o,!0):new WeakMap().set(o,!0))}},n=function(i,o){var s=r.get(i),a=s&&s.get(o)||!1;return t(i,o),a};return{has:n}}});var opt=I(ipt=>{"use strict";Object.defineProperty(ipt,"__esModule",{value:!0});ipt.Unknown=void 0;var xja=Kf(),Dja=v1(),Nja={tag:"unknown"};ipt.Unknown=(0,xja.create)(function(r){return(0,Dja.SUCCESS)(r)},Nja)});var gri=I(spt=>{"use strict";Object.defineProperty(spt,"__esModule",{value:!0});spt.Never=void 0;var kja=Kf(),Pja=v1(),Qja={tag:"never"};spt.Never=(0,kja.create)(Pja.FAILURE.NOTHING_EXPECTED,Qja)});var mri=I(apt=>{"use strict";Object.defineProperty(apt,"__esModule",{value:!0});apt.Void=void 0;var Fja=opt();apt.Void=Fja.Unknown});var Shr=I(ume=>{"use strict";var lpt=ume&&ume.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&r[t],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(ume,"__esModule",{value:!0});ume.Union=void 0;var cpt=Kf(),eke=v1();function Lja(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return function(a){for(var l=0;l<r.length;l++)if(r[l].guard(a))return o[l](a)}},i={tag:"union",alternatives:r,match:n};return(0,cpt.create)(function(o,s){var a,l,u,c,d,p,f,A;if(typeof o!="object"||o===null){try{for(var h=lpt(r),y=h.next();!y.done;y=h.next()){var C=y.value;if((0,cpt.innerValidate)(C,o,s).success)return(0,eke.SUCCESS)(o)}}catch(J){a={error:J}}finally{try{y&&!y.done&&(l=h.return)&&l.call(h)}finally{if(a)throw a.error}}return eke.FAILURE.TYPE_INCORRECT(i,o)}var v={};try{for(var w=lpt(r),_=w.next();!_.done;_=w.next()){var C=_.value;if(C.reflect.tag==="record"){var R=function(K){var Q=C.reflect.fields[K];Q.tag==="literal"&&(v[K]?v[K].every(function($){return $!==Q.value})&&v[K].push(Q.value):v[K]=[Q.value])};for(var N in C.reflect.fields)R(N)}}}catch(J){u={error:J}}finally{try{_&&!_.done&&(c=w.return)&&c.call(w)}finally{if(u)throw u.error}}for(var N in v)if(v[N].length===r.length)try{for(var L=(d=void 0,lpt(r)),G=L.next();!G.done;G=L.next()){var C=G.value;if(C.reflect.tag==="record"){var Y=C.reflect.fields[N];if(Y.tag==="literal"&&(0,eke.hasKey)(N,o)&&o[N]===Y.value)return(0,cpt.innerValidate)(C,o,s)}}}catch(K){d={error:K}}finally{try{G&&!G.done&&(p=L.return)&&p.call(L)}finally{if(d)throw d.error}}try{for(var H=lpt(r),V=H.next();!V.done;V=H.next()){var F=V.value;if((0,cpt.innerValidate)(F,o,s).success)return(0,eke.SUCCESS)(o)}}catch(J){f={error:J}}finally{try{V&&!V.done&&(A=H.return)&&A.call(H)}finally{if(f)throw f.error}}return eke.FAILURE.TYPE_INCORRECT(i,o)},i)}ume.Union=Lja});var _hr=I(VI=>{"use strict";Object.defineProperty(VI,"__esModule",{value:!0});VI.Nullish=VI.Null=VI.Undefined=VI.Literal=VI.literal=void 0;var zja=Kf(),yri=v1(),qja=Shr();function Ohr(r){return Array.isArray(r)?String(r.map(String)):typeof r=="bigint"?String(r)+"n":String(r)}VI.literal=Ohr;function whr(r){var t={tag:"literal",value:r};return(0,zja.create)(function(n){return n===r?(0,yri.SUCCESS)(n):yri.FAILURE.VALUE_INCORRECT("literal","`".concat(Ohr(r),"`"),"`".concat(Ohr(n),"`"))},t)}VI.Literal=whr;VI.Undefined=whr(void 0);VI.Null=whr(null);VI.Nullish=(0,qja.Union)(VI.Null,VI.Undefined)});var vri=I(QD=>{"use strict";var ZG=QD&&QD.__read||function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},Thr=QD&&QD.__spreadArray||function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))},bri=QD&&QD.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&r[t],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(QD,"__esModule",{value:!0});QD.Template=void 0;var upt=Kf(),Eri=Z7e(),$F=v1(),Iri=_hr(),Rhr=function(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},Uja=function(r){if(0<r.length&&Array.isArray(r[0])){var t=ZG(r),n=t[0],i=t.slice(1);return[Array.from(n),i]}else{var o=r,n=o.reduce(function(l,u){return(0,upt.isRuntype)(u)?l.push(""):l.push(l.pop()+String(u)),l},[""]),i=o.filter(upt.isRuntype);return[n,i]}},jja=function(r,t){for(var n=0;n<t.length;)switch(t[n].reflect.tag){case"literal":{var i=t[n];t.splice(n,1);var o=String(i.value);r.splice(n,2,r[n]+o+r[n+1]);break}case"template":{var s=t[n];t.splice.apply(t,Thr([n,1],ZG(s.runtypes),!1));var a=s.strings;if(a.length===1)r.splice(n,2,r[n]+a[0]+r[n+1]);else{var l=a[0],u=a.slice(1,-1),c=a[a.length-1];r.splice.apply(r,Thr(Thr([n,2,r[n]+l],ZG(u),!1),[c+r[n+1]],!1))}break}case"union":{var d=t[n];if(d.alternatives.length===1)try{var p=nke(d);t.splice(n,1);var o=String(p.value);r.splice(n,2,r[n]+o+r[n+1]);break}catch{n++;break}else{n++;break}}case"intersect":{var f=t[n];if(f.intersectees.length===1)try{var A=nke(f);t.splice(n,1);var o=String(A.value);r.splice(n,2,r[n]+o+r[n+1]);break}catch{n++;break}else{n++;break}}default:n++;break}},Wja=function(r){var t=ZG(Uja(r),2),n=t[0],i=t[1];return jja(n,i),[n,i]},nke=function(r){switch(r.reflect.tag){case"literal":return r;case"brand":return nke(r.reflect.entity);case"union":if(r.reflect.alternatives.length===1)return nke(r.reflect.alternatives[0]);break;case"intersect":if(r.reflect.intersectees.length===1)return nke(r.reflect.intersectees[0]);break;default:break}throw void 0},Cri=function(r){return r},Bhr={string:[function(r){return globalThis.String(r)},".*"],number:[function(r){return globalThis.Number(r)},"[+-]?(?:\\d*\\.\\d+|\\d+\\.\\d*|\\d+)(?:[Ee][+-]?\\d+)?","0[Bb][01]+","0[Oo][0-7]+","0[Xx][0-9A-Fa-f]+"],bigint:[function(r){return globalThis.BigInt(r)},"-?[1-9]d*"],boolean:[function(r){return r!=="false"},"true","false"],null:[function(){return null},"null"],undefined:[function(){},"undefined"]},tke=function(r){switch(r.tag){case"literal":{var t=ZG(Bhr[(0,$F.typeOf)(r.value)]||[Cri],1),n=t[0];return n}case"brand":return tke(r.entity);case"constraint":return tke(r.underlying);case"union":return r.alternatives.map(tke);case"intersect":return r.intersectees.map(tke);default:var i=ZG(Bhr[r.tag]||[Cri],1),o=i[0];return o}},Mhr=function(r,t){return function(n){var i,o,s,a,l=tke(r);if(Array.isArray(l))switch(r.tag){case"union":try{for(var u=bri(r.alternatives),c=u.next();!c.done;c=u.next()){var d=c.value,p=Mhr(d.reflect,t)(n);if(p.success)return p}}catch(C){i={error:C}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return $F.FAILURE.TYPE_INCORRECT(r,n);case"intersect":try{for(var f=bri(r.intersectees),A=f.next();!A.done;A=f.next()){var h=A.value,p=Mhr(h.reflect,t)(n);if(!p.success)return p}}catch(C){s={error:C}}finally{try{A&&!A.done&&(a=f.return)&&a.call(f)}finally{if(s)throw s.error}}return(0,$F.SUCCESS)(n);default:throw Error("impossible")}else{var y=l,p=(0,upt.innerValidate)(r,y(n),t);return!p.success&&p.code==="VALUE_INCORRECT"&&r.tag==="literal"?$F.FAILURE.VALUE_INCORRECT("literal",'"'.concat((0,Iri.literal)(r.value),'"'),'"'.concat(n,'"')):p}}},rke=function(r){switch(r.tag){case"literal":return Rhr(String(r.value));case"brand":return rke(r.entity);case"constraint":return rke(r.underlying);case"union":return r.alternatives.map(rke).join("|");case"template":return r.strings.map(Rhr).reduce(function(i,o,s){var a=i+o,l=r.runtypes[s];return l?a+"(?:".concat(rke(l.reflect),")"):a},"");default:var t=ZG(Bhr[r.tag]||[void 0,".*"]),n=t.slice(1);return n.join("|")}},Gja=function(r){var t=r.strings.map(Rhr).reduce(function(n,i,o){var s=n+i,a=r.runtypes[o];return a?s+"(".concat(rke(a.reflect),")"):s},"");return new RegExp("^".concat(t,"$"),"su")};function Vja(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=ZG(Wja(r),2),i=n[0],o=n[1],s={tag:"template",strings:i,runtypes:o},a=Gja(s),l=function(u,c){var d=u.match(a);if(d){for(var p=d.slice(1),f=0;f<o.length;f++){var A=o[f],h=p[f],y=Mhr(A.reflect,c)(h);if(!y.success)return y}return(0,$F.SUCCESS)(u)}else return $F.FAILURE.VALUE_INCORRECT("string","".concat((0,Eri.default)(s)),'"'.concat((0,Iri.literal)(u),'"'))};return(0,upt.create)(function(u,c){if(typeof u!="string")return $F.FAILURE.TYPE_INCORRECT(s,u);var d=l(u,c);if(d.success)return(0,$F.SUCCESS)(u);var p=$F.FAILURE.VALUE_INCORRECT("string","".concat((0,Eri.default)(s)),'"'.concat(u,'"'));return p.message!==d.message&&(p.message+=" (inner: ".concat(d.message,")")),p},s)}QD.Template=Vja});var wri=I(dpt=>{"use strict";Object.defineProperty(dpt,"__esModule",{value:!0});dpt.Boolean=void 0;var Hja=Kf(),Sri=v1(),Ori={tag:"boolean"};dpt.Boolean=(0,Hja.create)(function(r){return typeof r=="boolean"?(0,Sri.SUCCESS)(r):Sri.FAILURE.TYPE_INCORRECT(Ori,r)},Ori)});var Rri=I(ppt=>{"use strict";Object.defineProperty(ppt,"__esModule",{value:!0});ppt.Number=void 0;var Kja=Kf(),_ri=v1(),Tri={tag:"number"};ppt.Number=(0,Kja.create)(function(r){return typeof r=="number"?(0,_ri.SUCCESS)(r):_ri.FAILURE.TYPE_INCORRECT(Tri,r)},Tri)});var xri=I(fpt=>{"use strict";Object.defineProperty(fpt,"__esModule",{value:!0});fpt.BigInt=void 0;var Yja=Kf(),Bri=v1(),Mri={tag:"bigint"};fpt.BigInt=(0,Yja.create)(function(r){return typeof r=="bigint"?(0,Bri.SUCCESS)(r):Bri.FAILURE.TYPE_INCORRECT(Mri,r)},Mri)});var xhr=I(Apt=>{"use strict";Object.defineProperty(Apt,"__esModule",{value:!0});Apt.String=void 0;var Jja=Kf(),Dri=v1(),Nri={tag:"string"};Apt.String=(0,Jja.create)(function(r){return typeof r=="string"?(0,Dri.SUCCESS)(r):Dri.FAILURE.TYPE_INCORRECT(Nri,r)},Nri)});var Fri=I(hpt=>{"use strict";Object.defineProperty(hpt,"__esModule",{value:!0});hpt.Symbol=void 0;var Qri=Kf(),ike=v1(),$ja=function(r){var t={tag:"symbol",key:r};return(0,Qri.create)(function(n){if(typeof n!="symbol")return ike.FAILURE.TYPE_INCORRECT(t,n);var i=globalThis.Symbol.keyFor(n);return i!==r?ike.FAILURE.VALUE_INCORRECT("symbol key",Pri(r),Pri(i)):(0,ike.SUCCESS)(n)},t)},kri={tag:"symbol"};hpt.Symbol=(0,Qri.create)(function(r){return typeof r=="symbol"?(0,ike.SUCCESS)(r):ike.FAILURE.TYPE_INCORRECT(kri,r)},Object.assign($ja,kri));var Pri=function(r){return r===void 0?"undefined":'"'.concat(r,'"')}});var qri=I(gpt=>{"use strict";Object.defineProperty(gpt,"__esModule",{value:!0});gpt.Array=void 0;var Lri=Kf(),oke=v1();function zri(r,t){var n={tag:"array",isReadonly:t,element:r};return Zja((0,Lri.create)(function(i,o){if(!Array.isArray(i))return oke.FAILURE.TYPE_INCORRECT(n,i);var s=(0,oke.enumerableKeysOf)(i),a=s.map(function(u){return(0,Lri.innerValidate)(r,i[u],o)}),l=s.reduce(function(u,c){var d=a[c];return d.success||(u[c]=d.details||d.message),u},[]);return(0,oke.enumerableKeysOf)(l).length!==0?oke.FAILURE.CONTENT_INCORRECT(n,l):(0,oke.SUCCESS)(i)},n))}function Xja(r){return zri(r,!1)}gpt.Array=Xja;function Zja(r){return r.asReadonly=t,r;function t(){return zri(r.element,!0)}}});var jri=I(mpt=>{"use strict";Object.defineProperty(mpt,"__esModule",{value:!0});mpt.Tuple=void 0;var Uri=Kf(),dme=v1();function eWa(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n={tag:"tuple",components:r};return(0,Uri.create)(function(i,o){if(!Array.isArray(i))return dme.FAILURE.TYPE_INCORRECT(n,i);if(i.length!==r.length)return dme.FAILURE.CONSTRAINT_FAILED(n,"Expected length ".concat(r.length,", but was ").concat(i.length));var s=(0,dme.enumerableKeysOf)(i),a=s.map(function(u){return(0,Uri.innerValidate)(r[u],i[u],o)}),l=s.reduce(function(u,c){var d=a[c];return d.success||(u[c]=d.details||d.message),u},[]);return(0,dme.enumerableKeysOf)(l).length!==0?dme.FAILURE.CONTENT_INCORRECT(n,l):(0,dme.SUCCESS)(i)},n)}mpt.Tuple=eWa});var Gri=I(Uw=>{"use strict";var Dhr=Uw&&Uw.__read||function(r,t){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},Nhr=Uw&&Uw.__spreadArray||function(r,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,s;i<o;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return r.concat(s||Array.prototype.slice.call(t))};Object.defineProperty(Uw,"__esModule",{value:!0});Uw.Partial=Uw.Record=Uw.InternalRecord=void 0;var Wri=Kf(),HI=v1();function eV(r,t,n){var i={tag:"record",isPartial:t,isReadonly:n,fields:r};return nWa((0,Wri.create)(function(o,s){if(o==null)return HI.FAILURE.TYPE_INCORRECT(i,o);var a=(0,HI.enumerableKeysOf)(r);if(a.length!==0&&typeof o!="object")return HI.FAILURE.TYPE_INCORRECT(i,o);var l=Nhr([],Dhr(new Set(Nhr(Nhr([],Dhr(a),!1),Dhr((0,HI.enumerableKeysOf)(o)),!1))),!1),u=l.reduce(function(d,p){var f=(0,HI.hasKey)(p,r),A=(0,HI.hasKey)(p,o);if(f){var h=r[p],y=t||h.reflect.tag==="optional";if(A){var C=o[p];y&&C===void 0?d[p]=(0,HI.SUCCESS)(C):d[p]=(0,Wri.innerValidate)(h,C,s)}else y?d[p]=(0,HI.SUCCESS)(void 0):d[p]=HI.FAILURE.PROPERTY_MISSING(h.reflect)}else if(A){var C=o[p];d[p]=(0,HI.SUCCESS)(C)}else throw new Error("impossible");return d},{}),c=l.reduce(function(d,p){var f=u[p];return f.success||(d[p]=f.details||f.message),d},{});return(0,HI.enumerableKeysOf)(c).length!==0?HI.FAILURE.CONTENT_INCORRECT(i,c):(0,HI.SUCCESS)(o)},i))}Uw.InternalRecord=eV;function tWa(r){return eV(r,!1,!1)}Uw.Record=tWa;function rWa(r){return eV(r,!0,!1)}Uw.Partial=rWa;function nWa(r){return r.asPartial=t,r.asReadonly=n,r.pick=i,r.omit=o,r.extend=s,r;function t(){return eV(r.fields,!0,r.isReadonly)}function n(){return eV(r.fields,r.isPartial,!0)}function i(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u={};return a.forEach(function(c){u[c]=r.fields[c]}),eV(u,r.isPartial,r.isReadonly)}function o(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u={},c=(0,HI.enumerableKeysOf)(r.fields);return c.forEach(function(d){a.includes(d)||(u[d]=r.fields[d])}),eV(u,r.isPartial,r.isReadonly)}function s(a){return eV(Object.assign({},r.fields,a),r.isPartial,r.isReadonly)}}});var Phr=I(pme=>{"use strict";Object.defineProperty(pme,"__esModule",{value:!0});pme.Guard=pme.Constraint=void 0;var iWa=Kf(),khr=v1(),oWa=opt();function sWa(r,t,n){var i=n&&n.name,o=n&&n.args,s={tag:"constraint",underlying:r,constraint:t,name:i,args:o};return(0,iWa.create)(function(a){var l=r.validate(a);if(!l.success)return l;var u=t(l.value);return typeof u=="string"?khr.FAILURE.CONSTRAINT_FAILED(s,u):u?(0,khr.SUCCESS)(l.value):khr.FAILURE.CONSTRAINT_FAILED(s)},s)}pme.Constraint=sWa;var aWa=function(r,t){return oWa.Unknown.withGuard(r,t)};pme.Guard=aWa});var Hri=I(ypt=>{"use strict";Object.defineProperty(ypt,"__esModule",{value:!0});ypt.Dictionary=void 0;var Vri=Kf(),Qhr=xhr(),lWa=Phr(),cWa=Z7e(),$oe=v1(),uWa=(0,lWa.Constraint)(Qhr.String,function(r){return!isNaN(+r)},{name:"number"});function dWa(r,t){var n=t===void 0||t==="string"?Qhr.String:t==="number"?uWa:t,i=(0,cWa.default)(n),o={tag:"dictionary",key:i,value:r};return(0,Vri.create)(function(s,a){if(s==null||typeof s!="object"||Object.getPrototypeOf(s)!==Object.prototype&&(!Array.isArray(s)||i==="string"))return $oe.FAILURE.TYPE_INCORRECT(o,s);var l=/^(?:NaN|-?\d+(?:\.\d+)?)$/,u=(0,$oe.enumerableKeysOf)(s),c=u.reduce(function(p,f){var A=typeof f=="string"&&l.test(f),h=A?globalThis.Number(f):f;return(A?!n.guard(h)&&!n.guard(f):!n.guard(h))?p[f]=$oe.FAILURE.KEY_INCORRECT(o,n.reflect,h):p[f]=(0,Vri.innerValidate)(r,s[f],a),p},{}),d=u.reduce(function(p,f){var A=c[f];return A.success||(p[f]=A.details||A.message),p},{});return(0,$oe.enumerableKeysOf)(d).length!==0?$oe.FAILURE.CONTENT_INCORRECT(o,d):(0,$oe.SUCCESS)(s)},o)}ypt.Dictionary=dWa});var Yri=I(fme=>{"use strict";var pWa=fme&&fme.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&r[t],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(fme,"__esModule",{value:!0});fme.Intersect=void 0;var Kri=Kf(),fWa=v1();function AWa(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n={tag:"intersect",intersectees:r};return(0,Kri.create)(function(i,o){var s,a;try{for(var l=pWa(r),u=l.next();!u.done;u=l.next()){var c=u.value,d=(0,Kri.innerValidate)(c,i,o);if(!d.success)return d}}catch(p){s={error:p}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(s)throw s.error}}return(0,fWa.SUCCESS)(i)},n)}fme.Intersect=AWa});var Jri=I(bpt=>{"use strict";Object.defineProperty(bpt,"__esModule",{value:!0});bpt.Optional=void 0;var hWa=Kf(),gWa=v1();function mWa(r){var t={tag:"optional",underlying:r};return(0,hWa.create)(function(n){return n===void 0?(0,gWa.SUCCESS)(n):r.validate(n)},t)}bpt.Optional=mWa});var Zri=I(Ept=>{"use strict";Object.defineProperty(Ept,"__esModule",{value:!0});Ept.Function=void 0;var yWa=Kf(),$ri=v1(),Xri={tag:"function"};Ept.Function=(0,yWa.create)(function(r){return typeof r=="function"?(0,$ri.SUCCESS)(r):$ri.FAILURE.TYPE_INCORRECT(Xri,r)},Xri)});var tni=I(Cpt=>{"use strict";Object.defineProperty(Cpt,"__esModule",{value:!0});Cpt.InstanceOf=void 0;var bWa=Kf(),eni=v1();function EWa(r){var t={tag:"instanceof",ctor:r};return(0,bWa.create)(function(n){return n instanceof r?(0,eni.SUCCESS)(n):eni.FAILURE.TYPE_INCORRECT(t,n)},t)}Cpt.InstanceOf=EWa});var rni=I(Ipt=>{"use strict";Object.defineProperty(Ipt,"__esModule",{value:!0});Ipt.Lazy=void 0;var CWa=Kf();function IWa(r){var t={get tag(){return i().tag}},n;function i(){if(!n){n=r();for(var o in n)o!=="tag"&&(t[o]=n[o])}return n}return(0,CWa.create)(function(o){return i().validate(o)},t)}Ipt.Lazy=IWa});var nni=I(vpt=>{"use strict";Object.defineProperty(vpt,"__esModule",{value:!0});vpt.Brand=void 0;var vWa=Kf();function SWa(r,t){var n={tag:"brand",brand:r,entity:t};return(0,vWa.create)(function(i){return t.validate(i)},n)}vpt.Brand=SWa});var ini=I(Ame=>{"use strict";Object.defineProperty(Ame,"__esModule",{value:!0});Ame.checked=Ame.check=void 0;var OWa=cme(),wWa=v1(),Fhr=new WeakMap;function _Wa(r,t,n){var i=Fhr.get(r)||new Map;Fhr.set(r,i);var o=i.get(t)||[];i.set(t,o),o.push(n)}Ame.check=_Wa;function TWa(r,t,n){var i=Fhr.get(r),o=i&&i.get(t);if(o)return o;for(var s=[],a=0;a<n;a++)s.push(a);return s}function RWa(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];if(r.length===0)throw new Error("No runtype provided to `@checked`. Please remove the decorator.");return function(n,i,o){var s=o.value,a=(n.name||n.constructor.name+".prototype")+(typeof i=="string"?'["'.concat(i,'"]'):"[".concat(String(i),"]")),l=TWa(n,i,r.length);if(l.length!==r.length)throw new Error("Number of `@checked` runtypes and @check parameters not matched.");if(l.length>s.length)throw new Error("Number of `@checked` runtypes exceeds actual parameter length.");o.value=function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return r.forEach(function(d,p){var f=l[p],A=d.validate(u[f]);if(!A.success){var h="".concat(a,", argument #").concat(f,": ").concat(A.message),y=wWa.FAILURE.ARGUMENT_INCORRECT(h);throw new OWa.ValidationError(y)}}),s.apply(this,u)}}}Ame.checked=RWa});var qw=I(Ga=>{"use strict";var BWa=Ga&&Ga.__createBinding||(Object.create?function(r,t,n,i){i===void 0&&(i=n),Object.defineProperty(r,i,{enumerable:!0,get:function(){return t[n]}})}:function(r,t,n,i){i===void 0&&(i=n),r[i]=t[n]}),Ed=Ga&&Ga.__exportStar||function(r,t){for(var n in r)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&BWa(t,r,n)};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.InstanceOf=Ga.Nullish=Ga.Null=Ga.Undefined=Ga.Literal=void 0;Ed(ari(),Ga);Ed(Chr(),Ga);Ed(cri(),Ga);Ed(pri(),Ga);Ed(fri(),Ga);Ed(cme(),Ga);Ed(opt(),Ga);Ed(gri(),Ga);Ed(mri(),Ga);var Spt=_hr();Object.defineProperty(Ga,"Literal",{enumerable:!0,get:function(){return Spt.Literal}});Object.defineProperty(Ga,"Undefined",{enumerable:!0,get:function(){return Spt.Undefined}});Object.defineProperty(Ga,"Null",{enumerable:!0,get:function(){return Spt.Null}});Object.defineProperty(Ga,"Nullish",{enumerable:!0,get:function(){return Spt.Nullish}});Ed(vri(),Ga);Ed(wri(),Ga);Ed(Rri(),Ga);Ed(xri(),Ga);Ed(xhr(),Ga);Ed(Fri(),Ga);Ed(qri(),Ga);Ed(jri(),Ga);Ed(Gri(),Ga);Ed(Hri(),Ga);Ed(Shr(),Ga);Ed(Yri(),Ga);Ed(Jri(),Ga);Ed(Zri(),Ga);var MWa=tni();Object.defineProperty(Ga,"InstanceOf",{enumerable:!0,get:function(){return MWa.InstanceOf}});Ed(rni(),Ga);Ed(Phr(),Ga);Ed(nni(),Ga);Ed(ini(),Ga)});var ske=I((CEd,oni)=>{var xWa="2.0.0",DWa=Number.MAX_SAFE_INTEGER||9007199254740991,NWa=16,kWa=250,PWa=["major","premajor","minor","preminor","patch","prepatch","prerelease"];oni.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:NWa,MAX_SAFE_BUILD_LENGTH:kWa,MAX_SAFE_INTEGER:DWa,RELEASE_TYPES:PWa,SEMVER_SPEC_VERSION:xWa,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ake=I((IEd,sni)=>{var QWa=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};sni.exports=QWa});var hme=I((XF,ani)=>{var{MAX_SAFE_COMPONENT_LENGTH:Lhr,MAX_SAFE_BUILD_LENGTH:FWa,MAX_LENGTH:LWa}=ske(),zWa=ake();XF=ani.exports={};var qWa=XF.re=[],UWa=XF.safeRe=[],Go=XF.src=[],Vo=XF.t={},jWa=0,zhr="[a-zA-Z0-9-]",WWa=[["\\s",1],["\\d",LWa],[zhr,FWa]],GWa=r=>{for(let[t,n]of WWa)r=r.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return r},Bl=(r,t,n)=>{let i=GWa(t),o=jWa++;zWa(r,o,t),Vo[r]=o,Go[o]=t,qWa[o]=new RegExp(t,n?"g":void 0),UWa[o]=new RegExp(i,n?"g":void 0)};Bl("NUMERICIDENTIFIER","0|[1-9]\\d*");Bl("NUMERICIDENTIFIERLOOSE","\\d+");Bl("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${zhr}*`);Bl("MAINVERSION",`(${Go[Vo.NUMERICIDENTIFIER]})\\.(${Go[Vo.NUMERICIDENTIFIER]})\\.(${Go[Vo.NUMERICIDENTIFIER]})`);Bl("MAINVERSIONLOOSE",`(${Go[Vo.NUMERICIDENTIFIERLOOSE]})\\.(${Go[Vo.NUMERICIDENTIFIERLOOSE]})\\.(${Go[Vo.NUMERICIDENTIFIERLOOSE]})`);Bl("PRERELEASEIDENTIFIER",`(?:${Go[Vo.NUMERICIDENTIFIER]}|${Go[Vo.NONNUMERICIDENTIFIER]})`);Bl("PRERELEASEIDENTIFIERLOOSE",`(?:${Go[Vo.NUMERICIDENTIFIERLOOSE]}|${Go[Vo.NONNUMERICIDENTIFIER]})`);Bl("PRERELEASE",`(?:-(${Go[Vo.PRERELEASEIDENTIFIER]}(?:\\.${Go[Vo.PRERELEASEIDENTIFIER]})*))`);Bl("PRERELEASELOOSE",`(?:-?(${Go[Vo.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Go[Vo.PRERELEASEIDENTIFIERLOOSE]})*))`);Bl("BUILDIDENTIFIER",`${zhr}+`);Bl("BUILD",`(?:\\+(${Go[Vo.BUILDIDENTIFIER]}(?:\\.${Go[Vo.BUILDIDENTIFIER]})*))`);Bl("FULLPLAIN",`v?${Go[Vo.MAINVERSION]}${Go[Vo.PRERELEASE]}?${Go[Vo.BUILD]}?`);Bl("FULL",`^${Go[Vo.FULLPLAIN]}$`);Bl("LOOSEPLAIN",`[v=\\s]*${Go[Vo.MAINVERSIONLOOSE]}${Go[Vo.PRERELEASELOOSE]}?${Go[Vo.BUILD]}?`);Bl("LOOSE",`^${Go[Vo.LOOSEPLAIN]}$`);Bl("GTLT","((?:<|>)?=?)");Bl("XRANGEIDENTIFIERLOOSE",`${Go[Vo.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Bl("XRANGEIDENTIFIER",`${Go[Vo.NUMERICIDENTIFIER]}|x|X|\\*`);Bl("XRANGEPLAIN",`[v=\\s]*(${Go[Vo.XRANGEIDENTIFIER]})(?:\\.(${Go[Vo.XRANGEIDENTIFIER]})(?:\\.(${Go[Vo.XRANGEIDENTIFIER]})(?:${Go[Vo.PRERELEASE]})?${Go[Vo.BUILD]}?)?)?`);Bl("XRANGEPLAINLOOSE",`[v=\\s]*(${Go[Vo.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Go[Vo.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Go[Vo.XRANGEIDENTIFIERLOOSE]})(?:${Go[Vo.PRERELEASELOOSE]})?${Go[Vo.BUILD]}?)?)?`);Bl("XRANGE",`^${Go[Vo.GTLT]}\\s*${Go[Vo.XRANGEPLAIN]}$`);Bl("XRANGELOOSE",`^${Go[Vo.GTLT]}\\s*${Go[Vo.XRANGEPLAINLOOSE]}$`);Bl("COERCE",`(^|[^\\d])(\\d{1,${Lhr}})(?:\\.(\\d{1,${Lhr}}))?(?:\\.(\\d{1,${Lhr}}))?(?:$|[^\\d])`);Bl("COERCERTL",Go[Vo.COERCE],!0);Bl("LONETILDE","(?:~>?)");Bl("TILDETRIM",`(\\s*)${Go[Vo.LONETILDE]}\\s+`,!0);XF.tildeTrimReplace="$1~";Bl("TILDE",`^${Go[Vo.LONETILDE]}${Go[Vo.XRANGEPLAIN]}$`);Bl("TILDELOOSE",`^${Go[Vo.LONETILDE]}${Go[Vo.XRANGEPLAINLOOSE]}$`);Bl("LONECARET","(?:\\^)");Bl("CARETTRIM",`(\\s*)${Go[Vo.LONECARET]}\\s+`,!0);XF.caretTrimReplace="$1^";Bl("CARET",`^${Go[Vo.LONECARET]}${Go[Vo.XRANGEPLAIN]}$`);Bl("CARETLOOSE",`^${Go[Vo.LONECARET]}${Go[Vo.XRANGEPLAINLOOSE]}$`);Bl("COMPARATORLOOSE",`^${Go[Vo.GTLT]}\\s*(${Go[Vo.LOOSEPLAIN]})$|^$`);Bl("COMPARATOR",`^${Go[Vo.GTLT]}\\s*(${Go[Vo.FULLPLAIN]})$|^$`);Bl("COMPARATORTRIM",`(\\s*)${Go[Vo.GTLT]}\\s*(${Go[Vo.LOOSEPLAIN]}|${Go[Vo.XRANGEPLAIN]})`,!0);XF.comparatorTrimReplace="$1$2$3";Bl("HYPHENRANGE",`^\\s*(${Go[Vo.XRANGEPLAIN]})\\s+-\\s+(${Go[Vo.XRANGEPLAIN]})\\s*$`);Bl("HYPHENRANGELOOSE",`^\\s*(${Go[Vo.XRANGEPLAINLOOSE]})\\s+-\\s+(${Go[Vo.XRANGEPLAINLOOSE]})\\s*$`);Bl("STAR","(<|>)?=?\\s*\\*");Bl("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Bl("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Opt=I((vEd,lni)=>{var VWa=Object.freeze({loose:!0}),HWa=Object.freeze({}),KWa=r=>r?typeof r!="object"?VWa:r:HWa;lni.exports=KWa});var qhr=I((SEd,dni)=>{var cni=/^[0-9]+$/,uni=(r,t)=>{let n=cni.test(r),i=cni.test(t);return n&&i&&(r=+r,t=+t),r===t?0:n&&!i?-1:i&&!n?1:r<t?-1:1},YWa=(r,t)=>uni(t,r);dni.exports={compareIdentifiers:uni,rcompareIdentifiers:YWa}});var Z3=I((OEd,hni)=>{var wpt=ake(),{MAX_LENGTH:pni,MAX_SAFE_INTEGER:_pt}=ske(),{safeRe:fni,t:Ani}=hme(),JWa=Opt(),{compareIdentifiers:gme}=qhr(),Uhr=class r{constructor(t,n){if(n=JWa(n),t instanceof r){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>pni)throw new TypeError(`version is longer than ${pni} characters`);wpt("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=t.trim().match(n.loose?fni[Ani.LOOSE]:fni[Ani.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>_pt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>_pt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>_pt||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<_pt)return s}return o}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(wpt("SemVer.compare",this.version,this.options,t),!(t instanceof r)){if(typeof t=="string"&&t===this.version)return 0;t=new r(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof r||(t=new r(t,this.options)),gme(this.major,t.major)||gme(this.minor,t.minor)||gme(this.patch,t.patch)}comparePre(t){if(t instanceof r||(t=new r(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let i=this.prerelease[n],o=t.prerelease[n];if(wpt("prerelease compare",n,i,o),i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(i===o)continue;return gme(i,o)}while(++n)}compareBuild(t){t instanceof r||(t=new r(t,this.options));let n=0;do{let i=this.build[n],o=t.build[n];if(wpt("prerelease compare",n,i,o),i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(i===o)continue;return gme(i,o)}while(++n)}inc(t,n,i){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(i)?1:0;if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let s=[n,o];i===!1&&(s=[n]),gme(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};hni.exports=Uhr});var Xoe=I((wEd,mni)=>{var gni=Z3(),$Wa=(r,t,n=!1)=>{if(r instanceof gni)return r;try{return new gni(r,t)}catch(i){if(!n)return null;throw i}};mni.exports=$Wa});var bni=I((_Ed,yni)=>{var XWa=Xoe(),ZWa=(r,t)=>{let n=XWa(r,t);return n?n.version:null};yni.exports=ZWa});var Cni=I((TEd,Eni)=>{var eGa=Xoe(),tGa=(r,t)=>{let n=eGa(r.trim().replace(/^[=v]+/,""),t);return n?n.version:null};Eni.exports=tGa});var Sni=I((REd,vni)=>{var Ini=Z3(),rGa=(r,t,n,i,o)=>{typeof n=="string"&&(o=i,i=n,n=void 0);try{return new Ini(r instanceof Ini?r.version:r,n).inc(t,i,o).version}catch{return null}};vni.exports=rGa});var _ni=I((BEd,wni)=>{var Oni=Xoe(),nGa=(r,t)=>{let n=Oni(r,null,!0),i=Oni(t,null,!0),o=n.compare(i);if(o===0)return null;let s=o>0,a=s?n:i,l=s?i:n,u=!!a.prerelease.length;if(!!l.prerelease.length&&!u)return!l.patch&&!l.minor?"major":a.patch?"patch":a.minor?"minor":"major";let d=u?"pre":"";return n.major!==i.major?d+"major":n.minor!==i.minor?d+"minor":n.patch!==i.patch?d+"patch":"prerelease"};wni.exports=nGa});var Rni=I((MEd,Tni)=>{var iGa=Z3(),oGa=(r,t)=>new iGa(r,t).major;Tni.exports=oGa});var Mni=I((xEd,Bni)=>{var sGa=Z3(),aGa=(r,t)=>new sGa(r,t).minor;Bni.exports=aGa});var Dni=I((DEd,xni)=>{var lGa=Z3(),cGa=(r,t)=>new lGa(r,t).patch;xni.exports=cGa});var kni=I((NEd,Nni)=>{var uGa=Xoe(),dGa=(r,t)=>{let n=uGa(r,t);return n&&n.prerelease.length?n.prerelease:null};Nni.exports=dGa});var jw=I((kEd,Qni)=>{var Pni=Z3(),pGa=(r,t,n)=>new Pni(r,n).compare(new Pni(t,n));Qni.exports=pGa});var Lni=I((PEd,Fni)=>{var fGa=jw(),AGa=(r,t,n)=>fGa(t,r,n);Fni.exports=AGa});var qni=I((QEd,zni)=>{var hGa=jw(),gGa=(r,t)=>hGa(r,t,!0);zni.exports=gGa});var Tpt=I((FEd,jni)=>{var Uni=Z3(),mGa=(r,t,n)=>{let i=new Uni(r,n),o=new Uni(t,n);return i.compare(o)||i.compareBuild(o)};jni.exports=mGa});var Gni=I((LEd,Wni)=>{var yGa=Tpt(),bGa=(r,t)=>r.sort((n,i)=>yGa(n,i,t));Wni.exports=bGa});var Hni=I((zEd,Vni)=>{var EGa=Tpt(),CGa=(r,t)=>r.sort((n,i)=>EGa(i,n,t));Vni.exports=CGa});var lke=I((qEd,Kni)=>{var IGa=jw(),vGa=(r,t,n)=>IGa(r,t,n)>0;Kni.exports=vGa});var Rpt=I((UEd,Yni)=>{var SGa=jw(),OGa=(r,t,n)=>SGa(r,t,n)<0;Yni.exports=OGa});var jhr=I((jEd,Jni)=>{var wGa=jw(),_Ga=(r,t,n)=>wGa(r,t,n)===0;Jni.exports=_Ga});var Whr=I((WEd,$ni)=>{var TGa=jw(),RGa=(r,t,n)=>TGa(r,t,n)!==0;$ni.exports=RGa});var Bpt=I((GEd,Xni)=>{var BGa=jw(),MGa=(r,t,n)=>BGa(r,t,n)>=0;Xni.exports=MGa});var Mpt=I((VEd,Zni)=>{var xGa=jw(),DGa=(r,t,n)=>xGa(r,t,n)<=0;Zni.exports=DGa});var Ghr=I((HEd,eii)=>{var NGa=jhr(),kGa=Whr(),PGa=lke(),QGa=Bpt(),FGa=Rpt(),LGa=Mpt(),zGa=(r,t,n,i)=>{switch(t){case"===":return typeof r=="object"&&(r=r.version),typeof n=="object"&&(n=n.version),r===n;case"!==":return typeof r=="object"&&(r=r.version),typeof n=="object"&&(n=n.version),r!==n;case"":case"=":case"==":return NGa(r,n,i);case"!=":return kGa(r,n,i);case">":return PGa(r,n,i);case">=":return QGa(r,n,i);case"<":return FGa(r,n,i);case"<=":return LGa(r,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};eii.exports=zGa});var rii=I((KEd,tii)=>{var qGa=Z3(),UGa=Xoe(),{safeRe:xpt,t:Dpt}=hme(),jGa=(r,t)=>{if(r instanceof qGa)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;t=t||{};let n=null;if(!t.rtl)n=r.match(xpt[Dpt.COERCE]);else{let i;for(;(i=xpt[Dpt.COERCERTL].exec(r))&&(!n||n.index+n[0].length!==r.length);)(!n||i.index+i[0].length!==n.index+n[0].length)&&(n=i),xpt[Dpt.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;xpt[Dpt.COERCERTL].lastIndex=-1}return n===null?null:UGa(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};tii.exports=jGa});var iii=I((YEd,nii)=>{"use strict";nii.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}});var Vhr=I((JEd,oii)=>{"use strict";oii.exports=ku;ku.Node=Zoe;ku.create=ku;function ku(r){var t=this;if(t instanceof ku||(t=new ku),t.tail=null,t.head=null,t.length=0,r&&typeof r.forEach=="function")r.forEach(function(o){t.push(o)});else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}ku.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var t=r.next,n=r.prev;return t&&(t.prev=n),n&&(n.next=t),r===this.head&&(this.head=t),r===this.tail&&(this.tail=n),r.list.length--,r.next=null,r.prev=null,r.list=null,t};ku.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var t=this.head;r.list=this,r.next=t,t&&(t.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};ku.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var t=this.tail;r.list=this,r.prev=t,t&&(t.next=r),this.tail=r,this.head||(this.head=r),this.length++}};ku.prototype.push=function(){for(var r=0,t=arguments.length;r<t;r++)GGa(this,arguments[r]);return this.length};ku.prototype.unshift=function(){for(var r=0,t=arguments.length;r<t;r++)VGa(this,arguments[r]);return this.length};ku.prototype.pop=function(){if(this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};ku.prototype.shift=function(){if(this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};ku.prototype.forEach=function(r,t){t=t||this;for(var n=this.head,i=0;n!==null;i++)r.call(t,n.value,i,this),n=n.next};ku.prototype.forEachReverse=function(r,t){t=t||this;for(var n=this.tail,i=this.length-1;n!==null;i--)r.call(t,n.value,i,this),n=n.prev};ku.prototype.get=function(r){for(var t=0,n=this.head;n!==null&&t<r;t++)n=n.next;if(t===r&&n!==null)return n.value};ku.prototype.getReverse=function(r){for(var t=0,n=this.tail;n!==null&&t<r;t++)n=n.prev;if(t===r&&n!==null)return n.value};ku.prototype.map=function(r,t){t=t||this;for(var n=new ku,i=this.head;i!==null;)n.push(r.call(t,i.value,this)),i=i.next;return n};ku.prototype.mapReverse=function(r,t){t=t||this;for(var n=new ku,i=this.tail;i!==null;)n.push(r.call(t,i.value,this)),i=i.prev;return n};ku.prototype.reduce=function(r,t){var n,i=this.head;if(arguments.length>1)n=t;else if(this.head)i=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;i!==null;o++)n=r(n,i.value,o),i=i.next;return n};ku.prototype.reduceReverse=function(r,t){var n,i=this.tail;if(arguments.length>1)n=t;else if(this.tail)i=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=this.length-1;i!==null;o--)n=r(n,i.value,o),i=i.prev;return n};ku.prototype.toArray=function(){for(var r=new Array(this.length),t=0,n=this.head;n!==null;t++)r[t]=n.value,n=n.next;return r};ku.prototype.toArrayReverse=function(){for(var r=new Array(this.length),t=0,n=this.tail;n!==null;t++)r[t]=n.value,n=n.prev;return r};ku.prototype.slice=function(r,t){t=t||this.length,t<0&&(t+=this.length),r=r||0,r<0&&(r+=this.length);var n=new ku;if(t<r||t<0)return n;r<0&&(r=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;o!==null&&i<r;i++)o=o.next;for(;o!==null&&i<t;i++,o=o.next)n.push(o.value);return n};ku.prototype.sliceReverse=function(r,t){t=t||this.length,t<0&&(t+=this.length),r=r||0,r<0&&(r+=this.length);var n=new ku;if(t<r||t<0)return n;r<0&&(r=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;o!==null&&i>t;i--)o=o.prev;for(;o!==null&&i>r;i--,o=o.prev)n.push(o.value);return n};ku.prototype.splice=function(r,t,...n){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var i=0,o=this.head;o!==null&&i<r;i++)o=o.next;for(var s=[],i=0;o&&i<t;i++)s.push(o.value),o=this.removeNode(o);o===null&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(var i=0;i<n.length;i++)o=WGa(this,o,n[i]);return s};ku.prototype.reverse=function(){for(var r=this.head,t=this.tail,n=r;n!==null;n=n.prev){var i=n.prev;n.prev=n.next,n.next=i}return this.head=t,this.tail=r,this};function WGa(r,t,n){var i=t===r.head?new Zoe(n,null,t,r):new Zoe(n,t,t.next,r);return i.next===null&&(r.tail=i),i.prev===null&&(r.head=i),r.length++,i}function GGa(r,t){r.tail=new Zoe(t,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function VGa(r,t){r.head=new Zoe(t,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function Zoe(r,t,n,i){if(!(this instanceof Zoe))return new Zoe(r,t,n,i);this.list=i,this.value=r,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{iii()(ku)}catch{}});var bme=I(($Ed,cii)=>{"use strict";var HGa=Vhr(),ese=Symbol("max"),eL=Symbol("length"),mme=Symbol("lengthCalculator"),uke=Symbol("allowStale"),tse=Symbol("maxAge"),ZF=Symbol("dispose"),sii=Symbol("noDisposeOnSet"),Qm=Symbol("lruList"),HR=Symbol("cache"),lii=Symbol("updateAgeOnGet"),Hhr=()=>1,Yhr=class{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");let n=this[ese]=t.max||1/0,i=t.length||Hhr;if(this[mme]=typeof i!="function"?Hhr:i,this[uke]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[tse]=t.maxAge||0,this[ZF]=t.dispose,this[sii]=t.noDisposeOnSet||!1,this[lii]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[ese]=t||1/0,cke(this)}get max(){return this[ese]}set allowStale(t){this[uke]=!!t}get allowStale(){return this[uke]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[tse]=t,cke(this)}get maxAge(){return this[tse]}set lengthCalculator(t){typeof t!="function"&&(t=Hhr),t!==this[mme]&&(this[mme]=t,this[eL]=0,this[Qm].forEach(n=>{n.length=this[mme](n.value,n.key),this[eL]+=n.length})),cke(this)}get lengthCalculator(){return this[mme]}get length(){return this[eL]}get itemCount(){return this[Qm].length}rforEach(t,n){n=n||this;for(let i=this[Qm].tail;i!==null;){let o=i.prev;aii(this,t,i,n),i=o}}forEach(t,n){n=n||this;for(let i=this[Qm].head;i!==null;){let o=i.next;aii(this,t,i,n),i=o}}keys(){return this[Qm].toArray().map(t=>t.key)}values(){return this[Qm].toArray().map(t=>t.value)}reset(){this[ZF]&&this[Qm]&&this[Qm].length&&this[Qm].forEach(t=>this[ZF](t.key,t.value)),this[HR]=new Map,this[Qm]=new HGa,this[eL]=0}dump(){return this[Qm].map(t=>Npt(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[Qm]}set(t,n,i){if(i=i||this[tse],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let o=i?Date.now():0,s=this[mme](n,t);if(this[HR].has(t)){if(s>this[ese])return yme(this,this[HR].get(t)),!1;let u=this[HR].get(t).value;return this[ZF]&&(this[sii]||this[ZF](t,u.value)),u.now=o,u.maxAge=i,u.value=n,this[eL]+=s-u.length,u.length=s,this.get(t),cke(this),!0}let a=new Jhr(t,n,s,o,i);return a.length>this[ese]?(this[ZF]&&this[ZF](t,n),!1):(this[eL]+=a.length,this[Qm].unshift(a),this[HR].set(t,this[Qm].head),cke(this),!0)}has(t){if(!this[HR].has(t))return!1;let n=this[HR].get(t).value;return!Npt(this,n)}get(t){return Khr(this,t,!0)}peek(t){return Khr(this,t,!1)}pop(){let t=this[Qm].tail;return t?(yme(this,t),t.value):null}del(t){yme(this,this[HR].get(t))}load(t){this.reset();let n=Date.now();for(let i=t.length-1;i>=0;i--){let o=t[i],s=o.e||0;if(s===0)this.set(o.k,o.v);else{let a=s-n;a>0&&this.set(o.k,o.v,a)}}}prune(){this[HR].forEach((t,n)=>Khr(this,n,!1))}},Khr=(r,t,n)=>{let i=r[HR].get(t);if(i){let o=i.value;if(Npt(r,o)){if(yme(r,i),!r[uke])return}else n&&(r[lii]&&(i.value.now=Date.now()),r[Qm].unshiftNode(i));return o.value}},Npt=(r,t)=>{if(!t||!t.maxAge&&!r[tse])return!1;let n=Date.now()-t.now;return t.maxAge?n>t.maxAge:r[tse]&&n>r[tse]},cke=r=>{if(r[eL]>r[ese])for(let t=r[Qm].tail;r[eL]>r[ese]&&t!==null;){let n=t.prev;yme(r,t),t=n}},yme=(r,t)=>{if(t){let n=t.value;r[ZF]&&r[ZF](n.key,n.value),r[eL]-=n.length,r[HR].delete(n.key),r[Qm].removeNode(t)}},Jhr=class{constructor(t,n,i,o,s){this.key=t,this.value=n,this.length=i,this.now=o,this.maxAge=s||0}},aii=(r,t,n,i)=>{let o=n.value;Npt(r,o)&&(yme(r,n),r[uke]||(o=void 0)),o&&t.call(i,o.value,o.key,r)};cii.exports=Yhr});var Ww=I((XEd,fii)=>{var $hr=class r{constructor(t,n){if(n=YGa(n),t instanceof r)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new r(t.raw,n);if(t instanceof Xhr)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(o=>!dii(o[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&rVa(o[0])){this.set=[o];break}}}this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){let i=((this.options.includePrerelease&&eVa)|(this.options.loose&&tVa))+":"+t,o=uii.get(i);if(o)return o;let s=this.options.loose,a=s?KI[qE.HYPHENRANGELOOSE]:KI[qE.HYPHENRANGE];t=t.replace(a,pVa(this.options.includePrerelease)),Pp("hyphen replace",t),t=t.replace(KI[qE.COMPARATORTRIM],$Ga),Pp("comparator trim",t),t=t.replace(KI[qE.TILDETRIM],XGa),Pp("tilde trim",t),t=t.replace(KI[qE.CARETTRIM],ZGa),Pp("caret trim",t);let l=t.split(" ").map(p=>nVa(p,this.options)).join(" ").split(/\s+/).map(p=>dVa(p,this.options));s&&(l=l.filter(p=>(Pp("loose invalid filter",p,this.options),!!p.match(KI[qE.COMPARATORLOOSE])))),Pp("range list",l);let u=new Map,c=l.map(p=>new Xhr(p,this.options));for(let p of c){if(dii(p))return[p];u.set(p.value,p)}u.size>1&&u.has("")&&u.delete("");let d=[...u.values()];return uii.set(i,d),d}intersects(t,n){if(!(t instanceof r))throw new TypeError("a Range is required");return this.set.some(i=>pii(i,n)&&t.set.some(o=>pii(o,n)&&i.every(s=>o.every(a=>s.intersects(a,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new JGa(t,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(fVa(this.set[n],t,this.options))return!0;return!1}};fii.exports=$hr;var KGa=bme(),uii=new KGa({max:1e3}),YGa=Opt(),Xhr=dke(),Pp=ake(),JGa=Z3(),{safeRe:KI,t:qE,comparatorTrimReplace:$Ga,tildeTrimReplace:XGa,caretTrimReplace:ZGa}=hme(),{FLAG_INCLUDE_PRERELEASE:eVa,FLAG_LOOSE:tVa}=ske(),dii=r=>r.value==="<0.0.0-0",rVa=r=>r.value==="",pii=(r,t)=>{let n=!0,i=r.slice(),o=i.pop();for(;n&&i.length;)n=i.every(s=>o.intersects(s,t)),o=i.pop();return n},nVa=(r,t)=>(Pp("comp",r,t),r=sVa(r,t),Pp("caret",r),r=iVa(r,t),Pp("tildes",r),r=lVa(r,t),Pp("xrange",r),r=uVa(r,t),Pp("stars",r),r),UE=r=>!r||r.toLowerCase()==="x"||r==="*",iVa=(r,t)=>r.trim().split(/\s+/).map(n=>oVa(n,t)).join(" "),oVa=(r,t)=>{let n=t.loose?KI[qE.TILDELOOSE]:KI[qE.TILDE];return r.replace(n,(i,o,s,a,l)=>{Pp("tilde",r,i,o,s,a,l);let u;return UE(o)?u="":UE(s)?u=`>=${o}.0.0 <${+o+1}.0.0-0`:UE(a)?u=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:l?(Pp("replaceTilde pr",l),u=`>=${o}.${s}.${a}-${l} <${o}.${+s+1}.0-0`):u=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,Pp("tilde return",u),u})},sVa=(r,t)=>r.trim().split(/\s+/).map(n=>aVa(n,t)).join(" "),aVa=(r,t)=>{Pp("caret",r,t);let n=t.loose?KI[qE.CARETLOOSE]:KI[qE.CARET],i=t.includePrerelease?"-0":"";return r.replace(n,(o,s,a,l,u)=>{Pp("caret",r,o,s,a,l,u);let c;return UE(s)?c="":UE(a)?c=`>=${s}.0.0${i} <${+s+1}.0.0-0`:UE(l)?s==="0"?c=`>=${s}.${a}.0${i} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.0${i} <${+s+1}.0.0-0`:u?(Pp("replaceCaret pr",u),s==="0"?a==="0"?c=`>=${s}.${a}.${l}-${u} <${s}.${a}.${+l+1}-0`:c=`>=${s}.${a}.${l}-${u} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${l}-${u} <${+s+1}.0.0-0`):(Pp("no pr"),s==="0"?a==="0"?c=`>=${s}.${a}.${l}${i} <${s}.${a}.${+l+1}-0`:c=`>=${s}.${a}.${l}${i} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${l} <${+s+1}.0.0-0`),Pp("caret return",c),c})},lVa=(r,t)=>(Pp("replaceXRanges",r,t),r.split(/\s+/).map(n=>cVa(n,t)).join(" ")),cVa=(r,t)=>{r=r.trim();let n=t.loose?KI[qE.XRANGELOOSE]:KI[qE.XRANGE];return r.replace(n,(i,o,s,a,l,u)=>{Pp("xRange",r,i,o,s,a,l,u);let c=UE(s),d=c||UE(a),p=d||UE(l),f=p;return o==="="&&f&&(o=""),u=t.includePrerelease?"-0":"",c?o===">"||o==="<"?i="<0.0.0-0":i="*":o&&f?(d&&(a=0),l=0,o===">"?(o=">=",d?(s=+s+1,a=0,l=0):(a=+a+1,l=0)):o==="<="&&(o="<",d?s=+s+1:a=+a+1),o==="<"&&(u="-0"),i=`${o+s}.${a}.${l}${u}`):d?i=`>=${s}.0.0${u} <${+s+1}.0.0-0`:p&&(i=`>=${s}.${a}.0${u} <${s}.${+a+1}.0-0`),Pp("xRange return",i),i})},uVa=(r,t)=>(Pp("replaceStars",r,t),r.trim().replace(KI[qE.STAR],"")),dVa=(r,t)=>(Pp("replaceGTE0",r,t),r.trim().replace(KI[t.includePrerelease?qE.GTE0PRE:qE.GTE0],"")),pVa=r=>(t,n,i,o,s,a,l,u,c,d,p,f,A)=>(UE(i)?n="":UE(o)?n=`>=${i}.0.0${r?"-0":""}`:UE(s)?n=`>=${i}.${o}.0${r?"-0":""}`:a?n=`>=${n}`:n=`>=${n}${r?"-0":""}`,UE(c)?u="":UE(d)?u=`<${+c+1}.0.0-0`:UE(p)?u=`<${c}.${+d+1}.0-0`:f?u=`<=${c}.${d}.${p}-${f}`:r?u=`<${c}.${d}.${+p+1}-0`:u=`<=${u}`,`${n} ${u}`.trim()),fVa=(r,t,n)=>{for(let i=0;i<r.length;i++)if(!r[i].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let i=0;i<r.length;i++)if(Pp(r[i].semver),r[i].semver!==Xhr.ANY&&r[i].semver.prerelease.length>0){let o=r[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}});var dke=I((ZEd,bii)=>{var pke=Symbol("SemVer ANY"),tgr=class r{static get ANY(){return pke}constructor(t,n){if(n=Aii(n),t instanceof r){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),egr("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===pke?this.value="":this.value=this.operator+this.semver.version,egr("comp",this)}parse(t){let n=this.options.loose?hii[gii.COMPARATORLOOSE]:hii[gii.COMPARATOR],i=t.match(n);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new mii(i[2],this.options.loose):this.semver=pke}toString(){return this.value}test(t){if(egr("Comparator.test",t,this.options.loose),this.semver===pke||t===pke)return!0;if(typeof t=="string")try{t=new mii(t,this.options)}catch{return!1}return Zhr(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new yii(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new yii(this.value,n).test(t.semver):(n=Aii(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Zhr(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Zhr(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};bii.exports=tgr;var Aii=Opt(),{safeRe:hii,t:gii}=hme(),Zhr=Ghr(),egr=ake(),mii=Z3(),yii=Ww()});var fke=I((eCd,Eii)=>{var AVa=Ww(),hVa=(r,t,n)=>{try{t=new AVa(t,n)}catch{return!1}return t.test(r)};Eii.exports=hVa});var Iii=I((tCd,Cii)=>{var gVa=Ww(),mVa=(r,t)=>new gVa(r,t).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));Cii.exports=mVa});var Sii=I((rCd,vii)=>{var yVa=Z3(),bVa=Ww(),EVa=(r,t,n)=>{let i=null,o=null,s=null;try{s=new bVa(t,n)}catch{return null}return r.forEach(a=>{s.test(a)&&(!i||o.compare(a)===-1)&&(i=a,o=new yVa(i,n))}),i};vii.exports=EVa});var wii=I((nCd,Oii)=>{var CVa=Z3(),IVa=Ww(),vVa=(r,t,n)=>{let i=null,o=null,s=null;try{s=new IVa(t,n)}catch{return null}return r.forEach(a=>{s.test(a)&&(!i||o.compare(a)===1)&&(i=a,o=new CVa(i,n))}),i};Oii.exports=vVa});var Rii=I((iCd,Tii)=>{var rgr=Z3(),SVa=Ww(),_ii=lke(),OVa=(r,t)=>{r=new SVa(r,t);let n=new rgr("0.0.0");if(r.test(n)||(n=new rgr("0.0.0-0"),r.test(n)))return n;n=null;for(let i=0;i<r.set.length;++i){let o=r.set[i],s=null;o.forEach(a=>{let l=new rgr(a.semver.version);switch(a.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||_ii(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!n||_ii(n,s))&&(n=s)}return n&&r.test(n)?n:null};Tii.exports=OVa});var Mii=I((oCd,Bii)=>{var wVa=Ww(),_Va=(r,t)=>{try{return new wVa(r,t).range||"*"}catch{return null}};Bii.exports=_Va});var kpt=I((sCd,kii)=>{var TVa=Z3(),Nii=dke(),{ANY:RVa}=Nii,BVa=Ww(),MVa=fke(),xii=lke(),Dii=Rpt(),xVa=Mpt(),DVa=Bpt(),NVa=(r,t,n,i)=>{r=new TVa(r,i),t=new BVa(t,i);let o,s,a,l,u;switch(n){case">":o=xii,s=xVa,a=Dii,l=">",u=">=";break;case"<":o=Dii,s=DVa,a=xii,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(MVa(r,t,i))return!1;for(let c=0;c<t.set.length;++c){let d=t.set[c],p=null,f=null;if(d.forEach(A=>{A.semver===RVa&&(A=new Nii(">=0.0.0")),p=p||A,f=f||A,o(A.semver,p.semver,i)?p=A:a(A.semver,f.semver,i)&&(f=A)}),p.operator===l||p.operator===u||(!f.operator||f.operator===l)&&s(r,f.semver))return!1;if(f.operator===u&&a(r,f.semver))return!1}return!0};kii.exports=NVa});var Qii=I((aCd,Pii)=>{var kVa=kpt(),PVa=(r,t,n)=>kVa(r,t,">",n);Pii.exports=PVa});var Lii=I((lCd,Fii)=>{var QVa=kpt(),FVa=(r,t,n)=>QVa(r,t,"<",n);Fii.exports=FVa});var Uii=I((cCd,qii)=>{var zii=Ww(),LVa=(r,t,n)=>(r=new zii(r,n),t=new zii(t,n),r.intersects(t,n));qii.exports=LVa});var Wii=I((uCd,jii)=>{var zVa=fke(),qVa=jw();jii.exports=(r,t,n)=>{let i=[],o=null,s=null,a=r.sort((d,p)=>qVa(d,p,n));for(let d of a)zVa(d,t,n)?(s=d,o||(o=d)):(s&&i.push([o,s]),s=null,o=null);o&&i.push([o,null]);let l=[];for(let[d,p]of i)d===p?l.push(d):!p&&d===a[0]?l.push("*"):p?d===a[0]?l.push(`<=${p}`):l.push(`${d} - ${p}`):l.push(`>=${d}`);let u=l.join(" || "),c=typeof t.raw=="string"?t.raw:String(t);return u.length<c.length?u:t}});var Jii=I((dCd,Yii)=>{var Gii=Ww(),igr=dke(),{ANY:ngr}=igr,Ake=fke(),ogr=jw(),UVa=(r,t,n={})=>{if(r===t)return!0;r=new Gii(r,n),t=new Gii(t,n);let i=!1;e:for(let o of r.set){for(let s of t.set){let a=WVa(o,s,n);if(i=i||a!==null,a)continue e}if(i)return!1}return!0},jVa=[new igr(">=0.0.0-0")],Vii=[new igr(">=0.0.0")],WVa=(r,t,n)=>{if(r===t)return!0;if(r.length===1&&r[0].semver===ngr){if(t.length===1&&t[0].semver===ngr)return!0;n.includePrerelease?r=jVa:r=Vii}if(t.length===1&&t[0].semver===ngr){if(n.includePrerelease)return!0;t=Vii}let i=new Set,o,s;for(let A of r)A.operator===">"||A.operator===">="?o=Hii(o,A,n):A.operator==="<"||A.operator==="<="?s=Kii(s,A,n):i.add(A.semver);if(i.size>1)return null;let a;if(o&&s){if(a=ogr(o.semver,s.semver,n),a>0)return null;if(a===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let A of i){if(o&&!Ake(A,String(o),n)||s&&!Ake(A,String(s),n))return null;for(let h of t)if(!Ake(A,String(h),n))return!1;return!0}let l,u,c,d,p=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1;p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let A of t){if(d=d||A.operator===">"||A.operator===">=",c=c||A.operator==="<"||A.operator==="<=",o){if(f&&A.semver.prerelease&&A.semver.prerelease.length&&A.semver.major===f.major&&A.semver.minor===f.minor&&A.semver.patch===f.patch&&(f=!1),A.operator===">"||A.operator===">="){if(l=Hii(o,A,n),l===A&&l!==o)return!1}else if(o.operator===">="&&!Ake(o.semver,String(A),n))return!1}if(s){if(p&&A.semver.prerelease&&A.semver.prerelease.length&&A.semver.major===p.major&&A.semver.minor===p.minor&&A.semver.patch===p.patch&&(p=!1),A.operator==="<"||A.operator==="<="){if(u=Kii(s,A,n),u===A&&u!==s)return!1}else if(s.operator==="<="&&!Ake(s.semver,String(A),n))return!1}if(!A.operator&&(s||o)&&a!==0)return!1}return!(o&&c&&!s&&a!==0||s&&d&&!o&&a!==0||f||p)},Hii=(r,t,n)=>{if(!r)return t;let i=ogr(r.semver,t.semver,n);return i>0?r:i<0||t.operator===">"&&r.operator===">="?t:r},Kii=(r,t,n)=>{if(!r)return t;let i=ogr(r.semver,t.semver,n);return i<0?r:i>0||t.operator==="<"&&r.operator==="<="?t:r};Yii.exports=UVa});var Eme=I((pCd,Zii)=>{var sgr=hme(),$ii=ske(),GVa=Z3(),Xii=qhr(),VVa=Xoe(),HVa=bni(),KVa=Cni(),YVa=Sni(),JVa=_ni(),$Va=Rni(),XVa=Mni(),ZVa=Dni(),eHa=kni(),tHa=jw(),rHa=Lni(),nHa=qni(),iHa=Tpt(),oHa=Gni(),sHa=Hni(),aHa=lke(),lHa=Rpt(),cHa=jhr(),uHa=Whr(),dHa=Bpt(),pHa=Mpt(),fHa=Ghr(),AHa=rii(),hHa=dke(),gHa=Ww(),mHa=fke(),yHa=Iii(),bHa=Sii(),EHa=wii(),CHa=Rii(),IHa=Mii(),vHa=kpt(),SHa=Qii(),OHa=Lii(),wHa=Uii(),_Ha=Wii(),THa=Jii();Zii.exports={parse:VVa,valid:HVa,clean:KVa,inc:YVa,diff:JVa,major:$Va,minor:XVa,patch:ZVa,prerelease:eHa,compare:tHa,rcompare:rHa,compareLoose:nHa,compareBuild:iHa,sort:oHa,rsort:sHa,gt:aHa,lt:lHa,eq:cHa,neq:uHa,gte:dHa,lte:pHa,cmp:fHa,coerce:AHa,Comparator:hHa,Range:gHa,satisfies:mHa,toComparators:yHa,maxSatisfying:bHa,minSatisfying:EHa,minVersion:CHa,validRange:IHa,outside:vHa,gtr:SHa,ltr:OHa,intersects:wHa,simplifyRange:_Ha,subset:THa,SemVer:GVa,re:sgr.re,src:sgr.src,tokens:sgr.t,SEMVER_SPEC_VERSION:$ii.SEMVER_SPEC_VERSION,RELEASE_TYPES:$ii.RELEASE_TYPES,compareIdentifiers:Xii.compareIdentifiers,rcompareIdentifiers:Xii.rcompareIdentifiers}});var hke,RHa,fCd,BHa,jE,tV=ut(()=>{"use strict";hke=yt(qw()),RHa=yt(Eme()),fCd=(0,hke.Record)({version:hke.String,hash:hke.String}),BHa=()=>({version:"7.20.2",hash:"87c6f1bba2ed71f96c36b2f25ed6bcb6ed025e22"}),jE=BHa()});var DS,eoi,gke,Ppt=ut(()=>{"use strict";tV();eoi=r=>{DS=r},gke=r=>({coalesceSoftwareVersion:jE?.version||"",service:r,env:process.env.REACT_APP_OWNER??"",reactAppCoalesceDev:process.env.REACT_APP_COALESCE_DEV??""})});var toi,roi,NS,agr,noi,ioi,ooi,mke,lgr,Qpt,xHa,cgr,Cme,yke,Fpt,ugr,soi,Ime=ut(()=>{"use strict";toi=yt(nF()),roi=yt(Wit()),NS=yt(die());Koe();ept();Ppt();Zl();VR();fr();agr=null,noi=r=>{agr=r},ioi={emerg:"error",assert:"warn",alert:"warn",error:"warn",warn:"warn",app:"info",info:"info",debug:"debug"},ooi={emerg:"emerg",assert:"alert",alert:"alert",error:"error",app:"info",info:"info",warn:"warn",debug:"debug"},mke=class extends toi.default{baseContext;constructor(t){super(t),this.baseContext=gke(DS)}log(t,n){agr&&agr.log({...t,level:ooi[t.level]},{...this.baseContext,...X3},ioi[t.level]),n()}},Qpt=r=>{let t=gke(r);lgr={host:"http-intake.logs.datadoghq.com",path:`/v1/input/pub04bd017317b60c96b62874179d82ff97?ddtags=env:${t.env},coalesceSoftwareVersion:${t.coalesceSoftwareVersion}&ddsource=nodejs&service=${r}`,ssl:!0}},xHa=!1,cgr=()=>NS.format.combine(NS.format.timestamp(),NS.format.colorize({colors:Zdt.COLORS}),NS.format.printf(r=>{let t=[{key:"orgID",prefix:"org"},{key:"workspaceID",prefix:"env"},{key:"userID",prefix:"user"},{key:"runID",prefix:"run"},{key:"nodeID",prefix:"node"},{key:"kubernetesJobUuid",prefix:"k8s-job"},{key:"planID",prefix:"plan"}],n=process.env.JEST_WORKER_ID?`[SHARD:${process.env.JEST_WORKER_ID}]`:"",i=t.map(({key:o,prefix:s})=>r[o]?`|(${s}:${r[o]})`:"").join("");return`|${r.timestamp}|${n}[${r.loggingArea}]${i}|)|${r.level}:${r.message}`})),Cme=r=>new NS.transports.Console({format:process.env.CONSOLE_JSON_LOGS?NS.format.combine(NS.format.timestamp(),NS.format.json()):cgr(),level:r.level,silent:xHa}),yke=class extends roi.Http{running=0;rejectLogCalls=!1;constructor(){let t={batch:!1,...lgr,format:NS.format.combine(cgr(),NS.format.uncolorize())};super(t),this.on("logged",()=>{this.running-=1}),this.on("warn",()=>{this.running-=1})}log(t,n){if(this.rejectLogCalls)return;let i={...t,level:ooi[t.level],status:ioi[t.level]};this.running+=1,super.log?.(i,n)}async closeAndWait(t){this.rejectLogCalls=!0;let n=async()=>{let i=t>5e3?500:t/100,o=0;for(;o++*i<t;){if(this.running===0)return;await new Promise(s=>setTimeout(s,i))}if(this.running!==0)throw new ft("should not be reachable")};this.close&&this.close(),await Pm(t,"Close took too long",n())}},Fpt=()=>new yke,ugr=()=>new NS.transports.File({filename:process.env.JEST_WORKER_ID?`test-shard-${process.env.JEST_WORKER_ID}.log`:"test.log",dirname:"./test-logs",format:cgr(),level:Xdt.debug}),soi=r=>{let t=[];return t.push(Cme(r)),lgr&&t.push(Fpt()),_c().isTest&&t.push(ugr()),[new mke,...t]}});var aoi,dgr,pgr,DHa,NHa,bke,fgr=ut(()=>{"use strict";aoi=yt(die());Ppt();Koe();X7e();Ime();Zl();dgr=r=>r.includes("production")?"production":r.includes("staging")?"staging":r.includes("qa")?"qa":"development",pgr=()=>{if(m1()){let r=process.env.RUNTIME_ENVIRONMENT||"development";return wkn("coa")?bR()?dgr(r):void 0:dgr(r)}else{let r;try{r=self.ENVIRONMENT}catch{}return typeof r=="string"?dgr(r):void 0}},DHa=()=>{let r=_c();if(r.isTest)return{};let t=pgr();return r.isNode?{firebaseEnv:t}:{windowInfo:{frontendURLHost:self.location.host},firebaseEnv:t}},NHa=r=>{let t=gke(DS);return{appEnv:DHa(),loggingArea:r,...t}},bke=r=>{let t=MS[r];if(!t)throw new Error(`Logging area "${r}" is not a valid LoggingAreas key`);return t.logger||(t.logger=aoi.createLogger({levels:Zdt.LEVELS,defaultMeta:NHa(r),level:t.level,transports:soi(t)})),t.logger}});var loi,Lpt,zpt,Agr,qpt,tL,coi=ut(()=>{"use strict";loi=yt(wo()),Lpt=yt(die());X7e();Ime();Zl();fgr();Koe();QA();zpt=(r,t)=>{let n=r.toUpperCase(),i=[];if(n in MS||i.push(`invalid logging area '${n}'`),Xdt[t]||i.push("`invalid log level '${logLevel}'`"),i.length)throw i.forEach(l=>{console.error(l)}),new Error("Invalid logging area or log level: "+i.join(", "));let o=bke(n),s=o.transports.filter(l=>l instanceof Lpt.transports.Console),a=o.transports;s.length||(a=[...a,Cme(MS[n])]),a.filter(l=>l instanceof Lpt.transports.Console)[0].level=t,o.configure({...o,transports:o.transports})},Agr=()=>{Object.keys(MS).forEach(r=>{zpt(r,"debug")})},qpt=(r,t)=>{for(let n in r){let i=n,o=bke(i);r[i].defaultMeta={...o.defaultMeta,...r[i].defaultMeta,...t};let s=r[i].transports||o.transports,a;if(_c().isTest&&s.length>0){let l=s[s.length-1];l instanceof Lpt.transports.File&&(a=l,s=o.transports.slice(0,-1),s.push(ugr()))}o.configure({...o,...r[i],transports:s,level:r[i].level||o.level}),a&&a.close&&a.close()}},tL=r=>{let t=loi.default.mapValues(MS,(n,i)=>({}));qpt(t,r)}});function Eke(r,t){return function(){return r.apply(t,arguments)}}var hgr=ut(()=>{"use strict"});function PHa(r){return r!==null&&!Cke(r)&&r.constructor!==null&&!Cke(r.constructor)&&kS(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}function QHa(r){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&poi(r.buffer),t}function Ike(r,t,{allOwnKeys:n=!1}={}){if(r===null||typeof r>"u")return;let i,o;if(typeof r!="object"&&(r=[r]),vme(r))for(i=0,o=r.length;i<o;i++)t.call(null,r[i],i,r);else{let s=n?Object.getOwnPropertyNames(r):Object.keys(r),a=s.length,l;for(i=0;i<a;i++)l=s[i],t.call(null,r[l],l,r)}}function Aoi(r,t){t=t.toLowerCase();let n=Object.keys(r),i=n.length,o;for(;i-- >0;)if(o=n[i],t===o.toLowerCase())return o;return null}function mgr(){let{caseless:r}=hoi(this)&&this||{},t={},n=(i,o)=>{let s=r&&Aoi(t,o)||o;Upt(t[s])&&Upt(i)?t[s]=mgr(t[s],i):Upt(i)?t[s]=mgr({},i):vme(i)?t[s]=i.slice():t[s]=i};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&Ike(arguments[i],n);return t}function hKa(r){return!!(r&&kS(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}var kHa,ygr,jpt,KR,Wpt,vme,Cke,poi,FHa,kS,foi,Gpt,LHa,Upt,zHa,qHa,UHa,jHa,WHa,GHa,VHa,HHa,KHa,YHa,JHa,$Ha,rse,hoi,XHa,ZHa,eKa,tKa,rKa,nKa,iKa,oKa,sKa,aKa,lKa,uoi,cKa,goi,uKa,dKa,pKa,fKa,ggr,doi,moi,AKa,gKa,mKa,yKa,yoi,bKa,Xt,$0=ut(()=>{"use strict";hgr();({toString:kHa}=Object.prototype),{getPrototypeOf:ygr}=Object,jpt=(r=>t=>{let n=kHa.call(t);return r[n]||(r[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),KR=r=>(r=r.toLowerCase(),t=>jpt(t)===r),Wpt=r=>t=>typeof t===r,{isArray:vme}=Array,Cke=Wpt("undefined");poi=KR("ArrayBuffer");FHa=Wpt("string"),kS=Wpt("function"),foi=Wpt("number"),Gpt=r=>r!==null&&typeof r=="object",LHa=r=>r===!0||r===!1,Upt=r=>{if(jpt(r)!=="object")return!1;let t=ygr(r);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},zHa=KR("Date"),qHa=KR("File"),UHa=KR("Blob"),jHa=KR("FileList"),WHa=r=>Gpt(r)&&kS(r.pipe),GHa=r=>{let t;return r&&(typeof FormData=="function"&&r instanceof FormData||kS(r.append)&&((t=jpt(r))==="formdata"||t==="object"&&kS(r.toString)&&r.toString()==="[object FormData]"))},VHa=KR("URLSearchParams"),[HHa,KHa,YHa,JHa]=["ReadableStream","Request","Response","Headers"].map(KR),$Ha=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");rse=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hoi=r=>!Cke(r)&&r!==rse;XHa=(r,t,n,{allOwnKeys:i}={})=>(Ike(t,(o,s)=>{n&&kS(o)?r[s]=Eke(o,n):r[s]=o},{allOwnKeys:i}),r),ZHa=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),eKa=(r,t,n,i)=>{r.prototype=Object.create(t.prototype,i),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:t.prototype}),n&&Object.assign(r.prototype,n)},tKa=(r,t,n,i)=>{let o,s,a,l={};if(t=t||{},r==null)return t;do{for(o=Object.getOwnPropertyNames(r),s=o.length;s-- >0;)a=o[s],(!i||i(a,r,t))&&!l[a]&&(t[a]=r[a],l[a]=!0);r=n!==!1&&ygr(r)}while(r&&(!n||n(r,t))&&r!==Object.prototype);return t},rKa=(r,t,n)=>{r=String(r),(n===void 0||n>r.length)&&(n=r.length),n-=t.length;let i=r.indexOf(t,n);return i!==-1&&i===n},nKa=r=>{if(!r)return null;if(vme(r))return r;let t=r.length;if(!foi(t))return null;let n=new Array(t);for(;t-- >0;)n[t]=r[t];return n},iKa=(r=>t=>r&&t instanceof r)(typeof Uint8Array<"u"&&ygr(Uint8Array)),oKa=(r,t)=>{let i=(r&&r[Symbol.iterator]).call(r),o;for(;(o=i.next())&&!o.done;){let s=o.value;t.call(r,s[0],s[1])}},sKa=(r,t)=>{let n,i=[];for(;(n=r.exec(t))!==null;)i.push(n);return i},aKa=KR("HTMLFormElement"),lKa=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,o){return i.toUpperCase()+o}),uoi=(({hasOwnProperty:r})=>(t,n)=>r.call(t,n))(Object.prototype),cKa=KR("RegExp"),goi=(r,t)=>{let n=Object.getOwnPropertyDescriptors(r),i={};Ike(n,(o,s)=>{let a;(a=t(o,s,r))!==!1&&(i[s]=a||o)}),Object.defineProperties(r,i)},uKa=r=>{goi(r,(t,n)=>{if(kS(r)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let i=r[n];if(kS(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},dKa=(r,t)=>{let n={},i=o=>{o.forEach(s=>{n[s]=!0})};return vme(r)?i(r):i(String(r).split(t)),n},pKa=()=>{},fKa=(r,t)=>r!=null&&Number.isFinite(r=+r)?r:t,ggr="abcdefghijklmnopqrstuvwxyz",doi="0123456789",moi={DIGIT:doi,ALPHA:ggr,ALPHA_DIGIT:ggr+ggr.toUpperCase()+doi},AKa=(r=16,t=moi.ALPHA_DIGIT)=>{let n="",{length:i}=t;for(;r--;)n+=t[Math.random()*i|0];return n};gKa=r=>{let t=new Array(10),n=(i,o)=>{if(Gpt(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[o]=i;let s=vme(i)?[]:{};return Ike(i,(a,l)=>{let u=n(a,o+1);!Cke(u)&&(s[l]=u)}),t[o]=void 0,s}}return i};return n(r,0)},mKa=KR("AsyncFunction"),yKa=r=>r&&(Gpt(r)||kS(r))&&kS(r.then)&&kS(r.catch),yoi=((r,t)=>r?setImmediate:t?((n,i)=>(rse.addEventListener("message",({source:o,data:s})=>{o===rse&&s===n&&i.length&&i.shift()()},!1),o=>{i.push(o),rse.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",kS(rse.postMessage)),bKa=typeof queueMicrotask<"u"?queueMicrotask.bind(rse):typeof process<"u"&&process.nextTick||yoi,Xt={isArray:vme,isArrayBuffer:poi,isBuffer:PHa,isFormData:GHa,isArrayBufferView:QHa,isString:FHa,isNumber:foi,isBoolean:LHa,isObject:Gpt,isPlainObject:Upt,isReadableStream:HHa,isRequest:KHa,isResponse:YHa,isHeaders:JHa,isUndefined:Cke,isDate:zHa,isFile:qHa,isBlob:UHa,isRegExp:cKa,isFunction:kS,isStream:WHa,isURLSearchParams:VHa,isTypedArray:iKa,isFileList:jHa,forEach:Ike,merge:mgr,extend:XHa,trim:$Ha,stripBOM:ZHa,inherits:eKa,toFlatObject:tKa,kindOf:jpt,kindOfTest:KR,endsWith:rKa,toArray:nKa,forEachEntry:oKa,matchAll:sKa,isHTMLForm:aKa,hasOwnProperty:uoi,hasOwnProp:uoi,reduceDescriptors:goi,freezeMethods:uKa,toObjectSet:dKa,toCamelCase:lKa,noop:pKa,toFiniteNumber:fKa,findKey:Aoi,global:rse,isContextDefined:hoi,ALPHABET:moi,generateString:AKa,isSpecCompliantForm:hKa,toJSONObject:gKa,isAsyncFn:mKa,isThenable:yKa,setImmediate:yoi,asap:bKa}});function Sme(r,t,n,i,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),o&&(this.response=o,this.status=o.status?o.status:null)}var boi,Eoi,Gi,PS=ut(()=>{"use strict";$0();Xt.inherits(Sme,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Xt.toJSONObject(this.config),code:this.code,status:this.status}}});boi=Sme.prototype,Eoi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Eoi[r]={value:r}});Object.defineProperties(Sme,Eoi);Object.defineProperty(boi,"isAxiosError",{value:!0});Sme.from=(r,t,n,i,o,s)=>{let a=Object.create(boi);return Xt.toFlatObject(r,a,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),Sme.call(a,r.message,t,n,i,o),a.cause=r,a.name=r.name,s&&Object.assign(a,s),a};Gi=Sme});var Coi,Vpt,bgr=ut(()=>{Coi=yt(gDe(),1),Vpt=Coi.default});function Egr(r){return Xt.isPlainObject(r)||Xt.isArray(r)}function voi(r){return Xt.endsWith(r,"[]")?r.slice(0,-2):r}function Ioi(r,t,n){return r?r.concat(t).map(function(o,s){return o=voi(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function EKa(r){return Xt.isArray(r)&&!r.some(Egr)}function IKa(r,t,n){if(!Xt.isObject(r))throw new TypeError("target must be an object");t=t||new(Vpt||FormData),n=Xt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,C){return!Xt.isUndefined(C[y])});let i=n.metaTokens,o=n.visitor||d,s=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&Xt.isSpecCompliantForm(t);if(!Xt.isFunction(o))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(Xt.isDate(h))return h.toISOString();if(!u&&Xt.isBlob(h))throw new Gi("Blob is not supported. Use a Buffer instead.");return Xt.isArrayBuffer(h)||Xt.isTypedArray(h)?u&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function d(h,y,C){let v=h;if(h&&!C&&typeof h=="object"){if(Xt.endsWith(y,"{}"))y=i?y:y.slice(0,-2),h=JSON.stringify(h);else if(Xt.isArray(h)&&EKa(h)||(Xt.isFileList(h)||Xt.endsWith(y,"[]"))&&(v=Xt.toArray(h)))return y=voi(y),v.forEach(function(_,R){!(Xt.isUndefined(_)||_===null)&&t.append(a===!0?Ioi([y],R,s):a===null?y:y+"[]",c(_))}),!1}return Egr(h)?!0:(t.append(Ioi(C,y,s),c(h)),!1)}let p=[],f=Object.assign(CKa,{defaultVisitor:d,convertValue:c,isVisitable:Egr});function A(h,y){if(!Xt.isUndefined(h)){if(p.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));p.push(h),Xt.forEach(h,function(v,w){(!(Xt.isUndefined(v)||v===null)&&o.call(t,v,Xt.isString(w)?w.trim():w,y,f))===!0&&A(v,y?y.concat(w):[w])}),p.pop()}}if(!Xt.isObject(r))throw new TypeError("data must be an object");return A(r),t}var CKa,rV,vke=ut(()=>{"use strict";$0();PS();bgr();CKa=Xt.toFlatObject(Xt,{},null,function(t){return/^is[A-Z]/.test(t)});rV=IKa});function Soi(r){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Ooi(r,t){this._pairs=[],r&&rV(r,this,t)}var woi,_oi,Toi=ut(()=>{"use strict";vke();woi=Ooi.prototype;woi.append=function(t,n){this._pairs.push([t,n])};woi.toString=function(t){let n=t?function(i){return t.call(this,i,Soi)}:Soi;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};_oi=Ooi});function vKa(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nse(r,t,n){if(!t)return r;let i=n&&n.encode||vKa,o=n&&n.serialize,s;if(o?s=o(t,n):s=Xt.isURLSearchParams(t)?t.toString():new _oi(t,n).toString(i),s){let a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+s}return r}var Hpt=ut(()=>{"use strict";$0();Toi()});var Cgr,Igr,Roi=ut(()=>{"use strict";$0();Cgr=class{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Xt.forEach(this.handlers,function(i){i!==null&&t(i)})}},Igr=Cgr});var Ome,Kpt=ut(()=>{"use strict";Ome={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var Boi,Moi,xoi=ut(()=>{"use strict";Boi=yt(require("url"),1),Moi=Boi.default.URLSearchParams});var Doi,Noi=ut(()=>{xoi();bgr();Doi={isNode:!0,classes:{URLSearchParams:Moi,FormData:Vpt,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]}});var Ogr={};SI(Ogr,{hasBrowserEnv:()=>Sgr,hasStandardBrowserEnv:()=>SKa,hasStandardBrowserWebWorkerEnv:()=>OKa,navigator:()=>vgr,origin:()=>wKa});var Sgr,vgr,SKa,OKa,wKa,koi=ut(()=>{Sgr=typeof window<"u"&&typeof document<"u",vgr=typeof navigator=="object"&&navigator||void 0,SKa=Sgr&&(!vgr||["ReactNative","NativeScript","NS"].indexOf(vgr.product)<0),OKa=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wKa=Sgr&&window.location.href||"http://localhost"});var Cd,FD=ut(()=>{Noi();koi();Cd={...Ogr,...Doi}});function wgr(r,t){return rV(r,new Cd.classes.URLSearchParams,Object.assign({visitor:function(n,i,o,s){return Cd.isNode&&Xt.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}var Poi=ut(()=>{"use strict";$0();vke();FD()});function _Ka(r){return Xt.matchAll(/\w+|\[(\w*)]/g,r).map(t=>t[0]==="[]"?"":t[1]||t[0])}function TKa(r){let t={},n=Object.keys(r),i,o=n.length,s;for(i=0;i<o;i++)s=n[i],t[s]=r[s];return t}function RKa(r){function t(n,i,o,s){let a=n[s++];if(a==="__proto__")return!0;let l=Number.isFinite(+a),u=s>=n.length;return a=!a&&Xt.isArray(o)?o.length:a,u?(Xt.hasOwnProp(o,a)?o[a]=[o[a],i]:o[a]=i,!l):((!o[a]||!Xt.isObject(o[a]))&&(o[a]=[]),t(n,i,o[a],s)&&Xt.isArray(o[a])&&(o[a]=TKa(o[a])),!l)}if(Xt.isFormData(r)&&Xt.isFunction(r.entries)){let n={};return Xt.forEachEntry(r,(i,o)=>{t(_Ka(i),o,n,0)}),n}return null}var Ypt,_gr=ut(()=>{"use strict";$0();Ypt=RKa});function BKa(r,t,n){if(Xt.isString(r))try{return(t||JSON.parse)(r),Xt.trim(r)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(r)}var Tgr,wme,Jpt=ut(()=>{"use strict";$0();PS();Kpt();vke();Poi();FD();_gr();Tgr={transitional:Ome,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i=n.getContentType()||"",o=i.indexOf("application/json")>-1,s=Xt.isObject(t);if(s&&Xt.isHTMLForm(t)&&(t=new FormData(t)),Xt.isFormData(t))return o?JSON.stringify(Ypt(t)):t;if(Xt.isArrayBuffer(t)||Xt.isBuffer(t)||Xt.isStream(t)||Xt.isFile(t)||Xt.isBlob(t)||Xt.isReadableStream(t))return t;if(Xt.isArrayBufferView(t))return t.buffer;if(Xt.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return wgr(t,this.formSerializer).toString();if((l=Xt.isFileList(t))||i.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return rV(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),BKa(t)):t}],transformResponse:[function(t){let n=this.transitional||Tgr.transitional,i=n&&n.forcedJSONParsing,o=this.responseType==="json";if(Xt.isResponse(t)||Xt.isReadableStream(t))return t;if(t&&Xt.isString(t)&&(i&&!this.responseType||o)){let a=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(l){if(a)throw l.name==="SyntaxError"?Gi.from(l,Gi.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Cd.classes.FormData,Blob:Cd.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Xt.forEach(["delete","get","head","post","put","patch"],r=>{Tgr.headers[r]={}});wme=Tgr});var MKa,Qoi,Foi=ut(()=>{"use strict";$0();MKa=Xt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Qoi=r=>{let t={},n,i,o;return r&&r.split(`
143
143
  `).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),i=a.substring(o+1).trim(),!(!n||t[n]&&MKa[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t}});function Ske(r){return r&&String(r).trim().toLowerCase()}function $pt(r){return r===!1||r==null?r:Xt.isArray(r)?r.map($pt):String(r)}function xKa(r){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=n.exec(r);)t[i[1]]=i[2];return t}function Rgr(r,t,n,i,o){if(Xt.isFunction(i))return i.call(this,t,n);if(o&&(t=n),!!Xt.isString(t)){if(Xt.isString(i))return t.indexOf(i)!==-1;if(Xt.isRegExp(i))return i.test(t)}}function NKa(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function kKa(r,t){let n=Xt.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(r,i+n,{value:function(o,s,a){return this[i].call(this,t,o,s,a)},configurable:!0})})}var Loi,DKa,_me,sf,LD=ut(()=>{"use strict";$0();Foi();Loi=Symbol("internals");DKa=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());_me=class{constructor(t){t&&this.set(t)}set(t,n,i){let o=this;function s(l,u,c){let d=Ske(u);if(!d)throw new Error("header name must be a non-empty string");let p=Xt.findKey(o,d);(!p||o[p]===void 0||c===!0||c===void 0&&o[p]!==!1)&&(o[p||u]=$pt(l))}let a=(l,u)=>Xt.forEach(l,(c,d)=>s(c,d,u));if(Xt.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(Xt.isString(t)&&(t=t.trim())&&!DKa(t))a(Qoi(t),n);else if(Xt.isHeaders(t))for(let[l,u]of t.entries())s(u,l,i);else t!=null&&s(n,t,i);return this}get(t,n){if(t=Ske(t),t){let i=Xt.findKey(this,t);if(i){let o=this[i];if(!n)return o;if(n===!0)return xKa(o);if(Xt.isFunction(n))return n.call(this,o,i);if(Xt.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ske(t),t){let i=Xt.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||Rgr(this,this[i],i,n)))}return!1}delete(t,n){let i=this,o=!1;function s(a){if(a=Ske(a),a){let l=Xt.findKey(i,a);l&&(!n||Rgr(i,i[l],l,n))&&(delete i[l],o=!0)}}return Xt.isArray(t)?t.forEach(s):s(t),o}clear(t){let n=Object.keys(this),i=n.length,o=!1;for(;i--;){let s=n[i];(!t||Rgr(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){let n=this,i={};return Xt.forEach(this,(o,s)=>{let a=Xt.findKey(i,s);if(a){n[a]=$pt(o),delete n[s];return}let l=t?NKa(s):String(s).trim();l!==s&&delete n[s],n[l]=$pt(o),i[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let n=Object.create(null);return Xt.forEach(this,(i,o)=>{i!=null&&i!==!1&&(n[o]=t&&Xt.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
144
144
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let i=new this(t);return n.forEach(o=>i.set(o)),i}static accessor(t){let i=(this[Loi]=this[Loi]={accessors:{}}).accessors,o=this.prototype;function s(a){let l=Ske(a);i[l]||(kKa(o,a),i[l]=!0)}return Xt.isArray(t)?t.forEach(s):s(t),this}};_me.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Xt.reduceDescriptors(_me.prototype,({value:r},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(i){this[n]=i}}});Xt.freezeMethods(_me);sf=_me});function Oke(r,t){let n=this||wme,i=t||n,o=sf.from(i.headers),s=i.data;return Xt.forEach(r,function(l){s=l.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}var zoi=ut(()=>{"use strict";$0();Jpt();LD()});function wke(r){return!!(r&&r.__CANCEL__)}var Bgr=ut(()=>{"use strict"});function qoi(r,t,n){Gi.call(this,r??"canceled",Gi.ERR_CANCELED,t,n),this.name="CanceledError"}var QS,ise=ut(()=>{"use strict";PS();$0();Xt.inherits(qoi,Gi,{__CANCEL__:!0});QS=qoi});function zD(r,t,n){let i=n.config.validateStatus;!n.status||!i||i(n.status)?r(n):t(new Gi("Request failed with status code "+n.status,[Gi.ERR_BAD_REQUEST,Gi.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}var Xpt=ut(()=>{"use strict";PS()});function Mgr(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}var Uoi=ut(()=>{"use strict"});function xgr(r,t){return t?r.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):r}var joi=ut(()=>{"use strict"});function ose(r,t){return r&&!Mgr(t)?xgr(r,t):t}var Zpt=ut(()=>{"use strict";Uoi();joi()});var sse,e1t=ut(()=>{sse="1.7.7"});function _ke(r){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return t&&t[1]||""}var Dgr=ut(()=>{"use strict"});function Ngr(r,t,n){let i=n&&n.Blob||Cd.classes.Blob,o=_ke(r);if(t===void 0&&i&&(t=!0),o==="data"){r=o.length?r.slice(o.length+1):r;let s=PKa.exec(r);if(!s)throw new Gi("Invalid URL",Gi.ERR_INVALID_URL);let a=s[1],l=s[2],u=s[3],c=Buffer.from(decodeURIComponent(u),l?"base64":"utf8");if(t){if(!i)throw new Gi("Blob is not supported",Gi.ERR_NOT_SUPPORT);return new i([c],{type:a})}return c}throw new Gi("Unsupported protocol "+o,Gi.ERR_NOT_SUPPORT)}var PKa,Woi=ut(()=>{"use strict";PS();Dgr();FD();PKa=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/});var Goi,kgr,Pgr,Qgr,Voi=ut(()=>{"use strict";Goi=yt(require("stream"),1);$0();kgr=Symbol("internals"),Pgr=class extends Goi.default.Transform{constructor(t){t=Xt.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,o)=>!Xt.isUndefined(o[i])),super({readableHighWaterMark:t.chunkSize});let n=this[kgr]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",i=>{i==="progress"&&(n.isCaptured||(n.isCaptured=!0))})}_read(t){let n=this[kgr];return n.onReadCallback&&n.onReadCallback(),super._read(t)}_transform(t,n,i){let o=this[kgr],s=o.maxRate,a=this.readableHighWaterMark,l=o.timeWindow,u=1e3/l,c=s/u,d=o.minChunkSize!==!1?Math.max(o.minChunkSize,c*.01):0,p=(A,h)=>{let y=Buffer.byteLength(A);o.bytesSeen+=y,o.bytes+=y,o.isCaptured&&this.emit("progress",o.bytesSeen),this.push(A)?process.nextTick(h):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(h)}},f=(A,h)=>{let y=Buffer.byteLength(A),C=null,v=a,w,_=0;if(s){let R=Date.now();(!o.ts||(_=R-o.ts)>=l)&&(o.ts=R,w=c-o.bytes,o.bytes=w<0?-w:0,_=0),w=c-o.bytes}if(s){if(w<=0)return setTimeout(()=>{h(null,A)},l-_);w<v&&(v=w)}v&&y>v&&y-v>d&&(C=A.subarray(v),A=A.subarray(0,v)),p(A,C?()=>{process.nextTick(h,null,C)}:h)};f(t,function A(h,y){if(h)return i(h);y?f(y,A):i(null)})}},Qgr=Pgr});var Hoi,QKa,t1t,Fgr=ut(()=>{({asyncIterator:Hoi}=Symbol),QKa=async function*(r){r.stream?yield*r.stream():r.arrayBuffer?yield await r.arrayBuffer():r[Hoi]?yield*r[Hoi]():yield r},t1t=QKa});var Koi,Yoi,FKa,Tke,nV,LKa,zKa,Lgr,qKa,Joi,$oi=ut(()=>{Koi=require("util"),Yoi=require("stream");$0();Fgr();FKa=Xt.ALPHABET.ALPHA_DIGIT+"-_",Tke=new Koi.TextEncoder,nV=`\r
145
145
  `,LKa=Tke.encode(nV),zKa=2,Lgr=class{constructor(t,n){let{escapeName:i}=this.constructor,o=Xt.isString(n),s=`Content-Disposition: form-data; name="${i(t)}"${!o&&n.name?`; filename="${i(n.name)}"`:""}${nV}`;o?n=Tke.encode(String(n).replace(/\r?\n|\r\n?/g,nV)):s+=`Content-Type: ${n.type||"application/octet-stream"}${nV}`,this.headers=Tke.encode(s+nV),this.contentLength=o?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+zKa,this.name=t,this.value=n}async*encode(){yield this.headers;let{value:t}=this;Xt.isTypedArray(t)?yield t:yield*t1t(t),yield LKa}static escapeName(t){return String(t).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},qKa=(r,t,n)=>{let{tag:i="form-data-boundary",size:o=25,boundary:s=i+"-"+Xt.generateString(o,FKa)}=n||{};if(!Xt.isFormData(r))throw TypeError("FormData instance required");if(s.length<1||s.length>70)throw Error("boundary must be 10-70 characters long");let a=Tke.encode("--"+s+nV),l=Tke.encode("--"+s+"--"+nV+nV),u=l.byteLength,c=Array.from(r.entries()).map(([p,f])=>{let A=new Lgr(p,f);return u+=A.size,A});u+=a.byteLength*c.length,u=Xt.toFiniteNumber(u);let d={"Content-Type":`multipart/form-data; boundary=${s}`};return Number.isFinite(u)&&(d["Content-Length"]=u),t&&t(d),Yoi.Readable.from(async function*(){for(let p of c)yield a,yield*p.encode();yield l}())},Joi=qKa});var Xoi,zgr,Zoi,esi=ut(()=>{"use strict";Xoi=yt(require("stream"),1),zgr=class extends Xoi.default.Transform{__transform(t,n,i){this.push(t),i()}_transform(t,n,i){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let o=Buffer.alloc(2);o[0]=120,o[1]=156,this.push(o,n)}this.__transform(t,n,i)}},Zoi=zgr});var UKa,tsi,rsi=ut(()=>{$0();UKa=(r,t)=>Xt.isAsyncFn(r)?function(...n){let i=n.pop();r.apply(this,n).then(o=>{try{t?i(null,...t(o)):i(null,o)}catch(s){i(s)}},i)}:r,tsi=UKa});function jKa(r,t){r=r||10;let n=new Array(r),i=new Array(r),o=0,s=0,a;return t=t!==void 0?t:1e3,function(u){let c=Date.now(),d=i[s];a||(a=c),n[o]=u,i[o]=c;let p=s,f=0;for(;p!==o;)f+=n[p++],p=p%r;if(o=(o+1)%r,o===s&&(s=(s+1)%r),c-a<t)return;let A=d&&c-d;return A?Math.round(f*1e3/A):void 0}}var nsi,isi=ut(()=>{"use strict";nsi=jKa});function WKa(r,t){let n=0,i=1e3/t,o,s,a=(c,d=Date.now())=>{n=d,o=null,s&&(clearTimeout(s),s=null),r.apply(null,c)};return[(...c)=>{let d=Date.now(),p=d-n;p>=i?a(c,d):(o=c,s||(s=setTimeout(()=>{s=null,a(o)},i-p)))},()=>o&&a(o)]}var osi,ssi=ut(()=>{osi=WKa});var rL,Tme,Rme,r1t=ut(()=>{isi();ssi();$0();rL=(r,t,n=3)=>{let i=0,o=nsi(50,250);return osi(s=>{let a=s.loaded,l=s.lengthComputable?s.total:void 0,u=a-i,c=o(u),d=a<=l;i=a;let p={loaded:a,total:l,progress:l?a/l:void 0,bytes:u,rate:c||void 0,estimated:c&&l&&d?(l-a)/c:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};r(p)},n)},Tme=(r,t)=>{let n=r!=null;return[i=>t[0]({lengthComputable:n,total:r,loaded:i}),t[1]]},Rme=r=>(...t)=>Xt.asap(()=>r(...t))});function YKa(r,t){r.beforeRedirects.proxy&&r.beforeRedirects.proxy(r),r.beforeRedirects.config&&r.beforeRedirects.config(r,t)}function ysi(r,t,n){let i=t;if(!i&&i!==!1){let o=(0,psi.getProxyForUrl)(n);o&&(i=new URL(o))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));let s=Buffer.from(i.auth,"utf8").toString("base64");r.headers["Proxy-Authorization"]="Basic "+s}r.headers.host=r.hostname+(r.port?":"+r.port:"");let o=i.hostname||i.host;r.hostname=o,r.host=o,r.port=i.port,r.path=n,i.protocol&&(r.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}r.beforeRedirects.proxy=function(s){ysi(s,t,s.href)}}var psi,fsi,Asi,hsi,gsi,nL,ase,msi,asi,GKa,lsi,VKa,HKa,KKa,csi,usi,JKa,$Ka,XKa,dsi,bsi,Esi=ut(()=>{"use strict";$0();Xpt();Zpt();Hpt();psi=yt(mDe(),1),fsi=yt(require("http"),1),Asi=yt(require("https"),1),hsi=yt(require("util"),1),gsi=yt(Vrr(),1),nL=yt(require("zlib"),1);e1t();Kpt();PS();ise();FD();Woi();ase=yt(require("stream"),1);LD();Voi();msi=require("events");$oi();Fgr();esi();rsi();r1t();asi={flush:nL.default.constants.Z_SYNC_FLUSH,finishFlush:nL.default.constants.Z_SYNC_FLUSH},GKa={flush:nL.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:nL.default.constants.BROTLI_OPERATION_FLUSH},lsi=Xt.isFunction(nL.default.createBrotliDecompress),{http:VKa,https:HKa}=gsi.default,KKa=/https:?/,csi=Cd.protocols.map(r=>r+":"),usi=(r,[t,n])=>(r.on("end",n).on("error",n),t);JKa=typeof process<"u"&&Xt.kindOf(process)==="process",$Ka=r=>new Promise((t,n)=>{let i,o,s=(u,c)=>{o||(o=!0,i&&i(u,c))},a=u=>{s(u),t(u)},l=u=>{s(u,!0),n(u)};r(a,l,u=>i=u).catch(l)}),XKa=({address:r,family:t})=>{if(!Xt.isString(r))throw TypeError("address must be a string");return{address:r,family:t||(r.indexOf(".")<0?6:4)}},dsi=(r,t)=>XKa(Xt.isObject(r)?r:{address:r,family:t}),bsi=JKa&&function(t){return $Ka(async function(i,o,s){let{data:a,lookup:l,family:u}=t,{responseType:c,responseEncoding:d}=t,p=t.method.toUpperCase(),f,A=!1,h;if(l){let re=tsi(l,ne=>Xt.isArray(ne)?ne:[ne]);l=(ne,W,oe)=>{re(ne,W,(ae,ie,pe)=>{if(ae)return oe(ae);let _e=Xt.isArray(ie)?ie.map(Qe=>dsi(Qe)):[dsi(ie,pe)];W.all?oe(ae,_e):oe(ae,_e[0].address,_e[0].family)})}}let y=new msi.EventEmitter,C=()=>{t.cancelToken&&t.cancelToken.unsubscribe(v),t.signal&&t.signal.removeEventListener("abort",v),y.removeAllListeners()};s((re,ne)=>{f=!0,ne&&(A=!0,C())});function v(re){y.emit("abort",!re||re.type?new QS(null,t,h):re)}y.once("abort",o),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(v),t.signal&&(t.signal.aborted?v():t.signal.addEventListener("abort",v)));let w=ose(t.baseURL,t.url),_=new URL(w,Cd.hasBrowserEnv?Cd.origin:void 0),R=_.protocol||csi[0];if(R==="data:"){let re;if(p!=="GET")return zD(i,o,{status:405,statusText:"method not allowed",headers:{},config:t});try{re=Ngr(t.url,c==="blob",{Blob:t.env&&t.env.Blob})}catch(ne){throw Gi.from(ne,Gi.ERR_BAD_REQUEST,t)}return c==="text"?(re=re.toString(d),(!d||d==="utf8")&&(re=Xt.stripBOM(re))):c==="stream"&&(re=ase.default.Readable.from(re)),zD(i,o,{data:re,status:200,statusText:"OK",headers:new sf,config:t})}if(csi.indexOf(R)===-1)return o(new Gi("Unsupported protocol "+R,Gi.ERR_BAD_REQUEST,t));let N=sf.from(t.headers).normalize();N.set("User-Agent","axios/"+sse,!1);let{onUploadProgress:L,onDownloadProgress:G}=t,Y=t.maxRate,H,V;if(Xt.isSpecCompliantForm(a)){let re=N.getContentType(/boundary=([-_\w\d]{10,70})/i);a=Joi(a,ne=>{N.set(ne)},{tag:`axios-${sse}-boundary`,boundary:re&&re[1]||void 0})}else if(Xt.isFormData(a)&&Xt.isFunction(a.getHeaders)){if(N.set(a.getHeaders()),!N.hasContentLength())try{let re=await hsi.default.promisify(a.getLength).call(a);Number.isFinite(re)&&re>=0&&N.setContentLength(re)}catch{}}else if(Xt.isBlob(a))a.size&&N.setContentType(a.type||"application/octet-stream"),N.setContentLength(a.size||0),a=ase.default.Readable.from(t1t(a));else if(a&&!Xt.isStream(a)){if(!Buffer.isBuffer(a))if(Xt.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else if(Xt.isString(a))a=Buffer.from(a,"utf-8");else return o(new Gi("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Gi.ERR_BAD_REQUEST,t));if(N.setContentLength(a.length,!1),t.maxBodyLength>-1&&a.length>t.maxBodyLength)return o(new Gi("Request body larger than maxBodyLength limit",Gi.ERR_BAD_REQUEST,t))}let F=Xt.toFiniteNumber(N.getContentLength());Xt.isArray(Y)?(H=Y[0],V=Y[1]):H=V=Y,a&&(L||H)&&(Xt.isStream(a)||(a=ase.default.Readable.from(a,{objectMode:!1})),a=ase.default.pipeline([a,new Qgr({maxRate:Xt.toFiniteNumber(H)})],Xt.noop),L&&a.on("progress",usi(a,Tme(F,rL(Rme(L),!1,3)))));let J;if(t.auth){let re=t.auth.username||"",ne=t.auth.password||"";J=re+":"+ne}if(!J&&_.username){let re=_.username,ne=_.password;J=re+":"+ne}J&&N.delete("authorization");let K;try{K=nse(_.pathname+_.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(re){let ne=new Error(re.message);return ne.config=t,ne.url=t.url,ne.exists=!0,o(ne)}N.set("Accept-Encoding","gzip, compress, deflate"+(lsi?", br":""),!1);let Q={path:K,method:p,headers:N.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:J,protocol:R,family:u,beforeRedirect:YKa,beforeRedirects:{}};!Xt.isUndefined(l)&&(Q.lookup=l),t.socketPath?Q.socketPath=t.socketPath:(Q.hostname=_.hostname.startsWith("[")?_.hostname.slice(1,-1):_.hostname,Q.port=_.port,ysi(Q,t.proxy,R+"//"+_.hostname+(_.port?":"+_.port:"")+Q.path));let $,ee=KKa.test(Q.protocol);if(Q.agent=ee?t.httpsAgent:t.httpAgent,t.transport?$=t.transport:t.maxRedirects===0?$=ee?Asi.default:fsi.default:(t.maxRedirects&&(Q.maxRedirects=t.maxRedirects),t.beforeRedirect&&(Q.beforeRedirects.config=t.beforeRedirect),$=ee?HKa:VKa),t.maxBodyLength>-1?Q.maxBodyLength=t.maxBodyLength:Q.maxBodyLength=1/0,t.insecureHTTPParser&&(Q.insecureHTTPParser=t.insecureHTTPParser),h=$.request(Q,function(ne){if(h.destroyed)return;let W=[ne],oe=+ne.headers["content-length"];if(G||V){let Qe=new Qgr({maxRate:Xt.toFiniteNumber(V)});G&&Qe.on("progress",usi(Qe,Tme(oe,rL(Rme(G),!0,3)))),W.push(Qe)}let ae=ne,ie=ne.req||h;if(t.decompress!==!1&&ne.headers["content-encoding"])switch((p==="HEAD"||ne.statusCode===204)&&delete ne.headers["content-encoding"],(ne.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":W.push(nL.default.createUnzip(asi)),delete ne.headers["content-encoding"];break;case"deflate":W.push(new Zoi),W.push(nL.default.createUnzip(asi)),delete ne.headers["content-encoding"];break;case"br":lsi&&(W.push(nL.default.createBrotliDecompress(GKa)),delete ne.headers["content-encoding"])}ae=W.length>1?ase.default.pipeline(W,Xt.noop):W[0];let pe=ase.default.finished(ae,()=>{pe(),C()}),_e={status:ne.statusCode,statusText:ne.statusMessage,headers:new sf(ne.headers),config:t,request:ie};if(c==="stream")_e.data=ae,zD(i,o,_e);else{let Qe=[],ge=0;ae.on("data",function(Ve){Qe.push(Ve),ge+=Ve.length,t.maxContentLength>-1&&ge>t.maxContentLength&&(A=!0,ae.destroy(),o(new Gi("maxContentLength size of "+t.maxContentLength+" exceeded",Gi.ERR_BAD_RESPONSE,t,ie)))}),ae.on("aborted",function(){if(A)return;let Ve=new Gi("maxContentLength size of "+t.maxContentLength+" exceeded",Gi.ERR_BAD_RESPONSE,t,ie);ae.destroy(Ve),o(Ve)}),ae.on("error",function(Ve){h.destroyed||o(Gi.from(Ve,null,t,ie))}),ae.on("end",function(){try{let Ve=Qe.length===1?Qe[0]:Buffer.concat(Qe);c!=="arraybuffer"&&(Ve=Ve.toString(d),(!d||d==="utf8")&&(Ve=Xt.stripBOM(Ve))),_e.data=Ve}catch(Ve){return o(Gi.from(Ve,null,t,_e.request,_e))}zD(i,o,_e)})}y.once("abort",Qe=>{ae.destroyed||(ae.emit("error",Qe),ae.destroy())})}),y.once("abort",re=>{o(re),h.destroy(re)}),h.on("error",function(ne){o(Gi.from(ne,null,t,h))}),h.on("socket",function(ne){ne.setKeepAlive(!0,1e3*60)}),t.timeout){let re=parseInt(t.timeout,10);if(Number.isNaN(re)){o(new Gi("error trying to parse `config.timeout` to int",Gi.ERR_BAD_OPTION_VALUE,t,h));return}h.setTimeout(re,function(){if(f)return;let W=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",oe=t.transitional||Ome;t.timeoutErrorMessage&&(W=t.timeoutErrorMessage),o(new Gi(W,oe.clarifyTimeoutError?Gi.ETIMEDOUT:Gi.ECONNABORTED,t,h)),v()})}if(Xt.isStream(a)){let re=!1,ne=!1;a.on("end",()=>{re=!0}),a.once("error",W=>{ne=!0,h.destroy(W)}),a.on("close",()=>{!re&&!ne&&v(new QS("Request stream has been aborted",t,h))}),a.pipe(h)}else h.end(a)})}});var Csi,Isi=ut(()=>{"use strict";$0();FD();Csi=Cd.hasStandardBrowserEnv?function(){let t=Cd.navigator&&/(msie|trident)/i.test(Cd.navigator.userAgent),n=document.createElement("a"),i;function o(s){let a=s;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=o(window.location.href),function(a){let l=Xt.isString(a)?o(a):a;return l.protocol===i.protocol&&l.host===i.host}}():function(){return function(){return!0}}()});var vsi,Ssi=ut(()=>{$0();FD();vsi=Cd.hasStandardBrowserEnv?{write(r,t,n,i,o,s){let a=[r+"="+encodeURIComponent(t)];Xt.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Xt.isString(i)&&a.push("path="+i),Xt.isString(o)&&a.push("domain="+o),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(r){let t=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}}});function YR(r,t){t=t||{};let n={};function i(c,d,p){return Xt.isPlainObject(c)&&Xt.isPlainObject(d)?Xt.merge.call({caseless:p},c,d):Xt.isPlainObject(d)?Xt.merge({},d):Xt.isArray(d)?d.slice():d}function o(c,d,p){if(Xt.isUndefined(d)){if(!Xt.isUndefined(c))return i(void 0,c,p)}else return i(c,d,p)}function s(c,d){if(!Xt.isUndefined(d))return i(void 0,d)}function a(c,d){if(Xt.isUndefined(d)){if(!Xt.isUndefined(c))return i(void 0,c)}else return i(void 0,d)}function l(c,d,p){if(p in t)return i(c,d);if(p in r)return i(void 0,c)}let u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(c,d)=>o(Osi(c),Osi(d),!0)};return Xt.forEach(Object.keys(Object.assign({},r,t)),function(d){let p=u[d]||o,f=p(r[d],t[d],d);Xt.isUndefined(f)&&p!==l||(n[d]=f)}),n}var Osi,n1t=ut(()=>{"use strict";$0();LD();Osi=r=>r instanceof sf?{...r}:r});var i1t,qgr=ut(()=>{FD();$0();Isi();Ssi();Zpt();n1t();LD();Hpt();i1t=r=>{let t=YR({},r),{data:n,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:l}=t;t.headers=a=sf.from(a),t.url=nse(ose(t.baseURL,t.url),r.params,r.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(Xt.isFormData(n)){if(Cd.hasStandardBrowserEnv||Cd.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){let[c,...d]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...d].join("; "))}}if(Cd.hasStandardBrowserEnv&&(i&&Xt.isFunction(i)&&(i=i(t)),i||i!==!1&&Csi(t.url))){let c=o&&s&&vsi.read(s);c&&a.set(o,c)}return t}});var ZKa,wsi,_si=ut(()=>{$0();Xpt();Kpt();PS();ise();Dgr();FD();LD();r1t();qgr();ZKa=typeof XMLHttpRequest<"u",wsi=ZKa&&function(r){return new Promise(function(n,i){let o=i1t(r),s=o.data,a=sf.from(o.headers).normalize(),{responseType:l,onUploadProgress:u,onDownloadProgress:c}=o,d,p,f,A,h;function y(){A&&A(),h&&h(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let C=new XMLHttpRequest;C.open(o.method.toUpperCase(),o.url,!0),C.timeout=o.timeout;function v(){if(!C)return;let _=sf.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),N={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:_,config:r,request:C};zD(function(G){n(G),y()},function(G){i(G),y()},N),C=null}"onloadend"in C?C.onloadend=v:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(v)},C.onabort=function(){C&&(i(new Gi("Request aborted",Gi.ECONNABORTED,r,C)),C=null)},C.onerror=function(){i(new Gi("Network Error",Gi.ERR_NETWORK,r,C)),C=null},C.ontimeout=function(){let R=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",N=o.transitional||Ome;o.timeoutErrorMessage&&(R=o.timeoutErrorMessage),i(new Gi(R,N.clarifyTimeoutError?Gi.ETIMEDOUT:Gi.ECONNABORTED,r,C)),C=null},s===void 0&&a.setContentType(null),"setRequestHeader"in C&&Xt.forEach(a.toJSON(),function(R,N){C.setRequestHeader(N,R)}),Xt.isUndefined(o.withCredentials)||(C.withCredentials=!!o.withCredentials),l&&l!=="json"&&(C.responseType=o.responseType),c&&([f,h]=rL(c,!0),C.addEventListener("progress",f)),u&&C.upload&&([p,A]=rL(u),C.upload.addEventListener("progress",p),C.upload.addEventListener("loadend",A)),(o.cancelToken||o.signal)&&(d=_=>{C&&(i(!_||_.type?new QS(null,r,C):_),C.abort(),C=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));let w=_ke(o.url);if(w&&Cd.protocols.indexOf(w)===-1){i(new Gi("Unsupported protocol "+w+":",Gi.ERR_BAD_REQUEST,r));return}C.send(s||null)})}});var eYa,Tsi,Rsi=ut(()=>{ise();PS();$0();eYa=(r,t)=>{let{length:n}=r=r?r.filter(Boolean):[];if(t||n){let i=new AbortController,o,s=function(c){if(!o){o=!0,l();let d=c instanceof Error?c:this.reason;i.abort(d instanceof Gi?d:new QS(d instanceof Error?d.message:d))}},a=t&&setTimeout(()=>{a=null,s(new Gi(`timeout ${t} of ms exceeded`,Gi.ETIMEDOUT))},t),l=()=>{r&&(a&&clearTimeout(a),a=null,r.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),r=null)};r.forEach(c=>c.addEventListener("abort",s));let{signal:u}=i;return u.unsubscribe=()=>Xt.asap(l),u}},Tsi=eYa});var tYa,rYa,nYa,Ugr,Bsi=ut(()=>{tYa=function*(r,t){let n=r.byteLength;if(!t||n<t){yield r;return}let i=0,o;for(;i<n;)o=i+t,yield r.slice(i,o),i=o},rYa=async function*(r,t){for await(let n of nYa(r))yield*tYa(n,t)},nYa=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}let t=r.getReader();try{for(;;){let{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},Ugr=(r,t,n,i)=>{let o=rYa(r,t),s=0,a,l=u=>{a||(a=!0,i&&i(u))};return new ReadableStream({async pull(u){try{let{done:c,value:d}=await o.next();if(c){l(),u.close();return}let p=d.byteLength;if(n){let f=s+=p;n(f)}u.enqueue(new Uint8Array(d))}catch(c){throw l(c),c}},cancel(u){return l(u),o.return()}},{highWaterMark:2})}});var s1t,xsi,iYa,Dsi,oYa,Msi,jgr,o1t,sYa,aYa,Nsi,ksi=ut(()=>{FD();$0();PS();Rsi();Bsi();LD();r1t();qgr();Xpt();s1t=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",xsi=s1t&&typeof ReadableStream=="function",iYa=s1t&&(typeof TextEncoder=="function"?(r=>t=>r.encode(t))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),Dsi=(r,...t)=>{try{return!!r(...t)}catch{return!1}},oYa=xsi&&Dsi(()=>{let r=!1,t=new Request(Cd.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!t}),Msi=64*1024,jgr=xsi&&Dsi(()=>Xt.isReadableStream(new Response("").body)),o1t={stream:jgr&&(r=>r.body)};s1t&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!o1t[t]&&(o1t[t]=Xt.isFunction(r[t])?n=>n[t]():(n,i)=>{throw new Gi(`Response type '${t}' is not supported`,Gi.ERR_NOT_SUPPORT,i)})})})(new Response);sYa=async r=>{if(r==null)return 0;if(Xt.isBlob(r))return r.size;if(Xt.isSpecCompliantForm(r))return(await new Request(Cd.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(Xt.isArrayBufferView(r)||Xt.isArrayBuffer(r))return r.byteLength;if(Xt.isURLSearchParams(r)&&(r=r+""),Xt.isString(r))return(await iYa(r)).byteLength},aYa=async(r,t)=>{let n=Xt.toFiniteNumber(r.getContentLength());return n??sYa(t)},Nsi=s1t&&(async r=>{let{url:t,method:n,data:i,signal:o,cancelToken:s,timeout:a,onDownloadProgress:l,onUploadProgress:u,responseType:c,headers:d,withCredentials:p="same-origin",fetchOptions:f}=i1t(r);c=c?(c+"").toLowerCase():"text";let A=Tsi([o,s&&s.toAbortSignal()],a),h,y=A&&A.unsubscribe&&(()=>{A.unsubscribe()}),C;try{if(u&&oYa&&n!=="get"&&n!=="head"&&(C=await aYa(d,i))!==0){let N=new Request(t,{method:"POST",body:i,duplex:"half"}),L;if(Xt.isFormData(i)&&(L=N.headers.get("content-type"))&&d.setContentType(L),N.body){let[G,Y]=Tme(C,rL(Rme(u)));i=Ugr(N.body,Msi,G,Y)}}Xt.isString(p)||(p=p?"include":"omit");let v="credentials"in Request.prototype;h=new Request(t,{...f,signal:A,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:i,duplex:"half",credentials:v?p:void 0});let w=await fetch(h),_=jgr&&(c==="stream"||c==="response");if(jgr&&(l||_&&y)){let N={};["status","statusText","headers"].forEach(H=>{N[H]=w[H]});let L=Xt.toFiniteNumber(w.headers.get("content-length")),[G,Y]=l&&Tme(L,rL(Rme(l),!0))||[];w=new Response(Ugr(w.body,Msi,G,()=>{Y&&Y(),y&&y()}),N)}c=c||"text";let R=await o1t[Xt.findKey(o1t,c)||"text"](w,r);return!_&&y&&y(),await new Promise((N,L)=>{zD(N,L,{data:R,headers:sf.from(w.headers),status:w.status,statusText:w.statusText,config:r,request:h})})}catch(v){throw y&&y(),v&&v.name==="TypeError"&&/fetch/i.test(v.message)?Object.assign(new Gi("Network Error",Gi.ERR_NETWORK,r,h),{cause:v.cause||v}):Gi.from(v,v&&v.code,r,h)}})});var Wgr,Psi,lYa,a1t,Ggr=ut(()=>{$0();Esi();_si();ksi();PS();Wgr={http:bsi,xhr:wsi,fetch:Nsi};Xt.forEach(Wgr,(r,t)=>{if(r){try{Object.defineProperty(r,"name",{value:t})}catch{}Object.defineProperty(r,"adapterName",{value:t})}});Psi=r=>`- ${r}`,lYa=r=>Xt.isFunction(r)||r===null||r===!1,a1t={getAdapter:r=>{r=Xt.isArray(r)?r:[r];let{length:t}=r,n,i,o={};for(let s=0;s<t;s++){n=r[s];let a;if(i=n,!lYa(n)&&(i=Wgr[(a=String(n)).toLowerCase()],i===void 0))throw new Gi(`Unknown adapter '${a}'`);if(i)break;o[a||"#"+s]=i}if(!i){let s=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build")),a=t?s.length>1?`since :
@@ -1153,7 +1153,7 @@ ${JSON.stringify(s.data,null,2)}`,o,s.data,p.error);uhi(t)&&(s.data=p.data)}retu
1153
1153
  `+r.slice(o,s),o=s+1),a=l;return u+=`
1154
1154
  `,r.length-o>t&&a>o?u+=r.slice(o,a)+`
1155
1155
  `+r.slice(a+1):u+=r.slice(o),u.slice(1)}function DLl(r){for(var t="",n=0,i,o=0;o<r.length;n>=65536?o+=2:o++)n=TLe(r,o),i=bb[n],!i&&eEt(n)?(t+=r[o],n>=65536&&(t+=r[o+1])):t+=i||SLl(n);return t}function NLl(r,t,n){var i="",o=r.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],r.replacer&&(l=r.replacer.call(n,String(s),l)),(XL(r,t,l,!1,!1)||typeof l>"u"&&XL(r,t,null,!1,!1))&&(i!==""&&(i+=","+(r.condenseFlow?"":" ")),i+=r.dump);r.tag=o,r.dump="["+i+"]"}function Fxi(r,t,n,i){var o="",s=r.tag,a,l,u;for(a=0,l=n.length;a<l;a+=1)u=n[a],r.replacer&&(u=r.replacer.call(n,String(a),u)),(XL(r,t+1,u,!0,!0,!1,!0)||typeof u>"u"&&XL(r,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=YTr(r,t)),r.dump&&Rbe===r.dump.charCodeAt(0)?o+="-":o+="- ",o+=r.dump);r.tag=s,r.dump=o||"[]"}function kLl(r,t,n){var i="",o=r.tag,s=Object.keys(n),a,l,u,c,d;for(a=0,l=s.length;a<l;a+=1)d="",i!==""&&(d+=", "),r.condenseFlow&&(d+='"'),u=s[a],c=n[u],r.replacer&&(c=r.replacer.call(n,u,c)),XL(r,t,u,!1,!1)&&(r.dump.length>1024&&(d+="? "),d+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),XL(r,t,c,!1,!1)&&(d+=r.dump,i+=d));r.tag=o,r.dump="{"+i+"}"}function PLl(r,t,n,i){var o="",s=r.tag,a=Object.keys(n),l,u,c,d,p,f;if(r.sortKeys===!0)a.sort();else if(typeof r.sortKeys=="function")a.sort(r.sortKeys);else if(r.sortKeys)throw new oC("sortKeys must be a boolean or a function");for(l=0,u=a.length;l<u;l+=1)f="",(!i||o!=="")&&(f+=YTr(r,t)),c=a[l],d=n[c],r.replacer&&(d=r.replacer.call(n,c,d)),XL(r,t+1,c,!0,!0,!0)&&(p=r.tag!==null&&r.tag!=="?"||r.dump&&r.dump.length>1024,p&&(r.dump&&Rbe===r.dump.charCodeAt(0)?f+="?":f+="? "),f+=r.dump,p&&(f+=YTr(r,t)),XL(r,t+1,d,!0,p)&&(r.dump&&Rbe===r.dump.charCodeAt(0)?f+=":":f+=": ",f+=r.dump,o+=f));r.tag=s,r.dump=o||"{}"}function Lxi(r,t,n){var i,o,s,a,l,u;for(o=n?r.explicitTypes:r.implicitTypes,s=0,a=o.length;s<a;s+=1)if(l=o[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof t=="object"&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(n?l.multi&&l.representName?r.tag=l.representName(t):r.tag=l.tag:r.tag="?",l.represent){if(u=r.styleMap[l.tag]||l.defaultStyle,gDi.call(l.represent)==="[object Function]")i=l.represent(t,u);else if(mDi.call(l.represent,u))i=l.represent[u](t,u);else throw new oC("!<"+l.tag+'> tag resolver accepts not "'+u+'" style');r.dump=i}return!0}return!1}function XL(r,t,n,i,o,s,a){r.tag=null,r.dump=n,Lxi(r,n,!1)||Lxi(r,n,!0);var l=gDi.call(r.dump),u=i,c;i&&(i=r.flowLevel<0||r.flowLevel>t);var d=l==="[object Object]"||l==="[object Array]",p,f;if(d&&(p=r.duplicates.indexOf(n),f=p!==-1),(r.tag!==null&&r.tag!=="?"||f||r.indent!==2&&t>0)&&(o=!1),f&&r.usedDuplicates[p])r.dump="*ref_"+p;else{if(d&&f&&!r.usedDuplicates[p]&&(r.usedDuplicates[p]=!0),l==="[object Object]")i&&Object.keys(r.dump).length!==0?(PLl(r,t,r.dump,o),f&&(r.dump="&ref_"+p+r.dump)):(kLl(r,t,r.dump),f&&(r.dump="&ref_"+p+" "+r.dump));else if(l==="[object Array]")i&&r.dump.length!==0?(r.noArrayIndent&&!a&&t>0?Fxi(r,t-1,r.dump,o):Fxi(r,t,r.dump,o),f&&(r.dump="&ref_"+p+r.dump)):(NLl(r,t,r.dump),f&&(r.dump="&ref_"+p+" "+r.dump));else if(l==="[object String]")r.tag!=="?"&&MLl(r,r.dump,t,s,u);else{if(l==="[object Undefined]")return!1;if(r.skipInvalid)return!1;throw new oC("unacceptable kind of an object to dump "+l)}r.tag!==null&&r.tag!=="?"&&(c=encodeURI(r.tag[0]==="!"?r.tag.slice(1):r.tag).replace(/!/g,"%21"),r.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",r.dump=c+" "+r.dump)}return!0}function QLl(r,t){var n=[],i=[],o,s;for($Tr(r,n,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(n[i[o]]);t.usedDuplicates=new Array(s)}function $Tr(r,t,n){var i,o,s;if(r!==null&&typeof r=="object")if(o=t.indexOf(r),o!==-1)n.indexOf(o)===-1&&n.push(o);else if(t.push(r),Array.isArray(r))for(o=0,s=r.length;o<s;o+=1)$Tr(r[o],t,n);else for(i=Object.keys(r),o=0,s=i.length;o<s;o+=1)$Tr(r[i[o]],t,n)}function FLl(r,t){t=t||{};var n=new wLl(t);n.noRefs||QLl(r,n);var i=r;return n.replacer&&(i=n.replacer.call({"":i},"",i)),XL(n,0,i,!0,!0)?n.dump+`
1156
- `:""}var LLl=FLl,zLl={dump:LLl};function nRr(r,t){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var tEt=Py,RDi=Uxi,BDi=Vxi,MDi=$xi,xDi=Xxi,DDi=ZTr,rEt=hDi.load,NDi=hDi.loadAll,nEt=zLl.dump,iEt=oC,kDi={binary:nDi,float:Jxi,map:Gxi,null:Hxi,pairs:oDi,set:sDi,timestamp:tDi,bool:Kxi,int:Yxi,merge:rDi,omap:iDi,seq:Wxi,str:jxi},PDi=nRr("safeLoad","load"),QDi=nRr("safeLoadAll","loadAll"),FDi=nRr("safeDump","dump"),qLl={Type:tEt,Schema:RDi,FAILSAFE_SCHEMA:BDi,JSON_SCHEMA:MDi,CORE_SCHEMA:xDi,DEFAULT_SCHEMA:DDi,load:rEt,loadAll:NDi,dump:nEt,YAMLException:iEt,types:kDi,safeLoad:PDi,safeLoadAll:QDi,safeDump:FDi};var mc=class r{constructor(t){this.value=t}static representation="[REDACTED]";get sensitiveValue(){return this.value}toString(){return r.representation}toJSON(){return r.representation}[Symbol.for("nodejs.util.inspect.custom")](){return r.representation}},lVd=new tEt("tag:yaml.org,2002:str",{kind:"scalar",instanceOf:mc,represent:r=>r.toString()});var iRr=r=>r;var Bbe=yt(wo());fr();Wr();var LDi=T.string().brand(Symbol("SantizedString"));function UDi(r){return!!r&&typeof r=="object"&&"orgId"in r&&"userId"in r&&typeof r.orgId=="string"&&typeof r.userId=="string"}function ULl(r){return UDi(r)&&"workspaceId"in r&&typeof r.workspaceId=="string"}function jLl(r){if(!UDi(r)){let t=(0,Bbe.mapValues)((0,Bbe.pick)(r,"orgId","userId"),n=>typeof n);throw new ft(`Secret got an invalid context type at runtime (got: ${t}, expected orgId & userId) - cannot create name`)}}function WLl(r){if(!ULl(r)){let t=(0,Bbe.mapValues)((0,Bbe.pick)(r,"orgId","userId","workspaceId"),n=>typeof n);throw new ft(`Secret got an invalid context type at runtime (got: ${t}, expected orgId & userId & workspaceId) - cannot create name`)}}function zDi(r){return jLl(r),r}function qDi(r){return WLl(r),r}var GLl=/[^a-zA-Z0-9/-]/gu,VLl=r=>{let t="-".codePointAt(0).toString(16);return r.replaceAll("--",`--${t}---${t}-`).replaceAll(GLl,n=>`--${n.codePointAt(0).toString(16)}-`)},sEt=r=>LDi.parse(r.map(VLl).join("_")),aEt=(r,t)=>{if(r.secretNameFormat==="orgId"){let n=zDi(t);return sEt([n.orgId,r.typeName])}else if(r.secretNameFormat==="orgIdAndUserId"){let n=zDi(t);return sEt([n.orgId,n.userId,r.typeName])}else if(r.secretNameFormat==="orgIdAndWorkspaceId"){let n=qDi(t);return sEt([n.orgId,n.workspaceId,r.typeName])}else if(r.secretNameFormat==="orgIdAndWorkspaceIdAndUserId"){let n=qDi(t);return sEt([n.orgId,n.workspaceId,n.userId,r.typeName])}else{let n=r.secretNameFormat;throw new ft(`Got an unknown secret name format "${n}" - cannot create name`)}},HLl=r=>{let t=/\-\-([0-9a-f]+)\-/g,n=r.replaceAll(t,i=>String.fromCodePoint(parseInt(i.replaceAll("-",""),16)));if(n!==r)return n},lEt=r=>{let t=HLl(r);if(!(t===void 0||t.match(/[^a-zA-Z0-9/_-]/g)))return t};mi();var Y9=et.SECRETS;function sRr(r,t){return!!r&&typeof r=="object"&&"code"in r&&r.code===t}function KLl(r){return sRr(r,dEt.Status.INVALID_ARGUMENT)&&"details"in r&&typeof r.details=="string"&&r.details.startsWith("Secret payload data length must be at most")}function Mbe(r){return sRr(r,dEt.Status.NOT_FOUND)||YLl(r)}function YLl(r){return sRr(r,dEt.Status.FAILED_PRECONDITION)&&typeof r?.message=="string"&&r.message.includes("is in DESTROYED state")}function oRr(r){if(!r)return null;let t=r.split("/").pop();if(!t)return null;let n=parseInt(t);return Number.isNaN(n)?null:n}var JLl=9e4,$Ll=600,XLl=600,aRr=10,ZLl=new Sbe({tokensPerInterval:JLl/aRr,interval:"minute"}),ezl=new Sbe({tokensPerInterval:$Ll/aRr,interval:"minute"}),cEt=new Sbe({tokensPerInterval:XLl/aRr,interval:"minute"}),tzl=new n_(1),uEt=class{constructor(t,n=new jDi.SecretManagerServiceClient){this.projectId=t;this.client=n}shouldUpgradeLegacyResultsToNewName(){return!1}BuildSecretName=t=>`projects/${this.projectId}/secrets/${t}`;BuildSecretNameLatestVersion=t=>`${this.BuildSecretName(t)}/versions/latest`;getByName=async t=>{await ZLl.removeTokens(1);let n=await this.client.accessSecretVersion({name:this.BuildSecretNameLatestVersion(t)}),[i]=n,o=i.payload?.data?.toString();return o?new mc(o):null};makeAddVersionData=(t,n)=>({parent:this.BuildSecretName(t),payload:{data:iRr(Buffer.from(n.sensitiveValue))}});addVersionByName=async(t,n)=>{let i=this.makeAddVersionData(t,n);await cEt.removeTokens(1),await this.client.addSecretVersion(i),this.PruneInaccessibleVersions(i.parent).catch(o=>{Y9.error("Could not prune versions for",i.parent,o)})};setByName=async(t,n)=>{await cEt.removeTokens(2);let i=this.makeAddVersionData(t,n);await this.client.createSecret({parent:`projects/${this.projectId}`,secretId:t,secret:{replication:{automatic:{}}}}),await this.client.addSecretVersion(i)};listSecretVersions=async t=>{await ezl.removeTokens(1);let[n]=await this.client.listSecretVersions({parent:this.BuildSecretName(t)});return n};destroySecretVersion=async t=>{await cEt.removeTokens(1),await this.client.destroySecretVersion({name:t})};getMissingSecret=async t=>{let n=lEt(t);if(n)try{let i=await this.getByName(n);return i&&this.shouldUpgradeLegacyResultsToNewName()&&(await this.setByName(t,i),await this.deleteByName(n)),i}catch(i){if(!Mbe(i))throw i}return null};Get=async t=>{try{return await this.getByName(t)}catch(n){if(Mbe(n))return this.getMissingSecret(t);throw n}};setMissingSecret=async(t,n)=>{let i=lEt(t);if(!i)await this.setByName(t,n);else if(this.shouldUpgradeLegacyResultsToNewName())await this.setByName(t,n),await this.deleteByName(i,{ignoreMissing:!0});else try{await this.addVersionByName(i,n)}catch(o){if(Mbe(o)){await this.setByName(t,n);return}throw o}};Set=async(t,n)=>{try{await this.addVersionByName(t,n);return}catch(i){if(Mbe(i)){await this.setMissingSecret(t,n);return}throw KLl(i)&&Y9.emerg("Payload exceeded for: ",t,"Reach out to support to determine if feature flags to adjust secret storage are appropriate next steps",i),i}};deleteByName=async(t,n)=>{try{await cEt.removeTokens(1),await this.client.deleteSecret({name:this.BuildSecretName(t)})}catch(i){if(n?.ignoreMissing&&Mbe(i))return;throw i}};Delete=async t=>{let n=lEt(t),i=[t];n&&i.push(n),await JE(i.map(o=>this.deleteByName(o,{ignoreMissing:!0})))};PruneInaccessibleVersions=async t=>{try{Y9.info("Begin pruning inaccessible versions for secret",t),await tzl.runExclusive(async()=>{Y9.info("Got lock for pruning inaccessible versions for secret",t);let i=(await this.listSecretVersions(t)).filter(o=>o.state==="ENABLED"&&!!oRr(o.name)).sort((o,s)=>oRr(s.name)-oRr(o.name)).slice(1);for(let o of i)try{Y9.info("Destroying secret version",o.name),await this.destroySecretVersion(o.name),Y9.info("Successfully destroyed secret version",o.name)}catch(s){Mbe(s)?Y9.error("Tried to prune secret",o.name,"but it was not found"):Y9.alert("Error trying to prune inaccessible secret version",o.name,". Error: ",s)}},1)}catch(n){Y9.alert("Fatal error trying to prune inaccessible secret versions for secret",t,". Error: ",n)}finally{Y9.info("Completed pruning inaccessible versions for secret",t)}}};var pEt=class{injectError=null;data={};InjectErrorIfNeeded=()=>{if(this.injectError!==null)throw this.injectError};Get=async t=>{this.InjectErrorIfNeeded();let n=this.data[t];return n===void 0?null:new mc(n)};Set=async(t,n)=>{this.InjectErrorIfNeeded(),this.data[t]=n.sensitiveValue};Delete=async t=>{this.InjectErrorIfNeeded(),delete this.data[t]}};var C$i=yt(E$i());var qIt=class r{client;constructor(t){this.client=(0,C$i.createClient)({url:t})}static Create=async t=>{let n=new r(t);return await n.client.connect(),n};Get=async t=>{let n=await this.client.get(t);return n===null?null:new mc(n)};Set=async(t,n)=>{await this.client.set(t,n.sensitiveValue)};Delete=async t=>{await this.client.del(t)}};var XIe=class{constructor(t){this.secretStore=t}Get=async(t,n)=>{let i=await this.secretStore.Get(aEt(t,n));if(i===null)return null;let o=new mc(t.dataValidator.assert(JSON.parse(i.sensitiveValue)));return t.GetEntry(n,o)};Set=async(t,n,i)=>{let o=aEt(t,n),s=null,a=await this.secretStore.Get(o);a!==null&&(s=new mc(t.dataValidator.assert(JSON.parse(a.sensitiveValue))));let l=t.SetEntry(n,s,i);await this.secretStore.Set(o,new mc(JSON.stringify(l.sensitiveValue)))};Delete=async(t,n)=>{let i=aEt(t,n),o=await this.secretStore.Get(i);if(o===null)return;let s=new mc(t.dataValidator.assert(JSON.parse(o.sensitiveValue))),a=t.DeleteEntry(n,s);a===null?await this.secretStore.Delete(i):await this.secretStore.Set(i,new mc(JSON.stringify(a.sensitiveValue)))};Upgrade=async(t,n,i,o,s)=>{let a=await this.Get(t,n);if(!a)return;await this.Get(i,o)||await this.Set(i,o,new mc(s(a.sensitiveValue))),await this.Delete(t,n)}};var UIt=class{client;constructor(t,n){this.client=XS(t,n)}Exists=async(t,n)=>await this.client.SecretExists({params:{context:t.EncodeContext(n),secretType:t.typeName}});Set=async(t,n,i)=>await this.client.SetSecret({secretValue:i.sensitiveValue},{params:{context:t.EncodeContext(n),secretType:t.typeName}});Delete=async(t,n)=>await this.client.DeleteSecret(void 0,{params:{context:t.EncodeContext(n),secretType:t.typeName}});Upgrade=async(t,n)=>await this.Exists(t,n)?(await this.client.UpgradeSecret(void 0,{params:{context:t.EncodeContext(n),secretType:t.typeName}}),!0):!1};fr();var jIt=class{backend;constructor(t){this.backend=new XIe(t)}Exists=async(t,n)=>await this.backend.Get(t,n)!==null;Set=async(t,n,i)=>await this.backend.Set(t,n,i);Delete=async(t,n)=>await this.backend.Delete(t,n);Upgrade=async(t,n)=>{if(!await this.Exists(t,n))return!1;let i=t.UpgradeTarget;if(!i)throw new Oo("Cannot upgrade this secret type",`Secret type ${t.typeName} as no upgrade target`);return await this.backend.Upgrade(t,n,i,n,o=>o),!0}};dr();var iMr=yt(wo()),ize=yt(qw());var oze=ize.Record({orgId:ize.String,userId:ize.String}),WIt=(r,t,n,i)=>({DecodeContext:o=>r.assert({[t]:o}),EncodeContext:o=>(r.assert(o),encodeURIComponent(o[t])),GetEntry:(o,s)=>{r.assert(o),n.assert(s.sensitiveValue);let a=s.sensitiveValue[o[t]];return a?new mc(i.assert(a)):null},SetEntry:(o,s,a)=>{r.assert(o);let l=s?(0,iMr.cloneDeep)(n.assert(s.sensitiveValue)):{};return l[o[t]]=i.assert(a.sensitiveValue),new mc(l)},DeleteEntry:(o,s)=>{r.assert(o),n.assert(s.sensitiveValue);let a=s?(0,iMr.cloneDeep)(n.assert(s.sensitiveValue)):{};return delete a[o[t]],typeof a=="object"&&(a===null||Object.keys(a).length===0)?null:a?new mc(a):null}}),I$i=(r,t,n)=>({DecodeContext:i=>r.assert({[t]:i}),EncodeContext:i=>(r.assert(i),encodeURIComponent(i[t])),GetEntry:(i,o)=>(r.assert(i),o),SetEntry:(i,o,s)=>(r.assert(i),n.assert(s.sensitiveValue),s),DeleteEntry:(i,o)=>(r.assert(i),n.assert(o.sensitiveValue),null)});var ZIe=yt(qw());uhr();var v$i=ZIe.Record({gitAccountId:ZIe.String}),jrc=ZIe.Intersect(oze,v$i),Wrc=GI("SecretContextGitAccount",v$i),S$i=(r,t)=>WIt(Wrc,"gitAccountId",r,t);var eve=yt(qw());var O$i=eve.Record({workspaceId:eve.String}),Grc=eve.Intersect(oze,O$i),w$i=GI("SecretContextWorkspace",O$i),Pg=(r,t)=>WIt(w$i,"workspaceId",r,t),tve=r=>I$i(w$i,"workspaceId",r);Wr();Ko();var Vrc=fd(Tl(),Tl()),_$i=ir("GitTokens",Vrc),T$i=ir("string",Tl()),GIt={typeName:"GitTokens",dataValidator:_$i,entryValidator:T$i,secretNameFormat:"orgIdAndUserId",...S$i(_$i,T$i),UpgradeTarget:void 0};Wr();Ko();var oMr=T.object({password:T.string()}),Hrc=T.record(T.string(),oMr),VIt=ir("SnowflakeCredentials",Hrc),HIt=ir("SnowflakeCredentialsEntry",oMr),sze={typeName:"SnowflakeCredentialsV2",dataValidator:VIt,entryValidator:HIt,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(VIt,HIt),UpgradeTarget:void 0},$ae={typeName:"SnowflakeCredentials",dataValidator:VIt,entryValidator:HIt,secretNameFormat:"orgIdAndUserId",...Pg(VIt,HIt),UpgradeTarget:sze};Wr();Ko();var B$i=T.object({clientId:T.string(),clientSecret:T.string()}),Krc=T.record(T.string(),B$i),R$i=ir("SnowflakeOAuthForWorkspaces",Krc),aze=ir("SnowflakeOAuth",B$i),lze={typeName:"SnowflakeOAuthV2",dataValidator:aze,entryValidator:aze,secretNameFormat:"orgIdAndWorkspaceId",...tve(aze),UpgradeTarget:void 0},Xae={typeName:"SnowflakeOAuth",dataValidator:R$i,entryValidator:aze,secretNameFormat:"orgId",...Pg(R$i,aze),UpgradeTarget:lze};Wr();Ko();var sMr=ot.object({access_token:ot.string(),refresh_token:ot.string()}),Yrc=ot.record(ot.string(),sMr),KIt=ir("SnowflakeTokens",Yrc),YIt=ir("SnowflakeTokensEntry",sMr),Zae={typeName:"SnowflakeTokensV2",dataValidator:KIt,entryValidator:YIt,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(KIt,YIt),UpgradeTarget:void 0},jB={typeName:"SnowflakeTokens",dataValidator:KIt,entryValidator:YIt,secretNameFormat:"orgIdAndUserId",...Pg(KIt,YIt),UpgradeTarget:Zae};var Jrc=yt(require("crypto")),M$i=require("fs");fr();var aMr=(()=>{let r=Jrc;return r&&typeof r=="object"&&"createPrivateKey"in r&&r.createPrivateKey?r.createPrivateKey:void 0})();function cze(r,t){if(aMr===void 0)throw new ft("Cannot work with private keys in this environment");try{let i=aMr({key:r.sensitiveValue,passphrase:t?.sensitiveValue}).export({format:"pem",type:"pkcs8"});if(!i||typeof i!="string")throw new ft("Unknown error decrypting private key");if(t!==void 0)try{throw aMr({key:r.sensitiveValue}),new Oo("Private key is not encrypted but a passphrase was provided")}catch(o){if(Tp(o))throw o;if(!o||typeof o!="object"||"code"in o&&o.code!=="ERR_OSSL_CRYPTO_INTERRUPTED_OR_CANCELLED")throw new ft("Unknown error decrypting private key",o?.message)}return new mc(i)}catch(n){if(Tp(n))throw n;if(n&&typeof n=="object"&&"code"in n)switch(n.code){case"ERR_OSSL_UNSUPPORTED":throw new Oo("Unable to parse private key");case"ERR_OSSL_BAD_DECRYPT":throw new Oo("Unable to decrypt private key using the provided passphrase");case"ERR_OSSL_CRYPTO_INTERRUPTED_OR_CANCELLED":throw new Oo("Unable to decrypt private key without a passphrase")}throw new ft("Unknown error decrypting private key",n?.message)}}function x$i(r,t){try{return cze(new mc((0,M$i.readFileSync)(r)),t)}catch(n){if(Tp(n))throw n;if(n&&typeof n=="object"&&"code"in n)switch(n.code){case"ENOENT":throw new Oo(`Private key file not found at ${r}`);case"EACCES":throw new Oo(`Permission denied to read private key file at ${r}`)}throw new ft(`Unknown error decrypting private key at ${r}`,n?.message)}}fr();Wr();Ko();var lMr=T.object({key:T.string(),passphrase:T.string().nullable().optional(),savePassphrase:T.boolean().optional()}).superRefine((r,t)=>{if((r.passphrase===void 0||r.passphrase===null)&&r.savePassphrase!==void 0)return t.addIssue({code:T.ZodIssueCode.custom,message:"Can't have passphrase unset and savePassphrase set at the same time",fatal:!0,path:["passphrase"]}),T.NEVER;let n=r.passphrase===void 0||r.passphrase===null?void 0:new mc(r.passphrase);r.savePassphrase||(delete r.passphrase,delete r.savePassphrase);try{cze(new mc(r.key),n)}catch(i){(!Tp(i)||i.message!=="Unable to decrypt private key without a passphrase")&&t.addIssue({code:T.ZodIssueCode.custom,message:i instanceof Error?i.message:"Unknown error validating private key"})}}),$rc=T.record(T.string(),lMr),JIt=ir("SnowflakeKeyPairSecret",$rc),$It=ir("SnowflakeKeyPairEntry",lMr),D$i="SnowflakeKeyPair",Xrc=D$i+"V2",uze={typeName:Xrc,dataValidator:JIt,entryValidator:$It,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(JIt,$It),UpgradeTarget:void 0},ele={typeName:D$i,dataValidator:JIt,entryValidator:$It,secretNameFormat:"orgIdAndWorkspaceId",...Pg(JIt,$It),UpgradeTarget:uze};Wr();Ko();var cMr=ot.object({token:ot.string()}),Zrc=ot.record(cMr),N$i=ir("DatabricksCredentials",Zrc),k$i=ir("DatabricksCredentialsEntry",cMr),rve={typeName:"DatabricksCredentials",dataValidator:N$i,entryValidator:k$i,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(N$i,k$i),UpgradeTarget:void 0};Wr();Ko();var enc=ot.object({clientId:ot.string(),clientSecret:ot.string()}),uMr=ir("DatabricksOAuthU2M",enc),nve={typeName:"DatabricksOAuthU2M",dataValidator:uMr,entryValidator:uMr,secretNameFormat:"orgIdAndWorkspaceId",...tve(uMr),UpgradeTarget:void 0};Wr();Ko();var tnc=ot.object({clientID:ot.string(),clientSecret:ot.string()}),dMr=ir("DatabricksOAuthM2M",tnc),tle={typeName:"DatabricksOAuthM2M",dataValidator:dMr,entryValidator:dMr,secretNameFormat:"orgIdAndWorkspaceId",...tve(dMr),UpgradeTarget:void 0};Wr();Ko();var F$i=ot.object({clientID:ot.string(),clientSecret:ot.string()}),rnc=ot.record(F$i),P$i=ir("FabricCredentials",rnc),Q$i=ir("FabricCredentialsEntry",F$i),pMr={typeName:"FabricCredentials",dataValidator:P$i,entryValidator:Q$i,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(P$i,Q$i),UpgradeTarget:void 0};Wr();Ko();var q$i=ot.object({access_token:ot.string(),refresh_token:ot.string()}),nnc=ot.record(ot.string(),q$i),L$i=ir("DatabricksOAuthU2MTokens",nnc),z$i=ir("DatabricksOAuthU2MTokensEntry",q$i),s7={typeName:"DatabricksOAuthU2MTokens",dataValidator:L$i,entryValidator:z$i,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(L$i,z$i),UpgradeTarget:void 0};var inc={[GIt.typeName]:GIt,[$ae.typeName]:$ae,[sze.typeName]:sze,[ele.typeName]:ele,[uze.typeName]:uze,[Xae.typeName]:Xae,[lze.typeName]:lze,[jB.typeName]:jB,[Zae.typeName]:Zae,[rve.typeName]:rve,[nve.typeName]:nve,[s7.typeName]:s7,[tle.typeName]:tle,[pMr.typeName]:pMr};Wr();Ko();var W$i=ot.object({clientID:ot.string(),clientSecret:ot.string()}),onc=ot.record(W$i),U$i=ir("FabricCredentials",onc),j$i=ir("FabricCredentialsEntry",W$i),fMr={typeName:"FabricCredentials",dataValidator:U$i,entryValidator:j$i,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(U$i,j$i),UpgradeTarget:void 0};var AMr=et.SECRETS,G$i=(0,XIt.default)(async()=>{switch(process.env.COALESCE_SECRET_STORE_TYPE){case"redis":if(AMr.app("Selected Redis secret store."),!process.env.COALESCE_SECRET_STORE_REDIS_URL)throw new Error("The redis secret store is configured, but no COALESCE_SECRET_STORE_REDIS_URL was defined.");return await qIt.Create(process.env.COALESCE_SECRET_STORE_REDIS_URL);case"memory":return AMr.app("Selected Memory secret store."),new pEt;case"google":default:return AMr.app("Selected Google Secrets Manager secret store."),new uEt((await dgt()).projectId)}}),Ib=(0,XIt.default)(async()=>new XIe(await G$i())),Unp=(0,XIt.default)(async()=>_c().isTest?new jIt(await G$i()):new UIt(P3(),ZE()));dr();var anc=et.SECRETS;var ive=async(r,t,n,i)=>{let o={userID:t.userId,orgID:t.orgId,workspaceID:+t.workspaceId},s=n.UpgradeTarget;if(i&&s){let a=await r.Get(s,t);return a||(a=await r.Get(n,t),a&&(anc.infoContext(o,`v2 Snowflake secrets feature flag was set, found v1 credentials. Upgrading v1 to v2 for ${n.typeName}`),await r.Set(s,t,a),await r.Delete(n,t))),a}else return await r.Get(n,t)};mi();dr();var hZi=yt(Hp()),gic={redirectUrl:null},qMr=(0,hZi.createSlice)({name:"redirects",initialState:gic,reducers:{setRedirectUrl(r,t){return{...r,redirectUrl:t.payload.redirectUrl}},removeRedirectUrl(r){return{...r,redirectUrl:null}}}});Wr();var gZi=yt(Hp()),UMr="UPDATE_CREDENTIAL";var jMr="DELETE_CREDENTIAL";var WMr="BULK_UPDATE_CONFIG";var GMr=(0,gZi.createSlice)({name:"workspaces",initialState:{workspaces:{}},reducers:{set(r,t){return r={workspaces:{...r.workspaces,...t.payload}},r},delete(r,t){return t.payload.forEach(n=>{delete r.workspaces[+n]}),r}}}),mic=T.object({}),yic=T.object({snowflakePassword:T.union([T.undefined(),T.string()])}),bic=T.object({databricksToken:T.union([T.undefined(),T.string()])}),Eic=T.object({databricksOAuthM2M:T.union([T.undefined(),T.string()])}),Cic=T.object({fabricCredential:T.union([T.undefined(),T.string()])}),mZi=T.union([mic,yic,bic,Eic,Cic]);dr();var yZi=yt(Hp());var Iic={},VMr=(0,yZi.createSlice)({name:"adminUsers",initialState:Iic,reducers:{createAdminUsersBulk(r,t){return{...r,...t.payload.valuesToCreate}},updateAdminUsersBulk(r,t){return{...r,...t.payload.valuesToModify}},deleteAdminUsersBulk(r,t){return Iu(r,n=>{t.payload.valuesToDelete.forEach(i=>{delete n[i]})})}}}),{createAdminUsersBulk:vic,updateAdminUsersBulk:Sic,deleteAdminUsersBulk:Oic}=VMr.actions;var CZi=yt(Hp());var bZi=yt(Hp());Ji();Ko();var EZi=a9.nullable().default(null),wic=ir("currentWorkspace",EZi),HMr=(0,bZi.createSlice)({name:"currentWorkspace",initialState:EZi.parse(null),reducers:{getSetCurrentWorkspaceWithoutResettingState(r,t){return t.payload},getChangeWorkspace(r,t){return t.payload}}}),{getSetCurrentWorkspaceWithoutResettingState:_ip,getChangeWorkspace:D_}=HMr.actions;var _ic={},KMr=(0,CZi.createSlice)({name:"folders",initialState:_ic,reducers:{createFoldersBulk(r,t){return{...r,...t.payload.valuesToCreate}},updateFoldersBulk(r,t){return{...r,...t.payload.valuesToModify}},deleteFoldersBulk(r,t){return Iu(r,n=>{t.payload.valuesToDelete.forEach(i=>{delete n[i]})})}},extraReducers:r=>{r.addCase(D_,(t,n)=>({}))}}),{createFoldersBulk:Tic,updateFoldersBulk:Ric,deleteFoldersBulk:YMr}=KMr.actions;var IZi=yt(Hp());var JMr=(0,IZi.createSlice)({name:"mapping",initialState:{},reducers:{createMappingBulk(r,t){return{...r,...t.payload.valuesToCreate}},updateMappingBulk(r,t){return{...r,...t.payload.valuesToModify}},deleteMappingBulk(r,t){return Iu(r,n=>{t.payload.valuesToDelete.forEach(i=>{delete n[i]})})},getPopulateAllMappings(r,t){return t.payload.mappingsObj}},extraReducers:r=>{r.addCase(D_,(t,n)=>({}))}}),{createMappingBulk:Bic,updateMappingBulk:Mic,deleteMappingBulk:xic,getPopulateAllMappings:Nip}=JMr.actions;var vZi=yt(Hp());var Dic={},$Mr=(0,vZi.createSlice)({name:"orgs",initialState:Dic,reducers:{createOrgsBulk(r,t){return{...r,...t.payload.valuesToCreate}},updateOrgsBulk(r,t){return{...r,...t.payload.valuesToModify}},deleteOrgsBulk(r,t){return Iu(r,n=>{t.payload.valuesToDelete.forEach(i=>{delete n[i]})})}}}),{createOrgsBulk:Nic,updateOrgsBulk:kic,deleteOrgsBulk:Pic}=$Mr.actions;var Uip=et.STATE;var OZi=yt(Hp());var SZi=r=>{let t=i=>i.forEach(o=>{o.sourceColumnReferences?.forEach(s=>{let a=s?.columnReferences[0]??null;a&&(a.stepCounter=a.stepCounter.toString())})}),n=r?.operation?.metadata?.columns??[];return t(n),r},XMr={allSteps:{}},gvt=(0,OZi.createSlice)({name:"steps",initialState:XMr,reducers:{createStepsBulk(r,t){let n={};for(let[i,o]of Object.entries(t.payload))n[i]=SZi(o);return r.allSteps={...r.allSteps,...n},r},updateStepsBulk(r,t){for(let[n,i]of Object.entries(t.payload))r.allSteps[n]=i;return r},deleteStepsBulk(r,t){for(let n of t.payload)delete r.allSteps[n];return r},clearAllSteps(){return{...XMr}},getUpdateStepDataAction(r,t){let{stepData:n}=t.payload;return r.allSteps[t.payload.stepCounter]=SZi(n),r},getNewGraph(r,t){return r.gFinal=t.payload.graph,r}},extraReducers:r=>{r.addCase(D_,(t,n)=>XMr)}}),{deleteStepsBulk:_J,getUpdateStepDataAction:Vip,getNewGraph:Hip}=gvt.actions;var wZi=yt(Hp());var aC=(r,t=!1)=>(0,wZi.createSlice)({name:r,initialState:{},reducers:{set:(i,o)=>(i={...i,...o.payload},i),delete:(i,o)=>(o.payload.forEach(s=>{delete i[s]}),i)},extraReducers:t?i=>{i.addCase(D_,(o,s)=>(o={},o))}:{}});var ZMr=aC("projects");var e8r=aC("installedPackages",!0);var t8r=aC("globalUserSettings");var r8r=aC("gitAccounts");var n8r=aC("projectGitAccounts");XE();dr();Mc();QA();var qic=et.RUNNER;function Bze(r){let t=Dx(Va(r));return qic.error("RunPost formattedRealError:",t,"raw error"),t}dr();XE();Zl();function i8r(r){let t=r.response?.status;return!!t&&t>499&&t<600}function Uic(r,t){return r.includes("https://securetoken.googleapis.com")&&t===502}function jic(r,t,n){let i=r.includes(P3()),o=i&&n&&n.includes("/api/json_template"),s=i&&r.startsWith("https://local.app.coalescestage.io");return o||t===502&&i||(t===504||t===503)&&s}function o8r(r){if(!i8r(r))return!1;let n=r.config&&(r.config.baseURL??P3()),i=r.config?.url,o=r.response?.status;if(!n||!o)return!1;let s=jic(n,o,i),a=Uic(n,o);return s||a}Cy();var Wic=et.RUNNER;async function s8r(r,t=3,n=1e4){return Z0(r,t+1,Wic,{},{retryStrategy:{name:"backoff",base:n/1e3},logOnRetry:"Request returned status 500",retryLogLevel:"info",logOnFailure:"Retry500ResponsesWithExponentialBackoff failed, request never resolved after maximum allowed retries.",failureLogLevel:"error",customErrorOnFailure:i=>{let o=new Error().stack,s=Og(i)&&i.config?i.config.baseURL:"";return[i,o,s]},checkError:i=>{if(!Og(i)||Og(i)&&i.response?.status===401||!o8r(i))return i}})}dr();XE();var Gic=et.RUNNER;async function a8r(r){return await Z0(r,3,Gic,{},{checkError:i=>(i instanceof Error?i.toString():"").toLowerCase().includes("getaddrinfo")?null:i,logOnRetry:"Got an error that looks like DNS, retrying"})}function l8r(r){return()=>a8r(r)}var mvt={getFormattedRealErrorFromAxiosError:Bze,Retry500ResponsesWithExponentialBackoff:s8r,WrapRequestInDNSRetry:l8r};Cy();Zl();fr();Cy();fr();var _Zi=r=>{if(Og(r)&&r.response?.status===409){let t=r.response?.data?.error?.errorString??"",n=r.response?.data?.error?.errorDetail??"",i=n.indexOf(", context"),o=i>=0?n.substring(0,i):"Resource access blocked due to conflict";throw new N3(t,o)}};var c8r=async(r,t,n)=>{let i={};n!==void 0&&(i.Authorization=`Bearer ${n}`);let o=async()=>(await Fp).post(r,t,{headers:i}),s=mvt.WrapRequestInDNSRetry(o);return mvt.Retry500ResponsesWithExponentialBackoff(s).catch(a=>{_Zi(a);let l=500;Og(a)&&(l=a.status||a.response?.status||500);let u=mvt.getFormattedRealErrorFromAxiosError(a);throw new ft(u.error.errorString,u.error.errorDetail||void 0,l)})},uz=(r,t,n)=>c8r(new URL(r,P3()).href,t,n);Ko();fr();dr();var Qg=yt(qw());Wr();Uo();var TZi=yt(qw()),dve=r=>{let t=i=>r.includes(i),n=i=>`Failed constraint check. Expected one of ${JSON.stringify(r)}, but received ${JSON.stringify(i)}`;return TZi.Unknown.withConstraint(i=>t(i)||n(i))};Ko();var yvt=["Basic","OAuth","KeyPair","Cloud"];var Vic=ot.object({connectionKind:ot.literal(Id.Values.databricks),connectionType:ot.enum(["Cloud","Token","OAuthM2M","OAuthU2M"]),connectionDetails:ot.object({userID:ot.string(),path:ot.string(),user:ot.string().optional()})}),usp=ot.object({connectionKind:ot.literal(Id.Values.fabric),connectionType:ot.literal("oauth"),connectionDetails:ot.object({userID:ot.string(),connectionString:ot.string().optional()})}),dsp=ir("DatabricksUserConnection",Vic),Hic=Qg.Record({userID:Qg.String,user:Qg.String,role:Qg.String.optional(),warehouse:Qg.String.optional(),authenticator:Qg.Optional(Qg.Union(Qg.Literal("Basic"),Qg.Literal("OAuth"),Qg.Literal("KeyPair"))),keyPair:Qg.Optional(Qg.String)}),RZi=Qg.Record({connectionKind:Qg.Literal(Id.Values.snowflake).optional(),connectionType:dve(yvt),connectionDetails:Hic});var u8r=et.CONNECTION,Yic=GI("UserConnectionType",RZi),Jic=async(r,t,n)=>{let i=n.isFeatureEnabled("enableSnowflakeOAuthSecretsV2");return ive(r,t,Xae,i)},$ic=async(r,t)=>await r.Get(nve,t);var BZi=async(r,t,n)=>ive(r,t,$ae,n),MZi=async(r,t,n)=>{let i=n.isFeatureEnabled("enableSnowflakeSecretsV2");return ive(r,t,jB,i)},xZi=async r=>await(await Ib()).Get(s7,r),DZi=async(r,t,n)=>await r.Set(s7,t,n),NZi=async(r,t,n,i)=>{if(!i.isFeatureEnabled("enableSnowflakeSecretsV2"))return await r.Set(jB,t,n);await r.Get(jB,t)&&await r.Delete(jB,t),await r.Set(Zae,t,n)},bvt=async(r,t,n,i)=>{let o;try{o=await r.workspace(n).fetch()}catch(u){throw Tp(u)&&u instanceof hl?new ft(`Environment ${n} doesn't exist in org ${t.fbTeamID}`):u}let s={orgId:t.fbTeamID,userId:t.fbUserID,workspaceId:n.toString()},a=await Ib(),l=i===Id.Values.databricks?await $ic(a,s):await Jic(a,s,Rp().featureFlags);if(l===null)throw new ft(`Unable to get OAuth credentials for environment ${n} in org ${t.fbTeamID}!`);return{oauthClientID:l.sensitiveValue.clientId,oauthClientSecret:l.sensitiveValue.clientSecret,connectionAccount:o.connectionAccount,accessUrl:o.accessUrl||null}};var kZi=(r,t)=>{switch(r){case"databricks":return Zic(t);case"snowflake":return eoc(t);case"fabric":return Xic(t);default:throw new sw(r,"CreateDefaultUserConnection")}},Xic=(r,t="oauth")=>({connectionKind:"fabric",connectionType:t,connectionDetails:{userID:r,connectionString:""}}),Zic=r=>({connectionType:"Cloud",connectionDetails:{userID:r,path:""},connectionKind:"databricks"}),eoc=r=>toc("Cloud",r,"",""),toc=(r,t,n,i)=>({connectionType:r,connectionDetails:{user:n,role:i,userID:t,warehouse:""},connectionKind:"snowflake"});var PZi=r=>Yic.is(r),dz=async(r,t)=>{let n="[GetUserConnectionInfoByEnvironment]";return Z0(async()=>{try{let o=await r.fetch(),s;return o.connectionKind==="databricks"?s={connectionType:o.connectionType,connectionDetails:{path:o.connectionDetails.path,userID:o.connectionDetails.userID},connectionKind:"databricks"}:o.connectionKind==="fabric"?s={connectionType:o.connectionType,connectionDetails:{connectionString:o.connectionDetails.connectionString,userID:o.connectionDetails.userID},connectionKind:"fabric"}:s={connectionType:o.connectionType,connectionDetails:{user:o.connectionDetails.user,userID:o.connectionDetails.userID,role:o.connectionDetails.role,warehouse:o.connectionDetails.warehouse}},u8r.infoContext(t,"User Connection found,","kind:",s.connectionKind??"snowflake","type:",s.connectionType),s}catch(o){throw u8r.errorContext(t,"Error getting user connection info",o),o instanceof hl?new Oo("Invalid Connection Information, environment or connection does not exist. Please check that the environmentID is valid, and contains a valid connection.",`environmentID: ${t.workspaceID}: ${o.detail||o.message}`):o}},3,u8r,t,{retryStrategy:{name:"backoff",base:60},logOnRetry:`${n} retrying`,logOnFailure:`${n} failed, exhausted allotted retry attempts`})};fr();Wr();Ji();Ko();Wr();fr();QA();dr();Ko();var QZi=ot.object({snowflakeAuthType:ot.literal("WorkspaceUserDefault").optional(),platformKind:ot.literal("snowflake").optional()}),noc=ir("TSnowflakeDefaultAuthCredentials",QZi),d8r=ot.object({snowflakeUsername:ot.string(),snowflakePassword:ot.string(),snowflakeWarehouse:ot.string().optional(),snowflakeRole:ot.string().optional(),snowflakeAuthType:ot.literal("Basic").optional(),snowflakeAccessUrl:ot.string().nullable().optional(),platformKind:ot.literal("snowflake").optional()}),p8r=ir("TSnowflakeBasicAuthCredentials",d8r),FZi=ot.object({snowflakeUsername:ot.string().optional(),snowflakeWarehouse:ot.string().optional(),snowflakeRole:ot.string().optional(),snowflakeAuthType:ot.literal("Cloud").optional(),platformKind:ot.literal("snowflake").optional()}),ioc=ir("TSnowflakeCloudAuthCredentials",FZi),LZi=ot.object({snowflakeWarehouse:ot.string().optional(),snowflakeAuthType:ot.literal("OAuth").optional(),platformKind:ot.literal("snowflake").optional()}),ooc=ir("TSnowflakeOAuthCredentials",LZi),f8r=ot.object({snowflakeUsername:ot.string().optional(),snowflakeKeyPairKey:ot.string().optional(),snowflakeKeyPairPass:ot.string().nullable().optional(),snowflakeWarehouse:ot.string().optional(),snowflakeRole:ot.string().optional(),snowflakeAuthType:ot.literal("KeyPair").optional(),platformKind:ot.literal("snowflake").optional()}),A8r=ir("TSnowflakeKeyPairAuthCredentials",f8r),h8r=ot.object({token:ot.string(),path:ot.string().optional(),databricksAuthType:ot.literal("Token"),platformKind:ot.literal("databricks")}),zZi=ir("DatabricksBasicAuthCredentials",h8r),soc=ot.object({path:ot.string().optional(),databricksAuthType:ot.literal("Cloud"),platformKind:ot.literal("databricks")}),aoc=ot.object({path:ot.string().optional(),databricksAuthType:ot.literal("OAuthU2M"),platformKind:ot.literal("databricks"),accessToken:ot.string().optional()}),qZi=ot.object({path:ot.string().optional(),databricksAuthType:ot.literal("OAuthM2M"),platformKind:ot.literal("databricks"),clientID:ot.string().optional(),clientSecret:ot.string().optional()}),UZi=ir("DatabricksOAuthM2MCredentials",qZi),loc=ot.object({connectionString:ot.string().optional(),fabricAuthType:ot.literal("oauth"),platformKind:ot.literal("fabric")}),Mze=ot.union([d8r,f8r,h8r]),pz=ot.union([h8r,soc,aoc,qZi,loc,d8r,QZi,f8r,LZi,FZi]),xze=r=>r.platformKind==="snowflake"||r.platformKind===void 0,Evt=r=>r.platformKind==="databricks",jZi=r=>r.platformKind==="fabric",Dze=r=>r.connectionKind==="snowflake"||r.connectionKind===void 0,Cvt=r=>r.connectionKind==="databricks",WZi=r=>r.connectionKind==="fabric",coc=(r,t,n,i)=>n(t.assert(r,i)),uoc=(r,t,n)=>{for(let[i,o]of t)try{return coc(r,i,o,n)}catch{}throw new zw("No matching type found")},TJ=(r,t,n,i,o,s)=>{let a=u=>()=>{throw new Error(`Unexpected credential type: ${u}`)},l=[[p8r,t],[A8r,n??a("keypair")],[ooc,i??a("oauth")],[ioc,o??a("cloud")],[noc,s??a("workspaceDefault")]];try{return uoc(r,l,{failureLogLevel:Kdt})}catch{throw et.CONNECTION.error("Got unsupported credentials",r.snowflakeAuthType,Dx(r)),new ft(`Got unexpected credentials type ${r.snowflakeAuthType}`)}};Wr();Uo();Ji();Ko();Wr();var Ivt=ot.string().regex(/^-?\d+$/),N_=ot.union([ot.literal("API"),ot.literal("CLI"),ot.literal("UI"),ot.literal("fivetranAPI")]),k_=(r,t,n)=>ot.object({runDetails:r,userID:ot.string().optional(),parameters:ot.union([ot.record(ot.any()),ot.string(),ot.null()]).optional(),userCredentials:t,origin:n}).passthrough();var RJ=class{runDetails;userCredentials;runTimeParameters;origin;constructor(t){this.runDetails=t.runDetails,this.userCredentials=t.userCredentials,this.runTimeParameters=t.parameters||t.runTimeParameters||null,this.origin=t.origin}};Wr();var g8r=ot.record(ot.string(),ot.unknown()),GZi=ot.object({addedTable:g8r,alteredTable:g8r,deletedTable:g8r}),vvt=ot.union([ot.number(),ot.string()]),doc=ot.union([ot.object({id:ot.string(),version:ot.string()}),ot.object({id:ot.string(),releaseID:ot.string()})]),poc=ot.object({defaultStorageLocation:ot.string().nullable().optional(),packageInfo:doc.optional(),error:ot.object({errorString:ot.string()}).nullable(),nodeMetadataSpec:ot.string(),templates:ot.object({create:ot.object({templateString:ot.string()}),run:ot.object({templateString:ot.string()})})}),foc=ot.object({id:ot.string().optional(),isDisabled:ot.boolean(),metadata:poc,name:ot.string(),version:ot.number()}),Aoc=ot.object({macroString:ot.string(),macroCounter:ot.number().optional(),id:ot.string().optional()}),VZi=ot.object({jobCounter:ot.number().optional(),name:ot.string().optional()}),HZi=VZi.extend({subgraphs:ot.array(ot.number()).optional(),steps:ot.array(vvt).optional()}).strict(),KZi=VZi.extend({includeSelector:ot.string().optional(),excludeSelector:ot.string().optional()}).strict(),hoc=KZi.merge(HZi).strict(),goc=ot.object({folderCounter:vvt,name:ot.string(),steps:ot.array(vvt)}),YZi=ot.object({steps:ot.record(ot.string(),ot.unknown()),stepTypes:ot.record(ot.string(),foc),jobs:ot.record(vvt,ot.union([hoc,HZi,KZi])),folders:ot.record(ot.string(),goc),macros:ot.record(ot.string(),Aoc),userConnections:ot.record(ot.string(),ot.record(ot.string(),ot.unknown())).optional(),locations:ot.unknown().optional(),defaultStorageMapping:ot.string().nullable().optional(),version:ot.number().optional(),installedPackages:ot.record(ot.string(),ot.unknown()).optional()}).strict();var JZi=ot.object({deployCommit:ot.string(),deployCommitMessage:ot.string(),fromWorkspaceData:YZi,planID:ot.string(),stepsInRun:ot.number(),clearTargetEnvironment:ot.boolean().optional(),environmentID:ot.string(),forcedDeployment:ot.boolean().optional(),parallelism:ot.number().optional()}).strict(),moc=ot.object({dependencies:qse.optional(),dividedStepDataWithWorkspaceEdits:GZi,version:ot.literal(1).optional()}).strict(),$Zi=JZi.merge(moc).strict(),yoc=ot.object({deletedNodes:ot.array(IL).optional(),phasedDependencies:ot.object({addedTable:jse,alteredTable:jse,deletedTable:jse}).strict(),phasedNodeEdits:ot.object({addedTable:Use,alteredTable:Use,deletedTable:Use}).strict(),version:ot.literal(2)}).strict(),XZi=JZi.merge(yoc).strict(),ZZi=ot.union([$Zi,XZi]),Ysp=k_(ZZi,Mze,N_).strict(),boc=k_(ZZi,pz,N_).strict(),eeo=ir("DeployRunWeb",Zo(boc)),pve=class extends RJ{},Jsp=k_($Zi,pz,N_).strict(),$sp=k_(XZi,pz,N_).strict();Wr();Ji();Ko();var Eoc=ot.object({environmentID:ot.string(),operationType:ot.union([ot.literal("create"),ot.literal("run")]),isPreview:ot.boolean(),multisourceIndexLookup:ot.record(ot.string(),ot.number()).nullable(),parallelism:ot.number(),canceled:ot.boolean(),jobID:Ivt.optional(),includeNodesSelector:ot.string().optional(),excludeNodesSelector:ot.string().optional(),stepsInRun:ot.number().nullable().optional(),dependencies:qse.optional()}),Coc=k_(Eoc,pz,N_),teo=ir("TDevRunRequest",Coc);Wr();Ko();var reo=ot.object({environmentID:ot.string(),stepsInRun:ot.number().optional(),jobID:Ivt.optional(),includeNodesSelector:ot.string().optional(),excludeNodesSelector:ot.string().optional(),forceIgnoreWorkspaceStatus:ot.boolean().optional(),parallelism:ot.number().optional(),executor:ot.string().optional()}),dap=k_(reo,Mze,N_),Ioc=k_(reo,pz,N_),neo=ir("TRefreshRunWeb",Ioc),Svt=class extends RJ{},ieo=ot.object({runID:ot.string(),forceIgnoreWorkspaceStatus:ot.boolean().optional(),executor:ot.string().optional()}),pap=k_(ieo,Mze,N_),voc=k_(ieo,pz,N_),oeo=ir("TReRunWeb",voc),fve=class extends RJ{};var Soc=ot.object({newPassword:ot.string(),editedUserID:ot.string()}),yap=ir("TResetPasswordBody",Soc),Ooc=ot.object({orgID:ot.string().optional(),environmentID:ot.string(),runID:ot.number(),runType:FCr.optional()}),bap=ir("CancelRunRequest",Ooc),woc=ot.object({user:ot.string().optional(),password:ot.string().optional(),keyPairKey:ot.string().min(1).optional(),authenticator:ot.enum(yvt),warehouse:ot.string().optional(),role:ot.string().optional(),keyPairPass:ot.string().nullable().optional(),accountName:ot.string().optional(),accessUrl:ot.string().nullable().optional(),database:ot.string().optional(),destinationSchema:ot.string().optional(),orgID:ot.string(),environmentID:ot.union([ot.number(),ot.string()]).optional(),keyPairPath:ot.string().optional(),kind:ot.literal("snowflake").optional()}),_oc=ot.union([ot.object({kind:ot.literal("databricks"),environmentID:ot.union([ot.number(),ot.string()]).optional(),path:ot.string(),host:ot.string(),authenticator:ot.literal("Cloud")}),ot.object({kind:ot.literal("databricks"),environmentID:ot.union([ot.number(),ot.string()]).optional(),authenticator:ot.literal("Token"),path:ot.string(),host:ot.string(),token:ot.string().optional()}),ot.object({kind:ot.literal("databricks"),environmentID:ot.union([ot.number(),ot.string()]).optional(),authenticator:ot.literal("OAuthM2M"),path:ot.string(),host:ot.string(),clientID:ot.string().optional(),clientSecret:ot.string().optional()}),ot.object({kind:ot.literal("databricks"),environmentID:ot.union([ot.number(),ot.string()]).optional(),authenticator:ot.literal("OAuthU2M"),path:ot.string(),host:ot.string(),accessToken:ot.string().optional()})]),Toc=ot.object({kind:ot.literal("fabric"),environmentID:ot.union([ot.number(),ot.string()]).optional(),credentials:ot.object({clientID:ot.string(),clientSecret:ot.string()}).optional(),authenticator:ot.literal("oauth"),connectionString:ot.string().optional()}),Roc=ot.object({userContext:ot.union([woc,_oc,Toc]),templateString:ot.string(),options:ot.record(ot.string(),ot.any()).optional()}),Boc=Roc.extend({requestId:ot.string()}),Eap=ir("TRunSQLRequest",Boc),Nze=r=>{if(r!==void 0)try{return parseInt(r)}catch{throw new zw("jobID could not be converted to a number",`jobID=${r}`)}};var Moc=async(r,t,n)=>{let i=n.isFeatureEnabled("enableSnowflakeSecretsV2");return ive(r,t,ele,i)},aeo=async(r,t,n,i,o,s)=>{let a=n.toString();if(xze(i)){if(!Dze(o))throw new Oo(`Got a snowflake user credentials with a ${o.connectionKind} userConnection`);if(i.snowflakeAuthType==="KeyPair"&&(i.snowflakeKeyPairKey===void 0||i.snowflakeKeyPairPass===void 0)){let l=await Ib(),u=await Moc(l,{orgId:r,userId:t,workspaceId:a},s);if(!u){if(i.snowflakeKeyPairKey===void 0)throw new Oo("No Snowflake private key found!");return}i.snowflakeKeyPairKey===void 0&&(i.snowflakeKeyPairKey=u.sensitiveValue.key),!i.snowflakeUsername&&o.connectionDetails?.user&&(i.snowflakeUsername=o.connectionDetails.user),i.snowflakeKeyPairPass===void 0&&u.sensitiveValue.passphrase!==void 0&&(i.snowflakeKeyPairPass=u.sensitiveValue.passphrase)}}},xoc=async(r,t,n,i,o,s)=>{let a=n.toString();if(Evt(i)&&(i.databricksAuthType==="Cloud"||i.databricksAuthType==="OAuthM2M"||i.databricksAuthType==="OAuthU2M")){if(!Cvt(o))throw new Oo(`Got a databricks auth credentials with a ${o.connectionKind??"snowflake"} userConnection`);let l=await Ib();if(i.databricksAuthType==="OAuthM2M"){let u=await l.Get(tle,{orgId:r,userId:t,workspaceId:a});if(!u)throw new Oo("No Databricks OAuth M2M credentials found!");i.clientSecret=u.sensitiveValue.clientSecret,i.clientID=u.sensitiveValue.clientID}else if(i.databricksAuthType==="Cloud"){let u=await l.Get(rve,{orgId:r,userId:t,workspaceId:a});if(!u)throw new Oo("No Databricks Cloud credentials found!");i.databricksAuthType="Token",i.token=u.sensitiveValue.token}else if(i.databricksAuthType==="OAuthU2M"){let c=await(await Ib()).Get(s7,{orgId:r,userId:t,workspaceId:a});if(!c)throw new Oo("No Databricks credentials found!");!i.path&&o.connectionDetails.path&&(i.path=o.connectionDetails.path),i.accessToken=c.sensitiveValue.access_token}!i.path&&o.connectionDetails.path&&(i.path=o.connectionDetails.path)}else if(xze(i)&&i.snowflakeAuthType==="Cloud"){if(!Dze(o))throw new Oo(`Got a snowflake user credentials with a ${o.connectionKind} userConnection`);let l=await Ib(),u=await BZi(l,{orgId:r,userId:t,workspaceId:a},s.isFeatureEnabled("enableSnowflakeSecretsV2"));if(!u)throw new Oo("No Snowflake credentials found!");!i.snowflakeUsername&&o.connectionDetails?.user&&(i.snowflakeUsername=o.connectionDetails.user),!i.snowflakeWarehouse&&o.connectionDetails?.warehouse&&(i.snowflakeWarehouse=o.connectionDetails.warehouse),!i.snowflakeRole&&o.connectionDetails?.role&&(i.snowflakeRole=o.connectionDetails.role),i.snowflakeAuthType="Basic",i.snowflakePassword=u.sensitiveValue.password}},BJ=async(r,t,n,i,o,s)=>{await xoc(r,t,n,i,o,s),await aeo(r,t,n,i,o,s)};Wr();var Nap=T.literal("oauth"),m8r=".datawarehouse.fabric.microsoft.com";dr();var y8r="0";function leo(r,t=null){return t??`https://${r}.snowflakecomputing.com`}var ceo=(r,t,n,i)=>{let o=[];return t.forEach(s=>{let a=i[s];if(a){let{name:l}=a,u=`{ subgraph: "${l}" }`;o.push(u)}}),r.forEach(s=>{let a=n[s];if(a){let{locationName:l,name:u}=a.operation,c=`{ location: ${l} name: ${u} }`;o.push(c)}}),o};var Doc=r=>r.reduce((t,n)=>t?t.concat(" ",n):n,"");var ueo=(r,t)=>Doc([r,t.toString()]);dr();Ji();var Noc=et.JOBS;var peo=r=>!r?.hasOwnProperty("includeSelector")||!r?.hasOwnProperty("version"),b8r=(r,t,n)=>{let{steps:i,subgraphs:o,...s}=r,a={...s};if(a.hasOwnProperty("version")||(a.version=zse),a.hasOwnProperty("includeSelector"))return a;a.includeSelector="",a.excludeSelector="";let l=new Set(i),u=new Set(o),p=ceo([...l],[...u].map(f=>`${f}`),n,t).map(f=>`+${f}`).join(" OR ");return a.includeSelector=p,Noc.info("Upgrading job v1 to v2",r,a),a};var feo=(r,t)=>{let{jobs:n,folders:i,steps:o}=r,s=n[t];return b8r(s,i,o)};mi();Zl();dr();var Beo=yt(Oeo(),1),Q_=(r,t,n={})=>(_vt(t),!n.nocomment&&t.charAt(0)==="#"?!1:new Ave(t,n).match(r));var Uoc=/^\*+([^+@!?\*\[\(]*)$/,joc=r=>t=>!t.startsWith(".")&&t.endsWith(r),Woc=r=>t=>t.endsWith(r),Goc=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),Voc=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),Hoc=/^\*+\.\*+$/,Koc=r=>!r.startsWith(".")&&r.includes("."),Yoc=r=>r!=="."&&r!==".."&&r.includes("."),Joc=/^\.\*+$/,$oc=r=>r!=="."&&r!==".."&&r.startsWith("."),Xoc=/^\*+$/,Zoc=r=>r.length!==0&&!r.startsWith("."),esc=r=>r.length!==0&&r!=="."&&r!=="..",tsc=/^\?+([^+@!?\*\[\(]*)?$/,rsc=([r,t=""])=>{let n=Teo([r]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},nsc=([r,t=""])=>{let n=Reo([r]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},isc=([r,t=""])=>{let n=Reo([r]);return t?i=>n(i)&&i.endsWith(t):n},osc=([r,t=""])=>{let n=Teo([r]);return t?i=>n(i)&&i.endsWith(t):n},Teo=([r])=>{let t=r.length;return n=>n.length===t&&!n.startsWith(".")},Reo=([r])=>{let t=r.length;return n=>n.length===t&&n!=="."&&n!==".."},ssc=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",wvt=ssc==="win32",S8r=wvt?{sep:"\\"}:{sep:"/"},asc=S8r.sep;Q_.sep=asc;var P_=Symbol("globstar **");Q_.GLOBSTAR=P_;var weo={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},O8r="[^/]",v8r=O8r+"*?",lsc="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",csc="(?:(?!(?:\\/|^)\\.).)*?",Meo=r=>r.split("").reduce((t,n)=>(t[n]=!0,t),{}),_eo=Meo("().*{}+?[]^$\\!"),usc=Meo("[.("),dsc=(r,t={})=>n=>Q_(n,r,t);Q_.filter=dsc;var MJ=(r,t={})=>Object.assign({},r,t),psc=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return Q_;let t=Q_;return Object.assign((i,o,s={})=>t(i,o,MJ(r,s)),{Minimatch:class extends t.Minimatch{constructor(o,s={}){super(o,MJ(r,s))}static defaults(o){return t.defaults(MJ(r,o)).Minimatch}},filter:(i,o={})=>t.filter(i,MJ(r,o)),defaults:i=>t.defaults(MJ(r,i)),makeRe:(i,o={})=>t.makeRe(i,MJ(r,o)),braceExpand:(i,o={})=>t.braceExpand(i,MJ(r,o)),match:(i,o,s={})=>t.match(i,o,MJ(r,s)),sep:t.sep,GLOBSTAR:P_})};Q_.defaults=psc;var xeo=(r,t={})=>(_vt(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,Beo.default)(r));Q_.braceExpand=xeo;var fsc=1024*64,_vt=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>fsc)throw new TypeError("pattern is too long")},Ovt=Symbol("subparse"),Asc=(r,t={})=>new Ave(r,t).makeRe();Q_.makeRe=Asc;var w8r=(r,t,n={})=>{let i=new Ave(t,n);return r=r.filter(o=>i.match(o)),i.options.nonull&&!r.length&&r.push(t),r};Q_.match=w8r;var hsc=r=>r.replace(/\\(.)/g,"$1"),gsc=r=>r.replace(/\\([^-\]])/g,"$1"),msc=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ysc=r=>r.replace(/[[\]\\]/g,"\\$&"),Ave=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;regexp;constructor(t,n={}){_vt(t),n=n||{},this.options=n,this.pattern=t,this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.globSet=[],this.globParts=[],this.set=[],this.make()}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=this.braceExpand(),n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(s=>this.slashSplit(s));if(this.options.noglobstar)this.globParts=i;else{for(let s of i){let a;do{a=!1;for(let l=0;l<s.length-1;l++)s[l]==="*"&&s[l-1]==="**"&&(s[l]="**",s[l-1]="*",a=!0)}while(a)}this.globParts=i.map(s=>(s=s.reduce((a,l)=>{let u=a[a.length-1];return l==="**"&&u==="**"?a:l===".."&&u&&u!==".."&&u!=="."&&u!=="**"?(a.pop(),a):(a.push(l),a)},[]),s.length===0?[""]:s))}this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,a,l)=>s.map(u=>this.parse(u)));if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),wvt)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,i=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)n=!n,i++;i&&(this.pattern=t.slice(i)),this.negate=n}matchOne(t,n,i=!1){let o=this.options;if(wvt){let h=t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),y=n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]);if(h&&y){let C=t[3],v=n[3];C.toLowerCase()===v.toLowerCase()&&(t[3]=v)}else if(y&&typeof t[0]=="string"){let C=n[3],v=t[0];C.toLowerCase()===v.toLowerCase()&&(n[3]=v,n=n.slice(3))}else if(h&&typeof n[0]=="string"){let C=t[3];C.toLowerCase()===n[0].toLowerCase()&&(n[0]=C,t=t.slice(3))}}this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var s=0,a=0,l=t.length,u=n.length;s<l&&a<u;s++,a++){this.debug("matchOne loop");var c=n[a],d=t[s];if(this.debug(n,c,d),c===!1)return!1;if(c===P_){this.debug("GLOBSTAR",[n,c,d]);var p=s,f=a+1;if(f===u){for(this.debug("** at the end");s<l;s++)if(t[s]==="."||t[s]===".."||!o.dot&&t[s].charAt(0)===".")return!1;return!0}for(;p<l;){var A=t[p];if(this.debug(`
1156
+ `:""}var LLl=FLl,zLl={dump:LLl};function nRr(r,t){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var tEt=Py,RDi=Uxi,BDi=Vxi,MDi=$xi,xDi=Xxi,DDi=ZTr,rEt=hDi.load,NDi=hDi.loadAll,nEt=zLl.dump,iEt=oC,kDi={binary:nDi,float:Jxi,map:Gxi,null:Hxi,pairs:oDi,set:sDi,timestamp:tDi,bool:Kxi,int:Yxi,merge:rDi,omap:iDi,seq:Wxi,str:jxi},PDi=nRr("safeLoad","load"),QDi=nRr("safeLoadAll","loadAll"),FDi=nRr("safeDump","dump"),qLl={Type:tEt,Schema:RDi,FAILSAFE_SCHEMA:BDi,JSON_SCHEMA:MDi,CORE_SCHEMA:xDi,DEFAULT_SCHEMA:DDi,load:rEt,loadAll:NDi,dump:nEt,YAMLException:iEt,types:kDi,safeLoad:PDi,safeLoadAll:QDi,safeDump:FDi};var mc=class r{constructor(t){this.value=t}static representation="[REDACTED]";get sensitiveValue(){return this.value}toString(){return r.representation}toJSON(){return r.representation}[Symbol.for("nodejs.util.inspect.custom")](){return r.representation}},lVd=new tEt("tag:yaml.org,2002:str",{kind:"scalar",instanceOf:mc,represent:r=>r.toString()});var iRr=r=>r;var Bbe=yt(wo());fr();Wr();var LDi=T.string().brand(Symbol("SantizedString"));function UDi(r){return!!r&&typeof r=="object"&&"orgId"in r&&"userId"in r&&typeof r.orgId=="string"&&typeof r.userId=="string"}function ULl(r){return UDi(r)&&"workspaceId"in r&&typeof r.workspaceId=="string"}function jLl(r){if(!UDi(r)){let t=(0,Bbe.mapValues)((0,Bbe.pick)(r,"orgId","userId"),n=>typeof n);throw new ft(`Secret got an invalid context type at runtime (got: ${t}, expected orgId & userId) - cannot create name`)}}function WLl(r){if(!ULl(r)){let t=(0,Bbe.mapValues)((0,Bbe.pick)(r,"orgId","userId","workspaceId"),n=>typeof n);throw new ft(`Secret got an invalid context type at runtime (got: ${t}, expected orgId & userId & workspaceId) - cannot create name`)}}function zDi(r){return jLl(r),r}function qDi(r){return WLl(r),r}var GLl=/[^a-zA-Z0-9/-]/gu,VLl=r=>{let t="-".codePointAt(0).toString(16);return r.replaceAll("--",`--${t}---${t}-`).replaceAll(GLl,n=>`--${n.codePointAt(0).toString(16)}-`)},sEt=r=>LDi.parse(r.map(VLl).join("_")),aEt=(r,t)=>{if(r.secretNameFormat==="orgId"){let n=zDi(t);return sEt([n.orgId,r.typeName])}else if(r.secretNameFormat==="orgIdAndUserId"){let n=zDi(t);return sEt([n.orgId,n.userId,r.typeName])}else if(r.secretNameFormat==="orgIdAndWorkspaceId"){let n=qDi(t);return sEt([n.orgId,n.workspaceId,r.typeName])}else if(r.secretNameFormat==="orgIdAndWorkspaceIdAndUserId"){let n=qDi(t);return sEt([n.orgId,n.workspaceId,n.userId,r.typeName])}else{let n=r.secretNameFormat;throw new ft(`Got an unknown secret name format "${n}" - cannot create name`)}},HLl=r=>{let t=/\-\-([0-9a-f]+)\-/g,n=r.replaceAll(t,i=>String.fromCodePoint(parseInt(i.replaceAll("-",""),16)));if(n!==r)return n},lEt=r=>{let t=HLl(r);if(!(t===void 0||t.match(/[^a-zA-Z0-9/_-]/g)))return t};mi();var Y9=et.SECRETS;function sRr(r,t){return!!r&&typeof r=="object"&&"code"in r&&r.code===t}function KLl(r){return sRr(r,dEt.Status.INVALID_ARGUMENT)&&"details"in r&&typeof r.details=="string"&&r.details.startsWith("Secret payload data length must be at most")}function Mbe(r){return sRr(r,dEt.Status.NOT_FOUND)||YLl(r)}function YLl(r){return sRr(r,dEt.Status.FAILED_PRECONDITION)&&typeof r?.message=="string"&&r.message.includes("is in DESTROYED state")}function oRr(r){if(!r)return null;let t=r.split("/").pop();if(!t)return null;let n=parseInt(t);return Number.isNaN(n)?null:n}var JLl=9e4,$Ll=600,XLl=600,aRr=10,ZLl=new Sbe({tokensPerInterval:JLl/aRr,interval:"minute"}),ezl=new Sbe({tokensPerInterval:$Ll/aRr,interval:"minute"}),cEt=new Sbe({tokensPerInterval:XLl/aRr,interval:"minute"}),tzl=new n_(1),uEt=class{constructor(t,n=new jDi.SecretManagerServiceClient){this.projectId=t;this.client=n}shouldUpgradeLegacyResultsToNewName(){return!1}BuildSecretName=t=>`projects/${this.projectId}/secrets/${t}`;BuildSecretNameLatestVersion=t=>`${this.BuildSecretName(t)}/versions/latest`;getByName=async t=>{await ZLl.removeTokens(1);let n=await this.client.accessSecretVersion({name:this.BuildSecretNameLatestVersion(t)}),[i]=n,o=i.payload?.data?.toString();return o?new mc(o):null};makeAddVersionData=(t,n)=>({parent:this.BuildSecretName(t),payload:{data:iRr(Buffer.from(n.sensitiveValue))}});addVersionByName=async(t,n)=>{let i=this.makeAddVersionData(t,n);await cEt.removeTokens(1),await this.client.addSecretVersion(i),this.PruneInaccessibleVersions(i.parent).catch(o=>{Y9.error("Could not prune versions for",i.parent,o)})};setByName=async(t,n)=>{await cEt.removeTokens(2);let i=this.makeAddVersionData(t,n);await this.client.createSecret({parent:`projects/${this.projectId}`,secretId:t,secret:{replication:{automatic:{}}}}),await this.client.addSecretVersion(i)};listSecretVersions=async t=>{await ezl.removeTokens(1);let[n]=await this.client.listSecretVersions({parent:this.BuildSecretName(t)});return n};destroySecretVersion=async t=>{await cEt.removeTokens(1),await this.client.destroySecretVersion({name:t})};getMissingSecret=async t=>{let n=lEt(t);if(n)try{let i=await this.getByName(n);return i&&this.shouldUpgradeLegacyResultsToNewName()&&(await this.setByName(t,i),await this.deleteByName(n)),i}catch(i){if(!Mbe(i))throw i}return null};Get=async t=>{try{return await this.getByName(t)}catch(n){if(Mbe(n))return this.getMissingSecret(t);throw n}};setMissingSecret=async(t,n)=>{let i=lEt(t);if(!i)await this.setByName(t,n);else if(this.shouldUpgradeLegacyResultsToNewName())await this.setByName(t,n),await this.deleteByName(i,{ignoreMissing:!0});else try{await this.addVersionByName(i,n)}catch(o){if(Mbe(o)){await this.setByName(t,n);return}throw o}};Set=async(t,n)=>{try{await this.addVersionByName(t,n);return}catch(i){if(Mbe(i)){await this.setMissingSecret(t,n);return}throw KLl(i)&&Y9.emerg("Payload exceeded for: ",t,"Reach out to support to determine if feature flags to adjust secret storage are appropriate next steps",i),i}};deleteByName=async(t,n)=>{try{await cEt.removeTokens(1),await this.client.deleteSecret({name:this.BuildSecretName(t)})}catch(i){if(n?.ignoreMissing&&Mbe(i))return;throw i}};Delete=async t=>{let n=lEt(t),i=[t];n&&i.push(n),await JE(i.map(o=>this.deleteByName(o,{ignoreMissing:!0})))};PruneInaccessibleVersions=async t=>{try{Y9.info("Begin pruning inaccessible versions for secret",t),await tzl.runExclusive(async()=>{Y9.info("Got lock for pruning inaccessible versions for secret",t);let i=(await this.listSecretVersions(t)).filter(o=>o.state==="ENABLED"&&!!oRr(o.name)).sort((o,s)=>oRr(s.name)-oRr(o.name)).slice(1);for(let o of i)try{Y9.info("Destroying secret version",o.name),await this.destroySecretVersion(o.name),Y9.info("Successfully destroyed secret version",o.name)}catch(s){Mbe(s)?Y9.error("Tried to prune secret",o.name,"but it was not found"):Y9.alert("Error trying to prune inaccessible secret version",o.name,". Error: ",s)}},1)}catch(n){Y9.alert("Fatal error trying to prune inaccessible secret versions for secret",t,". Error: ",n)}finally{Y9.info("Completed pruning inaccessible versions for secret",t)}}};var pEt=class{injectError=null;data={};InjectErrorIfNeeded=()=>{if(this.injectError!==null)throw this.injectError};Get=async t=>{this.InjectErrorIfNeeded();let n=this.data[t];return n===void 0?null:new mc(n)};Set=async(t,n)=>{this.InjectErrorIfNeeded(),this.data[t]=n.sensitiveValue};Delete=async t=>{this.InjectErrorIfNeeded(),delete this.data[t]}};var C$i=yt(E$i());var qIt=class r{client;constructor(t){this.client=(0,C$i.createClient)({url:t})}static Create=async t=>{let n=new r(t);return await n.client.connect(),n};Get=async t=>{let n=await this.client.get(t);return n===null?null:new mc(n)};Set=async(t,n)=>{await this.client.set(t,n.sensitiveValue)};Delete=async t=>{await this.client.del(t)}};var XIe=class{constructor(t){this.secretStore=t}Get=async(t,n)=>{let i=await this.secretStore.Get(aEt(t,n));if(i===null)return null;let o=new mc(t.dataValidator.assert(JSON.parse(i.sensitiveValue)));return t.GetEntry(n,o)};Set=async(t,n,i)=>{let o=aEt(t,n),s=null,a=await this.secretStore.Get(o);a!==null&&(s=new mc(t.dataValidator.assert(JSON.parse(a.sensitiveValue))));let l=t.SetEntry(n,s,i);await this.secretStore.Set(o,new mc(JSON.stringify(l.sensitiveValue)))};Delete=async(t,n)=>{let i=aEt(t,n),o=await this.secretStore.Get(i);if(o===null)return;let s=new mc(t.dataValidator.assert(JSON.parse(o.sensitiveValue))),a=t.DeleteEntry(n,s);a===null?await this.secretStore.Delete(i):await this.secretStore.Set(i,new mc(JSON.stringify(a.sensitiveValue)))};Upgrade=async(t,n,i,o,s)=>{let a=await this.Get(t,n);if(!a)return;await this.Get(i,o)||await this.Set(i,o,new mc(s(a.sensitiveValue))),await this.Delete(t,n)}};var UIt=class{client;constructor(t,n){this.client=XS(t,n)}Exists=async(t,n)=>await this.client.SecretExists({params:{context:t.EncodeContext(n),secretType:t.typeName}});Set=async(t,n,i)=>await this.client.SetSecret({secretValue:i.sensitiveValue},{params:{context:t.EncodeContext(n),secretType:t.typeName}});Delete=async(t,n)=>await this.client.DeleteSecret(void 0,{params:{context:t.EncodeContext(n),secretType:t.typeName}});Upgrade=async(t,n)=>await this.Exists(t,n)?(await this.client.UpgradeSecret(void 0,{params:{context:t.EncodeContext(n),secretType:t.typeName}}),!0):!1};fr();var jIt=class{backend;constructor(t){this.backend=new XIe(t)}Exists=async(t,n)=>await this.backend.Get(t,n)!==null;Set=async(t,n,i)=>await this.backend.Set(t,n,i);Delete=async(t,n)=>await this.backend.Delete(t,n);Upgrade=async(t,n)=>{if(!await this.Exists(t,n))return!1;let i=t.UpgradeTarget;if(!i)throw new Oo("Cannot upgrade this secret type",`Secret type ${t.typeName} as no upgrade target`);return await this.backend.Upgrade(t,n,i,n,o=>o),!0}};dr();var iMr=yt(wo()),ize=yt(qw());var oze=ize.Record({orgId:ize.String,userId:ize.String}),WIt=(r,t,n,i)=>({DecodeContext:o=>r.assert({[t]:o}),EncodeContext:o=>(r.assert(o),encodeURIComponent(o[t])),GetEntry:(o,s)=>{r.assert(o),n.assert(s.sensitiveValue);let a=s.sensitiveValue[o[t]];return a?new mc(i.assert(a)):null},SetEntry:(o,s,a)=>{r.assert(o);let l=s?(0,iMr.cloneDeep)(n.assert(s.sensitiveValue)):{};return l[o[t]]=i.assert(a.sensitiveValue),new mc(l)},DeleteEntry:(o,s)=>{r.assert(o),n.assert(s.sensitiveValue);let a=s?(0,iMr.cloneDeep)(n.assert(s.sensitiveValue)):{};return delete a[o[t]],typeof a=="object"&&(a===null||Object.keys(a).length===0)?null:a?new mc(a):null}}),I$i=(r,t,n)=>({DecodeContext:i=>r.assert({[t]:i}),EncodeContext:i=>(r.assert(i),encodeURIComponent(i[t])),GetEntry:(i,o)=>(r.assert(i),o),SetEntry:(i,o,s)=>(r.assert(i),n.assert(s.sensitiveValue),s),DeleteEntry:(i,o)=>(r.assert(i),n.assert(o.sensitiveValue),null)});var ZIe=yt(qw());uhr();var v$i=ZIe.Record({gitAccountId:ZIe.String}),jrc=ZIe.Intersect(oze,v$i),Wrc=GI("SecretContextGitAccount",v$i),S$i=(r,t)=>WIt(Wrc,"gitAccountId",r,t);var eve=yt(qw());var O$i=eve.Record({workspaceId:eve.String}),Grc=eve.Intersect(oze,O$i),w$i=GI("SecretContextWorkspace",O$i),Pg=(r,t)=>WIt(w$i,"workspaceId",r,t),tve=r=>I$i(w$i,"workspaceId",r);Wr();Ko();var Vrc=fd(Tl(),Tl()),_$i=ir("GitTokens",Vrc),T$i=ir("string",Tl()),GIt={typeName:"GitTokens",dataValidator:_$i,entryValidator:T$i,secretNameFormat:"orgIdAndUserId",...S$i(_$i,T$i),UpgradeTarget:void 0};Wr();Ko();var oMr=T.object({password:T.string()}),Hrc=T.record(T.string(),oMr),VIt=ir("SnowflakeCredentials",Hrc),HIt=ir("SnowflakeCredentialsEntry",oMr),sze={typeName:"SnowflakeCredentialsV2",dataValidator:VIt,entryValidator:HIt,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(VIt,HIt),UpgradeTarget:void 0},$ae={typeName:"SnowflakeCredentials",dataValidator:VIt,entryValidator:HIt,secretNameFormat:"orgIdAndUserId",...Pg(VIt,HIt),UpgradeTarget:sze};Wr();Ko();var B$i=T.object({clientId:T.string(),clientSecret:T.string()}),Krc=T.record(T.string(),B$i),R$i=ir("SnowflakeOAuthForWorkspaces",Krc),aze=ir("SnowflakeOAuth",B$i),lze={typeName:"SnowflakeOAuthV2",dataValidator:aze,entryValidator:aze,secretNameFormat:"orgIdAndWorkspaceId",...tve(aze),UpgradeTarget:void 0},Xae={typeName:"SnowflakeOAuth",dataValidator:R$i,entryValidator:aze,secretNameFormat:"orgId",...Pg(R$i,aze),UpgradeTarget:lze};Wr();Ko();var sMr=ot.object({access_token:ot.string(),refresh_token:ot.string()}),Yrc=ot.record(ot.string(),sMr),KIt=ir("SnowflakeTokens",Yrc),YIt=ir("SnowflakeTokensEntry",sMr),Zae={typeName:"SnowflakeTokensV2",dataValidator:KIt,entryValidator:YIt,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(KIt,YIt),UpgradeTarget:void 0},jB={typeName:"SnowflakeTokens",dataValidator:KIt,entryValidator:YIt,secretNameFormat:"orgIdAndUserId",...Pg(KIt,YIt),UpgradeTarget:Zae};var Jrc=yt(require("crypto")),M$i=require("fs");fr();var aMr=(()=>{let r=Jrc;return r&&typeof r=="object"&&"createPrivateKey"in r&&r.createPrivateKey?r.createPrivateKey:void 0})();function cze(r,t){if(aMr===void 0)throw new ft("Cannot work with private keys in this environment");try{let i=aMr({key:r.sensitiveValue,passphrase:t?.sensitiveValue}).export({format:"pem",type:"pkcs8"});if(!i||typeof i!="string")throw new ft("Unknown error decrypting private key");if(t!==void 0)try{throw aMr({key:r.sensitiveValue}),new Oo("Private key is not encrypted but a passphrase was provided")}catch(o){if(Tp(o))throw o;if(!o||typeof o!="object"||"code"in o&&o.code!=="ERR_OSSL_CRYPTO_INTERRUPTED_OR_CANCELLED")throw new ft("Unknown error decrypting private key",o?.message)}return new mc(i)}catch(n){if(Tp(n))throw n;if(n&&typeof n=="object"&&"code"in n)switch(n.code){case"ERR_OSSL_UNSUPPORTED":throw new Oo("Unable to parse private key");case"ERR_OSSL_BAD_DECRYPT":throw new Oo("Unable to decrypt private key using the provided passphrase");case"ERR_OSSL_CRYPTO_INTERRUPTED_OR_CANCELLED":throw new Oo("Unable to decrypt private key without a passphrase")}throw new ft("Unknown error decrypting private key",n?.message)}}function x$i(r,t){try{return cze(new mc((0,M$i.readFileSync)(r)),t)}catch(n){if(Tp(n))throw n;if(n&&typeof n=="object"&&"code"in n)switch(n.code){case"ENOENT":throw new Oo(`Private key file not found at ${r}`);case"EACCES":throw new Oo(`Permission denied to read private key file at ${r}`)}throw new ft(`Unknown error decrypting private key at ${r}`,n?.message)}}fr();Wr();Ko();var lMr=T.object({key:T.string(),passphrase:T.string().nullable().optional(),savePassphrase:T.boolean().optional()}).superRefine((r,t)=>{if((r.passphrase===void 0||r.passphrase===null)&&r.savePassphrase!==void 0)return t.addIssue({code:T.ZodIssueCode.custom,message:"Can't have passphrase unset and savePassphrase set at the same time",fatal:!0,path:["passphrase"]}),T.NEVER;let n=r.passphrase===void 0||r.passphrase===null?void 0:new mc(r.passphrase);r.savePassphrase||(delete r.passphrase,delete r.savePassphrase);try{cze(new mc(r.key),n)}catch(i){(!Tp(i)||i.message!=="Unable to decrypt private key without a passphrase")&&t.addIssue({code:T.ZodIssueCode.custom,message:i instanceof Error?i.message:"Unknown error validating private key"})}}),$rc=T.record(T.string(),lMr),JIt=ir("SnowflakeKeyPairSecret",$rc),$It=ir("SnowflakeKeyPairEntry",lMr),D$i="SnowflakeKeyPair",Xrc=D$i+"V2",uze={typeName:Xrc,dataValidator:JIt,entryValidator:$It,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(JIt,$It),UpgradeTarget:void 0},ele={typeName:D$i,dataValidator:JIt,entryValidator:$It,secretNameFormat:"orgIdAndUserId",...Pg(JIt,$It),UpgradeTarget:uze};Wr();Ko();var cMr=ot.object({token:ot.string()}),Zrc=ot.record(cMr),N$i=ir("DatabricksCredentials",Zrc),k$i=ir("DatabricksCredentialsEntry",cMr),rve={typeName:"DatabricksCredentials",dataValidator:N$i,entryValidator:k$i,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(N$i,k$i),UpgradeTarget:void 0};Wr();Ko();var enc=ot.object({clientId:ot.string(),clientSecret:ot.string()}),uMr=ir("DatabricksOAuthU2M",enc),nve={typeName:"DatabricksOAuthU2M",dataValidator:uMr,entryValidator:uMr,secretNameFormat:"orgIdAndWorkspaceId",...tve(uMr),UpgradeTarget:void 0};Wr();Ko();var tnc=ot.object({clientID:ot.string(),clientSecret:ot.string()}),dMr=ir("DatabricksOAuthM2M",tnc),tle={typeName:"DatabricksOAuthM2M",dataValidator:dMr,entryValidator:dMr,secretNameFormat:"orgIdAndWorkspaceId",...tve(dMr),UpgradeTarget:void 0};Wr();Ko();var F$i=ot.object({clientID:ot.string(),clientSecret:ot.string()}),rnc=ot.record(F$i),P$i=ir("FabricCredentials",rnc),Q$i=ir("FabricCredentialsEntry",F$i),pMr={typeName:"FabricCredentials",dataValidator:P$i,entryValidator:Q$i,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(P$i,Q$i),UpgradeTarget:void 0};Wr();Ko();var q$i=ot.object({access_token:ot.string(),refresh_token:ot.string()}),nnc=ot.record(ot.string(),q$i),L$i=ir("DatabricksOAuthU2MTokens",nnc),z$i=ir("DatabricksOAuthU2MTokensEntry",q$i),s7={typeName:"DatabricksOAuthU2MTokens",dataValidator:L$i,entryValidator:z$i,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(L$i,z$i),UpgradeTarget:void 0};var inc={[GIt.typeName]:GIt,[$ae.typeName]:$ae,[sze.typeName]:sze,[ele.typeName]:ele,[uze.typeName]:uze,[Xae.typeName]:Xae,[lze.typeName]:lze,[jB.typeName]:jB,[Zae.typeName]:Zae,[rve.typeName]:rve,[nve.typeName]:nve,[s7.typeName]:s7,[tle.typeName]:tle,[pMr.typeName]:pMr};Wr();Ko();var W$i=ot.object({clientID:ot.string(),clientSecret:ot.string()}),onc=ot.record(W$i),U$i=ir("FabricCredentials",onc),j$i=ir("FabricCredentialsEntry",W$i),fMr={typeName:"FabricCredentials",dataValidator:U$i,entryValidator:j$i,secretNameFormat:"orgIdAndWorkspaceIdAndUserId",...Pg(U$i,j$i),UpgradeTarget:void 0};var AMr=et.SECRETS,G$i=(0,XIt.default)(async()=>{switch(process.env.COALESCE_SECRET_STORE_TYPE){case"redis":if(AMr.app("Selected Redis secret store."),!process.env.COALESCE_SECRET_STORE_REDIS_URL)throw new Error("The redis secret store is configured, but no COALESCE_SECRET_STORE_REDIS_URL was defined.");return await qIt.Create(process.env.COALESCE_SECRET_STORE_REDIS_URL);case"memory":return AMr.app("Selected Memory secret store."),new pEt;case"google":default:return AMr.app("Selected Google Secrets Manager secret store."),new uEt((await dgt()).projectId)}}),Ib=(0,XIt.default)(async()=>new XIe(await G$i())),Unp=(0,XIt.default)(async()=>_c().isTest?new jIt(await G$i()):new UIt(P3(),ZE()));dr();var anc=et.SECRETS;var ive=async(r,t,n,i)=>{let o={userID:t.userId,orgID:t.orgId,workspaceID:+t.workspaceId},s=n.UpgradeTarget;if(i&&s){let a=await r.Get(s,t);return a||(a=await r.Get(n,t),a&&(anc.infoContext(o,`v2 Snowflake secrets feature flag was set, found v1 credentials. Upgrading v1 to v2 for ${n.typeName}`),await r.Set(s,t,a),await r.Delete(n,t))),a}else return await r.Get(n,t)};mi();dr();var hZi=yt(Hp()),gic={redirectUrl:null},qMr=(0,hZi.createSlice)({name:"redirects",initialState:gic,reducers:{setRedirectUrl(r,t){return{...r,redirectUrl:t.payload.redirectUrl}},removeRedirectUrl(r){return{...r,redirectUrl:null}}}});Wr();var gZi=yt(Hp()),UMr="UPDATE_CREDENTIAL";var jMr="DELETE_CREDENTIAL";var WMr="BULK_UPDATE_CONFIG";var GMr=(0,gZi.createSlice)({name:"workspaces",initialState:{workspaces:{}},reducers:{set(r,t){return r={workspaces:{...r.workspaces,...t.payload}},r},delete(r,t){return t.payload.forEach(n=>{delete r.workspaces[+n]}),r}}}),mic=T.object({}),yic=T.object({snowflakePassword:T.union([T.undefined(),T.string()])}),bic=T.object({databricksToken:T.union([T.undefined(),T.string()])}),Eic=T.object({databricksOAuthM2M:T.union([T.undefined(),T.string()])}),Cic=T.object({fabricCredential:T.union([T.undefined(),T.string()])}),mZi=T.union([mic,yic,bic,Eic,Cic]);dr();var yZi=yt(Hp());var Iic={},VMr=(0,yZi.createSlice)({name:"adminUsers",initialState:Iic,reducers:{createAdminUsersBulk(r,t){return{...r,...t.payload.valuesToCreate}},updateAdminUsersBulk(r,t){return{...r,...t.payload.valuesToModify}},deleteAdminUsersBulk(r,t){return Iu(r,n=>{t.payload.valuesToDelete.forEach(i=>{delete n[i]})})}}}),{createAdminUsersBulk:vic,updateAdminUsersBulk:Sic,deleteAdminUsersBulk:Oic}=VMr.actions;var CZi=yt(Hp());var bZi=yt(Hp());Ji();Ko();var EZi=a9.nullable().default(null),wic=ir("currentWorkspace",EZi),HMr=(0,bZi.createSlice)({name:"currentWorkspace",initialState:EZi.parse(null),reducers:{getSetCurrentWorkspaceWithoutResettingState(r,t){return t.payload},getChangeWorkspace(r,t){return t.payload}}}),{getSetCurrentWorkspaceWithoutResettingState:_ip,getChangeWorkspace:D_}=HMr.actions;var _ic={},KMr=(0,CZi.createSlice)({name:"folders",initialState:_ic,reducers:{createFoldersBulk(r,t){return{...r,...t.payload.valuesToCreate}},updateFoldersBulk(r,t){return{...r,...t.payload.valuesToModify}},deleteFoldersBulk(r,t){return Iu(r,n=>{t.payload.valuesToDelete.forEach(i=>{delete n[i]})})}},extraReducers:r=>{r.addCase(D_,(t,n)=>({}))}}),{createFoldersBulk:Tic,updateFoldersBulk:Ric,deleteFoldersBulk:YMr}=KMr.actions;var IZi=yt(Hp());var JMr=(0,IZi.createSlice)({name:"mapping",initialState:{},reducers:{createMappingBulk(r,t){return{...r,...t.payload.valuesToCreate}},updateMappingBulk(r,t){return{...r,...t.payload.valuesToModify}},deleteMappingBulk(r,t){return Iu(r,n=>{t.payload.valuesToDelete.forEach(i=>{delete n[i]})})},getPopulateAllMappings(r,t){return t.payload.mappingsObj}},extraReducers:r=>{r.addCase(D_,(t,n)=>({}))}}),{createMappingBulk:Bic,updateMappingBulk:Mic,deleteMappingBulk:xic,getPopulateAllMappings:Nip}=JMr.actions;var vZi=yt(Hp());var Dic={},$Mr=(0,vZi.createSlice)({name:"orgs",initialState:Dic,reducers:{createOrgsBulk(r,t){return{...r,...t.payload.valuesToCreate}},updateOrgsBulk(r,t){return{...r,...t.payload.valuesToModify}},deleteOrgsBulk(r,t){return Iu(r,n=>{t.payload.valuesToDelete.forEach(i=>{delete n[i]})})}}}),{createOrgsBulk:Nic,updateOrgsBulk:kic,deleteOrgsBulk:Pic}=$Mr.actions;var Uip=et.STATE;var OZi=yt(Hp());var SZi=r=>{let t=i=>i.forEach(o=>{o.sourceColumnReferences?.forEach(s=>{let a=s?.columnReferences[0]??null;a&&(a.stepCounter=a.stepCounter.toString())})}),n=r?.operation?.metadata?.columns??[];return t(n),r},XMr={allSteps:{}},gvt=(0,OZi.createSlice)({name:"steps",initialState:XMr,reducers:{createStepsBulk(r,t){let n={};for(let[i,o]of Object.entries(t.payload))n[i]=SZi(o);return r.allSteps={...r.allSteps,...n},r},updateStepsBulk(r,t){for(let[n,i]of Object.entries(t.payload))r.allSteps[n]=i;return r},deleteStepsBulk(r,t){for(let n of t.payload)delete r.allSteps[n];return r},clearAllSteps(){return{...XMr}},getUpdateStepDataAction(r,t){let{stepData:n}=t.payload;return r.allSteps[t.payload.stepCounter]=SZi(n),r},getNewGraph(r,t){return r.gFinal=t.payload.graph,r}},extraReducers:r=>{r.addCase(D_,(t,n)=>XMr)}}),{deleteStepsBulk:_J,getUpdateStepDataAction:Vip,getNewGraph:Hip}=gvt.actions;var wZi=yt(Hp());var aC=(r,t=!1)=>(0,wZi.createSlice)({name:r,initialState:{},reducers:{set:(i,o)=>(i={...i,...o.payload},i),delete:(i,o)=>(o.payload.forEach(s=>{delete i[s]}),i)},extraReducers:t?i=>{i.addCase(D_,(o,s)=>(o={},o))}:{}});var ZMr=aC("projects");var e8r=aC("installedPackages",!0);var t8r=aC("globalUserSettings");var r8r=aC("gitAccounts");var n8r=aC("projectGitAccounts");XE();dr();Mc();QA();var qic=et.RUNNER;function Bze(r){let t=Dx(Va(r));return qic.error("RunPost formattedRealError:",t,"raw error"),t}dr();XE();Zl();function i8r(r){let t=r.response?.status;return!!t&&t>499&&t<600}function Uic(r,t){return r.includes("https://securetoken.googleapis.com")&&t===502}function jic(r,t,n){let i=r.includes(P3()),o=i&&n&&n.includes("/api/json_template"),s=i&&r.startsWith("https://local.app.coalescestage.io");return o||t===502&&i||(t===504||t===503)&&s}function o8r(r){if(!i8r(r))return!1;let n=r.config&&(r.config.baseURL??P3()),i=r.config?.url,o=r.response?.status;if(!n||!o)return!1;let s=jic(n,o,i),a=Uic(n,o);return s||a}Cy();var Wic=et.RUNNER;async function s8r(r,t=3,n=1e4){return Z0(r,t+1,Wic,{},{retryStrategy:{name:"backoff",base:n/1e3},logOnRetry:"Request returned status 500",retryLogLevel:"info",logOnFailure:"Retry500ResponsesWithExponentialBackoff failed, request never resolved after maximum allowed retries.",failureLogLevel:"error",customErrorOnFailure:i=>{let o=new Error().stack,s=Og(i)&&i.config?i.config.baseURL:"";return[i,o,s]},checkError:i=>{if(!Og(i)||Og(i)&&i.response?.status===401||!o8r(i))return i}})}dr();XE();var Gic=et.RUNNER;async function a8r(r){return await Z0(r,3,Gic,{},{checkError:i=>(i instanceof Error?i.toString():"").toLowerCase().includes("getaddrinfo")?null:i,logOnRetry:"Got an error that looks like DNS, retrying"})}function l8r(r){return()=>a8r(r)}var mvt={getFormattedRealErrorFromAxiosError:Bze,Retry500ResponsesWithExponentialBackoff:s8r,WrapRequestInDNSRetry:l8r};Cy();Zl();fr();Cy();fr();var _Zi=r=>{if(Og(r)&&r.response?.status===409){let t=r.response?.data?.error?.errorString??"",n=r.response?.data?.error?.errorDetail??"",i=n.indexOf(", context"),o=i>=0?n.substring(0,i):"Resource access blocked due to conflict";throw new N3(t,o)}};var c8r=async(r,t,n)=>{let i={};n!==void 0&&(i.Authorization=`Bearer ${n}`);let o=async()=>(await Fp).post(r,t,{headers:i}),s=mvt.WrapRequestInDNSRetry(o);return mvt.Retry500ResponsesWithExponentialBackoff(s).catch(a=>{_Zi(a);let l=500;Og(a)&&(l=a.status||a.response?.status||500);let u=mvt.getFormattedRealErrorFromAxiosError(a);throw new ft(u.error.errorString,u.error.errorDetail||void 0,l)})},uz=(r,t,n)=>c8r(new URL(r,P3()).href,t,n);Ko();fr();dr();var Qg=yt(qw());Wr();Uo();var TZi=yt(qw()),dve=r=>{let t=i=>r.includes(i),n=i=>`Failed constraint check. Expected one of ${JSON.stringify(r)}, but received ${JSON.stringify(i)}`;return TZi.Unknown.withConstraint(i=>t(i)||n(i))};Ko();var yvt=["Basic","OAuth","KeyPair","Cloud"];var Vic=ot.object({connectionKind:ot.literal(Id.Values.databricks),connectionType:ot.enum(["Cloud","Token","OAuthM2M","OAuthU2M"]),connectionDetails:ot.object({userID:ot.string(),path:ot.string(),user:ot.string().optional()})}),usp=ot.object({connectionKind:ot.literal(Id.Values.fabric),connectionType:ot.literal("oauth"),connectionDetails:ot.object({userID:ot.string(),connectionString:ot.string().optional()})}),dsp=ir("DatabricksUserConnection",Vic),Hic=Qg.Record({userID:Qg.String,user:Qg.String,role:Qg.String.optional(),warehouse:Qg.String.optional(),authenticator:Qg.Optional(Qg.Union(Qg.Literal("Basic"),Qg.Literal("OAuth"),Qg.Literal("KeyPair"))),keyPair:Qg.Optional(Qg.String)}),RZi=Qg.Record({connectionKind:Qg.Literal(Id.Values.snowflake).optional(),connectionType:dve(yvt),connectionDetails:Hic});var u8r=et.CONNECTION,Yic=GI("UserConnectionType",RZi),Jic=async(r,t,n)=>{let i=n.isFeatureEnabled("enableSnowflakeOAuthSecretsV2");return ive(r,t,Xae,i)},$ic=async(r,t)=>await r.Get(nve,t);var BZi=async(r,t,n)=>ive(r,t,$ae,n),MZi=async(r,t,n)=>{let i=n.isFeatureEnabled("enableSnowflakeSecretsV2");return ive(r,t,jB,i)},xZi=async r=>await(await Ib()).Get(s7,r),DZi=async(r,t,n)=>await r.Set(s7,t,n),NZi=async(r,t,n,i)=>{if(!i.isFeatureEnabled("enableSnowflakeSecretsV2"))return await r.Set(jB,t,n);await r.Get(jB,t)&&await r.Delete(jB,t),await r.Set(Zae,t,n)},bvt=async(r,t,n,i)=>{let o;try{o=await r.workspace(n).fetch()}catch(u){throw Tp(u)&&u instanceof hl?new ft(`Environment ${n} doesn't exist in org ${t.fbTeamID}`):u}let s={orgId:t.fbTeamID,userId:t.fbUserID,workspaceId:n.toString()},a=await Ib(),l=i===Id.Values.databricks?await $ic(a,s):await Jic(a,s,Rp().featureFlags);if(l===null)throw new ft(`Unable to get OAuth credentials for environment ${n} in org ${t.fbTeamID}!`);return{oauthClientID:l.sensitiveValue.clientId,oauthClientSecret:l.sensitiveValue.clientSecret,connectionAccount:o.connectionAccount,accessUrl:o.accessUrl||null}};var kZi=(r,t)=>{switch(r){case"databricks":return Zic(t);case"snowflake":return eoc(t);case"fabric":return Xic(t);default:throw new sw(r,"CreateDefaultUserConnection")}},Xic=(r,t="oauth")=>({connectionKind:"fabric",connectionType:t,connectionDetails:{userID:r,connectionString:""}}),Zic=r=>({connectionType:"Cloud",connectionDetails:{userID:r,path:""},connectionKind:"databricks"}),eoc=r=>toc("Cloud",r,"",""),toc=(r,t,n,i)=>({connectionType:r,connectionDetails:{user:n,role:i,userID:t,warehouse:""},connectionKind:"snowflake"});var PZi=r=>Yic.is(r),dz=async(r,t)=>{let n="[GetUserConnectionInfoByEnvironment]";return Z0(async()=>{try{let o=await r.fetch(),s;return o.connectionKind==="databricks"?s={connectionType:o.connectionType,connectionDetails:{path:o.connectionDetails.path,userID:o.connectionDetails.userID},connectionKind:"databricks"}:o.connectionKind==="fabric"?s={connectionType:o.connectionType,connectionDetails:{connectionString:o.connectionDetails.connectionString,userID:o.connectionDetails.userID},connectionKind:"fabric"}:s={connectionType:o.connectionType,connectionDetails:{user:o.connectionDetails.user,userID:o.connectionDetails.userID,role:o.connectionDetails.role,warehouse:o.connectionDetails.warehouse}},u8r.infoContext(t,"User Connection found,","kind:",s.connectionKind??"snowflake","type:",s.connectionType),s}catch(o){throw u8r.errorContext(t,"Error getting user connection info",o),o instanceof hl?new Oo("Invalid Connection Information, environment or connection does not exist. Please check that the environmentID is valid, and contains a valid connection.",`environmentID: ${t.workspaceID}: ${o.detail||o.message}`):o}},3,u8r,t,{retryStrategy:{name:"backoff",base:60},logOnRetry:`${n} retrying`,logOnFailure:`${n} failed, exhausted allotted retry attempts`})};fr();Wr();Ji();Ko();Wr();fr();QA();dr();Ko();var QZi=ot.object({snowflakeAuthType:ot.literal("WorkspaceUserDefault").optional(),platformKind:ot.literal("snowflake").optional()}),noc=ir("TSnowflakeDefaultAuthCredentials",QZi),d8r=ot.object({snowflakeUsername:ot.string(),snowflakePassword:ot.string(),snowflakeWarehouse:ot.string().optional(),snowflakeRole:ot.string().optional(),snowflakeAuthType:ot.literal("Basic").optional(),snowflakeAccessUrl:ot.string().nullable().optional(),platformKind:ot.literal("snowflake").optional()}),p8r=ir("TSnowflakeBasicAuthCredentials",d8r),FZi=ot.object({snowflakeUsername:ot.string().optional(),snowflakeWarehouse:ot.string().optional(),snowflakeRole:ot.string().optional(),snowflakeAuthType:ot.literal("Cloud").optional(),platformKind:ot.literal("snowflake").optional()}),ioc=ir("TSnowflakeCloudAuthCredentials",FZi),LZi=ot.object({snowflakeWarehouse:ot.string().optional(),snowflakeAuthType:ot.literal("OAuth").optional(),platformKind:ot.literal("snowflake").optional()}),ooc=ir("TSnowflakeOAuthCredentials",LZi),f8r=ot.object({snowflakeUsername:ot.string().optional(),snowflakeKeyPairKey:ot.string().optional(),snowflakeKeyPairPass:ot.string().nullable().optional(),snowflakeWarehouse:ot.string().optional(),snowflakeRole:ot.string().optional(),snowflakeAuthType:ot.literal("KeyPair").optional(),platformKind:ot.literal("snowflake").optional()}),A8r=ir("TSnowflakeKeyPairAuthCredentials",f8r),h8r=ot.object({token:ot.string(),path:ot.string().optional(),databricksAuthType:ot.literal("Token"),platformKind:ot.literal("databricks")}),zZi=ir("DatabricksBasicAuthCredentials",h8r),soc=ot.object({path:ot.string().optional(),databricksAuthType:ot.literal("Cloud"),platformKind:ot.literal("databricks")}),aoc=ot.object({path:ot.string().optional(),databricksAuthType:ot.literal("OAuthU2M"),platformKind:ot.literal("databricks"),accessToken:ot.string().optional()}),qZi=ot.object({path:ot.string().optional(),databricksAuthType:ot.literal("OAuthM2M"),platformKind:ot.literal("databricks"),clientID:ot.string().optional(),clientSecret:ot.string().optional()}),UZi=ir("DatabricksOAuthM2MCredentials",qZi),loc=ot.object({connectionString:ot.string().optional(),fabricAuthType:ot.literal("oauth"),platformKind:ot.literal("fabric")}),Mze=ot.union([d8r,f8r,h8r]),pz=ot.union([h8r,soc,aoc,qZi,loc,d8r,QZi,f8r,LZi,FZi]),xze=r=>r.platformKind==="snowflake"||r.platformKind===void 0,Evt=r=>r.platformKind==="databricks",jZi=r=>r.platformKind==="fabric",Dze=r=>r.connectionKind==="snowflake"||r.connectionKind===void 0,Cvt=r=>r.connectionKind==="databricks",WZi=r=>r.connectionKind==="fabric",coc=(r,t,n,i)=>n(t.assert(r,i)),uoc=(r,t,n)=>{for(let[i,o]of t)try{return coc(r,i,o,n)}catch{}throw new zw("No matching type found")},TJ=(r,t,n,i,o,s)=>{let a=u=>()=>{throw new Error(`Unexpected credential type: ${u}`)},l=[[p8r,t],[A8r,n??a("keypair")],[ooc,i??a("oauth")],[ioc,o??a("cloud")],[noc,s??a("workspaceDefault")]];try{return uoc(r,l,{failureLogLevel:Kdt})}catch{throw et.CONNECTION.error("Got unsupported credentials",r.snowflakeAuthType,Dx(r)),new ft(`Got unexpected credentials type ${r.snowflakeAuthType}`)}};Wr();Uo();Ji();Ko();Wr();var Ivt=ot.string().regex(/^-?\d+$/),N_=ot.union([ot.literal("API"),ot.literal("CLI"),ot.literal("UI"),ot.literal("fivetranAPI")]),k_=(r,t,n)=>ot.object({runDetails:r,userID:ot.string().optional(),parameters:ot.union([ot.record(ot.any()),ot.string(),ot.null()]).optional(),userCredentials:t,origin:n}).passthrough();var RJ=class{runDetails;userCredentials;runTimeParameters;origin;constructor(t){this.runDetails=t.runDetails,this.userCredentials=t.userCredentials,this.runTimeParameters=t.parameters||t.runTimeParameters||null,this.origin=t.origin}};Wr();var g8r=ot.record(ot.string(),ot.unknown()),GZi=ot.object({addedTable:g8r,alteredTable:g8r,deletedTable:g8r}),vvt=ot.union([ot.number(),ot.string()]),doc=ot.union([ot.object({id:ot.string(),version:ot.string()}),ot.object({id:ot.string(),releaseID:ot.string()})]),poc=ot.object({defaultStorageLocation:ot.string().nullable().optional(),packageInfo:doc.optional(),error:ot.object({errorString:ot.string()}).nullable(),nodeMetadataSpec:ot.string(),templates:ot.object({create:ot.object({templateString:ot.string()}),run:ot.object({templateString:ot.string()})})}),foc=ot.object({id:ot.string().optional(),isDisabled:ot.boolean(),metadata:poc,name:ot.string(),version:ot.number()}),Aoc=ot.object({macroString:ot.string(),macroCounter:ot.number().optional(),id:ot.string().optional()}),VZi=ot.object({jobCounter:ot.number().optional(),name:ot.string().optional()}),HZi=VZi.extend({subgraphs:ot.array(ot.number()).optional(),steps:ot.array(vvt).optional()}).strict(),KZi=VZi.extend({includeSelector:ot.string().optional(),excludeSelector:ot.string().optional()}).strict(),hoc=KZi.merge(HZi).strict(),goc=ot.object({folderCounter:vvt,name:ot.string(),steps:ot.array(vvt)}),YZi=ot.object({steps:ot.record(ot.string(),ot.unknown()),stepTypes:ot.record(ot.string(),foc),jobs:ot.record(vvt,ot.union([hoc,HZi,KZi])),folders:ot.record(ot.string(),goc),macros:ot.record(ot.string(),Aoc),userConnections:ot.record(ot.string(),ot.record(ot.string(),ot.unknown())).optional(),locations:ot.unknown().optional(),defaultStorageMapping:ot.string().nullable().optional(),version:ot.number().optional(),installedPackages:ot.record(ot.string(),ot.unknown()).optional()}).strict();var JZi=ot.object({deployCommit:ot.string(),deployCommitMessage:ot.string(),fromWorkspaceData:YZi,planID:ot.string(),stepsInRun:ot.number(),clearTargetEnvironment:ot.boolean().optional(),environmentID:ot.string(),forcedDeployment:ot.boolean().optional(),parallelism:ot.number().optional()}).strict(),moc=ot.object({dependencies:qse.optional(),dividedStepDataWithWorkspaceEdits:GZi,version:ot.literal(1).optional()}).strict(),$Zi=JZi.merge(moc).strict(),yoc=ot.object({deletedNodes:ot.array(IL).optional(),phasedDependencies:ot.object({addedTable:jse,alteredTable:jse,deletedTable:jse}).strict(),phasedNodeEdits:ot.object({addedTable:Use,alteredTable:Use,deletedTable:Use}).strict(),version:ot.literal(2)}).strict(),XZi=JZi.merge(yoc).strict(),ZZi=ot.union([$Zi,XZi]),Ysp=k_(ZZi,Mze,N_).strict(),boc=k_(ZZi,pz,N_).strict(),eeo=ir("DeployRunWeb",Zo(boc)),pve=class extends RJ{},Jsp=k_($Zi,pz,N_).strict(),$sp=k_(XZi,pz,N_).strict();Wr();Ji();Ko();var Eoc=ot.object({environmentID:ot.string(),operationType:ot.union([ot.literal("create"),ot.literal("run")]),isPreview:ot.boolean(),multisourceIndexLookup:ot.record(ot.string(),ot.number()).nullable(),parallelism:ot.number(),canceled:ot.boolean(),jobID:Ivt.optional(),includeNodesSelector:ot.string().optional(),excludeNodesSelector:ot.string().optional(),stepsInRun:ot.number().nullable().optional(),dependencies:qse.optional()}),Coc=k_(Eoc,pz,N_),teo=ir("TDevRunRequest",Coc);Wr();Ko();var reo=ot.object({environmentID:ot.string(),stepsInRun:ot.number().optional(),jobID:Ivt.optional(),includeNodesSelector:ot.string().optional(),excludeNodesSelector:ot.string().optional(),forceIgnoreWorkspaceStatus:ot.boolean().optional(),parallelism:ot.number().optional(),executor:ot.string().optional()}),dap=k_(reo,Mze,N_),Ioc=k_(reo,pz,N_),neo=ir("TRefreshRunWeb",Ioc),Svt=class extends RJ{},ieo=ot.object({runID:ot.string(),forceIgnoreWorkspaceStatus:ot.boolean().optional(),executor:ot.string().optional()}),pap=k_(ieo,Mze,N_),voc=k_(ieo,pz,N_),oeo=ir("TReRunWeb",voc),fve=class extends RJ{};var Soc=ot.object({newPassword:ot.string(),editedUserID:ot.string()}),yap=ir("TResetPasswordBody",Soc),Ooc=ot.object({orgID:ot.string().optional(),environmentID:ot.string(),runID:ot.number(),runType:FCr.optional()}),bap=ir("CancelRunRequest",Ooc),woc=ot.object({user:ot.string().optional(),password:ot.string().optional(),keyPairKey:ot.string().min(1).optional(),authenticator:ot.enum(yvt),warehouse:ot.string().optional(),role:ot.string().optional(),keyPairPass:ot.string().nullable().optional(),accountName:ot.string().optional(),accessUrl:ot.string().nullable().optional(),database:ot.string().optional(),destinationSchema:ot.string().optional(),orgID:ot.string(),environmentID:ot.union([ot.number(),ot.string()]).optional(),keyPairPath:ot.string().optional(),kind:ot.literal("snowflake").optional()}),_oc=ot.union([ot.object({kind:ot.literal("databricks"),environmentID:ot.union([ot.number(),ot.string()]).optional(),path:ot.string(),host:ot.string(),authenticator:ot.literal("Cloud")}),ot.object({kind:ot.literal("databricks"),environmentID:ot.union([ot.number(),ot.string()]).optional(),authenticator:ot.literal("Token"),path:ot.string(),host:ot.string(),token:ot.string().optional()}),ot.object({kind:ot.literal("databricks"),environmentID:ot.union([ot.number(),ot.string()]).optional(),authenticator:ot.literal("OAuthM2M"),path:ot.string(),host:ot.string(),clientID:ot.string().optional(),clientSecret:ot.string().optional()}),ot.object({kind:ot.literal("databricks"),environmentID:ot.union([ot.number(),ot.string()]).optional(),authenticator:ot.literal("OAuthU2M"),path:ot.string(),host:ot.string(),accessToken:ot.string().optional()})]),Toc=ot.object({kind:ot.literal("fabric"),environmentID:ot.union([ot.number(),ot.string()]).optional(),credentials:ot.object({clientID:ot.string(),clientSecret:ot.string()}).optional(),authenticator:ot.literal("oauth"),connectionString:ot.string().optional()}),Roc=ot.object({userContext:ot.union([woc,_oc,Toc]),templateString:ot.string(),options:ot.record(ot.string(),ot.any()).optional()}),Boc=Roc.extend({requestId:ot.string()}),Eap=ir("TRunSQLRequest",Boc),Nze=r=>{if(r!==void 0)try{return parseInt(r)}catch{throw new zw("jobID could not be converted to a number",`jobID=${r}`)}};var Moc=async(r,t,n)=>{let i=n.isFeatureEnabled("enableSnowflakeSecretsV2");return ive(r,t,ele,i)},aeo=async(r,t,n,i,o,s)=>{let a=n.toString();if(xze(i)){if(!Dze(o))throw new Oo(`Got a snowflake user credentials with a ${o.connectionKind} userConnection`);if(i.snowflakeAuthType==="KeyPair"&&(i.snowflakeKeyPairKey===void 0||i.snowflakeKeyPairPass===void 0)){let l=await Ib(),u=await Moc(l,{orgId:r,userId:t,workspaceId:a},s);if(!u){if(i.snowflakeKeyPairKey===void 0)throw new Oo("No Snowflake private key found!");return}i.snowflakeKeyPairKey===void 0&&(i.snowflakeKeyPairKey=u.sensitiveValue.key),!i.snowflakeUsername&&o.connectionDetails?.user&&(i.snowflakeUsername=o.connectionDetails.user),i.snowflakeKeyPairPass===void 0&&u.sensitiveValue.passphrase!==void 0&&(i.snowflakeKeyPairPass=u.sensitiveValue.passphrase)}}},xoc=async(r,t,n,i,o,s)=>{let a=n.toString();if(Evt(i)&&(i.databricksAuthType==="Cloud"||i.databricksAuthType==="OAuthM2M"||i.databricksAuthType==="OAuthU2M")){if(!Cvt(o))throw new Oo(`Got a databricks auth credentials with a ${o.connectionKind??"snowflake"} userConnection`);let l=await Ib();if(i.databricksAuthType==="OAuthM2M"){let u=await l.Get(tle,{orgId:r,userId:t,workspaceId:a});if(!u)throw new Oo("No Databricks OAuth M2M credentials found!");i.clientSecret=u.sensitiveValue.clientSecret,i.clientID=u.sensitiveValue.clientID}else if(i.databricksAuthType==="Cloud"){let u=await l.Get(rve,{orgId:r,userId:t,workspaceId:a});if(!u)throw new Oo("No Databricks Cloud credentials found!");i.databricksAuthType="Token",i.token=u.sensitiveValue.token}else if(i.databricksAuthType==="OAuthU2M"){let c=await(await Ib()).Get(s7,{orgId:r,userId:t,workspaceId:a});if(!c)throw new Oo("No Databricks credentials found!");!i.path&&o.connectionDetails.path&&(i.path=o.connectionDetails.path),i.accessToken=c.sensitiveValue.access_token}!i.path&&o.connectionDetails.path&&(i.path=o.connectionDetails.path)}else if(xze(i)&&i.snowflakeAuthType==="Cloud"){if(!Dze(o))throw new Oo(`Got a snowflake user credentials with a ${o.connectionKind} userConnection`);let l=await Ib(),u=await BZi(l,{orgId:r,userId:t,workspaceId:a},s.isFeatureEnabled("enableSnowflakeSecretsV2"));if(!u)throw new Oo("No Snowflake credentials found!");!i.snowflakeUsername&&o.connectionDetails?.user&&(i.snowflakeUsername=o.connectionDetails.user),!i.snowflakeWarehouse&&o.connectionDetails?.warehouse&&(i.snowflakeWarehouse=o.connectionDetails.warehouse),!i.snowflakeRole&&o.connectionDetails?.role&&(i.snowflakeRole=o.connectionDetails.role),i.snowflakeAuthType="Basic",i.snowflakePassword=u.sensitiveValue.password}},BJ=async(r,t,n,i,o,s)=>{await xoc(r,t,n,i,o,s),await aeo(r,t,n,i,o,s)};Wr();var Nap=T.literal("oauth"),m8r=".datawarehouse.fabric.microsoft.com";dr();var y8r="0";function leo(r,t=null){return t??`https://${r}.snowflakecomputing.com`}var ceo=(r,t,n,i)=>{let o=[];return t.forEach(s=>{let a=i[s];if(a){let{name:l}=a,u=`{ subgraph: "${l}" }`;o.push(u)}}),r.forEach(s=>{let a=n[s];if(a){let{locationName:l,name:u}=a.operation,c=`{ location: ${l} name: ${u} }`;o.push(c)}}),o};var Doc=r=>r.reduce((t,n)=>t?t.concat(" ",n):n,"");var ueo=(r,t)=>Doc([r,t.toString()]);dr();Ji();var Noc=et.JOBS;var peo=r=>!r?.hasOwnProperty("includeSelector")||!r?.hasOwnProperty("version"),b8r=(r,t,n)=>{let{steps:i,subgraphs:o,...s}=r,a={...s};if(a.hasOwnProperty("version")||(a.version=zse),a.hasOwnProperty("includeSelector"))return a;a.includeSelector="",a.excludeSelector="";let l=new Set(i),u=new Set(o),p=ceo([...l],[...u].map(f=>`${f}`),n,t).map(f=>`+${f}`).join(" OR ");return a.includeSelector=p,Noc.info("Upgrading job v1 to v2",r,a),a};var feo=(r,t)=>{let{jobs:n,folders:i,steps:o}=r,s=n[t];return b8r(s,i,o)};mi();Zl();dr();var Beo=yt(Oeo(),1),Q_=(r,t,n={})=>(_vt(t),!n.nocomment&&t.charAt(0)==="#"?!1:new Ave(t,n).match(r));var Uoc=/^\*+([^+@!?\*\[\(]*)$/,joc=r=>t=>!t.startsWith(".")&&t.endsWith(r),Woc=r=>t=>t.endsWith(r),Goc=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),Voc=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),Hoc=/^\*+\.\*+$/,Koc=r=>!r.startsWith(".")&&r.includes("."),Yoc=r=>r!=="."&&r!==".."&&r.includes("."),Joc=/^\.\*+$/,$oc=r=>r!=="."&&r!==".."&&r.startsWith("."),Xoc=/^\*+$/,Zoc=r=>r.length!==0&&!r.startsWith("."),esc=r=>r.length!==0&&r!=="."&&r!=="..",tsc=/^\?+([^+@!?\*\[\(]*)?$/,rsc=([r,t=""])=>{let n=Teo([r]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},nsc=([r,t=""])=>{let n=Reo([r]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},isc=([r,t=""])=>{let n=Reo([r]);return t?i=>n(i)&&i.endsWith(t):n},osc=([r,t=""])=>{let n=Teo([r]);return t?i=>n(i)&&i.endsWith(t):n},Teo=([r])=>{let t=r.length;return n=>n.length===t&&!n.startsWith(".")},Reo=([r])=>{let t=r.length;return n=>n.length===t&&n!=="."&&n!==".."},ssc=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",wvt=ssc==="win32",S8r=wvt?{sep:"\\"}:{sep:"/"},asc=S8r.sep;Q_.sep=asc;var P_=Symbol("globstar **");Q_.GLOBSTAR=P_;var weo={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},O8r="[^/]",v8r=O8r+"*?",lsc="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",csc="(?:(?!(?:\\/|^)\\.).)*?",Meo=r=>r.split("").reduce((t,n)=>(t[n]=!0,t),{}),_eo=Meo("().*{}+?[]^$\\!"),usc=Meo("[.("),dsc=(r,t={})=>n=>Q_(n,r,t);Q_.filter=dsc;var MJ=(r,t={})=>Object.assign({},r,t),psc=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return Q_;let t=Q_;return Object.assign((i,o,s={})=>t(i,o,MJ(r,s)),{Minimatch:class extends t.Minimatch{constructor(o,s={}){super(o,MJ(r,s))}static defaults(o){return t.defaults(MJ(r,o)).Minimatch}},filter:(i,o={})=>t.filter(i,MJ(r,o)),defaults:i=>t.defaults(MJ(r,i)),makeRe:(i,o={})=>t.makeRe(i,MJ(r,o)),braceExpand:(i,o={})=>t.braceExpand(i,MJ(r,o)),match:(i,o,s={})=>t.match(i,o,MJ(r,s)),sep:t.sep,GLOBSTAR:P_})};Q_.defaults=psc;var xeo=(r,t={})=>(_vt(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,Beo.default)(r));Q_.braceExpand=xeo;var fsc=1024*64,_vt=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>fsc)throw new TypeError("pattern is too long")},Ovt=Symbol("subparse"),Asc=(r,t={})=>new Ave(r,t).makeRe();Q_.makeRe=Asc;var w8r=(r,t,n={})=>{let i=new Ave(t,n);return r=r.filter(o=>i.match(o)),i.options.nonull&&!r.length&&r.push(t),r};Q_.match=w8r;var hsc=r=>r.replace(/\\(.)/g,"$1"),gsc=r=>r.replace(/\\([^-\]])/g,"$1"),msc=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ysc=r=>r.replace(/[[\]\\]/g,"\\$&"),Ave=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;regexp;constructor(t,n={}){_vt(t),n=n||{},this.options=n,this.pattern=t,this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.globSet=[],this.globParts=[],this.set=[],this.make()}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=this.braceExpand(),n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(s=>this.slashSplit(s));if(this.options.noglobstar)this.globParts=i;else{for(let s of i){let a;do{a=!1;for(let l=0;l<s.length-1;l++)s[l]==="*"&&s[l-1]==="**"&&(s[l]="**",s[l-1]="*",a=!0)}while(a)}this.globParts=i.map(s=>(s=s.reduce((a,l)=>{let u=a[a.length-1];return l==="**"&&u==="**"?a:l===".."&&u&&u!==".."&&u!=="."&&u!=="**"?(a.pop(),a):(a.push(l),a)},[]),s.length===0?[""]:s))}this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,a,l)=>s.map(u=>this.parse(u)));if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),wvt)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,i=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)n=!n,i++;i&&(this.pattern=t.slice(i)),this.negate=n}matchOne(t,n,i=!1){let o=this.options;if(wvt){let h=t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),y=n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]);if(h&&y){let C=t[3],v=n[3];C.toLowerCase()===v.toLowerCase()&&(t[3]=v)}else if(y&&typeof t[0]=="string"){let C=n[3],v=t[0];C.toLowerCase()===v.toLowerCase()&&(n[3]=v,n=n.slice(3))}else if(h&&typeof n[0]=="string"){let C=t[3];C.toLowerCase()===n[0].toLowerCase()&&(n[0]=C,t=t.slice(3))}}this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var s=0,a=0,l=t.length,u=n.length;s<l&&a<u;s++,a++){this.debug("matchOne loop");var c=n[a],d=t[s];if(this.debug(n,c,d),c===!1)return!1;if(c===P_){this.debug("GLOBSTAR",[n,c,d]);var p=s,f=a+1;if(f===u){for(this.debug("** at the end");s<l;s++)if(t[s]==="."||t[s]===".."||!o.dot&&t[s].charAt(0)===".")return!1;return!0}for(;p<l;){var A=t[p];if(this.debug(`
1157
1157
  globstar while`,t,p,n,f,A),this.matchOne(t.slice(p),n.slice(f),i))return this.debug("globstar found match!",p,l,A),!0;if(A==="."||A===".."||!o.dot&&A.charAt(0)==="."){this.debug("dot detected!",t,p,n,f);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(i&&(this.debug(`
1158
1158
  >>> no match, partial?`,t,p,n,f),p===l))}let h;if(typeof c=="string"?(h=d===c,this.debug("string match",c,d,h)):(h=c.test(d),this.debug("pattern match",c,d,h)),!h)return!1}if(s===l&&a===u)return!0;if(s===l)return i;if(a===u)return s===l-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return xeo(this.pattern,this.options)}parse(t,n){_vt(t);let i=this.options;if(t==="**")if(i.noglobstar)t="*";else return P_;if(t==="")return"";let o,s=null;n!==Ovt&&((o=t.match(Xoc))?s=i.dot?esc:Zoc:(o=t.match(Uoc))?s=(i.nocase?i.dot?Voc:Goc:i.dot?Woc:joc)(o[1]):(o=t.match(tsc))?s=(i.nocase?i.dot?nsc:rsc:i.dot?isc:osc)(o):(o=t.match(Hoc))?s=i.dot?Yoc:Koc:(o=t.match(Joc))&&(s=$oc));let a="",l=!1,u=!1,c=[],d=[],p=!1,f=!1,A=-1,h=-1,y,C,v,w=t.charAt(0)===".",_=i.dot||w,R=()=>w?"":_?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",N=H=>H.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",L=()=>{if(p){switch(p){case"*":a+=v8r,l=!0;break;case"?":a+=O8r,l=!0;break;default:a+="\\"+p;break}this.debug("clearStateChar %j %j",p,a),p=!1}};for(let H=0,V;H<t.length&&(V=t.charAt(H));H++){if(this.debug("%s %s %s %j",t,H,a,V),u){if(V==="/")return!1;_eo[V]&&(a+="\\"),a+=V,u=!1;continue}switch(V){case"/":return!1;case"\\":if(f&&t.charAt(H+1)==="-"){a+=V;continue}L(),u=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",t,H,a,V),f){this.debug(" in class"),V==="!"&&H===h+1&&(V="^"),a+=V;continue}this.debug("call clearStateChar %j",p),L(),p=V,i.noext&&L();continue;case"(":{if(f){a+="(";continue}if(!p){a+="\\(";continue}let F={type:p,start:H-1,reStart:a.length,open:weo[p].open,close:weo[p].close};this.debug(this.pattern," ",F),c.push(F),a+=F.open,F.start===0&&F.type!=="!"&&(w=!0,a+=N(t.slice(H+1))),this.debug("plType %j %j",p,a),p=!1;continue}case")":{let F=c[c.length-1];if(f||!F){a+="\\)";continue}c.pop(),L(),l=!0,C=F,a+=C.close,C.type==="!"&&d.push(Object.assign(C,{reEnd:a.length}));continue}case"|":{let F=c[c.length-1];if(f||!F){a+="\\|";continue}L(),a+="|",F.start===0&&F.type!=="!"&&(w=!0,a+=N(t.slice(H+1)));continue}case"[":if(L(),f){a+="\\"+V;continue}f=!0,h=H,A=a.length,a+=V;continue;case"]":if(H===h+1||!f){a+="\\"+V;continue}y=t.substring(h+1,H);try{RegExp("["+ysc(gsc(y))+"]"),a+=V}catch{a=a.substring(0,A)+"(?:$.)"}l=!0,f=!1;continue;default:L(),_eo[V]&&!(V==="^"&&f)&&(a+="\\"),a+=V;break}}for(f&&(y=t.slice(h+1),v=this.parse(y,Ovt),a=a.substring(0,A)+"\\["+v[0],l=l||v[1]),C=c.pop();C;C=c.pop()){let H;H=a.slice(C.reStart+C.open.length),this.debug(this.pattern,"setting tail",a,C),H=H.replace(/((?:\\{2}){0,64})(\\?)\|/g,(F,J,K)=>(K||(K="\\"),J+J+K+"|")),this.debug(`tail=%j
1159
1159
  %s`,H,H,C,a);let V=C.type==="*"?v8r:C.type==="?"?O8r:"\\"+C.type;l=!0,a=a.slice(0,C.reStart)+V+"\\("+H}L(),u&&(a+="\\\\");let G=usc[a.charAt(0)];for(let H=d.length-1;H>-1;H--){let V=d[H],F=a.slice(0,V.reStart),J=a.slice(V.reStart,V.reEnd-8),K=a.slice(V.reEnd),Q=a.slice(V.reEnd-8,V.reEnd)+K,$=F.split(")").length,ee=F.split("(").length-$,re=K;for(let W=0;W<ee;W++)re=re.replace(/\)[+*?]?/,"");K=re;let ne=K===""&&n!==Ovt?"(?:$|\\/)":"";a=F+J+K+ne+Q}if(a!==""&&l&&(a="(?=.)"+a),G&&(a=R()+a),n===Ovt)return[a,l];if(i.nocase&&!l&&!i.nocaseMagicOnly&&(l=t.toUpperCase()!==t.toLowerCase()),!l)return hsc(t);let Y=i.nocase?"i":"";try{let H=s?{_glob:t,_src:a,test:s}:{_glob:t,_src:a};return Object.assign(new RegExp("^"+a+"$",Y),H)}catch(H){return this.debug("invalid regexp",H),new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,i=n.noglobstar?v8r:n.dot?lsc:csc,o=n.nocase?"i":"",s=t.map(a=>{let l=a.map(u=>typeof u=="string"?msc(u):u===P_?P_:u._src);return l.forEach((u,c)=>{let d=l[c+1],p=l[c-1];u!==P_||p===P_||(p===void 0?d!==void 0&&d!==P_?l[c+1]="(?:\\/|"+i+"\\/)?"+d:l[c]=i:d===void 0?l[c-1]=p+"(?:\\/|"+i+")?":d!==P_&&(l[c-1]=p+"(?:\\/|\\/"+i+"\\/)"+d,l[c+1]=P_))}),l.filter(u=>u!==P_).join("/")}).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,o)}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):wvt&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let i=this.options;S8r.sep!=="/"&&(t=t.split(S8r.sep).join("/"));let o=this.slashSplit(t);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let a=o[o.length-1];if(!a)for(let l=o.length-2;!a&&l>=0;l--)a=o[l];for(let l=0;l<s.length;l++){let u=s[l],c=o;if(i.matchBase&&u.length===1&&(c=[a]),this.matchOne(c,u,n))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return Q_.defaults(t).Minimatch}};Q_.Minimatch=Ave;var f$e=yt(wo()),aEs=yt(S0o());var uqe=(r,t)=>{Object.entries(r).forEach(([n,i])=>{t(n,i)})};dr();mi();var vv=r=>r.sort((t,n)=>t?.locationName?.localeCompare(n?.locationName)||t?.nodeName?.localeCompare(n?.nodeName));fr();mi();var zJ=r=>!r||!r.operation?null:r.operation.name||"<Unnamed step>",dqe=r=>{let t=xse(r||[]);if(!t)throw new ft(`Expected at least one sourceMapping, but sourceMapping was ${r}`);return t};mi();ept();Ji();aye();mi();var O0o=r=>{let t={SHA1:EL.Enum.SHA1,SHA256:EL.Enum.SHA256,MD5:EL.Enum.MD5};return r.map(n=>{let i=n.keyColumnType=n.keyColumnType===void 0||n.keyColumnType==="None"?void 0:n.keyColumnType,o=n.systemColumnType===void 0||n.systemColumnType==="None"?void 0:n.systemColumnType,s=n.hashDetails&&{hashAlgorithm:t[n.hashDetails.hashAlgorithm]};return{...n,keyColumnType:i,systemColumnType:o,hashDetails:s}})},NCc=r=>r&&r.map(t=>({...t,noLinkRefs:t.noLinkRefs||[]})),kCc=r=>({metadata:{...r.metadata,columns:O0o(r.metadata.columns)},type:"sourceInput",database:r.database??"",description:r.description??"",schema:r.schema??"",deployEnabled:r.deployEnabled,locationName:r.locationName,sqlType:"Source",name:r.name,version:r.version??CL}),PCc=r=>{let t={Before:"Before",After:"After"};return r&&r.map(n=>({...n,description:n.description??"",runOrder:t[n.runOrder]}))},QCc=r=>({metadata:{...r.metadata,columns:O0o(r.metadata.columns),sourceMapping:dqe(NCc(r.metadata.sourceMapping)),appliedNodeTests:PCc(r.metadata.appliedNodeTests)??[],enabledColumnTestIDs:r.metadata.enabledColumnTestIDs??[]},config:r.config||{},isMultisource:r.isMultisource,materializationType:r.materializationType,overrideSQL:r.overrideSQL??!1,type:"sql",database:r.database??"",description:r.description??"",schema:r.schema??"",deployEnabled:r.deployEnabled,locationName:r.locationName,sqlType:r.sqlType,name:r.name,version:r.version}),w0o=r=>{let t=r.type==="sourceInput"?kCc(r):QCc(r);return ab(t)};fr();var Tve=class extends ft{constructor(n,i){super(i,`node ${n} had no sourceMappings`);this.nodeIDOrName=n}};dr();mi();var ed=(r,t)=>r?!h7(r,t):(et.COMMON.infoContext(t??{},"IsSourceStepData: stepData is falsy. stepData:",r),!1),h7=(r,t)=>{if(!r)return t&&et.COMMON.infoContext(t,"IsSourceStepData: stepData is falsy. stepData:",r),!1;let{operation:{type:n,sqlType:i,name:o}}=r,s=i==="Source",a=n==="sourceInput";return t&&VA(!((s||a)&&a!==s),`Discrepency between source type: ${n}, sqlType: ${i} for source node: ${o}. stepData: `,"COMMON",{...t,function:"IsSourceStepData"},r),s&&a};Ji();fr();mi();var _0o=yt(wo());fr();mi();var pqe=class extends ft{constructor(n,i,o,s){let a=Object.keys(o),l=`${(0,_0o.capitalize)(n)} with ID '${i}' not found`;super(l,l+` in ${s}; known valid IDs (${a.length}): ${JSON.stringify(a)}`);this.id=i;this.sourceData=o;this.sourceDescription=s;this.entityType=n}entityType},a4t=(r,t,n,i)=>ZAt(n[t],()=>new pqe(r,t,n,i)),ip=(r,t,n)=>a4t("node",r,t,n),cC=(r,t,n)=>a4t("node type",r,t,n),T0o=(r,t,n)=>a4t("column",r,t,n),yz=(r,t,n)=>a4t("location",r,t,n);fr();var LCc={snowflake:{openingMark:'"',closingMark:'"'},databricks:{openingMark:"`",closingMark:"`"},fabric:{openingMark:"[",closingMark:"]"}},gf=(r,t)=>{let n=LCc[t];if(!n)throw new ft(`Unknown platform kind: ${t}`);return r.map(i=>`${n.openingMark}${i}${n.closingMark}`).join(".")},fle=(r,t)=>{let{database:n,schema:i}=r;return VA(!!(n&&i),`Database or schema are empty or undefined. Cannot create location name. database: ${n}, schema: ${i}`,"PLAN"),gf([n,i],t)};var K00=yt(wo());mi();fr();mi();Ji();Mc();dr();var sje=yt(wo());dr();Ji();var l4t=["isBusinessKey","isChangeTracking","isSurrogateKey"],iDr=["materializationType","isMultisource","overrideSQL","deployEnabled"];Mc();fr();mi();fr();var zCc=r=>0,R0o=r=>{let t=zCc(r);switch(t){case 0:return{base:{name:()=>r.name,isDisabled:()=>r.isDisabled,version:()=>r.version,id:()=>r.id,packageInfo:()=>r.packageInfo,metadata:()=>r.metadata},metadata:{nodeMetadataSpec:()=>r.metadata.nodeMetadataSpec,templates:()=>r.metadata.templates,error:()=>r.metadata.error,defaultStorageLocation:()=>r.metadata.defaultStorageLocation}};default:throw new ft(`Unknown node type data version: ${t}`)}};var qJ="TBLPROPERTIES('delta.columnMapping.mode' = 'name')";var qCc=`capitalized: Source