@noormdev/cli 1.0.0-alpha.0 → 1.0.0-alpha.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/dist/chunk-CFWFYGBB.js +7 -0
- package/dist/chunk-ERDQ5FIO.js +2 -0
- package/dist/chunk-GGT3S2QA.js +5 -0
- package/dist/chunk-JNBY3ZU6.js +214 -0
- package/dist/chunk-KVY4JR2A.js +2 -0
- package/dist/chunk-QI5B3GSQ.js +2 -0
- package/dist/chunk-UR6MHSHU.js +2 -0
- package/dist/devtools-YYBWFXMQ.js +8 -0
- package/dist/engine-UAXTESN4.js +2 -0
- package/dist/esm-74GQLDJV.js +3 -0
- package/dist/index.js +720 -271
- package/dist/mssql-Y7W7F4UH.js +2 -0
- package/dist/mysql-EEPNIS5Q.js +2 -0
- package/dist/mysql2-GYI2HTEE.js +3008 -0
- package/dist/open-NGBTRDPN.js +3 -0
- package/dist/postgres-7E352BHM.js +2 -0
- package/dist/sqlite-KSGG7IKM.js +2 -0
- package/dist/tarn-LSH7NLRE.js +2 -0
- package/dist/tedious-7M6OXIVA.js +192 -0
- package/package.json +2 -6
- package/dist/chunk-FQKJMLMW.js +0 -1
- package/dist/chunk-WOT6VMZA.js +0 -1
- package/dist/engine-Z55HXOAZ.js +0 -1
- package/dist/mssql-GVXYXFBZ.js +0 -1
- package/dist/mysql-LUTQ2CEP.js +0 -1
- package/dist/postgres-DEDRRMUE.js +0 -1
- package/dist/sqlite-OQR7CVXV.js +0 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as wo}from"./chunk-CFWFYGBB.js";import{a as x,b as xt,c as g,d as AT,f as At}from"./chunk-UR6MHSHU.js";var wn=g((Vh,BR)=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.default=void 0;var YW=65536*65536,qR=1/YW,VW=Buffer.from([254,255,255,255,255,255,255,255]),HR=Buffer.alloc(0),Yh=class{constructor(e,n,i){this.initialSize=e,this.encoding=n||"ucs2",this.doubleSizeGrowth=i||!1,this.buffer=Buffer.alloc(this.initialSize,0),this.compositeBuffer=HR,this.position=0}get data(){return this.newBuffer(0),this.compositeBuffer}copyFrom(e){let n=e.length;this.makeRoomFor(n),e.copy(this.buffer,this.position),this.position+=n}makeRoomFor(e){if(this.buffer.length-this.position<e)if(this.doubleSizeGrowth){let n=Math.max(128,this.buffer.length*2);for(;n<e;)n*=2;this.newBuffer(n)}else this.newBuffer(e)}newBuffer(e){let n=this.buffer.slice(0,this.position);this.compositeBuffer=Buffer.concat([this.compositeBuffer,n]),this.buffer=e===0?HR:Buffer.alloc(e,0),this.position=0}writeUInt8(e){this.makeRoomFor(1),this.buffer.writeUInt8(e,this.position),this.position+=1}writeUInt16LE(e){this.makeRoomFor(2),this.buffer.writeUInt16LE(e,this.position),this.position+=2}writeUShort(e){this.writeUInt16LE(e)}writeUInt16BE(e){this.makeRoomFor(2),this.buffer.writeUInt16BE(e,this.position),this.position+=2}writeUInt24LE(e){this.makeRoomFor(3),this.buffer[this.position+2]=e>>>16&255,this.buffer[this.position+1]=e>>>8&255,this.buffer[this.position]=e&255,this.position+=3}writeUInt32LE(e){this.makeRoomFor(4),this.buffer.writeUInt32LE(e,this.position),this.position+=4}writeBigInt64LE(e){this.makeRoomFor(8),this.buffer.writeBigInt64LE(e,this.position),this.position+=8}writeInt64LE(e){this.writeBigInt64LE(BigInt(e))}writeUInt64LE(e){this.writeBigUInt64LE(BigInt(e))}writeBigUInt64LE(e){this.makeRoomFor(8),this.buffer.writeBigUInt64LE(e,this.position),this.position+=8}writeUInt32BE(e){this.makeRoomFor(4),this.buffer.writeUInt32BE(e,this.position),this.position+=4}writeUInt40LE(e){this.writeInt32LE(e&-1),this.writeUInt8(Math.floor(e*qR))}writeInt8(e){this.makeRoomFor(1),this.buffer.writeInt8(e,this.position),this.position+=1}writeInt16LE(e){this.makeRoomFor(2),this.buffer.writeInt16LE(e,this.position),this.position+=2}writeInt16BE(e){this.makeRoomFor(2),this.buffer.writeInt16BE(e,this.position),this.position+=2}writeInt32LE(e){this.makeRoomFor(4),this.buffer.writeInt32LE(e,this.position),this.position+=4}writeInt32BE(e){this.makeRoomFor(4),this.buffer.writeInt32BE(e,this.position),this.position+=4}writeFloatLE(e){this.makeRoomFor(4),this.buffer.writeFloatLE(e,this.position),this.position+=4}writeDoubleLE(e){this.makeRoomFor(8),this.buffer.writeDoubleLE(e,this.position),this.position+=8}writeString(e,n){n==null&&(n=this.encoding);let i=Buffer.byteLength(e,n);this.makeRoomFor(i),this.buffer.write(e,this.position,n),this.position+=i}writeBVarchar(e,n){this.writeUInt8(e.length),this.writeString(e,n)}writeUsVarchar(e,n){this.writeUInt16LE(e.length),this.writeString(e,n)}writeUsVarbyte(e,n){n==null&&(n=this.encoding);let i;e instanceof Buffer?i=e.length:(e=e.toString(),i=Buffer.byteLength(e,n)),this.writeUInt16LE(i),e instanceof Buffer?this.writeBuffer(e):(this.makeRoomFor(i),this.buffer.write(e,this.position,n),this.position+=i)}writePLPBody(e,n){n==null&&(n=this.encoding);let i;e instanceof Buffer?i=e.length:(e=e.toString(),i=Buffer.byteLength(e,n)),this.writeBuffer(VW),i>0&&(this.writeUInt32LE(i),e instanceof Buffer?this.writeBuffer(e):(this.makeRoomFor(i),this.buffer.write(e,this.position,n),this.position+=i)),this.writeUInt32LE(0)}writeBuffer(e){let n=e.length;this.makeRoomFor(n),e.copy(this.buffer,this.position),this.position+=n}writeMoney(e){this.writeInt32LE(Math.floor(e*qR)),this.writeInt32LE(e&-1)}},_Se=Vh.default=Yh;BR.exports=Yh});var Wt=g(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.Token=te.TYPE=te.SSPIToken=te.RowToken=te.RoutingEnvChangeToken=te.RollbackTransactionEnvChangeToken=te.ReturnValueToken=te.ReturnStatusToken=te.ResetConnectionEnvChangeToken=te.PacketSizeEnvChangeToken=te.OrderToken=te.NBCRowToken=te.LoginAckToken=te.LanguageEnvChangeToken=te.InfoMessageToken=te.FedAuthInfoToken=te.FeatureExtAckToken=te.ErrorMessageToken=te.DoneToken=te.DoneProcToken=te.DoneInProcToken=te.DatabaseMirroringPartnerEnvChangeToken=te.DatabaseEnvChangeToken=te.CommitTransactionEnvChangeToken=te.CollationChangeToken=te.ColMetadataToken=te.CharsetEnvChangeToken=te.BeginTransactionEnvChangeToken=void 0;var ySe=te.TYPE={ALTMETADATA:136,ALTROW:211,COLMETADATA:129,COLINFO:165,DONE:253,DONEPROC:254,DONEINPROC:255,ENVCHANGE:227,ERROR:170,FEATUREEXTACK:174,FEDAUTHINFO:238,INFO:171,LOGINACK:173,NBCROW:210,OFFSET:120,ORDER:169,RETURNSTATUS:121,RETURNVALUE:172,ROW:209,SSPI:237,TABNAME:164},qe=class{constructor(e,n){this.name=e,this.handlerName=n}};te.Token=qe;var CT=class extends qe{constructor(e){super("COLMETADATA","onColMetadata"),this.columns=e}};te.ColMetadataToken=CT;var ST=class extends qe{constructor({more:e,sqlError:n,attention:i,serverError:r,rowCount:o,curCmd:s}){super("DONE","onDone"),this.more=e,this.sqlError=n,this.attention=i,this.serverError=r,this.rowCount=o,this.curCmd=s}};te.DoneToken=ST;var wT=class extends qe{constructor({more:e,sqlError:n,attention:i,serverError:r,rowCount:o,curCmd:s}){super("DONEINPROC","onDoneInProc"),this.more=e,this.sqlError=n,this.attention=i,this.serverError=r,this.rowCount=o,this.curCmd=s}};te.DoneInProcToken=wT;var IT=class extends qe{constructor({more:e,sqlError:n,attention:i,serverError:r,rowCount:o,curCmd:s}){super("DONEPROC","onDoneProc"),this.more=e,this.sqlError=n,this.attention=i,this.serverError=r,this.rowCount=o,this.curCmd=s}};te.DoneProcToken=IT;var vT=class extends qe{constructor(e,n){super("ENVCHANGE","onDatabaseChange"),this.type="DATABASE",this.newValue=e,this.oldValue=n}};te.DatabaseEnvChangeToken=vT;var bT=class extends qe{constructor(e,n){super("ENVCHANGE","onLanguageChange"),this.type="LANGUAGE",this.newValue=e,this.oldValue=n}};te.LanguageEnvChangeToken=bT;var OT=class extends qe{constructor(e,n){super("ENVCHANGE","onCharsetChange"),this.type="CHARSET",this.newValue=e,this.oldValue=n}};te.CharsetEnvChangeToken=OT;var RT=class extends qe{constructor(e,n){super("ENVCHANGE","onPacketSizeChange"),this.type="PACKET_SIZE",this.newValue=e,this.oldValue=n}};te.PacketSizeEnvChangeToken=RT;var NT=class extends qe{constructor(e,n){super("ENVCHANGE","onBeginTransaction"),this.type="BEGIN_TXN",this.newValue=e,this.oldValue=n}};te.BeginTransactionEnvChangeToken=NT;var PT=class extends qe{constructor(e,n){super("ENVCHANGE","onCommitTransaction"),this.type="COMMIT_TXN",this.newValue=e,this.oldValue=n}};te.CommitTransactionEnvChangeToken=PT;var DT=class extends qe{constructor(e,n){super("ENVCHANGE","onRollbackTransaction"),this.type="ROLLBACK_TXN",this.newValue=e,this.oldValue=n}};te.RollbackTransactionEnvChangeToken=DT;var MT=class extends qe{constructor(e,n){super("ENVCHANGE","onDatabaseMirroringPartner"),this.type="DATABASE_MIRRORING_PARTNER",this.newValue=e,this.oldValue=n}};te.DatabaseMirroringPartnerEnvChangeToken=MT;var kT=class extends qe{constructor(e,n){super("ENVCHANGE","onResetConnection"),this.type="RESET_CONNECTION",this.newValue=e,this.oldValue=n}};te.ResetConnectionEnvChangeToken=kT;var LT=class extends qe{constructor(e,n){super("ENVCHANGE","onSqlCollationChange"),this.type="SQL_COLLATION",this.newValue=e,this.oldValue=n}};te.CollationChangeToken=LT;var UT=class extends qe{constructor(e,n){super("ENVCHANGE","onRoutingChange"),this.type="ROUTING_CHANGE",this.newValue=e,this.oldValue=n}};te.RoutingEnvChangeToken=UT;var xT=class extends qe{constructor(e,n){super("FEATUREEXTACK","onFeatureExtAck"),this.fedAuth=e,this.utf8Support=n}};te.FeatureExtAckToken=xT;var FT=class extends qe{constructor(e,n){super("FEDAUTHINFO","onFedAuthInfo"),this.spn=e,this.stsurl=n}};te.FedAuthInfoToken=FT;var qT=class extends qe{constructor({number:e,state:n,class:i,message:r,serverName:o,procName:s,lineNumber:a}){super("INFO","onInfoMessage"),this.number=e,this.state=n,this.class=i,this.message=r,this.serverName=o,this.procName=s,this.lineNumber=a}};te.InfoMessageToken=qT;var HT=class extends qe{constructor({number:e,state:n,class:i,message:r,serverName:o,procName:s,lineNumber:a}){super("ERROR","onErrorMessage"),this.number=e,this.state=n,this.class=i,this.message=r,this.serverName=o,this.procName=s,this.lineNumber=a}};te.ErrorMessageToken=HT;var BT=class extends qe{constructor({interface:e,tdsVersion:n,progName:i,progVersion:r}){super("LOGINACK","onLoginAck"),this.interface=e,this.tdsVersion=n,this.progName=i,this.progVersion=r}};te.LoginAckToken=BT;var jT=class extends qe{constructor(e){super("NBCROW","onRow"),this.columns=e}};te.NBCRowToken=jT;var YT=class extends qe{constructor(e){super("ORDER","onOrder"),this.orderColumns=e}};te.OrderToken=YT;var VT=class extends qe{constructor(e){super("RETURNSTATUS","onReturnStatus"),this.value=e}};te.ReturnStatusToken=VT;var $T=class extends qe{constructor({paramOrdinal:e,paramName:n,metadata:i,value:r}){super("RETURNVALUE","onReturnValue"),this.paramOrdinal=e,this.paramName=n,this.metadata=i,this.value=r}};te.ReturnValueToken=$T;var zT=class extends qe{constructor(e){super("ROW","onRow"),this.columns=e}};te.RowToken=zT;var GT=class extends qe{constructor(e,n){super("SSPICHALLENGE","onSSPI"),this.ntlmpacket=e,this.ntlmpacketBuffer=n}};te.SSPIToken=GT});var QT=g((zh,YR)=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.default=void 0;var $W=x("events"),jR=GW(wn()),zW=x("stream"),KT=Wt();function GW(t){return t&&t.__esModule?t:{default:t}}var WT={nullable:1,caseSen:2,updateableReadWrite:4,updateableUnknown:8,identity:16,computed:32,fixedLenCLRType:256,sparseColumnSet:1024,hidden:8192,key:16384,nullableUnknown:32768},WW={FINAL:0,MORE:1,ERROR:2,INXACT:4,COUNT:16,ATTN:32,SRVERROR:256},KW=Buffer.from([KT.TYPE.ROW]),XW=Buffer.from([16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),QW=Buffer.from([0]),XT=class extends zW.Transform{constructor(e){super({writableObjectMode:!0}),this.bulkLoad=e,this.mainOptions=e.options,this.columns=e.columns,this.columnMetadataWritten=!1}_transform(e,n,i){this.columnMetadataWritten||(this.push(this.bulkLoad.getColMetaData()),this.columnMetadataWritten=!0),this.push(KW);for(let r=0;r<this.columns.length;r++){let o=this.columns[r],s=Array.isArray(e)?e[r]:e[o.objName];if(!this.bulkLoad.firstRowWritten)try{s=o.type.validate(s,o.collation)}catch(c){return i(c)}let a={length:o.length,scale:o.scale,precision:o.precision,value:s};if(o.type.name==="Text"||o.type.name==="Image"||o.type.name==="NText"){if(s==null){this.push(QW);continue}this.push(XW)}try{this.push(o.type.generateParameterLength(a,this.mainOptions));for(let c of o.type.generateParameterData(a,this.mainOptions))this.push(c)}catch(c){return i(c)}}process.nextTick(i)}_flush(e){this.push(this.bulkLoad.createDoneToken()),process.nextTick(e)}},$h=class extends $W.EventEmitter{constructor(e,n,i,{checkConstraints:r=!1,fireTriggers:o=!1,keepNulls:s=!1,lockTable:a=!1,order:c={}},u){if(typeof r!="boolean")throw new TypeError('The "options.checkConstraints" property must be of type boolean.');if(typeof o!="boolean")throw new TypeError('The "options.fireTriggers" property must be of type boolean.');if(typeof s!="boolean")throw new TypeError('The "options.keepNulls" property must be of type boolean.');if(typeof a!="boolean")throw new TypeError('The "options.lockTable" property must be of type boolean.');if(typeof c!="object"||c===null)throw new TypeError('The "options.order" property must be of type object.');for(let[l,d]of Object.entries(c))if(d!=="ASC"&&d!=="DESC")throw new TypeError('The value of the "'+l+'" key in the "options.order" object must be either "ASC" or "DESC".');super(),this.error=void 0,this.canceled=!1,this.executionStarted=!1,this.collation=n,this.table=e,this.options=i,this.callback=u,this.columns=[],this.columnsByName={},this.firstRowWritten=!1,this.streamingMode=!1,this.rowToPacketTransform=new XT(this),this.bulkOptions={checkConstraints:r,fireTriggers:o,keepNulls:s,lockTable:a,order:c}}addColumn(e,n,{output:i=!1,length:r,precision:o,scale:s,objName:a=e,nullable:c=!0}){if(this.firstRowWritten)throw new Error("Columns cannot be added to bulk insert after the first row has been written.");if(this.executionStarted)throw new Error("Columns cannot be added to bulk insert after execution has started.");let u={type:n,name:e,value:null,output:i,length:r,precision:o,scale:s,objName:a,nullable:c,collation:this.collation};(n.id&48)===32&&u.length==null&&n.resolveLength&&(u.length=n.resolveLength(u)),n.resolvePrecision&&u.precision==null&&(u.precision=n.resolvePrecision(u)),n.resolveScale&&u.scale==null&&(u.scale=n.resolveScale(u)),this.columns.push(u),this.columnsByName[e]=u}getOptionsSql(){let e=[];if(this.bulkOptions.checkConstraints&&e.push("CHECK_CONSTRAINTS"),this.bulkOptions.fireTriggers&&e.push("FIRE_TRIGGERS"),this.bulkOptions.keepNulls&&e.push("KEEP_NULLS"),this.bulkOptions.lockTable&&e.push("TABLOCK"),this.bulkOptions.order){let n=[];for(let[i,r]of Object.entries(this.bulkOptions.order))n.push(`${i} ${r}`);n.length&&e.push(`ORDER (${n.join(", ")})`)}return e.length>0?` WITH (${e.join(",")})`:""}getBulkInsertSql(){let e="insert bulk "+this.table+"(";for(let n=0,i=this.columns.length;n<i;n++){let r=this.columns[n];n!==0&&(e+=", "),e+="["+r.name+"] "+r.type.declaration(r)}return e+=")",e+=this.getOptionsSql(),e}getTableCreationSql(){let e="CREATE TABLE "+this.table+`(
|
|
3
|
+
`;for(let n=0,i=this.columns.length;n<i;n++){let r=this.columns[n];n!==0&&(e+=`,
|
|
4
|
+
`),e+="["+r.name+"] "+r.type.declaration(r),r.nullable!==void 0&&(e+=" "+(r.nullable?"NULL":"NOT NULL"))}return e+=`
|
|
5
|
+
)`,e}getColMetaData(){let e=new jR.default(100,null,!0);e.writeUInt8(KT.TYPE.COLMETADATA),e.writeUInt16LE(this.columns.length);for(let n=0,i=this.columns.length;n<i;n++){let r=this.columns[n];this.options.tdsVersion<"7_2"?e.writeUInt16LE(0):e.writeUInt32LE(0);let o=WT.updateableReadWrite;r.nullable?o|=WT.nullable:r.nullable===void 0&&this.options.tdsVersion>="7_2"&&(o|=WT.nullableUnknown),e.writeUInt16LE(o),e.writeBuffer(r.type.generateTypeInfo(r,this.options)),r.type.hasTableName&&e.writeUsVarchar(this.table,"ucs2"),e.writeBVarchar(r.name,"ucs2")}return e.data}setTimeout(e){this.timeout=e}createDoneToken(){let e=new jR.default(this.options.tdsVersion<"7_2"?9:13);e.writeUInt8(KT.TYPE.DONE);let n=WW.FINAL;return e.writeUInt16LE(n),e.writeUInt16LE(0),e.writeUInt32LE(0),this.options.tdsVersion>="7_2"&&e.writeUInt32LE(0),e.data}cancel(){this.canceled||(this.canceled=!0,this.emit("cancel"))}},TSe=zh.default=$h;YR.exports=$h});var cn={};AT(cn,{__addDisposableResource:()=>pN,__assign:()=>Gh,__asyncDelegator:()=>sN,__asyncGenerator:()=>oN,__asyncValues:()=>aN,__await:()=>ys,__awaiter:()=>JR,__classPrivateFieldGet:()=>dN,__classPrivateFieldIn:()=>fN,__classPrivateFieldSet:()=>hN,__createBinding:()=>Kh,__decorate:()=>zR,__disposeResources:()=>mN,__esDecorate:()=>WR,__exportStar:()=>tN,__extends:()=>VR,__generator:()=>eN,__importDefault:()=>lN,__importStar:()=>uN,__makeTemplateObject:()=>cN,__metadata:()=>ZR,__param:()=>GR,__propKey:()=>XR,__read:()=>eA,__rest:()=>$R,__rewriteRelativeImportExtension:()=>gN,__runInitializers:()=>KR,__setFunctionName:()=>QR,__spread:()=>nN,__spreadArray:()=>iN,__spreadArrays:()=>rN,__values:()=>Wh,default:()=>e3});function VR(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ZT(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function $R(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function zR(t,e,n,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o}function GR(t,e){return function(n,i){e(n,i,t)}}function WR(t,e,n,i,r,o){function s(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&t?i.static?t:t.prototype:null,l=e||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,f=!1,m=n.length-1;m>=0;m--){var _={};for(var E in i)_[E]=E==="access"?{}:i[E];for(var E in i.access)_.access[E]=i.access[E];_.addInitializer=function(y){if(f)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(y||null))};var I=(0,n[m])(a==="accessor"?{get:l.get,set:l.set}:l[c],_);if(a==="accessor"){if(I===void 0)continue;if(I===null||typeof I!="object")throw new TypeError("Object expected");(d=s(I.get))&&(l.get=d),(d=s(I.set))&&(l.set=d),(d=s(I.init))&&r.unshift(d)}else(d=s(I))&&(a==="field"?r.unshift(d):l[c]=d)}u&&Object.defineProperty(u,i.name,l),f=!0}function KR(t,e,n){for(var i=arguments.length>2,r=0;r<e.length;r++)n=i?e[r].call(t,n):e[r].call(t);return i?n:void 0}function XR(t){return typeof t=="symbol"?t:"".concat(t)}function QR(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function ZR(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function JR(t,e,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(l){try{u(i.next(l))}catch(d){s(d)}}function c(l){try{u(i.throw(l))}catch(d){s(d)}}function u(l){l.done?o(l.value):r(l.value).then(a,c)}u((i=i.apply(t,e||[])).next())})}function eN(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(l){return c([u,l])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(l){u=[6,l],r=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function tN(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Kh(e,t,n)}function Wh(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function eA(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var i=n.call(t),r,o=[],s;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return o}function nN(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(eA(arguments[e]));return t}function rN(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var i=Array(t),r=0,e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}function iN(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,o;i<r;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}function ys(t){return this instanceof ys?(this.v=t,this):new ys(t)}function oN(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(t,e||[]),r,o=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),r[Symbol.asyncIterator]=function(){return this},r;function s(m){return function(_){return Promise.resolve(_).then(m,d)}}function a(m,_){i[m]&&(r[m]=function(E){return new Promise(function(I,y){o.push([m,E,I,y])>1||c(m,E)})},_&&(r[m]=_(r[m])))}function c(m,_){try{u(i[m](_))}catch(E){f(o[0][3],E)}}function u(m){m.value instanceof ys?Promise.resolve(m.value.v).then(l,d):f(o[0][2],m)}function l(m){c("next",m)}function d(m){c("throw",m)}function f(m,_){m(_),o.shift(),o.length&&c(o[0][0],o[0][1])}}function sN(t){var e,n;return e={},i("next"),i("throw",function(r){throw r}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(r,o){e[r]=t[r]?function(s){return(n=!n)?{value:ys(t[r](s)),done:!1}:o?o(s):s}:o}}function aN(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Wh=="function"?Wh(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(o){n[o]=t[o]&&function(s){return new Promise(function(a,c){s=t[o](s),r(a,c,s.done,s.value)})}}function r(o,s,a,c){Promise.resolve(c).then(function(u){o({value:u,done:a})},s)}}function cN(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function uN(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n=JT(t),i=0;i<n.length;i++)n[i]!=="default"&&Kh(e,t,n[i]);return ZW(e,t),e}function lN(t){return t&&t.__esModule?t:{default:t}}function dN(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)}function hN(t,e,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(t,n):r?r.value=n:e.set(t,n),n}function fN(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function pN(t,e,n){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],n&&(r=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e}function mN(t){function e(o){t.error=t.hasError?new JW(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var n,i=0;function r(){for(;n=t.stack.pop();)try{if(!n.async&&i===1)return i=0,t.stack.push(n),Promise.resolve().then(r);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(o).then(r,function(s){return e(s),r()})}else i|=1}catch(s){e(s)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return r()}function gN(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,r,o,s){return i?e?".jsx":".js":r&&(!o||!s)?n:r+o+"."+s.toLowerCase()+"js"}):t}var ZT,Gh,Kh,ZW,JT,JW,e3,un=xt(()=>{"use strict";ZT=function(t,e){return ZT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},ZT(t,e)};Gh=function(){return Gh=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Gh.apply(this,arguments)};Kh=Object.create?(function(t,e,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}):(function(t,e,n,i){i===void 0&&(i=n),t[i]=e[n]});ZW=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},JT=function(t){return JT=Object.getOwnPropertyNames||function(e){var n=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[n.length]=i);return n},JT(t)};JW=typeof SuppressedError=="function"?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};e3={__extends:VR,__assign:Gh,__rest:$R,__decorate:zR,__param:GR,__esDecorate:WR,__runInitializers:KR,__propKey:XR,__setFunctionName:QR,__metadata:ZR,__awaiter:JR,__generator:eN,__createBinding:Kh,__exportStar:tN,__values:Wh,__read:eA,__spread:nN,__spreadArrays:rN,__spreadArray:iN,__await:ys,__asyncGenerator:oN,__asyncDelegator:sN,__asyncValues:aN,__makeTemplateObject:cN,__importStar:uN,__importDefault:lN,__classPrivateFieldGet:dN,__classPrivateFieldSet:hN,__classPrivateFieldIn:fN,__addDisposableResource:pN,__disposeResources:mN,__rewriteRelativeImportExtension:gN}});var Fr=g(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.DEFAULT_TOKEN_CACHE_NAME=ct.CACHE_NON_CAE_SUFFIX=ct.CACHE_CAE_SUFFIX=ct.ALL_TENANTS=ct.DefaultAuthority=ct.DefaultAuthorityHost=ct.AzureAuthorityHosts=ct.DefaultTenantId=ct.DeveloperSignOnClientId=ct.SDK_VERSION=void 0;ct.SDK_VERSION="4.13.0";ct.DeveloperSignOnClientId="04b07795-8ddb-461a-bbee-02f9e1bf7b46";ct.DefaultTenantId="common";var tA;(function(t){t.AzureChina="https://login.chinacloudapi.cn",t.AzureGermany="https://login.microsoftonline.de",t.AzureGovernment="https://login.microsoftonline.us",t.AzurePublicCloud="https://login.microsoftonline.com"})(tA||(ct.AzureAuthorityHosts=tA={}));ct.DefaultAuthorityHost=tA.AzurePublicCloud;ct.DefaultAuthority="login.microsoftonline.com";ct.ALL_TENANTS=["*"];ct.CACHE_CAE_SUFFIX="cae";ct.CACHE_NON_CAE_SUFFIX="nocae";ct.DEFAULT_TOKEN_CACHE_NAME="msal.cache"});var Xh=g(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.msalPlugins=Me.msalNodeFlowVSCodeCredentialControl=Me.msalNodeFlowNativeBrokerControl=Me.vsCodeBrokerInfo=Me.vsCodeAuthRecordPath=Me.nativeBrokerInfo=Me.msalNodeFlowCacheControl=Me.persistenceProvider=void 0;Me.hasNativeBroker=t3;Me.hasVSCodePlugin=n3;var nA=Fr();Me.persistenceProvider=void 0;Me.msalNodeFlowCacheControl={setPersistence(t){Me.persistenceProvider=t}};Me.nativeBrokerInfo=void 0;Me.vsCodeAuthRecordPath=void 0;Me.vsCodeBrokerInfo=void 0;function t3(){return Me.nativeBrokerInfo!==void 0}function n3(){return Me.vsCodeAuthRecordPath!==void 0&&Me.vsCodeBrokerInfo!==void 0}Me.msalNodeFlowNativeBrokerControl={setNativeBroker(t){Me.nativeBrokerInfo={broker:t}}};Me.msalNodeFlowVSCodeCredentialControl={setVSCodeAuthRecordPath(t){Me.vsCodeAuthRecordPath=t},setVSCodeBroker(t){Me.vsCodeBrokerInfo={broker:t}}};function r3(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(Me.persistenceProvider===void 0)throw new Error(["Persistent token caching was requested, but no persistence provider was configured.","You must install the identity-cache-persistence plugin package (`npm install --save @azure/identity-cache-persistence`)","and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling","`useIdentityPlugin(cachePersistencePlugin)` before using `tokenCachePersistenceOptions`."].join(" "));let n=t.tokenCachePersistenceOptions.name||nA.DEFAULT_TOKEN_CACHE_NAME;e.cache.cachePlugin=(0,Me.persistenceProvider)({name:`${n}.${nA.CACHE_NON_CAE_SUFFIX}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=(0,Me.persistenceProvider)({name:`${n}.${nA.CACHE_CAE_SUFFIX}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=o3(t.isVSCodeCredential||!1)),e}var _N={missing:(t,e,n)=>[`${t} was requested, but no plugin was configured or no authentication record was found.`,`You must install the ${e} plugin package (npm install --save ${e})`,"and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling",`useIdentityPlugin(${n}) before using enableBroker.`].join(" "),unavailable:(t,e)=>[`${t} was requested, and the plugin is configured, but the broker is unavailable.`,`Ensure the ${t} plugin is properly installed and configured.`,"Check for missing native dependencies and ensure the package is properly installed.",`See the README for prerequisites on installing and using ${e}.`].join(" ")},i3={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return Me.vsCodeBrokerInfo}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return Me.nativeBrokerInfo}}};function o3(t){let{credentialName:e,packageName:n,pluginVar:i,brokerInfo:r}=i3[t?"vsCode":"native"];if(r===void 0)throw new Error(_N.missing(e,n,i));if(r.broker.isBrokerAvailable===!1)throw new Error(_N.unavailable(e,n));return r.broker}Me.msalPlugins={generatePluginConfiguration:r3}});var yN=g(iA=>{"use strict";Object.defineProperty(iA,"__esModule",{value:!0});iA.useIdentityPlugin=a3;var rA=Xh(),s3={cachePluginControl:rA.msalNodeFlowCacheControl,nativeBrokerPluginControl:rA.msalNodeFlowNativeBrokerControl,vsCodeCredentialControl:rA.msalNodeFlowVSCodeCredentialControl};function a3(t){t(s3)}});var _t=g(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.AuthenticationRequiredError=Ct.AggregateAuthenticationError=Ct.AggregateAuthenticationErrorName=Ct.AuthenticationError=Ct.AuthenticationErrorName=Ct.CredentialUnavailableError=Ct.CredentialUnavailableErrorName=void 0;function c3(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}Ct.CredentialUnavailableErrorName="CredentialUnavailableError";var oA=class extends Error{constructor(e,n){super(e,n),this.name=Ct.CredentialUnavailableErrorName}};Ct.CredentialUnavailableError=oA;Ct.AuthenticationErrorName="AuthenticationError";var sA=class extends Error{statusCode;errorResponse;constructor(e,n,i){let r={error:"unknown",errorDescription:"An unknown error occurred and no additional details are available."};if(c3(n))r=EN(n);else if(typeof n=="string")try{let o=JSON.parse(n);r=EN(o)}catch{e===400?r={error:"invalid_request",errorDescription:`The service indicated that the request was invalid.
|
|
6
|
+
|
|
7
|
+
${n}`}:r={error:"unknown_error",errorDescription:`An unknown error has occurred. Response body:
|
|
8
|
+
|
|
9
|
+
${n}`}}else r={error:"unknown_error",errorDescription:"An unknown error occurred and no additional details are available."};super(`${r.error} Status code: ${e}
|
|
10
|
+
More details:
|
|
11
|
+
${r.errorDescription},`,i),this.statusCode=e,this.errorResponse=r,this.name=Ct.AuthenticationErrorName}};Ct.AuthenticationError=sA;Ct.AggregateAuthenticationErrorName="AggregateAuthenticationError";var aA=class extends Error{errors;constructor(e,n){let i=e.join(`
|
|
12
|
+
`);super(`${n}
|
|
13
|
+
${i}`),this.errors=e,this.name=Ct.AggregateAuthenticationErrorName}};Ct.AggregateAuthenticationError=aA;function EN(t){return{error:t.error,errorDescription:t.error_description,correlationId:t.correlation_id,errorCodes:t.error_codes,timestamp:t.timestamp,traceId:t.trace_id}}var cA=class extends Error{scopes;getTokenOptions;constructor(e){super(e.message,e.cause?{cause:e.cause}:void 0),this.scopes=e.scopes,this.getTokenOptions=e.getTokenOptions,this.name="AuthenticationRequiredError"}};Ct.AuthenticationRequiredError=cA});var AN=g(uA=>{"use strict";Object.defineProperty(uA,"__esModule",{value:!0});uA.log=h3;var TN=(un(),At(cn)),u3=x("os"),l3=TN.__importDefault(x("util")),d3=TN.__importDefault(x("process"));function h3(t,...e){d3.default.stderr.write(`${l3.default.format(t,...e)}${u3.EOL}`)}});var bN=g(pA=>{"use strict";Object.defineProperty(pA,"__esModule",{value:!0});var f3=AN(),CN=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,wN,lA=[],dA=[],Qh=[];CN&&hA(CN);var IN=Object.assign(t=>vN(t),{enable:hA,enabled:fA,disable:p3,log:f3.log});function hA(t){wN=t,lA=[],dA=[];let e=t.split(",").map(n=>n.trim());for(let n of e)n.startsWith("-")?dA.push(n.substring(1)):lA.push(n);for(let n of Qh)n.enabled=fA(n.namespace)}function fA(t){if(t.endsWith("*"))return!0;for(let e of dA)if(SN(t,e))return!1;for(let e of lA)if(SN(t,e))return!0;return!1}function SN(t,e){if(e.indexOf("*")===-1)return t===e;let n=e;if(e.indexOf("**")!==-1){let f=[],m="";for(let _ of e)_==="*"&&m==="*"||(m=_,f.push(_));n=f.join("")}let i=0,r=0,o=n.length,s=t.length,a=-1,c=-1;for(;i<s&&r<o;)if(n[r]==="*"){if(a=r,r++,r===o)return!0;for(;t[i]!==n[r];)if(i++,i===s)return!1;c=i,i++,r++;continue}else if(n[r]===t[i])r++,i++;else if(a>=0){if(r=a+1,i=c+1,i===s)return!1;for(;t[i]!==n[r];)if(i++,i===s)return!1;c=i,i++,r++;continue}else return!1;let u=i===t.length,l=r===n.length,d=r===n.length-1&&n[r]==="*";return u&&(l||d)}function p3(){let t=wN||"";return hA(""),t}function vN(t){let e=Object.assign(n,{enabled:fA(t),destroy:m3,log:IN.log,namespace:t,extend:g3});function n(...i){e.enabled&&(i.length>0&&(i[0]=`${t} ${i[0]}`),e.log(...i))}return Qh.push(e),e}function m3(){let t=Qh.indexOf(this);return t>=0?(Qh.splice(t,1),!0):!1}function g3(t){let e=vN(`${this.namespace}:${t}`);return e.log=this.log,e}pA.default=IN});var nu=g(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.TypeSpecRuntimeLogger=void 0;Fi.createLoggerContext=PN;Fi.setLogLevel=y3;Fi.getLogLevel=E3;Fi.createClientLogger=T3;var _3=(un(),At(cn)),tu=_3.__importDefault(bN()),mA=["verbose","info","warning","error"],ON={verbose:400,info:300,warning:200,error:100};function RN(t,e){e.log=(...n)=>{t.log(...n)}}function NN(t){return mA.includes(t)}function PN(t){let e=new Set,n=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,i,r=(0,tu.default)(t.namespace);r.log=(...l)=>{tu.default.log(...l)};function o(l){if(l&&!NN(l))throw new Error(`Unknown log level '${l}'. Acceptable values: ${mA.join(",")}`);i=l;let d=[];for(let f of e)s(f)&&d.push(f.namespace);tu.default.enable(d.join(","))}n&&(NN(n)?o(n):console.error(`${t.logLevelEnvVarName} set to unknown log level '${n}'; logging is not enabled. Acceptable values: ${mA.join(", ")}.`));function s(l){return!!(i&&ON[l.level]<=ON[i])}function a(l,d){let f=Object.assign(l.extend(d),{level:d});if(RN(l,f),s(f)){let m=tu.default.disable();tu.default.enable(m+","+f.namespace)}return e.add(f),f}function c(){return i}function u(l){let d=r.extend(l);return RN(r,d),{error:a(d,"error"),warning:a(d,"warning"),info:a(d,"info"),verbose:a(d,"verbose")}}return{setLogLevel:o,getLogLevel:c,createClientLogger:u,logger:r}}var Zh=PN({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"});Fi.TypeSpecRuntimeLogger=Zh.logger;function y3(t){Zh.setLogLevel(t)}function E3(){return Zh.getLogLevel()}function T3(t){return Zh.createClientLogger(t)}});var DN=g(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.createLoggerContext=void 0;var A3=nu();Object.defineProperty(Jh,"createLoggerContext",{enumerable:!0,get:function(){return A3.createLoggerContext}})});var vo=g(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.AzureLogger=void 0;Io.setLogLevel=S3;Io.getLogLevel=w3;Io.createClientLogger=I3;var C3=DN(),ef=(0,C3.createLoggerContext)({logLevelEnvVarName:"AZURE_LOG_LEVEL",namespace:"azure"});Io.AzureLogger=ef.logger;function S3(t){ef.setLogLevel(t)}function w3(){return ef.getLogLevel()}function I3(t){return ef.createClientLogger(t)}});var He=g(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.logger=void 0;kn.processEnvVars=MN;kn.logEnvVars=b3;kn.formatSuccess=O3;kn.formatError=R3;kn.credentialLoggerInstance=gA;kn.credentialLogger=N3;var v3=vo();kn.logger=(0,v3.createClientLogger)("identity");function MN(t){return t.reduce((e,n)=>(process.env[n]?e.assigned.push(n):e.missing.push(n),e),{missing:[],assigned:[]})}function b3(t,e){let{assigned:n}=MN(e);kn.logger.info(`${t} => Found the following environment variables: ${n.join(", ")}`)}function O3(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}function R3(t,e){let n="ERROR.";return t?.length&&(n+=` Scopes: ${Array.isArray(t)?t.join(", "):t}.`),`${n} Error message: ${typeof e=="string"?e:e.message}.`}function gA(t,e,n=kn.logger){let i=e?`${e.fullTitle} ${t}`:t;function r(c){n.info(`${i} =>`,c)}function o(c){n.warning(`${i} =>`,c)}function s(c){n.verbose(`${i} =>`,c)}function a(c){n.error(`${i} =>`,c)}return{title:t,fullTitle:i,info:r,warning:o,verbose:s,error:a}}function N3(t,e=kn.logger){let n=gA(t,void 0,e);return{...n,parent:e,getToken:gA("=> getToken()",n,e)}}});var _A=g(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.TracingContextImpl=pi.knownContextKeys=void 0;pi.createTracingContext=P3;pi.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function P3(t={}){let e=new tf(t.parentContext);return t.span&&(e=e.setValue(pi.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(pi.knownContextKeys.namespace,t.namespace)),e}var tf=class t{_contextMap;constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,n){let i=new t(this);return i._contextMap.set(e,n),i}getValue(e){return this._contextMap.get(e)}deleteValue(e){let n=new t(this);return n._contextMap.delete(e),n}};pi.TracingContextImpl=tf});var kN=g(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.state=void 0;nf.state={instrumenterImplementation:void 0}});var yA=g(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.createDefaultTracingSpan=LN;Es.createDefaultInstrumenter=UN;Es.useInstrumenter=M3;Es.getInstrumenter=k3;var D3=_A(),rf=kN();function LN(){return{end:()=>{},isRecording:()=>!1,recordException:()=>{},setAttribute:()=>{},setStatus:()=>{},addEvent:()=>{}}}function UN(){return{createRequestHeaders:()=>({}),parseTraceparentHeader:()=>{},startSpan:(t,e)=>({span:LN(),tracingContext:(0,D3.createTracingContext)({parentContext:e.tracingContext})}),withContext(t,e,...n){return e(...n)}}}function M3(t){rf.state.instrumenterImplementation=t}function k3(){return rf.state.instrumenterImplementation||(rf.state.instrumenterImplementation=UN()),rf.state.instrumenterImplementation}});var xN=g(TA=>{"use strict";Object.defineProperty(TA,"__esModule",{value:!0});TA.createTracingClient=L3;var of=yA(),EA=_A();function L3(t){let{namespace:e,packageName:n,packageVersion:i}=t;function r(u,l,d){let f=(0,of.getInstrumenter)().startSpan(u,{...d,packageName:n,packageVersion:i,tracingContext:l?.tracingOptions?.tracingContext}),m=f.tracingContext,_=f.span;m.getValue(EA.knownContextKeys.namespace)||(m=m.setValue(EA.knownContextKeys.namespace,e)),_.setAttribute("az.namespace",m.getValue(EA.knownContextKeys.namespace));let E=Object.assign({},l,{tracingOptions:{...l?.tracingOptions,tracingContext:m}});return{span:_,updatedOptions:E}}async function o(u,l,d,f){let{span:m,updatedOptions:_}=r(u,l,f);try{let E=await s(_.tracingOptions.tracingContext,()=>Promise.resolve(d(_,m)));return m.setStatus({status:"success"}),E}catch(E){throw m.setStatus({status:"error",error:E}),E}finally{m.end()}}function s(u,l,...d){return(0,of.getInstrumenter)().withContext(u,l,...d)}function a(u){return(0,of.getInstrumenter)().parseTraceparentHeader(u)}function c(u){return(0,of.getInstrumenter)().createRequestHeaders(u)}return{startSpan:r,withSpan:o,withContext:s,parseTraceparentHeader:a,createRequestHeaders:c}}});var AA=g(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.createTracingClient=Ts.useInstrumenter=void 0;var U3=yA();Object.defineProperty(Ts,"useInstrumenter",{enumerable:!0,get:function(){return U3.useInstrumenter}});var x3=xN();Object.defineProperty(Ts,"createTracingClient",{enumerable:!0,get:function(){return x3.createTracingClient}})});var Rt=g(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.tracingClient=void 0;var F3=Fr(),q3=AA();sf.tracingClient=(0,q3.createTracingClient)({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:F3.SDK_VERSION})});var SA=g(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.ChainedTokenCredential=mi.logger=void 0;var FN=_t(),af=He(),H3=Rt();mi.logger=(0,af.credentialLogger)("ChainedTokenCredential");var CA=class{_sources=[];constructor(...e){this._sources=e}async getToken(e,n={}){let{token:i}=await this.getTokenInternal(e,n);return i}async getTokenInternal(e,n={}){let i=null,r,o=[];return H3.tracingClient.withSpan("ChainedTokenCredential.getToken",n,async s=>{for(let a=0;a<this._sources.length&&i===null;a++)try{i=await this._sources[a].getToken(e,s),r=this._sources[a]}catch(c){if(c.name==="CredentialUnavailableError"||c.name==="AuthenticationRequiredError")o.push(c);else throw mi.logger.getToken.info((0,af.formatError)(e,c)),c}if(!i&&o.length>0){let a=new FN.AggregateAuthenticationError(o,"ChainedTokenCredential authentication failed.");throw mi.logger.getToken.info((0,af.formatError)(e,a)),a}if(mi.logger.getToken.info(`Result for ${r.constructor.name}: ${(0,af.formatSuccess)(e)}`),i===null)throw new FN.CredentialUnavailableError("Failed to retrieve a valid token");return{token:i,successfulCredential:r}})}};mi.ChainedTokenCredential=CA});import B3 from"crypto";function ru(){return cf>uf.length-16&&(B3.randomFillSync(uf),cf=0),uf.slice(cf,cf+=16)}var uf,cf,wA=xt(()=>{"use strict";uf=new Uint8Array(256),cf=uf.length});var qN,HN=xt(()=>{"use strict";qN=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function j3(t){return typeof t=="string"&&qN.test(t)}var qi,iu=xt(()=>{"use strict";HN();qi=j3});function Y3(t,e=0){let n=(Ft[t[e+0]]+Ft[t[e+1]]+Ft[t[e+2]]+Ft[t[e+3]]+"-"+Ft[t[e+4]]+Ft[t[e+5]]+"-"+Ft[t[e+6]]+Ft[t[e+7]]+"-"+Ft[t[e+8]]+Ft[t[e+9]]+"-"+Ft[t[e+10]]+Ft[t[e+11]]+Ft[t[e+12]]+Ft[t[e+13]]+Ft[t[e+14]]+Ft[t[e+15]]).toLowerCase();if(!qi(n))throw TypeError("Stringified UUID is invalid");return n}var Ft,Hi,ou=xt(()=>{"use strict";iu();Ft=[];for(let t=0;t<256;++t)Ft.push((t+256).toString(16).substr(1));Hi=Y3});function V3(t,e,n){let i=e&&n||0,r=e||new Array(16);t=t||{};let o=t.node||BN,s=t.clockseq!==void 0?t.clockseq:IA;if(o==null||s==null){let f=t.random||(t.rng||ru)();o==null&&(o=BN=[f[0]|1,f[1],f[2],f[3],f[4],f[5]]),s==null&&(s=IA=(f[6]<<8|f[7])&16383)}let a=t.msecs!==void 0?t.msecs:Date.now(),c=t.nsecs!==void 0?t.nsecs:bA+1,u=a-vA+(c-bA)/1e4;if(u<0&&t.clockseq===void 0&&(s=s+1&16383),(u<0||a>vA)&&t.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");vA=a,bA=c,IA=s,a+=122192928e5;let l=((a&268435455)*1e4+c)%4294967296;r[i++]=l>>>24&255,r[i++]=l>>>16&255,r[i++]=l>>>8&255,r[i++]=l&255;let d=a/4294967296*1e4&268435455;r[i++]=d>>>8&255,r[i++]=d&255,r[i++]=d>>>24&15|16,r[i++]=d>>>16&255,r[i++]=s>>>8|128,r[i++]=s&255;for(let f=0;f<6;++f)r[i+f]=o[f];return e||Hi(r)}var BN,IA,vA,bA,jN,YN=xt(()=>{"use strict";wA();ou();vA=0,bA=0;jN=V3});function $3(t){if(!qi(t))throw TypeError("Invalid UUID");let e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}var lf,OA=xt(()=>{"use strict";iu();lf=$3});function z3(t){t=unescape(encodeURIComponent(t));let e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}function df(t,e,n){function i(r,o,s,a){if(typeof r=="string"&&(r=z3(r)),typeof o=="string"&&(o=lf(o)),o.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+r.length);if(c.set(o),c.set(r,o.length),c=n(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,s){a=a||0;for(let u=0;u<16;++u)s[a+u]=c[u];return s}return Hi(c)}try{i.name=t}catch{}return i.DNS=G3,i.URL=W3,i}var G3,W3,RA=xt(()=>{"use strict";ou();OA();G3="6ba7b810-9dad-11d1-80b4-00c04fd430c8",W3="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});import K3 from"crypto";function X3(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),K3.createHash("md5").update(t).digest()}var VN,$N=xt(()=>{"use strict";VN=X3});var Q3,zN,GN=xt(()=>{"use strict";RA();$N();Q3=df("v3",48,VN),zN=Q3});function Z3(t,e,n){t=t||{};let i=t.random||(t.rng||ru)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){n=n||0;for(let r=0;r<16;++r)e[n+r]=i[r];return e}return Hi(i)}var WN,KN=xt(()=>{"use strict";wA();ou();WN=Z3});import J3 from"crypto";function e6(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),J3.createHash("sha1").update(t).digest()}var XN,QN=xt(()=>{"use strict";XN=e6});var t6,ZN,JN=xt(()=>{"use strict";RA();QN();t6=df("v5",80,XN),ZN=t6});var eP,tP=xt(()=>{"use strict";eP="00000000-0000-0000-0000-000000000000"});function n6(t){if(!qi(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}var nP,rP=xt(()=>{"use strict";iu();nP=n6});var iP={};AT(iP,{NIL:()=>eP,parse:()=>lf,stringify:()=>Hi,v1:()=>jN,v3:()=>zN,v4:()=>WN,v5:()=>ZN,validate:()=>qi,version:()=>nP});var oP=xt(()=>{"use strict";YN();GN();KN();JN();tP();rP();iu();ou();OA()});var TC=g(P=>{"use strict";var Y={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},gi={SUCCESS:200,SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR:400,CLIENT_ERROR_RANGE_START:400,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,REQUEST_TIMEOUT:408,GONE:410,TOO_MANY_REQUESTS:429,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR:500,SERVER_ERROR_RANGE_START:500,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,SERVER_ERROR_RANGE_END:599,MULTI_SIDED_ERROR:600},r6={GET:"GET",POST:"POST"},ip=[Y.OPENID_SCOPE,Y.PROFILE_SCOPE,Y.OFFLINE_ACCESS_SCOPE],sP=[...ip,Y.EMAIL_SCOPE],Nt={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},i6={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},_i={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},su={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},hf={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},o6={PLAIN:"plain",S256:"S256"},s6={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},a6={QUERY:"query",FRAGMENT:"fragment"},hP={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},GA={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},au={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",MSAV1_ACCOUNT_TYPE:"MSA",GENERIC_ACCOUNT_TYPE:"Generic"},lu={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},Ht={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},c6={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},WA="appmetadata",u6="client_info",du="1",gf={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},Ln={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},qt={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},Bt={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},Cs={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},DA={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},KA={username:"username",password:"password"},As={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},NA={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},Bi={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},l6={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},d6=864e5,fP=300,h6={BASE64:"base64",HEX:"hex",UTF8:"utf-8"},_f="unexpected_error",yf="post_request_failed",f6=Object.freeze({__proto__:null,postRequestFailed:yf,unexpectedError:_f}),Ef={[_f]:"Unexpected error in authentication.",[yf]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."},p6={unexpectedError:{code:_f,desc:Ef[_f]},postRequestFailed:{code:yf,desc:Ef[yf]}},ln=class t extends Error{constructor(e,n,i){let r=n?`${e}: ${n}`:e;super(r),Object.setPrototypeOf(this,t.prototype),this.errorCode=e||Y.EMPTY_STRING,this.errorMessage=n||Y.EMPTY_STRING,this.subError=i||Y.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}};function m6(t,e){return new ln(t,e?`${Ef[t]} ${e}`:Ef[t])}var vs="client_info_decoding_error",hu="client_info_empty_error",bs="token_parsing_error",fu="null_or_empty_token",Kn="endpoints_resolution_error",pu="network_error",mu="openid_config_error",gu="hash_not_deserialized",Yi="invalid_state",_u="state_mismatch",Os="state_not_found",yu="nonce_mismatch",Rs="auth_time_not_found",Eu="max_age_transpired",Tf="multiple_matching_tokens",Af="multiple_matching_accounts",Tu="multiple_matching_appMetadata",Au="request_cannot_be_made",Cu="cannot_remove_empty_scope",Su="cannot_append_scopeset",Ns="empty_input_scopeset",Cf="device_code_polling_cancelled",Sf="device_code_expired",wf="device_code_unknown_error",Ps="no_account_in_silent_request",wu="invalid_cache_record",Ds="invalid_cache_environment",If="no_account_found",Ms="no_crypto_object",vf="unexpected_credential_type",bf="invalid_assertion",Of="invalid_client_credential",bo="token_refresh_required",Rf="user_timeout_reached",Iu="token_claims_cnf_required_for_signedjwt",vu="authorization_code_missing_from_server_response",Nf="binding_key_not_removed",bu="end_session_endpoint_not_supported",Ou="key_id_missing",Pf="no_network_connectivity",Df="user_canceled",Mf="missing_tenant_id_error",Te="method_not_implemented",kf="nested_app_auth_bridge_disabled",Lf="platform_broker_error",g6=Object.freeze({__proto__:null,authTimeNotFound:Rs,authorizationCodeMissingFromServerResponse:vu,bindingKeyNotRemoved:Nf,cannotAppendScopeSet:Su,cannotRemoveEmptyScope:Cu,clientInfoDecodingError:vs,clientInfoEmptyError:hu,deviceCodeExpired:Sf,deviceCodePollingCancelled:Cf,deviceCodeUnknownError:wf,emptyInputScopeSet:Ns,endSessionEndpointNotSupported:bu,endpointResolutionError:Kn,hashNotDeserialized:gu,invalidAssertion:bf,invalidCacheEnvironment:Ds,invalidCacheRecord:wu,invalidClientCredential:Of,invalidState:Yi,keyIdMissing:Ou,maxAgeTranspired:Eu,methodNotImplemented:Te,missingTenantIdError:Mf,multipleMatchingAccounts:Af,multipleMatchingAppMetadata:Tu,multipleMatchingTokens:Tf,nestedAppAuthBridgeDisabled:kf,networkError:pu,noAccountFound:If,noAccountInSilentRequest:Ps,noCryptoObject:Ms,noNetworkConnectivity:Pf,nonceMismatch:yu,nullOrEmptyToken:fu,openIdConfigError:mu,platformBrokerError:Lf,requestCannotBeMade:Au,stateMismatch:_u,stateNotFound:Os,tokenClaimsCnfRequiredForSignedJwt:Iu,tokenParsingError:bs,tokenRefreshRequired:bo,unexpectedCredentialType:vf,userCanceled:Df,userTimeoutReached:Rf}),de={[vs]:"The client info could not be parsed/decoded correctly",[hu]:"The client info was empty",[bs]:"Token cannot be parsed",[fu]:"The token is null or empty",[Kn]:"Endpoints cannot be resolved",[pu]:"Network request failed",[mu]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[gu]:"The hash parameters could not be deserialized",[Yi]:"State was not the expected format",[_u]:"State mismatch error",[Os]:"State not found",[yu]:"Nonce mismatch error",[Rs]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[Eu]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[Tf]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[Af]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[Tu]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[Au]:"Token request cannot be made without authorization code or refresh token.",[Cu]:"Cannot remove null or empty scope from ScopeSet",[Su]:"Cannot append ScopeSet",[Ns]:"Empty input ScopeSet cannot be processed",[Cf]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[Sf]:"Device code is expired.",[wf]:"Device code stopped polling for unknown reasons.",[Ps]:"Please pass an account object, silent flow is not supported without account information",[wu]:"Cache record object was null or undefined.",[Ds]:"Invalid environment when attempting to create cache entry",[If]:"No account found in cache for given key.",[Ms]:"No crypto object detected.",[vf]:"Unexpected credential type.",[bf]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[Of]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[bo]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[Rf]:"User defined timeout for device code polling reached",[Iu]:"Cannot generate a POP jwt if the token_claims are not populated",[vu]:"Server response does not contain an authorization code to proceed",[Nf]:"Could not remove the credential's binding key from storage.",[bu]:"The provided authority does not support logout",[Ou]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[Pf]:"No network connectivity. Check your internet connection.",[Df]:"User cancelled the flow.",[Mf]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[Te]:"This method has not been implemented",[kf]:"The nested app auth bridge is disabled",[Lf]:"An error occurred in the native broker. See the platformBrokerError property for details."},_6={clientInfoDecodingError:{code:vs,desc:de[vs]},clientInfoEmptyError:{code:hu,desc:de[hu]},tokenParsingError:{code:bs,desc:de[bs]},nullOrEmptyToken:{code:fu,desc:de[fu]},endpointResolutionError:{code:Kn,desc:de[Kn]},networkError:{code:pu,desc:de[pu]},unableToGetOpenidConfigError:{code:mu,desc:de[mu]},hashNotDeserialized:{code:gu,desc:de[gu]},invalidStateError:{code:Yi,desc:de[Yi]},stateMismatchError:{code:_u,desc:de[_u]},stateNotFoundError:{code:Os,desc:de[Os]},nonceMismatchError:{code:yu,desc:de[yu]},authTimeNotFoundError:{code:Rs,desc:de[Rs]},maxAgeTranspired:{code:Eu,desc:de[Eu]},multipleMatchingTokens:{code:Tf,desc:de[Tf]},multipleMatchingAccounts:{code:Af,desc:de[Af]},multipleMatchingAppMetadata:{code:Tu,desc:de[Tu]},tokenRequestCannotBeMade:{code:Au,desc:de[Au]},removeEmptyScopeError:{code:Cu,desc:de[Cu]},appendScopeSetError:{code:Su,desc:de[Su]},emptyInputScopeSetError:{code:Ns,desc:de[Ns]},DeviceCodePollingCancelled:{code:Cf,desc:de[Cf]},DeviceCodeExpired:{code:Sf,desc:de[Sf]},DeviceCodeUnknownError:{code:wf,desc:de[wf]},NoAccountInSilentRequest:{code:Ps,desc:de[Ps]},invalidCacheRecord:{code:wu,desc:de[wu]},invalidCacheEnvironment:{code:Ds,desc:de[Ds]},noAccountFound:{code:If,desc:de[If]},noCryptoObj:{code:Ms,desc:de[Ms]},unexpectedCredentialType:{code:vf,desc:de[vf]},invalidAssertion:{code:bf,desc:de[bf]},invalidClientCredential:{code:Of,desc:de[Of]},tokenRefreshRequired:{code:bo,desc:de[bo]},userTimeoutReached:{code:Rf,desc:de[Rf]},tokenClaimsRequired:{code:Iu,desc:de[Iu]},noAuthorizationCodeFromServer:{code:vu,desc:de[vu]},bindingKeyNotRemovedError:{code:Nf,desc:de[Nf]},logoutNotSupported:{code:bu,desc:de[bu]},keyIdMissing:{code:Ou,desc:de[Ou]},noNetworkConnectivity:{code:Pf,desc:de[Pf]},userCanceledError:{code:Df,desc:de[Df]},missingTenantIdError:{code:Mf,desc:de[Mf]},nestedAppAuthBridgeDisabled:{code:kf,desc:de[kf]},platformBrokerError:{code:Lf,desc:de[Lf]}},Uf=class t extends ln{constructor(e,n){super(e,n?`${de[e]}: ${n}`:de[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function V(t,e){return new Uf(t,e)}function zu(t,e){let n=mP(t);try{let i=e(n);return JSON.parse(i)}catch{throw V(bs)}}function pP(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(i=>e.includes(i.trim().toLowerCase()))}function mP(t){if(!t)throw V(fu);let n=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!n||n.length<4)throw V(bs);return n[2]}function XA(t,e){if(e===0||Date.now()-3e5>t+e)throw V(Eu)}var y6=Object.freeze({__proto__:null,checkMaxAge:XA,extractTokenClaims:zu,getJWSPayload:mP,isKmsi:pP}),Tr={Default:0,Adfs:1,Dsts:2,Ciam:3};function E6(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}var Ru="redirect_uri_empty",xf="claims_request_parsing_error",Nu="authority_uri_insecure",ji="url_parse_error",Pu="empty_url_error",Du="empty_input_scopes_error",ks="invalid_claims",Mu="token_request_empty",ku="logout_request_empty",Ff="invalid_code_challenge_method",Lu="pkce_params_missing",Ls="invalid_cloud_discovery_metadata",Uu="invalid_authority_metadata",xu="untrusted_authority",Us="missing_ssh_jwk",qf="missing_ssh_kid",Fu="missing_nonce_authentication_header",xs="invalid_authentication_header",Hf="cannot_set_OIDCOptions",Bf="cannot_allow_platform_broker",jf="authority_mismatch",Yf="invalid_request_method_for_EAR",Vf="invalid_authorize_post_body_parameters",$f="invalid_platform_broker_configuration",T6=Object.freeze({__proto__:null,authorityMismatch:jf,authorityUriInsecure:Nu,cannotAllowPlatformBroker:Bf,cannotSetOIDCOptions:Hf,claimsRequestParsingError:xf,emptyInputScopesError:Du,invalidAuthenticationHeader:xs,invalidAuthorityMetadata:Uu,invalidAuthorizePostBodyParameters:Vf,invalidClaims:ks,invalidCloudDiscoveryMetadata:Ls,invalidCodeChallengeMethod:Ff,invalidPlatformBrokerConfiguration:$f,invalidRequestMethodForEAR:Yf,logoutRequestEmpty:ku,missingNonceAuthenticationHeader:Fu,missingSshJwk:Us,missingSshKid:qf,pkceParamsMissing:Lu,redirectUriEmpty:Ru,tokenRequestEmpty:Mu,untrustedAuthority:xu,urlEmptyError:Pu,urlParseError:ji}),Xe={[Ru]:"A redirect URI is required for all calls, and none has been set.",[xf]:"Could not parse the given claims request object.",[Nu]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[ji]:"URL could not be parsed into appropriate segments.",[Pu]:"URL was empty or null.",[Du]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[ks]:"Given claims parameter must be a stringified JSON object.",[Mu]:"Token request was empty and not found in cache.",[ku]:"The logout request was null or undefined.",[Ff]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[Lu]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[Ls]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[Uu]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[xu]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[Us]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[qf]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[Fu]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[xs]:"Invalid authentication header provided",[Hf]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[Bf]:"Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",[jf]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",[Vf]:"Invalid authorize post body parameters provided. If you are using authorizePostBodyParameters, the request method must be POST. Please check the request method and parameters.",[Yf]:"Invalid request method for EAR protocol mode. The request method cannot be GET when using EAR protocol mode. Please change the request method to POST.",[$f]:"Invalid platform broker configuration. `allowPlatformBrokerWithDOM` can only be enabled when `allowPlatformBroker` is enabled."},A6={redirectUriNotSet:{code:Ru,desc:Xe[Ru]},claimsRequestParsingError:{code:xf,desc:Xe[xf]},authorityUriInsecure:{code:Nu,desc:Xe[Nu]},urlParseError:{code:ji,desc:Xe[ji]},urlEmptyError:{code:Pu,desc:Xe[Pu]},emptyScopesError:{code:Du,desc:Xe[Du]},invalidClaimsRequest:{code:ks,desc:Xe[ks]},tokenRequestEmptyError:{code:Mu,desc:Xe[Mu]},logoutRequestEmptyError:{code:ku,desc:Xe[ku]},invalidCodeChallengeMethod:{code:Ff,desc:Xe[Ff]},invalidCodeChallengeParams:{code:Lu,desc:Xe[Lu]},invalidCloudDiscoveryMetadata:{code:Ls,desc:Xe[Ls]},invalidAuthorityMetadata:{code:Uu,desc:Xe[Uu]},untrustedAuthority:{code:xu,desc:Xe[xu]},missingSshJwk:{code:Us,desc:Xe[Us]},missingSshKid:{code:qf,desc:Xe[qf]},missingNonceAuthenticationHeader:{code:Fu,desc:Xe[Fu]},invalidAuthenticationHeader:{code:xs,desc:Xe[xs]},cannotSetOIDCOptions:{code:Hf,desc:Xe[Hf]},cannotAllowPlatformBroker:{code:Bf,desc:Xe[Bf]},authorityMismatch:{code:jf,desc:Xe[jf]},invalidAuthorizePostBodyParameters:{code:Vf,desc:Xe[Vf]},invalidRequestMethodForEAR:{code:Yf,desc:Xe[Yf]},invalidPlatformBrokerConfiguration:{code:$f,desc:Xe[$f]}},zf=class t extends ln{constructor(e){super(e,Xe[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function st(t){return new zf(t)}var In=class{static isEmptyObj(e){if(e)try{let n=JSON.parse(e);return Object.keys(n).length===0}catch{}return!0}static startsWith(e,n){return e.indexOf(n)===0}static endsWith(e,n){return e.length>=n.length&&e.lastIndexOf(n)===e.length-n.length}static queryStringToObject(e){let n={},i=e.split("&"),r=o=>decodeURIComponent(o.replace(/\+/g," "));return i.forEach(o=>{if(o.trim()){let[s,a]=o.split(/=(.+)/g,2);s&&a&&(n[r(s)]=r(a))}}),n}static trimArrayEntries(e){return e.map(n=>n.trim())}static removeEmptyStringsFromArray(e){return e.filter(n=>!!n)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,n){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(n)}};function aP(t){if(!t)return t;let e=t.toLowerCase();return In.endsWith(e,"?")?e=e.slice(0,-1):In.endsWith(e,"?/")&&(e=e.slice(0,-2)),In.endsWith(e,"/")||(e+="/"),e}function gP(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function _P(t){if(!t||t.indexOf("=")<0)return null;try{let e=gP(t),n=Object.fromEntries(new URLSearchParams(e));if(n.code||n.ear_jwe||n.error||n.error_description||n.state)return n}catch{throw V(gu)}return null}function Fs(t,e=!0,n){let i=new Array;return t.forEach((r,o)=>{!e&&n&&o in n?i.push(`${o}=${r}`):i.push(`${o}=${encodeURIComponent(r)}`)}),i.join("&")}function C6(t){if(!t)return t;let e=t.split("#")[0];try{let n=new URL(e),i=n.origin+n.pathname+n.search;return aP(i)}catch{return aP(e)}}var S6=Object.freeze({__proto__:null,getDeserializedResponse:_P,mapToQueryString:Fs,normalizeUrlForComparison:C6,stripLeadingHashOrQuery:gP}),Pt=class t{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw st(Pu);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let n=e.toLowerCase();return In.endsWith(n,"?")?n=n.slice(0,-1):In.endsWith(n,"?/")&&(n=n.slice(0,-2)),In.endsWith(n,"/")||(n+="/"),n}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw st(ji)}if(!e.HostNameAndPort||!e.PathSegments)throw st(ji);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw st(Nu)}static appendQueryString(e,n){return n?e.indexOf("?")<0?`${e}?${n}`:`${e}&${n}`:e}static removeHashFromUrl(e){return t.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){let n=this.getUrlComponents(),i=n.PathSegments;return e&&i.length!==0&&(i[0]===_i.COMMON||i[0]===_i.ORGANIZATIONS)&&(i[0]=e),t.constructAuthorityUriFromObject(n)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=this.urlString.match(e);if(!n)throw st(ji);let i={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5],QueryString:n[7]},r=i.AbsolutePath.split("/");return r=r.filter(o=>o&&o.length>0),i.PathSegments=r,i.QueryString&&i.QueryString.endsWith("/")&&(i.QueryString=i.QueryString.substring(0,i.QueryString.length-1)),i}static getDomainFromUrl(e){let n=RegExp("^([^:/?#]+://)?([^/?#]*)"),i=e.match(n);if(!i)throw st(ji);return i[2]}static getAbsoluteUrl(e,n){if(e[0]===Y.FORWARD_SLASH){let r=new t(n).getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!_P(e)}},yP={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},cP=yP.endpointMetadata,QA=yP.instanceDiscoveryMetadata,EP=new Set;QA.metadata.forEach(t=>{t.aliases.forEach(e=>{EP.add(e)})});function w6(t,e){let n,i=t.canonicalAuthority;if(i){let r=new Pt(i).getUrlComponents().HostNameAndPort;n=uP(r,t.cloudDiscoveryMetadata?.metadata,Ln.CONFIG,e)||uP(r,QA.metadata,Ln.HARDCODED_VALUES,e)||t.knownAuthorities}return n||[]}function uP(t,e,n,i){if(i?.trace(`getAliasesFromMetadata called with source: ${n}`),t&&e){let r=Gf(e,t);if(r)return i?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${n}, returning aliases`),r.aliases;i?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${n}`)}return null}function I6(t){return Gf(QA.metadata,t)}function Gf(t,e){for(let n=0;n<t.length;n++){let i=t[n];if(i.aliases.includes(e))return i}return null}var qu={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"},ZA={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};function v6(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}function b6(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}var O={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",NetworkClientSendPostRequestAsync:"networkClientSendPostRequestAsync",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",InitializeCache:"initializeCache",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",GetAuthCodeUrl:"getAuthCodeUrl",GetStandardParams:"getStandardParams",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",HandleResponseEar:"handleResponseEar",HandleResponsePlatformBroker:"handleResponsePlatformBroker",HandleResponseCode:"handleResponseCode",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",ImportExistingCache:"importExistingCache",SetUserData:"setUserData",LocalStorageUpdated:"localStorageUpdated",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues",GenerateHKDF:"generateHKDF",GenerateBaseKey:"generateBaseKey",Base64Decode:"base64Decode",UrlEncodeArr:"urlEncodeArr",Encrypt:"encrypt",Decrypt:"decrypt",GenerateEarKey:"generateEarKey",DecryptEarResponse:"decryptEarResponse"},O6=new Map([[O.AcquireTokenByCode,"ATByCode"],[O.AcquireTokenByRefreshToken,"ATByRT"],[O.AcquireTokenSilent,"ATS"],[O.AcquireTokenSilentAsync,"ATSAsync"],[O.AcquireTokenPopup,"ATPopup"],[O.AcquireTokenRedirect,"ATRedirect"],[O.CryptoOptsGetPublicKeyThumbprint,"CryptoGetPKThumb"],[O.CryptoOptsSignJwt,"CryptoSignJwt"],[O.SilentCacheClientAcquireToken,"SltCacheClientAT"],[O.SilentIframeClientAcquireToken,"SltIframeClientAT"],[O.SilentRefreshClientAcquireToken,"SltRClientAT"],[O.SsoSilent,"SsoSlt"],[O.StandardInteractionClientGetDiscoveredAuthority,"StdIntClientGetDiscAuth"],[O.FetchAccountIdWithNativeBroker,"FetchAccIdWithNtvBroker"],[O.NativeInteractionClientAcquireToken,"NtvIntClientAT"],[O.BaseClientCreateTokenRequestHeaders,"BaseClientCreateTReqHead"],[O.NetworkClientSendPostRequestAsync,"NetClientSendPost"],[O.RefreshTokenClientExecutePostToTokenEndpoint,"RTClientExecPost"],[O.AuthorizationCodeClientExecutePostToTokenEndpoint,"AuthCodeClientExecPost"],[O.BrokerHandhshake,"BrokerHandshake"],[O.AcquireTokenByRefreshTokenInBroker,"ATByRTInBroker"],[O.AcquireTokenByBroker,"ATByBroker"],[O.RefreshTokenClientExecuteTokenRequest,"RTClientExecTReq"],[O.RefreshTokenClientAcquireToken,"RTClientAT"],[O.RefreshTokenClientAcquireTokenWithCachedRefreshToken,"RTClientATWithCachedRT"],[O.RefreshTokenClientAcquireTokenByRefreshToken,"RTClientATByRT"],[O.RefreshTokenClientCreateTokenRequestBody,"RTClientCreateTReqBody"],[O.AcquireTokenFromCache,"ATFromCache"],[O.SilentFlowClientAcquireCachedToken,"SltFlowClientATCached"],[O.SilentFlowClientGenerateResultFromCacheRecord,"SltFlowClientGenResFromCache"],[O.AcquireTokenBySilentIframe,"ATBySltIframe"],[O.InitializeBaseRequest,"InitBaseReq"],[O.InitializeSilentRequest,"InitSltReq"],[O.InitializeClientApplication,"InitClientApplication"],[O.InitializeCache,"InitCache"],[O.ImportExistingCache,"importCache"],[O.SetUserData,"setUserData"],[O.LocalStorageUpdated,"localStorageUpdated"],[O.SilentIframeClientTokenHelper,"SIClientTHelper"],[O.SilentHandlerInitiateAuthRequest,"SHandlerInitAuthReq"],[O.SilentHandlerMonitorIframeForHash,"SltHandlerMonitorIframeForHash"],[O.SilentHandlerLoadFrame,"SHandlerLoadFrame"],[O.SilentHandlerLoadFrameSync,"SHandlerLoadFrameSync"],[O.StandardInteractionClientCreateAuthCodeClient,"StdIntClientCreateAuthCodeClient"],[O.StandardInteractionClientGetClientConfiguration,"StdIntClientGetClientConf"],[O.StandardInteractionClientInitializeAuthorizationRequest,"StdIntClientInitAuthReq"],[O.GetAuthCodeUrl,"GetAuthCodeUrl"],[O.HandleCodeResponseFromServer,"HandleCodeResFromServer"],[O.HandleCodeResponse,"HandleCodeResp"],[O.HandleResponseEar,"HandleRespEar"],[O.HandleResponseCode,"HandleRespCode"],[O.HandleResponsePlatformBroker,"HandleRespPlatBroker"],[O.UpdateTokenEndpointAuthority,"UpdTEndpointAuth"],[O.AuthClientAcquireToken,"AuthClientAT"],[O.AuthClientExecuteTokenRequest,"AuthClientExecTReq"],[O.AuthClientCreateTokenRequestBody,"AuthClientCreateTReqBody"],[O.PopTokenGenerateCnf,"PopTGenCnf"],[O.PopTokenGenerateKid,"PopTGenKid"],[O.HandleServerTokenResponse,"HandleServerTRes"],[O.DeserializeResponse,"DeserializeRes"],[O.AuthorityFactoryCreateDiscoveredInstance,"AuthFactCreateDiscInst"],[O.AuthorityResolveEndpointsAsync,"AuthResolveEndpointsAsync"],[O.AuthorityResolveEndpointsFromLocalSources,"AuthResolveEndpointsFromLocal"],[O.AuthorityGetCloudDiscoveryMetadataFromNetwork,"AuthGetCDMetaFromNet"],[O.AuthorityUpdateCloudDiscoveryMetadata,"AuthUpdCDMeta"],[O.AuthorityGetEndpointMetadataFromNetwork,"AuthUpdCDMetaFromNet"],[O.AuthorityUpdateEndpointMetadata,"AuthUpdEndpointMeta"],[O.AuthorityUpdateMetadataWithRegionalInformation,"AuthUpdMetaWithRegInfo"],[O.RegionDiscoveryDetectRegion,"RegDiscDetectReg"],[O.RegionDiscoveryGetRegionFromIMDS,"RegDiscGetRegFromIMDS"],[O.RegionDiscoveryGetCurrentVersion,"RegDiscGetCurrentVer"],[O.AcquireTokenByCodeAsync,"ATByCodeAsync"],[O.GetEndpointMetadataFromNetwork,"GetEndpointMetaFromNet"],[O.GetCloudDiscoveryMetadataFromNetworkMeasurement,"GetCDMetaFromNet"],[O.HandleRedirectPromiseMeasurement,"HandleRedirectPromise"],[O.HandleNativeRedirectPromiseMeasurement,"HandleNtvRedirectPromise"],[O.UpdateCloudDiscoveryMetadataMeasurement,"UpdateCDMeta"],[O.UsernamePasswordClientAcquireToken,"UserPassClientAT"],[O.NativeMessageHandlerHandshake,"NtvMsgHandlerHandshake"],[O.NativeGenerateAuthResult,"NtvGenAuthRes"],[O.RemoveHiddenIframe,"RemoveHiddenIframe"],[O.ClearTokensAndKeysWithClaims,"ClearTAndKeysWithClaims"],[O.CacheManagerGetRefreshToken,"CacheManagerGetRT"],[O.GeneratePkceCodes,"GenPkceCodes"],[O.GenerateCodeVerifier,"GenCodeVerifier"],[O.GenerateCodeChallengeFromVerifier,"GenCodeChallengeFromVerifier"],[O.Sha256Digest,"Sha256Digest"],[O.GetRandomValues,"GetRandomValues"],[O.GenerateHKDF,"genHKDF"],[O.GenerateBaseKey,"genBaseKey"],[O.Base64Decode,"b64Decode"],[O.UrlEncodeArr,"urlEncArr"],[O.Encrypt,"encrypt"],[O.Decrypt,"decrypt"],[O.GenerateEarKey,"genEarKey"],[O.DecryptEarResponse,"decryptEarResp"]]),TP={NotStarted:0,InProgress:1,Completed:2},R6=new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","queuedTimeMs","startTimeMs","status","multiMatchedAT","multiMatchedID","multiMatchedRT","unencryptedCacheCount","encryptedCacheExpiredCount","oldAccountCount","oldAccessCount","oldIdCount","oldRefreshCount","currAccountCount","currAccessCount","currIdCount","currRefreshCount","expiredCacheRemovedCount","upgradedCacheCount"]),AP=(t,e,n,i,r)=>(...o)=>{n.trace(`Executing function ${e}`);let s=i?.startMeasurement(e,r);if(r){let a=e+"CallCount";i?.incrementFields({[a]:1},r)}try{let a=t(...o);return s?.end({success:!0}),n.trace(`Returning result from ${e}`),a}catch(a){n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(a))}catch{n.trace("Unable to print error message.")}throw s?.end({success:!1},a),a}},Be=(t,e,n,i,r)=>(...o)=>{n.trace(`Executing function ${e}`);let s=i?.startMeasurement(e,r);if(r){let a=e+"CallCount";i?.incrementFields({[a]:1},r)}return i?.setPreQueueTime(e,r),t(...o).then(a=>(n.trace(`Returning result from ${e}`),s?.end({success:!0}),a)).catch(a=>{n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(a))}catch{n.trace("Unable to print error message.")}throw s?.end({success:!1},a),a})},Wf=class t{constructor(e,n,i,r){this.networkInterface=e,this.logger=n,this.performanceClient=i,this.correlationId=r}async detectRegion(e,n){this.performanceClient?.addQueueMeasurement(O.RegionDiscoveryDetectRegion,this.correlationId);let i=e;if(i)n.region_source=As.ENVIRONMENT_VARIABLE;else{let r=t.IMDS_OPTIONS;try{let o=await Be(this.getRegionFromIMDS.bind(this),O.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(Y.IMDS_VERSION,r);if(o.status===gi.SUCCESS&&(i=o.body,n.region_source=As.IMDS),o.status===gi.BAD_REQUEST){let s=await Be(this.getCurrentVersion.bind(this),O.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(r);if(!s)return n.region_source=As.FAILED_AUTO_DETECTION,null;let a=await Be(this.getRegionFromIMDS.bind(this),O.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(s,r);a.status===gi.SUCCESS&&(i=a.body,n.region_source=As.IMDS)}}catch{return n.region_source=As.FAILED_AUTO_DETECTION,null}}return i||(n.region_source=As.FAILED_AUTO_DETECTION),i||null}async getRegionFromIMDS(e,n){return this.performanceClient?.addQueueMeasurement(O.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${Y.IMDS_ENDPOINT}?api-version=${e}&format=text`,n,Y.IMDS_TIMEOUT)}async getCurrentVersion(e){this.performanceClient?.addQueueMeasurement(O.RegionDiscoveryGetCurrentVersion,this.correlationId);try{let n=await this.networkInterface.sendGetRequestAsync(`${Y.IMDS_ENDPOINT}?format=json`,e);return n.status===gi.BAD_REQUEST&&n.body&&n.body["newest-versions"]&&n.body["newest-versions"].length>0?n.body["newest-versions"][0]:null}catch{return null}}};Wf.IMDS_OPTIONS={headers:{Metadata:"true"}};function Ei(){return Math.round(new Date().getTime()/1e3)}function N6(t){return t.getTime()/1e3}function ff(t){return t?new Date(Number(t)*1e3):new Date}function Kf(t,e){let n=Number(t)||0;return Ei()+e>n}function P6(t,e){let n=Number(t)+e*24*60*60*1e3;return Date.now()>n}function CP(t){return Number(t)>Ei()}function D6(t,e){return new Promise(n=>setTimeout(()=>n(e),t))}var M6=Object.freeze({__proto__:null,delay:D6,isCacheExpired:P6,isTokenExpired:Kf,nowSeconds:Ei,toDateFromSeconds:ff,toSecondsFromDate:N6,wasClockTurnedBack:CP});function SP(t,e,n,i,r){return{credentialType:Ht.ID_TOKEN,homeAccountId:t,environment:e,clientId:i,secret:n,realm:r,lastUpdatedAt:Date.now().toString()}}function wP(t,e,n,i,r,o,s,a,c,u,l,d,f,m,_){let E={homeAccountId:t,credentialType:Ht.ACCESS_TOKEN,secret:n,cachedAt:Ei().toString(),expiresOn:s.toString(),extendedExpiresOn:a.toString(),environment:e,clientId:i,realm:r,target:o,tokenType:l||Bt.BEARER,lastUpdatedAt:Date.now().toString()};if(d&&(E.userAssertionHash=d),u&&(E.refreshOn=u.toString()),m&&(E.requestedClaims=m,E.requestedClaimsHash=_),E.tokenType?.toLowerCase()!==Bt.BEARER.toLowerCase())switch(E.credentialType=Ht.ACCESS_TOKEN_WITH_AUTH_SCHEME,E.tokenType){case Bt.POP:let I=zu(n,c);if(!I?.cnf?.kid)throw V(Iu);E.keyId=I.cnf.kid;break;case Bt.SSH:E.keyId=f}return E}function IP(t,e,n,i,r,o,s){let a={credentialType:Ht.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:i,secret:n,lastUpdatedAt:Date.now().toString()};return o&&(a.userAssertionHash=o),r&&(a.familyId=r),s&&(a.expiresOn=s.toString()),a}function op(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function k6(t){return t?op(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===Ht.ACCESS_TOKEN||t.credentialType===Ht.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function L6(t){return t?op(t)&&t.hasOwnProperty("realm")&&t.credentialType===Ht.ID_TOKEN:!1}function U6(t){return t?op(t)&&t.credentialType===Ht.REFRESH_TOKEN:!1}function x6(t,e){let n=t.indexOf(qt.CACHE_KEY)===0,i=!0;return e&&(i=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),n&&i}function F6(t,e){let n=!1;t&&(n=t.indexOf(Cs.THROTTLING_PREFIX)===0);let i=!0;return e&&(i=e.hasOwnProperty("throttleTime")),n&&i}function q6({environment:t,clientId:e}){return[WA,t,e].join(lu.CACHE_KEY_SEPARATOR).toLowerCase()}function H6(t,e){return e?t.indexOf(WA)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function B6(t,e){return e?t.indexOf(gf.CACHE_KEY)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function MA(){return Ei()+gf.REFRESH_TIME_SECONDS}function cu(t,e,n){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=n,t.jwks_uri=e.jwks_uri}function pf(t,e,n){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=n}function kA(t){return t.expiresAt<=Ei()}var j6=Object.freeze({__proto__:null,createAccessTokenEntity:wP,createIdTokenEntity:SP,createRefreshTokenEntity:IP,generateAppMetadataKey:q6,generateAuthorityMetadataExpiresAt:MA,isAccessTokenEntity:k6,isAppMetadataEntity:H6,isAuthorityMetadataEntity:B6,isAuthorityMetadataExpired:kA,isCredentialEntity:op,isIdTokenEntity:L6,isRefreshTokenEntity:U6,isServerTelemetryEntity:x6,isThrottlingEntity:F6,updateAuthorityEndpointMetadata:cu,updateCloudDiscoveryMetadata:pf}),qs=class t{constructor(e,n,i,r,o,s,a,c){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=n,this.cacheManager=i,this.authorityOptions=r,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=o,this.performanceClient=a,this.correlationId=s,this.managedIdentity=c||!1,this.regionDiscovery=new Wf(n,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(Y.CIAM_AUTH_URL))return Tr.Ciam;let n=e.PathSegments;if(n.length)switch(n[0].toLowerCase()){case Y.ADFS:return Tr.Adfs;case Y.DSTS:return Tr.Dsts}return Tr.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new Pt(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw V(Kn)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw V(Kn)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw V(Kn)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw V(bu);return this.replacePath(this.metadata.end_session_endpoint)}else throw V(Kn)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw V(Kn)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw V(Kn)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Tr.Default&&this.protocolMode!==qu.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let n=e,r=new Pt(this.metadata.canonical_authority).getUrlComponents(),o=r.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((a,c)=>{let u=o[c];if(c===0&&this.canReplaceTenant(r)){let l=new Pt(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];u!==l&&(this.logger.verbose(`Replacing tenant domain name ${u} with id ${l}`),u=l)}a!==u&&(n=n.replace(`/${u}/`,`/${a}/`))}),this.replaceTenant(n)}get defaultOpenIdConfigurationEndpoint(){let e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Tr.Adfs||this.protocolMode===qu.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){this.performanceClient?.addQueueMeasurement(O.AuthorityResolveEndpointsAsync,this.correlationId);let e=this.getCurrentMetadataEntity(),n=await Be(this.updateCloudDiscoveryMetadata.bind(this),O.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let i=await Be(this.updateEndpointMetadata.bind(this),O.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,n,{source:i}),this.performanceClient?.addFields({cloudDiscoverySource:n,authorityEndpointSource:i},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:MA(),jwks_uri:""}),e}updateCachedMetadata(e,n,i){n!==Ln.CACHE&&i?.source!==Ln.CACHE&&(e.expiresAt=MA(),e.canonical_authority=this.canonicalAuthority);let r=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(r,e),this.metadata=e}async updateEndpointMetadata(e){this.performanceClient?.addQueueMeasurement(O.AuthorityUpdateEndpointMetadata,this.correlationId);let n=this.updateEndpointMetadataFromLocalSources(e);if(n){if(n.source===Ln.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&n.metadata){let r=await Be(this.updateMetadataWithRegionalInformation.bind(this),O.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(n.metadata);cu(e,r,!1),e.canonical_authority=this.canonicalAuthority}return n.source}let i=await Be(this.getEndpointMetadataFromNetwork.bind(this),O.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(i=await Be(this.updateMetadataWithRegionalInformation.bind(this),O.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(i)),cu(e,i,!0),Ln.NETWORK;throw V(mu,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");let n=this.getEndpointMetadataFromConfig();if(n)return this.logger.verbose("Found endpoint metadata in authority configuration"),cu(e,n,!1),{source:Ln.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{let r=this.getEndpointMetadataFromHardcodedValues();if(r)return cu(e,r,!1),{source:Ln.HARDCODED_VALUES,metadata:r};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}let i=kA(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!i?(this.logger.verbose("Found endpoint metadata in the cache."),{source:Ln.CACHE}):(i&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new Pt(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw st(Uu)}return null}async getEndpointMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(O.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);let e={},n=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${n}`);try{let i=await this.networkInterface.sendGetRequestAsync(n,e);return E6(i.body)?i.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(i){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${i}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in cP?cP[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){this.performanceClient?.addQueueMeasurement(O.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);let n=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(n){if(n!==Y.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=NA.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);let i=await Be(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),O.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(i)return this.regionDiscoveryMetadata.region_outcome=NA.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=i,t.replaceWithRegionalInformation(e,i);this.regionDiscoveryMetadata.region_outcome=NA.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){this.performanceClient?.addQueueMeasurement(O.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);let n=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(n)return n;let i=await Be(this.getCloudDiscoveryMetadataFromNetwork.bind(this),O.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return pf(e,i,!0),Ln.NETWORK;throw st(xu)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||Y.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||Y.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||Y.NOT_APPLICABLE}`);let n=this.getCloudDiscoveryMetadataFromConfig();if(n)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),pf(e,n,!1),Ln.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{let r=I6(this.hostnameAndPort);if(r)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),pf(e,r,!1),Ln.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}let i=kA(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!i?(this.logger.verbose("Found cloud discovery metadata in the cache."),Ln.CACHE):(i&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Tr.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");let e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),n=Gf(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),n)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),n;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),st(Ls)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(O.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);let e=`${Y.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,n={},i=null;try{let r=await this.networkInterface.sendGetRequestAsync(e,n),o,s;if(v6(r.body))o=r.body,s=o.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${o.tenant_discovery_endpoint}`);else if(b6(r.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${r.status}`),o=r.body,o.error===Y.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${o.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${o.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),s=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),i=Gf(s,this.hostnameAndPort)}catch(r){if(r instanceof ln)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
|
|
14
|
+
Error: ${r.errorCode}
|
|
15
|
+
Error Description: ${r.errorMessage}`);else{let o=r;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.
|
|
16
|
+
Error: ${o.name}
|
|
17
|
+
Error Description: ${o.message}`)}return null}return i||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),i=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),i}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&Pt.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let i;if(n&&n.azureCloudInstance!==ZA.None){let r=n.tenant?n.tenant:Y.DEFAULT_COMMON_TENANT;i=`${n.azureCloudInstance}/${r}/`}return i||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return Y.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw V(Kn)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return EP.has(e)}static isPublicCloudAuthority(e){return Y.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,i){let r=new Pt(e);r.validateAsUri();let o=r.getUrlComponents(),s=`${n}.${o.HostNameAndPort}`;this.isPublicCloudAuthority(o.HostNameAndPort)&&(s=`${n}.${Y.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);let a=Pt.constructAuthorityUriFromObject({...r.getUrlComponents(),HostNameAndPort:s}).urlString;return i?`${a}?${i}`:a}static replaceWithRegionalInformation(e,n){let i={...e};return i.authorization_endpoint=t.buildRegionalAuthorityString(i.authorization_endpoint,n),i.token_endpoint=t.buildRegionalAuthorityString(i.token_endpoint,n),i.end_session_endpoint&&(i.end_session_endpoint=t.buildRegionalAuthorityString(i.end_session_endpoint,n)),i}static transformCIAMAuthority(e){let n=e,r=new Pt(e).getUrlComponents();if(r.PathSegments.length===0&&r.HostNameAndPort.endsWith(Y.CIAM_AUTH_URL)){let o=r.HostNameAndPort.split(".")[0];n=`${n}${o}${Y.AAD_TENANT_DOMAIN_SUFFIX}`}return n}};qs.reservedTenantDomains=new Set(["{tenant}","{tenantid}",_i.COMMON,_i.CONSUMERS,_i.ORGANIZATIONS]);function Y6(t){let i=new Pt(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(i){case _i.COMMON:case _i.ORGANIZATIONS:case _i.CONSUMERS:return;default:return i}}function JA(t){return t.endsWith(Y.FORWARD_SLASH)?t:`${t}${Y.FORWARD_SLASH}`}function V6(t){let e=t.cloudDiscoveryMetadata,n;if(e)try{n=JSON.parse(e)}catch{throw st(Ls)}return{canonicalAuthority:t.authority?JA(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}async function vP(t,e,n,i,r,o,s){s?.addQueueMeasurement(O.AuthorityFactoryCreateDiscoveredInstance,o);let a=qs.transformCIAMAuthority(JA(t)),c=new qs(a,e,n,i,r,o,s);try{return await Be(c.resolveEndpointsAsync.bind(c),O.AuthorityResolveEndpointsAsync,r,s,o)(),c}catch{throw V(Kn)}}var $6=Object.freeze({__proto__:null,createDiscoveredInstance:vP}),$s="client_id",eC="redirect_uri",bP="response_type",OP="response_mode",RP="grant_type",NP="claims",PP="scope",z6="error",G6="error_description",W6="access_token",K6="id_token",DP="refresh_token",X6="expires_in",Q6="refresh_token_expires_in",MP="state",kP="nonce",LP="prompt",Z6="session_state",J6="client_info",UP="code",xP="code_challenge",FP="code_challenge_method",qP="code_verifier",HP="client-request-id",BP="x-client-SKU",jP="x-client-VER",YP="x-client-OS",VP="x-client-CPU",$P="x-client-current-telemetry",zP="x-client-last-telemetry",GP="x-ms-lib-capability",WP="x-app-name",KP="x-app-ver",XP="post_logout_redirect_uri",QP="id_token_hint",ZP="device_code",JP="client_secret",eD="client_assertion",tD="client_assertion_type",tC="token_type",nC="req_cnf",nD="assertion",rD="requested_token_use",e4="on_behalf_of",t4="foci",n4="X-AnchorMailbox",LA="return_spa_code",iD="nativebroker",oD="logout_hint",sD="sid",aD="login_hint",cD="domain_hint",r4="x-client-xtra-sku",Xf="brk_client_id",UA="brk_redirect_uri",Qf="instance_aware",uD="ear_jwk",lD="ear_jwe_crypto",i4=Object.freeze({__proto__:null,ACCESS_TOKEN:W6,BROKER_CLIENT_ID:Xf,BROKER_REDIRECT_URI:UA,CCS_HEADER:n4,CLAIMS:NP,CLIENT_ASSERTION:eD,CLIENT_ASSERTION_TYPE:tD,CLIENT_ID:$s,CLIENT_INFO:J6,CLIENT_REQUEST_ID:HP,CLIENT_SECRET:JP,CODE:UP,CODE_CHALLENGE:xP,CODE_CHALLENGE_METHOD:FP,CODE_VERIFIER:qP,DEVICE_CODE:ZP,DOMAIN_HINT:cD,EAR_JWE_CRYPTO:lD,EAR_JWK:uD,ERROR:z6,ERROR_DESCRIPTION:G6,EXPIRES_IN:X6,FOCI:t4,GRANT_TYPE:RP,ID_TOKEN:K6,ID_TOKEN_HINT:QP,INSTANCE_AWARE:Qf,LOGIN_HINT:aD,LOGOUT_HINT:oD,NATIVE_BROKER:iD,NONCE:kP,OBO_ASSERTION:nD,ON_BEHALF_OF:e4,POST_LOGOUT_URI:XP,PROMPT:LP,REDIRECT_URI:eC,REFRESH_TOKEN:DP,REFRESH_TOKEN_EXPIRES_IN:Q6,REQUESTED_TOKEN_USE:rD,REQ_CNF:nC,RESPONSE_MODE:OP,RESPONSE_TYPE:bP,RETURN_SPA_CODE:LA,SCOPE:PP,SESSION_STATE:Z6,SID:sD,STATE:MP,TOKEN_TYPE:tC,X_APP_NAME:WP,X_APP_VER:KP,X_CLIENT_CPU:VP,X_CLIENT_CURR_TELEM:$P,X_CLIENT_EXTRA_SKU:r4,X_CLIENT_LAST_TELEM:zP,X_CLIENT_OS:YP,X_CLIENT_SKU:BP,X_CLIENT_VER:jP,X_MS_LIB_CAPABILITY:GP}),xA={createNewGuid:()=>{throw V(Te)},base64Decode:()=>{throw V(Te)},base64Encode:()=>{throw V(Te)},base64UrlEncode:()=>{throw V(Te)},encodeKid:()=>{throw V(Te)},async getPublicKeyThumbprint(){throw V(Te)},async removeTokenBindingKey(){throw V(Te)},async clearKeystore(){throw V(Te)},async signJwt(){throw V(Te)},async hashString(){throw V(Te)}};P.LogLevel=void 0;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(P.LogLevel||(P.LogLevel={}));var Hu=class t{constructor(e,n,i){this.level=P.LogLevel.Info;let r=()=>{},o=e||t.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||r,this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level=typeof o.logLevel=="number"?o.logLevel:P.LogLevel.Info,this.correlationId=o.correlationId||Y.EMPTY_STRING,this.packageName=n||Y.EMPTY_STRING,this.packageVersion=i||Y.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:P.LogLevel.Info}}clone(e,n,i){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:i||this.correlationId},e,n)}logMessage(e,n){if(n.logLevel>this.level||!this.piiLoggingEnabled&&n.containsPii)return;let o=`${`[${new Date().toUTCString()}] : [${n.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${P.LogLevel[n.logLevel]} - ${e}`;this.executeCallback(n.logLevel,o,n.containsPii||!1)}executeCallback(e,n,i){this.localCallback&&this.localCallback(e,n,i)}error(e,n){this.logMessage(e,{logLevel:P.LogLevel.Error,containsPii:!1,correlationId:n||Y.EMPTY_STRING})}errorPii(e,n){this.logMessage(e,{logLevel:P.LogLevel.Error,containsPii:!0,correlationId:n||Y.EMPTY_STRING})}warning(e,n){this.logMessage(e,{logLevel:P.LogLevel.Warning,containsPii:!1,correlationId:n||Y.EMPTY_STRING})}warningPii(e,n){this.logMessage(e,{logLevel:P.LogLevel.Warning,containsPii:!0,correlationId:n||Y.EMPTY_STRING})}info(e,n){this.logMessage(e,{logLevel:P.LogLevel.Info,containsPii:!1,correlationId:n||Y.EMPTY_STRING})}infoPii(e,n){this.logMessage(e,{logLevel:P.LogLevel.Info,containsPii:!0,correlationId:n||Y.EMPTY_STRING})}verbose(e,n){this.logMessage(e,{logLevel:P.LogLevel.Verbose,containsPii:!1,correlationId:n||Y.EMPTY_STRING})}verbosePii(e,n){this.logMessage(e,{logLevel:P.LogLevel.Verbose,containsPii:!0,correlationId:n||Y.EMPTY_STRING})}trace(e,n){this.logMessage(e,{logLevel:P.LogLevel.Trace,containsPii:!1,correlationId:n||Y.EMPTY_STRING})}tracePii(e,n){this.logMessage(e,{logLevel:P.LogLevel.Trace,containsPii:!0,correlationId:n||Y.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}},dD="@azure/msal-common",sp="15.13.3",Ar=class t{constructor(e){let n=e?In.trimArrayEntries([...e]):[],i=n?In.removeEmptyStringsFromArray(n):[];if(!i||!i.length)throw st(Du);this.scopes=new Set,i.forEach(r=>this.scopes.add(r))}static fromString(e){let i=(e||Y.EMPTY_STRING).split(" ");return new t(i)}static createSearchScopes(e){let n=e&&e.length>0?e:[...ip],i=new t(n);return i.containsOnlyOIDCScopes()?i.removeScope(Y.OFFLINE_ACCESS_SCOPE):i.removeOIDCScopes(),i}containsScope(e){let n=this.printScopesLowerCase().split(" "),i=new t(n);return e?i.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(n=>this.containsScope(n))}containsOnlyOIDCScopes(){let e=0;return sP.forEach(n=>{this.containsScope(n)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(n=>this.appendScope(n))}catch{throw V(Su)}}removeScope(e){if(!e)throw V(Cu);this.scopes.delete(e.trim())}removeOIDCScopes(){sP.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw V(Ns);let n=new Set;return e.scopes.forEach(i=>n.add(i.toLowerCase())),this.scopes.forEach(i=>n.add(i.toLowerCase())),n}intersectingScopeSets(e){if(!e)throw V(Ns);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();let n=this.unionScopeSets(e),i=e.getScopeCount(),r=this.getScopeCount();return n.size<r+i}getScopeCount(){return this.scopes.size}asArray(){let e=[];return this.scopes.forEach(n=>e.push(n)),e}printScopes(){return this.scopes?this.asArray().join(" "):Y.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}};function Bu(t,e){if(!t)throw V(hu);try{let n=e(t);return JSON.parse(n)}catch{throw V(vs)}}function Oo(t){if(!t)throw V(vs);let e=t.split(lu.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?Y.EMPTY_STRING:e[1]}}function FA(t,e){return!!t&&!!e&&t===e.split(".")[1]}function ap(t,e,n,i){if(i){let{oid:r,sub:o,tid:s,name:a,tfp:c,acr:u,preferred_username:l,upn:d,login_hint:f}=i,m=s||c||u||"";return{tenantId:m,localAccountId:r||o||"",name:a,username:l||d||"",loginHint:f,isHomeTenant:FA(m,t)}}else return{tenantId:n,localAccountId:e,username:"",isHomeTenant:FA(n,t)}}function rC(t,e,n,i){let r=t;if(e){let{isHomeTenant:o,...s}=e;r={...t,...s}}if(n){let{isHomeTenant:o,...s}=ap(t.homeAccountId,t.localAccountId,t.tenantId,n);return r={...r,...s,idTokenClaims:n,idToken:i},r}return r}function iC(t){return t&&(t.tid||t.tfp||t.acr)||null}var yi=class t{static getAccountInfo(e){return{homeAccountId:e.homeAccountId,environment:e.environment,tenantId:e.realm,username:e.username,localAccountId:e.localAccountId,loginHint:e.loginHint,name:e.name,nativeAccountId:e.nativeAccountId,authorityType:e.authorityType,tenantProfiles:new Map((e.tenantProfiles||[]).map(n=>[n.tenantId,n])),dataBoundary:e.dataBoundary}}isSingleTenant(){return!this.tenantProfiles}static createAccount(e,n,i){let r=new t;n.authorityType===Tr.Adfs?r.authorityType=au.ADFS_ACCOUNT_TYPE:n.protocolMode===qu.OIDC?r.authorityType=au.GENERIC_ACCOUNT_TYPE:r.authorityType=au.MSSTS_ACCOUNT_TYPE;let o;e.clientInfo&&i&&(o=Bu(e.clientInfo,i),o.xms_tdbr&&(r.dataBoundary=o.xms_tdbr==="EU"?"EU":"None")),r.clientInfo=e.clientInfo,r.homeAccountId=e.homeAccountId,r.nativeAccountId=e.nativeAccountId;let s=e.environment||n&&n.getPreferredCache();if(!s)throw V(Ds);r.environment=s,r.realm=o?.utid||iC(e.idTokenClaims)||"",r.localAccountId=o?.uid||e.idTokenClaims?.oid||e.idTokenClaims?.sub||"";let a=e.idTokenClaims?.preferred_username||e.idTokenClaims?.upn,c=e.idTokenClaims?.emails?e.idTokenClaims.emails[0]:null;if(r.username=a||c||"",r.loginHint=e.idTokenClaims?.login_hint,r.name=e.idTokenClaims?.name||"",r.cloudGraphHostName=e.cloudGraphHostName,r.msGraphHost=e.msGraphHost,e.tenantProfiles)r.tenantProfiles=e.tenantProfiles;else{let u=ap(e.homeAccountId,r.localAccountId,r.realm,e.idTokenClaims);r.tenantProfiles=[u]}return r}static createFromAccountInfo(e,n,i){let r=new t;return r.authorityType=e.authorityType||au.GENERIC_ACCOUNT_TYPE,r.homeAccountId=e.homeAccountId,r.localAccountId=e.localAccountId,r.nativeAccountId=e.nativeAccountId,r.realm=e.tenantId,r.environment=e.environment,r.username=e.username,r.name=e.name,r.loginHint=e.loginHint,r.cloudGraphHostName=n,r.msGraphHost=i,r.tenantProfiles=Array.from(e.tenantProfiles?.values()||[]),r.dataBoundary=e.dataBoundary,r}static generateHomeAccountId(e,n,i,r,o){if(!(n===Tr.Adfs||n===Tr.Dsts)){if(e)try{let s=Bu(e,r.base64Decode);if(s.uid&&s.utid)return`${s.uid}.${s.utid}`}catch{}i.warning("No client info in response")}return o?.sub||""}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,n,i){if(!e||!n)return!1;let r=!0;if(i){let o=e.idTokenClaims||{},s=n.idTokenClaims||{};r=o.iat===s.iat&&o.nonce===s.nonce}return e.homeAccountId===n.homeAccountId&&e.localAccountId===n.localAccountId&&e.username===n.username&&e.tenantId===n.tenantId&&e.loginHint===n.loginHint&&e.environment===n.environment&&e.nativeAccountId===n.nativeAccountId&&r}},oC="cache_quota_exceeded",cp="cache_error_unknown",o4=Object.freeze({__proto__:null,cacheErrorUnknown:cp,cacheQuotaExceeded:oC}),PA={[oC]:"Exceeded cache storage capacity.",[cp]:"Unexpected error occurred when using cache storage."},Ss=class t extends ln{constructor(e,n){let i=n||(PA[e]?PA[e]:PA[cp]);super(`${e}: ${i}`),Object.setPrototypeOf(this,t.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=i}};function hD(t){return t instanceof Error?t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED"||t.message.includes("exceeded the quota")?new Ss(oC):new Ss(t.name,t.message):new Ss(cp)}var Zf=class{constructor(e,n,i,r,o){this.clientId=e,this.cryptoImpl=n,this.commonLogger=i.clone(dD,sp),this.staticAuthorityOptions=o,this.performanceClient=r}getAllAccounts(e,n){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,n),n,e)}getAccountInfoFilteredBy(e,n){if(Object.keys(e).length===0||Object.values(e).every(r=>!r))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null"),null;let i=this.getAllAccounts(e,n);return i.length>1?i.sort(o=>o.idTokenClaims?-1:1)[0]:i.length===1?i[0]:null}getBaseAccountInfo(e,n){let i=this.getAccountsFilteredBy(e,n);return i.length>0?yi.getAccountInfo(i[0]):null}buildTenantProfiles(e,n,i){return e.flatMap(r=>this.getTenantProfilesFromAccountEntity(r,n,i?.tenantId,i))}getTenantedAccountInfoByFilter(e,n,i,r,o){let s=null,a;if(o&&!this.tenantProfileMatchesFilter(i,o))return null;let c=this.getIdToken(e,r,n,i.tenantId);return c&&(a=zu(c.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(a,o))?null:(s=rC(e,i,a,c?.secret),s)}getTenantProfilesFromAccountEntity(e,n,i,r){let o=yi.getAccountInfo(e),s=o.tenantProfiles||new Map,a=this.getTokenKeys();if(i){let u=s.get(i);if(u)s=new Map([[i,u]]);else return[]}let c=[];return s.forEach(u=>{let l=this.getTenantedAccountInfoByFilter(o,a,u,n,r);l&&c.push(l)}),c}tenantProfileMatchesFilter(e,n){return!(n.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,n.localAccountId)||n.name&&e.name!==n.name||n.isHomeTenant!==void 0&&e.isHomeTenant!==n.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,n){return!(n&&(n.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,n.localAccountId)||n.loginHint&&!this.matchLoginHintFromTokenClaims(e,n.loginHint)||n.username&&!this.matchUsername(e.preferred_username,n.username)||n.name&&!this.matchName(e,n.name)||n.sid&&!this.matchSid(e,n.sid)))}async saveCacheRecord(e,n,i,r){if(!e)throw V(wu);try{e.account&&await this.setAccount(e.account,n,i),e.idToken&&r?.idToken!==!1&&await this.setIdTokenCredential(e.idToken,n,i),e.accessToken&&r?.accessToken!==!1&&await this.saveAccessToken(e.accessToken,n,i),e.refreshToken&&r?.refreshToken!==!1&&await this.setRefreshTokenCredential(e.refreshToken,n,i),e.appMetadata&&this.setAppMetadata(e.appMetadata,n)}catch(o){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed"),o instanceof ln?o:hD(o)}}async saveAccessToken(e,n,i){let r={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},o=this.getTokenKeys(),s=Ar.fromString(e.target);o.accessToken.forEach(a=>{if(!this.accessTokenKeyMatchesFilter(a,r,!1))return;let c=this.getAccessTokenCredential(a,n);c&&this.credentialMatchesFilter(c,r)&&Ar.fromString(c.target).intersectingScopeSets(s)&&this.removeAccessToken(a,n)}),await this.setAccessTokenCredential(e,n,i)}getAccountsFilteredBy(e,n){let i=this.getAccountKeys(),r=[];return i.forEach(o=>{let s=this.getAccount(o,n);if(!s||e.homeAccountId&&!this.matchHomeAccountId(s,e.homeAccountId)||e.username&&!this.matchUsername(s.username,e.username)||e.environment&&!this.matchEnvironment(s,e.environment)||e.realm&&!this.matchRealm(s,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(s,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(s,e.authorityType))return;let a={localAccountId:e?.localAccountId,name:e?.name},c=s.tenantProfiles?.filter(u=>this.tenantProfileMatchesFilter(u,a));c&&c.length===0||r.push(s)}),r}credentialMatchesFilter(e,n){return!(n.clientId&&!this.matchClientId(e,n.clientId)||n.userAssertionHash&&!this.matchUserAssertionHash(e,n.userAssertionHash)||typeof n.homeAccountId=="string"&&!this.matchHomeAccountId(e,n.homeAccountId)||n.environment&&!this.matchEnvironment(e,n.environment)||n.realm&&!this.matchRealm(e,n.realm)||n.credentialType&&!this.matchCredentialType(e,n.credentialType)||n.familyId&&!this.matchFamilyId(e,n.familyId)||n.target&&!this.matchTarget(e,n.target)||(n.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==n.requestedClaimsHash||e.credentialType===Ht.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(n.tokenType&&!this.matchTokenType(e,n.tokenType)||n.tokenType===Bt.SSH&&n.keyId&&!this.matchKeyId(e,n.keyId)))}getAppMetadataFilteredBy(e){let n=this.getKeys(),i={};return n.forEach(r=>{if(!this.isAppMetadata(r))return;let o=this.getAppMetadata(r);o&&(e.environment&&!this.matchEnvironment(o,e.environment)||e.clientId&&!this.matchClientId(o,e.clientId)||(i[r]=o))}),i}getAuthorityMetadataByAlias(e){let n=this.getAuthorityMetadataKeys(),i=null;return n.forEach(r=>{if(!this.isAuthorityMetadata(r)||r.indexOf(this.clientId)===-1)return;let o=this.getAuthorityMetadata(r);o&&o.aliases.indexOf(e)!==-1&&(i=o)}),i}removeAllAccounts(e){this.getAllAccounts({},e).forEach(i=>{this.removeAccount(i,e)})}removeAccount(e,n){this.removeAccountContext(e,n);let i=this.getAccountKeys(),r=o=>o.includes(e.homeAccountId)&&o.includes(e.environment);i.filter(r).forEach(o=>{this.removeItem(o,n),this.performanceClient.incrementFields({accountsRemoved:1},n)})}removeAccountContext(e,n){let i=this.getTokenKeys(),r=o=>o.includes(e.homeAccountId)&&o.includes(e.environment);i.idToken.filter(r).forEach(o=>{this.removeIdToken(o,n)}),i.accessToken.filter(r).forEach(o=>{this.removeAccessToken(o,n)}),i.refreshToken.filter(r).forEach(o=>{this.removeRefreshToken(o,n)})}removeAccessToken(e,n){let i=this.getAccessTokenCredential(e,n);if(this.removeItem(e,n),this.performanceClient.incrementFields({accessTokensRemoved:1},n),!i||i.credentialType.toLowerCase()!==Ht.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()||i.tokenType!==Bt.POP)return;let r=i.keyId;r&&this.cryptoImpl.removeTokenBindingKey(r).catch(()=>{this.commonLogger.error(`Failed to remove token binding key ${r}`,n),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},n)})}removeAppMetadata(e){return this.getKeys().forEach(i=>{this.isAppMetadata(i)&&this.removeItem(i,e)}),!0}getIdToken(e,n,i,r,o){this.commonLogger.trace("CacheManager - getIdToken called");let s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Ht.ID_TOKEN,clientId:this.clientId,realm:r},a=this.getIdTokensByFilter(s,n,i),c=a.size;if(c<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(c>1){let u=a;if(!r){let l=new Map;a.forEach((f,m)=>{f.realm===e.tenantId&&l.set(m,f)});let d=l.size;if(d<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),a.values().next().value;if(d===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),l.values().next().value;u=l}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),u.forEach((l,d)=>{this.removeIdToken(d,n)}),o&&n&&o.addFields({multiMatchedID:a.size},n),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),a.values().next().value}getIdTokensByFilter(e,n,i){let r=i&&i.idToken||this.getTokenKeys().idToken,o=new Map;return r.forEach(s=>{if(!this.idTokenKeyMatchesFilter(s,{clientId:this.clientId,...e}))return;let a=this.getIdTokenCredential(s,n);a&&this.credentialMatchesFilter(a,e)&&o.set(s,a)}),o}idTokenKeyMatchesFilter(e,n){let i=e.toLowerCase();return!(n.clientId&&i.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&i.indexOf(n.homeAccountId.toLowerCase())===-1)}removeIdToken(e,n){this.removeItem(e,n)}removeRefreshToken(e,n){this.removeItem(e,n)}getAccessToken(e,n,i,r){let o=n.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",o);let s=Ar.createSearchScopes(n.scopes),a=n.authenticationScheme||Bt.BEARER,c=a&&a.toLowerCase()!==Bt.BEARER.toLowerCase()?Ht.ACCESS_TOKEN_WITH_AUTH_SCHEME:Ht.ACCESS_TOKEN,u={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:c,clientId:this.clientId,realm:r||e.tenantId,target:s,tokenType:a,keyId:n.sshKid,requestedClaimsHash:n.requestedClaimsHash},l=i&&i.accessToken||this.getTokenKeys().accessToken,d=[];l.forEach(m=>{if(this.accessTokenKeyMatchesFilter(m,u,!0)){let _=this.getAccessTokenCredential(m,o);_&&this.credentialMatchesFilter(_,u)&&d.push(_)}});let f=d.length;return f<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",o),null):f>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",o),d.forEach(m=>{this.removeAccessToken(this.generateCredentialKey(m),o)}),this.performanceClient.addFields({multiMatchedAT:d.length},o),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",o),d[0])}accessTokenKeyMatchesFilter(e,n,i){let r=e.toLowerCase();if(n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1||n.realm&&r.indexOf(n.realm.toLowerCase())===-1||n.requestedClaimsHash&&r.indexOf(n.requestedClaimsHash.toLowerCase())===-1)return!1;if(n.target){let o=n.target.asArray();for(let s=0;s<o.length;s++){if(i&&!r.includes(o[s].toLowerCase()))return!1;if(!i&&r.includes(o[s].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e,n){let i=this.getTokenKeys(),r=[];return i.accessToken.forEach(o=>{if(!this.accessTokenKeyMatchesFilter(o,e,!0))return;let s=this.getAccessTokenCredential(o,n);s&&this.credentialMatchesFilter(s,e)&&r.push(s)}),r}getRefreshToken(e,n,i,r,o){this.commonLogger.trace("CacheManager - getRefreshToken called");let s=n?du:void 0,a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Ht.REFRESH_TOKEN,clientId:this.clientId,familyId:s},c=r&&r.refreshToken||this.getTokenKeys().refreshToken,u=[];c.forEach(d=>{if(this.refreshTokenKeyMatchesFilter(d,a)){let f=this.getRefreshTokenCredential(d,i);f&&this.credentialMatchesFilter(f,a)&&u.push(f)}});let l=u.length;return l<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(l>1&&o&&i&&o.addFields({multiMatchedRT:l},i),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),u[0])}refreshTokenKeyMatchesFilter(e,n){let i=e.toLowerCase();return!(n.familyId&&i.indexOf(n.familyId.toLowerCase())===-1||!n.familyId&&n.clientId&&i.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&i.indexOf(n.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){let n={environment:e,clientId:this.clientId},i=this.getAppMetadataFilteredBy(n),r=Object.keys(i).map(s=>i[s]),o=r.length;if(o<1)return null;if(o>1)throw V(Tu);return r[0]}isAppMetadataFOCI(e){let n=this.readAppMetadataFromCache(e);return!!(n&&n.familyId===du)}matchHomeAccountId(e,n){return typeof e.homeAccountId=="string"&&n===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,n){let i=e.oid||e.sub;return n===i}matchLocalAccountIdFromTenantProfile(e,n){return e.localAccountId===n}matchName(e,n){return n.toLowerCase()===e.name?.toLowerCase()}matchUsername(e,n){return!!(e&&typeof e=="string"&&n?.toLowerCase()===e.toLowerCase())}matchUserAssertionHash(e,n){return!!(e.userAssertionHash&&n===e.userAssertionHash)}matchEnvironment(e,n){if(this.staticAuthorityOptions){let r=w6(this.staticAuthorityOptions,this.commonLogger);if(r.includes(n)&&r.includes(e.environment))return!0}let i=this.getAuthorityMetadataByAlias(n);return!!(i&&i.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,n){return e.credentialType&&n.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,n){return!!(e.clientId&&n===e.clientId)}matchFamilyId(e,n){return!!(e.familyId&&n===e.familyId)}matchRealm(e,n){return e.realm?.toLowerCase()===n.toLowerCase()}matchNativeAccountId(e,n){return!!(e.nativeAccountId&&n===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,n){return e.login_hint===n||e.preferred_username===n||e.upn===n}matchSid(e,n){return e.sid===n}matchAuthorityType(e,n){return!!(e.authorityType&&n.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,n){return e.credentialType!==Ht.ACCESS_TOKEN&&e.credentialType!==Ht.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Ar.fromString(e.target).containsScopeSet(n)}matchTokenType(e,n){return!!(e.tokenType&&e.tokenType===n)}matchKeyId(e,n){return!!(e.keyId&&e.keyId===n)}isAppMetadata(e){return e.indexOf(WA)!==-1}isAuthorityMetadata(e){return e.indexOf(gf.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${gf.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,n){for(let i in n)e[i]=n[i];return e}},Jf=class extends Zf{async setAccount(){throw V(Te)}getAccount(){throw V(Te)}async setIdTokenCredential(){throw V(Te)}getIdTokenCredential(){throw V(Te)}async setAccessTokenCredential(){throw V(Te)}getAccessTokenCredential(){throw V(Te)}async setRefreshTokenCredential(){throw V(Te)}getRefreshTokenCredential(){throw V(Te)}setAppMetadata(){throw V(Te)}getAppMetadata(){throw V(Te)}setServerTelemetry(){throw V(Te)}getServerTelemetry(){throw V(Te)}setAuthorityMetadata(){throw V(Te)}getAuthorityMetadata(){throw V(Te)}getAuthorityMetadataKeys(){throw V(Te)}setThrottlingCache(){throw V(Te)}getThrottlingCache(){throw V(Te)}removeItem(){throw V(Te)}getKeys(){throw V(Te)}getAccountKeys(){throw V(Te)}getTokenKeys(){throw V(Te)}generateCredentialKey(){throw V(Te)}generateAccountKey(){throw V(Te)}},ju=class{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}},ep=class{generateId(){return"callback-id"}startMeasurement(e,n){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:TP.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""},measurement:new ju}}startPerformanceMeasurement(){return new ju}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}},fD={tokenRenewalOffsetSeconds:fP,preventCorsPreflight:!1},s4={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:P.LogLevel.Info,correlationId:Y.EMPTY_STRING},a4={claimsBasedCachingEnabled:!1},c4={async sendGetRequestAsync(){throw V(Te)},async sendPostRequestAsync(){throw V(Te)}},u4={sku:Y.SKU,version:sp,cpu:Y.EMPTY_STRING,os:Y.EMPTY_STRING},l4={clientSecret:Y.EMPTY_STRING,clientAssertion:void 0},d4={azureCloudInstance:ZA.None,tenant:`${Y.DEFAULT_COMMON_TENANT}`},h4={application:{appName:"",appVersion:""}};function f4({authOptions:t,systemOptions:e,loggerOptions:n,cacheOptions:i,storageInterface:r,networkInterface:o,cryptoInterface:s,clientCredentials:a,libraryInfo:c,telemetry:u,serverTelemetryManager:l,persistencePlugin:d,serializableCache:f}){let m={...s4,...n};return{authOptions:p4(t),systemOptions:{...fD,...e},loggerOptions:m,cacheOptions:{...a4,...i},storageInterface:r||new Jf(t.clientId,xA,new Hu(m),new ep),networkInterface:o||c4,cryptoInterface:s||xA,clientCredentials:a||l4,libraryInfo:{...u4,...c},telemetry:{...h4,...u},serverTelemetryManager:l||null,persistencePlugin:d||null,serializableCache:f||null}}function p4(t){return{clientCapabilities:[],azureCloudOptions:d4,skipAuthorityMetadataCache:!1,instanceAware:!1,encodeExtraQueryParams:!1,...t}}function pD(t){return t.authOptions.authority.options.protocolMode===qu.OIDC}var qr={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};function up(t,e,n){if(!e)return;let i=t.get($s);i&&t.has(Xf)&&n?.addFields({embeddedClientId:i,embeddedRedirectUri:t.get(eC)},e)}function m4(t,e){t.set(bP,e)}function mD(t,e){t.set(OP,e||hP.QUERY)}function g4(t){t.set(iD,"1")}function lp(t,e,n=!0,i=ip){n&&!i.includes("openid")&&!e.includes("openid")&&i.push("openid");let r=n?[...e||[],...i]:e||[],o=new Ar(r);t.set(PP,o.printScopes())}function dp(t,e){t.set($s,e)}function hp(t,e){t.set(eC,e)}function gD(t,e){t.set(XP,e)}function _D(t,e){t.set(QP,e)}function yD(t,e){t.set(cD,e)}function uu(t,e){t.set(aD,e)}function Yu(t,e){t.set(Nt.CCS_HEADER,`UPN:${e}`)}function ws(t,e){t.set(Nt.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function qA(t,e){t.set(sD,e)}function fp(t,e,n){let i=wD(e,n);try{JSON.parse(i)}catch{throw st(ks)}t.set(NP,i)}function pp(t,e){t.set(HP,e)}function sC(t,e){t.set(BP,e.sku),t.set(jP,e.version),e.os&&t.set(YP,e.os),e.cpu&&t.set(VP,e.cpu)}function aC(t,e){e?.appName&&t.set(WP,e.appName),e?.appVersion&&t.set(KP,e.appVersion)}function ED(t,e){t.set(LP,e)}function cC(t,e){e&&t.set(MP,e)}function TD(t,e){t.set(kP,e)}function _4(t,e,n){if(e&&n)t.set(xP,e),t.set(FP,n);else throw st(Lu)}function AD(t,e){t.set(UP,e)}function y4(t,e){t.set(ZP,e)}function CD(t,e){t.set(DP,e)}function SD(t,e){t.set(qP,e)}function uC(t,e){t.set(JP,e)}function lC(t,e){e&&t.set(eD,e)}function dC(t,e){e&&t.set(tD,e)}function E4(t,e){t.set(nD,e)}function T4(t,e){t.set(rD,e)}function hC(t,e){t.set(RP,e)}function mp(t){t.set(u6,"1")}function fC(t){t.has(Qf)||t.set(Qf,"true")}function Is(t,e){Object.entries(e).forEach(([n,i])=>{!t.has(n)&&i&&t.set(n,i)})}function wD(t,e){let n;if(!t)n={};else try{n=JSON.parse(t)}catch{throw st(ks)}return e&&e.length>0&&(n.hasOwnProperty(su.ACCESS_TOKEN)||(n[su.ACCESS_TOKEN]={}),n[su.ACCESS_TOKEN][su.XMS_CC]={values:e}),JSON.stringify(n)}function A4(t,e){t.set(KA.username,e)}function C4(t,e){t.set(KA.password,e)}function pC(t,e){e&&(t.set(tC,Bt.POP),t.set(nC,e))}function mC(t,e){e&&(t.set(tC,Bt.SSH),t.set(nC,e))}function gC(t,e){t.set($P,e.generateCurrentRequestHeaderValue()),t.set(zP,e.generateLastRequestHeaderValue())}function _C(t){t.set(GP,Cs.X_MS_LIB_CAPABILITY_VALUE)}function ID(t,e){t.set(oD,e)}function Gu(t,e,n){t.has(Xf)||t.set(Xf,e),t.has(UA)||t.set(UA,n)}function S4(t,e){t.set(uD,encodeURIComponent(e)),t.set(lD,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}function w4(t,e){Object.entries(e).forEach(([n,i])=>{i&&t.set(n,i)})}var I4=Object.freeze({__proto__:null,addApplicationTelemetry:aC,addAuthorizationCode:AD,addBrokerParameters:Gu,addCcsOid:ws,addCcsUpn:Yu,addClaims:fp,addClientAssertion:lC,addClientAssertionType:dC,addClientCapabilitiesToClaims:wD,addClientId:dp,addClientInfo:mp,addClientSecret:uC,addCodeChallengeParams:_4,addCodeVerifier:SD,addCorrelationId:pp,addDeviceCode:y4,addDomainHint:yD,addEARParameters:S4,addExtraQueryParameters:Is,addGrantType:hC,addIdTokenHint:_D,addInstanceAware:fC,addLibraryInfo:sC,addLoginHint:uu,addLogoutHint:ID,addNativeBroker:g4,addNonce:TD,addOboAssertion:E4,addPassword:C4,addPopToken:pC,addPostBodyParameters:w4,addPostLogoutRedirectUri:gD,addPrompt:ED,addRedirectUri:hp,addRefreshToken:CD,addRequestTokenUse:T4,addResponseMode:mD,addResponseType:m4,addScopes:lp,addServerTelemetry:gC,addSid:qA,addSshJwk:mC,addState:cC,addThrottling:_C,addUsername:A4,instrumentBrokerParams:up}),Ro=class t extends ln{constructor(e,n,i,r,o){super(e,n,i),this.name="ServerError",this.errorNo=r,this.status=o,Object.setPrototypeOf(this,t.prototype)}};function gp(t,e,n){return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:n,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||e.tokenBodyParameters?.clientId}}var Vu=class t{static generateThrottlingStorageKey(e){return`${Cs.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,n,i){let r=t.generateThrottlingStorageKey(n),o=e.getThrottlingCache(r);if(o){if(o.throttleTime<Date.now()){e.removeItem(r,i);return}throw new Ro(o.errorCodes?.join(" ")||Y.EMPTY_STRING,o.errorMessage,o.subError)}}static postProcess(e,n,i,r){if(t.checkResponseStatus(i)||t.checkResponseForRetryAfter(i)){let o={throttleTime:t.calculateThrottleTime(parseInt(i.headers[Nt.RETRY_AFTER])),error:i.body.error,errorCodes:i.body.error_codes,errorMessage:i.body.error_description,subError:i.body.suberror};e.setThrottlingCache(t.generateThrottlingStorageKey(n),o,r)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Nt.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){let n=e<=0?0:e,i=Date.now()/1e3;return Math.floor(Math.min(i+(n||Cs.DEFAULT_THROTTLE_TIME_SECONDS),i+Cs.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,n,i,r){let o=gp(n,i,r),s=this.generateThrottlingStorageKey(o);e.removeItem(s,i.correlationId)}},$u=class t extends ln{constructor(e,n,i){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,t.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=i}};function v4(t,e,n,i){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${i?.name}, error.message:${i?.message}`,new $u(t,e,n)}var Hs=class{constructor(e,n){this.config=f4(e),this.logger=new Hu(this.config.loggerOptions,dD,sp),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n}createTokenRequestHeaders(e){let n={};if(n[Nt.CONTENT_TYPE]=Y.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case qr.HOME_ACCOUNT_ID:try{let i=Oo(e.credential);n[Nt.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case qr.UPN:n[Nt.CCS_HEADER]=`UPN: ${e.credential}`;break}return n}async executePostToTokenEndpoint(e,n,i,r,o,s){s&&this.performanceClient?.addQueueMeasurement(s,o);let a=await this.sendPostRequest(r,e,{body:n,headers:i},o);return this.config.serverTelemetryManager&&a.status<500&&a.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async sendPostRequest(e,n,i,r){Vu.preProcess(this.cacheManager,e,r);let o;try{o=await Be(this.networkClient.sendPostRequestAsync.bind(this.networkClient),O.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,r)(n,i);let s=o.headers||{};this.performanceClient?.addFields({refreshTokenSize:o.body.refresh_token?.length||0,httpVerToken:s[Nt.X_MS_HTTP_VERSION]||"",requestId:s[Nt.X_MS_REQUEST_ID]||""},r)}catch(s){if(s instanceof $u){let a=s.responseHeaders;throw a&&this.performanceClient?.addFields({httpVerToken:a[Nt.X_MS_HTTP_VERSION]||"",requestId:a[Nt.X_MS_REQUEST_ID]||"",contentTypeHeader:a[Nt.CONTENT_TYPE]||void 0,contentLengthHeader:a[Nt.CONTENT_LENGTH]||void 0,httpStatus:s.httpStatus},r),s.error}throw s instanceof ln?s:V(pu)}return Vu.postProcess(this.cacheManager,e,o,r),o}async updateAuthority(e,n){this.performanceClient?.addQueueMeasurement(O.UpdateTokenEndpointAuthority,n);let i=`https://${e}/${this.authority.tenant}/`,r=await vP(i,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=r}createTokenQueryParameters(e){let n=new Map;return e.embeddedClientId&&Gu(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenQueryParameters&&Is(n,e.tokenQueryParameters),pp(n,e.correlationId),up(n,e.correlationId,this.performanceClient),Fs(n)}},Bs="no_tokens_found",tp="native_account_unavailable",yC="refresh_token_expired",EC="ux_not_allowed",vD="interaction_required",bD="consent_required",OD="login_required",js="bad_token",b4=Object.freeze({__proto__:null,badToken:js,consentRequired:bD,interactionRequired:vD,loginRequired:OD,nativeAccountUnavailable:tp,noTokensFound:Bs,refreshTokenExpired:yC,uxNotAllowed:EC}),lP=[vD,bD,OD,js,EC],O4=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],mf={[Bs]:"No refresh token found in the cache. Please sign-in.",[tp]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[yC]:"Refresh token has expired.",[js]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",[EC]:"`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve."},R4={noTokensFoundError:{code:Bs,desc:mf[Bs]},native_account_unavailable:{code:tp,desc:mf[tp]},bad_token:{code:js,desc:mf[js]}},Vi=class t extends ln{constructor(e,n,i,r,o,s,a,c){super(e,n,i),Object.setPrototypeOf(this,t.prototype),this.timestamp=r||Y.EMPTY_STRING,this.traceId=o||Y.EMPTY_STRING,this.correlationId=s||Y.EMPTY_STRING,this.claims=a||Y.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=c}};function RD(t,e,n){let i=!!t&&lP.indexOf(t)>-1,r=!!n&&O4.indexOf(n)>-1,o=!!e&&lP.some(s=>e.indexOf(s)>-1);return i||o||r}function HA(t){return new Vi(t,mf[t])}var np=class t{static setRequestState(e,n,i){let r=t.generateLibraryState(e,i);return n?`${r}${Y.RESOURCE_DELIM}${n}`:r}static generateLibraryState(e,n){if(!e)throw V(Ms);let i={id:e.createNewGuid()};n&&(i.meta=n);let r=JSON.stringify(i);return e.base64Encode(r)}static parseRequestState(e,n){if(!e)throw V(Ms);if(!n)throw V(Yi);try{let i=n.split(Y.RESOURCE_DELIM),r=i[0],o=i.length>1?i.slice(1).join(Y.RESOURCE_DELIM):Y.EMPTY_STRING,s=e.base64Decode(r),a=JSON.parse(s);return{userRequestState:o||Y.EMPTY_STRING,libraryState:a}}catch{throw V(Yi)}}},N4={SW:"sw"},Ys=class{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){this.performanceClient?.addQueueMeasurement(O.PopTokenGenerateCnf,e.correlationId);let i=await Be(this.generateKid.bind(this),O.PopTokenGenerateCnf,n,this.performanceClient,e.correlationId)(e),r=this.cryptoUtils.base64UrlEncode(JSON.stringify(i));return{kid:i.kid,reqCnfString:r}}async generateKid(e){return this.performanceClient?.addQueueMeasurement(O.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:N4.SW}}async signPopToken(e,n,i){return this.signPayload(e,n,i)}async signPayload(e,n,i,r){let{resourceRequestMethod:o,resourceRequestUri:s,shrClaims:a,shrNonce:c,shrOptions:u}=i,d=(s?new Pt(s):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:Ei(),m:o?.toUpperCase(),u:d?.HostNameAndPort,nonce:c||this.cryptoUtils.createNewGuid(),p:d?.AbsolutePath,q:d?.QueryString?[[],d.QueryString]:void 0,client_claims:a||void 0,...r},n,u,i.correlationId)}},rp=class{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}},Vs=class t{constructor(e,n,i,r,o,s,a){this.clientId=e,this.cacheStorage=n,this.cryptoObj=i,this.logger=r,this.serializableCache=o,this.persistencePlugin=s,this.performanceClient=a}validateTokenResponse(e,n){if(e.error||e.error_description||e.suberror){let i=`Error(s): ${e.error_codes||Y.NOT_AVAILABLE} - Timestamp: ${e.timestamp||Y.NOT_AVAILABLE} - Description: ${e.error_description||Y.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||Y.NOT_AVAILABLE} - Trace ID: ${e.trace_id||Y.NOT_AVAILABLE}`,r=e.error_codes?.length?e.error_codes[0]:void 0,o=new Ro(e.error,i,e.suberror,r,e.status);if(n&&e.status&&e.status>=gi.SERVER_ERROR_RANGE_START&&e.status<=gi.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
|
|
18
|
+
${o}`);return}else if(n&&e.status&&e.status>=gi.CLIENT_ERROR_RANGE_START&&e.status<=gi.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
|
|
19
|
+
${o}`);return}throw RD(e.error,e.error_description,e.suberror)?new Vi(e.error,e.error_description,e.suberror,e.timestamp||Y.EMPTY_STRING,e.trace_id||Y.EMPTY_STRING,e.correlation_id||Y.EMPTY_STRING,e.claims||Y.EMPTY_STRING,r):o}}async handleServerTokenResponse(e,n,i,r,o,s,a,c,u){this.performanceClient?.addQueueMeasurement(O.HandleServerTokenResponse,e.correlation_id);let l;if(e.id_token){if(l=zu(e.id_token||Y.EMPTY_STRING,this.cryptoObj.base64Decode),o&&o.nonce&&l.nonce!==o.nonce)throw V(yu);if(r.maxAge||r.maxAge===0){let _=l.auth_time;if(!_)throw V(Rs);XA(_,r.maxAge)}}this.homeAccountIdentifier=yi.generateHomeAccountId(e.client_info||Y.EMPTY_STRING,n.authorityType,this.logger,this.cryptoObj,l);let d;o&&o.state&&(d=np.parseRequestState(this.cryptoObj,o.state)),e.key_id=e.key_id||r.sshKid||void 0;let f=this.generateCacheRecord(e,n,i,r,l,s,o),m;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),m=new rp(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(m)),a&&!c&&f.account){let _=this.cacheStorage.generateAccountKey(yi.getAccountInfo(f.account));if(!this.cacheStorage.getAccount(_,r.correlationId))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await t.generateAuthenticationResult(this.cryptoObj,n,f,!1,r,l,d,void 0,u)}await this.cacheStorage.saveCacheRecord(f,r.correlationId,pP(l||{}),r.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&m&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(m))}return t.generateAuthenticationResult(this.cryptoObj,n,f,!1,r,l,d,e,u)}generateCacheRecord(e,n,i,r,o,s,a){let c=n.getPreferredCache();if(!c)throw V(Ds);let u=iC(o),l,d;e.id_token&&o&&(l=SP(this.homeAccountIdentifier,c,e.id_token,this.clientId,u||""),d=ND(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,r.correlationId,o,e.client_info,c,u,a,void 0,this.logger));let f=null;if(e.access_token){let E=e.scope?Ar.fromString(e.scope):new Ar(r.scopes||[]),I=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,y=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,A=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,S=i+I,w=S+y,N=A&&A>0?i+A:void 0;f=wP(this.homeAccountIdentifier,c,e.access_token,this.clientId,u||n.tenant||"",E.printScopes(),S,w,this.cryptoObj.base64Decode,N,e.token_type,s,e.key_id,r.claims,r.requestedClaimsHash)}let m=null;if(e.refresh_token){let E;if(e.refresh_token_expires_in){let I=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;E=i+I}m=IP(this.homeAccountIdentifier,c,e.refresh_token,this.clientId,e.foci,s,E)}let _=null;return e.foci&&(_={clientId:this.clientId,environment:c,familyId:e.foci}),{account:d,idToken:l,accessToken:f,refreshToken:m,appMetadata:_}}static async generateAuthenticationResult(e,n,i,r,o,s,a,c,u){let l=Y.EMPTY_STRING,d=[],f=null,m,_,E=Y.EMPTY_STRING;if(i.accessToken){if(i.accessToken.tokenType===Bt.POP&&!o.popKid){let S=new Ys(e),{secret:w,keyId:N}=i.accessToken;if(!N)throw V(Ou);l=await S.signPopToken(w,N,o)}else l=i.accessToken.secret;d=Ar.fromString(i.accessToken.target).asArray(),f=ff(i.accessToken.expiresOn),m=ff(i.accessToken.extendedExpiresOn),i.accessToken.refreshOn&&(_=ff(i.accessToken.refreshOn))}i.appMetadata&&(E=i.appMetadata.familyId===du?du:"");let I=s?.oid||s?.sub||"",y=s?.tid||"";c?.spa_accountid&&i.account&&(i.account.nativeAccountId=c?.spa_accountid);let A=i.account?rC(yi.getAccountInfo(i.account),void 0,s,i.idToken?.secret):null;return{authority:n.canonicalAuthority,uniqueId:I,tenantId:y,scopes:d,account:A,idToken:i?.idToken?.secret||"",idTokenClaims:s||{},accessToken:l,fromCache:r,expiresOn:f,extExpiresOn:m,refreshOn:_,correlationId:o.correlationId,requestId:u||Y.EMPTY_STRING,familyId:E,tokenType:i.accessToken?.tokenType||Y.EMPTY_STRING,state:a?a.userRequestState:Y.EMPTY_STRING,cloudGraphHostName:i.account?.cloudGraphHostName||Y.EMPTY_STRING,msGraphHost:i.account?.msGraphHost||Y.EMPTY_STRING,code:c?.spa_code,fromNativeBroker:!1}}};function ND(t,e,n,i,r,o,s,a,c,u,l,d){d?.verbose("setCachedAccount called");let m=t.getAccountKeys().find(A=>A.startsWith(n)),_=null;m&&(_=t.getAccount(m,r));let E=_||yi.createAccount({homeAccountId:n,idTokenClaims:o,clientInfo:s,environment:a,cloudGraphHostName:u?.cloud_graph_host_name,msGraphHost:u?.msgraph_host,nativeAccountId:l},e,i),I=E.tenantProfiles||[],y=c||E.realm;if(y&&!I.find(A=>A.tenantId===y)){let A=ap(n,E.localAccountId,y,o);I.push(A)}return E.tenantProfiles=I,E}async function _p(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}var P4=Object.freeze({__proto__:null,getClientAssertion:_p}),BA=class extends Hs{constructor(e,n){super(e,n),this.includeRedirectUri=!0,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,n){if(this.performanceClient?.addQueueMeasurement(O.AuthClientAcquireToken,e.correlationId),!e.code)throw V(Au);let i=Ei(),r=await Be(this.executeTokenRequest.bind(this),O.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),o=r.headers?.[Nt.X_MS_REQUEST_ID],s=new Vs(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(r.body),Be(s.handleServerTokenResponse.bind(s),O.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,i,e,n,void 0,void 0,void 0,o)}getLogoutUri(e){if(!e)throw st(ku);let n=this.createLogoutUrlQueryString(e);return Pt.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n){this.performanceClient?.addQueueMeasurement(O.AuthClientExecuteTokenRequest,n.correlationId);let i=this.createTokenQueryParameters(n),r=Pt.appendQueryString(e.tokenEndpoint,i),o=await Be(this.createTokenRequestBody.bind(this),O.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,n.correlationId)(n),s;if(n.clientInfo)try{let u=Bu(n.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${u.uid}${lu.CLIENT_INFO_SEPARATOR}${u.utid}`,type:qr.HOME_ACCOUNT_ID}}catch(u){this.logger.verbose("Could not parse client info for CCS Header: "+u)}let a=this.createTokenRequestHeaders(s||n.ccsCredential),c=gp(this.config.authOptions.clientId,n);return Be(this.executePostToTokenEndpoint.bind(this),O.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,n.correlationId)(r,o,a,c,n.correlationId,O.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(O.AuthClientCreateTokenRequestBody,e.correlationId);let n=new Map;if(dp(n,e.embeddedClientId||e.tokenBodyParameters?.[$s]||this.config.authOptions.clientId),this.includeRedirectUri)hp(n,e.redirectUri);else if(!e.redirectUri)throw st(Ru);if(lp(n,e.scopes,!0,this.oidcDefaultScopes),AD(n,e.code),sC(n,this.config.libraryInfo),aC(n,this.config.telemetry.application),_C(n),this.serverTelemetryManager&&!pD(this.config)&&gC(n,this.serverTelemetryManager),e.codeVerifier&&SD(n,e.codeVerifier),this.config.clientCredentials.clientSecret&&uC(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let r=this.config.clientCredentials.clientAssertion;lC(n,await _p(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),dC(n,r.assertionType)}if(hC(n,GA.AUTHORIZATION_CODE_GRANT),mp(n),e.authenticationScheme===Bt.POP){let r=new Ys(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Be(r.generateCnf.bind(r),O.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,pC(n,o)}else if(e.authenticationScheme===Bt.SSH)if(e.sshJwk)mC(n,e.sshJwk);else throw st(Us);(!In.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&fp(n,e.claims,this.config.authOptions.clientCapabilities);let i;if(e.clientInfo)try{let r=Bu(e.clientInfo,this.cryptoUtils.base64Decode);i={credential:`${r.uid}${lu.CLIENT_INFO_SEPARATOR}${r.utid}`,type:qr.HOME_ACCOUNT_ID}}catch(r){this.logger.verbose("Could not parse client info for CCS Header: "+r)}else i=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&i)switch(i.type){case qr.HOME_ACCOUNT_ID:try{let r=Oo(i.credential);ws(n,r)}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case qr.UPN:Yu(n,i.credential);break}return e.embeddedClientId&&Gu(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&Is(n,e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[LA])&&Is(n,{[LA]:"1"}),up(n,e.correlationId,this.performanceClient),Fs(n)}createLogoutUrlQueryString(e){let n=new Map;return e.postLogoutRedirectUri&&gD(n,e.postLogoutRedirectUri),e.correlationId&&pp(n,e.correlationId),e.idTokenHint&&_D(n,e.idTokenHint),e.state&&cC(n,e.state),e.logoutHint&&ID(n,e.logoutHint),e.extraQueryParameters&&Is(n,e.extraQueryParameters),this.config.authOptions.instanceAware&&fC(n),Fs(n,this.config.authOptions.encodeExtraQueryParams,e.extraQueryParameters)}},D4=300,jA=class extends Hs{constructor(e,n){super(e,n)}async acquireToken(e){this.performanceClient?.addQueueMeasurement(O.RefreshTokenClientAcquireToken,e.correlationId);let n=Ei(),i=await Be(this.executeTokenRequest.bind(this),O.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),r=i.headers?.[Nt.X_MS_REQUEST_ID],o=new Vs(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(i.body),Be(o.handleServerTokenResponse.bind(o),O.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,n,e,void 0,void 0,!0,e.forceCache,r)}async acquireTokenByRefreshToken(e){if(!e)throw st(Mu);if(this.performanceClient?.addQueueMeasurement(O.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw V(Ps);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await Be(this.acquireTokenWithCachedRefreshToken.bind(this),O.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(i){let r=i instanceof Vi&&i.errorCode===Bs,o=i instanceof Ro&&i.errorCode===DA.INVALID_GRANT_ERROR&&i.subError===DA.CLIENT_MISMATCH_ERROR;if(r||o)return Be(this.acquireTokenWithCachedRefreshToken.bind(this),O.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw i}return Be(this.acquireTokenWithCachedRefreshToken.bind(this),O.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,n){this.performanceClient?.addQueueMeasurement(O.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);let i=AP(this.cacheManager.getRefreshToken.bind(this.cacheManager),O.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0,this.performanceClient);if(!i)throw HA(Bs);if(i.expiresOn&&Kf(i.expiresOn,e.refreshTokenExpirationOffsetSeconds||D4))throw this.performanceClient?.addFields({rtExpiresOnMs:Number(i.expiresOn)},e.correlationId),HA(yC);let r={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||Bt.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:qr.HOME_ACCOUNT_ID}};try{return await Be(this.acquireToken.bind(this),O.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(r)}catch(o){if(o instanceof Vi&&(this.performanceClient?.addFields({rtExpiresOnMs:Number(i.expiresOn)},e.correlationId),o.subError===js)){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");let s=this.cacheManager.generateCredentialKey(i);this.cacheManager.removeRefreshToken(s,e.correlationId)}throw o}}async executeTokenRequest(e,n){this.performanceClient?.addQueueMeasurement(O.RefreshTokenClientExecuteTokenRequest,e.correlationId);let i=this.createTokenQueryParameters(e),r=Pt.appendQueryString(n.tokenEndpoint,i),o=await Be(this.createTokenRequestBody.bind(this),O.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),a=gp(this.config.authOptions.clientId,e);return Be(this.executePostToTokenEndpoint.bind(this),O.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(r,o,s,a,e.correlationId,O.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(O.RefreshTokenClientCreateTokenRequestBody,e.correlationId);let n=new Map;if(dp(n,e.embeddedClientId||e.tokenBodyParameters?.[$s]||this.config.authOptions.clientId),e.redirectUri&&hp(n,e.redirectUri),lp(n,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),hC(n,GA.REFRESH_TOKEN_GRANT),mp(n),sC(n,this.config.libraryInfo),aC(n,this.config.telemetry.application),_C(n),this.serverTelemetryManager&&!pD(this.config)&&gC(n,this.serverTelemetryManager),CD(n,e.refreshToken),this.config.clientCredentials.clientSecret&&uC(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let i=this.config.clientCredentials.clientAssertion;lC(n,await _p(i.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),dC(n,i.assertionType)}if(e.authenticationScheme===Bt.POP){let i=new Ys(this.cryptoUtils,this.performanceClient),r;e.popKid?r=this.cryptoUtils.encodeKid(e.popKid):r=(await Be(i.generateCnf.bind(i),O.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,pC(n,r)}else if(e.authenticationScheme===Bt.SSH)if(e.sshJwk)mC(n,e.sshJwk);else throw st(Us);if((!In.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&fp(n,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case qr.HOME_ACCOUNT_ID:try{let i=Oo(e.ccsCredential.credential);ws(n,i)}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case qr.UPN:Yu(n,e.ccsCredential.credential);break}return e.embeddedClientId&&Gu(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&Is(n,e.tokenBodyParameters),up(n,e.correlationId,this.performanceClient),Fs(n)}},YA=class extends Hs{constructor(e,n){super(e,n)}async acquireCachedToken(e){this.performanceClient?.addQueueMeasurement(O.SilentFlowClientAcquireCachedToken,e.correlationId);let n=Bi.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!In.isEmptyObj(e.claims))throw this.setCacheOutcome(Bi.FORCE_REFRESH_OR_CLAIMS,e.correlationId),V(bo);if(!e.account)throw V(Ps);let i=e.account.tenantId||Y6(e.authority),r=this.cacheManager.getTokenKeys(),o=this.cacheManager.getAccessToken(e.account,e,r,i);if(o){if(CP(o.cachedAt)||Kf(o.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Bi.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),V(bo);o.refreshOn&&Kf(o.refreshOn,0)&&(n=Bi.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Bi.NO_CACHED_ACCESS_TOKEN,e.correlationId),V(bo);let s=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:o,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,r,i,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Be(this.generateResultFromCacheRecord.bind(this),O.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(a,e),n]}setCacheOutcome(e,n){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},n),e!==Bi.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,n){this.performanceClient?.addQueueMeasurement(O.SilentFlowClientGenerateResultFromCacheRecord,n.correlationId);let i;if(e.idToken&&(i=zu(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){let r=i?.auth_time;if(!r)throw V(Rs);XA(r,n.maxAge)}return Vs.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,i)}},M4={sendGetRequestAsync:()=>Promise.reject(V(Te)),sendPostRequestAsync:()=>Promise.reject(V(Te))};function k4(t,e,n,i){let r=e.correlationId,o=new Map;dp(o,e.embeddedClientId||e.extraQueryParameters?.[$s]||t.clientId);let s=[...e.scopes||[],...e.extraScopesToConsent||[]];if(lp(o,s,!0,t.authority.options.OIDCOptions?.defaultScopes),hp(o,e.redirectUri),pp(o,r),mD(o,e.responseMode),mp(o),e.prompt&&(ED(o,e.prompt),i?.addFields({prompt:e.prompt},r)),e.domainHint&&(yD(o,e.domainHint),i?.addFields({domainHintFromRequest:!0},r)),e.prompt!==hf.SELECT_ACCOUNT)if(e.sid&&e.prompt===hf.NONE)n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),qA(o,e.sid),i?.addFields({sidFromRequest:!0},r);else if(e.account){let a=F4(e.account),c=q4(e.account);if(c&&e.domainHint&&(n.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),c=null),c){n.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),uu(o,c),i?.addFields({loginHintFromClaim:!0},r);try{let u=Oo(e.account.homeAccountId);ws(o,u)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&e.prompt===hf.NONE){n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),qA(o,a),i?.addFields({sidFromClaim:!0},r);try{let u=Oo(e.account.homeAccountId);ws(o,u)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)n.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),uu(o,e.loginHint),Yu(o,e.loginHint),i?.addFields({loginHintFromRequest:!0},r);else if(e.account.username){n.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),uu(o,e.account.username),i?.addFields({loginHintFromUpn:!0},r);try{let u=Oo(e.account.homeAccountId);ws(o,u)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(n.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),uu(o,e.loginHint),Yu(o,e.loginHint),i?.addFields({loginHintFromRequest:!0},r));else n.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&TD(o,e.nonce),e.state&&cC(o,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&fp(o,e.claims,t.clientCapabilities),e.embeddedClientId&&Gu(o,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(Qf))&&fC(o),o}function L4(t,e,n,i){let r=Fs(e,n,i);return Pt.appendQueryString(t.authorizationEndpoint,r)}function U4(t,e){if(PD(t,e),!t.code)throw V(vu);return t}function PD(t,e){if(!t.state||!e)throw t.state?V(Os,"Cached State"):V(Os,"Server State");let n,i;try{n=decodeURIComponent(t.state)}catch{throw V(Yi,t.state)}try{i=decodeURIComponent(e)}catch{throw V(Yi,t.state)}if(n!==i)throw V(_u);if(t.error||t.error_description||t.suberror){let r=x4(t);throw RD(t.error,t.error_description,t.suberror)?new Vi(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",r):new Ro(t.error||"",t.error_description,t.suberror,r)}}function x4(t){let e="code=",n=t.error_uri?.lastIndexOf(e);return n&&n>=0?t.error_uri?.substring(n+e.length):void 0}function F4(t){return t.idTokenClaims?.sid||null}function q4(t){return t.loginHint||t.idTokenClaims?.login_hint||null}var H4=Object.freeze({__proto__:null,getAuthorizationCodePayload:U4,getAuthorizeUrl:L4,getStandardAuthorizeRequestParameters:k4,validateAuthorizationResponse:PD}),VA=class{constructor(e){this.headers=e}getShrNonce(){let e=this.headers[Nt.AuthenticationInfo];if(e){let i=this.parseChallenges(e);if(i.nextnonce)return i.nextnonce;throw st(xs)}let n=this.headers[Nt.WWWAuthenticate];if(n){let i=this.parseChallenges(n);if(i.nonce)return i.nonce;throw st(xs)}throw st(Fu)}parseChallenges(e){let n=e.indexOf(" "),i=e.substr(n+1).split(","),r={};return i.forEach(o=>{let[s,a]=o.split("=");r[s]=unescape(a.replace(/['"]+/g,Y.EMPTY_STRING))}),r}};function B4(t){if(t===0)return"UNTAG";let e="abcdefghijklmnopqrstuvwxyz0123456789****************************",n="*****";return n=[e[t>>24&63],e[t>>18&63],e[t>>12&63],e[t>>6&63],e[t>>0&63]].join(""),n}var $A=class t extends ln{constructor(e,n,i,r){let o=B4(r),s=n?`${n} (Error Code: ${i}, Tag: ${o})`:`(Error Code: ${i}, Tag: ${o})`;super(e,s),this.name="PlatformBrokerError",this.statusCode=i,this.tag=o,Object.setPrototypeOf(this,t.prototype)}},dP=",",DD="|";function j4(t){let{skus:e,libraryName:n,libraryVersion:i,extensionName:r,extensionVersion:o}=t,s=new Map([[0,[n,i]],[2,[r,o]]]),a=[];if(e?.length){if(a=e.split(dP),a.length<4)return e}else a=Array.from({length:4},()=>DD);return s.forEach((c,u)=>{c.length===2&&c[0]?.length&&c[1]?.length&&Y4({skuArr:a,index:u,skuName:c[0],skuVersion:c[1]})}),a.join(dP)}function Y4(t){let{skuArr:e,index:n,skuName:i,skuVersion:r}=t;n>=e.length||(e[n]=[i,r].join(DD))}var zA=class t{constructor(e,n){this.cacheOutcome=Bi.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||Y.EMPTY_STRING,this.wrapperVer=e.wrapperVer||Y.EMPTY_STRING,this.telemetryCacheKey=qt.CACHE_KEY+lu.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${qt.VALUE_SEPARATOR}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],i=this.getNativeBrokerErrorCode();i?.length&&n.push(`broker_error=${i}`);let r=n.join(qt.VALUE_SEPARATOR),o=this.getRegionDiscoveryFields(),s=[e,o].join(qt.VALUE_SEPARATOR);return[qt.SCHEMA_VERSION,s,r].join(qt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),n=t.maxErrorsToSend(e),i=e.failedRequests.slice(0,2*n).join(qt.VALUE_SEPARATOR),r=e.errors.slice(0,n).join(qt.VALUE_SEPARATOR),o=e.errors.length,s=n<o?qt.OVERFLOW_TRUE:qt.OVERFLOW_FALSE,a=[o,s].join(qt.VALUE_SEPARATOR);return[qt.SCHEMA_VERSION,e.cacheHits,i,r,a].join(qt.CATEGORY_SEPARATOR)}cacheFailedRequest(e){let n=this.getLastRequests();n.errors.length>=qt.MAX_CACHED_ERRORS&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof ln?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(qt.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){let e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){let e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){let e=this.getLastRequests(),n=t.maxErrorsToSend(e),i=e.errors.length;if(n===i)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{let r={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}}static maxErrorsToSend(e){let n,i=0,r=0,o=e.errors.length;for(n=0;n<o;n++){let s=e.failedRequests[2*n]||Y.EMPTY_STRING,a=e.failedRequests[2*n+1]||Y.EMPTY_STRING,c=e.errors[n]||Y.EMPTY_STRING;if(r+=s.toString().length+a.toString().length+c.length+3,r<qt.MAX_LAST_HEADER_BYTES)i+=1;else break}return i}getRegionDiscoveryFields(){let e=[];return e.push(this.regionUsed||Y.EMPTY_STRING),e.push(this.regionSource||Y.EMPTY_STRING),e.push(this.regionOutcome||Y.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){let n=this.getLastRequests();n.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){let e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId)}static makeExtraSkuString(e){return j4(e)}};P.AADAuthorityConstants=_i;P.AADServerParamKeys=i4;P.AccountEntity=yi;P.AuthError=ln;P.AuthErrorCodes=f6;P.AuthErrorMessage=p6;P.AuthToken=y6;P.AuthenticationHeaderParser=VA;P.AuthenticationScheme=Bt;P.Authority=qs;P.AuthorityFactory=$6;P.AuthorityType=Tr;P.AuthorizationCodeClient=BA;P.Authorize=H4;P.AzureCloudInstance=ZA;P.BaseClient=Hs;P.CacheAccountType=au;P.CacheError=Ss;P.CacheErrorCodes=o4;P.CacheHelpers=j6;P.CacheManager=Zf;P.CacheOutcome=Bi;P.CacheType=c6;P.CcsCredentialType=qr;P.ClaimsRequestKeys=su;P.ClientAssertionUtils=P4;P.ClientAuthError=Uf;P.ClientAuthErrorCodes=g6;P.ClientAuthErrorMessage=_6;P.ClientConfigurationError=zf;P.ClientConfigurationErrorCodes=T6;P.ClientConfigurationErrorMessage=A6;P.CodeChallengeMethodValues=o6;P.Constants=Y;P.CredentialType=Ht;P.DEFAULT_CRYPTO_IMPLEMENTATION=xA;P.DEFAULT_SYSTEM_OPTIONS=fD;P.DEFAULT_TOKEN_RENEWAL_OFFSET_SEC=fP;P.DefaultStorageClass=Jf;P.EncodingTypes=h6;P.Errors=DA;P.GrantType=GA;P.HeaderNames=Nt;P.HttpMethod=r6;P.HttpStatus=gi;P.IntFields=R6;P.InteractionRequiredAuthError=Vi;P.InteractionRequiredAuthErrorCodes=b4;P.InteractionRequiredAuthErrorMessage=R4;P.JsonWebTokenTypes=l6;P.Logger=Hu;P.NetworkError=$u;P.OAuthResponseType=s6;P.OIDC_DEFAULT_SCOPES=ip;P.ONE_DAY_IN_MS=d6;P.PasswordGrantConstants=KA;P.PerformanceEventAbbreviations=O6;P.PerformanceEventStatus=TP;P.PerformanceEvents=O;P.PersistentCacheKeys=i6;P.PlatformBrokerError=$A;P.PopTokenGenerator=Ys;P.PromptValue=hf;P.ProtocolMode=qu;P.ProtocolUtils=np;P.RefreshTokenClient=jA;P.RequestParameterBuilder=I4;P.ResponseHandler=Vs;P.ResponseMode=hP;P.ScopeSet=Ar;P.ServerError=Ro;P.ServerResponseType=a6;P.ServerTelemetryManager=zA;P.SilentFlowClient=YA;P.StringUtils=In;P.StubPerformanceClient=ep;P.StubPerformanceMeasurement=ju;P.StubbedNetworkModule=M4;P.THE_FAMILY_ID=du;P.ThrottlingConstants=Cs;P.ThrottlingUtils=Vu;P.TimeUtils=M6;P.TokenCacheContext=rp;P.UrlString=Pt;P.UrlUtils=S6;P.buildAccountToCache=ND;P.buildClientInfo=Bu;P.buildClientInfoFromHomeAccountId=Oo;P.buildStaticAuthorityOptions=V6;P.buildTenantProfile=ap;P.createAuthError=m6;P.createCacheError=hD;P.createClientAuthError=V;P.createClientConfigurationError=st;P.createInteractionRequiredAuthError=HA;P.createNetworkError=v4;P.formatAuthorityUri=JA;P.getClientAssertion=_p;P.getRequestThumbprint=gp;P.getTenantIdFromIdTokenClaims=iC;P.invoke=AP;P.invokeAsync=Be;P.tenantIdMatchesHomeTenant=FA;P.updateAccountTenantProfileData=rC;P.version=sp});var UD=g(F=>{"use strict";var M=TC(),kD="missing_kid_error",LD="missing_alg_error",V4={[kD]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[LD]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."},CC=class t extends M.AuthError{constructor(e,n){super(e,n),this.name="JoseHeaderError",Object.setPrototypeOf(this,t.prototype)}};function MD(t){return new CC(t,V4[t])}var SC=class t{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw MD(kD);if(!e.alg)throw MD(LD);let n=new t({typ:e.typ||M.JsonWebTokenTypes.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(n)}};function $4(t,e,n){n&&n.push({name:e.get(t.name)||t.name})}function z4(t,e,n,i){if(!n?.length)return;let r=m=>m.length?m[m.length-1]:void 0,o=e.get(t.name)||t.name;if(r(n)?.name!==o)return;let a=n?.pop();if(!a)return;let c=i instanceof M.AuthError?i.errorCode:i instanceof Error?i.name:void 0,u=i instanceof M.AuthError?i.subError:void 0;c&&a.childErr!==c&&(a.err=c,u&&(a.subErr=u)),delete a.name,delete a.childErr;let l={...a,dur:t.durationMs};t.success||(l.fail=1);let d=r(n);if(!d)return{[o]:l};c&&(d.childErr=c);let f;if(!d[o])f=o;else{let m=Object.keys(d).filter(_=>_.startsWith(o)).length;f=`${o}_${m+1}`}return d[f]=l,d}function G4(t,e,n,i=5){if(t instanceof Error){if(t instanceof M.AuthError){n.errorCode=t.errorCode,n.subErrorCode=t.subError,(t instanceof M.ServerError||t instanceof M.InteractionRequiredAuthError)&&(n.serverErrorNo=t.errorNo);return}else if(t instanceof M.CacheError){n.errorCode=t.errorCode;return}else if(n.errorStack?.length){e.trace("PerformanceClient.addErrorStack: Stack already exist",n.correlationId);return}else if(!t.stack?.length){e.trace("PerformanceClient.addErrorStack: Input stack is empty",n.correlationId);return}}else{e.trace("PerformanceClient.addErrorStack: Input error is not instance of Error",n.correlationId);return}t.stack&&(n.errorStack=W4(t.stack,i)),n.errorName=t.name}function W4(t,e){if(e<0)return[];let n=t.split(`
|
|
20
|
+
`)||[],i=[],r=n[0];r.startsWith("TypeError: Cannot read property")||r.startsWith("TypeError: Cannot read properties of")||r.startsWith("TypeError: Cannot set property")||r.startsWith("TypeError: Cannot set properties of")||r.endsWith("is not a function")?i.push(AC(r)):(r.startsWith("SyntaxError")||r.startsWith("TypeError"))&&i.push(AC(r.replace(/['].*[']|["].*["]/g,"<redacted>")));for(let o=1;o<n.length&&!(i.length>=e);o++){let s=n[o];i.push(AC(s))}return i}function AC(t){let e=t.lastIndexOf(" ")+1;if(e<1)return t;let n=t.substring(e),i=n.lastIndexOf("/");return i=i<0?n.lastIndexOf("\\"):i,i>=0?(t.substring(0,e)+"("+n.substring(i+1)+(n.charAt(n.length-1)===")"?"":")")).trimStart():t.trimStart()}function K4(t){let e=t?.idTokenClaims;if(e?.tfp||e?.acr)return"B2C";if(e?.tid){if(e?.tid==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}var wC=class{constructor(e,n,i,r,o,s,a,c){this.authority=n,this.libraryName=r,this.libraryVersion=o,this.applicationTelemetry=s,this.clientId=e,this.logger=i,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.eventStack=new Map,this.queueMeasurements=new Map,this.preQueueTimeByCorrelationId=new Map,this.intFields=a||new Set;for(let u of M.IntFields)this.intFields.add(u);this.abbreviations=c||new Map;for(let[u,l]of M.PerformanceEventAbbreviations)this.abbreviations.set(u,l)}startPerformanceMeasurement(e,n){return{}}getPreQueueTime(e,n){let i=this.preQueueTimeByCorrelationId.get(n);if(i){if(i.name!==e){this.logger.trace(`PerformanceClient.getPreQueueTime: no pre-queue time found for ${e}, unable to add queue measurement`);return}}else{this.logger.trace(`PerformanceClient.getPreQueueTime: no pre-queue times found for correlationId: ${n}, unable to add queue measurement`);return}return i.time}calculateQueuedTime(e,n){return e<1?(this.logger.trace(`PerformanceClient: preQueueTime should be a positive integer and not ${e}`),0):n<1?(this.logger.trace(`PerformanceClient: currentTime should be a positive integer and not ${n}`),0):n<e?(this.logger.trace("PerformanceClient: currentTime is less than preQueueTime, check how time is being retrieved"),0):n-e}addQueueMeasurement(e,n,i,r){if(!n){this.logger.trace(`PerformanceClient.addQueueMeasurement: correlationId not provided for ${e}, cannot add queue measurement`);return}if(i===0)this.logger.trace(`PerformanceClient.addQueueMeasurement: queue time provided for ${e} is ${i}`);else if(!i){this.logger.trace(`PerformanceClient.addQueueMeasurement: no queue time provided for ${e}`);return}let o={eventName:e,queueTime:r?0:i,manuallyCompleted:r},s=this.queueMeasurements.get(n);if(s)s.push(o),this.queueMeasurements.set(n,s);else{this.logger.trace(`PerformanceClient.addQueueMeasurement: adding correlationId ${n} to queue measurements`);let a=[o];this.queueMeasurements.set(n,a)}this.preQueueTimeByCorrelationId.delete(n)}startMeasurement(e,n){let i=n||this.generateId();n||this.logger.info(`PerformanceClient: No correlation id provided for ${e}, generating`,i),this.logger.trace(`PerformanceClient: Performance measurement started for ${e}`,i);let r={eventId:this.generateId(),status:M.PerformanceEventStatus.InProgress,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:i,appName:this.applicationTelemetry?.appName,appVersion:this.applicationTelemetry?.appVersion};return this.cacheEventByCorrelationId(r),$4(r,this.abbreviations,this.eventStack.get(i)),{end:(o,s,a)=>this.endMeasurement({...r,...o},s,a),discard:()=>this.discardMeasurements(r.correlationId),add:o=>this.addFields(o,r.correlationId),increment:o=>this.incrementFields(o,r.correlationId),event:r,measurement:new M.StubPerformanceMeasurement}}endMeasurement(e,n,i){let r=this.eventsByCorrelationId.get(e.correlationId);if(!r)return this.logger.trace(`PerformanceClient: Measurement not found for ${e.eventId}`,e.correlationId),null;let o=e.eventId===r.eventId,s={totalQueueTime:0,totalQueueCount:0,manuallyCompletedCount:0};e.durationMs=Math.round(e.durationMs||this.getDurationMs(e.startTimeMs));let a=JSON.stringify(z4(e,this.abbreviations,this.eventStack.get(r.correlationId),n));if(o?(s=this.getQueueInfo(e.correlationId),this.discardMeasurements(r.correlationId)):r.incompleteSubMeasurements?.delete(e.eventId),this.logger.trace(`PerformanceClient: Performance measurement ended for ${e.name}: ${e.durationMs} ms`,e.correlationId),n&&G4(n,this.logger,r),!o)return r[e.name+"DurationMs"]=Math.floor(e.durationMs),{...r};o&&!n&&(r.errorCode||r.subErrorCode)&&(this.logger.trace(`PerformanceClient: Remove error and sub-error codes for root event ${e.name} as intermediate error was successfully handled`,e.correlationId),r.errorCode=void 0,r.subErrorCode=void 0);let c={...r,...e},u=0;return c.incompleteSubMeasurements?.forEach(l=>{this.logger.trace(`PerformanceClient: Incomplete submeasurement ${l.name} found for ${e.name}`,c.correlationId),u++}),c.incompleteSubMeasurements=void 0,c={...c,queuedTimeMs:s.totalQueueTime,queuedCount:s.totalQueueCount,queuedManuallyCompletedCount:s.manuallyCompletedCount,status:M.PerformanceEventStatus.Completed,incompleteSubsCount:u,context:a},i&&(c.accountType=K4(i),c.dataBoundary=i.dataBoundary),this.truncateIntegralFields(c),this.emitEvents([c],e.correlationId),c}addFields(e,n){this.logger.trace("PerformanceClient: Updating static fields");let i=this.eventsByCorrelationId.get(n);i?this.eventsByCorrelationId.set(n,{...i,...e}):this.logger.trace("PerformanceClient: Event not found for",n)}incrementFields(e,n){this.logger.trace("PerformanceClient: Updating counters");let i=this.eventsByCorrelationId.get(n);if(i)for(let r in e){if(!i.hasOwnProperty(r))i[r]=0;else if(isNaN(Number(i[r])))return;i[r]+=e[r]}else this.logger.trace("PerformanceClient: Event not found for",n)}cacheEventByCorrelationId(e){let n=this.eventsByCorrelationId.get(e.correlationId);n?(this.logger.trace(`PerformanceClient: Performance measurement for ${e.name} added/updated`,e.correlationId),n.incompleteSubMeasurements=n.incompleteSubMeasurements||new Map,n.incompleteSubMeasurements.set(e.eventId,{name:e.name,startTimeMs:e.startTimeMs})):(this.logger.trace(`PerformanceClient: Performance measurement for ${e.name} started`,e.correlationId),this.eventsByCorrelationId.set(e.correlationId,{...e}),this.eventStack.set(e.correlationId,[]))}getQueueInfo(e){let n=this.queueMeasurements.get(e);n||this.logger.trace(`PerformanceClient: no queue measurements found for for correlationId: ${e}`);let i=0,r=0,o=0;return n?.forEach(s=>{i+=s.queueTime,r++,o+=s.manuallyCompleted?1:0}),{totalQueueTime:i,totalQueueCount:r,manuallyCompletedCount:o}}discardMeasurements(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e),this.logger.trace("PerformanceClient: QueueMeasurements discarded",e),this.queueMeasurements.delete(e),this.logger.trace("PerformanceClient: Pre-queue times discarded",e),this.preQueueTimeByCorrelationId.delete(e),this.logger.trace("PerformanceClient: Event stack discarded",e),this.eventStack.delete(e)}addPerformanceCallback(e){for(let[i,r]of this.callbacks)if(r.toString()===e.toString())return this.logger.warning(`PerformanceClient: Performance callback is already registered with id: ${i}`),i;let n=this.generateId();return this.callbacks.set(n,e),this.logger.verbose(`PerformanceClient: Performance callback registered with id: ${n}`),n}removePerformanceCallback(e){let n=this.callbacks.delete(e);return n?this.logger.verbose(`PerformanceClient: Performance callback ${e} removed.`):this.logger.verbose(`PerformanceClient: Performance callback ${e} not removed.`),n}emitEvents(e,n){this.logger.verbose("PerformanceClient: Emitting performance events",n),this.callbacks.forEach((i,r)=>{this.logger.trace(`PerformanceClient: Emitting event to callback ${r}`,n),i.apply(null,[e])})}truncateIntegralFields(e){this.intFields.forEach(n=>{n in e&&typeof e[n]=="number"&&(e[n]=Math.floor(e[n]))})}getDurationMs(e){let n=Date.now()-e;return n<0?n:0}};F.AADAuthorityConstants=M.AADAuthorityConstants;F.AADServerParamKeys=M.AADServerParamKeys;F.AccountEntity=M.AccountEntity;F.AuthError=M.AuthError;F.AuthErrorCodes=M.AuthErrorCodes;F.AuthErrorMessage=M.AuthErrorMessage;F.AuthToken=M.AuthToken;F.AuthenticationHeaderParser=M.AuthenticationHeaderParser;F.AuthenticationScheme=M.AuthenticationScheme;F.Authority=M.Authority;F.AuthorityFactory=M.AuthorityFactory;F.AuthorityType=M.AuthorityType;F.AuthorizationCodeClient=M.AuthorizationCodeClient;F.AuthorizeProtocol=M.Authorize;F.AzureCloudInstance=M.AzureCloudInstance;F.BaseClient=M.BaseClient;F.CacheAccountType=M.CacheAccountType;F.CacheError=M.CacheError;F.CacheErrorCodes=M.CacheErrorCodes;F.CacheHelpers=M.CacheHelpers;F.CacheManager=M.CacheManager;F.CacheOutcome=M.CacheOutcome;F.CacheType=M.CacheType;F.CcsCredentialType=M.CcsCredentialType;F.ClaimsRequestKeys=M.ClaimsRequestKeys;F.ClientAuthError=M.ClientAuthError;F.ClientAuthErrorCodes=M.ClientAuthErrorCodes;F.ClientAuthErrorMessage=M.ClientAuthErrorMessage;F.ClientConfigurationError=M.ClientConfigurationError;F.ClientConfigurationErrorCodes=M.ClientConfigurationErrorCodes;F.ClientConfigurationErrorMessage=M.ClientConfigurationErrorMessage;F.CodeChallengeMethodValues=M.CodeChallengeMethodValues;F.Constants=M.Constants;F.CredentialType=M.CredentialType;F.DEFAULT_CRYPTO_IMPLEMENTATION=M.DEFAULT_CRYPTO_IMPLEMENTATION;F.DEFAULT_SYSTEM_OPTIONS=M.DEFAULT_SYSTEM_OPTIONS;F.DEFAULT_TOKEN_RENEWAL_OFFSET_SEC=M.DEFAULT_TOKEN_RENEWAL_OFFSET_SEC;F.DefaultStorageClass=M.DefaultStorageClass;F.EncodingTypes=M.EncodingTypes;F.Errors=M.Errors;F.GrantType=M.GrantType;F.HeaderNames=M.HeaderNames;F.HttpMethod=M.HttpMethod;F.HttpStatus=M.HttpStatus;F.IntFields=M.IntFields;F.InteractionRequiredAuthError=M.InteractionRequiredAuthError;F.InteractionRequiredAuthErrorCodes=M.InteractionRequiredAuthErrorCodes;F.InteractionRequiredAuthErrorMessage=M.InteractionRequiredAuthErrorMessage;F.JsonWebTokenTypes=M.JsonWebTokenTypes;Object.defineProperty(F,"LogLevel",{enumerable:!0,get:function(){return M.LogLevel}});F.Logger=M.Logger;F.NetworkError=M.NetworkError;F.OAuthResponseType=M.OAuthResponseType;F.OIDC_DEFAULT_SCOPES=M.OIDC_DEFAULT_SCOPES;F.ONE_DAY_IN_MS=M.ONE_DAY_IN_MS;F.PasswordGrantConstants=M.PasswordGrantConstants;F.PerformanceEventStatus=M.PerformanceEventStatus;F.PerformanceEvents=M.PerformanceEvents;F.PersistentCacheKeys=M.PersistentCacheKeys;F.PlatformBrokerError=M.PlatformBrokerError;F.PopTokenGenerator=M.PopTokenGenerator;F.PromptValue=M.PromptValue;F.ProtocolMode=M.ProtocolMode;F.ProtocolUtils=M.ProtocolUtils;F.RefreshTokenClient=M.RefreshTokenClient;F.RequestParameterBuilder=M.RequestParameterBuilder;F.ResponseHandler=M.ResponseHandler;F.ResponseMode=M.ResponseMode;F.ScopeSet=M.ScopeSet;F.ServerError=M.ServerError;F.ServerResponseType=M.ServerResponseType;F.ServerTelemetryManager=M.ServerTelemetryManager;F.SilentFlowClient=M.SilentFlowClient;F.StringUtils=M.StringUtils;F.StubPerformanceClient=M.StubPerformanceClient;F.StubbedNetworkModule=M.StubbedNetworkModule;F.THE_FAMILY_ID=M.THE_FAMILY_ID;F.ThrottlingConstants=M.ThrottlingConstants;F.ThrottlingUtils=M.ThrottlingUtils;F.TimeUtils=M.TimeUtils;F.UrlString=M.UrlString;F.UrlUtils=M.UrlUtils;F.buildAccountToCache=M.buildAccountToCache;F.buildClientInfo=M.buildClientInfo;F.buildClientInfoFromHomeAccountId=M.buildClientInfoFromHomeAccountId;F.buildStaticAuthorityOptions=M.buildStaticAuthorityOptions;F.buildTenantProfile=M.buildTenantProfile;F.createAuthError=M.createAuthError;F.createCacheError=M.createCacheError;F.createClientAuthError=M.createClientAuthError;F.createClientConfigurationError=M.createClientConfigurationError;F.createInteractionRequiredAuthError=M.createInteractionRequiredAuthError;F.createNetworkError=M.createNetworkError;F.formatAuthorityUri=M.formatAuthorityUri;F.getRequestThumbprint=M.getRequestThumbprint;F.getTenantIdFromIdTokenClaims=M.getTenantIdFromIdTokenClaims;F.invoke=M.invoke;F.invokeAsync=M.invokeAsync;F.tenantIdMatchesHomeTenant=M.tenantIdMatchesHomeTenant;F.updateAccountTenantProfileData=M.updateAccountTenantProfileData;F.version=M.version;F.JoseHeader=SC;F.PerformanceClient=wC});var FD=g(U=>{"use strict";var q=TC(),xD=UD();U.AADAuthorityConstants=q.AADAuthorityConstants;U.AADServerParamKeys=q.AADServerParamKeys;U.AccountEntity=q.AccountEntity;U.AuthError=q.AuthError;U.AuthErrorCodes=q.AuthErrorCodes;U.AuthErrorMessage=q.AuthErrorMessage;U.AuthToken=q.AuthToken;U.AuthenticationHeaderParser=q.AuthenticationHeaderParser;U.AuthenticationScheme=q.AuthenticationScheme;U.Authority=q.Authority;U.AuthorityFactory=q.AuthorityFactory;U.AuthorityType=q.AuthorityType;U.AuthorizationCodeClient=q.AuthorizationCodeClient;U.AuthorizeProtocol=q.Authorize;U.AzureCloudInstance=q.AzureCloudInstance;U.BaseClient=q.BaseClient;U.CacheAccountType=q.CacheAccountType;U.CacheError=q.CacheError;U.CacheErrorCodes=q.CacheErrorCodes;U.CacheHelpers=q.CacheHelpers;U.CacheManager=q.CacheManager;U.CacheOutcome=q.CacheOutcome;U.CacheType=q.CacheType;U.CcsCredentialType=q.CcsCredentialType;U.ClaimsRequestKeys=q.ClaimsRequestKeys;U.ClientAssertionUtils=q.ClientAssertionUtils;U.ClientAuthError=q.ClientAuthError;U.ClientAuthErrorCodes=q.ClientAuthErrorCodes;U.ClientAuthErrorMessage=q.ClientAuthErrorMessage;U.ClientConfigurationError=q.ClientConfigurationError;U.ClientConfigurationErrorCodes=q.ClientConfigurationErrorCodes;U.ClientConfigurationErrorMessage=q.ClientConfigurationErrorMessage;U.CodeChallengeMethodValues=q.CodeChallengeMethodValues;U.Constants=q.Constants;U.CredentialType=q.CredentialType;U.DEFAULT_CRYPTO_IMPLEMENTATION=q.DEFAULT_CRYPTO_IMPLEMENTATION;U.DEFAULT_SYSTEM_OPTIONS=q.DEFAULT_SYSTEM_OPTIONS;U.DEFAULT_TOKEN_RENEWAL_OFFSET_SEC=q.DEFAULT_TOKEN_RENEWAL_OFFSET_SEC;U.DefaultStorageClass=q.DefaultStorageClass;U.EncodingTypes=q.EncodingTypes;U.Errors=q.Errors;U.GrantType=q.GrantType;U.HeaderNames=q.HeaderNames;U.HttpMethod=q.HttpMethod;U.HttpStatus=q.HttpStatus;U.IntFields=q.IntFields;U.InteractionRequiredAuthError=q.InteractionRequiredAuthError;U.InteractionRequiredAuthErrorCodes=q.InteractionRequiredAuthErrorCodes;U.InteractionRequiredAuthErrorMessage=q.InteractionRequiredAuthErrorMessage;U.JsonWebTokenTypes=q.JsonWebTokenTypes;Object.defineProperty(U,"LogLevel",{enumerable:!0,get:function(){return q.LogLevel}});U.Logger=q.Logger;U.NetworkError=q.NetworkError;U.OAuthResponseType=q.OAuthResponseType;U.OIDC_DEFAULT_SCOPES=q.OIDC_DEFAULT_SCOPES;U.ONE_DAY_IN_MS=q.ONE_DAY_IN_MS;U.PasswordGrantConstants=q.PasswordGrantConstants;U.PerformanceEventStatus=q.PerformanceEventStatus;U.PerformanceEvents=q.PerformanceEvents;U.PersistentCacheKeys=q.PersistentCacheKeys;U.PlatformBrokerError=q.PlatformBrokerError;U.PopTokenGenerator=q.PopTokenGenerator;U.PromptValue=q.PromptValue;U.ProtocolMode=q.ProtocolMode;U.ProtocolUtils=q.ProtocolUtils;U.RefreshTokenClient=q.RefreshTokenClient;U.RequestParameterBuilder=q.RequestParameterBuilder;U.ResponseHandler=q.ResponseHandler;U.ResponseMode=q.ResponseMode;U.ScopeSet=q.ScopeSet;U.ServerError=q.ServerError;U.ServerResponseType=q.ServerResponseType;U.ServerTelemetryManager=q.ServerTelemetryManager;U.SilentFlowClient=q.SilentFlowClient;U.StringUtils=q.StringUtils;U.StubPerformanceClient=q.StubPerformanceClient;U.StubbedNetworkModule=q.StubbedNetworkModule;U.THE_FAMILY_ID=q.THE_FAMILY_ID;U.ThrottlingConstants=q.ThrottlingConstants;U.ThrottlingUtils=q.ThrottlingUtils;U.TimeUtils=q.TimeUtils;U.TokenCacheContext=q.TokenCacheContext;U.UrlString=q.UrlString;U.UrlUtils=q.UrlUtils;U.buildAccountToCache=q.buildAccountToCache;U.buildClientInfo=q.buildClientInfo;U.buildClientInfoFromHomeAccountId=q.buildClientInfoFromHomeAccountId;U.buildStaticAuthorityOptions=q.buildStaticAuthorityOptions;U.buildTenantProfile=q.buildTenantProfile;U.createAuthError=q.createAuthError;U.createCacheError=q.createCacheError;U.createClientAuthError=q.createClientAuthError;U.createClientConfigurationError=q.createClientConfigurationError;U.createInteractionRequiredAuthError=q.createInteractionRequiredAuthError;U.createNetworkError=q.createNetworkError;U.formatAuthorityUri=q.formatAuthorityUri;U.getClientAssertion=q.getClientAssertion;U.getRequestThumbprint=q.getRequestThumbprint;U.getTenantIdFromIdTokenClaims=q.getTenantIdFromIdTokenClaims;U.invoke=q.invoke;U.invokeAsync=q.invokeAsync;U.tenantIdMatchesHomeTenant=q.tenantIdMatchesHomeTenant;U.updateAccountTenantProfileData=q.updateAccountTenantProfileData;U.version=q.version;U.JoseHeader=xD.JoseHeader;U.PerformanceClient=xD.PerformanceClient});var Po=g((IC,HD)=>{"use strict";var yp=x("buffer"),Hr=yp.Buffer;function qD(t,e){for(var n in t)e[n]=t[n]}Hr.from&&Hr.alloc&&Hr.allocUnsafe&&Hr.allocUnsafeSlow?HD.exports=yp:(qD(yp,IC),IC.Buffer=No);function No(t,e,n){return Hr(t,e,n)}No.prototype=Object.create(Hr.prototype);qD(Hr,No);No.from=function(t,e,n){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Hr(t,e,n)};No.alloc=function(t,e,n){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=Hr(t);return e!==void 0?typeof n=="string"?i.fill(e,n):i.fill(e):i.fill(0),i};No.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Hr(t)};No.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return yp.SlowBuffer(t)}});var vC=g((bwe,BD)=>{"use strict";var Ep=Po().Buffer,X4=x("stream"),Q4=x("util");function Tp(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Ep.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Ep.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}Q4.inherits(Tp,X4);Tp.prototype.write=function(e){this.buffer=Ep.concat([this.buffer,Ep.from(e)]),this.emit("data",e)};Tp.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};BD.exports=Tp});var YD=g((Owe,jD)=>{"use strict";function bC(t){var e=(t/8|0)+(t%8===0?0:1);return e}var Z4={ES256:bC(256),ES384:bC(384),ES512:bC(521)};function J4(t){var e=Z4[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}jD.exports=J4});var XD=g((Rwe,KD)=>{"use strict";var Ap=Po().Buffer,$D=YD(),Cp=128,zD=0,eK=32,tK=16,nK=2,GD=tK|eK|zD<<6,Sp=nK|zD<<6;function rK(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function WD(t){if(Ap.isBuffer(t))return t;if(typeof t=="string")return Ap.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function iK(t,e){t=WD(t);var n=$D(e),i=n+1,r=t.length,o=0;if(t[o++]!==GD)throw new Error('Could not find expected "seq"');var s=t[o++];if(s===(Cp|1)&&(s=t[o++]),r-o<s)throw new Error('"seq" specified length of "'+s+'", only "'+(r-o)+'" remaining');if(t[o++]!==Sp)throw new Error('Could not find expected "int" for "r"');var a=t[o++];if(r-o-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(r-o-2)+'" available');if(i<a)throw new Error('"r" specified length of "'+a+'", max of "'+i+'" is acceptable');var c=o;if(o+=a,t[o++]!==Sp)throw new Error('Could not find expected "int" for "s"');var u=t[o++];if(r-o!==u)throw new Error('"s" specified length of "'+u+'", expected "'+(r-o)+'"');if(i<u)throw new Error('"s" specified length of "'+u+'", max of "'+i+'" is acceptable');var l=o;if(o+=u,o!==r)throw new Error('Expected to consume entire buffer, but "'+(r-o)+'" bytes remain');var d=n-a,f=n-u,m=Ap.allocUnsafe(d+a+f+u);for(o=0;o<d;++o)m[o]=0;t.copy(m,o,c+Math.max(-d,0),c+a),o=n;for(var _=o;o<_+f;++o)m[o]=0;return t.copy(m,o,l+Math.max(-f,0),l+u),m=m.toString("base64"),m=rK(m),m}function VD(t,e,n){for(var i=0;e+i<n&&t[e+i]===0;)++i;var r=t[e+i]>=Cp;return r&&--i,i}function oK(t,e){t=WD(t);var n=$D(e),i=t.length;if(i!==n*2)throw new TypeError('"'+e+'" signatures must be "'+n*2+'" bytes, saw "'+i+'"');var r=VD(t,0,n),o=VD(t,n,t.length),s=n-r,a=n-o,c=2+s+1+1+a,u=c<Cp,l=Ap.allocUnsafe((u?2:3)+c),d=0;return l[d++]=GD,u?l[d++]=c:(l[d++]=Cp|1,l[d++]=c&255),l[d++]=Sp,l[d++]=s,r<0?(l[d++]=0,d+=t.copy(l,d,0,n)):d+=t.copy(l,d,r,n),l[d++]=Sp,l[d++]=a,o<0?(l[d++]=0,t.copy(l,d,n)):t.copy(l,d,n+o),l}KD.exports={derToJose:iK,joseToDer:oK}});var ZD=g((Nwe,QD)=>{"use strict";var Wu=x("buffer").Buffer,OC=x("buffer").SlowBuffer;QD.exports=wp;function wp(t,e){if(!Wu.isBuffer(t)||!Wu.isBuffer(e)||t.length!==e.length)return!1;for(var n=0,i=0;i<t.length;i++)n|=t[i]^e[i];return n===0}wp.install=function(){Wu.prototype.equal=OC.prototype.equal=function(e){return wp(this,e)}};var sK=Wu.prototype.equal,aK=OC.prototype.equal;wp.restore=function(){Wu.prototype.equal=sK,OC.prototype.equal=aK}});var DC=g((Pwe,aM)=>{"use strict";var Gs=Po().Buffer,Xn=x("crypto"),eM=XD(),JD=x("util"),cK=`"%s" is not a valid algorithm.
|
|
21
|
+
Supported algorithms are:
|
|
22
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Ku="secret must be a string or buffer",zs="key must be a string or a buffer",uK="key must be a string, a buffer or an object",NC=typeof Xn.createPublicKey=="function";NC&&(zs+=" or a KeyObject",Ku+="or a KeyObject");function tM(t){if(!Gs.isBuffer(t)&&typeof t!="string"&&(!NC||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Cr(zs)}function nM(t){if(!Gs.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Cr(uK)}function lK(t){if(!Gs.isBuffer(t)){if(typeof t=="string")return t;if(!NC||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Cr(Ku)}}function PC(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function rM(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var n=0;n<e;++n)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}function Cr(t){var e=[].slice.call(arguments,1),n=JD.format.bind(JD,t).apply(null,e);return new TypeError(n)}function dK(t){return Gs.isBuffer(t)||typeof t=="string"}function Xu(t){return dK(t)||(t=JSON.stringify(t)),t}function iM(t){return function(n,i){lK(i),n=Xu(n);var r=Xn.createHmac("sha"+t,i),o=(r.update(n),r.digest("base64"));return PC(o)}}var RC,hK="timingSafeEqual"in Xn?function(e,n){return e.byteLength!==n.byteLength?!1:Xn.timingSafeEqual(e,n)}:function(e,n){return RC||(RC=ZD()),RC(e,n)};function fK(t){return function(n,i,r){var o=iM(t)(n,r);return hK(Gs.from(i),Gs.from(o))}}function oM(t){return function(n,i){nM(i),n=Xu(n);var r=Xn.createSign("RSA-SHA"+t),o=(r.update(n),r.sign(i,"base64"));return PC(o)}}function sM(t){return function(n,i,r){tM(r),n=Xu(n),i=rM(i);var o=Xn.createVerify("RSA-SHA"+t);return o.update(n),o.verify(r,i,"base64")}}function pK(t){return function(n,i){nM(i),n=Xu(n);var r=Xn.createSign("RSA-SHA"+t),o=(r.update(n),r.sign({key:i,padding:Xn.constants.RSA_PKCS1_PSS_PADDING,saltLength:Xn.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return PC(o)}}function mK(t){return function(n,i,r){tM(r),n=Xu(n),i=rM(i);var o=Xn.createVerify("RSA-SHA"+t);return o.update(n),o.verify({key:r,padding:Xn.constants.RSA_PKCS1_PSS_PADDING,saltLength:Xn.constants.RSA_PSS_SALTLEN_DIGEST},i,"base64")}}function gK(t){var e=oM(t);return function(){var i=e.apply(null,arguments);return i=eM.derToJose(i,"ES"+t),i}}function _K(t){var e=sM(t);return function(i,r,o){r=eM.joseToDer(r,"ES"+t).toString("base64");var s=e(i,r,o);return s}}function yK(){return function(){return""}}function EK(){return function(e,n){return n===""}}aM.exports=function(e){var n={hs:iM,rs:oM,ps:pK,es:gK,none:yK},i={hs:fK,rs:sM,ps:mK,es:_K,none:EK},r=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!r)throw Cr(cK,e);var o=(r[1]||r[3]).toLowerCase(),s=r[2];return{sign:n[o](s),verify:i[o](s)}}});var MC=g((Dwe,cM)=>{"use strict";var TK=x("buffer").Buffer;cM.exports=function(e){return typeof e=="string"?e:typeof e=="number"||TK.isBuffer(e)?e.toString():JSON.stringify(e)}});var pM=g((Mwe,fM)=>{"use strict";var AK=Po().Buffer,uM=vC(),CK=DC(),SK=x("stream"),lM=MC(),kC=x("util");function dM(t,e){return AK.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function wK(t,e,n){n=n||"utf8";var i=dM(lM(t),"binary"),r=dM(lM(e),n);return kC.format("%s.%s",i,r)}function hM(t){var e=t.header,n=t.payload,i=t.secret||t.privateKey,r=t.encoding,o=CK(e.alg),s=wK(e,n,r),a=o.sign(s,i);return kC.format("%s.%s",s,a)}function Ip(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var n=new uM(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=n,this.payload=new uM(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}kC.inherits(Ip,SK);Ip.prototype.sign=function(){try{var e=hM({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};Ip.sign=hM;fM.exports=Ip});var wM=g((kwe,SM)=>{"use strict";var gM=Po().Buffer,mM=vC(),IK=DC(),vK=x("stream"),_M=MC(),bK=x("util"),OK=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function RK(t){return Object.prototype.toString.call(t)==="[object Object]"}function NK(t){if(RK(t))return t;try{return JSON.parse(t)}catch{return}}function yM(t){var e=t.split(".",1)[0];return NK(gM.from(e,"base64").toString("binary"))}function PK(t){return t.split(".",2).join(".")}function EM(t){return t.split(".")[2]}function DK(t,e){e=e||"utf8";var n=t.split(".")[1];return gM.from(n,"base64").toString(e)}function TM(t){return OK.test(t)&&!!yM(t)}function AM(t,e,n){if(!e){var i=new Error("Missing algorithm parameter for jws.verify");throw i.code="MISSING_ALGORITHM",i}t=_M(t);var r=EM(t),o=PK(t),s=IK(e);return s.verify(o,r,n)}function CM(t,e){if(e=e||{},t=_M(t),!TM(t))return null;var n=yM(t);if(!n)return null;var i=DK(t);return(n.typ==="JWT"||e.json)&&(i=JSON.parse(i,e.encoding)),{header:n,payload:i,signature:EM(t)}}function Ws(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var n=new mM(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=n,this.signature=new mM(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}bK.inherits(Ws,vK);Ws.prototype.verify=function(){try{var e=AM(this.signature.buffer,this.algorithm,this.key.buffer),n=CM(this.signature.buffer,this.encoding);return this.emit("done",e,n),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(i){this.readable=!1,this.emit("error",i),this.emit("close")}};Ws.decode=CM;Ws.isValid=TM;Ws.verify=AM;SM.exports=Ws});var bp=g($i=>{"use strict";var IM=pM(),vp=wM(),MK=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];$i.ALGORITHMS=MK;$i.sign=IM.sign;$i.verify=vp.verify;$i.decode=vp.decode;$i.isValid=vp.isValid;$i.createSign=function(e){return new IM(e)};$i.createVerify=function(e){return new vp(e)}});var LC=g((Uwe,vM)=>{"use strict";var kK=bp();vM.exports=function(t,e){e=e||{};var n=kK.decode(t,e);if(!n)return null;var i=n.payload;if(typeof i=="string")try{var r=JSON.parse(i);r!==null&&typeof r=="object"&&(i=r)}catch{}return e.complete===!0?{header:n.header,payload:i,signature:n.signature}:i}});var Qu=g((xwe,bM)=>{"use strict";var Op=function(t,e){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,e&&(this.inner=e)};Op.prototype=Object.create(Error.prototype);Op.prototype.constructor=Op;bM.exports=Op});var UC=g((Fwe,RM)=>{"use strict";var OM=Qu(),Rp=function(t,e){OM.call(this,t),this.name="NotBeforeError",this.date=e};Rp.prototype=Object.create(OM.prototype);Rp.prototype.constructor=Rp;RM.exports=Rp});var xC=g((qwe,PM)=>{"use strict";var NM=Qu(),Np=function(t,e){NM.call(this,t),this.name="TokenExpiredError",this.expiredAt=e};Np.prototype=Object.create(NM.prototype);Np.prototype.constructor=Np;PM.exports=Np});var FC=g((Hwe,DM)=>{"use strict";var Ks=1e3,Xs=Ks*60,Qs=Xs*60,Do=Qs*24,LK=Do*7,UK=Do*365.25;DM.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return xK(t);if(n==="number"&&isFinite(t))return e.long?qK(t):FK(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function xK(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return n*UK;case"weeks":case"week":case"w":return n*LK;case"days":case"day":case"d":return n*Do;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Qs;case"minutes":case"minute":case"mins":case"min":case"m":return n*Xs;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ks;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function FK(t){var e=Math.abs(t);return e>=Do?Math.round(t/Do)+"d":e>=Qs?Math.round(t/Qs)+"h":e>=Xs?Math.round(t/Xs)+"m":e>=Ks?Math.round(t/Ks)+"s":t+"ms"}function qK(t){var e=Math.abs(t);return e>=Do?Pp(t,e,Do,"day"):e>=Qs?Pp(t,e,Qs,"hour"):e>=Xs?Pp(t,e,Xs,"minute"):e>=Ks?Pp(t,e,Ks,"second"):t+" ms"}function Pp(t,e,n,i){var r=e>=n*1.5;return Math.round(t/n)+" "+i+(r?"s":"")}});var qC=g((Bwe,MM)=>{"use strict";var HK=FC();MM.exports=function(t,e){var n=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var i=HK(t);return typeof i>"u"?void 0:Math.floor(n+i/1e3)}else return typeof t=="number"?n+t:void 0}});var Zu=g((jwe,kM)=>{"use strict";var BK="2.0.0",jK=Number.MAX_SAFE_INTEGER||9007199254740991,YK=16,VK=250,$K=["major","premajor","minor","preminor","patch","prepatch","prerelease"];kM.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:YK,MAX_SAFE_BUILD_LENGTH:VK,MAX_SAFE_INTEGER:jK,RELEASE_TYPES:$K,SEMVER_SPEC_VERSION:BK,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Ju=g((Ywe,LM)=>{"use strict";var zK=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};LM.exports=zK});var Zs=g((Br,UM)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:HC,MAX_SAFE_BUILD_LENGTH:GK,MAX_LENGTH:WK}=Zu(),KK=Ju();Br=UM.exports={};var XK=Br.re=[],QK=Br.safeRe=[],z=Br.src=[],ZK=Br.safeSrc=[],G=Br.t={},JK=0,BC="[a-zA-Z0-9-]",e8=[["\\s",1],["\\d",WK],[BC,GK]],t8=t=>{for(let[e,n]of e8)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},pe=(t,e,n)=>{let i=t8(e),r=JK++;KK(t,r,e),G[t]=r,z[r]=e,ZK[r]=i,XK[r]=new RegExp(e,n?"g":void 0),QK[r]=new RegExp(i,n?"g":void 0)};pe("NUMERICIDENTIFIER","0|[1-9]\\d*");pe("NUMERICIDENTIFIERLOOSE","\\d+");pe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${BC}*`);pe("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);pe("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);pe("PRERELEASEIDENTIFIER",`(?:${z[G.NONNUMERICIDENTIFIER]}|${z[G.NUMERICIDENTIFIER]})`);pe("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NONNUMERICIDENTIFIER]}|${z[G.NUMERICIDENTIFIERLOOSE]})`);pe("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);pe("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);pe("BUILDIDENTIFIER",`${BC}+`);pe("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);pe("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);pe("FULL",`^${z[G.FULLPLAIN]}$`);pe("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);pe("LOOSE",`^${z[G.LOOSEPLAIN]}$`);pe("GTLT","((?:<|>)?=?)");pe("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);pe("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);pe("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);pe("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);pe("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);pe("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);pe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${HC}})(?:\\.(\\d{1,${HC}}))?(?:\\.(\\d{1,${HC}}))?`);pe("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);pe("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);pe("COERCERTL",z[G.COERCE],!0);pe("COERCERTLFULL",z[G.COERCEFULL],!0);pe("LONETILDE","(?:~>?)");pe("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);Br.tildeTrimReplace="$1~";pe("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);pe("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);pe("LONECARET","(?:\\^)");pe("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);Br.caretTrimReplace="$1^";pe("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);pe("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);pe("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);pe("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);pe("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);Br.comparatorTrimReplace="$1$2$3";pe("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);pe("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);pe("STAR","(<|>)?=?\\s*\\*");pe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");pe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Dp=g((Vwe,xM)=>{"use strict";var n8=Object.freeze({loose:!0}),r8=Object.freeze({}),i8=t=>t?typeof t!="object"?n8:t:r8;xM.exports=i8});var jC=g(($we,HM)=>{"use strict";var FM=/^[0-9]+$/,qM=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=FM.test(t),i=FM.test(e);return n&&i&&(t=+t,e=+e),t===e?0:n&&!i?-1:i&&!n?1:t<e?-1:1},o8=(t,e)=>qM(e,t);HM.exports={compareIdentifiers:qM,rcompareIdentifiers:o8}});var Kt=g((zwe,jM)=>{"use strict";var Mp=Ju(),{MAX_LENGTH:BM,MAX_SAFE_INTEGER:kp}=Zu(),{safeRe:Lp,t:Up}=Zs(),s8=Dp(),{compareIdentifiers:YC}=jC(),VC=class t{constructor(e,n){if(n=s8(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>BM)throw new TypeError(`version is longer than ${BM} characters`);Mp("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=e.trim().match(n.loose?Lp[Up.LOOSE]:Lp[Up.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>kp||this.major<0)throw new TypeError("Invalid major version");if(this.minor>kp||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>kp||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){let o=+r;if(o>=0&&o<kp)return o}return r}):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(e){if(Mp("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let i=this.prerelease[n],r=e.prerelease[n];if(Mp("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return YC(i,r)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let i=this.build[n],r=e.build[n];if(Mp("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return YC(i,r)}while(++n)}inc(e,n,i){if(e.startsWith("pre")){if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let r=`-${n}`.match(this.options.loose?Lp[Up.PRERELEASELOOSE]:Lp[Up.PRERELEASE]);if(!r||r[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let r=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let o=[n,r];i===!1&&(o=[n]),YC(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};jM.exports=VC});var Mo=g((Gwe,VM)=>{"use strict";var YM=Kt(),a8=(t,e,n=!1)=>{if(t instanceof YM)return t;try{return new YM(t,e)}catch(i){if(!n)return null;throw i}};VM.exports=a8});var zM=g((Wwe,$M)=>{"use strict";var c8=Mo(),u8=(t,e)=>{let n=c8(t,e);return n?n.version:null};$M.exports=u8});var WM=g((Kwe,GM)=>{"use strict";var l8=Mo(),d8=(t,e)=>{let n=l8(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};GM.exports=d8});var QM=g((Xwe,XM)=>{"use strict";var KM=Kt(),h8=(t,e,n,i,r)=>{typeof n=="string"&&(r=i,i=n,n=void 0);try{return new KM(t instanceof KM?t.version:t,n).inc(e,i,r).version}catch{return null}};XM.exports=h8});var ek=g((Qwe,JM)=>{"use strict";var ZM=Mo(),f8=(t,e)=>{let n=ZM(t,null,!0),i=ZM(e,null,!0),r=n.compare(i);if(r===0)return null;let o=r>0,s=o?n:i,a=o?i:n,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return n.major!==i.major?l+"major":n.minor!==i.minor?l+"minor":n.patch!==i.patch?l+"patch":"prerelease"};JM.exports=f8});var nk=g((Zwe,tk)=>{"use strict";var p8=Kt(),m8=(t,e)=>new p8(t,e).major;tk.exports=m8});var ik=g((Jwe,rk)=>{"use strict";var g8=Kt(),_8=(t,e)=>new g8(t,e).minor;rk.exports=_8});var sk=g((eIe,ok)=>{"use strict";var y8=Kt(),E8=(t,e)=>new y8(t,e).patch;ok.exports=E8});var ck=g((tIe,ak)=>{"use strict";var T8=Mo(),A8=(t,e)=>{let n=T8(t,e);return n&&n.prerelease.length?n.prerelease:null};ak.exports=A8});var Qn=g((nIe,lk)=>{"use strict";var uk=Kt(),C8=(t,e,n)=>new uk(t,n).compare(new uk(e,n));lk.exports=C8});var hk=g((rIe,dk)=>{"use strict";var S8=Qn(),w8=(t,e,n)=>S8(e,t,n);dk.exports=w8});var pk=g((iIe,fk)=>{"use strict";var I8=Qn(),v8=(t,e)=>I8(t,e,!0);fk.exports=v8});var xp=g((oIe,gk)=>{"use strict";var mk=Kt(),b8=(t,e,n)=>{let i=new mk(t,n),r=new mk(e,n);return i.compare(r)||i.compareBuild(r)};gk.exports=b8});var yk=g((sIe,_k)=>{"use strict";var O8=xp(),R8=(t,e)=>t.sort((n,i)=>O8(n,i,e));_k.exports=R8});var Tk=g((aIe,Ek)=>{"use strict";var N8=xp(),P8=(t,e)=>t.sort((n,i)=>N8(i,n,e));Ek.exports=P8});var el=g((cIe,Ak)=>{"use strict";var D8=Qn(),M8=(t,e,n)=>D8(t,e,n)>0;Ak.exports=M8});var Fp=g((uIe,Ck)=>{"use strict";var k8=Qn(),L8=(t,e,n)=>k8(t,e,n)<0;Ck.exports=L8});var $C=g((lIe,Sk)=>{"use strict";var U8=Qn(),x8=(t,e,n)=>U8(t,e,n)===0;Sk.exports=x8});var zC=g((dIe,wk)=>{"use strict";var F8=Qn(),q8=(t,e,n)=>F8(t,e,n)!==0;wk.exports=q8});var qp=g((hIe,Ik)=>{"use strict";var H8=Qn(),B8=(t,e,n)=>H8(t,e,n)>=0;Ik.exports=B8});var Hp=g((fIe,vk)=>{"use strict";var j8=Qn(),Y8=(t,e,n)=>j8(t,e,n)<=0;vk.exports=Y8});var GC=g((pIe,bk)=>{"use strict";var V8=$C(),$8=zC(),z8=el(),G8=qp(),W8=Fp(),K8=Hp(),X8=(t,e,n,i)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return V8(t,n,i);case"!=":return $8(t,n,i);case">":return z8(t,n,i);case">=":return G8(t,n,i);case"<":return W8(t,n,i);case"<=":return K8(t,n,i);default:throw new TypeError(`Invalid operator: ${e}`)}};bk.exports=X8});var Rk=g((mIe,Ok)=>{"use strict";var Q8=Kt(),Z8=Mo(),{safeRe:Bp,t:jp}=Zs(),J8=(t,e)=>{if(t instanceof Q8)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Bp[jp.COERCEFULL]:Bp[jp.COERCE]);else{let c=e.includePrerelease?Bp[jp.COERCERTLFULL]:Bp[jp.COERCERTL],u;for(;(u=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||u.index+u[0].length!==n.index+n[0].length)&&(n=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(n===null)return null;let i=n[2],r=n[3]||"0",o=n[4]||"0",s=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return Z8(`${i}.${r}.${o}${s}${a}`,e)};Ok.exports=J8});var Pk=g((gIe,Nk)=>{"use strict";var WC=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let r=this.map.keys().next().value;this.delete(r)}this.map.set(e,n)}return this}};Nk.exports=WC});var Zn=g((_Ie,Lk)=>{"use strict";var e5=/\s+/g,KC=class t{constructor(e,n){if(n=n5(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof XC)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(e5," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(r=>!Mk(r[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&u5(r[0])){this.set=[r];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let i=0;i<n.length;i++)i>0&&(this.formatted+=" "),this.formatted+=n[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let i=((this.options.includePrerelease&&a5)|(this.options.loose&&c5))+":"+e,r=Dk.get(i);if(r)return r;let o=this.options.loose,s=o?dn[Xt.HYPHENRANGELOOSE]:dn[Xt.HYPHENRANGE];e=e.replace(s,E5(this.options.includePrerelease)),Qe("hyphen replace",e),e=e.replace(dn[Xt.COMPARATORTRIM],i5),Qe("comparator trim",e),e=e.replace(dn[Xt.TILDETRIM],o5),Qe("tilde trim",e),e=e.replace(dn[Xt.CARETTRIM],s5),Qe("caret trim",e);let a=e.split(" ").map(d=>l5(d,this.options)).join(" ").split(/\s+/).map(d=>y5(d,this.options));o&&(a=a.filter(d=>(Qe("loose invalid filter",d,this.options),!!d.match(dn[Xt.COMPARATORLOOSE])))),Qe("range list",a);let c=new Map,u=a.map(d=>new XC(d,this.options));for(let d of u){if(Mk(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return Dk.set(i,l),l}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>kk(i,n)&&e.set.some(r=>kk(r,n)&&i.every(o=>r.every(s=>o.intersects(s,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new r5(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(T5(this.set[n],e,this.options))return!0;return!1}};Lk.exports=KC;var t5=Pk(),Dk=new t5,n5=Dp(),XC=tl(),Qe=Ju(),r5=Kt(),{safeRe:dn,t:Xt,comparatorTrimReplace:i5,tildeTrimReplace:o5,caretTrimReplace:s5}=Zs(),{FLAG_INCLUDE_PRERELEASE:a5,FLAG_LOOSE:c5}=Zu(),Mk=t=>t.value==="<0.0.0-0",u5=t=>t.value==="",kk=(t,e)=>{let n=!0,i=t.slice(),r=i.pop();for(;n&&i.length;)n=i.every(o=>r.intersects(o,e)),r=i.pop();return n},l5=(t,e)=>(t=t.replace(dn[Xt.BUILD],""),Qe("comp",t,e),t=f5(t,e),Qe("caret",t),t=d5(t,e),Qe("tildes",t),t=m5(t,e),Qe("xrange",t),t=_5(t,e),Qe("stars",t),t),hn=t=>!t||t.toLowerCase()==="x"||t==="*",d5=(t,e)=>t.trim().split(/\s+/).map(n=>h5(n,e)).join(" "),h5=(t,e)=>{let n=e.loose?dn[Xt.TILDELOOSE]:dn[Xt.TILDE];return t.replace(n,(i,r,o,s,a)=>{Qe("tilde",t,i,r,o,s,a);let c;return hn(r)?c="":hn(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:hn(s)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?(Qe("replaceTilde pr",a),c=`>=${r}.${o}.${s}-${a} <${r}.${+o+1}.0-0`):c=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,Qe("tilde return",c),c})},f5=(t,e)=>t.trim().split(/\s+/).map(n=>p5(n,e)).join(" "),p5=(t,e)=>{Qe("caret",t,e);let n=e.loose?dn[Xt.CARETLOOSE]:dn[Xt.CARET],i=e.includePrerelease?"-0":"";return t.replace(n,(r,o,s,a,c)=>{Qe("caret",t,r,o,s,a,c);let u;return hn(o)?u="":hn(s)?u=`>=${o}.0.0${i} <${+o+1}.0.0-0`:hn(a)?o==="0"?u=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(Qe("replaceCaret pr",c),o==="0"?s==="0"?u=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(Qe("no pr"),o==="0"?s==="0"?u=`>=${o}.${s}.${a}${i} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}${i} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Qe("caret return",u),u})},m5=(t,e)=>(Qe("replaceXRanges",t,e),t.split(/\s+/).map(n=>g5(n,e)).join(" ")),g5=(t,e)=>{t=t.trim();let n=e.loose?dn[Xt.XRANGELOOSE]:dn[Xt.XRANGE];return t.replace(n,(i,r,o,s,a,c)=>{Qe("xRange",t,i,r,o,s,a,c);let u=hn(o),l=u||hn(s),d=l||hn(a),f=d;return r==="="&&f&&(r=""),c=e.includePrerelease?"-0":"",u?r===">"||r==="<"?i="<0.0.0-0":i="*":r&&f?(l&&(s=0),a=0,r===">"?(r=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):r==="<="&&(r="<",l?o=+o+1:s=+s+1),r==="<"&&(c="-0"),i=`${r+o}.${s}.${a}${c}`):l?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),Qe("xRange return",i),i})},_5=(t,e)=>(Qe("replaceStars",t,e),t.trim().replace(dn[Xt.STAR],"")),y5=(t,e)=>(Qe("replaceGTE0",t,e),t.trim().replace(dn[e.includePrerelease?Xt.GTE0PRE:Xt.GTE0],"")),E5=t=>(e,n,i,r,o,s,a,c,u,l,d,f)=>(hn(i)?n="":hn(r)?n=`>=${i}.0.0${t?"-0":""}`:hn(o)?n=`>=${i}.${r}.0${t?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,hn(u)?c="":hn(l)?c=`<${+u+1}.0.0-0`:hn(d)?c=`<${u}.${+l+1}.0-0`:f?c=`<=${u}.${l}.${d}-${f}`:t?c=`<${u}.${l}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),T5=(t,e,n)=>{for(let i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let i=0;i<t.length;i++)if(Qe(t[i].semver),t[i].semver!==XC.ANY&&t[i].semver.prerelease.length>0){let r=t[i].semver;if(r.major===e.major&&r.minor===e.minor&&r.patch===e.patch)return!0}return!1}return!0}});var tl=g((yIe,Bk)=>{"use strict";var nl=Symbol("SemVer ANY"),JC=class t{static get ANY(){return nl}constructor(e,n){if(n=Uk(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),ZC("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===nl?this.value="":this.value=this.operator+this.semver.version,ZC("comp",this)}parse(e){let n=this.options.loose?xk[Fk.COMPARATORLOOSE]:xk[Fk.COMPARATOR],i=e.match(n);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new qk(i[2],this.options.loose):this.semver=nl}toString(){return this.value}test(e){if(ZC("Comparator.test",e,this.options.loose),this.semver===nl||e===nl)return!0;if(typeof e=="string")try{e=new qk(e,this.options)}catch{return!1}return QC(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Hk(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new Hk(this.value,n).test(e.semver):(n=Uk(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||QC(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||QC(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Bk.exports=JC;var Uk=Dp(),{safeRe:xk,t:Fk}=Zs(),QC=GC(),ZC=Ju(),qk=Kt(),Hk=Zn()});var rl=g((EIe,jk)=>{"use strict";var A5=Zn(),C5=(t,e,n)=>{try{e=new A5(e,n)}catch{return!1}return e.test(t)};jk.exports=C5});var Vk=g((TIe,Yk)=>{"use strict";var S5=Zn(),w5=(t,e)=>new S5(t,e).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));Yk.exports=w5});var zk=g((AIe,$k)=>{"use strict";var I5=Kt(),v5=Zn(),b5=(t,e,n)=>{let i=null,r=null,o=null;try{o=new v5(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===-1)&&(i=s,r=new I5(i,n))}),i};$k.exports=b5});var Wk=g((CIe,Gk)=>{"use strict";var O5=Kt(),R5=Zn(),N5=(t,e,n)=>{let i=null,r=null,o=null;try{o=new R5(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===1)&&(i=s,r=new O5(i,n))}),i};Gk.exports=N5});var Qk=g((SIe,Xk)=>{"use strict";var eS=Kt(),P5=Zn(),Kk=el(),D5=(t,e)=>{t=new P5(t,e);let n=new eS("0.0.0");if(t.test(n)||(n=new eS("0.0.0-0"),t.test(n)))return n;n=null;for(let i=0;i<t.set.length;++i){let r=t.set[i],o=null;r.forEach(s=>{let a=new eS(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||Kk(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||Kk(n,o))&&(n=o)}return n&&t.test(n)?n:null};Xk.exports=D5});var Jk=g((wIe,Zk)=>{"use strict";var M5=Zn(),k5=(t,e)=>{try{return new M5(t,e).range||"*"}catch{return null}};Zk.exports=k5});var Yp=g((IIe,rL)=>{"use strict";var L5=Kt(),nL=tl(),{ANY:U5}=nL,x5=Zn(),F5=rl(),eL=el(),tL=Fp(),q5=Hp(),H5=qp(),B5=(t,e,n,i)=>{t=new L5(t,i),e=new x5(e,i);let r,o,s,a,c;switch(n){case">":r=eL,o=q5,s=tL,a=">",c=">=";break;case"<":r=tL,o=H5,s=eL,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(F5(t,e,i))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],d=null,f=null;if(l.forEach(m=>{m.semver===U5&&(m=new nL(">=0.0.0")),d=d||m,f=f||m,r(m.semver,d.semver,i)?d=m:s(m.semver,f.semver,i)&&(f=m)}),d.operator===a||d.operator===c||(!f.operator||f.operator===a)&&o(t,f.semver))return!1;if(f.operator===c&&s(t,f.semver))return!1}return!0};rL.exports=B5});var oL=g((vIe,iL)=>{"use strict";var j5=Yp(),Y5=(t,e,n)=>j5(t,e,">",n);iL.exports=Y5});var aL=g((bIe,sL)=>{"use strict";var V5=Yp(),$5=(t,e,n)=>V5(t,e,"<",n);sL.exports=$5});var lL=g((OIe,uL)=>{"use strict";var cL=Zn(),z5=(t,e,n)=>(t=new cL(t,n),e=new cL(e,n),t.intersects(e,n));uL.exports=z5});var hL=g((RIe,dL)=>{"use strict";var G5=rl(),W5=Qn();dL.exports=(t,e,n)=>{let i=[],r=null,o=null,s=t.sort((l,d)=>W5(l,d,n));for(let l of s)G5(l,e,n)?(o=l,r||(r=l)):(o&&i.push([r,o]),o=null,r=null);r&&i.push([r,null]);let a=[];for(let[l,d]of i)l===d?a.push(l):!d&&l===s[0]?a.push("*"):d?l===s[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e}});var yL=g((NIe,_L)=>{"use strict";var fL=Zn(),nS=tl(),{ANY:tS}=nS,il=rl(),rS=Qn(),K5=(t,e,n={})=>{if(t===e)return!0;t=new fL(t,n),e=new fL(e,n);let i=!1;e:for(let r of t.set){for(let o of e.set){let s=Q5(r,o,n);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},X5=[new nS(">=0.0.0-0")],pL=[new nS(">=0.0.0")],Q5=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===tS){if(e.length===1&&e[0].semver===tS)return!0;n.includePrerelease?t=X5:t=pL}if(e.length===1&&e[0].semver===tS){if(n.includePrerelease)return!0;e=pL}let i=new Set,r,o;for(let m of t)m.operator===">"||m.operator===">="?r=mL(r,m,n):m.operator==="<"||m.operator==="<="?o=gL(o,m,n):i.add(m.semver);if(i.size>1)return null;let s;if(r&&o){if(s=rS(r.semver,o.semver,n),s>0)return null;if(s===0&&(r.operator!==">="||o.operator!=="<="))return null}for(let m of i){if(r&&!il(m,String(r),n)||o&&!il(m,String(o),n))return null;for(let _ of e)if(!il(m,String(_),n))return!1;return!0}let a,c,u,l,d=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=r&&!n.includePrerelease&&r.semver.prerelease.length?r.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let m of e){if(l=l||m.operator===">"||m.operator===">=",u=u||m.operator==="<"||m.operator==="<=",r){if(f&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===f.major&&m.semver.minor===f.minor&&m.semver.patch===f.patch&&(f=!1),m.operator===">"||m.operator===">="){if(a=mL(r,m,n),a===m&&a!==r)return!1}else if(r.operator===">="&&!il(r.semver,String(m),n))return!1}if(o){if(d&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch&&(d=!1),m.operator==="<"||m.operator==="<="){if(c=gL(o,m,n),c===m&&c!==o)return!1}else if(o.operator==="<="&&!il(o.semver,String(m),n))return!1}if(!m.operator&&(o||r)&&s!==0)return!1}return!(r&&u&&!o&&s!==0||o&&l&&!r&&s!==0||f||d)},mL=(t,e,n)=>{if(!t)return e;let i=rS(t.semver,e.semver,n);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},gL=(t,e,n)=>{if(!t)return e;let i=rS(t.semver,e.semver,n);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};_L.exports=K5});var Vp=g((PIe,AL)=>{"use strict";var iS=Zs(),EL=Zu(),Z5=Kt(),TL=jC(),J5=Mo(),e9=zM(),t9=WM(),n9=QM(),r9=ek(),i9=nk(),o9=ik(),s9=sk(),a9=ck(),c9=Qn(),u9=hk(),l9=pk(),d9=xp(),h9=yk(),f9=Tk(),p9=el(),m9=Fp(),g9=$C(),_9=zC(),y9=qp(),E9=Hp(),T9=GC(),A9=Rk(),C9=tl(),S9=Zn(),w9=rl(),I9=Vk(),v9=zk(),b9=Wk(),O9=Qk(),R9=Jk(),N9=Yp(),P9=oL(),D9=aL(),M9=lL(),k9=hL(),L9=yL();AL.exports={parse:J5,valid:e9,clean:t9,inc:n9,diff:r9,major:i9,minor:o9,patch:s9,prerelease:a9,compare:c9,rcompare:u9,compareLoose:l9,compareBuild:d9,sort:h9,rsort:f9,gt:p9,lt:m9,eq:g9,neq:_9,gte:y9,lte:E9,cmp:T9,coerce:A9,Comparator:C9,Range:S9,satisfies:w9,toComparators:I9,maxSatisfying:v9,minSatisfying:b9,minVersion:O9,validRange:R9,outside:N9,gtr:P9,ltr:D9,intersects:M9,simplifyRange:k9,subset:L9,SemVer:Z5,re:iS.re,src:iS.src,tokens:iS.t,SEMVER_SPEC_VERSION:EL.SEMVER_SPEC_VERSION,RELEASE_TYPES:EL.RELEASE_TYPES,compareIdentifiers:TL.compareIdentifiers,rcompareIdentifiers:TL.rcompareIdentifiers}});var SL=g((DIe,CL)=>{"use strict";var U9=Vp();CL.exports=U9.satisfies(process.version,">=15.7.0")});var IL=g((MIe,wL)=>{"use strict";var x9=Vp();wL.exports=x9.satisfies(process.version,">=16.9.0")});var oS=g((kIe,vL)=>{"use strict";var F9=SL(),q9=IL(),H9={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},B9={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};vL.exports=function(t,e){if(!t||!e)return;let n=e.asymmetricKeyType;if(!n)return;let i=H9[n];if(!i)throw new Error(`Unknown key type "${n}".`);if(!i.includes(t))throw new Error(`"alg" parameter for "${n}" key type must be one of: ${i.join(", ")}.`);if(F9)switch(n){case"ec":let r=e.asymmetricKeyDetails.namedCurve,o=B9[t];if(r!==o)throw new Error(`"alg" parameter "${t}" requires curve "${o}".`);break;case"rsa-pss":if(q9){let s=parseInt(t.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:c,saltLength:u}=e.asymmetricKeyDetails;if(a!==`sha${s}`||c!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(u!==void 0&&u>s>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}break}}});var sS=g((LIe,bL)=>{"use strict";var j9=Vp();bL.exports=j9.satisfies(process.version,"^6.12.0 || >=8.0.0")});var NL=g((UIe,RL)=>{"use strict";var Ge=Qu(),Y9=UC(),OL=xC(),V9=LC(),$9=qC(),z9=oS(),G9=sS(),W9=bp(),{KeyObject:K9,createSecretKey:X9,createPublicKey:Q9}=x("crypto"),aS=["RS256","RS384","RS512"],Z9=["ES256","ES384","ES512"],cS=["RS256","RS384","RS512"],J9=["HS256","HS384","HS512"];G9&&(aS.splice(aS.length,0,"PS256","PS384","PS512"),cS.splice(cS.length,0,"PS256","PS384","PS512"));RL.exports=function(t,e,n,i){typeof n=="function"&&!i&&(i=n,n={}),n||(n={}),n=Object.assign({},n);let r;if(i?r=i:r=function(l,d){if(l)throw l;return d},n.clockTimestamp&&typeof n.clockTimestamp!="number")return r(new Ge("clockTimestamp must be a number"));if(n.nonce!==void 0&&(typeof n.nonce!="string"||n.nonce.trim()===""))return r(new Ge("nonce must be a non-empty string"));if(n.allowInvalidAsymmetricKeyTypes!==void 0&&typeof n.allowInvalidAsymmetricKeyTypes!="boolean")return r(new Ge("allowInvalidAsymmetricKeyTypes must be a boolean"));let o=n.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return r(new Ge("jwt must be provided"));if(typeof t!="string")return r(new Ge("jwt must be a string"));let s=t.split(".");if(s.length!==3)return r(new Ge("jwt malformed"));let a;try{a=V9(t,{complete:!0})}catch(l){return r(l)}if(!a)return r(new Ge("invalid token"));let c=a.header,u;if(typeof e=="function"){if(!i)return r(new Ge("verify must be called asynchronous if secret or public key is provided as a callback"));u=e}else u=function(l,d){return d(null,e)};return u(c,function(l,d){if(l)return r(new Ge("error in secret or public key callback: "+l.message));let f=s[2].trim()!=="";if(!f&&d)return r(new Ge("jwt signature is required"));if(f&&!d)return r(new Ge("secret or public key must be provided"));if(!f&&!n.algorithms)return r(new Ge('please specify "none" in "algorithms" to verify unsigned tokens'));if(d!=null&&!(d instanceof K9))try{d=Q9(d)}catch{try{d=X9(typeof d=="string"?Buffer.from(d):d)}catch{return r(new Ge("secretOrPublicKey is not valid key material"))}}if(n.algorithms||(d.type==="secret"?n.algorithms=J9:["rsa","rsa-pss"].includes(d.asymmetricKeyType)?n.algorithms=cS:d.asymmetricKeyType==="ec"?n.algorithms=Z9:n.algorithms=aS),n.algorithms.indexOf(a.header.alg)===-1)return r(new Ge("invalid algorithm"));if(c.alg.startsWith("HS")&&d.type!=="secret")return r(new Ge(`secretOrPublicKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)&&d.type!=="public")return r(new Ge(`secretOrPublicKey must be an asymmetric key when using ${c.alg}`));if(!n.allowInvalidAsymmetricKeyTypes)try{z9(c.alg,d)}catch(E){return r(E)}let m;try{m=W9.verify(t,a.header.alg,d)}catch(E){return r(E)}if(!m)return r(new Ge("invalid signature"));let _=a.payload;if(typeof _.nbf<"u"&&!n.ignoreNotBefore){if(typeof _.nbf!="number")return r(new Ge("invalid nbf value"));if(_.nbf>o+(n.clockTolerance||0))return r(new Y9("jwt not active",new Date(_.nbf*1e3)))}if(typeof _.exp<"u"&&!n.ignoreExpiration){if(typeof _.exp!="number")return r(new Ge("invalid exp value"));if(o>=_.exp+(n.clockTolerance||0))return r(new OL("jwt expired",new Date(_.exp*1e3)))}if(n.audience){let E=Array.isArray(n.audience)?n.audience:[n.audience];if(!(Array.isArray(_.aud)?_.aud:[_.aud]).some(function(A){return E.some(function(S){return S instanceof RegExp?S.test(A):S===A})}))return r(new Ge("jwt audience invalid. expected: "+E.join(" or ")))}if(n.issuer&&(typeof n.issuer=="string"&&_.iss!==n.issuer||Array.isArray(n.issuer)&&n.issuer.indexOf(_.iss)===-1))return r(new Ge("jwt issuer invalid. expected: "+n.issuer));if(n.subject&&_.sub!==n.subject)return r(new Ge("jwt subject invalid. expected: "+n.subject));if(n.jwtid&&_.jti!==n.jwtid)return r(new Ge("jwt jwtid invalid. expected: "+n.jwtid));if(n.nonce&&_.nonce!==n.nonce)return r(new Ge("jwt nonce invalid. expected: "+n.nonce));if(n.maxAge){if(typeof _.iat!="number")return r(new Ge("iat required when maxAge is specified"));let E=$9(n.maxAge,_.iat);if(typeof E>"u")return r(new Ge('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(o>=E+(n.clockTolerance||0))return r(new OL("maxAge exceeded",new Date(E*1e3)))}if(n.complete===!0){let E=a.signature;return r(null,{header:c,payload:_,signature:E})}return r(null,_)})}});var UL=g((xIe,LL)=>{"use strict";var PL=1/0,ML=9007199254740991,e7=17976931348623157e292,DL=NaN,t7="[object Arguments]",n7="[object Function]",r7="[object GeneratorFunction]",i7="[object String]",o7="[object Symbol]",s7=/^\s+|\s+$/g,a7=/^[-+]0x[0-9a-f]+$/i,c7=/^0b[01]+$/i,u7=/^0o[0-7]+$/i,l7=/^(?:0|[1-9]\d*)$/,d7=parseInt;function h7(t,e){for(var n=-1,i=t?t.length:0,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}function f7(t,e,n,i){for(var r=t.length,o=n+(i?1:-1);i?o--:++o<r;)if(e(t[o],o,t))return o;return-1}function p7(t,e,n){if(e!==e)return f7(t,m7,n);for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1}function m7(t){return t!==t}function g7(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function _7(t,e){return h7(e,function(n){return t[n]})}function y7(t,e){return function(n){return t(e(n))}}var $p=Object.prototype,lS=$p.hasOwnProperty,zp=$p.toString,E7=$p.propertyIsEnumerable,T7=y7(Object.keys,Object),A7=Math.max;function C7(t,e){var n=kL(t)||b7(t)?g7(t.length,String):[],i=n.length,r=!!i;for(var o in t)(e||lS.call(t,o))&&!(r&&(o=="length"||w7(o,i)))&&n.push(o);return n}function S7(t){if(!I7(t))return T7(t);var e=[];for(var n in Object(t))lS.call(t,n)&&n!="constructor"&&e.push(n);return e}function w7(t,e){return e=e??ML,!!e&&(typeof t=="number"||l7.test(t))&&t>-1&&t%1==0&&t<e}function I7(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$p;return t===n}function v7(t,e,n,i){t=dS(t)?t:x7(t),n=n&&!i?k7(n):0;var r=t.length;return n<0&&(n=A7(r+n,0)),P7(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&p7(t,e,n)>-1}function b7(t){return O7(t)&&lS.call(t,"callee")&&(!E7.call(t,"callee")||zp.call(t)==t7)}var kL=Array.isArray;function dS(t){return t!=null&&N7(t.length)&&!R7(t)}function O7(t){return hS(t)&&dS(t)}function R7(t){var e=uS(t)?zp.call(t):"";return e==n7||e==r7}function N7(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ML}function uS(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function hS(t){return!!t&&typeof t=="object"}function P7(t){return typeof t=="string"||!kL(t)&&hS(t)&&zp.call(t)==i7}function D7(t){return typeof t=="symbol"||hS(t)&&zp.call(t)==o7}function M7(t){if(!t)return t===0?t:0;if(t=L7(t),t===PL||t===-PL){var e=t<0?-1:1;return e*e7}return t===t?t:0}function k7(t){var e=M7(t),n=e%1;return e===e?n?e-n:e:0}function L7(t){if(typeof t=="number")return t;if(D7(t))return DL;if(uS(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=uS(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(s7,"");var n=c7.test(t);return n||u7.test(t)?d7(t.slice(2),n?2:8):a7.test(t)?DL:+t}function U7(t){return dS(t)?C7(t):S7(t)}function x7(t){return t?_7(t,U7(t)):[]}LL.exports=v7});var FL=g((FIe,xL)=>{"use strict";var F7="[object Boolean]",q7=Object.prototype,H7=q7.toString;function B7(t){return t===!0||t===!1||j7(t)&&H7.call(t)==F7}function j7(t){return!!t&&typeof t=="object"}xL.exports=B7});var YL=g((qIe,jL)=>{"use strict";var qL=1/0,Y7=17976931348623157e292,HL=NaN,V7="[object Symbol]",$7=/^\s+|\s+$/g,z7=/^[-+]0x[0-9a-f]+$/i,G7=/^0b[01]+$/i,W7=/^0o[0-7]+$/i,K7=parseInt,X7=Object.prototype,Q7=X7.toString;function Z7(t){return typeof t=="number"&&t==nX(t)}function BL(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function J7(t){return!!t&&typeof t=="object"}function eX(t){return typeof t=="symbol"||J7(t)&&Q7.call(t)==V7}function tX(t){if(!t)return t===0?t:0;if(t=rX(t),t===qL||t===-qL){var e=t<0?-1:1;return e*Y7}return t===t?t:0}function nX(t){var e=tX(t),n=e%1;return e===e?n?e-n:e:0}function rX(t){if(typeof t=="number")return t;if(eX(t))return HL;if(BL(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=BL(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace($7,"");var n=G7.test(t);return n||W7.test(t)?K7(t.slice(2),n?2:8):z7.test(t)?HL:+t}jL.exports=Z7});var $L=g((HIe,VL)=>{"use strict";var iX="[object Number]",oX=Object.prototype,sX=oX.toString;function aX(t){return!!t&&typeof t=="object"}function cX(t){return typeof t=="number"||aX(t)&&sX.call(t)==iX}VL.exports=cX});var KL=g((BIe,WL)=>{"use strict";var uX="[object Object]";function lX(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function dX(t,e){return function(n){return t(e(n))}}var hX=Function.prototype,zL=Object.prototype,GL=hX.toString,fX=zL.hasOwnProperty,pX=GL.call(Object),mX=zL.toString,gX=dX(Object.getPrototypeOf,Object);function _X(t){return!!t&&typeof t=="object"}function yX(t){if(!_X(t)||mX.call(t)!=uX||lX(t))return!1;var e=gX(t);if(e===null)return!0;var n=fX.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&GL.call(n)==pX}WL.exports=yX});var QL=g((jIe,XL)=>{"use strict";var EX="[object String]",TX=Object.prototype,AX=TX.toString,CX=Array.isArray;function SX(t){return!!t&&typeof t=="object"}function wX(t){return typeof t=="string"||!CX(t)&&SX(t)&&AX.call(t)==EX}XL.exports=wX});var n1=g((YIe,t1)=>{"use strict";var IX="Expected a function",ZL=1/0,vX=17976931348623157e292,JL=NaN,bX="[object Symbol]",OX=/^\s+|\s+$/g,RX=/^[-+]0x[0-9a-f]+$/i,NX=/^0b[01]+$/i,PX=/^0o[0-7]+$/i,DX=parseInt,MX=Object.prototype,kX=MX.toString;function LX(t,e){var n;if(typeof e!="function")throw new TypeError(IX);return t=HX(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}function UX(t){return LX(2,t)}function e1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function xX(t){return!!t&&typeof t=="object"}function FX(t){return typeof t=="symbol"||xX(t)&&kX.call(t)==bX}function qX(t){if(!t)return t===0?t:0;if(t=BX(t),t===ZL||t===-ZL){var e=t<0?-1:1;return e*vX}return t===t?t:0}function HX(t){var e=qX(t),n=e%1;return e===e?n?e-n:e:0}function BX(t){if(typeof t=="number")return t;if(FX(t))return JL;if(e1(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=e1(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(OX,"");var n=NX.test(t);return n||PX.test(t)?DX(t.slice(2),n?2:8):RX.test(t)?JL:+t}t1.exports=UX});var d1=g((VIe,l1)=>{"use strict";var r1=qC(),jX=sS(),YX=oS(),i1=bp(),VX=UL(),Gp=FL(),o1=YL(),fS=$L(),a1=KL(),zi=QL(),$X=n1(),{KeyObject:zX,createSecretKey:GX,createPrivateKey:WX}=x("crypto"),c1=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];jX&&c1.splice(3,0,"PS256","PS384","PS512");var KX={expiresIn:{isValid:function(t){return o1(t)||zi(t)&&t},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(t){return o1(t)||zi(t)&&t},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(t){return zi(t)||Array.isArray(t)},message:'"audience" must be a string or array'},algorithm:{isValid:VX.bind(null,c1),message:'"algorithm" must be a valid string enum value'},header:{isValid:a1,message:'"header" must be an object'},encoding:{isValid:zi,message:'"encoding" must be a string'},issuer:{isValid:zi,message:'"issuer" must be a string'},subject:{isValid:zi,message:'"subject" must be a string'},jwtid:{isValid:zi,message:'"jwtid" must be a string'},noTimestamp:{isValid:Gp,message:'"noTimestamp" must be a boolean'},keyid:{isValid:zi,message:'"keyid" must be a string'},mutatePayload:{isValid:Gp,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:Gp,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:Gp,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},XX={iat:{isValid:fS,message:'"iat" should be a number of seconds'},exp:{isValid:fS,message:'"exp" should be a number of seconds'},nbf:{isValid:fS,message:'"nbf" should be a number of seconds'}};function u1(t,e,n,i){if(!a1(n))throw new Error('Expected "'+i+'" to be a plain object.');Object.keys(n).forEach(function(r){let o=t[r];if(!o){if(!e)throw new Error('"'+r+'" is not allowed in "'+i+'"');return}if(!o.isValid(n[r]))throw new Error(o.message)})}function QX(t){return u1(KX,!1,t,"options")}function ZX(t){return u1(XX,!0,t,"payload")}var s1={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},JX=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];l1.exports=function(t,e,n,i){typeof n=="function"?(i=n,n={}):n=n||{};let r=typeof t=="object"&&!Buffer.isBuffer(t),o=Object.assign({alg:n.algorithm||"HS256",typ:r?"JWT":void 0,kid:n.keyid},n.header);function s(u){if(i)return i(u);throw u}if(!e&&n.algorithm!=="none")return s(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof zX))try{e=WX(e)}catch{try{e=GX(typeof e=="string"?Buffer.from(e):e)}catch{return s(new Error("secretOrPrivateKey is not valid key material"))}}if(o.alg.startsWith("HS")&&e.type!=="secret")return s(new Error(`secretOrPrivateKey must be a symmetric key when using ${o.alg}`));if(/^(?:RS|PS|ES)/.test(o.alg)){if(e.type!=="private")return s(new Error(`secretOrPrivateKey must be an asymmetric key when using ${o.alg}`));if(!n.allowInsecureKeySizes&&!o.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return s(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`))}if(typeof t>"u")return s(new Error("payload is required"));if(r){try{ZX(t)}catch(u){return s(u)}n.mutatePayload||(t=Object.assign({},t))}else{let u=JX.filter(function(l){return typeof n[l]<"u"});if(u.length>0)return s(new Error("invalid "+u.join(",")+" option for "+typeof t+" payload"))}if(typeof t.exp<"u"&&typeof n.expiresIn<"u")return s(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof t.nbf<"u"&&typeof n.notBefore<"u")return s(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{QX(n)}catch(u){return s(u)}if(!n.allowInvalidAsymmetricKeyTypes)try{YX(o.alg,e)}catch(u){return s(u)}let a=t.iat||Math.floor(Date.now()/1e3);if(n.noTimestamp?delete t.iat:r&&(t.iat=a),typeof n.notBefore<"u"){try{t.nbf=r1(n.notBefore,a)}catch(u){return s(u)}if(typeof t.nbf>"u")return s(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof n.expiresIn<"u"&&typeof t=="object"){try{t.exp=r1(n.expiresIn,a)}catch(u){return s(u)}if(typeof t.exp>"u")return s(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(s1).forEach(function(u){let l=s1[u];if(typeof n[u]<"u"){if(typeof t[l]<"u")return s(new Error('Bad "options.'+u+'" option. The payload already has an "'+l+'" property.'));t[l]=n[u]}});let c=n.encoding||"utf8";if(typeof i=="function")i=i&&$X(i),i1.createSign({header:o,privateKey:e,payload:t,encoding:c}).once("error",i).once("done",function(u){if(!n.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&u.length<256)return i(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`));i(null,u)});else{let u=i1.sign({header:o,payload:t,secret:e,encoding:c});if(!n.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&u.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`);return u}}});var f1=g(($Ie,h1)=>{"use strict";h1.exports={decode:LC(),verify:NL(),sign:d1(),JsonWebTokenError:Qu(),NotBeforeError:UC(),TokenExpiredError:xC()}});var Wm=g(ie=>{"use strict";var Zp=x("http"),p1=x("https"),eQ=(oP(),At(iP)),x1=x("crypto"),fn=FD(),tQ=f1(),ol=x("fs"),nQ=x("path"),pl=class{static serializeJSONBlob(e){return JSON.stringify(e)}static serializeAccounts(e){let n={};return Object.keys(e).map(function(i){let r=e[i];n[i]={home_account_id:r.homeAccountId,environment:r.environment,realm:r.realm,local_account_id:r.localAccountId,username:r.username,authority_type:r.authorityType,name:r.name,client_info:r.clientInfo,last_modification_time:r.lastModificationTime,last_modification_app:r.lastModificationApp,tenantProfiles:r.tenantProfiles?.map(o=>JSON.stringify(o))}}),n}static serializeIdTokens(e){let n={};return Object.keys(e).map(function(i){let r=e[i];n[i]={home_account_id:r.homeAccountId,environment:r.environment,credential_type:r.credentialType,client_id:r.clientId,secret:r.secret,realm:r.realm}}),n}static serializeAccessTokens(e){let n={};return Object.keys(e).map(function(i){let r=e[i];n[i]={home_account_id:r.homeAccountId,environment:r.environment,credential_type:r.credentialType,client_id:r.clientId,secret:r.secret,realm:r.realm,target:r.target,cached_at:r.cachedAt,expires_on:r.expiresOn,extended_expires_on:r.extendedExpiresOn,refresh_on:r.refreshOn,key_id:r.keyId,token_type:r.tokenType,requestedClaims:r.requestedClaims,requestedClaimsHash:r.requestedClaimsHash,userAssertionHash:r.userAssertionHash}}),n}static serializeRefreshTokens(e){let n={};return Object.keys(e).map(function(i){let r=e[i];n[i]={home_account_id:r.homeAccountId,environment:r.environment,credential_type:r.credentialType,client_id:r.clientId,secret:r.secret,family_id:r.familyId,target:r.target,realm:r.realm}}),n}static serializeAppMetadata(e){let n={};return Object.keys(e).map(function(i){let r=e[i];n[i]={client_id:r.clientId,environment:r.environment,family_id:r.familyId}}),n}static serializeAllCache(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}}};var D={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},It={SUCCESS:200,SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR:400,CLIENT_ERROR_RANGE_START:400,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,REQUEST_TIMEOUT:408,GONE:410,TOO_MANY_REQUESTS:429,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR:500,SERVER_ERROR_RANGE_START:500,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,SERVER_ERROR_RANGE_END:599,MULTI_SIDED_ERROR:600},Ti=[D.OPENID_SCOPE,D.PROFILE_SCOPE,D.OFFLINE_ACCESS_SCOPE],m1=[...Ti,D.EMAIL_SCOPE],Yt={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},Ai={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Wp={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},Jp={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},rQ={PLAIN:"plain",S256:"S256"},F1={CODE:"code",IDTOKEN_TOKEN:"id_token token"},$m={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},Sa={AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},Kp={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",GENERIC_ACCOUNT_TYPE:"Generic"},ml={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},ht={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},$S="appmetadata",iQ="client_info",tm="1",nm={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},Un={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},jt={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},et={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},cl={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},g1={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},q1={username:"username",password:"password"},Js={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},pS={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},wt={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},H1=300,Si={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var rm="unexpected_error",gl="post_request_failed",oQ=Object.freeze({__proto__:null,postRequestFailed:gl,unexpectedError:rm});var im={[rm]:"Unexpected error in authentication.",[gl]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."},sQ={unexpectedError:{code:rm,desc:im[rm]},postRequestFailed:{code:gl,desc:im[gl]}},We=class t extends Error{constructor(e,n,i){let r=n?`${e}: ${n}`:e;super(r),Object.setPrototypeOf(this,t.prototype),this.errorCode=e||D.EMPTY_STRING,this.errorMessage=n||D.EMPTY_STRING,this.subError=i||D.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}};function aQ(t,e){return new We(t,e?`${im[t]} ${e}`:im[t])}var ra="client_info_decoding_error",_l="client_info_empty_error",ia="token_parsing_error",yl="null_or_empty_token",Jn="endpoints_resolution_error",ko="network_error",El="openid_config_error",Tl="hash_not_deserialized",oa="invalid_state",Al="state_mismatch",om="state_not_found",Cl="nonce_mismatch",sa="auth_time_not_found",Sl="max_age_transpired",aa="multiple_matching_tokens",sm="multiple_matching_accounts",wl="multiple_matching_appMetadata",Il="request_cannot_be_made",vl="cannot_remove_empty_scope",bl="cannot_append_scopeset",ca="empty_input_scopeset",Ol="device_code_polling_cancelled",Rl="device_code_expired",Nl="device_code_unknown_error",ua="no_account_in_silent_request",Pl="invalid_cache_record",la="invalid_cache_environment",am="no_account_found",da="no_crypto_object",cm="unexpected_credential_type",Dl="invalid_assertion",ha="invalid_client_credential",Vr="token_refresh_required",Ml="user_timeout_reached",kl="token_claims_cnf_required_for_signedjwt",um="authorization_code_missing_from_server_response",lm="binding_key_not_removed",Ll="end_session_endpoint_not_supported",Ul="key_id_missing",dm="no_network_connectivity",hm="user_canceled",xl="missing_tenant_id_error",Se="method_not_implemented",fm="nested_app_auth_bridge_disabled",pm="platform_broker_error",cQ=Object.freeze({__proto__:null,authTimeNotFound:sa,authorizationCodeMissingFromServerResponse:um,bindingKeyNotRemoved:lm,cannotAppendScopeSet:bl,cannotRemoveEmptyScope:vl,clientInfoDecodingError:ra,clientInfoEmptyError:_l,deviceCodeExpired:Rl,deviceCodePollingCancelled:Ol,deviceCodeUnknownError:Nl,emptyInputScopeSet:ca,endSessionEndpointNotSupported:Ll,endpointResolutionError:Jn,hashNotDeserialized:Tl,invalidAssertion:Dl,invalidCacheEnvironment:la,invalidCacheRecord:Pl,invalidClientCredential:ha,invalidState:oa,keyIdMissing:Ul,maxAgeTranspired:Sl,methodNotImplemented:Se,missingTenantIdError:xl,multipleMatchingAccounts:sm,multipleMatchingAppMetadata:wl,multipleMatchingTokens:aa,nestedAppAuthBridgeDisabled:fm,networkError:ko,noAccountFound:am,noAccountInSilentRequest:ua,noCryptoObject:da,noNetworkConnectivity:dm,nonceMismatch:Cl,nullOrEmptyToken:yl,openIdConfigError:El,platformBrokerError:pm,requestCannotBeMade:Il,stateMismatch:Al,stateNotFound:om,tokenClaimsCnfRequiredForSignedJwt:kl,tokenParsingError:ia,tokenRefreshRequired:Vr,unexpectedCredentialType:cm,userCanceled:hm,userTimeoutReached:Ml});var he={[ra]:"The client info could not be parsed/decoded correctly",[_l]:"The client info was empty",[ia]:"Token cannot be parsed",[yl]:"The token is null or empty",[Jn]:"Endpoints cannot be resolved",[ko]:"Network request failed",[El]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[Tl]:"The hash parameters could not be deserialized",[oa]:"State was not the expected format",[Al]:"State mismatch error",[om]:"State not found",[Cl]:"Nonce mismatch error",[sa]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[Sl]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[aa]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[sm]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[wl]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[Il]:"Token request cannot be made without authorization code or refresh token.",[vl]:"Cannot remove null or empty scope from ScopeSet",[bl]:"Cannot append ScopeSet",[ca]:"Empty input ScopeSet cannot be processed",[Ol]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[Rl]:"Device code is expired.",[Nl]:"Device code stopped polling for unknown reasons.",[ua]:"Please pass an account object, silent flow is not supported without account information",[Pl]:"Cache record object was null or undefined.",[la]:"Invalid environment when attempting to create cache entry",[am]:"No account found in cache for given key.",[da]:"No crypto object detected.",[cm]:"Unexpected credential type.",[Dl]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[ha]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[Vr]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[Ml]:"User defined timeout for device code polling reached",[kl]:"Cannot generate a POP jwt if the token_claims are not populated",[um]:"Server response does not contain an authorization code to proceed",[lm]:"Could not remove the credential's binding key from storage.",[Ll]:"The provided authority does not support logout",[Ul]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[dm]:"No network connectivity. Check your internet connection.",[hm]:"User cancelled the flow.",[xl]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[Se]:"This method has not been implemented",[fm]:"The nested app auth bridge is disabled",[pm]:"An error occurred in the native broker. See the platformBrokerError property for details."},uQ={clientInfoDecodingError:{code:ra,desc:he[ra]},clientInfoEmptyError:{code:_l,desc:he[_l]},tokenParsingError:{code:ia,desc:he[ia]},nullOrEmptyToken:{code:yl,desc:he[yl]},endpointResolutionError:{code:Jn,desc:he[Jn]},networkError:{code:ko,desc:he[ko]},unableToGetOpenidConfigError:{code:El,desc:he[El]},hashNotDeserialized:{code:Tl,desc:he[Tl]},invalidStateError:{code:oa,desc:he[oa]},stateMismatchError:{code:Al,desc:he[Al]},stateNotFoundError:{code:om,desc:he[om]},nonceMismatchError:{code:Cl,desc:he[Cl]},authTimeNotFoundError:{code:sa,desc:he[sa]},maxAgeTranspired:{code:Sl,desc:he[Sl]},multipleMatchingTokens:{code:aa,desc:he[aa]},multipleMatchingAccounts:{code:sm,desc:he[sm]},multipleMatchingAppMetadata:{code:wl,desc:he[wl]},tokenRequestCannotBeMade:{code:Il,desc:he[Il]},removeEmptyScopeError:{code:vl,desc:he[vl]},appendScopeSetError:{code:bl,desc:he[bl]},emptyInputScopeSetError:{code:ca,desc:he[ca]},DeviceCodePollingCancelled:{code:Ol,desc:he[Ol]},DeviceCodeExpired:{code:Rl,desc:he[Rl]},DeviceCodeUnknownError:{code:Nl,desc:he[Nl]},NoAccountInSilentRequest:{code:ua,desc:he[ua]},invalidCacheRecord:{code:Pl,desc:he[Pl]},invalidCacheEnvironment:{code:la,desc:he[la]},noAccountFound:{code:am,desc:he[am]},noCryptoObj:{code:da,desc:he[da]},unexpectedCredentialType:{code:cm,desc:he[cm]},invalidAssertion:{code:Dl,desc:he[Dl]},invalidClientCredential:{code:ha,desc:he[ha]},tokenRefreshRequired:{code:Vr,desc:he[Vr]},userTimeoutReached:{code:Ml,desc:he[Ml]},tokenClaimsRequired:{code:kl,desc:he[kl]},noAuthorizationCodeFromServer:{code:um,desc:he[um]},bindingKeyNotRemovedError:{code:lm,desc:he[lm]},logoutNotSupported:{code:Ll,desc:he[Ll]},keyIdMissing:{code:Ul,desc:he[Ul]},noNetworkConnectivity:{code:dm,desc:he[dm]},userCanceledError:{code:hm,desc:he[hm]},missingTenantIdError:{code:xl,desc:he[xl]},nestedAppAuthBridgeDisabled:{code:fm,desc:he[fm]},platformBrokerError:{code:pm,desc:he[pm]}},Fl=class t extends We{constructor(e,n){super(e,n?`${he[e]}: ${n}`:he[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function j(t,e){return new Fl(t,e)}var AS={createNewGuid:()=>{throw j(Se)},base64Decode:()=>{throw j(Se)},base64Encode:()=>{throw j(Se)},base64UrlEncode:()=>{throw j(Se)},encodeKid:()=>{throw j(Se)},async getPublicKeyThumbprint(){throw j(Se)},async removeTokenBindingKey(){throw j(Se)},async clearKeystore(){throw j(Se)},async signJwt(){throw j(Se)},async hashString(){throw j(Se)}};ie.LogLevel=void 0;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(ie.LogLevel||(ie.LogLevel={}));var Ki=class t{constructor(e,n,i){this.level=ie.LogLevel.Info;let r=()=>{},o=e||t.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||r,this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level=typeof o.logLevel=="number"?o.logLevel:ie.LogLevel.Info,this.correlationId=o.correlationId||D.EMPTY_STRING,this.packageName=n||D.EMPTY_STRING,this.packageVersion=i||D.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:ie.LogLevel.Info}}clone(e,n,i){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:i||this.correlationId},e,n)}logMessage(e,n){if(n.logLevel>this.level||!this.piiLoggingEnabled&&n.containsPii)return;let o=`${`[${new Date().toUTCString()}] : [${n.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${ie.LogLevel[n.logLevel]} - ${e}`;this.executeCallback(n.logLevel,o,n.containsPii||!1)}executeCallback(e,n,i){this.localCallback&&this.localCallback(e,n,i)}error(e,n){this.logMessage(e,{logLevel:ie.LogLevel.Error,containsPii:!1,correlationId:n||D.EMPTY_STRING})}errorPii(e,n){this.logMessage(e,{logLevel:ie.LogLevel.Error,containsPii:!0,correlationId:n||D.EMPTY_STRING})}warning(e,n){this.logMessage(e,{logLevel:ie.LogLevel.Warning,containsPii:!1,correlationId:n||D.EMPTY_STRING})}warningPii(e,n){this.logMessage(e,{logLevel:ie.LogLevel.Warning,containsPii:!0,correlationId:n||D.EMPTY_STRING})}info(e,n){this.logMessage(e,{logLevel:ie.LogLevel.Info,containsPii:!1,correlationId:n||D.EMPTY_STRING})}infoPii(e,n){this.logMessage(e,{logLevel:ie.LogLevel.Info,containsPii:!0,correlationId:n||D.EMPTY_STRING})}verbose(e,n){this.logMessage(e,{logLevel:ie.LogLevel.Verbose,containsPii:!1,correlationId:n||D.EMPTY_STRING})}verbosePii(e,n){this.logMessage(e,{logLevel:ie.LogLevel.Verbose,containsPii:!0,correlationId:n||D.EMPTY_STRING})}trace(e,n){this.logMessage(e,{logLevel:ie.LogLevel.Trace,containsPii:!1,correlationId:n||D.EMPTY_STRING})}tracePii(e,n){this.logMessage(e,{logLevel:ie.LogLevel.Trace,containsPii:!0,correlationId:n||D.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};var B1="@azure/msal-common",zS="15.13.3";var zm={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};var ql="redirect_uri_empty",mm="claims_request_parsing_error",Hl="authority_uri_insecure",Gi="url_parse_error",fa="empty_url_error",Bl="empty_input_scopes_error",pa="invalid_claims",jl="token_request_empty",Yl="logout_request_empty",gm="invalid_code_challenge_method",Vl="pkce_params_missing",ma="invalid_cloud_discovery_metadata",$l="invalid_authority_metadata",zl="untrusted_authority",ga="missing_ssh_jwk",_m="missing_ssh_kid",ym="missing_nonce_authentication_header",Em="invalid_authentication_header",Tm="cannot_set_OIDCOptions",Am="cannot_allow_platform_broker",Cm="authority_mismatch",Sm="invalid_request_method_for_EAR",wm="invalid_authorize_post_body_parameters",Im="invalid_platform_broker_configuration",lQ=Object.freeze({__proto__:null,authorityMismatch:Cm,authorityUriInsecure:Hl,cannotAllowPlatformBroker:Am,cannotSetOIDCOptions:Tm,claimsRequestParsingError:mm,emptyInputScopesError:Bl,invalidAuthenticationHeader:Em,invalidAuthorityMetadata:$l,invalidAuthorizePostBodyParameters:wm,invalidClaims:pa,invalidCloudDiscoveryMetadata:ma,invalidCodeChallengeMethod:gm,invalidPlatformBrokerConfiguration:Im,invalidRequestMethodForEAR:Sm,logoutRequestEmpty:Yl,missingNonceAuthenticationHeader:ym,missingSshJwk:ga,missingSshKid:_m,pkceParamsMissing:Vl,redirectUriEmpty:ql,tokenRequestEmpty:jl,untrustedAuthority:zl,urlEmptyError:fa,urlParseError:Gi});var Ze={[ql]:"A redirect URI is required for all calls, and none has been set.",[mm]:"Could not parse the given claims request object.",[Hl]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[Gi]:"URL could not be parsed into appropriate segments.",[fa]:"URL was empty or null.",[Bl]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[pa]:"Given claims parameter must be a stringified JSON object.",[jl]:"Token request was empty and not found in cache.",[Yl]:"The logout request was null or undefined.",[gm]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[Vl]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[ma]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[$l]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[zl]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[ga]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[_m]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[ym]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[Em]:"Invalid authentication header provided",[Tm]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[Am]:"Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",[Cm]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",[wm]:"Invalid authorize post body parameters provided. If you are using authorizePostBodyParameters, the request method must be POST. Please check the request method and parameters.",[Sm]:"Invalid request method for EAR protocol mode. The request method cannot be GET when using EAR protocol mode. Please change the request method to POST.",[Im]:"Invalid platform broker configuration. `allowPlatformBrokerWithDOM` can only be enabled when `allowPlatformBroker` is enabled."},dQ={redirectUriNotSet:{code:ql,desc:Ze[ql]},claimsRequestParsingError:{code:mm,desc:Ze[mm]},authorityUriInsecure:{code:Hl,desc:Ze[Hl]},urlParseError:{code:Gi,desc:Ze[Gi]},urlEmptyError:{code:fa,desc:Ze[fa]},emptyScopesError:{code:Bl,desc:Ze[Bl]},invalidClaimsRequest:{code:pa,desc:Ze[pa]},tokenRequestEmptyError:{code:jl,desc:Ze[jl]},logoutRequestEmptyError:{code:Yl,desc:Ze[Yl]},invalidCodeChallengeMethod:{code:gm,desc:Ze[gm]},invalidCodeChallengeParams:{code:Vl,desc:Ze[Vl]},invalidCloudDiscoveryMetadata:{code:ma,desc:Ze[ma]},invalidAuthorityMetadata:{code:$l,desc:Ze[$l]},untrustedAuthority:{code:zl,desc:Ze[zl]},missingSshJwk:{code:ga,desc:Ze[ga]},missingSshKid:{code:_m,desc:Ze[_m]},missingNonceAuthenticationHeader:{code:ym,desc:Ze[ym]},invalidAuthenticationHeader:{code:Em,desc:Ze[Em]},cannotSetOIDCOptions:{code:Tm,desc:Ze[Tm]},cannotAllowPlatformBroker:{code:Am,desc:Ze[Am]},authorityMismatch:{code:Cm,desc:Ze[Cm]},invalidAuthorizePostBodyParameters:{code:wm,desc:Ze[wm]},invalidRequestMethodForEAR:{code:Sm,desc:Ze[Sm]},invalidPlatformBrokerConfiguration:{code:Im,desc:Ze[Im]}},vm=class t extends We{constructor(e){super(e,Ze[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function yt(t){return new vm(t)}var bn=class{static isEmptyObj(e){if(e)try{let n=JSON.parse(e);return Object.keys(n).length===0}catch{}return!0}static startsWith(e,n){return e.indexOf(n)===0}static endsWith(e,n){return e.length>=n.length&&e.lastIndexOf(n)===e.length-n.length}static queryStringToObject(e){let n={},i=e.split("&"),r=o=>decodeURIComponent(o.replace(/\+/g," "));return i.forEach(o=>{if(o.trim()){let[s,a]=o.split(/=(.+)/g,2);s&&a&&(n[r(s)]=r(a))}}),n}static trimArrayEntries(e){return e.map(n=>n.trim())}static removeEmptyStringsFromArray(e){return e.filter(n=>!!n)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,n){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(n)}};var vn=class t{constructor(e){let n=e?bn.trimArrayEntries([...e]):[],i=n?bn.removeEmptyStringsFromArray(n):[];if(!i||!i.length)throw yt(Bl);this.scopes=new Set,i.forEach(r=>this.scopes.add(r))}static fromString(e){let i=(e||D.EMPTY_STRING).split(" ");return new t(i)}static createSearchScopes(e){let n=e&&e.length>0?e:[...Ti],i=new t(n);return i.containsOnlyOIDCScopes()?i.removeScope(D.OFFLINE_ACCESS_SCOPE):i.removeOIDCScopes(),i}containsScope(e){let n=this.printScopesLowerCase().split(" "),i=new t(n);return e?i.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(n=>this.containsScope(n))}containsOnlyOIDCScopes(){let e=0;return m1.forEach(n=>{this.containsScope(n)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(n=>this.appendScope(n))}catch{throw j(bl)}}removeScope(e){if(!e)throw j(vl);this.scopes.delete(e.trim())}removeOIDCScopes(){m1.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw j(ca);let n=new Set;return e.scopes.forEach(i=>n.add(i.toLowerCase())),this.scopes.forEach(i=>n.add(i.toLowerCase())),n}intersectingScopeSets(e){if(!e)throw j(ca);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();let n=this.unionScopeSets(e),i=e.getScopeCount(),r=this.getScopeCount();return n.size<r+i}getScopeCount(){return this.scopes.size}asArray(){let e=[];return this.scopes.forEach(n=>e.push(n)),e}printScopes(){return this.scopes?this.asArray().join(" "):D.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}};function bm(t,e){if(!t)throw j(_l);try{let n=e(t);return JSON.parse(n)}catch{throw j(ra)}}function na(t){if(!t)throw j(ra);let e=t.split(ml.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?D.EMPTY_STRING:e[1]}}function _1(t,e){return!!t&&!!e&&t===e.split(".")[1]}function GS(t,e,n,i){if(i){let{oid:r,sub:o,tid:s,name:a,tfp:c,acr:u,preferred_username:l,upn:d,login_hint:f}=i,m=s||c||u||"";return{tenantId:m,localAccountId:r||o||"",name:a,username:l||d||"",loginHint:f,isHomeTenant:_1(m,t)}}else return{tenantId:n,localAccountId:e,username:"",isHomeTenant:_1(n,t)}}function j1(t,e,n,i){let r=t;if(e){let{isHomeTenant:o,...s}=e;r={...t,...s}}if(n){let{isHomeTenant:o,...s}=GS(t.homeAccountId,t.localAccountId,t.tenantId,n);return r={...r,...s,idTokenClaims:n,idToken:i},r}return r}var jr={Default:0,Adfs:1,Dsts:2,Ciam:3};function Y1(t){return t&&(t.tid||t.tfp||t.acr)||null}var Xi={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};var xn=class t{static getAccountInfo(e){return{homeAccountId:e.homeAccountId,environment:e.environment,tenantId:e.realm,username:e.username,localAccountId:e.localAccountId,loginHint:e.loginHint,name:e.name,nativeAccountId:e.nativeAccountId,authorityType:e.authorityType,tenantProfiles:new Map((e.tenantProfiles||[]).map(n=>[n.tenantId,n])),dataBoundary:e.dataBoundary}}isSingleTenant(){return!this.tenantProfiles}static createAccount(e,n,i){let r=new t;n.authorityType===jr.Adfs?r.authorityType=Kp.ADFS_ACCOUNT_TYPE:n.protocolMode===Xi.OIDC?r.authorityType=Kp.GENERIC_ACCOUNT_TYPE:r.authorityType=Kp.MSSTS_ACCOUNT_TYPE;let o;e.clientInfo&&i&&(o=bm(e.clientInfo,i),o.xms_tdbr&&(r.dataBoundary=o.xms_tdbr==="EU"?"EU":"None")),r.clientInfo=e.clientInfo,r.homeAccountId=e.homeAccountId,r.nativeAccountId=e.nativeAccountId;let s=e.environment||n&&n.getPreferredCache();if(!s)throw j(la);r.environment=s,r.realm=o?.utid||Y1(e.idTokenClaims)||"",r.localAccountId=o?.uid||e.idTokenClaims?.oid||e.idTokenClaims?.sub||"";let a=e.idTokenClaims?.preferred_username||e.idTokenClaims?.upn,c=e.idTokenClaims?.emails?e.idTokenClaims.emails[0]:null;if(r.username=a||c||"",r.loginHint=e.idTokenClaims?.login_hint,r.name=e.idTokenClaims?.name||"",r.cloudGraphHostName=e.cloudGraphHostName,r.msGraphHost=e.msGraphHost,e.tenantProfiles)r.tenantProfiles=e.tenantProfiles;else{let u=GS(e.homeAccountId,r.localAccountId,r.realm,e.idTokenClaims);r.tenantProfiles=[u]}return r}static createFromAccountInfo(e,n,i){let r=new t;return r.authorityType=e.authorityType||Kp.GENERIC_ACCOUNT_TYPE,r.homeAccountId=e.homeAccountId,r.localAccountId=e.localAccountId,r.nativeAccountId=e.nativeAccountId,r.realm=e.tenantId,r.environment=e.environment,r.username=e.username,r.name=e.name,r.loginHint=e.loginHint,r.cloudGraphHostName=n,r.msGraphHost=i,r.tenantProfiles=Array.from(e.tenantProfiles?.values()||[]),r.dataBoundary=e.dataBoundary,r}static generateHomeAccountId(e,n,i,r,o){if(!(n===jr.Adfs||n===jr.Dsts)){if(e)try{let s=bm(e,r.base64Decode);if(s.uid&&s.utid)return`${s.uid}.${s.utid}`}catch{}i.warning("No client info in response")}return o?.sub||""}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,n,i){if(!e||!n)return!1;let r=!0;if(i){let o=e.idTokenClaims||{},s=n.idTokenClaims||{};r=o.iat===s.iat&&o.nonce===s.nonce}return e.homeAccountId===n.homeAccountId&&e.localAccountId===n.localAccountId&&e.username===n.username&&e.tenantId===n.tenantId&&e.loginHint===n.loginHint&&e.environment===n.environment&&e.nativeAccountId===n.nativeAccountId&&r}};function td(t,e){let n=fQ(t);try{let i=e(n);return JSON.parse(i)}catch{throw j(ia)}}function hQ(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(i=>e.includes(i.trim().toLowerCase()))}function fQ(t){if(!t)throw j(yl);let n=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!n||n.length<4)throw j(ia);return n[2]}function V1(t,e){if(e===0||Date.now()-3e5>t+e)throw j(Sl)}function pQ(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function $1(t){if(!t||t.indexOf("=")<0)return null;try{let e=pQ(t),n=Object.fromEntries(new URLSearchParams(e));if(n.code||n.ear_jwe||n.error||n.error_description||n.state)return n}catch{throw j(Tl)}return null}function Fn(t,e=!0,n){let i=new Array;return t.forEach((r,o)=>{!e&&n&&o in n?i.push(`${o}=${r}`):i.push(`${o}=${encodeURIComponent(r)}`)}),i.join("&")}var Je=class t{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw yt(fa);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let n=e.toLowerCase();return bn.endsWith(n,"?")?n=n.slice(0,-1):bn.endsWith(n,"?/")&&(n=n.slice(0,-2)),bn.endsWith(n,"/")||(n+="/"),n}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw yt(Gi)}if(!e.HostNameAndPort||!e.PathSegments)throw yt(Gi);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw yt(Hl)}static appendQueryString(e,n){return n?e.indexOf("?")<0?`${e}?${n}`:`${e}&${n}`:e}static removeHashFromUrl(e){return t.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){let n=this.getUrlComponents(),i=n.PathSegments;return e&&i.length!==0&&(i[0]===Ai.COMMON||i[0]===Ai.ORGANIZATIONS)&&(i[0]=e),t.constructAuthorityUriFromObject(n)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=this.urlString.match(e);if(!n)throw yt(Gi);let i={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5],QueryString:n[7]},r=i.AbsolutePath.split("/");return r=r.filter(o=>o&&o.length>0),i.PathSegments=r,i.QueryString&&i.QueryString.endsWith("/")&&(i.QueryString=i.QueryString.substring(0,i.QueryString.length-1)),i}static getDomainFromUrl(e){let n=RegExp("^([^:/?#]+://)?([^/?#]*)"),i=e.match(n);if(!i)throw yt(Gi);return i[2]}static getAbsoluteUrl(e,n){if(e[0]===D.FORWARD_SLASH){let r=new t(n).getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!$1(e)}};var z1={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},y1=z1.endpointMetadata,WS=z1.instanceDiscoveryMetadata,G1=new Set;WS.metadata.forEach(t=>{t.aliases.forEach(e=>{G1.add(e)})});function mQ(t,e){let n,i=t.canonicalAuthority;if(i){let r=new Je(i).getUrlComponents().HostNameAndPort;n=E1(r,t.cloudDiscoveryMetadata?.metadata,Un.CONFIG,e)||E1(r,WS.metadata,Un.HARDCODED_VALUES,e)||t.knownAuthorities}return n||[]}function E1(t,e,n,i){if(i?.trace(`getAliasesFromMetadata called with source: ${n}`),t&&e){let r=Om(e,t);if(r)return i?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${n}, returning aliases`),r.aliases;i?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${n}`)}return null}function gQ(t){return Om(WS.metadata,t)}function Om(t,e){for(let n=0;n<t.length;n++){let i=t[n];if(i.aliases.includes(e))return i}return null}var W1="cache_quota_exceeded",KS="cache_error_unknown";var mS={[W1]:"Exceeded cache storage capacity.",[KS]:"Unexpected error occurred when using cache storage."},ul=class t extends We{constructor(e,n){let i=n||(mS[e]?mS[e]:mS[KS]);super(`${e}: ${i}`),Object.setPrototypeOf(this,t.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=i}};function _Q(t){return t instanceof Error?t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED"||t.message.includes("exceeded the quota")?new ul(W1):new ul(t.name,t.message):new ul(KS)}var Gl=class{constructor(e,n,i,r,o){this.clientId=e,this.cryptoImpl=n,this.commonLogger=i.clone(B1,zS),this.staticAuthorityOptions=o,this.performanceClient=r}getAllAccounts(e,n){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,n),n,e)}getAccountInfoFilteredBy(e,n){if(Object.keys(e).length===0||Object.values(e).every(r=>!r))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null"),null;let i=this.getAllAccounts(e,n);return i.length>1?i.sort(o=>o.idTokenClaims?-1:1)[0]:i.length===1?i[0]:null}getBaseAccountInfo(e,n){let i=this.getAccountsFilteredBy(e,n);return i.length>0?xn.getAccountInfo(i[0]):null}buildTenantProfiles(e,n,i){return e.flatMap(r=>this.getTenantProfilesFromAccountEntity(r,n,i?.tenantId,i))}getTenantedAccountInfoByFilter(e,n,i,r,o){let s=null,a;if(o&&!this.tenantProfileMatchesFilter(i,o))return null;let c=this.getIdToken(e,r,n,i.tenantId);return c&&(a=td(c.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(a,o))?null:(s=j1(e,i,a,c?.secret),s)}getTenantProfilesFromAccountEntity(e,n,i,r){let o=xn.getAccountInfo(e),s=o.tenantProfiles||new Map,a=this.getTokenKeys();if(i){let u=s.get(i);if(u)s=new Map([[i,u]]);else return[]}let c=[];return s.forEach(u=>{let l=this.getTenantedAccountInfoByFilter(o,a,u,n,r);l&&c.push(l)}),c}tenantProfileMatchesFilter(e,n){return!(n.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,n.localAccountId)||n.name&&e.name!==n.name||n.isHomeTenant!==void 0&&e.isHomeTenant!==n.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,n){return!(n&&(n.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,n.localAccountId)||n.loginHint&&!this.matchLoginHintFromTokenClaims(e,n.loginHint)||n.username&&!this.matchUsername(e.preferred_username,n.username)||n.name&&!this.matchName(e,n.name)||n.sid&&!this.matchSid(e,n.sid)))}async saveCacheRecord(e,n,i,r){if(!e)throw j(Pl);try{e.account&&await this.setAccount(e.account,n,i),e.idToken&&r?.idToken!==!1&&await this.setIdTokenCredential(e.idToken,n,i),e.accessToken&&r?.accessToken!==!1&&await this.saveAccessToken(e.accessToken,n,i),e.refreshToken&&r?.refreshToken!==!1&&await this.setRefreshTokenCredential(e.refreshToken,n,i),e.appMetadata&&this.setAppMetadata(e.appMetadata,n)}catch(o){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed"),o instanceof We?o:_Q(o)}}async saveAccessToken(e,n,i){let r={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},o=this.getTokenKeys(),s=vn.fromString(e.target);o.accessToken.forEach(a=>{if(!this.accessTokenKeyMatchesFilter(a,r,!1))return;let c=this.getAccessTokenCredential(a,n);c&&this.credentialMatchesFilter(c,r)&&vn.fromString(c.target).intersectingScopeSets(s)&&this.removeAccessToken(a,n)}),await this.setAccessTokenCredential(e,n,i)}getAccountsFilteredBy(e,n){let i=this.getAccountKeys(),r=[];return i.forEach(o=>{let s=this.getAccount(o,n);if(!s||e.homeAccountId&&!this.matchHomeAccountId(s,e.homeAccountId)||e.username&&!this.matchUsername(s.username,e.username)||e.environment&&!this.matchEnvironment(s,e.environment)||e.realm&&!this.matchRealm(s,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(s,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(s,e.authorityType))return;let a={localAccountId:e?.localAccountId,name:e?.name},c=s.tenantProfiles?.filter(u=>this.tenantProfileMatchesFilter(u,a));c&&c.length===0||r.push(s)}),r}credentialMatchesFilter(e,n){return!(n.clientId&&!this.matchClientId(e,n.clientId)||n.userAssertionHash&&!this.matchUserAssertionHash(e,n.userAssertionHash)||typeof n.homeAccountId=="string"&&!this.matchHomeAccountId(e,n.homeAccountId)||n.environment&&!this.matchEnvironment(e,n.environment)||n.realm&&!this.matchRealm(e,n.realm)||n.credentialType&&!this.matchCredentialType(e,n.credentialType)||n.familyId&&!this.matchFamilyId(e,n.familyId)||n.target&&!this.matchTarget(e,n.target)||(n.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==n.requestedClaimsHash||e.credentialType===ht.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(n.tokenType&&!this.matchTokenType(e,n.tokenType)||n.tokenType===et.SSH&&n.keyId&&!this.matchKeyId(e,n.keyId)))}getAppMetadataFilteredBy(e){let n=this.getKeys(),i={};return n.forEach(r=>{if(!this.isAppMetadata(r))return;let o=this.getAppMetadata(r);o&&(e.environment&&!this.matchEnvironment(o,e.environment)||e.clientId&&!this.matchClientId(o,e.clientId)||(i[r]=o))}),i}getAuthorityMetadataByAlias(e){let n=this.getAuthorityMetadataKeys(),i=null;return n.forEach(r=>{if(!this.isAuthorityMetadata(r)||r.indexOf(this.clientId)===-1)return;let o=this.getAuthorityMetadata(r);o&&o.aliases.indexOf(e)!==-1&&(i=o)}),i}removeAllAccounts(e){this.getAllAccounts({},e).forEach(i=>{this.removeAccount(i,e)})}removeAccount(e,n){this.removeAccountContext(e,n);let i=this.getAccountKeys(),r=o=>o.includes(e.homeAccountId)&&o.includes(e.environment);i.filter(r).forEach(o=>{this.removeItem(o,n),this.performanceClient.incrementFields({accountsRemoved:1},n)})}removeAccountContext(e,n){let i=this.getTokenKeys(),r=o=>o.includes(e.homeAccountId)&&o.includes(e.environment);i.idToken.filter(r).forEach(o=>{this.removeIdToken(o,n)}),i.accessToken.filter(r).forEach(o=>{this.removeAccessToken(o,n)}),i.refreshToken.filter(r).forEach(o=>{this.removeRefreshToken(o,n)})}removeAccessToken(e,n){let i=this.getAccessTokenCredential(e,n);if(this.removeItem(e,n),this.performanceClient.incrementFields({accessTokensRemoved:1},n),!i||i.credentialType.toLowerCase()!==ht.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()||i.tokenType!==et.POP)return;let r=i.keyId;r&&this.cryptoImpl.removeTokenBindingKey(r).catch(()=>{this.commonLogger.error(`Failed to remove token binding key ${r}`,n),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},n)})}removeAppMetadata(e){return this.getKeys().forEach(i=>{this.isAppMetadata(i)&&this.removeItem(i,e)}),!0}getIdToken(e,n,i,r,o){this.commonLogger.trace("CacheManager - getIdToken called");let s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:ht.ID_TOKEN,clientId:this.clientId,realm:r},a=this.getIdTokensByFilter(s,n,i),c=a.size;if(c<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(c>1){let u=a;if(!r){let l=new Map;a.forEach((f,m)=>{f.realm===e.tenantId&&l.set(m,f)});let d=l.size;if(d<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),a.values().next().value;if(d===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),l.values().next().value;u=l}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),u.forEach((l,d)=>{this.removeIdToken(d,n)}),o&&n&&o.addFields({multiMatchedID:a.size},n),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),a.values().next().value}getIdTokensByFilter(e,n,i){let r=i&&i.idToken||this.getTokenKeys().idToken,o=new Map;return r.forEach(s=>{if(!this.idTokenKeyMatchesFilter(s,{clientId:this.clientId,...e}))return;let a=this.getIdTokenCredential(s,n);a&&this.credentialMatchesFilter(a,e)&&o.set(s,a)}),o}idTokenKeyMatchesFilter(e,n){let i=e.toLowerCase();return!(n.clientId&&i.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&i.indexOf(n.homeAccountId.toLowerCase())===-1)}removeIdToken(e,n){this.removeItem(e,n)}removeRefreshToken(e,n){this.removeItem(e,n)}getAccessToken(e,n,i,r){let o=n.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",o);let s=vn.createSearchScopes(n.scopes),a=n.authenticationScheme||et.BEARER,c=a.toLowerCase()!==et.BEARER.toLowerCase()?ht.ACCESS_TOKEN_WITH_AUTH_SCHEME:ht.ACCESS_TOKEN,u={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:c,clientId:this.clientId,realm:r||e.tenantId,target:s,tokenType:a,keyId:n.sshKid,requestedClaimsHash:n.requestedClaimsHash},l=i&&i.accessToken||this.getTokenKeys().accessToken,d=[];l.forEach(m=>{if(this.accessTokenKeyMatchesFilter(m,u,!0)){let _=this.getAccessTokenCredential(m,o);_&&this.credentialMatchesFilter(_,u)&&d.push(_)}});let f=d.length;return f<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",o),null):f>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",o),d.forEach(m=>{this.removeAccessToken(this.generateCredentialKey(m),o)}),this.performanceClient.addFields({multiMatchedAT:d.length},o),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",o),d[0])}accessTokenKeyMatchesFilter(e,n,i){let r=e.toLowerCase();if(n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1||n.realm&&r.indexOf(n.realm.toLowerCase())===-1||n.requestedClaimsHash&&r.indexOf(n.requestedClaimsHash.toLowerCase())===-1)return!1;if(n.target){let o=n.target.asArray();for(let s=0;s<o.length;s++){if(i&&!r.includes(o[s].toLowerCase()))return!1;if(!i&&r.includes(o[s].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e,n){let i=this.getTokenKeys(),r=[];return i.accessToken.forEach(o=>{if(!this.accessTokenKeyMatchesFilter(o,e,!0))return;let s=this.getAccessTokenCredential(o,n);s&&this.credentialMatchesFilter(s,e)&&r.push(s)}),r}getRefreshToken(e,n,i,r,o){this.commonLogger.trace("CacheManager - getRefreshToken called");let s=n?tm:void 0,a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:ht.REFRESH_TOKEN,clientId:this.clientId,familyId:s},c=r&&r.refreshToken||this.getTokenKeys().refreshToken,u=[];c.forEach(d=>{if(this.refreshTokenKeyMatchesFilter(d,a)){let f=this.getRefreshTokenCredential(d,i);f&&this.credentialMatchesFilter(f,a)&&u.push(f)}});let l=u.length;return l<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(l>1&&o&&i&&o.addFields({multiMatchedRT:l},i),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),u[0])}refreshTokenKeyMatchesFilter(e,n){let i=e.toLowerCase();return!(n.familyId&&i.indexOf(n.familyId.toLowerCase())===-1||!n.familyId&&n.clientId&&i.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&i.indexOf(n.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){let n={environment:e,clientId:this.clientId},i=this.getAppMetadataFilteredBy(n),r=Object.keys(i).map(s=>i[s]),o=r.length;if(o<1)return null;if(o>1)throw j(wl);return r[0]}isAppMetadataFOCI(e){let n=this.readAppMetadataFromCache(e);return!!(n&&n.familyId===tm)}matchHomeAccountId(e,n){return typeof e.homeAccountId=="string"&&n===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,n){let i=e.oid||e.sub;return n===i}matchLocalAccountIdFromTenantProfile(e,n){return e.localAccountId===n}matchName(e,n){return n.toLowerCase()===e.name?.toLowerCase()}matchUsername(e,n){return!!(e&&typeof e=="string"&&n?.toLowerCase()===e.toLowerCase())}matchUserAssertionHash(e,n){return!!(e.userAssertionHash&&n===e.userAssertionHash)}matchEnvironment(e,n){if(this.staticAuthorityOptions){let r=mQ(this.staticAuthorityOptions,this.commonLogger);if(r.includes(n)&&r.includes(e.environment))return!0}let i=this.getAuthorityMetadataByAlias(n);return!!(i&&i.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,n){return e.credentialType&&n.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,n){return!!(e.clientId&&n===e.clientId)}matchFamilyId(e,n){return!!(e.familyId&&n===e.familyId)}matchRealm(e,n){return e.realm?.toLowerCase()===n.toLowerCase()}matchNativeAccountId(e,n){return!!(e.nativeAccountId&&n===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,n){return e.login_hint===n||e.preferred_username===n||e.upn===n}matchSid(e,n){return e.sid===n}matchAuthorityType(e,n){return!!(e.authorityType&&n.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,n){return e.credentialType!==ht.ACCESS_TOKEN&&e.credentialType!==ht.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:vn.fromString(e.target).containsScopeSet(n)}matchTokenType(e,n){return!!(e.tokenType&&e.tokenType===n)}matchKeyId(e,n){return!!(e.keyId&&e.keyId===n)}isAppMetadata(e){return e.indexOf($S)!==-1}isAuthorityMetadata(e){return e.indexOf(nm.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${nm.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,n){for(let i in n)e[i]=n[i];return e}},CS=class extends Gl{async setAccount(){throw j(Se)}getAccount(){throw j(Se)}async setIdTokenCredential(){throw j(Se)}getIdTokenCredential(){throw j(Se)}async setAccessTokenCredential(){throw j(Se)}getAccessTokenCredential(){throw j(Se)}async setRefreshTokenCredential(){throw j(Se)}getRefreshTokenCredential(){throw j(Se)}setAppMetadata(){throw j(Se)}getAppMetadata(){throw j(Se)}setServerTelemetry(){throw j(Se)}getServerTelemetry(){throw j(Se)}setAuthorityMetadata(){throw j(Se)}getAuthorityMetadata(){throw j(Se)}getAuthorityMetadataKeys(){throw j(Se)}setThrottlingCache(){throw j(Se)}getThrottlingCache(){throw j(Se)}removeItem(){throw j(Se)}getKeys(){throw j(Se)}getAccountKeys(){throw j(Se)}getTokenKeys(){throw j(Se)}generateCredentialKey(){throw j(Se)}generateAccountKey(){throw j(Se)}};var re={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",NetworkClientSendPostRequestAsync:"networkClientSendPostRequestAsync",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",InitializeCache:"initializeCache",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",GetAuthCodeUrl:"getAuthCodeUrl",GetStandardParams:"getStandardParams",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",HandleResponseEar:"handleResponseEar",HandleResponsePlatformBroker:"handleResponsePlatformBroker",HandleResponseCode:"handleResponseCode",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",ImportExistingCache:"importExistingCache",SetUserData:"setUserData",LocalStorageUpdated:"localStorageUpdated",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues",GenerateHKDF:"generateHKDF",GenerateBaseKey:"generateBaseKey",Base64Decode:"base64Decode",UrlEncodeArr:"urlEncodeArr",Encrypt:"encrypt",Decrypt:"decrypt",GenerateEarKey:"generateEarKey",DecryptEarResponse:"decryptEarResponse"},yQ={InProgress:1};var Rm=class{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}},SS=class{generateId(){return"callback-id"}startMeasurement(e,n){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:yQ.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""},measurement:new Rm}}startPerformanceMeasurement(){return new Rm}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}};var EQ={tokenRenewalOffsetSeconds:H1,preventCorsPreflight:!1},TQ={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:ie.LogLevel.Info,correlationId:D.EMPTY_STRING},AQ={claimsBasedCachingEnabled:!1},CQ={async sendGetRequestAsync(){throw j(Se)},async sendPostRequestAsync(){throw j(Se)}},SQ={sku:D.SKU,version:zS,cpu:D.EMPTY_STRING,os:D.EMPTY_STRING},wQ={clientSecret:D.EMPTY_STRING,clientAssertion:void 0},IQ={azureCloudInstance:zm.None,tenant:`${D.DEFAULT_COMMON_TENANT}`},vQ={application:{appName:"",appVersion:""}};function bQ({authOptions:t,systemOptions:e,loggerOptions:n,cacheOptions:i,storageInterface:r,networkInterface:o,cryptoInterface:s,clientCredentials:a,libraryInfo:c,telemetry:u,serverTelemetryManager:l,persistencePlugin:d,serializableCache:f}){let m={...TQ,...n};return{authOptions:OQ(t),systemOptions:{...EQ,...e},loggerOptions:m,cacheOptions:{...AQ,...i},storageInterface:r||new CS(t.clientId,AS,new Ki(m),new SS),networkInterface:o||CQ,cryptoInterface:s||AS,clientCredentials:a||wQ,libraryInfo:{...SQ,...c},telemetry:{...vQ,...u},serverTelemetryManager:l||null,persistencePlugin:d||null,serializableCache:f||null}}function OQ(t){return{clientCapabilities:[],azureCloudOptions:IQ,skipAuthorityMetadataCache:!1,instanceAware:!1,encodeExtraQueryParams:!1,...t}}function K1(t){return t.authOptions.authority.options.protocolMode===Xi.OIDC}var Yr={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};var nd="client_id",X1="redirect_uri",RQ="response_type",NQ="response_mode",PQ="grant_type",DQ="claims",MQ="scope",kQ="refresh_token",LQ="state",UQ="nonce",xQ="prompt",FQ="code",qQ="code_challenge",HQ="code_challenge_method",BQ="code_verifier",jQ="client-request-id",YQ="x-client-SKU",VQ="x-client-VER",$Q="x-client-OS",zQ="x-client-CPU",GQ="x-client-current-telemetry",WQ="x-client-last-telemetry",KQ="x-ms-lib-capability",XQ="x-app-name",QQ="x-app-ver",ZQ="post_logout_redirect_uri",JQ="id_token_hint",eZ="device_code",tZ="client_secret",nZ="client_assertion",rZ="client_assertion_type",Q1="token_type",Z1="req_cnf",iZ="assertion",oZ="requested_token_use",sZ="on_behalf_of",T1="return_spa_code",aZ="logout_hint",cZ="sid",uZ="login_hint",lZ="domain_hint",A1="x-client-xtra-sku",wS="brk_client_id",C1="brk_redirect_uri",IS="instance_aware";function XS(t,e,n){if(!e)return;let i=t.get(nd);i&&t.has(wS)&&n?.addFields({embeddedClientId:i,embeddedRedirectUri:t.get(X1)},e)}function J1(t,e){t.set(RQ,e)}function dZ(t,e){t.set(NQ,e||$m.QUERY)}function Qi(t,e,n=!0,i=Ti){n&&!i.includes("openid")&&!e.includes("openid")&&i.push("openid");let r=n?[...e||[],...i]:e||[],o=new vn(r);t.set(MQ,o.printScopes())}function Zi(t,e){t.set(nd,e)}function QS(t,e){t.set(X1,e)}function hZ(t,e){t.set(ZQ,e)}function fZ(t,e){t.set(JQ,e)}function pZ(t,e){t.set(lZ,e)}function Xp(t,e){t.set(uZ,e)}function Wl(t,e){t.set(Yt.CCS_HEADER,`UPN:${e}`)}function ll(t,e){t.set(Yt.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function S1(t,e){t.set(cZ,e)}function Ji(t,e,n){let i=wZ(e,n);try{JSON.parse(i)}catch{throw yt(pa)}t.set(DQ,i)}function qo(t,e){t.set(jQ,e)}function Ho(t,e){t.set(YQ,e.sku),t.set(VQ,e.version),e.os&&t.set($Q,e.os),e.cpu&&t.set(zQ,e.cpu)}function Bo(t,e){e?.appName&&t.set(XQ,e.appName),e?.appVersion&&t.set(QQ,e.appVersion)}function mZ(t,e){t.set(xQ,e)}function eU(t,e){e&&t.set(LQ,e)}function gZ(t,e){t.set(UQ,e)}function _Z(t,e,n){if(e&&n)t.set(qQ,e),t.set(HQ,n);else throw yt(Vl)}function yZ(t,e){t.set(FQ,e)}function EZ(t,e){t.set(eZ,e)}function TZ(t,e){t.set(kQ,e)}function AZ(t,e){t.set(BQ,e)}function rd(t,e){t.set(tZ,e)}function id(t,e){e&&t.set(nZ,e)}function od(t,e){e&&t.set(rZ,e)}function CZ(t,e){t.set(iZ,e)}function SZ(t,e){t.set(oZ,e)}function wa(t,e){t.set(PQ,e)}function Ia(t){t.set(iQ,"1")}function tU(t){t.has(IS)||t.set(IS,"true")}function $r(t,e){Object.entries(e).forEach(([n,i])=>{!t.has(n)&&i&&t.set(n,i)})}function wZ(t,e){let n;if(!t)n={};else try{n=JSON.parse(t)}catch{throw yt(pa)}return e&&e.length>0&&(n.hasOwnProperty(Wp.ACCESS_TOKEN)||(n[Wp.ACCESS_TOKEN]={}),n[Wp.ACCESS_TOKEN][Wp.XMS_CC]={values:e}),JSON.stringify(n)}function IZ(t,e){t.set(q1.username,e)}function vZ(t,e){t.set(q1.password,e)}function nU(t,e){e&&(t.set(Q1,et.POP),t.set(Z1,e))}function rU(t,e){e&&(t.set(Q1,et.SSH),t.set(Z1,e))}function va(t,e){t.set(GQ,e.generateCurrentRequestHeaderValue()),t.set(WQ,e.generateLastRequestHeaderValue())}function ba(t){t.set(KQ,cl.X_MS_LIB_CAPABILITY_VALUE)}function bZ(t,e){t.set(aZ,e)}function Gm(t,e,n){t.has(wS)||t.set(wS,e),t.has(C1)||t.set(C1,n)}function OZ(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}function RZ(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}function NZ(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}var PZ=(t,e,n,i,r)=>(...o)=>{n.trace(`Executing function ${e}`);let s=i?.startMeasurement(e,r);if(r){let a=e+"CallCount";i?.incrementFields({[a]:1},r)}try{let a=t(...o);return s?.end({success:!0}),n.trace(`Returning result from ${e}`),a}catch(a){n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(a))}catch{n.trace("Unable to print error message.")}throw s?.end({success:!1},a),a}},Ve=(t,e,n,i,r)=>(...o)=>{n.trace(`Executing function ${e}`);let s=i?.startMeasurement(e,r);if(r){let a=e+"CallCount";i?.incrementFields({[a]:1},r)}return i?.setPreQueueTime(e,r),t(...o).then(a=>(n.trace(`Returning result from ${e}`),s?.end({success:!0}),a)).catch(a=>{n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(a))}catch{n.trace("Unable to print error message.")}throw s?.end({success:!1},a),a})};var Nm=class t{constructor(e,n,i,r){this.networkInterface=e,this.logger=n,this.performanceClient=i,this.correlationId=r}async detectRegion(e,n){this.performanceClient?.addQueueMeasurement(re.RegionDiscoveryDetectRegion,this.correlationId);let i=e;if(i)n.region_source=Js.ENVIRONMENT_VARIABLE;else{let r=t.IMDS_OPTIONS;try{let o=await Ve(this.getRegionFromIMDS.bind(this),re.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(D.IMDS_VERSION,r);if(o.status===It.SUCCESS&&(i=o.body,n.region_source=Js.IMDS),o.status===It.BAD_REQUEST){let s=await Ve(this.getCurrentVersion.bind(this),re.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(r);if(!s)return n.region_source=Js.FAILED_AUTO_DETECTION,null;let a=await Ve(this.getRegionFromIMDS.bind(this),re.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(s,r);a.status===It.SUCCESS&&(i=a.body,n.region_source=Js.IMDS)}}catch{return n.region_source=Js.FAILED_AUTO_DETECTION,null}}return i||(n.region_source=Js.FAILED_AUTO_DETECTION),i||null}async getRegionFromIMDS(e,n){return this.performanceClient?.addQueueMeasurement(re.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${D.IMDS_ENDPOINT}?api-version=${e}&format=text`,n,D.IMDS_TIMEOUT)}async getCurrentVersion(e){this.performanceClient?.addQueueMeasurement(re.RegionDiscoveryGetCurrentVersion,this.correlationId);try{let n=await this.networkInterface.sendGetRequestAsync(`${D.IMDS_ENDPOINT}?format=json`,e);return n.status===It.BAD_REQUEST&&n.body&&n.body["newest-versions"]&&n.body["newest-versions"].length>0?n.body["newest-versions"][0]:null}catch{return null}}};Nm.IMDS_OPTIONS={headers:{Metadata:"true"}};function ft(){return Math.round(new Date().getTime()/1e3)}function gS(t){return t?new Date(Number(t)*1e3):new Date}function _a(t,e){let n=Number(t)||0;return ft()+e>n}function DZ(t){return Number(t)>ft()}function MZ(t,e){return new Promise(n=>setTimeout(()=>n(e),t))}function kZ(t,e,n,i,r){return{credentialType:ht.ID_TOKEN,homeAccountId:t,environment:e,clientId:i,secret:n,realm:r,lastUpdatedAt:Date.now().toString()}}function LZ(t,e,n,i,r,o,s,a,c,u,l,d,f,m,_){let E={homeAccountId:t,credentialType:ht.ACCESS_TOKEN,secret:n,cachedAt:ft().toString(),expiresOn:s.toString(),extendedExpiresOn:a.toString(),environment:e,clientId:i,realm:r,target:o,tokenType:l||et.BEARER,lastUpdatedAt:Date.now().toString()};if(d&&(E.userAssertionHash=d),u&&(E.refreshOn=u.toString()),m&&(E.requestedClaims=m,E.requestedClaimsHash=_),E.tokenType?.toLowerCase()!==et.BEARER.toLowerCase())switch(E.credentialType=ht.ACCESS_TOKEN_WITH_AUTH_SCHEME,E.tokenType){case et.POP:let I=td(n,c);if(!I?.cnf?.kid)throw j(kl);E.keyId=I.cnf.kid;break;case et.SSH:E.keyId=f}return E}function UZ(t,e,n,i,r,o,s){let a={credentialType:ht.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:i,secret:n,lastUpdatedAt:Date.now().toString()};return o&&(a.userAssertionHash=o),r&&(a.familyId=r),s&&(a.expiresOn=s.toString()),a}function ZS(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function w1(t){return t?ZS(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===ht.ACCESS_TOKEN||t.credentialType===ht.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function I1(t){return t?ZS(t)&&t.hasOwnProperty("realm")&&t.credentialType===ht.ID_TOKEN:!1}function v1(t){return t?ZS(t)&&t.credentialType===ht.REFRESH_TOKEN:!1}function xZ(t,e){let n=t.indexOf(jt.CACHE_KEY)===0,i=!0;return e&&(i=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),n&&i}function FZ(t,e){let n=!1;t&&(n=t.indexOf(cl.THROTTLING_PREFIX)===0);let i=!0;return e&&(i=e.hasOwnProperty("throttleTime")),n&&i}function qZ({environment:t,clientId:e}){return[$S,t,e].join(ml.CACHE_KEY_SEPARATOR).toLowerCase()}function b1(t,e){return e?t.indexOf($S)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function HZ(t,e){return e?t.indexOf(nm.CACHE_KEY)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function O1(){return ft()+nm.REFRESH_TIME_SECONDS}function Qp(t,e,n){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=n,t.jwks_uri=e.jwks_uri}function _S(t,e,n){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=n}function R1(t){return t.expiresAt<=ft()}var Lo=class t{constructor(e,n,i,r,o,s,a,c){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=n,this.cacheManager=i,this.authorityOptions=r,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=o,this.performanceClient=a,this.correlationId=s,this.managedIdentity=c||!1,this.regionDiscovery=new Nm(n,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(D.CIAM_AUTH_URL))return jr.Ciam;let n=e.PathSegments;if(n.length)switch(n[0].toLowerCase()){case D.ADFS:return jr.Adfs;case D.DSTS:return jr.Dsts}return jr.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new Je(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw j(Jn)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw j(Jn)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw j(Jn)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw j(Ll);return this.replacePath(this.metadata.end_session_endpoint)}else throw j(Jn)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw j(Jn)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw j(Jn)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===jr.Default&&this.protocolMode!==Xi.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let n=e,r=new Je(this.metadata.canonical_authority).getUrlComponents(),o=r.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((a,c)=>{let u=o[c];if(c===0&&this.canReplaceTenant(r)){let l=new Je(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];u!==l&&(this.logger.verbose(`Replacing tenant domain name ${u} with id ${l}`),u=l)}a!==u&&(n=n.replace(`/${u}/`,`/${a}/`))}),this.replaceTenant(n)}get defaultOpenIdConfigurationEndpoint(){let e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===jr.Adfs||this.protocolMode===Xi.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){this.performanceClient?.addQueueMeasurement(re.AuthorityResolveEndpointsAsync,this.correlationId);let e=this.getCurrentMetadataEntity(),n=await Ve(this.updateCloudDiscoveryMetadata.bind(this),re.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let i=await Ve(this.updateEndpointMetadata.bind(this),re.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,n,{source:i}),this.performanceClient?.addFields({cloudDiscoverySource:n,authorityEndpointSource:i},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:O1(),jwks_uri:""}),e}updateCachedMetadata(e,n,i){n!==Un.CACHE&&i?.source!==Un.CACHE&&(e.expiresAt=O1(),e.canonical_authority=this.canonicalAuthority);let r=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(r,e),this.metadata=e}async updateEndpointMetadata(e){this.performanceClient?.addQueueMeasurement(re.AuthorityUpdateEndpointMetadata,this.correlationId);let n=this.updateEndpointMetadataFromLocalSources(e);if(n){if(n.source===Un.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&n.metadata){let r=await Ve(this.updateMetadataWithRegionalInformation.bind(this),re.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(n.metadata);Qp(e,r,!1),e.canonical_authority=this.canonicalAuthority}return n.source}let i=await Ve(this.getEndpointMetadataFromNetwork.bind(this),re.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(i=await Ve(this.updateMetadataWithRegionalInformation.bind(this),re.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(i)),Qp(e,i,!0),Un.NETWORK;throw j(El,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");let n=this.getEndpointMetadataFromConfig();if(n)return this.logger.verbose("Found endpoint metadata in authority configuration"),Qp(e,n,!1),{source:Un.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{let r=this.getEndpointMetadataFromHardcodedValues();if(r)return Qp(e,r,!1),{source:Un.HARDCODED_VALUES,metadata:r};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}let i=R1(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!i?(this.logger.verbose("Found endpoint metadata in the cache."),{source:Un.CACHE}):(i&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new Je(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw yt($l)}return null}async getEndpointMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(re.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);let e={},n=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${n}`);try{let i=await this.networkInterface.sendGetRequestAsync(n,e);return OZ(i.body)?i.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(i){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${i}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in y1?y1[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){this.performanceClient?.addQueueMeasurement(re.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);let n=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(n){if(n!==D.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=pS.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);let i=await Ve(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),re.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(i)return this.regionDiscoveryMetadata.region_outcome=pS.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=i,t.replaceWithRegionalInformation(e,i);this.regionDiscoveryMetadata.region_outcome=pS.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){this.performanceClient?.addQueueMeasurement(re.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);let n=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(n)return n;let i=await Ve(this.getCloudDiscoveryMetadataFromNetwork.bind(this),re.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return _S(e,i,!0),Un.NETWORK;throw yt(zl)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||D.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||D.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||D.NOT_APPLICABLE}`);let n=this.getCloudDiscoveryMetadataFromConfig();if(n)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),_S(e,n,!1),Un.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{let r=gQ(this.hostnameAndPort);if(r)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),_S(e,r,!1),Un.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}let i=R1(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!i?(this.logger.verbose("Found cloud discovery metadata in the cache."),Un.CACHE):(i&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===jr.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");let e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),n=Om(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),n)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),n;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),yt(ma)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(re.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);let e=`${D.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,n={},i=null;try{let r=await this.networkInterface.sendGetRequestAsync(e,n),o,s;if(RZ(r.body))o=r.body,s=o.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${o.tenant_discovery_endpoint}`);else if(NZ(r.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${r.status}`),o=r.body,o.error===D.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${o.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${o.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),s=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),i=Om(s,this.hostnameAndPort)}catch(r){if(r instanceof We)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
|
|
23
|
+
Error: ${r.errorCode}
|
|
24
|
+
Error Description: ${r.errorMessage}`);else{let o=r;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.
|
|
25
|
+
Error: ${o.name}
|
|
26
|
+
Error Description: ${o.message}`)}return null}return i||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),i=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),i}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&Je.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let i;if(n&&n.azureCloudInstance!==zm.None){let r=n.tenant?n.tenant:D.DEFAULT_COMMON_TENANT;i=`${n.azureCloudInstance}/${r}/`}return i||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return D.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw j(Jn)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return G1.has(e)}static isPublicCloudAuthority(e){return D.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,i){let r=new Je(e);r.validateAsUri();let o=r.getUrlComponents(),s=`${n}.${o.HostNameAndPort}`;this.isPublicCloudAuthority(o.HostNameAndPort)&&(s=`${n}.${D.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);let a=Je.constructAuthorityUriFromObject({...r.getUrlComponents(),HostNameAndPort:s}).urlString;return i?`${a}?${i}`:a}static replaceWithRegionalInformation(e,n){let i={...e};return i.authorization_endpoint=t.buildRegionalAuthorityString(i.authorization_endpoint,n),i.token_endpoint=t.buildRegionalAuthorityString(i.token_endpoint,n),i.end_session_endpoint&&(i.end_session_endpoint=t.buildRegionalAuthorityString(i.end_session_endpoint,n)),i}static transformCIAMAuthority(e){let n=e,r=new Je(e).getUrlComponents();if(r.PathSegments.length===0&&r.HostNameAndPort.endsWith(D.CIAM_AUTH_URL)){let o=r.HostNameAndPort.split(".")[0];n=`${n}${o}${D.AAD_TENANT_DOMAIN_SUFFIX}`}return n}};Lo.reservedTenantDomains=new Set(["{tenant}","{tenantid}",Ai.COMMON,Ai.CONSUMERS,Ai.ORGANIZATIONS]);function BZ(t){let i=new Je(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(i){case Ai.COMMON:case Ai.ORGANIZATIONS:case Ai.CONSUMERS:return;default:return i}}function iU(t){return t.endsWith(D.FORWARD_SLASH)?t:`${t}${D.FORWARD_SLASH}`}function jZ(t){let e=t.cloudDiscoveryMetadata,n;if(e)try{n=JSON.parse(e)}catch{throw yt(ma)}return{canonicalAuthority:t.authority?iU(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}async function oU(t,e,n,i,r,o,s){s?.addQueueMeasurement(re.AuthorityFactoryCreateDiscoveredInstance,o);let a=Lo.transformCIAMAuthority(iU(t)),c=new Lo(a,e,n,i,r,o,s);try{return await Ve(c.resolveEndpointsAsync.bind(c),re.AuthorityResolveEndpointsAsync,r,s,o)(),c}catch{throw j(Jn)}}var Uo=class t extends We{constructor(e,n,i,r,o){super(e,n,i),this.name="ServerError",this.errorNo=r,this.status=o,Object.setPrototypeOf(this,t.prototype)}};function JS(t,e,n){return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:n,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||e.tokenBodyParameters?.clientId}}var Pm=class t{static generateThrottlingStorageKey(e){return`${cl.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,n,i){let r=t.generateThrottlingStorageKey(n),o=e.getThrottlingCache(r);if(o){if(o.throttleTime<Date.now()){e.removeItem(r,i);return}throw new Uo(o.errorCodes?.join(" ")||D.EMPTY_STRING,o.errorMessage,o.subError)}}static postProcess(e,n,i,r){if(t.checkResponseStatus(i)||t.checkResponseForRetryAfter(i)){let o={throttleTime:t.calculateThrottleTime(parseInt(i.headers[Yt.RETRY_AFTER])),error:i.body.error,errorCodes:i.body.error_codes,errorMessage:i.body.error_description,subError:i.body.suberror};e.setThrottlingCache(t.generateThrottlingStorageKey(n),o,r)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Yt.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){let n=e<=0?0:e,i=Date.now()/1e3;return Math.floor(Math.min(i+(n||cl.DEFAULT_THROTTLE_TIME_SECONDS),i+cl.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,n,i,r){let o=JS(n,i,r),s=this.generateThrottlingStorageKey(o);e.removeItem(s,i.correlationId)}};var vS=class t extends We{constructor(e,n,i){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,t.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=i}};var wi=class{constructor(e,n){this.config=bQ(e),this.logger=new Ki(this.config.loggerOptions,B1,zS),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n}createTokenRequestHeaders(e){let n={};if(n[Yt.CONTENT_TYPE]=D.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Yr.HOME_ACCOUNT_ID:try{let i=na(e.credential);n[Yt.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case Yr.UPN:n[Yt.CCS_HEADER]=`UPN: ${e.credential}`;break}return n}async executePostToTokenEndpoint(e,n,i,r,o,s){s&&this.performanceClient?.addQueueMeasurement(s,o);let a=await this.sendPostRequest(r,e,{body:n,headers:i},o);return this.config.serverTelemetryManager&&a.status<500&&a.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async sendPostRequest(e,n,i,r){Pm.preProcess(this.cacheManager,e,r);let o;try{o=await Ve(this.networkClient.sendPostRequestAsync.bind(this.networkClient),re.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,r)(n,i);let s=o.headers||{};this.performanceClient?.addFields({refreshTokenSize:o.body.refresh_token?.length||0,httpVerToken:s[Yt.X_MS_HTTP_VERSION]||"",requestId:s[Yt.X_MS_REQUEST_ID]||""},r)}catch(s){if(s instanceof vS){let a=s.responseHeaders;throw a&&this.performanceClient?.addFields({httpVerToken:a[Yt.X_MS_HTTP_VERSION]||"",requestId:a[Yt.X_MS_REQUEST_ID]||"",contentTypeHeader:a[Yt.CONTENT_TYPE]||void 0,contentLengthHeader:a[Yt.CONTENT_LENGTH]||void 0,httpStatus:s.httpStatus},r),s.error}throw s instanceof We?s:j(ko)}return Pm.postProcess(this.cacheManager,e,o,r),o}async updateAuthority(e,n){this.performanceClient?.addQueueMeasurement(re.UpdateTokenEndpointAuthority,n);let i=`https://${e}/${this.authority.tenant}/`,r=await oU(i,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=r}createTokenQueryParameters(e){let n=new Map;return e.embeddedClientId&&Gm(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenQueryParameters&&$r(n,e.tokenQueryParameters),qo(n,e.correlationId),XS(n,e.correlationId,this.performanceClient),Fn(n)}};var ya="no_tokens_found",Dm="native_account_unavailable",ew="refresh_token_expired",tw="ux_not_allowed",sU="interaction_required",aU="consent_required",cU="login_required",Ea="bad_token",YZ=Object.freeze({__proto__:null,badToken:Ea,consentRequired:aU,interactionRequired:sU,loginRequired:cU,nativeAccountUnavailable:Dm,noTokensFound:ya,refreshTokenExpired:ew,uxNotAllowed:tw});var N1=[sU,aU,cU,Ea,tw],VZ=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],em={[ya]:"No refresh token found in the cache. Please sign-in.",[Dm]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[ew]:"Refresh token has expired.",[Ea]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",[tw]:"`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve."},$Z={noTokensFoundError:{code:ya,desc:em[ya]},native_account_unavailable:{code:Dm,desc:em[Dm]},bad_token:{code:Ea,desc:em[Ea]}},xo=class t extends We{constructor(e,n,i,r,o,s,a,c){super(e,n,i),Object.setPrototypeOf(this,t.prototype),this.timestamp=r||D.EMPTY_STRING,this.traceId=o||D.EMPTY_STRING,this.correlationId=s||D.EMPTY_STRING,this.claims=a||D.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=c}};function zZ(t,e,n){let i=!!t&&N1.indexOf(t)>-1,r=!!n&&VZ.indexOf(n)>-1,o=!!e&&N1.some(s=>e.indexOf(s)>-1);return i||o||r}function P1(t){return new xo(t,em[t])}var bS=class t{static setRequestState(e,n,i){let r=t.generateLibraryState(e,i);return n?`${r}${D.RESOURCE_DELIM}${n}`:r}static generateLibraryState(e,n){if(!e)throw j(da);let i={id:e.createNewGuid()};n&&(i.meta=n);let r=JSON.stringify(i);return e.base64Encode(r)}static parseRequestState(e,n){if(!e)throw j(da);if(!n)throw j(oa);try{let i=n.split(D.RESOURCE_DELIM),r=i[0],o=i.length>1?i.slice(1).join(D.RESOURCE_DELIM):D.EMPTY_STRING,s=e.base64Decode(r),a=JSON.parse(s);return{userRequestState:o||D.EMPTY_STRING,libraryState:a}}catch{throw j(oa)}}};var GZ={SW:"sw"},Kl=class{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){this.performanceClient?.addQueueMeasurement(re.PopTokenGenerateCnf,e.correlationId);let i=await Ve(this.generateKid.bind(this),re.PopTokenGenerateCnf,n,this.performanceClient,e.correlationId)(e),r=this.cryptoUtils.base64UrlEncode(JSON.stringify(i));return{kid:i.kid,reqCnfString:r}}async generateKid(e){return this.performanceClient?.addQueueMeasurement(re.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:GZ.SW}}async signPopToken(e,n,i){return this.signPayload(e,n,i)}async signPayload(e,n,i,r){let{resourceRequestMethod:o,resourceRequestUri:s,shrClaims:a,shrNonce:c,shrOptions:u}=i,d=(s?new Je(s):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:ft(),m:o?.toUpperCase(),u:d?.HostNameAndPort,nonce:c||this.cryptoUtils.createNewGuid(),p:d?.AbsolutePath,q:d?.QueryString?[[],d.QueryString]:void 0,client_claims:a||void 0,...r},n,u,i.correlationId)}};var Wi=class{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}};var tr=class t{constructor(e,n,i,r,o,s,a){this.clientId=e,this.cacheStorage=n,this.cryptoObj=i,this.logger=r,this.serializableCache=o,this.persistencePlugin=s,this.performanceClient=a}validateTokenResponse(e,n){if(e.error||e.error_description||e.suberror){let i=`Error(s): ${e.error_codes||D.NOT_AVAILABLE} - Timestamp: ${e.timestamp||D.NOT_AVAILABLE} - Description: ${e.error_description||D.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||D.NOT_AVAILABLE} - Trace ID: ${e.trace_id||D.NOT_AVAILABLE}`,r=e.error_codes?.length?e.error_codes[0]:void 0,o=new Uo(e.error,i,e.suberror,r,e.status);if(n&&e.status&&e.status>=It.SERVER_ERROR_RANGE_START&&e.status<=It.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
|
|
27
|
+
${o}`);return}else if(n&&e.status&&e.status>=It.CLIENT_ERROR_RANGE_START&&e.status<=It.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
|
|
28
|
+
${o}`);return}throw zZ(e.error,e.error_description,e.suberror)?new xo(e.error,e.error_description,e.suberror,e.timestamp||D.EMPTY_STRING,e.trace_id||D.EMPTY_STRING,e.correlation_id||D.EMPTY_STRING,e.claims||D.EMPTY_STRING,r):o}}async handleServerTokenResponse(e,n,i,r,o,s,a,c,u){this.performanceClient?.addQueueMeasurement(re.HandleServerTokenResponse,e.correlation_id);let l;if(e.id_token){if(l=td(e.id_token||D.EMPTY_STRING,this.cryptoObj.base64Decode),o&&o.nonce&&l.nonce!==o.nonce)throw j(Cl);if(r.maxAge||r.maxAge===0){let _=l.auth_time;if(!_)throw j(sa);V1(_,r.maxAge)}}this.homeAccountIdentifier=xn.generateHomeAccountId(e.client_info||D.EMPTY_STRING,n.authorityType,this.logger,this.cryptoObj,l);let d;o&&o.state&&(d=bS.parseRequestState(this.cryptoObj,o.state)),e.key_id=e.key_id||r.sshKid||void 0;let f=this.generateCacheRecord(e,n,i,r,l,s,o),m;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),m=new Wi(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(m)),a&&!c&&f.account){let _=this.cacheStorage.generateAccountKey(xn.getAccountInfo(f.account));if(!this.cacheStorage.getAccount(_,r.correlationId))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await t.generateAuthenticationResult(this.cryptoObj,n,f,!1,r,l,d,void 0,u)}await this.cacheStorage.saveCacheRecord(f,r.correlationId,hQ(l||{}),r.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&m&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(m))}return t.generateAuthenticationResult(this.cryptoObj,n,f,!1,r,l,d,e,u)}generateCacheRecord(e,n,i,r,o,s,a){let c=n.getPreferredCache();if(!c)throw j(la);let u=Y1(o),l,d;e.id_token&&o&&(l=kZ(this.homeAccountIdentifier,c,e.id_token,this.clientId,u||""),d=WZ(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,r.correlationId,o,e.client_info,c,u,a,void 0,this.logger));let f=null;if(e.access_token){let E=e.scope?vn.fromString(e.scope):new vn(r.scopes||[]),I=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,y=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,A=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,S=i+I,w=S+y,N=A&&A>0?i+A:void 0;f=LZ(this.homeAccountIdentifier,c,e.access_token,this.clientId,u||n.tenant||"",E.printScopes(),S,w,this.cryptoObj.base64Decode,N,e.token_type,s,e.key_id,r.claims,r.requestedClaimsHash)}let m=null;if(e.refresh_token){let E;if(e.refresh_token_expires_in){let I=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;E=i+I}m=UZ(this.homeAccountIdentifier,c,e.refresh_token,this.clientId,e.foci,s,E)}let _=null;return e.foci&&(_={clientId:this.clientId,environment:c,familyId:e.foci}),{account:d,idToken:l,accessToken:f,refreshToken:m,appMetadata:_}}static async generateAuthenticationResult(e,n,i,r,o,s,a,c,u){let l=D.EMPTY_STRING,d=[],f=null,m,_,E=D.EMPTY_STRING;if(i.accessToken){if(i.accessToken.tokenType===et.POP&&!o.popKid){let S=new Kl(e),{secret:w,keyId:N}=i.accessToken;if(!N)throw j(Ul);l=await S.signPopToken(w,N,o)}else l=i.accessToken.secret;d=vn.fromString(i.accessToken.target).asArray(),f=gS(i.accessToken.expiresOn),m=gS(i.accessToken.extendedExpiresOn),i.accessToken.refreshOn&&(_=gS(i.accessToken.refreshOn))}i.appMetadata&&(E=i.appMetadata.familyId===tm?tm:"");let I=s?.oid||s?.sub||"",y=s?.tid||"";c?.spa_accountid&&i.account&&(i.account.nativeAccountId=c?.spa_accountid);let A=i.account?j1(xn.getAccountInfo(i.account),void 0,s,i.idToken?.secret):null;return{authority:n.canonicalAuthority,uniqueId:I,tenantId:y,scopes:d,account:A,idToken:i?.idToken?.secret||"",idTokenClaims:s||{},accessToken:l,fromCache:r,expiresOn:f,extExpiresOn:m,refreshOn:_,correlationId:o.correlationId,requestId:u||D.EMPTY_STRING,familyId:E,tokenType:i.accessToken?.tokenType||D.EMPTY_STRING,state:a?a.userRequestState:D.EMPTY_STRING,cloudGraphHostName:i.account?.cloudGraphHostName||D.EMPTY_STRING,msGraphHost:i.account?.msGraphHost||D.EMPTY_STRING,code:c?.spa_code,fromNativeBroker:!1}}};function WZ(t,e,n,i,r,o,s,a,c,u,l,d){d?.verbose("setCachedAccount called");let m=t.getAccountKeys().find(A=>A.startsWith(n)),_=null;m&&(_=t.getAccount(m,r));let E=_||xn.createAccount({homeAccountId:n,idTokenClaims:o,clientInfo:s,environment:a,cloudGraphHostName:u?.cloud_graph_host_name,msGraphHost:u?.msgraph_host,nativeAccountId:l},e,i),I=E.tenantProfiles||[],y=c||E.realm;if(y&&!I.find(A=>A.tenantId===y)){let A=GS(n,E.localAccountId,y,o);I.push(A)}return E.tenantProfiles=I,E}async function jo(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}var OS=class extends wi{constructor(e,n){super(e,n),this.includeRedirectUri=!0,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,n){if(this.performanceClient?.addQueueMeasurement(re.AuthClientAcquireToken,e.correlationId),!e.code)throw j(Il);let i=ft(),r=await Ve(this.executeTokenRequest.bind(this),re.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),o=r.headers?.[Yt.X_MS_REQUEST_ID],s=new tr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(r.body),Ve(s.handleServerTokenResponse.bind(s),re.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,i,e,n,void 0,void 0,void 0,o)}getLogoutUri(e){if(!e)throw yt(Yl);let n=this.createLogoutUrlQueryString(e);return Je.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n){this.performanceClient?.addQueueMeasurement(re.AuthClientExecuteTokenRequest,n.correlationId);let i=this.createTokenQueryParameters(n),r=Je.appendQueryString(e.tokenEndpoint,i),o=await Ve(this.createTokenRequestBody.bind(this),re.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,n.correlationId)(n),s;if(n.clientInfo)try{let u=bm(n.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${u.uid}${ml.CLIENT_INFO_SEPARATOR}${u.utid}`,type:Yr.HOME_ACCOUNT_ID}}catch(u){this.logger.verbose("Could not parse client info for CCS Header: "+u)}let a=this.createTokenRequestHeaders(s||n.ccsCredential),c=JS(this.config.authOptions.clientId,n);return Ve(this.executePostToTokenEndpoint.bind(this),re.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,n.correlationId)(r,o,a,c,n.correlationId,re.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(re.AuthClientCreateTokenRequestBody,e.correlationId);let n=new Map;if(Zi(n,e.embeddedClientId||e.tokenBodyParameters?.[nd]||this.config.authOptions.clientId),this.includeRedirectUri)QS(n,e.redirectUri);else if(!e.redirectUri)throw yt(ql);if(Qi(n,e.scopes,!0,this.oidcDefaultScopes),yZ(n,e.code),Ho(n,this.config.libraryInfo),Bo(n,this.config.telemetry.application),ba(n),this.serverTelemetryManager&&!K1(this.config)&&va(n,this.serverTelemetryManager),e.codeVerifier&&AZ(n,e.codeVerifier),this.config.clientCredentials.clientSecret&&rd(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let r=this.config.clientCredentials.clientAssertion;id(n,await jo(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),od(n,r.assertionType)}if(wa(n,Sa.AUTHORIZATION_CODE_GRANT),Ia(n),e.authenticationScheme===et.POP){let r=new Kl(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Ve(r.generateCnf.bind(r),re.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,nU(n,o)}else if(e.authenticationScheme===et.SSH)if(e.sshJwk)rU(n,e.sshJwk);else throw yt(ga);(!bn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ji(n,e.claims,this.config.authOptions.clientCapabilities);let i;if(e.clientInfo)try{let r=bm(e.clientInfo,this.cryptoUtils.base64Decode);i={credential:`${r.uid}${ml.CLIENT_INFO_SEPARATOR}${r.utid}`,type:Yr.HOME_ACCOUNT_ID}}catch(r){this.logger.verbose("Could not parse client info for CCS Header: "+r)}else i=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&i)switch(i.type){case Yr.HOME_ACCOUNT_ID:try{let r=na(i.credential);ll(n,r)}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case Yr.UPN:Wl(n,i.credential);break}return e.embeddedClientId&&Gm(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&$r(n,e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[T1])&&$r(n,{[T1]:"1"}),XS(n,e.correlationId,this.performanceClient),Fn(n)}createLogoutUrlQueryString(e){let n=new Map;return e.postLogoutRedirectUri&&hZ(n,e.postLogoutRedirectUri),e.correlationId&&qo(n,e.correlationId),e.idTokenHint&&fZ(n,e.idTokenHint),e.state&&eU(n,e.state),e.logoutHint&&bZ(n,e.logoutHint),e.extraQueryParameters&&$r(n,e.extraQueryParameters),this.config.authOptions.instanceAware&&tU(n),Fn(n,this.config.authOptions.encodeExtraQueryParams,e.extraQueryParameters)}};var KZ=300,dl=class extends wi{constructor(e,n){super(e,n)}async acquireToken(e){this.performanceClient?.addQueueMeasurement(re.RefreshTokenClientAcquireToken,e.correlationId);let n=ft(),i=await Ve(this.executeTokenRequest.bind(this),re.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),r=i.headers?.[Yt.X_MS_REQUEST_ID],o=new tr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(i.body),Ve(o.handleServerTokenResponse.bind(o),re.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,n,e,void 0,void 0,!0,e.forceCache,r)}async acquireTokenByRefreshToken(e){if(!e)throw yt(jl);if(this.performanceClient?.addQueueMeasurement(re.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw j(ua);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await Ve(this.acquireTokenWithCachedRefreshToken.bind(this),re.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(i){let r=i instanceof xo&&i.errorCode===ya,o=i instanceof Uo&&i.errorCode===g1.INVALID_GRANT_ERROR&&i.subError===g1.CLIENT_MISMATCH_ERROR;if(r||o)return Ve(this.acquireTokenWithCachedRefreshToken.bind(this),re.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw i}return Ve(this.acquireTokenWithCachedRefreshToken.bind(this),re.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,n){this.performanceClient?.addQueueMeasurement(re.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);let i=PZ(this.cacheManager.getRefreshToken.bind(this.cacheManager),re.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0,this.performanceClient);if(!i)throw P1(ya);if(i.expiresOn&&_a(i.expiresOn,e.refreshTokenExpirationOffsetSeconds||KZ))throw this.performanceClient?.addFields({rtExpiresOnMs:Number(i.expiresOn)},e.correlationId),P1(ew);let r={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||et.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Yr.HOME_ACCOUNT_ID}};try{return await Ve(this.acquireToken.bind(this),re.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(r)}catch(o){if(o instanceof xo&&(this.performanceClient?.addFields({rtExpiresOnMs:Number(i.expiresOn)},e.correlationId),o.subError===Ea)){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");let s=this.cacheManager.generateCredentialKey(i);this.cacheManager.removeRefreshToken(s,e.correlationId)}throw o}}async executeTokenRequest(e,n){this.performanceClient?.addQueueMeasurement(re.RefreshTokenClientExecuteTokenRequest,e.correlationId);let i=this.createTokenQueryParameters(e),r=Je.appendQueryString(n.tokenEndpoint,i),o=await Ve(this.createTokenRequestBody.bind(this),re.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),a=JS(this.config.authOptions.clientId,e);return Ve(this.executePostToTokenEndpoint.bind(this),re.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(r,o,s,a,e.correlationId,re.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(re.RefreshTokenClientCreateTokenRequestBody,e.correlationId);let n=new Map;if(Zi(n,e.embeddedClientId||e.tokenBodyParameters?.[nd]||this.config.authOptions.clientId),e.redirectUri&&QS(n,e.redirectUri),Qi(n,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),wa(n,Sa.REFRESH_TOKEN_GRANT),Ia(n),Ho(n,this.config.libraryInfo),Bo(n,this.config.telemetry.application),ba(n),this.serverTelemetryManager&&!K1(this.config)&&va(n,this.serverTelemetryManager),TZ(n,e.refreshToken),this.config.clientCredentials.clientSecret&&rd(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let i=this.config.clientCredentials.clientAssertion;id(n,await jo(i.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),od(n,i.assertionType)}if(e.authenticationScheme===et.POP){let i=new Kl(this.cryptoUtils,this.performanceClient),r;e.popKid?r=this.cryptoUtils.encodeKid(e.popKid):r=(await Ve(i.generateCnf.bind(i),re.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,nU(n,r)}else if(e.authenticationScheme===et.SSH)if(e.sshJwk)rU(n,e.sshJwk);else throw yt(ga);if((!bn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ji(n,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Yr.HOME_ACCOUNT_ID:try{let i=na(e.ccsCredential.credential);ll(n,i)}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case Yr.UPN:Wl(n,e.ccsCredential.credential);break}return e.embeddedClientId&&Gm(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&$r(n,e.tokenBodyParameters),XS(n,e.correlationId,this.performanceClient),Fn(n)}};var RS=class extends wi{constructor(e,n){super(e,n)}async acquireCachedToken(e){this.performanceClient?.addQueueMeasurement(re.SilentFlowClientAcquireCachedToken,e.correlationId);let n=wt.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!bn.isEmptyObj(e.claims))throw this.setCacheOutcome(wt.FORCE_REFRESH_OR_CLAIMS,e.correlationId),j(Vr);if(!e.account)throw j(ua);let i=e.account.tenantId||BZ(e.authority),r=this.cacheManager.getTokenKeys(),o=this.cacheManager.getAccessToken(e.account,e,r,i);if(o){if(DZ(o.cachedAt)||_a(o.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(wt.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),j(Vr);o.refreshOn&&_a(o.refreshOn,0)&&(n=wt.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(wt.NO_CACHED_ACCESS_TOKEN,e.correlationId),j(Vr);let s=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:o,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,r,i,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Ve(this.generateResultFromCacheRecord.bind(this),re.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(a,e),n]}setCacheOutcome(e,n){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},n),e!==wt.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,n){this.performanceClient?.addQueueMeasurement(re.SilentFlowClientGenerateResultFromCacheRecord,n.correlationId);let i;if(e.idToken&&(i=td(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){let r=i?.auth_time;if(!r)throw j(sa);V1(r,n.maxAge)}return tr.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,i)}};function XZ(t,e,n,i){let r=e.correlationId,o=new Map;Zi(o,e.embeddedClientId||e.extraQueryParameters?.[nd]||t.clientId);let s=[...e.scopes||[],...e.extraScopesToConsent||[]];if(Qi(o,s,!0,t.authority.options.OIDCOptions?.defaultScopes),QS(o,e.redirectUri),qo(o,r),dZ(o,e.responseMode),Ia(o),e.prompt&&mZ(o,e.prompt),e.domainHint&&pZ(o,e.domainHint),e.prompt!==Jp.SELECT_ACCOUNT)if(e.sid&&e.prompt===Jp.NONE)n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),S1(o,e.sid);else if(e.account){let a=ZZ(e.account),c=JZ(e.account);if(c&&e.domainHint&&(n.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),c=null),c){n.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),Xp(o,c);try{let u=na(e.account.homeAccountId);ll(o,u)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&e.prompt===Jp.NONE){n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),S1(o,a);try{let u=na(e.account.homeAccountId);ll(o,u)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)n.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),Xp(o,e.loginHint),Wl(o,e.loginHint);else if(e.account.username){n.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),Xp(o,e.account.username);try{let u=na(e.account.homeAccountId);ll(o,u)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(n.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),Xp(o,e.loginHint),Wl(o,e.loginHint));else n.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&gZ(o,e.nonce),e.state&&eU(o,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&Ji(o,e.claims,t.clientCapabilities),e.embeddedClientId&&Gm(o,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(IS))&&tU(o),o}function QZ(t,e,n,i){let r=Fn(e,n,i);return Je.appendQueryString(t.authorizationEndpoint,r)}function ZZ(t){return t.idTokenClaims?.sid||null}function JZ(t){return t.loginHint||t.idTokenClaims?.login_hint||null}var D1=",",uU="|";function eJ(t){let{skus:e,libraryName:n,libraryVersion:i,extensionName:r,extensionVersion:o}=t,s=new Map([[0,[n,i]],[2,[r,o]]]),a=[];if(e?.length){if(a=e.split(D1),a.length<4)return e}else a=Array.from({length:4},()=>uU);return s.forEach((c,u)=>{c.length===2&&c[0]?.length&&c[1]?.length&&tJ({skuArr:a,index:u,skuName:c[0],skuVersion:c[1]})}),a.join(D1)}function tJ(t){let{skuArr:e,index:n,skuName:i,skuVersion:r}=t;n>=e.length||(e[n]=[i,r].join(uU))}var Mm=class t{constructor(e,n){this.cacheOutcome=wt.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||D.EMPTY_STRING,this.wrapperVer=e.wrapperVer||D.EMPTY_STRING,this.telemetryCacheKey=jt.CACHE_KEY+ml.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${jt.VALUE_SEPARATOR}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],i=this.getNativeBrokerErrorCode();i?.length&&n.push(`broker_error=${i}`);let r=n.join(jt.VALUE_SEPARATOR),o=this.getRegionDiscoveryFields(),s=[e,o].join(jt.VALUE_SEPARATOR);return[jt.SCHEMA_VERSION,s,r].join(jt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),n=t.maxErrorsToSend(e),i=e.failedRequests.slice(0,2*n).join(jt.VALUE_SEPARATOR),r=e.errors.slice(0,n).join(jt.VALUE_SEPARATOR),o=e.errors.length,s=n<o?jt.OVERFLOW_TRUE:jt.OVERFLOW_FALSE,a=[o,s].join(jt.VALUE_SEPARATOR);return[jt.SCHEMA_VERSION,e.cacheHits,i,r,a].join(jt.CATEGORY_SEPARATOR)}cacheFailedRequest(e){let n=this.getLastRequests();n.errors.length>=jt.MAX_CACHED_ERRORS&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof We?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(jt.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){let e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){let e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){let e=this.getLastRequests(),n=t.maxErrorsToSend(e),i=e.errors.length;if(n===i)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{let r={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}}static maxErrorsToSend(e){let n,i=0,r=0,o=e.errors.length;for(n=0;n<o;n++){let s=e.failedRequests[2*n]||D.EMPTY_STRING,a=e.failedRequests[2*n+1]||D.EMPTY_STRING,c=e.errors[n]||D.EMPTY_STRING;if(r+=s.toString().length+a.toString().length+c.length+3,r<jt.MAX_LAST_HEADER_BYTES)i+=1;else break}return i}getRegionDiscoveryFields(){let e=[];return e.push(this.regionUsed||D.EMPTY_STRING),e.push(this.regionSource||D.EMPTY_STRING),e.push(this.regionOutcome||D.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){let n=this.getLastRequests();n.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){let e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId)}static makeExtraSkuString(e){return eJ(e)}},Ta=class{static deserializeJSONBlob(e){return e?JSON.parse(e):{}}static deserializeAccounts(e){let n={};return e&&Object.keys(e).map(function(i){let r=e[i],o={homeAccountId:r.home_account_id,environment:r.environment,realm:r.realm,localAccountId:r.local_account_id,username:r.username,authorityType:r.authority_type,name:r.name,clientInfo:r.client_info,lastModificationTime:r.last_modification_time,lastModificationApp:r.last_modification_app,tenantProfiles:r.tenantProfiles?.map(a=>JSON.parse(a)),lastUpdatedAt:Date.now().toString()},s=new xn;Gl.toObject(s,o),n[i]=s}),n}static deserializeIdTokens(e){let n={};return e&&Object.keys(e).map(function(i){let r=e[i],o={homeAccountId:r.home_account_id,environment:r.environment,credentialType:r.credential_type,clientId:r.client_id,secret:r.secret,realm:r.realm,lastUpdatedAt:Date.now().toString()};n[i]=o}),n}static deserializeAccessTokens(e){let n={};return e&&Object.keys(e).map(function(i){let r=e[i],o={homeAccountId:r.home_account_id,environment:r.environment,credentialType:r.credential_type,clientId:r.client_id,secret:r.secret,realm:r.realm,target:r.target,cachedAt:r.cached_at,expiresOn:r.expires_on,extendedExpiresOn:r.extended_expires_on,refreshOn:r.refresh_on,keyId:r.key_id,tokenType:r.token_type,requestedClaims:r.requestedClaims,requestedClaimsHash:r.requestedClaimsHash,userAssertionHash:r.userAssertionHash,lastUpdatedAt:Date.now().toString()};n[i]=o}),n}static deserializeRefreshTokens(e){let n={};return e&&Object.keys(e).map(function(i){let r=e[i],o={homeAccountId:r.home_account_id,environment:r.environment,credentialType:r.credential_type,clientId:r.client_id,secret:r.secret,familyId:r.family_id,target:r.target,realm:r.realm,lastUpdatedAt:Date.now().toString()};n[i]=o}),n}static deserializeAppMetadata(e){let n={};return e&&Object.keys(e).map(function(i){let r=e[i];n[i]={clientId:r.client_id,environment:r.environment,familyId:r.family_id}}),n}static deserializeAllCache(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}}},nJ=Object.freeze({__proto__:null,Deserializer:Ta,Serializer:pl}),rJ="system_assigned_managed_identity",iJ="managed_identity",M1=`https://login.microsoftonline.com/${iJ}/`,eo={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},qn={API_VERSION:"api-version",RESOURCE:"resource",SHA256_TOKEN_TO_REFRESH:"token_sha256_to_refresh",XMS_CC:"xms_cc"},me={AZURE_POD_IDENTITY_AUTHORITY_HOST:"AZURE_POD_IDENTITY_AUTHORITY_HOST",DEFAULT_IDENTITY_CLIENT_ID:"DEFAULT_IDENTITY_CLIENT_ID",IDENTITY_ENDPOINT:"IDENTITY_ENDPOINT",IDENTITY_HEADER:"IDENTITY_HEADER",IDENTITY_SERVER_THUMBPRINT:"IDENTITY_SERVER_THUMBPRINT",IMDS_ENDPOINT:"IMDS_ENDPOINT",MSI_ENDPOINT:"MSI_ENDPOINT",MSI_SECRET:"MSI_SECRET"},Ce={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},pn={SYSTEM_ASSIGNED:"system-assigned",USER_ASSIGNED_CLIENT_ID:"user-assigned-client-id",USER_ASSIGNED_RESOURCE_ID:"user-assigned-resource-id",USER_ASSIGNED_OBJECT_ID:"user-assigned-object-id"},Zt={GET:"get",POST:"post"},yS={SUCCESS_RANGE_START:It.SUCCESS_RANGE_START,SUCCESS_RANGE_END:It.SUCCESS_RANGE_END,SERVER_ERROR:It.SERVER_ERROR},oJ="REGION_NAME",sJ="MSAL_FORCE_REGION",aJ=32,cJ={SHA256:"sha256"},ES={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},lU={KEY_SEPARATOR:"-"},to={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",AUTHORIZATION_PENDING:"authorization_pending",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},ta={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByCode:871,acquireTokenByRefreshToken:872},Sr={RSA_256:"RS256",PSS_256:"PS256",X5T_256:"x5t#S256",X5T:"x5t",X5C:"x5c",AUDIENCE:"aud",EXPIRATION_TIME:"exp",ISSUER:"iss",SUBJECT:"sub",NOT_BEFORE:"nbf",JWT_ID:"jti"},TS={INTERVAL_MS:100,TIMEOUT_MS:5e3},uJ=4096,hl=class{static getNetworkResponse(e,n,i){return{headers:e,body:n,status:i}}static urlToHttpOptions(e){let n={protocol:e.protocol,hostname:e.hostname&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:`${e.pathname||""}${e.search||""}`,href:e.href};return e.port!==""&&(n.port=Number(e.port)),(e.username||e.password)&&(n.auth=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`),n}},nw="@azure/msal-node",Fo="3.8.4",Xl=class{constructor(e,n,i){this.networkRequestViaProxy=(r,o,s,a)=>{let c=new URL(o),u=new URL(this.proxyUrl),l=s?.headers||{},d={host:u.hostname,port:u.port,method:"CONNECT",path:c.hostname,headers:l};this.customAgentOptions&&Object.keys(this.customAgentOptions).length&&(d.agent=new Zp.Agent(this.customAgentOptions));let f="";if(r===Zt.POST){let _=s?.body||"";f=`Content-Type: application/x-www-form-urlencoded\r
|
|
29
|
+
Content-Length: ${_.length}\r
|
|
30
|
+
\r
|
|
31
|
+
${_}`}else a&&(d.timeout=a);let m=`${r.toUpperCase()} ${c.href} HTTP/1.1\r
|
|
32
|
+
Host: ${c.host}\r
|
|
33
|
+
Connection: close\r
|
|
34
|
+
`+f+`\r
|
|
35
|
+
`;return new Promise((_,E)=>{let I=Zp.request(d);a&&I.on("timeout",()=>{this.logUrlWithPiiAwareness(`Request timeout after ${a}ms for URL`,o),I.destroy(),E(new Error(`Request time out after ${a}ms`))}),I.end(),I.on("connect",(y,A)=>{let S=y?.statusCode||yS.SERVER_ERROR;(S<yS.SUCCESS_RANGE_START||S>yS.SUCCESS_RANGE_END)&&(I.destroy(),A.destroy(),E(new Error(`Error connecting to proxy. Http status code: ${y.statusCode}. Http status message: ${y?.statusMessage||"Unknown"}`))),A.write(m);let w=[];A.on("data",N=>{w.push(N)}),A.on("end",()=>{let W=Buffer.concat([...w]).toString().split(`\r
|
|
36
|
+
`),R=parseInt(W[0].split(" ")[1]),L=W[0].split(" ").slice(2).join(" "),b=W[W.length-1],X=W.slice(1,W.length-2),K=new Map;X.forEach(BW=>{let FR=BW.split(new RegExp(/:\s(.*)/s)),jW=FR[0],TT=FR[1];try{let jh=JSON.parse(TT);jh&&typeof jh=="object"&&(TT=jh)}catch{}K.set(jW,TT)});let Sn=Object.fromEntries(K),xR=hl.getNetworkResponse(Sn,this.parseBody(R,L,Sn,b),R);this.shouldDestroyRequest(R,xR)&&I.destroy(),_(xR)}),A.on("error",N=>{I.destroy(),A.destroy(),E(new Error(N.toString()))})}),I.on("error",y=>{this.logger.error(`HttpClient - Proxy request error: ${y.toString()}`,""),this.logUrlWithPiiAwareness("Destination URL",o),this.logUrlWithPiiAwareness("Proxy URL",this.proxyUrl),this.logger.error(`HttpClient - Method: ${r}`,""),this.logger.errorPii(`HttpClient - Headers: ${JSON.stringify(l)}`,""),I.destroy(),E(new Error(y.toString()))})})},this.networkRequestViaHttps=(r,o,s,a)=>{let c=r===Zt.POST,u=s?.body||"",l=new URL(o),d=s?.headers||{},f={method:r,headers:d,...hl.urlToHttpOptions(l)};return this.customAgentOptions&&Object.keys(this.customAgentOptions).length&&(f.agent=new p1.Agent(this.customAgentOptions)),c?f.headers={...f.headers,"Content-Length":u.length}:a&&(f.timeout=a),new Promise((m,_)=>{let E;f.protocol==="http:"?E=Zp.request(f):E=p1.request(f),c&&E.write(u),a&&E.on("timeout",()=>{this.logUrlWithPiiAwareness(`HTTPS request timeout after ${a}ms for URL`,o),E.destroy(),_(new Error(`Request time out after ${a}ms`))}),E.end(),E.on("response",I=>{let y=I.headers,A=I.statusCode,S=I.statusMessage,w=[];I.on("data",N=>{w.push(N)}),I.on("end",()=>{let N=Buffer.concat([...w]).toString(),W=y,R=hl.getNetworkResponse(W,this.parseBody(A,S,W,N),A);this.shouldDestroyRequest(A,R)&&E.destroy(),m(R)})}),E.on("error",I=>{this.logger.error(`HttpClient - HTTPS request error: ${I.toString()}`,""),this.logUrlWithPiiAwareness("URL",o),this.logger.error(`HttpClient - Method: ${r}`,""),this.logger.errorPii(`HttpClient - Headers: ${JSON.stringify(d)}`,""),E.destroy(),_(new Error(I.toString()))})})},this.parseBody=(r,o,s,a)=>{let c;try{c=JSON.parse(a)}catch{let l,d;r>=It.CLIENT_ERROR_RANGE_START&&r<=It.CLIENT_ERROR_RANGE_END?(l="client_error",d="A client"):r>=It.SERVER_ERROR_RANGE_START&&r<=It.SERVER_ERROR_RANGE_END?(l="server_error",d="A server"):(l="unknown_error",d="An unknown"),c={error:l,error_description:`${d} error occured.
|
|
37
|
+
Http status code: ${r}
|
|
38
|
+
Http status message: ${o||"Unknown"}
|
|
39
|
+
Headers: ${JSON.stringify(s)}`}}return c},this.logUrlWithPiiAwareness=(r,o)=>{if(this.isPiiEnabled)this.logger.errorPii(`HttpClient - ${r}: ${o}`,"");else{let s;try{let a=new URL(o);s=`${a.protocol}//${a.host}${a.pathname}`}catch{s=o.split("?")[0]||"unknown"}this.logger.error(`HttpClient - ${r}: ${s} [Enable PII logging to see additional details]`,"")}},this.shouldDestroyRequest=(r,o)=>(r<It.SUCCESS_RANGE_START||r>It.SUCCESS_RANGE_END)&&!(o.body&&typeof o.body=="object"&&"error"in o.body&&o.body.error===to.AUTHORIZATION_PENDING),this.proxyUrl=e||"",this.customAgentOptions=n||{},this.logger=new Ki(i||{},nw,Fo),this.isPiiEnabled=this.logger.isPiiLoggingEnabled()}async sendGetRequestAsync(e,n,i){return this.proxyUrl?this.networkRequestViaProxy(Zt.GET,e,n,i):this.networkRequestViaHttps(Zt.GET,e,n,i)}async sendPostRequestAsync(e,n){return this.proxyUrl?this.networkRequestViaProxy(Zt.POST,e,n):this.networkRequestViaHttps(Zt.POST,e,n)}},dU="invalid_file_extension",hU="invalid_file_path",fl="invalid_managed_identity_id_type",fU="invalid_secret",lJ="missing_client_id",dJ="network_unavailable",pU="platform_not_supported",mU="unable_to_create_azure_arc",gU="unable_to_create_cloud_shell",_U="unable_to_create_source",NS="unable_to_read_secret_file",hJ="user_assigned_not_available_at_runtime",yU="www_authenticate_header_missing",EU="www_authenticate_header_unsupported_format",al={[me.AZURE_POD_IDENTITY_AUTHORITY_HOST]:"azure_pod_identity_authority_host_url_malformed",[me.IDENTITY_ENDPOINT]:"identity_endpoint_url_malformed",[me.IMDS_ENDPOINT]:"imds_endpoint_url_malformed",[me.MSI_ENDPOINT]:"msi_endpoint_url_malformed"},fJ={[dU]:"The file path in the WWW-Authenticate header does not contain a .key file.",[hU]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[fl]:"More than one ManagedIdentityIdType was provided.",[fU]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[pU]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[lJ]:"A ManagedIdentityId id was not provided.",[al.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${me.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[al.IDENTITY_ENDPOINT]:`The Managed Identity's '${me.IDENTITY_ENDPOINT}' environment variable is malformed.`,[al.IMDS_ENDPOINT]:`The Managed Identity's '${me.IMDS_ENDPOINT}' environment variable is malformed.`,[al.MSI_ENDPOINT]:`The Managed Identity's '${me.MSI_ENDPOINT}' environment variable is malformed.`,[dJ]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[mU]:"Azure Arc Managed Identities can only be system assigned.",[gU]:"Cloud Shell Managed Identities can only be system assigned.",[_U]:"Unable to create a Managed Identity source based on environment variables.",[NS]:"Unable to read the secret file.",[hJ]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[yU]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[EU]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},PS=class t extends We{constructor(e){super(e,fJ[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Qt(t){return new PS(t)}var DS=class{get id(){return this._id}set id(e){this._id=e}get idType(){return this._idType}set idType(e){this._idType=e}constructor(e){let n=e?.userAssignedClientId,i=e?.userAssignedResourceId,r=e?.userAssignedObjectId;if(n){if(i||r)throw Qt(fl);this.id=n,this.idType=pn.USER_ASSIGNED_CLIENT_ID}else if(i){if(n||r)throw Qt(fl);this.id=i,this.idType=pn.USER_ASSIGNED_RESOURCE_ID}else if(r){if(n||i)throw Qt(fl);this.id=r,this.idType=pn.USER_ASSIGNED_OBJECT_ID}else this.id=rJ,this.idType=pn.SYSTEM_ASSIGNED}},St={invalidLoopbackAddressType:{code:"invalid_loopback_server_address_type",desc:"Loopback server address is not type string. This is unexpected."},unableToLoadRedirectUri:{code:"unable_to_load_redirectUrl",desc:"Loopback server callback was invoked without a url. This is unexpected."},noAuthCodeInResponse:{code:"no_auth_code_in_response",desc:"No auth code found in the server response. Please check your network trace to determine what happened."},noLoopbackServerExists:{code:"no_loopback_server_exists",desc:"No loopback server exists yet."},loopbackServerAlreadyExists:{code:"loopback_server_already_exists",desc:"Loopback server already exists. Cannot create another."},loopbackServerTimeout:{code:"loopback_server_timeout",desc:"Timed out waiting for auth code listener to be registered."},stateNotFoundError:{code:"state_not_found",desc:"State not found. Please verify that the request originated from msal."},thumbprintMissing:{code:"thumbprint_missing_from_client_certificate",desc:"Client certificate does not contain a SHA-1 or SHA-256 thumbprint."},redirectUriNotSupported:{code:"redirect_uri_not_supported",desc:"RedirectUri is not supported in this scenario. Please remove redirectUri from the request."}},er=class t extends We{constructor(e,n){super(e,n),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(St.invalidLoopbackAddressType.code,`${St.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(St.unableToLoadRedirectUri.code,`${St.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(St.noAuthCodeInResponse.code,`${St.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(St.noLoopbackServerExists.code,`${St.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(St.loopbackServerAlreadyExists.code,`${St.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(St.loopbackServerTimeout.code,`${St.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(St.stateNotFoundError.code,St.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(St.thumbprintMissing.code,St.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(St.redirectUriNotSupported.code,St.redirectUriNotSupported.desc)}},pJ={clientId:D.EMPTY_STRING,authority:D.DEFAULT_AUTHORITY,clientSecret:D.EMPTY_STRING,clientAssertion:D.EMPTY_STRING,clientCertificate:{thumbprint:D.EMPTY_STRING,thumbprintSha256:D.EMPTY_STRING,privateKey:D.EMPTY_STRING,x5c:D.EMPTY_STRING},knownAuthorities:[],cloudDiscoveryMetadata:D.EMPTY_STRING,authorityMetadata:D.EMPTY_STRING,clientCapabilities:[],protocolMode:Xi.AAD,azureCloudOptions:{azureCloudInstance:zm.None,tenant:D.EMPTY_STRING},skipAuthorityMetadataCache:!1,encodeExtraQueryParams:!1},mJ={claimsBasedCachingEnabled:!1},rw={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:ie.LogLevel.Info},gJ={loggerOptions:rw,networkClient:new Xl,proxyUrl:D.EMPTY_STRING,customAgentOptions:{},disableInternalRetries:!1},_J={application:{appName:D.EMPTY_STRING,appVersion:D.EMPTY_STRING}};function yJ({auth:t,broker:e,cache:n,system:i,telemetry:r}){let o={...gJ,networkClient:new Xl(i?.proxyUrl,i?.customAgentOptions),loggerOptions:i?.loggerOptions||rw,disableInternalRetries:i?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw er.createStateNotFoundError();return{auth:{...pJ,...t},broker:{...e},cache:{...mJ,...n},system:{...o,...i},telemetry:{..._J,...r}}}function EJ({clientCapabilities:t,managedIdentityIdParams:e,system:n}){let i=new DS(e),r=n?.loggerOptions||rw,o;return n?.networkClient?o=n.networkClient:o=new Xl(n?.proxyUrl,n?.customAgentOptions),{clientCapabilities:t||[],managedIdentityId:i,system:{loggerOptions:r,networkClient:o},disableInternalRetries:n?.disableInternalRetries||!1}}var km=class{generateGuid(){return eQ.v4()}isGuid(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}},Ci=class t{static base64Encode(e,n){return Buffer.from(e,n).toString(Si.BASE64)}static base64EncodeUrl(e,n){return t.base64Encode(e,n).replace(/=/g,D.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,Si.BASE64).toString("utf8")}static base64DecodeUrl(e){let n=e.replace(/-/g,"+").replace(/_/g,"/");for(;n.length%4;)n+="=";return t.base64Decode(n)}},Ql=class{sha256(e){return x1.createHash(cJ.SHA256).update(e).digest()}},MS=class{constructor(){this.hashUtils=new Ql}async generatePkceCodes(){let e=this.generateCodeVerifier(),n=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:n}}generateCodeVerifier(){let e=[],n=256-256%ES.CV_CHARSET.length;for(;e.length<=aJ;){let r=x1.randomBytes(1)[0];if(r>=n)continue;let o=r%ES.CV_CHARSET.length;e.push(ES.CV_CHARSET[o])}let i=e.join(D.EMPTY_STRING);return Ci.base64EncodeUrl(i)}generateCodeChallengeFromVerifier(e){return Ci.base64EncodeUrl(this.hashUtils.sha256(e).toString(Si.BASE64),Si.BASE64)}},Aa=class{constructor(){this.pkceGenerator=new MS,this.guidGenerator=new km,this.hashUtils=new Ql}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return Ci.base64Encode(e)}base64Decode(e){return Ci.base64Decode(e)}generatePkceCodes(){return this.pkceGenerator.generatePkceCodes()}getPublicKeyThumbprint(){throw new Error("Method not implemented.")}removeTokenBindingKey(){throw new Error("Method not implemented.")}clearKeystore(){throw new Error("Method not implemented.")}signJwt(){throw new Error("Method not implemented.")}async hashString(e){return Ci.base64EncodeUrl(this.hashUtils.sha256(e).toString(Si.BASE64),Si.BASE64)}};function TJ(t){let e=t.credentialType===ht.REFRESH_TOKEN&&t.familyId||t.clientId,n=t.tokenType&&t.tokenType.toLowerCase()!==et.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",t.requestedClaimsHash||"",n].join(lU.KEY_SEPARATOR).toLowerCase()}function AJ(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(lU.KEY_SEPARATOR).toLowerCase()}var Zl=class extends Gl{constructor(e,n,i,r){super(n,i,e,new fn.StubPerformanceClient,r),this.cache={},this.changeEmitters=[],this.logger=e}registerChangeEmitter(e){this.changeEmitters.push(e)}emitChange(){this.changeEmitters.forEach(e=>e.call(null))}cacheToInMemoryCache(e){let n={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(let i in e){let r=e[i];if(typeof r=="object")if(r instanceof xn)n.accounts[i]=r;else if(I1(r))n.idTokens[i]=r;else if(w1(r))n.accessTokens[i]=r;else if(v1(r))n.refreshTokens[i]=r;else if(b1(i,r))n.appMetadata[i]=r;else continue}return n}inMemoryCacheToCache(e){let n=this.getCache();return n={...n,...e.accounts,...e.idTokens,...e.accessTokens,...e.refreshTokens,...e.appMetadata},n}getInMemoryCache(){return this.logger.trace("Getting in-memory cache"),this.cacheToInMemoryCache(this.getCache())}setInMemoryCache(e){this.logger.trace("Setting in-memory cache");let n=this.inMemoryCacheToCache(e);this.setCache(n),this.emitChange()}getCache(){return this.logger.trace("Getting cache key-value store"),this.cache}setCache(e){this.logger.trace("Setting cache key value store"),this.cache=e,this.emitChange()}getItem(e){return this.logger.tracePii(`Item key: ${e}`),this.getCache()[e]}setItem(e,n){this.logger.tracePii(`Item key: ${e}`);let i=this.getCache();i[e]=n,this.setCache(i)}generateCredentialKey(e){return TJ(e)}generateAccountKey(e){return AJ(e)}getAccountKeys(){let e=this.getInMemoryCache();return Object.keys(e.accounts)}getTokenKeys(){let e=this.getInMemoryCache();return{idToken:Object.keys(e.idTokens),accessToken:Object.keys(e.accessTokens),refreshToken:Object.keys(e.refreshTokens)}}getAccount(e){return this.getItem(e)?Object.assign(new xn,this.getItem(e)):null}async setAccount(e){let n=this.generateAccountKey(xn.getAccountInfo(e));this.setItem(n,e)}getIdTokenCredential(e){let n=this.getItem(e);return I1(n)?n:null}async setIdTokenCredential(e){let n=this.generateCredentialKey(e);this.setItem(n,e)}getAccessTokenCredential(e){let n=this.getItem(e);return w1(n)?n:null}async setAccessTokenCredential(e){let n=this.generateCredentialKey(e);this.setItem(n,e)}getRefreshTokenCredential(e){let n=this.getItem(e);return v1(n)?n:null}async setRefreshTokenCredential(e){let n=this.generateCredentialKey(e);this.setItem(n,e)}getAppMetadata(e){let n=this.getItem(e);return b1(e,n)?n:null}setAppMetadata(e){let n=qZ(e);this.setItem(n,e)}getServerTelemetry(e){let n=this.getItem(e);return n&&xZ(e,n)?n:null}setServerTelemetry(e,n){this.setItem(e,n)}getAuthorityMetadata(e){let n=this.getItem(e);return n&&HZ(e,n)?n:null}getAuthorityMetadataKeys(){return this.getKeys().filter(e=>this.isAuthorityMetadata(e))}setAuthorityMetadata(e,n){this.setItem(e,n)}getThrottlingCache(e){let n=this.getItem(e);return n&&FZ(e,n)?n:null}setThrottlingCache(e,n){this.setItem(e,n)}removeItem(e){this.logger.tracePii(`Item key: ${e}`);let n=!1,i=this.getCache();return i[e]&&(delete i[e],n=!0),n&&(this.setCache(i),this.emitChange()),n}removeOutdatedAccount(e){this.removeItem(e)}containsKey(e){return this.getKeys().includes(e)}getKeys(){this.logger.trace("Retrieving all cache keys");let e=this.getCache();return[...Object.keys(e)]}clear(){this.logger.trace("Clearing cache entries created by MSAL"),this.getKeys().forEach(n=>{this.removeItem(n)}),this.emitChange()}static generateInMemoryCache(e){return Ta.deserializeAllCache(Ta.deserializeJSONBlob(e))}static generateJsonCache(e){return pl.serializeAllCache(e)}updateCredentialCacheKey(e,n){let i=this.generateCredentialKey(n);if(e!==i){let r=this.getItem(e);if(r)return this.removeItem(e),this.setItem(i,r),this.logger.verbose(`Updated an outdated ${n.credentialType} cache key`),i;this.logger.error(`Attempted to update an outdated ${n.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}},sl={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},Lm=class{constructor(e,n,i){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),i&&(this.persistence=i),this.logger=n}hasChanged(){return this.cacheHasChanged}serialize(){this.logger.trace("Serializing in-memory cache");let e=pl.serializeAllCache(this.storage.getInMemoryCache());return this.cacheSnapshot?(this.logger.trace("Reading cache snapshot from disk"),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)):this.logger.trace("No cache snapshot to merge"),this.cacheHasChanged=!1,JSON.stringify(e)}deserialize(e){if(this.logger.trace("Deserializing JSON to in-memory cache"),this.cacheSnapshot=e,this.cacheSnapshot){this.logger.trace("Reading cache snapshot from disk");let n=Ta.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(n)}else this.logger.trace("No cache snapshot to deserialize")}getKVStore(){return this.storage.getCache()}getCacheSnapshot(){let e=Zl.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new Aa().createNewGuid()){this.logger.trace("getAllAccounts called");let n;try{return this.persistence&&(n=new Wi(this,!1),await this.persistence.beforeCacheAccess(n)),this.storage.getAllAccounts({},e)}finally{this.persistence&&n&&await this.persistence.afterCacheAccess(n)}}async getAccountByHomeId(e){let n=await this.getAllAccounts();return e&&n&&n.length&&n.filter(i=>i.homeAccountId===e)[0]||null}async getAccountByLocalId(e){let n=await this.getAllAccounts();return e&&n&&n.length&&n.filter(i=>i.localAccountId===e)[0]||null}async removeAccount(e,n){this.logger.trace("removeAccount called");let i;try{this.persistence&&(i=new Wi(this,!0),await this.persistence.beforeCacheAccess(i)),this.storage.removeAccount(e,n||new km().generateGuid())}finally{this.persistence&&i&&await this.persistence.afterCacheAccess(i)}}async overwriteCache(){if(!this.persistence){this.logger.info("No persistence layer specified, cache cannot be overwritten");return}this.logger.info("Overwriting in-memory cache with persistent cache"),this.storage.clear();let e=new Wi(this,!1);await this.persistence.beforeCacheAccess(e);let n=this.getCacheSnapshot();this.storage.setCache(n),await this.persistence.afterCacheAccess(e)}handleChangeEvent(){this.cacheHasChanged=!0}mergeState(e,n){this.logger.trace("Merging in-memory cache with cache snapshot");let i=this.mergeRemovals(e,n);return this.mergeUpdates(i,n)}mergeUpdates(e,n){return Object.keys(n).forEach(i=>{let r=n[i];if(!e.hasOwnProperty(i))r!==null&&(e[i]=r);else{let o=r!==null,s=typeof r=="object",a=!Array.isArray(r),c=typeof e[i]<"u"&&e[i]!==null;o&&s&&a&&c?this.mergeUpdates(e[i],r):e[i]=r}}),e}mergeRemovals(e,n){this.logger.trace("Remove updated entries in cache");let i=e.Account?this.mergeRemovalsDict(e.Account,n.Account):e.Account,r=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,n.AccessToken):e.AccessToken,o=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,n.RefreshToken):e.RefreshToken,s=e.IdToken?this.mergeRemovalsDict(e.IdToken,n.IdToken):e.IdToken,a=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,n.AppMetadata):e.AppMetadata;return{...e,Account:i,AccessToken:r,RefreshToken:o,IdToken:s,AppMetadata:a}}mergeRemovalsDict(e,n){let i={...e};return Object.keys(e).forEach(r=>{(!n||!n.hasOwnProperty(r))&&delete i[r]}),i}overlayDefaults(e){return this.logger.trace("Overlaying input cache with the default cache"),{Account:{...sl.Account,...e.Account},IdToken:{...sl.IdToken,...e.IdToken},AccessToken:{...sl.AccessToken,...e.AccessToken},RefreshToken:{...sl.RefreshToken,...e.RefreshToken},AppMetadata:{...sl.AppMetadata,...e.AppMetadata}}}},Ca=class t{static fromAssertion(e){let n=new t;return n.jwt=e,n}static fromCertificate(e,n,i){let r=new t;return r.privateKey=n,r.thumbprint=e,r.useSha256=!1,i&&(r.publicCertificate=this.parseCertificate(i)),r}static fromCertificateWithSha256Thumbprint(e,n,i){let r=new t;return r.privateKey=n,r.thumbprint=e,r.useSha256=!0,i&&(r.publicCertificate=this.parseCertificate(i)),r}getJwt(e,n,i){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&n===this.issuer&&i===this.jwtAudience?this.jwt:this.createJwt(e,n,i);if(this.jwt)return this.jwt;throw j(Dl)}createJwt(e,n,i){this.issuer=n,this.jwtAudience=i;let r=ft();this.expirationTime=r+600;let s={alg:this.useSha256?Sr.PSS_256:Sr.RSA_256},a=this.useSha256?Sr.X5T_256:Sr.X5T;Object.assign(s,{[a]:Ci.base64EncodeUrl(this.thumbprint,Si.HEX)}),this.publicCertificate&&Object.assign(s,{[Sr.X5C]:this.publicCertificate});let c={[Sr.AUDIENCE]:this.jwtAudience,[Sr.EXPIRATION_TIME]:this.expirationTime,[Sr.ISSUER]:this.issuer,[Sr.SUBJECT]:this.issuer,[Sr.NOT_BEFORE]:r,[Sr.JWT_ID]:e.createNewGuid()};return this.jwt=tQ.sign(c,this.privateKey,{header:s}),this.jwt}isExpired(){return this.expirationTime<ft()}static parseCertificate(e){let n=/-----BEGIN CERTIFICATE-----\r*\n(.+?)\r*\n-----END CERTIFICATE-----/gs,i=[],r;for(;(r=n.exec(e))!==null;)i.push(r[1].replace(/\r*\n/g,D.EMPTY_STRING));return i}},Um=class extends wi{constructor(e){super(e)}async acquireToken(e){this.logger.info("in acquireToken call in username-password client");let n=ft(),i=await this.executeTokenRequest(this.authority,e),r=new tr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return r.validateTokenResponse(i.body),r.handleServerTokenResponse(i.body,this.authority,n,e)}async executeTokenRequest(e,n){let i=this.createTokenQueryParameters(n),r=Je.appendQueryString(e.tokenEndpoint,i),o=await this.createTokenRequestBody(n),s=this.createTokenRequestHeaders({credential:n.username,type:Yr.UPN}),a={clientId:this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:n.scopes,claims:n.claims,authenticationScheme:n.authenticationScheme,resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,sshKid:n.sshKid};return this.executePostToTokenEndpoint(r,o,s,a,n.correlationId)}async createTokenRequestBody(e){let n=new Map;Zi(n,this.config.authOptions.clientId),IZ(n,e.username),vZ(n,e.password),Qi(n,e.scopes),J1(n,F1.IDTOKEN_TOKEN),wa(n,Sa.RESOURCE_OWNER_PASSWORD_GRANT),Ia(n),Ho(n,this.config.libraryInfo),Bo(n,this.config.telemetry.application),ba(n),this.serverTelemetryManager&&va(n,this.serverTelemetryManager);let i=e.correlationId||this.config.cryptoInterface.createNewGuid();qo(n,i),this.config.clientCredentials.clientSecret&&rd(n,this.config.clientCredentials.clientSecret);let r=this.config.clientCredentials.clientAssertion;return r&&(id(n,await jo(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),od(n,r.assertionType)),(!bn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ji(n,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&Wl(n,e.username),Fn(n)}};function CJ(t,e,n,i){let r=XZ({...t.auth,authority:e,redirectUri:n.redirectUri||""},n,i);return Ho(r,{sku:to.MSAL_SKU,version:Fo,cpu:process.arch||"",os:process.platform||""}),t.auth.protocolMode!==Xi.OIDC&&Bo(r,t.telemetry.application),J1(r,F1.CODE),n.codeChallenge&&n.codeChallengeMethod&&_Z(r,n.codeChallenge,n.codeChallengeMethod),$r(r,n.extraQueryParameters||{}),QZ(e,r,t.auth.encodeExtraQueryParams,n.extraQueryParameters)}var Jl=class{constructor(e){this.config=yJ(e),this.cryptoProvider=new Aa,this.logger=new Ki(this.config.system.loggerOptions,nw,Fo),this.storage=new Zl(this.logger,this.config.auth.clientId,this.cryptoProvider,jZ(this.config.auth)),this.tokenCache=new Lm(this.storage,this.logger,this.config.cache.cachePlugin)}async getAuthCodeUrl(e){this.logger.info("getAuthCodeUrl called",e.correlationId);let n={...e,...await this.initializeBaseRequest(e),responseMode:e.responseMode||$m.QUERY,authenticationScheme:et.BEARER,state:e.state||"",nonce:e.nonce||""},i=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions);return CJ(this.config,i,n,this.logger)}async acquireTokenByCode(e,n){this.logger.info("acquireTokenByCode called"),e.state&&n&&(this.logger.info("acquireTokenByCode - validating state"),this.validateState(e.state,n.state||""),n={...n,state:""});let i={...e,...await this.initializeBaseRequest(e),authenticationScheme:et.BEARER},r=this.initializeServerTelemetryManager(ta.acquireTokenByCode,i.correlationId);try{let o=await this.createAuthority(i.authority,i.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,i.correlationId,i.redirectUri,r),a=new OS(s);return this.logger.verbose("Auth code client created",i.correlationId),await a.acquireToken(i,n)}catch(o){throw o instanceof We&&o.setCorrelationId(i.correlationId),r.cacheFailedRequest(o),o}}async acquireTokenByRefreshToken(e){this.logger.info("acquireTokenByRefreshToken called",e.correlationId);let n={...e,...await this.initializeBaseRequest(e),authenticationScheme:et.BEARER},i=this.initializeServerTelemetryManager(ta.acquireTokenByRefreshToken,n.correlationId);try{let r=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(r,n.correlationId,n.redirectUri||"",i),s=new dl(o);return this.logger.verbose("Refresh token client created",n.correlationId),await s.acquireToken(n)}catch(r){throw r instanceof We&&r.setCorrelationId(n.correlationId),i.cacheFailedRequest(r),r}}async acquireTokenSilent(e){let n={...e,...await this.initializeBaseRequest(e),forceRefresh:e.forceRefresh||!1},i=this.initializeServerTelemetryManager(ta.acquireTokenSilent,n.correlationId,n.forceRefresh);try{let r=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(r,n.correlationId,n.redirectUri||"",i),s=new RS(o);this.logger.verbose("Silent flow client created",n.correlationId);try{return await this.tokenCache.overwriteCache(),await this.acquireCachedTokenSilent(n,s,o)}catch(a){if(a instanceof Fl&&a.errorCode===Vr)return new dl(o).acquireTokenByRefreshToken(n);throw a}}catch(r){throw r instanceof We&&r.setCorrelationId(n.correlationId),i.cacheFailedRequest(r),r}}async acquireCachedTokenSilent(e,n,i){let[r,o]=await n.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...Ti]});if(o===wt.PROACTIVELY_REFRESHED){this.logger.info("ClientApplication:acquireCachedTokenSilent - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.");let s=new dl(i);try{await s.acquireTokenByRefreshToken(e)}catch{}}return r}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId);let n={...e,...await this.initializeBaseRequest(e)},i=this.initializeServerTelemetryManager(ta.acquireTokenByUsernamePassword,n.correlationId);try{let r=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(r,n.correlationId,"",i),s=new Um(o);return this.logger.verbose("Username password client created",n.correlationId),await s.acquireToken(n)}catch(r){throw r instanceof We&&r.setCorrelationId(n.correlationId),i.cacheFailedRequest(r),r}}getTokenCache(){return this.logger.info("getTokenCache called"),this.tokenCache}validateState(e,n){if(!e)throw er.createStateNotFoundError();if(e!==n)throw j(Al)}getLogger(){return this.logger}setLogger(e){this.logger=e}async buildOauthClientConfiguration(e,n,i,r){return this.logger.verbose("buildOauthClientConfiguration called",n),this.logger.info(`Building oauth client configuration with the following authority: ${e.tokenEndpoint}.`,n),r?.updateRegionDiscoveryMetadata(e.regionDiscoveryMetadata),{authOptions:{clientId:this.config.auth.clientId,authority:e,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:i},loggerOptions:{logLevel:this.config.system.loggerOptions.logLevel,loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,correlationId:n},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:r,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:await this.getClientAssertion(e)},libraryInfo:{sku:to.MSAL_SKU,version:Fo,cpu:process.arch||D.EMPTY_STRING,os:process.platform||D.EMPTY_STRING},telemetry:this.config.telemetry,persistencePlugin:this.config.cache.cachePlugin,serializableCache:this.tokenCache}}async getClientAssertion(e){return this.developerProvidedClientAssertion&&(this.clientAssertion=Ca.fromAssertion(await jo(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:to.JWT_BEARER_ASSERTION_TYPE}}async initializeBaseRequest(e){return this.logger.verbose("initializeRequestScopes called",e.correlationId),e.authenticationScheme&&e.authenticationScheme===et.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",e.correlationId),e.authenticationScheme=et.BEARER,this.config.cache.claimsBasedCachingEnabled&&e.claims&&!bn.isEmptyObj(e.claims)&&(e.requestedClaimsHash=await this.cryptoProvider.hashString(e.claims)),{...e,scopes:[...e&&e.scopes||[],...Ti],correlationId:e&&e.correlationId||this.cryptoProvider.createNewGuid(),authority:e.authority||this.config.auth.authority}}initializeServerTelemetryManager(e,n,i){let r={clientId:this.config.auth.clientId,correlationId:n,apiId:e,forceRefresh:i||!1};return new Mm(r,this.storage)}async createAuthority(e,n,i,r){this.logger.verbose("createAuthority called",n);let o=Lo.generateAuthority(e,r||this.config.auth.azureCloudOptions),s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,azureRegionConfiguration:i,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache};return oU(o,this.config.system.networkClient,this.storage,s,this.logger,n)}clearCache(){this.storage.clear()}},kS=class{async listenForAuthCode(e,n){if(this.server)throw er.createLoopbackServerAlreadyExistsError();return new Promise((i,r)=>{this.server=Zp.createServer((o,s)=>{let a=o.url;if(a){if(a===D.FORWARD_SLASH){s.end(e||"Auth code was successfully acquired. You can close this window now.");return}}else{s.end(n||"Error occurred loading redirectUrl"),r(er.createUnableToLoadRedirectUrlError());return}let c=this.getRedirectUri(),u=new URL(a,c),l=$1(u.search)||{};l.code&&(s.writeHead(It.REDIRECT,{location:c}),s.end()),l.error&&s.end(n||`Error occurred: ${l.error}`),i(l)}),this.server.listen(0,"127.0.0.1")})}getRedirectUri(){if(!this.server||!this.server.listening)throw er.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),er.createInvalidLoopbackAddressTypeError();let n=e&&e.port;return`${to.HTTP_PROTOCOL}${to.LOCALHOST}:${n}`}closeServer(){this.server&&(this.server.close(),typeof this.server.closeAllConnections=="function"&&this.server.closeAllConnections(),this.server.unref(),this.server=void 0)}},xm=class extends wi{constructor(e){super(e)}async acquireToken(e){let n=await this.getDeviceCode(e);e.deviceCodeCallback(n);let i=ft(),r=await this.acquireTokenWithDeviceCode(e,n),o=new tr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(r),o.handleServerTokenResponse(r,this.authority,i,e)}async getDeviceCode(e){let n=this.createExtraQueryParameters(e),i=Je.appendQueryString(this.authority.deviceCodeEndpoint,n),r=this.createQueryString(e),o=this.createTokenRequestHeaders(),s={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return this.executePostRequestToDeviceCodeEndpoint(i,r,o,s,e.correlationId)}createExtraQueryParameters(e){let n=new Map;return e.extraQueryParameters&&$r(n,e.extraQueryParameters),Fn(n)}async executePostRequestToDeviceCodeEndpoint(e,n,i,r,o){let{body:{user_code:s,device_code:a,verification_uri:c,expires_in:u,interval:l,message:d}}=await this.sendPostRequest(r,e,{body:n,headers:i},o);return{userCode:s,deviceCode:a,verificationUri:c,expiresIn:u,interval:l,message:d}}createQueryString(e){let n=new Map;return Qi(n,e.scopes),Zi(n,this.config.authOptions.clientId),e.extraQueryParameters&&$r(n,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ji(n,e.claims,this.config.authOptions.clientCapabilities),Fn(n)}continuePolling(e,n,i){if(i)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true"),j(Ol);if(n&&n<e&&ft()>n)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${n}`),j(Ml);if(ft()>e)throw n&&this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${n}`),this.logger.error(`Device code expired. Expiration time of device code was ${e}`),j(Rl);return!0}async acquireTokenWithDeviceCode(e,n){let i=this.createTokenQueryParameters(e),r=Je.appendQueryString(this.authority.tokenEndpoint,i),o=this.createTokenRequestBody(e,n),s=this.createTokenRequestHeaders(),a=e.timeout?ft()+e.timeout:void 0,c=ft()+n.expiresIn,u=n.interval*1e3;for(;this.continuePolling(c,a,e.cancel);){let l={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},d=await this.executePostToTokenEndpoint(r,o,s,l,e.correlationId);if(d.body&&d.body.error)if(d.body.error===D.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling."),await MZ(u);else throw this.logger.info("Unexpected error in polling from the server"),aQ(gl,d.body.error);else return this.logger.verbose("Authorization completed successfully. Polling stopped."),d.body}throw this.logger.error("Polling stopped for unknown reasons."),j(Nl)}createTokenRequestBody(e,n){let i=new Map;Qi(i,e.scopes),Zi(i,this.config.authOptions.clientId),wa(i,Sa.DEVICE_CODE_GRANT),EZ(i,n.deviceCode);let r=e.correlationId||this.config.cryptoInterface.createNewGuid();return qo(i,r),Ia(i),Ho(i,this.config.libraryInfo),Bo(i,this.config.telemetry.application),ba(i),this.serverTelemetryManager&&va(i,this.serverTelemetryManager),(!bn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ji(i,e.claims,this.config.authOptions.clientCapabilities),Fn(i)}},LS=class extends Jl{constructor(e){super(e),this.config.broker.nativeBrokerPlugin&&(this.config.broker.nativeBrokerPlugin.isBrokerAvailable?(this.nativeBrokerPlugin=this.config.broker.nativeBrokerPlugin,this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions)):this.logger.warning("NativeBroker implementation was provided but the broker is unavailable.")),this.skus=Mm.makeExtraSkuString({libraryName:to.MSAL_SKU,libraryVersion:Fo})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId);let n=Object.assign(e,await this.initializeBaseRequest(e)),i=this.initializeServerTelemetryManager(ta.acquireTokenByDeviceCode,n.correlationId);try{let r=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(r,n.correlationId,"",i),s=new xm(o);return this.logger.verbose("Device code client created",n.correlationId),await s.acquireToken(n)}catch(r){throw r instanceof We&&r.setCorrelationId(n.correlationId),i.cacheFailedRequest(r),r}}async acquireTokenInteractive(e){let n=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",n);let{openBrowser:i,successTemplate:r,errorTemplate:o,windowHandle:s,loopbackClient:a,...c}=e;if(this.nativeBrokerPlugin){let _={...c,clientId:this.config.auth.clientId,scopes:e.scopes||Ti,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:n,extraParameters:{...c.extraQueryParameters,...c.tokenQueryParameters,[A1]:this.skus},accountId:c.account?.nativeAccountId};return this.nativeBrokerPlugin.acquireTokenInteractive(_,s)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw er.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:u,challenge:l}=await this.cryptoProvider.generatePkceCodes(),d=a||new kS,f={},m=null;try{let _=d.listenForAuthCode(r,o).then(w=>{f=w}).catch(w=>{m=w}),E=await this.waitForRedirectUri(d),I={...c,correlationId:n,scopes:e.scopes||Ti,redirectUri:E,responseMode:$m.QUERY,codeChallenge:l,codeChallengeMethod:rQ.S256},y=await this.getAuthCodeUrl(I);if(await i(y),await _,m)throw m;if(f.error)throw new Uo(f.error,f.error_description,f.suberror);if(!f.code)throw er.createNoAuthCodeInResponseError();let A=f.client_info,S={code:f.code,codeVerifier:u,clientInfo:A||D.EMPTY_STRING,...I};return await this.acquireTokenByCode(S)}finally{d.closeServer()}}async acquireTokenSilent(e){let n=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",n),this.nativeBrokerPlugin){let i={...e,clientId:this.config.auth.clientId,scopes:e.scopes||Ti,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:n,extraParameters:{...e.tokenQueryParameters,[A1]:this.skus},accountId:e.account.nativeAccountId,forceRefresh:e.forceRefresh||!1};return this.nativeBrokerPlugin.acquireTokenSilent(i)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw er.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async signOut(e){if(this.nativeBrokerPlugin&&e.account.nativeAccountId){let n={clientId:this.config.auth.clientId,accountId:e.account.nativeAccountId,correlationId:e.correlationId||this.cryptoProvider.createNewGuid()};await this.nativeBrokerPlugin.signOut(n)}await this.getTokenCache().removeAccount(e.account,e.correlationId)}async getAllAccounts(){if(this.nativeBrokerPlugin){let e=this.cryptoProvider.createNewGuid();return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId,e)}return this.getTokenCache().getAllAccounts()}async waitForRedirectUri(e){return new Promise((n,i)=>{let r=0,o=setInterval(()=>{if(TS.TIMEOUT_MS/TS.INTERVAL_MS<r){clearInterval(o),i(er.createLoopbackServerTimeoutError());return}try{let s=e.getRedirectUri();clearInterval(o),n(s);return}catch(s){if(s instanceof We&&s.errorCode===St.noLoopbackServerExists.code){r++;return}clearInterval(o),i(s);return}},TS.INTERVAL_MS)})}},ed=class extends wi{constructor(e,n){super(e),this.appTokenProvider=n}async acquireToken(e){if(e.skipCache||e.claims)return this.executeTokenRequest(e,this.authority);let[n,i]=await this.getCachedAuthenticationResult(e,this.config,this.cryptoUtils,this.authority,this.cacheManager,this.serverTelemetryManager);return n?(i===wt.PROACTIVELY_REFRESHED&&(this.logger.info("ClientCredentialClient:getCachedAuthenticationResult - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),await this.executeTokenRequest(e,this.authority,!0)),n):this.executeTokenRequest(e,this.authority)}async getCachedAuthenticationResult(e,n,i,r,o,s){let a=n,c=n,u=wt.NOT_APPLICABLE,l;a.serializableCache&&a.persistencePlugin&&(l=new Wi(a.serializableCache,!1),await a.persistencePlugin.beforeCacheAccess(l));let d=this.readAccessTokenFromCache(r,c.managedIdentityId?.id||a.authOptions.clientId,new vn(e.scopes||[]),o,e.correlationId);return a.serializableCache&&a.persistencePlugin&&l&&await a.persistencePlugin.afterCacheAccess(l),d?_a(d.expiresOn,a.systemOptions?.tokenRenewalOffsetSeconds||H1)?(s?.setCacheOutcome(wt.CACHED_ACCESS_TOKEN_EXPIRED),[null,wt.CACHED_ACCESS_TOKEN_EXPIRED]):(d.refreshOn&&_a(d.refreshOn.toString(),0)&&(u=wt.PROACTIVELY_REFRESHED,s?.setCacheOutcome(wt.PROACTIVELY_REFRESHED)),[await tr.generateAuthenticationResult(i,r,{account:null,idToken:null,accessToken:d,refreshToken:null,appMetadata:null},!0,e),u]):(s?.setCacheOutcome(wt.NO_CACHED_ACCESS_TOKEN),[null,wt.NO_CACHED_ACCESS_TOKEN])}readAccessTokenFromCache(e,n,i,r,o){let s={homeAccountId:D.EMPTY_STRING,environment:e.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:ht.ACCESS_TOKEN,clientId:n,realm:e.tenant,target:vn.createSearchScopes(i.asArray())},a=r.getAccessTokensByFilter(s,o);if(a.length<1)return null;if(a.length>1)throw j(aa);return a[0]}async executeTokenRequest(e,n,i){let r,o;if(this.appTokenProvider){this.logger.info("Using appTokenProvider extensibility.");let c={correlationId:e.correlationId,tenantId:this.config.authOptions.authority.tenant,scopes:e.scopes,claims:e.claims};o=ft();let u=await this.appTokenProvider(c);r={access_token:u.accessToken,expires_in:u.expiresInSeconds,refresh_in:u.refreshInSeconds,token_type:et.BEARER}}else{let c=this.createTokenQueryParameters(e),u=Je.appendQueryString(n.tokenEndpoint,c),l=await this.createTokenRequestBody(e),d=this.createTokenRequestHeaders(),f={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};this.logger.info("Sending token request to endpoint: "+n.tokenEndpoint),o=ft();let m=await this.executePostToTokenEndpoint(u,l,d,f,e.correlationId);r=m.body,r.status=m.status}let s=new tr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(r,i),await s.handleServerTokenResponse(r,this.authority,o,e)}async createTokenRequestBody(e){let n=new Map;Zi(n,this.config.authOptions.clientId),Qi(n,e.scopes,!1),wa(n,Sa.CLIENT_CREDENTIALS_GRANT),Ho(n,this.config.libraryInfo),Bo(n,this.config.telemetry.application),ba(n),this.serverTelemetryManager&&va(n,this.serverTelemetryManager);let i=e.correlationId||this.config.cryptoInterface.createNewGuid();qo(n,i),this.config.clientCredentials.clientSecret&&rd(n,this.config.clientCredentials.clientSecret);let r=e.clientAssertion||this.config.clientCredentials.clientAssertion;return r&&(id(n,await jo(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),od(n,r.assertionType)),(!bn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ji(n,e.claims,this.config.authOptions.clientCapabilities),Fn(n)}},Fm=class extends wi{constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new vn(e.scopes||[]),this.userAssertionHash=await this.cryptoUtils.hashString(e.oboAssertion),e.skipCache||e.claims)return this.executeTokenRequest(e,this.authority,this.userAssertionHash);try{return await this.getCachedAuthenticationResult(e)}catch{return await this.executeTokenRequest(e,this.authority,this.userAssertionHash)}}async getCachedAuthenticationResult(e){let n=this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId,e);if(n){if(_a(n.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(wt.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info(`OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`),j(Vr)}else throw this.serverTelemetryManager?.setCacheOutcome(wt.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),j(Vr);let i=this.readIdTokenFromCacheForOBO(n.homeAccountId,e.correlationId),r,o=null;if(i){r=td(i.secret,Ci.base64Decode);let s=r.oid||r.sub,a={homeAccountId:i.homeAccountId,environment:i.environment,tenantId:i.realm,username:D.EMPTY_STRING,localAccountId:s||D.EMPTY_STRING};o=this.cacheManager.getAccount(this.cacheManager.generateAccountKey(a),e.correlationId)}return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),tr.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:o,accessToken:n,idToken:i,refreshToken:null,appMetadata:null},!0,e,r)}readIdTokenFromCacheForOBO(e,n){let i={homeAccountId:e,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:ht.ID_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant},r=this.cacheManager.getIdTokensByFilter(i,n);return Object.values(r).length<1?null:Object.values(r)[0]}readAccessTokenFromCacheForOBO(e,n){let i=n.authenticationScheme||et.BEARER,o={credentialType:i.toLowerCase()!==et.BEARER.toLowerCase()?ht.ACCESS_TOKEN_WITH_AUTH_SCHEME:ht.ACCESS_TOKEN,clientId:e,target:vn.createSearchScopes(this.scopeSet.asArray()),tokenType:i,keyId:n.sshKid,requestedClaimsHash:n.requestedClaimsHash,userAssertionHash:this.userAssertionHash},s=this.cacheManager.getAccessTokensByFilter(o,n.correlationId),a=s.length;if(a<1)return null;if(a>1)throw j(aa);return s[0]}async executeTokenRequest(e,n,i){let r=this.createTokenQueryParameters(e),o=Je.appendQueryString(n.tokenEndpoint,r),s=await this.createTokenRequestBody(e),a=this.createTokenRequestHeaders(),c={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},u=ft(),l=await this.executePostToTokenEndpoint(o,s,a,c,e.correlationId),d=new tr(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return d.validateTokenResponse(l.body),await d.handleServerTokenResponse(l.body,this.authority,u,e,void 0,i)}async createTokenRequestBody(e){let n=new Map;Zi(n,this.config.authOptions.clientId),Qi(n,e.scopes),wa(n,Sa.JWT_BEARER),Ia(n),Ho(n,this.config.libraryInfo),Bo(n,this.config.telemetry.application),ba(n),this.serverTelemetryManager&&va(n,this.serverTelemetryManager);let i=e.correlationId||this.config.cryptoInterface.createNewGuid();qo(n,i),SZ(n,sZ),CZ(n,e.oboAssertion),this.config.clientCredentials.clientSecret&&rd(n,this.config.clientCredentials.clientSecret);let r=this.config.clientCredentials.clientAssertion;return r&&(id(n,await jo(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),od(n,r.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ji(n,e.claims,this.config.authOptions.clientCapabilities),Fn(n)}},US=class extends Jl{constructor(e){super(e);let n=!!this.config.auth.clientSecret,i=!!this.config.auth.clientAssertion,r=(!!this.config.auth.clientCertificate?.thumbprint||!!this.config.auth.clientCertificate?.thumbprintSha256)&&!!this.config.auth.clientCertificate?.privateKey;if(!this.appTokenProvider){if(n&&i||i&&r||n&&r)throw j(ha);if(this.config.auth.clientSecret){this.clientSecret=this.config.auth.clientSecret;return}if(this.config.auth.clientAssertion){this.developerProvidedClientAssertion=this.config.auth.clientAssertion;return}if(r)this.clientAssertion=this.config.auth.clientCertificate.thumbprintSha256?Ca.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):Ca.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw j(ha);this.appTokenProvider=void 0}}SetAppTokenProvider(e){this.appTokenProvider=e}async acquireTokenByClientCredential(e){this.logger.info("acquireTokenByClientCredential called",e.correlationId);let n;e.clientAssertion&&(n={assertion:await jo(e.clientAssertion,this.config.auth.clientId),assertionType:to.JWT_BEARER_ASSERTION_TYPE});let i=await this.initializeBaseRequest(e),r={...i,scopes:i.scopes.filter(f=>!Ti.includes(f))},o={...e,...r,clientAssertion:n},a=new Je(o.authority).getUrlComponents().PathSegments[0];if(Object.values(Ai).includes(a))throw j(xl);let c=process.env[sJ],u;o.azureRegion!=="DisableMsalForceRegion"&&(!o.azureRegion&&c?u=c:u=o.azureRegion);let l={azureRegion:u,environmentRegion:process.env[oJ]},d=this.initializeServerTelemetryManager(ta.acquireTokenByClientCredential,o.correlationId,o.skipCache);try{let f=await this.createAuthority(o.authority,o.correlationId,l,e.azureCloudOptions),m=await this.buildOauthClientConfiguration(f,o.correlationId,"",d),_=new ed(m,this.appTokenProvider);return this.logger.verbose("Client credential client created",o.correlationId),await _.acquireToken(o)}catch(f){throw f instanceof We&&f.setCorrelationId(o.correlationId),d.cacheFailedRequest(f),f}}async acquireTokenOnBehalfOf(e){this.logger.info("acquireTokenOnBehalfOf called",e.correlationId);let n={...e,...await this.initializeBaseRequest(e)};try{let i=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),r=await this.buildOauthClientConfiguration(i,n.correlationId,"",void 0),o=new Fm(r);return this.logger.verbose("On behalf of client created",n.correlationId),await o.acquireToken(n)}catch(i){throw i instanceof We&&i.setCorrelationId(n.correlationId),i}}};function SJ(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}var xS=class{constructor(e,n,i){this.httpClientNoRetries=e,this.retryPolicy=n,this.logger=i}async sendNetworkRequestAsyncHelper(e,n,i){return e===Zt.GET?this.httpClientNoRetries.sendGetRequestAsync(n,i):this.httpClientNoRetries.sendPostRequestAsync(n,i)}async sendNetworkRequestAsync(e,n,i){let r=await this.sendNetworkRequestAsyncHelper(e,n,i);"isNewRequest"in this.retryPolicy&&(this.retryPolicy.isNewRequest=!0);let o=0;for(;await this.retryPolicy.pauseForRetry(r.status,o,this.logger,r.headers[Yt.RETRY_AFTER]);)r=await this.sendNetworkRequestAsyncHelper(e,n,i),o++;return r}async sendGetRequestAsync(e,n){return this.sendNetworkRequestAsync(Zt.GET,e,n)}async sendPostRequestAsync(e,n){return this.sendNetworkRequestAsync(Zt.POST,e,n)}},ea={MANAGED_IDENTITY_CLIENT_ID_2017:"clientid",MANAGED_IDENTITY_CLIENT_ID:"client_id",MANAGED_IDENTITY_OBJECT_ID:"object_id",MANAGED_IDENTITY_RESOURCE_ID_IMDS:"msi_res_id",MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS:"mi_res_id"},Ii=class{constructor(e,n,i,r,o){this.logger=e,this.nodeStorage=n,this.networkClient=i,this.cryptoProvider=r,this.disableInternalRetries=o}async getServerTokenResponseAsync(e,n,i,r){return this.getServerTokenResponse(e)}getServerTokenResponse(e){let n,i;return e.body.expires_on&&(SJ(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),i=e.body.expires_on-ft(),i>2*3600&&(n=i/2)),{status:e.status,access_token:e.body.access_token,expires_in:i,scope:e.body.resource,token_type:e.body.token_type,refresh_in:n,correlation_id:e.body.correlation_id||e.body.correlationId,error:typeof e.body.error=="string"?e.body.error:e.body.error?.code,error_description:e.body.message||(typeof e.body.error=="string"?e.body.error_description:e.body.error?.message),error_codes:e.body.error_codes,timestamp:e.body.timestamp,trace_id:e.body.trace_id}}async acquireTokenWithManagedIdentity(e,n,i,r){let o=this.createRequest(e.resource,n);if(e.revokedTokenSha256Hash&&(this.logger.info(`[Managed Identity] The following claims are present in the request: ${e.claims}`),o.queryParameters[qn.SHA256_TOKEN_TO_REFRESH]=e.revokedTokenSha256Hash),e.clientCapabilities?.length){let m=e.clientCapabilities.toString();this.logger.info(`[Managed Identity] The following client capabilities are present in the request: ${m}`),o.queryParameters[qn.XMS_CC]=m}let s=o.headers;s[Yt.CONTENT_TYPE]=D.URL_FORM_CONTENT_TYPE;let a={headers:s};Object.keys(o.bodyParameters).length&&(a.body=o.computeParametersBodyString());let c=this.disableInternalRetries?this.networkClient:new xS(this.networkClient,o.retryPolicy,this.logger),u=ft(),l;try{o.httpMethod===Zt.POST?l=await c.sendPostRequestAsync(o.computeUri(),a):l=await c.sendGetRequestAsync(o.computeUri(),a)}catch(m){throw m instanceof We?m:j(ko)}let d=new tr(n.id,this.nodeStorage,this.cryptoProvider,this.logger,null,null),f=await this.getServerTokenResponseAsync(l,c,o,a);return d.validateTokenResponse(f,r),d.handleServerTokenResponse(f,i,u,e)}getManagedIdentityUserAssignedIdQueryParameterKey(e,n,i){switch(e){case pn.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${i?"2017+":"2019+"}] Adding user assigned client id to the request.`),i?ea.MANAGED_IDENTITY_CLIENT_ID_2017:ea.MANAGED_IDENTITY_CLIENT_ID;case pn.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request."),n?ea.MANAGED_IDENTITY_RESOURCE_ID_IMDS:ea.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case pn.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request."),ea.MANAGED_IDENTITY_OBJECT_ID;default:throw Qt(fl)}}};Ii.getValidatedEnvVariableUrlString=(t,e,n,i)=>{try{return new Je(e).urlString}catch{throw i.info(`[Managed Identity] ${n} managed identity is unavailable because the '${t}' environment variable is malformed.`),Qt(al[t])}};var FS=class{calculateDelay(e,n){if(!e)return n;let i=Math.round(parseFloat(e)*1e3);return isNaN(i)&&(i=new Date(e).valueOf()-new Date().valueOf()),Math.max(n,i)}},wJ=3,IJ=1e3,vJ=[fn.HttpStatus.NOT_FOUND,fn.HttpStatus.REQUEST_TIMEOUT,fn.HttpStatus.TOO_MANY_REQUESTS,fn.HttpStatus.SERVER_ERROR,fn.HttpStatus.SERVICE_UNAVAILABLE,fn.HttpStatus.GATEWAY_TIMEOUT],qS=class t{constructor(){this.linearRetryStrategy=new FS}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return IJ}async pauseForRetry(e,n,i,r){if(vJ.includes(e)&&n<wJ){let o=this.linearRetryStrategy.calculateDelay(r,t.DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS);return i.verbose(`Retrying request in ${o}ms (retry attempt: ${n+1})`),await new Promise(s=>setTimeout(s,o)),!0}return!1}},no=class{constructor(e,n,i){this.httpMethod=e,this._baseEndpoint=n,this.headers={},this.bodyParameters={},this.queryParameters={},this.retryPolicy=i||new qS}computeUri(){let e=new Map;this.queryParameters&&$r(e,this.queryParameters);let n=Fn(e);return Je.appendQueryString(this._baseEndpoint,n)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&$r(e,this.bodyParameters),Fn(e)}},bJ="2019-08-01",qm=class t extends Ii{constructor(e,n,i,r,o,s,a){super(e,n,i,r,o),this.identityEndpoint=s,this.identityHeader=a}static getEnvironmentVariables(){let e=process.env[me.IDENTITY_ENDPOINT],n=process.env[me.IDENTITY_HEADER];return[e,n]}static tryCreate(e,n,i,r,o){let[s,a]=t.getEnvironmentVariables();if(!s||!a)return e.info(`[Managed Identity] ${Ce.APP_SERVICE} managed identity is unavailable because one or both of the '${me.IDENTITY_HEADER}' and '${me.IDENTITY_ENDPOINT}' environment variables are not defined.`),null;let c=t.getValidatedEnvVariableUrlString(me.IDENTITY_ENDPOINT,s,Ce.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${Ce.APP_SERVICE} managed identity. Endpoint URI: ${c}. Creating ${Ce.APP_SERVICE} managed identity.`),new t(e,n,i,r,o,s,a)}createRequest(e,n){let i=new no(Zt.GET,this.identityEndpoint);return i.headers[eo.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,i.queryParameters[qn.API_VERSION]=bJ,i.queryParameters[qn.RESOURCE]=e,n.idType!==pn.SYSTEM_ASSIGNED&&(i.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(n.idType)]=n.id),i}},OJ="2019-11-01",k1="http://127.0.0.1:40342/metadata/identity/oauth2/token",L1="N/A: himds executable exists",U1={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},RJ={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},Hm=class t extends Ii{constructor(e,n,i,r,o,s){super(e,n,i,r,o),this.identityEndpoint=s}static getEnvironmentVariables(){let e=process.env[me.IDENTITY_ENDPOINT],n=process.env[me.IMDS_ENDPOINT];if(!e||!n){let i=RJ[process.platform];try{ol.accessSync(i,ol.constants.F_OK|ol.constants.R_OK),e=k1,n=L1}catch{}}return[e,n]}static tryCreate(e,n,i,r,o,s){let[a,c]=t.getEnvironmentVariables();if(!a||!c)return e.info(`[Managed Identity] ${Ce.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${me.IDENTITY_ENDPOINT}' and '${me.IMDS_ENDPOINT}' are not defined. ${Ce.AZURE_ARC} managed identity is also unavailable through file detection.`),null;if(c===L1)e.info(`[Managed Identity] ${Ce.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${Ce.AZURE_ARC} endpoint: ${k1}. Creating ${Ce.AZURE_ARC} managed identity.`);else{let u=t.getValidatedEnvVariableUrlString(me.IDENTITY_ENDPOINT,a,Ce.AZURE_ARC,e);u.endsWith("/")&&u.slice(0,-1),t.getValidatedEnvVariableUrlString(me.IMDS_ENDPOINT,c,Ce.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${Ce.AZURE_ARC} managed identity. Endpoint URI: ${u}. Creating ${Ce.AZURE_ARC} managed identity.`)}if(s.idType!==pn.SYSTEM_ASSIGNED)throw Qt(mU);return new t(e,n,i,r,o,a)}createRequest(e){let n=new no(Zt.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return n.headers[eo.METADATA_HEADER_NAME]="true",n.queryParameters[qn.API_VERSION]=OJ,n.queryParameters[qn.RESOURCE]=e,n}async getServerTokenResponseAsync(e,n,i,r){let o;if(e.status===It.UNAUTHORIZED){let s=e.headers["www-authenticate"];if(!s)throw Qt(yU);if(!s.includes("Basic realm="))throw Qt(EU);let a=s.split("Basic realm=")[1];if(!U1.hasOwnProperty(process.platform))throw Qt(pU);let c=U1[process.platform],u=nQ.basename(a);if(!u.endsWith(".key"))throw Qt(dU);if(c+u!==a)throw Qt(hU);let l;try{l=await ol.statSync(a).size}catch{throw Qt(NS)}if(l>uJ)throw Qt(fU);let d;try{d=ol.readFileSync(a,Si.UTF8)}catch{throw Qt(NS)}let f=`Basic ${d}`;this.logger.info("[Managed Identity] Adding authorization header to the request."),i.headers[eo.AUTHORIZATION_HEADER_NAME]=f;try{o=await n.sendGetRequestAsync(i.computeUri(),r)}catch(m){throw m instanceof We?m:j(ko)}}return this.getServerTokenResponse(o||e)}},Bm=class t extends Ii{constructor(e,n,i,r,o,s){super(e,n,i,r,o),this.msiEndpoint=s}static getEnvironmentVariables(){return[process.env[me.MSI_ENDPOINT]]}static tryCreate(e,n,i,r,o,s){let[a]=t.getEnvironmentVariables();if(!a)return e.info(`[Managed Identity] ${Ce.CLOUD_SHELL} managed identity is unavailable because the '${me.MSI_ENDPOINT} environment variable is not defined.`),null;let c=t.getValidatedEnvVariableUrlString(me.MSI_ENDPOINT,a,Ce.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${Ce.CLOUD_SHELL} managed identity. Endpoint URI: ${c}. Creating ${Ce.CLOUD_SHELL} managed identity.`),s.idType!==pn.SYSTEM_ASSIGNED)throw Qt(gU);return new t(e,n,i,r,o,a)}createRequest(e){let n=new no(Zt.POST,this.msiEndpoint);return n.headers[eo.METADATA_HEADER_NAME]="true",n.bodyParameters[qn.RESOURCE]=e,n}},HS=class{constructor(e,n,i){this.minExponentialBackoff=e,this.maxExponentialBackoff=n,this.exponentialDeltaBackoff=i}calculateDelay(e){return e===0?this.minExponentialBackoff:Math.min(Math.pow(2,e-1)*this.exponentialDeltaBackoff,this.maxExponentialBackoff)}},NJ=[fn.HttpStatus.NOT_FOUND,fn.HttpStatus.REQUEST_TIMEOUT,fn.HttpStatus.GONE,fn.HttpStatus.TOO_MANY_REQUESTS],PJ=3,DJ=7,MJ=1e3,kJ=4e3,LJ=2e3,UJ=10*1e3,BS=class t{constructor(){this.exponentialRetryStrategy=new HS(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return MJ}static get MAX_EXPONENTIAL_BACKOFF_MS(){return kJ}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return LJ}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return UJ}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,n,i){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===fn.HttpStatus.GONE?DJ:PJ),(NJ.includes(e)||e>=fn.HttpStatus.SERVER_ERROR_RANGE_START&&e<=fn.HttpStatus.SERVER_ERROR_RANGE_END&&n<this.maxRetries)&&n<this.maxRetries){let r=e===fn.HttpStatus.GONE?t.HTTP_STATUS_GONE_RETRY_AFTER_MS:this.exponentialRetryStrategy.calculateDelay(n);return i.verbose(`Retrying request in ${r}ms (retry attempt: ${n+1})`),await new Promise(o=>setTimeout(o,r)),!0}return!1}},TU="/metadata/identity/oauth2/token",xJ=`http://169.254.169.254${TU}`,FJ="2018-02-01",jS=class t extends Ii{constructor(e,n,i,r,o,s){super(e,n,i,r,o),this.identityEndpoint=s}static tryCreate(e,n,i,r,o){let s;return process.env[me.AZURE_POD_IDENTITY_AUTHORITY_HOST]?(e.info(`[Managed Identity] Environment variable ${me.AZURE_POD_IDENTITY_AUTHORITY_HOST} for ${Ce.IMDS} returned endpoint: ${process.env[me.AZURE_POD_IDENTITY_AUTHORITY_HOST]}`),s=t.getValidatedEnvVariableUrlString(me.AZURE_POD_IDENTITY_AUTHORITY_HOST,`${process.env[me.AZURE_POD_IDENTITY_AUTHORITY_HOST]}${TU}`,Ce.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${me.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${Ce.IMDS}, using the default endpoint.`),s=xJ),new t(e,n,i,r,o,s)}createRequest(e,n){let i=new no(Zt.GET,this.identityEndpoint);return i.headers[eo.METADATA_HEADER_NAME]="true",i.queryParameters[qn.API_VERSION]=FJ,i.queryParameters[qn.RESOURCE]=e,n.idType!==pn.SYSTEM_ASSIGNED&&(i.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(n.idType,!0)]=n.id),i.retryPolicy=new BS,i}},qJ="2019-07-01-preview",jm=class t extends Ii{constructor(e,n,i,r,o,s,a){super(e,n,i,r,o),this.identityEndpoint=s,this.identityHeader=a}static getEnvironmentVariables(){let e=process.env[me.IDENTITY_ENDPOINT],n=process.env[me.IDENTITY_HEADER],i=process.env[me.IDENTITY_SERVER_THUMBPRINT];return[e,n,i]}static tryCreate(e,n,i,r,o,s){let[a,c,u]=t.getEnvironmentVariables();if(!a||!c||!u)return e.info(`[Managed Identity] ${Ce.SERVICE_FABRIC} managed identity is unavailable because one or all of the '${me.IDENTITY_HEADER}', '${me.IDENTITY_ENDPOINT}' or '${me.IDENTITY_SERVER_THUMBPRINT}' environment variables are not defined.`),null;let l=t.getValidatedEnvVariableUrlString(me.IDENTITY_ENDPOINT,a,Ce.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${Ce.SERVICE_FABRIC} managed identity. Endpoint URI: ${l}. Creating ${Ce.SERVICE_FABRIC} managed identity.`),s.idType!==pn.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${Ce.SERVICE_FABRIC} user assigned managed identity is configured in the cluster, not during runtime. See also: https://learn.microsoft.com/en-us/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service.`),new t(e,n,i,r,o,a,c)}createRequest(e,n){let i=new no(Zt.GET,this.identityEndpoint);return i.headers[eo.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,i.queryParameters[qn.API_VERSION]=qJ,i.queryParameters[qn.RESOURCE]=e,n.idType!==pn.SYSTEM_ASSIGNED&&(i.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(n.idType)]=n.id),i}},HJ="2017-09-01",BJ=`Only client id is supported for user-assigned managed identity in ${Ce.MACHINE_LEARNING}.`,Ym=class t extends Ii{constructor(e,n,i,r,o,s,a){super(e,n,i,r,o),this.msiEndpoint=s,this.secret=a}static getEnvironmentVariables(){let e=process.env[me.MSI_ENDPOINT],n=process.env[me.MSI_SECRET];return[e,n]}static tryCreate(e,n,i,r,o){let[s,a]=t.getEnvironmentVariables();if(!s||!a)return e.info(`[Managed Identity] ${Ce.MACHINE_LEARNING} managed identity is unavailable because one or both of the '${me.MSI_ENDPOINT}' and '${me.MSI_SECRET}' environment variables are not defined.`),null;let c=t.getValidatedEnvVariableUrlString(me.MSI_ENDPOINT,s,Ce.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${Ce.MACHINE_LEARNING} managed identity. Endpoint URI: ${c}. Creating ${Ce.MACHINE_LEARNING} managed identity.`),new t(e,n,i,r,o,s,a)}createRequest(e,n){let i=new no(Zt.GET,this.msiEndpoint);if(i.headers[eo.METADATA_HEADER_NAME]="true",i.headers[eo.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,i.queryParameters[qn.API_VERSION]=HJ,i.queryParameters[qn.RESOURCE]=e,n.idType===pn.SYSTEM_ASSIGNED)i.queryParameters[ea.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[me.DEFAULT_IDENTITY_CLIENT_ID];else if(n.idType===pn.USER_ASSIGNED_CLIENT_ID)i.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(n.idType,!1,!0)]=n.id;else throw new Error(BJ);return i}},Vm=class t{constructor(e,n,i,r,o){this.logger=e,this.nodeStorage=n,this.networkClient=i,this.cryptoProvider=r,this.disableInternalRetries=o}async sendManagedIdentityTokenRequest(e,n,i,r){return t.identitySource||(t.identitySource=this.selectManagedIdentitySource(this.logger,this.nodeStorage,this.networkClient,this.cryptoProvider,this.disableInternalRetries,n)),t.identitySource.acquireTokenWithManagedIdentity(e,n,i,r)}allEnvironmentVariablesAreDefined(e){return Object.values(e).every(n=>n!==void 0)}getManagedIdentitySource(){return t.sourceName=this.allEnvironmentVariablesAreDefined(jm.getEnvironmentVariables())?Ce.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(qm.getEnvironmentVariables())?Ce.APP_SERVICE:this.allEnvironmentVariablesAreDefined(Ym.getEnvironmentVariables())?Ce.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(Bm.getEnvironmentVariables())?Ce.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(Hm.getEnvironmentVariables())?Ce.AZURE_ARC:Ce.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,n,i,r,o,s){let a=jm.tryCreate(e,n,i,r,o,s)||qm.tryCreate(e,n,i,r,o)||Ym.tryCreate(e,n,i,r,o)||Bm.tryCreate(e,n,i,r,o,s)||Hm.tryCreate(e,n,i,r,o,s)||jS.tryCreate(e,n,i,r,o);if(!a)throw Qt(_U);return a}},jJ=[Ce.SERVICE_FABRIC],YS=class t{constructor(e){this.config=EJ(e||{}),this.logger=new Ki(this.config.system.loggerOptions,nw,Fo);let n={canonicalAuthority:D.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new Zl(this.logger,this.config.managedIdentityId.id,AS,n)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new Aa;let i={protocolMode:Xi.AAD,knownAuthorities:[M1],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new Lo(M1,this.networkClient,t.nodeStorage,i,this.logger,this.cryptoProvider.createNewGuid(),void 0,!0),this.fakeClientCredentialClient=new ed({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new Vm(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new Ql}async acquireToken(e){if(!e.resource)throw yt(fa);let n={forceRefresh:e.forceRefresh,resource:e.resource.replace("/.default",""),scopes:[e.resource.replace("/.default","")],authority:this.fakeAuthority.canonicalAuthority,correlationId:this.cryptoProvider.createNewGuid(),claims:e.claims,clientCapabilities:this.config.clientCapabilities};if(n.forceRefresh)return this.acquireTokenFromManagedIdentity(n,this.config.managedIdentityId,this.fakeAuthority);let[i,r]=await this.fakeClientCredentialClient.getCachedAuthenticationResult(n,this.config,this.cryptoProvider,this.fakeAuthority,t.nodeStorage);if(n.claims){let o=this.managedIdentityClient.getManagedIdentitySource();if(i&&jJ.includes(o)){let s=this.hashUtils.sha256(i.accessToken).toString(Si.HEX);n.revokedTokenSha256Hash=s}return this.acquireTokenFromManagedIdentity(n,this.config.managedIdentityId,this.fakeAuthority)}return i?(r===wt.PROACTIVELY_REFRESHED&&(this.logger.info("ClientCredentialClient:getCachedAuthenticationResult - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),await this.acquireTokenFromManagedIdentity(n,this.config.managedIdentityId,this.fakeAuthority,!0)),i):this.acquireTokenFromManagedIdentity(n,this.config.managedIdentityId,this.fakeAuthority)}async acquireTokenFromManagedIdentity(e,n,i,r){return this.managedIdentityClient.sendManagedIdentityTokenRequest(e,n,i,r)}getManagedIdentitySource(){return Vm.sourceName||this.managedIdentityClient.getManagedIdentitySource()}},VS=class{constructor(e,n){this.client=e,this.partitionManager=n}async beforeCacheAccess(e){let n=await this.partitionManager.getKey(),i=await this.client.get(n);e.tokenCache.deserialize(i)}async afterCacheAccess(e){if(e.cacheHasChanged){let n=e.tokenCache.getKVStore(),i=Object.values(n).filter(o=>xn.isAccountEntity(o)),r;if(i.length>0){let o=i[0];r=await this.partitionManager.extractKey(o)}else r=await this.partitionManager.getKey();await this.client.set(r,e.tokenCache.serialize())}}};ie.AuthError=We;ie.AuthErrorCodes=oQ;ie.AuthErrorMessage=sQ;ie.AzureCloudInstance=zm;ie.ClientApplication=Jl;ie.ClientAssertion=Ca;ie.ClientAuthError=Fl;ie.ClientAuthErrorCodes=cQ;ie.ClientAuthErrorMessage=uQ;ie.ClientConfigurationError=vm;ie.ClientConfigurationErrorCodes=lQ;ie.ClientConfigurationErrorMessage=dQ;ie.ClientCredentialClient=ed;ie.ConfidentialClientApplication=US;ie.CryptoProvider=Aa;ie.DeviceCodeClient=xm;ie.DistributedCachePlugin=VS;ie.InteractionRequiredAuthError=xo;ie.InteractionRequiredAuthErrorCodes=YZ;ie.InteractionRequiredAuthErrorMessage=$Z;ie.Logger=Ki;ie.ManagedIdentityApplication=YS;ie.ManagedIdentitySourceNames=Ce;ie.OnBehalfOfClient=Fm;ie.PromptValue=Jp;ie.ProtocolMode=Xi;ie.PublicClientApplication=LS;ie.ResponseMode=$m;ie.ServerError=Uo;ie.TokenCache=Lm;ie.TokenCacheContext=Wi;ie.UsernamePasswordClient=Um;ie.internals=nJ;ie.version=Fo});var ow=g(iw=>{"use strict";Object.defineProperty(iw,"__esModule",{value:!0});iw.getRandomIntegerInclusive=YJ;function YJ(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}});var aw=g(sw=>{"use strict";Object.defineProperty(sw,"__esModule",{value:!0});sw.calculateRetryDelay=$J;var VJ=ow();function $J(t,e){let n=e.retryDelayInMs*Math.pow(2,t),i=Math.min(e.maxRetryDelayInMs,n);return{retryAfterInMs:i/2+(0,VJ.getRandomIntegerInclusive)(0,i/2)}}});var Km=g(cw=>{"use strict";Object.defineProperty(cw,"__esModule",{value:!0});cw.isObject=zJ;function zJ(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var lw=g(uw=>{"use strict";Object.defineProperty(uw,"__esModule",{value:!0});uw.isError=WJ;var GJ=Km();function WJ(t){if((0,GJ.isObject)(t)){let e=typeof t.name=="string",n=typeof t.message=="string";return e&&n}return!1}});var CU=g(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});Xm.computeSha256Hmac=KJ;Xm.computeSha256Hash=XJ;var AU=x("crypto");async function KJ(t,e,n){let i=Buffer.from(t,"base64");return(0,AU.createHmac)("sha256",i).update(e).digest(n)}async function XJ(t,e){return(0,AU.createHash)("sha256").update(t).digest(e)}});var Qm=g(dw=>{"use strict";Object.defineProperty(dw,"__esModule",{value:!0});dw.randomUUID=QJ;function QJ(){return crypto.randomUUID()}});var sd=g(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.isReactNative=vt.isNodeRuntime=vt.isNodeLike=vt.isBun=vt.isDeno=vt.isWebWorker=vt.isBrowser=void 0;vt.isBrowser=typeof window<"u"&&typeof window.document<"u";vt.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(self.constructor?.name==="DedicatedWorkerGlobalScope"||self.constructor?.name==="ServiceWorkerGlobalScope"||self.constructor?.name==="SharedWorkerGlobalScope");vt.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";vt.isBun=typeof Bun<"u"&&typeof Bun.version<"u";vt.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!globalThis.process.versions?.node;vt.isNodeRuntime=vt.isNodeLike&&!vt.isBun&&!vt.isDeno;vt.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var Yo=g(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.uint8ArrayToString=ZJ;Zm.stringToUint8Array=JJ;function ZJ(t,e){return Buffer.from(t).toString(e)}function JJ(t,e){return Buffer.from(t,e)}});var ad=g(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.Sanitizer=void 0;var eee=Km(),hw="REDACTED",tee=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],nee=["api-version"],fw=class{allowedHeaderNames;allowedQueryParameters;constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:n=[]}={}){e=tee.concat(e),n=nee.concat(n),this.allowedHeaderNames=new Set(e.map(i=>i.toLowerCase())),this.allowedQueryParameters=new Set(n.map(i=>i.toLowerCase()))}sanitize(e){let n=new Set;return JSON.stringify(e,(i,r)=>{if(r instanceof Error)return{...r,name:r.name,message:r.message};if(i==="headers")return this.sanitizeHeaders(r);if(i==="url")return this.sanitizeUrl(r);if(i==="query")return this.sanitizeQuery(r);if(i==="body")return;if(i==="response")return;if(i==="operationSpec")return;if(Array.isArray(r)||(0,eee.isObject)(r)){if(n.has(r))return"[Circular]";n.add(r)}return r},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let n=new URL(e);if(!n.search)return e;for(let[i]of n.searchParams)this.allowedQueryParameters.has(i.toLowerCase())||n.searchParams.set(i,hw);return n.toString()}sanitizeHeaders(e){let n={};for(let i of Object.keys(e))this.allowedHeaderNames.has(i.toLowerCase())?n[i]=e[i]:n[i]=hw;return n}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let n={};for(let i of Object.keys(e))this.allowedQueryParameters.has(i.toLowerCase())?n[i]=e[i]:n[i]=hw;return n}};Jm.Sanitizer=fw});var cd=g(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.Sanitizer=Ie.uint8ArrayToString=Ie.stringToUint8Array=Ie.isWebWorker=Ie.isReactNative=Ie.isDeno=Ie.isNodeRuntime=Ie.isNodeLike=Ie.isBun=Ie.isBrowser=Ie.randomUUID=Ie.computeSha256Hmac=Ie.computeSha256Hash=Ie.isError=Ie.isObject=Ie.getRandomIntegerInclusive=Ie.calculateRetryDelay=void 0;var ree=aw();Object.defineProperty(Ie,"calculateRetryDelay",{enumerable:!0,get:function(){return ree.calculateRetryDelay}});var iee=ow();Object.defineProperty(Ie,"getRandomIntegerInclusive",{enumerable:!0,get:function(){return iee.getRandomIntegerInclusive}});var oee=Km();Object.defineProperty(Ie,"isObject",{enumerable:!0,get:function(){return oee.isObject}});var see=lw();Object.defineProperty(Ie,"isError",{enumerable:!0,get:function(){return see.isError}});var SU=CU();Object.defineProperty(Ie,"computeSha256Hash",{enumerable:!0,get:function(){return SU.computeSha256Hash}});Object.defineProperty(Ie,"computeSha256Hmac",{enumerable:!0,get:function(){return SU.computeSha256Hmac}});var aee=Qm();Object.defineProperty(Ie,"randomUUID",{enumerable:!0,get:function(){return aee.randomUUID}});var Vo=sd();Object.defineProperty(Ie,"isBrowser",{enumerable:!0,get:function(){return Vo.isBrowser}});Object.defineProperty(Ie,"isBun",{enumerable:!0,get:function(){return Vo.isBun}});Object.defineProperty(Ie,"isNodeLike",{enumerable:!0,get:function(){return Vo.isNodeLike}});Object.defineProperty(Ie,"isNodeRuntime",{enumerable:!0,get:function(){return Vo.isNodeRuntime}});Object.defineProperty(Ie,"isDeno",{enumerable:!0,get:function(){return Vo.isDeno}});Object.defineProperty(Ie,"isReactNative",{enumerable:!0,get:function(){return Vo.isReactNative}});Object.defineProperty(Ie,"isWebWorker",{enumerable:!0,get:function(){return Vo.isWebWorker}});var wU=Yo();Object.defineProperty(Ie,"stringToUint8Array",{enumerable:!0,get:function(){return wU.stringToUint8Array}});Object.defineProperty(Ie,"uint8ArrayToString",{enumerable:!0,get:function(){return wU.uint8ArrayToString}});var cee=ad();Object.defineProperty(Ie,"Sanitizer",{enumerable:!0,get:function(){return cee.Sanitizer}})});var IU=g(pw=>{"use strict";Object.defineProperty(pw,"__esModule",{value:!0});pw.cancelablePromiseRace=uee;async function uee(t,e){let n=new AbortController;function i(){n.abort()}e?.abortSignal?.addEventListener("abort",i);try{return await Promise.race(t.map(r=>r({abortSignal:n.signal})))}finally{n.abort(),e?.abortSignal?.removeEventListener("abort",i)}}});var vU=g(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});eg.AbortError=void 0;var mw=class extends Error{constructor(e){super(e),this.name="AbortError"}};eg.AbortError=mw});var gw=g(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.AbortError=void 0;var lee=vU();Object.defineProperty(tg,"AbortError",{enumerable:!0,get:function(){return lee.AbortError}})});var yw=g(_w=>{"use strict";Object.defineProperty(_w,"__esModule",{value:!0});_w.createAbortablePromise=hee;var dee=gw();function hee(t,e){let{cleanupBeforeAbort:n,abortSignal:i,abortErrorMsg:r}=e??{};return new Promise((o,s)=>{function a(){s(new dee.AbortError(r??"The operation was aborted."))}function c(){i?.removeEventListener("abort",u)}function u(){n?.(),c(),a()}if(i?.aborted)return a();try{t(l=>{c(),o(l)},l=>{c(),s(l)})}catch(l){s(l)}i?.addEventListener("abort",u)})}});var bU=g(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.delay=gee;ng.calculateRetryDelay=_ee;var fee=yw(),pee=cd(),mee="The delay was aborted.";function gee(t,e){let n,{abortSignal:i,abortErrorMsg:r}=e??{};return(0,fee.createAbortablePromise)(o=>{n=setTimeout(o,t)},{cleanupBeforeAbort:()=>clearTimeout(n),abortSignal:i,abortErrorMsg:r??mee})}function _ee(t,e){let n=e.retryDelayInMs*Math.pow(2,t),i=Math.min(e.maxRetryDelayInMs,n);return{retryAfterInMs:i/2+(0,pee.getRandomIntegerInclusive)(0,i/2)}}});var OU=g(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});Ew.getErrorMessage=Eee;var yee=cd();function Eee(t){if((0,yee.isError)(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}});var NU=g(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.isDefined=Tw;ud.isObjectWithProperties=Tee;ud.objectHasProperty=RU;function Tw(t){return typeof t<"u"&&t!==null}function Tee(t,e){if(!Tw(t)||typeof t!="object")return!1;for(let n of e)if(!RU(t,n))return!1;return!0}function RU(t,e){return Tw(t)&&typeof t=="object"&&e in t}});var nr=g(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.isWebWorker=ge.isReactNative=ge.isNodeRuntime=ge.isNodeLike=ge.isNode=ge.isDeno=ge.isBun=ge.isBrowser=ge.objectHasProperty=ge.isObjectWithProperties=ge.isDefined=ge.getErrorMessage=ge.delay=ge.createAbortablePromise=ge.cancelablePromiseRace=void 0;ge.calculateRetryDelay=vee;ge.computeSha256Hash=bee;ge.computeSha256Hmac=Oee;ge.getRandomIntegerInclusive=Ree;ge.isError=Nee;ge.isObject=Pee;ge.randomUUID=Dee;ge.uint8ArrayToString=Mee;ge.stringToUint8Array=kee;var Aee=(un(),At(cn)),Vt=Aee.__importStar(cd()),Cee=IU();Object.defineProperty(ge,"cancelablePromiseRace",{enumerable:!0,get:function(){return Cee.cancelablePromiseRace}});var See=yw();Object.defineProperty(ge,"createAbortablePromise",{enumerable:!0,get:function(){return See.createAbortablePromise}});var wee=bU();Object.defineProperty(ge,"delay",{enumerable:!0,get:function(){return wee.delay}});var Iee=OU();Object.defineProperty(ge,"getErrorMessage",{enumerable:!0,get:function(){return Iee.getErrorMessage}});var Aw=NU();Object.defineProperty(ge,"isDefined",{enumerable:!0,get:function(){return Aw.isDefined}});Object.defineProperty(ge,"isObjectWithProperties",{enumerable:!0,get:function(){return Aw.isObjectWithProperties}});Object.defineProperty(ge,"objectHasProperty",{enumerable:!0,get:function(){return Aw.objectHasProperty}});function vee(t,e){return Vt.calculateRetryDelay(t,e)}function bee(t,e){return Vt.computeSha256Hash(t,e)}function Oee(t,e,n){return Vt.computeSha256Hmac(t,e,n)}function Ree(t,e){return Vt.getRandomIntegerInclusive(t,e)}function Nee(t){return Vt.isError(t)}function Pee(t){return Vt.isObject(t)}function Dee(){return Vt.randomUUID()}ge.isBrowser=Vt.isBrowser;ge.isBun=Vt.isBun;ge.isDeno=Vt.isDeno;ge.isNode=Vt.isNodeLike;ge.isNodeLike=Vt.isNodeLike;ge.isNodeRuntime=Vt.isNodeRuntime;ge.isReactNative=Vt.isReactNative;ge.isWebWorker=Vt.isWebWorker;function Mee(t,e){return Vt.uint8ArrayToString(t,e)}function kee(t,e){return Vt.stringToUint8Array(t,e)}});var PU=g(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.msalCommon=void 0;var Lee=(un(),At(cn)),Uee=Lee.__importStar(Wm());rg.msalCommon=Uee});var hd=g(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.defaultLoggerCallback=void 0;mn.ensureValidMsalToken=Fee;mn.getAuthorityHost=qee;mn.getAuthority=Hee;mn.getKnownAuthorities=Bee;mn.getMSALLogLevel=Yee;mn.randomUUID=Vee;mn.handleMsalError=$ee;mn.publicToMsal=zee;mn.msalToPublic=Gee;mn.serializeAuthenticationRecord=Wee;mn.deserializeAuthenticationRecord=Kee;var Cw=_t(),ld=He(),ig=Fr(),Sw=nr(),xee=gw(),vi=PU(),dd=(0,ld.credentialLogger)("IdentityUtils"),DU="1.0";function Fee(t,e,n){let i=r=>(dd.getToken.info(r),new Cw.AuthenticationRequiredError({scopes:Array.isArray(t)?t:[t],getTokenOptions:n,message:r}));if(!e)throw i("No response");if(!e.expiresOn)throw i('Response had no "expiresOn" property.');if(!e.accessToken)throw i('Response had no "accessToken" property.')}function qee(t){let e=t?.authorityHost;return!e&&Sw.isNodeLike&&(e=process.env.AZURE_AUTHORITY_HOST),e??ig.DefaultAuthorityHost}function Hee(t,e){return e||(e=ig.DefaultAuthorityHost),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}function Bee(t,e,n){return t==="adfs"&&e||n?[e]:[]}var jee=(t,e=Sw.isNode?"Node":"Browser")=>(n,i,r)=>{if(!r)switch(n){case vi.msalCommon.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${i}`);return;case vi.msalCommon.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${i}`);return;case vi.msalCommon.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${i}`);return;case vi.msalCommon.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${i}`);return}};mn.defaultLoggerCallback=jee;function Yee(t){switch(t){case"error":return vi.msalCommon.LogLevel.Error;case"info":return vi.msalCommon.LogLevel.Info;case"verbose":return vi.msalCommon.LogLevel.Verbose;case"warning":return vi.msalCommon.LogLevel.Warning;default:return vi.msalCommon.LogLevel.Info}}function Vee(){return(0,Sw.randomUUID)()}function $ee(t,e,n){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let i=e;switch(i.errorCode){case"endpoints_resolution_error":return dd.info((0,ld.formatError)(t,e.message)),new Cw.CredentialUnavailableError(e.message);case"device_code_polling_cancelled":return new xee.AbortError("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":dd.info((0,ld.formatError)(t,`Authentication returned errorCode ${i.errorCode}`));break;default:dd.info((0,ld.formatError)(t,`Failed to acquire token: ${e.message}`));break}}return e.name==="ClientConfigurationError"||e.name==="BrowserConfigurationAuthError"||e.name==="AbortError"||e.name==="AuthenticationError"?e:e.name==="NativeAuthError"?(dd.info((0,ld.formatError)(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new Cw.AuthenticationRequiredError({scopes:t,getTokenOptions:n,message:e.message})}function zee(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}function Gee(t,e){return{authority:e.environment??ig.DefaultAuthority,homeAccountId:e.homeAccountId,tenantId:e.tenantId||ig.DefaultTenantId,username:e.username,clientId:t,version:DU}}function Wee(t){return JSON.stringify(t)}function Kee(t){let e=JSON.parse(t);if(e.version&&e.version!==DU)throw Error("Unsupported AuthenticationRecord version");return e}});var ww=g(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.encodeString=Xee;Oa.encodeByteArray=Qee;Oa.decodeString=Zee;Oa.decodeStringToString=Jee;function Xee(t){return Buffer.from(t).toString("base64")}function Qee(t){return(t instanceof Buffer?t:Buffer.from(t.buffer)).toString("base64")}function Zee(t){return Buffer.from(t,"base64")}function Jee(t){return Buffer.from(t,"base64").toString()}});var fd=g(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.XML_CHARKEY=Ra.XML_ATTRKEY=void 0;Ra.XML_ATTRKEY="$";Ra.XML_CHARKEY="_"});var Iw=g(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.isPrimitiveBody=MU;Na.isDuration=tte;Na.isValidUuid=rte;Na.flattenResponse=ote;function MU(t,e){return e!=="Composite"&&e!=="Dictionary"&&(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)!==null||t===void 0||t===null)}var ete=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function tte(t){return ete.test(t)}var nte=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;function rte(t){return nte.test(t)}function ite(t){let e={...t.headers,...t.body};return t.hasNullableType&&Object.getOwnPropertyNames(e).length===0?t.shouldWrapBody?{body:null}:null:t.shouldWrapBody?{...t.headers,body:t.body}:e}function ote(t,e){let n=t.parsedHeaders;if(t.request.method==="HEAD")return{...n,body:t.parsedBody};let i=e&&e.bodyMapper,r=!!i?.nullable,o=i?.type.name;if(o==="Stream")return{...n,blobBody:t.blobBody,readableStreamBody:t.readableStreamBody};let s=o==="Composite"&&i.type.modelProperties||{},a=Object.keys(s).some(c=>s[c].serializedName==="");if(o==="Sequence"||a){let c=t.parsedBody??[];for(let u of Object.keys(s))s[u].serializedName&&(c[u]=t.parsedBody?.[u]);if(n)for(let u of Object.keys(n))c[u]=n[u];return r&&!t.parsedBody&&!n&&Object.getOwnPropertyNames(s).length===0?null:c}return ite({body:t.parsedBody,headers:n,hasNullableType:r,shouldWrapBody:MU(t.parsedBody,o)})}});var md=g(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.MapperTypeNames=void 0;pd.createSerializer=ate;var ste=(un(),At(cn)),sg=ste.__importStar(ww()),Dt=fd(),LU=Iw(),vw=class{modelMappers;isXML;constructor(e={},n=!1){this.modelMappers=e,this.isXML=n}validateConstraints(e,n,i){let r=(o,s)=>{throw new Error(`"${i}" with value "${n}" should satisfy the constraint "${o}": ${s}.`)};if(e.constraints&&n!==void 0&&n!==null){let{ExclusiveMaximum:o,ExclusiveMinimum:s,InclusiveMaximum:a,InclusiveMinimum:c,MaxItems:u,MaxLength:l,MinItems:d,MinLength:f,MultipleOf:m,Pattern:_,UniqueItems:E}=e.constraints;if(o!==void 0&&n>=o&&r("ExclusiveMaximum",o),s!==void 0&&n<=s&&r("ExclusiveMinimum",s),a!==void 0&&n>a&&r("InclusiveMaximum",a),c!==void 0&&n<c&&r("InclusiveMinimum",c),u!==void 0&&n.length>u&&r("MaxItems",u),l!==void 0&&n.length>l&&r("MaxLength",l),d!==void 0&&n.length<d&&r("MinItems",d),f!==void 0&&n.length<f&&r("MinLength",f),m!==void 0&&n%m!==0&&r("MultipleOf",m),_){let I=typeof _=="string"?new RegExp(_):_;(typeof n!="string"||n.match(I)===null)&&r("Pattern",_)}E&&n.some((I,y,A)=>A.indexOf(I)!==y)&&r("UniqueItems",E)}}serialize(e,n,i,r={xml:{}}){let o={xml:{rootName:r.xml.rootName??"",includeRoot:r.xml.includeRoot??!1,xmlCharKey:r.xml.xmlCharKey??Dt.XML_CHARKEY}},s={},a=e.type.name;i||(i=e.serializedName),a.match(/^Sequence$/i)!==null&&(s=[]),e.isConstant&&(n=e.defaultValue);let{required:c,nullable:u}=e;if(c&&u&&n===void 0)throw new Error(`${i} cannot be undefined.`);if(c&&!u&&n==null)throw new Error(`${i} cannot be null or undefined.`);if(!c&&u===!1&&n===null)throw new Error(`${i} cannot be null.`);return n==null||a.match(/^any$/i)!==null?s=n:a.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i)!==null?s=fte(a,i,n):a.match(/^Enum$/i)!==null?s=pte(i,e.type.allowedValues,n):a.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)!==null?s=_te(a,n,i):a.match(/^ByteArray$/i)!==null?s=mte(i,n):a.match(/^Base64Url$/i)!==null?s=gte(i,n):a.match(/^Sequence$/i)!==null?s=yte(this,e,n,i,!!this.isXML,o):a.match(/^Dictionary$/i)!==null?s=Ete(this,e,n,i,!!this.isXML,o):a.match(/^Composite$/i)!==null&&(s=Ate(this,e,n,i,!!this.isXML,o)),s}deserialize(e,n,i,r={xml:{}}){let o={xml:{rootName:r.xml.rootName??"",includeRoot:r.xml.includeRoot??!1,xmlCharKey:r.xml.xmlCharKey??Dt.XML_CHARKEY},ignoreUnknownProperties:r.ignoreUnknownProperties??!1};if(n==null)return this.isXML&&e.type.name==="Sequence"&&!e.xmlIsWrapped&&(n=[]),e.defaultValue!==void 0&&(n=e.defaultValue),n;let s,a=e.type.name;if(i||(i=e.serializedName),a.match(/^Composite$/i)!==null)s=Ste(this,e,n,i,o);else{if(this.isXML){let c=o.xml.xmlCharKey;n[Dt.XML_ATTRKEY]!==void 0&&n[c]!==void 0&&(n=n[c])}a.match(/^Number$/i)!==null?(s=parseFloat(n),isNaN(s)&&(s=n)):a.match(/^Boolean$/i)!==null?n==="true"?s=!0:n==="false"?s=!1:s=n:a.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)!==null?s=n:a.match(/^(Date|DateTime|DateTimeRfc1123)$/i)!==null?s=new Date(n):a.match(/^UnixTime$/i)!==null?s=hte(n):a.match(/^ByteArray$/i)!==null?s=sg.decodeString(n):a.match(/^Base64Url$/i)!==null?s=lte(n):a.match(/^Sequence$/i)!==null?s=Ite(this,e,n,i,o):a.match(/^Dictionary$/i)!==null&&(s=wte(this,e,n,i,o))}return e.isConstant&&(s=e.defaultValue),s}};function ate(t={},e=!1){return new vw(t,e)}function cte(t,e){let n=t.length;for(;n-1>=0&&t[n-1]===e;)--n;return t.substr(0,n)}function ute(t){if(!t)return;if(!(t instanceof Uint8Array))throw new Error("Please provide an input of type Uint8Array for converting to Base64Url.");let e=sg.encodeByteArray(t);return cte(e,"=").replace(/\+/g,"-").replace(/\//g,"_")}function lte(t){if(t){if(t&&typeof t.valueOf()!="string")throw new Error("Please provide an input of type string for converting to Uint8Array");return t=t.replace(/-/g,"+").replace(/_/g,"/"),sg.decodeString(t)}}function bw(t){let e=[],n="";if(t){let i=t.split(".");for(let r of i)r.charAt(r.length-1)==="\\"?n+=r.substr(0,r.length-1)+".":(n+=r,e.push(n),n="")}return e}function dte(t){if(t)return typeof t.valueOf()=="string"&&(t=new Date(t)),Math.floor(t.getTime()/1e3)}function hte(t){if(t)return new Date(t*1e3)}function fte(t,e,n){if(n!=null){if(t.match(/^Number$/i)!==null){if(typeof n!="number")throw new Error(`${e} with value ${n} must be of type number.`)}else if(t.match(/^String$/i)!==null){if(typeof n.valueOf()!="string")throw new Error(`${e} with value "${n}" must be of type string.`)}else if(t.match(/^Uuid$/i)!==null){if(!(typeof n.valueOf()=="string"&&(0,LU.isValidUuid)(n)))throw new Error(`${e} with value "${n}" must be of type string and a valid uuid.`)}else if(t.match(/^Boolean$/i)!==null){if(typeof n!="boolean")throw new Error(`${e} with value ${n} must be of type boolean.`)}else if(t.match(/^Stream$/i)!==null){let i=typeof n;if(i!=="string"&&typeof n.pipe!="function"&&typeof n.tee!="function"&&!(n instanceof ArrayBuffer)&&!ArrayBuffer.isView(n)&&!((typeof Blob=="function"||typeof Blob=="object")&&n instanceof Blob)&&i!=="function")throw new Error(`${e} must be a string, Blob, ArrayBuffer, ArrayBufferView, ReadableStream, or () => ReadableStream.`)}}return n}function pte(t,e,n){if(!e)throw new Error(`Please provide a set of allowedValues to validate ${t} as an Enum Type.`);if(!e.some(r=>typeof r.valueOf()=="string"?r.toLowerCase()===n.toLowerCase():r===n))throw new Error(`${n} is not a valid value for ${t}. The valid values are: ${JSON.stringify(e)}.`);return n}function mte(t,e){if(e!=null){if(!(e instanceof Uint8Array))throw new Error(`${t} must be of type Uint8Array.`);e=sg.encodeByteArray(e)}return e}function gte(t,e){if(e!=null){if(!(e instanceof Uint8Array))throw new Error(`${t} must be of type Uint8Array.`);e=ute(e)}return e}function _te(t,e,n){if(e!=null){if(t.match(/^Date$/i)!==null){if(!(e instanceof Date||typeof e.valueOf()=="string"&&!isNaN(Date.parse(e))))throw new Error(`${n} must be an instanceof Date or a string in ISO8601 format.`);e=e instanceof Date?e.toISOString().substring(0,10):new Date(e).toISOString().substring(0,10)}else if(t.match(/^DateTime$/i)!==null){if(!(e instanceof Date||typeof e.valueOf()=="string"&&!isNaN(Date.parse(e))))throw new Error(`${n} must be an instanceof Date or a string in ISO8601 format.`);e=e instanceof Date?e.toISOString():new Date(e).toISOString()}else if(t.match(/^DateTimeRfc1123$/i)!==null){if(!(e instanceof Date||typeof e.valueOf()=="string"&&!isNaN(Date.parse(e))))throw new Error(`${n} must be an instanceof Date or a string in RFC-1123 format.`);e=e instanceof Date?e.toUTCString():new Date(e).toUTCString()}else if(t.match(/^UnixTime$/i)!==null){if(!(e instanceof Date||typeof e.valueOf()=="string"&&!isNaN(Date.parse(e))))throw new Error(`${n} must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.`);e=dte(e)}else if(t.match(/^TimeSpan$/i)!==null&&!(0,LU.isDuration)(e))throw new Error(`${n} must be a string in ISO 8601 format. Instead was "${e}".`)}return e}function yte(t,e,n,i,r,o){if(!Array.isArray(n))throw new Error(`${i} must be of type Array.`);let s=e.type.element;if(!s||typeof s!="object")throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${i}.`);s.type.name==="Composite"&&s.type.className&&(s=t.modelMappers[s.type.className]??s);let a=[];for(let c=0;c<n.length;c++){let u=t.serialize(s,n[c],i,o);if(r&&s.xmlNamespace){let l=s.xmlNamespacePrefix?`xmlns:${s.xmlNamespacePrefix}`:"xmlns";s.type.name==="Composite"?(a[c]={...u},a[c][Dt.XML_ATTRKEY]={[l]:s.xmlNamespace}):(a[c]={},a[c][o.xml.xmlCharKey]=u,a[c][Dt.XML_ATTRKEY]={[l]:s.xmlNamespace})}else a[c]=u}return a}function Ete(t,e,n,i,r,o){if(typeof n!="object")throw new Error(`${i} must be of type object.`);let s=e.type.value;if(!s||typeof s!="object")throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${i}.`);let a={};for(let c of Object.keys(n)){let u=t.serialize(s,n[c],i,o);a[c]=FU(s,u,r,o)}if(r&&e.xmlNamespace){let c=e.xmlNamespacePrefix?`xmlns:${e.xmlNamespacePrefix}`:"xmlns",u=a;return u[Dt.XML_ATTRKEY]={[c]:e.xmlNamespace},u}return a}function Tte(t,e,n){let i=e.type.additionalProperties;return!i&&e.type.className?UU(t,e,n)?.type.additionalProperties:i}function UU(t,e,n){let i=e.type.className;if(!i)throw new Error(`Class name for model "${n}" is not provided in the mapper "${JSON.stringify(e,void 0,2)}".`);return t.modelMappers[i]}function xU(t,e,n){let i=e.type.modelProperties;if(!i){let r=UU(t,e,n);if(!r)throw new Error(`mapper() cannot be null or undefined for model "${e.type.className}".`);if(i=r?.type.modelProperties,!i)throw new Error(`modelProperties cannot be null or undefined in the mapper "${JSON.stringify(r)}" of type "${e.type.className}" for object "${n}".`)}return i}function Ate(t,e,n,i,r,o){if(og(t,e)&&(e=qU(t,e,n,"clientName")),n!=null){let s={},a=xU(t,e,i);for(let u of Object.keys(a)){let l=a[u];if(l.readOnly)continue;let d,f=s;if(t.isXML)l.xmlIsWrapped?d=l.xmlName:d=l.xmlElementName||l.xmlName;else{let m=bw(l.serializedName);d=m.pop();for(let _ of m){let E=f[_];E==null&&(n[u]!==void 0&&n[u]!==null||l.defaultValue!==void 0)&&(f[_]={}),f=f[_]}}if(f!=null){if(r&&e.xmlNamespace){let y=e.xmlNamespacePrefix?`xmlns:${e.xmlNamespacePrefix}`:"xmlns";f[Dt.XML_ATTRKEY]={...f[Dt.XML_ATTRKEY],[y]:e.xmlNamespace}}let m=l.serializedName!==""?i+"."+l.serializedName:i,_=n[u],E=og(t,e);E&&E.clientName===u&&_==null&&(_=e.serializedName);let I=t.serialize(l,_,m,o);if(I!==void 0&&d!==void 0&&d!==null){let y=FU(l,I,r,o);r&&l.xmlIsAttribute?(f[Dt.XML_ATTRKEY]=f[Dt.XML_ATTRKEY]||{},f[Dt.XML_ATTRKEY][d]=I):r&&l.xmlIsWrapped?f[d]={[l.xmlElementName]:y}:f[d]=y}}}let c=Tte(t,e,i);if(c){let u=Object.keys(a);for(let l in n)u.every(f=>f!==l)&&(s[l]=t.serialize(c,n[l],i+'["'+l+'"]',o))}return s}return n}function FU(t,e,n,i){if(!n||!t.xmlNamespace)return e;let o={[t.xmlNamespacePrefix?`xmlns:${t.xmlNamespacePrefix}`:"xmlns"]:t.xmlNamespace};if(["Composite"].includes(t.type.name)){if(e[Dt.XML_ATTRKEY])return e;{let a={...e};return a[Dt.XML_ATTRKEY]=o,a}}let s={};return s[i.xml.xmlCharKey]=e,s[Dt.XML_ATTRKEY]=o,s}function Cte(t,e){return[Dt.XML_ATTRKEY,e.xml.xmlCharKey].includes(t)}function Ste(t,e,n,i,r){let o=r.xml.xmlCharKey??Dt.XML_CHARKEY;og(t,e)&&(e=qU(t,e,n,"serializedName"));let s=xU(t,e,i),a={},c=[];for(let l of Object.keys(s)){let d=s[l],f=bw(s[l].serializedName);c.push(f[0]);let{serializedName:m,xmlName:_,xmlElementName:E}=d,I=i;m!==""&&m!==void 0&&(I=i+"."+m);let y=d.headerCollectionPrefix;if(y){let A={};for(let S of Object.keys(n))S.startsWith(y)&&(A[S.substring(y.length)]=t.deserialize(d.type.value,n[S],I,r)),c.push(S);a[l]=A}else if(t.isXML)if(d.xmlIsAttribute&&n[Dt.XML_ATTRKEY])a[l]=t.deserialize(d,n[Dt.XML_ATTRKEY][_],I,r);else if(d.xmlIsMsText)n[o]!==void 0?a[l]=n[o]:typeof n=="string"&&(a[l]=n);else{let A=E||_||m;if(d.xmlIsWrapped){let w=n[_]?.[E]??[];a[l]=t.deserialize(d,w,I,r),c.push(_)}else{let S=n[A];a[l]=t.deserialize(d,S,I,r),c.push(A)}}else{let A,S=n,w=0;for(let R of f){if(!S)break;w++,S=S[R]}S===null&&w<f.length&&(S=void 0),A=S;let N=e.type.polymorphicDiscriminator;N&&l===N.clientName&&A==null&&(A=e.serializedName);let W;if(Array.isArray(n[l])&&s[l].serializedName===""){A=n[l];let R=t.deserialize(d,A,I,r);for(let[L,b]of Object.entries(a))Object.prototype.hasOwnProperty.call(R,L)||(R[L]=b);a=R}else(A!==void 0||d.defaultValue!==void 0)&&(W=t.deserialize(d,A,I,r),a[l]=W)}}let u=e.type.additionalProperties;if(u){let l=d=>{for(let f in s)if(bw(s[f].serializedName)[0]===d)return!1;return!0};for(let d in n)l(d)&&(a[d]=t.deserialize(u,n[d],i+'["'+d+'"]',r))}else if(n&&!r.ignoreUnknownProperties)for(let l of Object.keys(n))a[l]===void 0&&!c.includes(l)&&!Cte(l,r)&&(a[l]=n[l]);return a}function wte(t,e,n,i,r){let o=e.type.value;if(!o||typeof o!="object")throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${i}`);if(n){let s={};for(let a of Object.keys(n))s[a]=t.deserialize(o,n[a],i,r);return s}return n}function Ite(t,e,n,i,r){let o=e.type.element;if(!o||typeof o!="object")throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${i}`);if(n){Array.isArray(n)||(n=[n]),o.type.name==="Composite"&&o.type.className&&(o=t.modelMappers[o.type.className]??o);let s=[];for(let a=0;a<n.length;a++)s[a]=t.deserialize(o,n[a],`${i}[${a}]`,r);return s}return n}function vte(t,e,n){let i=[n];for(;i.length;){let r=i.shift(),o=e===r?e:r+"."+e;if(Object.prototype.hasOwnProperty.call(t,o))return t[o];for(let[s,a]of Object.entries(t))s.startsWith(r+".")&&a.type.uberParent===r&&a.type.className&&i.push(a.type.className)}}function qU(t,e,n,i){let r=og(t,e);if(r){let o=r[i];if(o){i==="serializedName"&&(o=o.replace(/\\/gi,""));let s=n[o],a=e.type.uberParent??e.type.className;if(typeof s=="string"&&a){let c=vte(t.modelMappers.discriminators,s,a);c&&(e=c)}}}return e}function og(t,e){return e.type.polymorphicDiscriminator||kU(t,e.type.uberParent)||kU(t,e.type.className)}function kU(t,e){return e&&t.modelMappers[e]&&t.modelMappers[e].type.polymorphicDiscriminator}pd.MapperTypeNames={Base64Url:"Base64Url",Boolean:"Boolean",ByteArray:"ByteArray",Composite:"Composite",Date:"Date",DateTime:"DateTime",DateTimeRfc1123:"DateTimeRfc1123",Dictionary:"Dictionary",Enum:"Enum",Number:"Number",Object:"Object",Sequence:"Sequence",String:"String",Stream:"Stream",TimeSpan:"TimeSpan",UnixTime:"UnixTime"}});var gd=g(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:!0});ag.AbortError=void 0;var Ow=class extends Error{constructor(e){super(e),this.name="AbortError"}};ag.AbortError=Ow});var ro=g(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});Nw.createHttpHeaders=Ote;function cg(t){return t.toLowerCase()}function*bte(t){for(let e of t.values())yield[e.name,e.value]}var Rw=class{_headersMap;constructor(e){if(this._headersMap=new Map,e)for(let n of Object.keys(e))this.set(n,e[n])}set(e,n){this._headersMap.set(cg(e),{name:e,value:String(n).trim()})}get(e){return this._headersMap.get(cg(e))?.value}has(e){return this._headersMap.has(cg(e))}delete(e){this._headersMap.delete(cg(e))}toJSON(e={}){let n={};if(e.preserveCase)for(let i of this._headersMap.values())n[i.name]=i.value;else for(let[i,r]of this._headersMap)n[i]=r.value;return n}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return bte(this._headersMap)}};function Ote(t){return new Rw(t)}});var BU=g(HU=>{"use strict";Object.defineProperty(HU,"__esModule",{value:!0})});var YU=g(jU=>{"use strict";Object.defineProperty(jU,"__esModule",{value:!0})});var Mw=g(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});Dw.createPipelineRequest=Pte;var Rte=ro(),Nte=Qm(),Pw=class{url;method;headers;timeout;withCredentials;body;multipartBody;formData;streamResponseStatusCodes;enableBrowserStreams;proxySettings;disableKeepAlive;abortSignal;requestId;allowInsecureConnection;onUploadProgress;onDownloadProgress;requestOverrides;authSchemes;constructor(e){this.url=e.url,this.body=e.body,this.headers=e.headers??(0,Rte.createHttpHeaders)(),this.method=e.method??"GET",this.timeout=e.timeout??0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=e.disableKeepAlive??!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=e.withCredentials??!1,this.abortSignal=e.abortSignal,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||(0,Nte.randomUUID)(),this.allowInsecureConnection=e.allowInsecureConnection??!1,this.enableBrowserStreams=e.enableBrowserStreams??!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function Pte(t){return new Pw(t)}});var Uw=g(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});Lw.createEmptyPipeline=Dte;var VU=new Set(["Deserialize","Serialize","Retry","Sign"]),kw=class t{_policies=[];_orderedPolicies;constructor(e){this._policies=e?.slice(0)??[],this._orderedPolicies=void 0}addPolicy(e,n={}){if(n.phase&&n.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(n.phase&&!VU.has(n.phase))throw new Error(`Invalid phase name: ${n.phase}`);if(n.afterPhase&&!VU.has(n.afterPhase))throw new Error(`Invalid afterPhase name: ${n.afterPhase}`);this._policies.push({policy:e,options:n}),this._orderedPolicies=void 0}removePolicy(e){let n=[];return this._policies=this._policies.filter(i=>e.name&&i.policy.name===e.name||e.phase&&i.options.phase===e.phase?(n.push(i.policy),!1):!0),this._orderedPolicies=void 0,n}sendRequest(e,n){return this.getOrderedPolicies().reduceRight((o,s)=>a=>s.sendRequest(a,o),o=>e.sendRequest(o))(n)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],n=new Map;function i(_){return{name:_,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}let r=i("Serialize"),o=i("None"),s=i("Deserialize"),a=i("Retry"),c=i("Sign"),u=[r,o,s,a,c];function l(_){return _==="Retry"?a:_==="Serialize"?r:_==="Deserialize"?s:_==="Sign"?c:o}for(let _ of this._policies){let E=_.policy,I=_.options,y=E.name;if(n.has(y))throw new Error("Duplicate policy names not allowed in pipeline");let A={policy:E,dependsOn:new Set,dependants:new Set};I.afterPhase&&(A.afterPhase=l(I.afterPhase),A.afterPhase.hasAfterPolicies=!0),n.set(y,A),l(I.phase).policies.add(A)}for(let _ of this._policies){let{policy:E,options:I}=_,y=E.name,A=n.get(y);if(!A)throw new Error(`Missing node for policy ${y}`);if(I.afterPolicies)for(let S of I.afterPolicies){let w=n.get(S);w&&(A.dependsOn.add(w),w.dependants.add(A))}if(I.beforePolicies)for(let S of I.beforePolicies){let w=n.get(S);w&&(w.dependsOn.add(A),A.dependants.add(w))}}function d(_){_.hasRun=!0;for(let E of _.policies)if(!(E.afterPhase&&(!E.afterPhase.hasRun||E.afterPhase.policies.size))&&E.dependsOn.size===0){e.push(E.policy);for(let I of E.dependants)I.dependsOn.delete(E);n.delete(E.policy.name),_.policies.delete(E)}}function f(){for(let _ of u){if(d(_),_.policies.size>0&&_!==o){o.hasRun||d(o);return}_.hasAfterPolicies&&d(o)}}let m=0;for(;n.size>0;){m++;let _=e.length;if(f(),e.length<=_&&m>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function Dte(){return kw.create()}});var $U=g(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});ug.custom=void 0;var Mte=x("util");ug.custom=Mte.inspect.custom});var Pa=g(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.RestError=void 0;_d.isRestError=Fte;var kte=lw(),Lte=$U(),Ute=ad(),xte=new Ute.Sanitizer,lg=class t extends Error{static REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";static PARSE_ERROR="PARSE_ERROR";code;statusCode;request;response;details;constructor(e,n={}){super(e),this.name="RestError",this.code=n.code,this.statusCode=n.statusCode,Object.defineProperty(this,"request",{value:n.request,enumerable:!1}),Object.defineProperty(this,"response",{value:n.response,enumerable:!1});let i=this.request?.agent?{maxFreeSockets:this.request.agent.maxFreeSockets,maxSockets:this.request.agent.maxSockets}:void 0;Object.defineProperty(this,Lte.custom,{value:()=>`RestError: ${this.message}
|
|
40
|
+
${xte.sanitize({...this,request:{...this.request,agent:i},response:this.response})}`,enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};_d.RestError=lg;function Fte(t){return t instanceof lg?!0:(0,kte.isError)(t)&&t.name==="RestError"}});var yd=g(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});dg.logger=void 0;var qte=nu();dg.logger=(0,qte.createClientLogger)("ts-http-runtime")});var QU=g(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:!0});fg.getBodyLength=XU;fg.createNodeHttpClient=Gte;var Hw=(un(),At(cn)),xw=Hw.__importDefault(x("http")),Fw=Hw.__importDefault(x("https")),zU=Hw.__importDefault(x("zlib")),Hte=x("stream"),GU=gd(),Bte=ro(),Td=Pa(),Da=yd(),jte=ad(),Yte={};function Ed(t){return t&&typeof t.pipe=="function"}function WU(t){return t.readable===!1?Promise.resolve():new Promise(e=>{let n=()=>{e(),t.removeListener("close",n),t.removeListener("end",n),t.removeListener("error",n)};t.on("close",n),t.on("end",n),t.on("error",n)})}function KU(t){return t&&typeof t.byteLength=="number"}var hg=class extends Hte.Transform{loadedBytes=0;progressCallback;_transform(e,n,i){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),i()}catch(r){i(r)}}constructor(e){super(),this.progressCallback=e}},qw=class{cachedHttpAgent;cachedHttpsAgents=new WeakMap;async sendRequest(e){let n=new AbortController,i;if(e.abortSignal){if(e.abortSignal.aborted)throw new GU.AbortError("The operation was aborted. Request has already been canceled.");i=u=>{u.type==="abort"&&n.abort()},e.abortSignal.addEventListener("abort",i)}let r;e.timeout>0&&(r=setTimeout(()=>{let u=new jte.Sanitizer;Da.logger.info(`request to '${u.sanitizeUrl(e.url)}' timed out. canceling...`),n.abort()},e.timeout));let o=e.headers.get("Accept-Encoding"),s=o?.includes("gzip")||o?.includes("deflate"),a=typeof e.body=="function"?e.body():e.body;if(a&&!e.headers.has("Content-Length")){let u=XU(a);u!==null&&e.headers.set("Content-Length",u)}let c;try{if(a&&e.onUploadProgress){let _=e.onUploadProgress,E=new hg(_);E.on("error",I=>{Da.logger.error("Error in upload progress",I)}),Ed(a)?a.pipe(E):E.end(a),a=E}let u=await this.makeRequest(e,n,a);r!==void 0&&clearTimeout(r);let l=Vte(u),f={status:u.statusCode??0,headers:l,request:e};if(e.method==="HEAD")return u.resume(),f;c=s?$te(u,l):u;let m=e.onDownloadProgress;if(m){let _=new hg(m);_.on("error",E=>{Da.logger.error("Error in download progress",E)}),c.pipe(_),c=_}return e.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY)||e.streamResponseStatusCodes?.has(f.status)?f.readableStreamBody=c:f.bodyAsText=await zte(c),f}finally{if(e.abortSignal&&i){let u=Promise.resolve();Ed(a)&&(u=WU(a));let l=Promise.resolve();Ed(c)&&(l=WU(c)),Promise.all([u,l]).then(()=>{i&&e.abortSignal?.removeEventListener("abort",i)}).catch(d=>{Da.logger.warning("Error when cleaning up abortListener on httpRequest",d)})}}}makeRequest(e,n,i){let r=new URL(e.url),o=r.protocol!=="https:";if(o&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let a={agent:e.agent??this.getOrCreateAgent(e,o),hostname:r.hostname,path:`${r.pathname}${r.search}`,port:r.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0}),...e.requestOverrides};return new Promise((c,u)=>{let l=o?xw.default.request(a,c):Fw.default.request(a,c);l.once("error",d=>{u(new Td.RestError(d.message,{code:d.code??Td.RestError.REQUEST_SEND_ERROR,request:e}))}),n.signal.addEventListener("abort",()=>{let d=new GU.AbortError("The operation was aborted. Rejecting from abort signal callback while making request.");l.destroy(d),u(d)}),i&&Ed(i)?i.pipe(l):i?typeof i=="string"||Buffer.isBuffer(i)?l.end(i):KU(i)?l.end(ArrayBuffer.isView(i)?Buffer.from(i.buffer):Buffer.from(i)):(Da.logger.error("Unrecognized body type",i),u(new Td.RestError("Unrecognized body type"))):l.end()})}getOrCreateAgent(e,n){let i=e.disableKeepAlive;if(n)return i?xw.default.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new xw.default.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(i&&!e.tlsSettings)return Fw.default.globalAgent;let r=e.tlsSettings??Yte,o=this.cachedHttpsAgents.get(r);return o&&o.options.keepAlive===!i||(Da.logger.info("No cached TLS Agent exist, creating a new Agent"),o=new Fw.default.Agent({keepAlive:!i,...r}),this.cachedHttpsAgents.set(r,o)),o}}};function Vte(t){let e=(0,Bte.createHttpHeaders)();for(let n of Object.keys(t.headers)){let i=t.headers[n];Array.isArray(i)?i.length>0&&e.set(n,i[0]):i&&e.set(n,i)}return e}function $te(t,e){let n=e.get("Content-Encoding");if(n==="gzip"){let i=zU.default.createGunzip();return t.pipe(i),i}else if(n==="deflate"){let i=zU.default.createInflate();return t.pipe(i),i}return t}function zte(t){return new Promise((e,n)=>{let i=[];t.on("data",r=>{Buffer.isBuffer(r)?i.push(r):i.push(Buffer.from(r))}),t.on("end",()=>{e(Buffer.concat(i).toString("utf8"))}),t.on("error",r=>{r&&r?.name==="AbortError"?n(r):n(new Td.RestError(`Error reading response as text: ${r.message}`,{code:Td.RestError.PARSE_ERROR}))})})}function XU(t){return t?Buffer.isBuffer(t)?t.length:Ed(t)?null:KU(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}function Gte(){return new qw}});var jw=g(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});Bw.createDefaultHttpClient=Kte;var Wte=QU();function Kte(){return(0,Wte.createNodeHttpClient)()}});var Yw=g(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.logPolicyName=void 0;Ma.logPolicy=Zte;var Xte=yd(),Qte=ad();Ma.logPolicyName="logPolicy";function Zte(t={}){let e=t.logger??Xte.logger.info,n=new Qte.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:Ma.logPolicyName,async sendRequest(i,r){if(!e.enabled)return r(i);e(`Request: ${n.sanitize(i)}`);let o=await r(i);return e(`Response status code: ${o.status}`),e(`Headers: ${n.sanitize(o.headers)}`),o}}}});var Vw=g(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.redirectPolicyName=void 0;ka.redirectPolicy=Jte;ka.redirectPolicyName="redirectPolicy";var ZU=["GET","HEAD"];function Jte(t={}){let{maxRetries:e=20}=t;return{name:ka.redirectPolicyName,async sendRequest(n,i){let r=await i(n);return JU(i,r,e)}}}async function JU(t,e,n,i=0){let{request:r,status:o,headers:s}=e,a=s.get("location");if(a&&(o===300||o===301&&ZU.includes(r.method)||o===302&&ZU.includes(r.method)||o===303&&r.method==="POST"||o===307)&&i<n){let c=new URL(a,r.url);r.url=c.toString(),o===303&&(r.method="GET",r.headers.delete("Content-Length"),delete r.body),r.headers.delete("Authorization");let u=await t(r);return JU(t,u,n,i+1)}return e}});var tx=g(pg=>{"use strict";Object.defineProperty(pg,"__esModule",{value:!0});pg.getHeaderName=ene;pg.setPlatformSpecificData=tne;var ex=(un(),At(cn)),$w=ex.__importDefault(x("os")),zw=ex.__importDefault(x("process"));function ene(){return"User-Agent"}async function tne(t){if(zw.default&&zw.default.versions){let e=`${$w.default.type()} ${$w.default.release()}; ${$w.default.arch()}`,n=zw.default.versions;n.bun?t.set("Bun",`${n.bun} (${e})`):n.deno?t.set("Deno",`${n.deno} (${e})`):n.node&&t.set("Node",`${n.node} (${e})`)}}});var $o=g(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.DEFAULT_RETRY_POLICY_COUNT=La.SDK_VERSION=void 0;La.SDK_VERSION="0.3.2";La.DEFAULT_RETRY_POLICY_COUNT=3});var rx=g(mg=>{"use strict";Object.defineProperty(mg,"__esModule",{value:!0});mg.getUserAgentHeaderName=ine;mg.getUserAgentValue=one;var nx=tx(),nne=$o();function rne(t){let e=[];for(let[n,i]of t){let r=i?`${n}/${i}`:n;e.push(r)}return e.join(" ")}function ine(){return(0,nx.getHeaderName)()}async function one(t){let e=new Map;e.set("ts-http-runtime",nne.SDK_VERSION),await(0,nx.setPlatformSpecificData)(e);let n=rne(e);return t?`${t} ${n}`:n}});var Gw=g(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.userAgentPolicyName=void 0;Ua.userAgentPolicy=sne;var ox=rx(),ix=(0,ox.getUserAgentHeaderName)();Ua.userAgentPolicyName="userAgentPolicy";function sne(t={}){let e=(0,ox.getUserAgentValue)(t.userAgentPrefix);return{name:Ua.userAgentPolicyName,async sendRequest(n,i){return n.headers.has(ix)||n.headers.set(ix,await e),i(n)}}}});var Ww=g(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.decompressResponsePolicyName=void 0;xa.decompressResponsePolicy=ane;xa.decompressResponsePolicyName="decompressResponsePolicy";function ane(){return{name:xa.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}});var Kw=g(gg=>{"use strict";Object.defineProperty(gg,"__esModule",{value:!0});gg.delay=lne;gg.parseHeaderValueAsNumber=dne;var cne=gd(),une="The operation was aborted.";function lne(t,e,n){return new Promise((i,r)=>{let o,s,a=()=>r(new cne.AbortError(n?.abortErrorMsg?n?.abortErrorMsg:une)),c=()=>{n?.abortSignal&&s&&n.abortSignal.removeEventListener("abort",s)};if(s=()=>(o&&clearTimeout(o),c(),a()),n?.abortSignal&&n.abortSignal.aborted)return a();o=setTimeout(()=>{c(),i(e)},t),n?.abortSignal&&n.abortSignal.addEventListener("abort",s)})}function dne(t,e){let n=t.headers.get(e);if(!n)return;let i=Number(n);if(!Number.isNaN(i))return i}});var yg=g(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:!0});_g.isThrottlingRetryResponse=pne;_g.throttlingRetryStrategy=mne;var hne=Kw(),Xw="Retry-After",fne=["retry-after-ms","x-ms-retry-after-ms",Xw];function sx(t){if(t&&[429,503].includes(t.status))try{for(let r of fne){let o=(0,hne.parseHeaderValueAsNumber)(t,r);if(o===0||o)return o*(r===Xw?1e3:1)}let e=t.headers.get(Xw);if(!e)return;let i=Date.parse(e)-Date.now();return Number.isFinite(i)?Math.max(0,i):void 0}catch{return}}function pne(t){return Number.isFinite(sx(t))}function mne(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=sx(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}});var Eg=g(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.exponentialRetryStrategy=Tne;Ad.isExponentialRetryResponse=ax;Ad.isSystemError=cx;var gne=aw(),_ne=yg(),yne=1e3,Ene=1e3*64;function Tne(t={}){let e=t.retryDelayInMs??yne,n=t.maxRetryDelayInMs??Ene;return{name:"exponentialRetryStrategy",retry({retryCount:i,response:r,responseError:o}){let s=cx(o),a=s&&t.ignoreSystemErrors,c=ax(r),u=c&&t.ignoreHttpStatusCodes;return r&&((0,_ne.isThrottlingRetryResponse)(r)||!c)||u||a?{skipStrategy:!0}:o&&!s&&!c?{errorToThrow:o}:(0,gne.calculateRetryDelay)(i,{retryDelayInMs:e,maxRetryDelayInMs:n})}}}function ax(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}function cx(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}});var Fa=g(Qw=>{"use strict";Object.defineProperty(Qw,"__esModule",{value:!0});Qw.retryPolicy=vne;var Ane=Kw(),Cne=gd(),Sne=nu(),ux=$o(),wne=(0,Sne.createClientLogger)("ts-http-runtime retryPolicy"),Ine="retryPolicy";function vne(t,e={maxRetries:ux.DEFAULT_RETRY_POLICY_COUNT}){let n=e.logger||wne;return{name:Ine,async sendRequest(i,r){let o,s,a=-1;e:for(;;){a+=1,o=void 0,s=void 0;try{n.info(`Retry ${a}: Attempting to send request`,i.requestId),o=await r(i),n.info(`Retry ${a}: Received a response from request`,i.requestId)}catch(c){if(n.error(`Retry ${a}: Received an error from request`,i.requestId),s=c,!c||s.name!=="RestError")throw c;o=s.response}if(i.abortSignal?.aborted)throw n.error(`Retry ${a}: Request aborted.`),new Cne.AbortError;if(a>=(e.maxRetries??ux.DEFAULT_RETRY_POLICY_COUNT)){if(n.info(`Retry ${a}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),s)throw s;if(o)return o;throw new Error("Maximum retries reached with no response or error to throw")}n.info(`Retry ${a}: Processing ${t.length} retry strategies.`);t:for(let c of t){let u=c.logger||n;u.info(`Retry ${a}: Processing retry strategy ${c.name}.`);let l=c.retry({retryCount:a,response:o,responseError:s});if(l.skipStrategy){u.info(`Retry ${a}: Skipped.`);continue t}let{errorToThrow:d,retryAfterInMs:f,redirectTo:m}=l;if(d)throw u.error(`Retry ${a}: Retry strategy ${c.name} throws error:`,d),d;if(f||f===0){u.info(`Retry ${a}: Retry strategy ${c.name} retries after ${f}`),await(0,Ane.delay)(f,void 0,{abortSignal:i.abortSignal});continue e}if(m){u.info(`Retry ${a}: Retry strategy ${c.name} redirects to ${m}`),i.url=m;continue e}}if(s)throw n.info("None of the retry strategies could work with the received error. Throwing it."),s;if(o)return n.info("None of the retry strategies could work with the received response. Returning it."),o}}}}});var Zw=g(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.defaultRetryPolicyName=void 0;qa.defaultRetryPolicy=Pne;var bne=Eg(),One=yg(),Rne=Fa(),Nne=$o();qa.defaultRetryPolicyName="defaultRetryPolicy";function Pne(t={}){return{name:qa.defaultRetryPolicyName,sendRequest:(0,Rne.retryPolicy)([(0,One.throttlingRetryStrategy)(),(0,bne.exponentialRetryStrategy)(t)],{maxRetries:t.maxRetries??Nne.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}});var Jw=g(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.formDataPolicyName=void 0;Ha.formDataPolicy=Lne;var Dne=Yo(),Mne=sd(),lx=ro();Ha.formDataPolicyName="formDataPolicy";function kne(t){let e={};for(let[n,i]of t.entries())e[n]??=[],e[n].push(i);return e}function Lne(){return{name:Ha.formDataPolicyName,async sendRequest(t,e){if(Mne.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=kne(t.body),t.body=void 0),t.formData){let n=t.headers.get("Content-Type");n&&n.indexOf("application/x-www-form-urlencoded")!==-1?t.body=Une(t.formData):await xne(t.formData,t),t.formData=void 0}return e(t)}}}function Une(t){let e=new URLSearchParams;for(let[n,i]of Object.entries(t))if(Array.isArray(i))for(let r of i)e.append(n,r.toString());else e.append(n,i.toString());return e.toString()}async function xne(t,e){let n=e.headers.get("Content-Type");if(n&&!n.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",n??"multipart/form-data");let i=[];for(let[r,o]of Object.entries(t))for(let s of Array.isArray(o)?o:[o])if(typeof s=="string")i.push({headers:(0,lx.createHttpHeaders)({"Content-Disposition":`form-data; name="${r}"`}),body:(0,Dne.stringToUint8Array)(s,"utf-8")});else{if(s==null||typeof s!="object")throw new Error(`Unexpected value for key ${r}: ${s}. Value should be serialized to string first.`);{let a=s.name||"blob",c=(0,lx.createHttpHeaders)();c.set("Content-Disposition",`form-data; name="${r}"; filename="${a}"`),c.set("Content-Type",s.type||"application/octet-stream"),i.push({headers:c,body:s})}}e.multipartBody={parts:i}}});var eI=g((B0e,dx)=>{"use strict";function Fne(t){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=r,n.enabled=a,n.humanize=FC(),n.destroy=u,Object.keys(t).forEach(l=>{n[l]=t[l]}),n.names=[],n.skips=[],n.formatters={};function e(l){let d=0;for(let f=0;f<l.length;f++)d=(d<<5)-d+l.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=e;function n(l){let d,f=null,m,_;function E(...I){if(!E.enabled)return;let y=E,A=Number(new Date),S=A-(d||A);y.diff=S,y.prev=d,y.curr=A,d=A,I[0]=n.coerce(I[0]),typeof I[0]!="string"&&I.unshift("%O");let w=0;I[0]=I[0].replace(/%([a-zA-Z%])/g,(W,R)=>{if(W==="%%")return"%";w++;let L=n.formatters[R];if(typeof L=="function"){let b=I[w];W=L.call(y,b),I.splice(w,1),w--}return W}),n.formatArgs.call(y,I),(y.log||n.log).apply(y,I)}return E.namespace=l,E.useColors=n.useColors(),E.color=n.selectColor(l),E.extend=i,E.destroy=n.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(m!==n.namespaces&&(m=n.namespaces,_=n.enabled(l)),_),set:I=>{f=I}}),typeof n.init=="function"&&n.init(E),E}function i(l,d){let f=n(this.namespace+(typeof d>"u"?":":d)+l);return f.log=this.log,f}function r(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];let d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of d)f[0]==="-"?n.skips.push(f.slice(1)):n.names.push(f)}function o(l,d){let f=0,m=0,_=-1,E=0;for(;f<l.length;)if(m<d.length&&(d[m]===l[f]||d[m]==="*"))d[m]==="*"?(_=m,E=f,m++):(f++,m++);else if(_!==-1)m=_+1,E++,f=E;else return!1;for(;m<d.length&&d[m]==="*";)m++;return m===d.length}function s(){let l=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),l}function a(l){for(let d of n.skips)if(o(l,d))return!1;for(let d of n.names)if(o(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}dx.exports=Fne});var hx=g((On,Tg)=>{"use strict";On.formatArgs=Hne;On.save=Bne;On.load=jne;On.useColors=qne;On.storage=Yne();On.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();On.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function qne(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Hne(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Tg.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(n++,r==="%c"&&(i=n))}),t.splice(i,0,e)}On.log=console.debug||console.log||(()=>{});function Bne(t){try{t?On.storage.setItem("debug",t):On.storage.removeItem("debug")}catch{}}function jne(){let t;try{t=On.storage.getItem("debug")||On.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function Yne(){try{return localStorage}catch{}}Tg.exports=eI()(On);var{formatters:Vne}=Tg.exports;Vne.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var px=g((j0e,fx)=>{"use strict";fx.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(n+t),r=e.indexOf("--");return i!==-1&&(r===-1||i<r)}});var _x=g((Y0e,gx)=>{"use strict";var $ne=x("os"),mx=x("tty"),rr=px(),{env:Mt}=process,io;rr("no-color")||rr("no-colors")||rr("color=false")||rr("color=never")?io=0:(rr("color")||rr("colors")||rr("color=true")||rr("color=always"))&&(io=1);"FORCE_COLOR"in Mt&&(Mt.FORCE_COLOR==="true"?io=1:Mt.FORCE_COLOR==="false"?io=0:io=Mt.FORCE_COLOR.length===0?1:Math.min(parseInt(Mt.FORCE_COLOR,10),3));function tI(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function nI(t,e){if(io===0)return 0;if(rr("color=16m")||rr("color=full")||rr("color=truecolor"))return 3;if(rr("color=256"))return 2;if(t&&!e&&io===void 0)return 0;let n=io||0;if(Mt.TERM==="dumb")return n;if(process.platform==="win32"){let i=$ne.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in Mt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in Mt)||Mt.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Mt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Mt.TEAMCITY_VERSION)?1:0;if(Mt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Mt){let i=parseInt((Mt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Mt.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Mt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Mt.TERM)||"COLORTERM"in Mt?1:n}function zne(t){let e=nI(t,t&&t.isTTY);return tI(e)}gx.exports={supportsColor:zne,stdout:tI(nI(!0,mx.isatty(1))),stderr:tI(nI(!0,mx.isatty(2)))}});var Ex=g((kt,Cg)=>{"use strict";var Gne=x("tty"),Ag=x("util");kt.init=ere;kt.log=Qne;kt.formatArgs=Kne;kt.save=Zne;kt.load=Jne;kt.useColors=Wne;kt.destroy=Ag.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");kt.colors=[6,2,3,4,5,1];try{let t=_x();t&&(t.stderr||t).level>=2&&(kt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}kt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(r,o)=>o.toUpperCase()),i=process.env[e];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),t[n]=i,t},{});function Wne(){return"colors"in kt.inspectOpts?!!kt.inspectOpts.colors:Gne.isatty(process.stderr.fd)}function Kne(t){let{namespace:e,useColors:n}=this;if(n){let i=this.color,r="\x1B[3"+(i<8?i:"8;5;"+i),o=` ${r};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
|
|
41
|
+
`).join(`
|
|
42
|
+
`+o),t.push(r+"m+"+Cg.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Xne()+e+" "+t[0]}function Xne(){return kt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Qne(...t){return process.stderr.write(Ag.formatWithOptions(kt.inspectOpts,...t)+`
|
|
43
|
+
`)}function Zne(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function Jne(){return process.env.DEBUG}function ere(t){t.inspectOpts={};let e=Object.keys(kt.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=kt.inspectOpts[e[n]]}Cg.exports=eI()(kt);var{formatters:yx}=Cg.exports;yx.o=function(t){return this.inspectOpts.colors=this.useColors,Ag.inspect(t,this.inspectOpts).split(`
|
|
44
|
+
`).map(e=>e.trim()).join(" ")};yx.O=function(t){return this.inspectOpts.colors=this.useColors,Ag.inspect(t,this.inspectOpts)}});var Sg=g((V0e,rI)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?rI.exports=hx():rI.exports=Ex()});var Cx=g(Rn=>{"use strict";var tre=Rn&&Rn.__createBinding||(Object.create?(function(t,e,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}):(function(t,e,n,i){i===void 0&&(i=n),t[i]=e[n]})),nre=Rn&&Rn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Tx=Rn&&Rn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&tre(e,t,n);return nre(e,t),e};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.req=Rn.json=Rn.toBuffer=void 0;var rre=Tx(x("http")),ire=Tx(x("https"));async function Ax(t){let e=0,n=[];for await(let i of t)e+=i.length,n.push(i);return Buffer.concat(n,e)}Rn.toBuffer=Ax;async function ore(t){let n=(await Ax(t)).toString("utf8");try{return JSON.parse(n)}catch(i){let r=i;throw r.message+=` (input: ${n})`,r}}Rn.json=ore;function sre(t,e={}){let i=((typeof t=="string"?t:t.href).startsWith("https:")?ire:rre).request(t,e),r=new Promise((o,s)=>{i.once("response",o).once("error",s).end()});return i.then=r.then.bind(r),i}Rn.req=sre});var oI=g(Hn=>{"use strict";var wx=Hn&&Hn.__createBinding||(Object.create?(function(t,e,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}):(function(t,e,n,i){i===void 0&&(i=n),t[i]=e[n]})),are=Hn&&Hn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ix=Hn&&Hn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&wx(e,t,n);return are(e,t),e},cre=Hn&&Hn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&wx(e,t,n)};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.Agent=void 0;var ure=Ix(x("net")),Sx=Ix(x("http")),lre=x("https");cre(Cx(),Hn);var zr=Symbol("AgentBaseInternalState"),iI=class extends Sx.Agent{constructor(e){super(e),this[zr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
|
|
45
|
+
`).some(i=>i.indexOf("(https.js:")!==-1||i.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let n=new ure.Socket({writable:!1});return this.sockets[e].push(n),this.totalSocketCount++,n}decrementSockets(e,n){if(!this.sockets[e]||n===null)return;let i=this.sockets[e],r=i.indexOf(n);r!==-1&&(i.splice(r,1),this.totalSocketCount--,i.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?lre.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,n,i){let r={...n,secureEndpoint:this.isSecureEndpoint(n)},o=this.getName(r),s=this.incrementSockets(o);Promise.resolve().then(()=>this.connect(e,r)).then(a=>{if(this.decrementSockets(o,s),a instanceof Sx.Agent)try{return a.addRequest(e,r)}catch(c){return i(c)}this[zr].currentSocket=a,super.createSocket(e,n,i)},a=>{this.decrementSockets(o,s),i(a)})}createConnection(){let e=this[zr].currentSocket;if(this[zr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[zr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[zr]&&(this[zr].defaultPort=e)}get protocol(){return this[zr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[zr]&&(this[zr].protocol=e)}};Hn.Agent=iI});var vx=g(Ba=>{"use strict";var dre=Ba&&Ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ba,"__esModule",{value:!0});Ba.parseProxyResponse=void 0;var hre=dre(Sg()),wg=(0,hre.default)("https-proxy-agent:parse-proxy-response");function fre(t){return new Promise((e,n)=>{let i=0,r=[];function o(){let l=t.read();l?u(l):t.once("readable",o)}function s(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("readable",o)}function a(){s(),wg("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(l){s(),wg("onerror %o",l),n(l)}function u(l){r.push(l),i+=l.length;let d=Buffer.concat(r,i),f=d.indexOf(`\r
|
|
46
|
+
\r
|
|
47
|
+
`);if(f===-1){wg("have not received end of HTTP headers yet..."),o();return}let m=d.slice(0,f).toString("ascii").split(`\r
|
|
48
|
+
`),_=m.shift();if(!_)return t.destroy(),n(new Error("No header received from proxy CONNECT response"));let E=_.split(" "),I=+E[1],y=E.slice(2).join(" "),A={};for(let S of m){if(!S)continue;let w=S.indexOf(":");if(w===-1)return t.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${S}"`));let N=S.slice(0,w).toLowerCase(),W=S.slice(w+1).trimStart(),R=A[N];typeof R=="string"?A[N]=[R,W]:Array.isArray(R)?R.push(W):A[N]=W}wg("got proxy server response: %o %o",_,A),s(),e({connect:{statusCode:I,statusText:y,headers:A},buffered:d})}t.on("error",c),t.on("end",a),o()})}Ba.parseProxyResponse=fre});var Dx=g(ir=>{"use strict";var pre=ir&&ir.__createBinding||(Object.create?(function(t,e,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}):(function(t,e,n,i){i===void 0&&(i=n),t[i]=e[n]})),mre=ir&&ir.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Nx=ir&&ir.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&pre(e,t,n);return mre(e,t),e},Px=ir&&ir.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ir,"__esModule",{value:!0});ir.HttpsProxyAgent=void 0;var Ig=Nx(x("net")),bx=Nx(x("tls")),gre=Px(x("assert")),_re=Px(Sg()),yre=oI(),Ere=x("url"),Tre=vx(),Cd=(0,_re.default)("https-proxy-agent"),Ox=t=>t.servername===void 0&&t.host&&!Ig.isIP(t.host)?{...t,servername:t.host}:t,vg=class extends yre.Agent{constructor(e,n){super(n),this.options={path:void 0},this.proxy=typeof e=="string"?new Ere.URL(e):e,this.proxyHeaders=n?.headers??{},Cd("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let i=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?Rx(n,"headers"):null,host:i,port:r}}async connect(e,n){let{proxy:i}=this;if(!n.host)throw new TypeError('No "host" provided');let r;i.protocol==="https:"?(Cd("Creating `tls.Socket`: %o",this.connectOpts),r=bx.connect(Ox(this.connectOpts))):(Cd("Creating `net.Socket`: %o",this.connectOpts),r=Ig.connect(this.connectOpts));let o=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},s=Ig.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${s}:${n.port} HTTP/1.1\r
|
|
49
|
+
`;if(i.username||i.password){let f=`${decodeURIComponent(i.username)}:${decodeURIComponent(i.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(f).toString("base64")}`}o.Host=`${s}:${n.port}`,o["Proxy-Connection"]||(o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let f of Object.keys(o))a+=`${f}: ${o[f]}\r
|
|
50
|
+
`;let c=(0,Tre.parseProxyResponse)(r);r.write(`${a}\r
|
|
51
|
+
`);let{connect:u,buffered:l}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",Are),n.secureEndpoint?(Cd("Upgrading socket connection to TLS"),bx.connect({...Rx(Ox(n),"host","path","port"),socket:r})):r;r.destroy();let d=new Ig.Socket({writable:!1});return d.readable=!0,e.once("socket",f=>{Cd("Replaying proxy buffer for failed request"),(0,gre.default)(f.listenerCount("data")>0),f.push(l),f.push(null)}),d}};vg.protocols=["http","https"];ir.HttpsProxyAgent=vg;function Are(t){t.resume()}function Rx(t,...e){let n={},i;for(i in t)e.includes(i)||(n[i]=t[i]);return n}});var Lx=g(or=>{"use strict";var Cre=or&&or.__createBinding||(Object.create?(function(t,e,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}):(function(t,e,n,i){i===void 0&&(i=n),t[i]=e[n]})),Sre=or&&or.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kx=or&&or.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Cre(e,t,n);return Sre(e,t),e},wre=or&&or.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(or,"__esModule",{value:!0});or.HttpProxyAgent=void 0;var Ire=kx(x("net")),vre=kx(x("tls")),bre=wre(Sg()),Ore=x("events"),Rre=oI(),Mx=x("url"),ja=(0,bre.default)("http-proxy-agent"),bg=class extends Rre.Agent{constructor(e,n){super(n),this.proxy=typeof e=="string"?new Mx.URL(e):e,this.proxyHeaders=n?.headers??{},ja("Creating new HttpProxyAgent instance: %o",this.proxy.href);let i=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...n?Nre(n,"headers"):null,host:i,port:r}}addRequest(e,n){e._header=null,this.setRequestProps(e,n),super.addRequest(e,n)}setRequestProps(e,n){let{proxy:i}=this,r=n.secureEndpoint?"https:":"http:",o=e.getHeader("host")||"localhost",s=`${r}//${o}`,a=new Mx.URL(e.path,s);n.port!==80&&(a.port=String(n.port)),e.path=String(a);let c=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(i.username||i.password){let u=`${decodeURIComponent(i.username)}:${decodeURIComponent(i.password)}`;c["Proxy-Authorization"]=`Basic ${Buffer.from(u).toString("base64")}`}c["Proxy-Connection"]||(c["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let u of Object.keys(c)){let l=c[u];l&&e.setHeader(u,l)}}async connect(e,n){e._header=null,e.path.includes("://")||this.setRequestProps(e,n);let i,r;ja("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(ja("Patching connection write() output buffer with updated header"),i=e.outputData[0].data,r=i.indexOf(`\r
|
|
52
|
+
\r
|
|
53
|
+
`)+4,e.outputData[0].data=e._header+i.substring(r),ja("Output buffer: %o",e.outputData[0].data));let o;return this.proxy.protocol==="https:"?(ja("Creating `tls.Socket`: %o",this.connectOpts),o=vre.connect(this.connectOpts)):(ja("Creating `net.Socket`: %o",this.connectOpts),o=Ire.connect(this.connectOpts)),await(0,Ore.once)(o,"connect"),o}};bg.protocols=["http","https"];or.HttpProxyAgent=bg;function Nre(t,...e){let n={},i;for(i in t)e.includes(i)||(n[i]=t[i]);return n}});var sI=g(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.globalNoProxyList=sr.proxyPolicyName=void 0;sr.loadNoProxy=Hx;sr.getDefaultProxySettings=Hre;sr.proxyPolicy=jre;var Pre=Dx(),Dre=Lx(),Mre=yd(),kre="HTTPS_PROXY",Lre="HTTP_PROXY",Ure="ALL_PROXY",xre="NO_PROXY";sr.proxyPolicyName="proxyPolicy";sr.globalNoProxyList=[];var Fx=!1,Fre=new Map;function Og(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}function qx(){if(!process)return;let t=Og(kre),e=Og(Ure),n=Og(Lre);return t||e||n}function qre(t,e,n){if(e.length===0)return!1;let i=new URL(t).hostname;if(n?.has(i))return n.get(i);let r=!1;for(let o of e)o[0]==="."?(i.endsWith(o)||i.length===o.length-1&&i===o.slice(1))&&(r=!0):i===o&&(r=!0);return n?.set(i,r),r}function Hx(){let t=Og(xre);return Fx=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}function Hre(t){if(!t&&(t=qx(),!t))return;let e=new URL(t);return{host:(e.protocol?e.protocol+"//":"")+e.hostname,port:Number.parseInt(e.port||"80"),username:e.username,password:e.password}}function Bre(){let t=qx();return t?new URL(t):void 0}function Ux(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}function xx(t,e,n){if(t.agent)return;let r=new URL(t.url).protocol!=="https:";t.tlsSettings&&Mre.logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let o=t.headers.toJSON();r?(e.httpProxyAgent||(e.httpProxyAgent=new Dre.HttpProxyAgent(n,{headers:o})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new Pre.HttpsProxyAgent(n,{headers:o})),t.agent=e.httpsProxyAgent)}function jre(t,e){Fx||sr.globalNoProxyList.push(...Hx());let n=t?Ux(t):Bre(),i={};return{name:sr.proxyPolicyName,async sendRequest(r,o){return!r.proxySettings&&n&&!qre(r.url,e?.customNoProxyList??sr.globalNoProxyList,e?.customNoProxyList?void 0:Fre)?xx(r,i,n):r.proxySettings&&xx(r,i,Ux(r.proxySettings)),o(r)}}}});var aI=g(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.agentPolicyName=void 0;Ya.agentPolicy=Yre;Ya.agentPolicyName="agentPolicy";function Yre(t){return{name:Ya.agentPolicyName,sendRequest:async(e,n)=>(e.agent||(e.agent=t),n(e))}}});var cI=g(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.tlsPolicyName=void 0;Va.tlsPolicy=Vre;Va.tlsPolicyName="tlsPolicy";function Vre(t){return{name:Va.tlsPolicyName,sendRequest:async(e,n)=>(e.tlsSettings||(e.tlsSettings=t),n(e))}}});var Sd=g(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.isNodeReadableStream=Bx;zo.isWebReadableStream=jx;zo.isBinaryBody=$re;zo.isReadableStream=Yx;zo.isBlob=zre;function Bx(t){return!!(t&&typeof t.pipe=="function")}function jx(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}function $re(t){return t!==void 0&&(t instanceof Uint8Array||Yx(t)||typeof t=="function"||t instanceof Blob)}function Yx(t){return Bx(t)||jx(t)}function zre(t){return typeof t.stream=="function"}});var zx=g(lI=>{"use strict";Object.defineProperty(lI,"__esModule",{value:!0});lI.concat=Xre;var uI=x("stream"),Gre=Sd();async function*Vx(){let t=this.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}function Wre(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=Vx.bind(t)),t.values||(t.values=Vx.bind(t))}function $x(t){return t instanceof ReadableStream?(Wre(t),uI.Readable.fromWeb(t)):t}function Kre(t){return t instanceof Uint8Array?uI.Readable.from(Buffer.from(t)):(0,Gre.isBlob)(t)?$x(t.stream()):$x(t)}async function Xre(t){return function(){let e=t.map(n=>typeof n=="function"?n():n).map(Kre);return uI.Readable.from((async function*(){for(let n of e)for await(let i of n)yield i})())}}});var dI=g(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.multipartPolicyName=void 0;za.multipartPolicy=cie;var $a=Yo(),Qre=Sd(),Zre=Qm(),Jre=zx();function eie(){return`----AzSDKFormBoundary${(0,Zre.randomUUID)()}`}function tie(t){let e="";for(let[n,i]of t)e+=`${n}: ${i}\r
|
|
54
|
+
`;return e}function nie(t){return t instanceof Uint8Array?t.byteLength:(0,Qre.isBlob)(t)?t.size===-1?void 0:t.size:void 0}function rie(t){let e=0;for(let n of t){let i=nie(n);if(i===void 0)return;e+=i}return e}async function iie(t,e,n){let i=[(0,$a.stringToUint8Array)(`--${n}`,"utf-8"),...e.flatMap(o=>[(0,$a.stringToUint8Array)(`\r
|
|
55
|
+
`,"utf-8"),(0,$a.stringToUint8Array)(tie(o.headers),"utf-8"),(0,$a.stringToUint8Array)(`\r
|
|
56
|
+
`,"utf-8"),o.body,(0,$a.stringToUint8Array)(`\r
|
|
57
|
+
--${n}`,"utf-8")]),(0,$a.stringToUint8Array)(`--\r
|
|
58
|
+
\r
|
|
59
|
+
`,"utf-8")],r=rie(i);r&&t.headers.set("Content-Length",r),t.body=await(0,Jre.concat)(i)}za.multipartPolicyName="multipartPolicy";var oie=70,sie=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function aie(t){if(t.length>oie)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!sie.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}function cie(){return{name:za.multipartPolicyName,async sendRequest(t,e){if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,i=t.headers.get("Content-Type")??"multipart/mixed",r=i.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!r)throw new Error(`Got multipart request body, but content-type header was not multipart: ${i}`);let[,o,s]=r;if(s&&n&&s!==n)throw new Error(`Multipart boundary was specified as ${s} in the header, but got ${n} in the request body`);return n??=s,n?aie(n):n=eie(),t.headers.set("Content-Type",`${o}; boundary=${n}`),await iie(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}});var Kx=g(hI=>{"use strict";Object.defineProperty(hI,"__esModule",{value:!0});hI.createPipelineFromOptions=Eie;var uie=Yw(),lie=Uw(),die=Vw(),hie=Gw(),fie=Ww(),pie=Zw(),mie=Jw(),Gx=sd(),gie=sI(),_ie=aI(),yie=cI(),Wx=dI();function Eie(t){let e=(0,lie.createEmptyPipeline)();return Gx.isNodeLike&&(t.agent&&e.addPolicy((0,_ie.agentPolicy)(t.agent)),t.tlsOptions&&e.addPolicy((0,yie.tlsPolicy)(t.tlsOptions)),e.addPolicy((0,gie.proxyPolicy)(t.proxyOptions)),e.addPolicy((0,fie.decompressResponsePolicy)())),e.addPolicy((0,mie.formDataPolicy)(),{beforePolicies:[Wx.multipartPolicyName]}),e.addPolicy((0,hie.userAgentPolicy)(t.userAgentOptions)),e.addPolicy((0,Wx.multipartPolicy)(),{afterPhase:"Deserialize"}),e.addPolicy((0,pie.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),Gx.isNodeLike&&e.addPolicy((0,die.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),e.addPolicy((0,uie.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),e}});var Xx=g(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.apiVersionPolicyName=void 0;Ga.apiVersionPolicy=Tie;Ga.apiVersionPolicyName="ApiVersionPolicy";function Tie(t){return{name:Ga.apiVersionPolicyName,sendRequest:(e,n)=>{let i=new URL(e.url);return!i.searchParams.get("api-version")&&t.apiVersion&&(e.url=`${e.url}${Array.from(i.searchParams.keys()).length>0?"&":"?"}api-version=${t.apiVersion}`),n(e)}}}});var Qx=g(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.isOAuth2TokenCredential=Aie;Wa.isBearerTokenCredential=Cie;Wa.isBasicCredential=Sie;Wa.isApiKeyCredential=wie;function Aie(t){return"getOAuth2Token"in t}function Cie(t){return"getBearerToken"in t}function Sie(t){return"username"in t&&"password"in t}function wie(t){return"key"in t}});var wd=g(fI=>{"use strict";Object.defineProperty(fI,"__esModule",{value:!0});fI.ensureSecureConnection=Oie;var Iie=yd(),Zx=!1;function vie(t,e){if(e.allowInsecureConnection&&t.allowInsecureConnection){let n=new URL(t.url);if(n.hostname==="localhost"||n.hostname==="127.0.0.1")return!0}return!1}function bie(){let t="Sending token over insecure transport. Assume any token issued is compromised.";Iie.logger.warning(t),typeof process?.emitWarning=="function"&&!Zx&&(Zx=!0,process.emitWarning(t))}function Oie(t,e){if(!t.url.toLowerCase().startsWith("https://"))if(vie(t,e))bie();else throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false.")}});var Jx=g(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.apiKeyAuthenticationPolicyName=void 0;Ka.apiKeyAuthenticationPolicy=Nie;var Rie=wd();Ka.apiKeyAuthenticationPolicyName="apiKeyAuthenticationPolicy";function Nie(t){return{name:Ka.apiKeyAuthenticationPolicyName,async sendRequest(e,n){(0,Rie.ensureSecureConnection)(e,t);let i=(e.authSchemes??t.authSchemes)?.find(r=>r.kind==="apiKey");if(!i)return n(e);if(i.apiKeyLocation!=="header")throw new Error(`Unsupported API key location: ${i.apiKeyLocation}`);return e.headers.set(i.name,t.credential.key),n(e)}}}});var tF=g(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.basicAuthenticationPolicyName=void 0;Xa.basicAuthenticationPolicy=Die;var eF=Yo(),Pie=wd();Xa.basicAuthenticationPolicyName="bearerAuthenticationPolicy";function Die(t){return{name:Xa.basicAuthenticationPolicyName,async sendRequest(e,n){if((0,Pie.ensureSecureConnection)(e,t),!(e.authSchemes??t.authSchemes)?.find(a=>a.kind==="http"&&a.scheme==="basic"))return n(e);let{username:r,password:o}=t.credential,s=(0,eF.uint8ArrayToString)((0,eF.stringToUint8Array)(`${r}:${o}`,"utf-8"),"base64");return e.headers.set("Authorization",`Basic ${s}`),n(e)}}}});var nF=g(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.bearerAuthenticationPolicyName=void 0;Qa.bearerAuthenticationPolicy=kie;var Mie=wd();Qa.bearerAuthenticationPolicyName="bearerAuthenticationPolicy";function kie(t){return{name:Qa.bearerAuthenticationPolicyName,async sendRequest(e,n){if((0,Mie.ensureSecureConnection)(e,t),!(e.authSchemes??t.authSchemes)?.find(o=>o.kind==="http"&&o.scheme==="bearer"))return n(e);let r=await t.credential.getBearerToken({abortSignal:e.abortSignal});return e.headers.set("Authorization",`Bearer ${r}`),n(e)}}}});var rF=g(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.oauth2AuthenticationPolicyName=void 0;Za.oauth2AuthenticationPolicy=Uie;var Lie=wd();Za.oauth2AuthenticationPolicyName="oauth2AuthenticationPolicy";function Uie(t){return{name:Za.oauth2AuthenticationPolicyName,async sendRequest(e,n){(0,Lie.ensureSecureConnection)(e,t);let i=(e.authSchemes??t.authSchemes)?.find(o=>o.kind==="oauth2");if(!i)return n(e);let r=await t.credential.getOAuth2Token(i.flows,{abortSignal:e.abortSignal});return e.headers.set("Authorization",`Bearer ${r}`),n(e)}}}});var mI=g(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.createDefaultPipeline=Vie;Ng.getCachedDefaultHttpsClient=$ie;var xie=jw(),Fie=Kx(),qie=Xx(),Rg=Qx(),Hie=Jx(),Bie=tF(),jie=nF(),Yie=rF(),pI;function Vie(t={}){let e=(0,Fie.createPipelineFromOptions)(t);e.addPolicy((0,qie.apiVersionPolicy)(t));let{credential:n,authSchemes:i,allowInsecureConnection:r}=t;return n&&((0,Rg.isApiKeyCredential)(n)?e.addPolicy((0,Hie.apiKeyAuthenticationPolicy)({authSchemes:i,credential:n,allowInsecureConnection:r})):(0,Rg.isBasicCredential)(n)?e.addPolicy((0,Bie.basicAuthenticationPolicy)({authSchemes:i,credential:n,allowInsecureConnection:r})):(0,Rg.isBearerTokenCredential)(n)?e.addPolicy((0,jie.bearerAuthenticationPolicy)({authSchemes:i,credential:n,allowInsecureConnection:r})):(0,Rg.isOAuth2TokenCredential)(n)&&e.addPolicy((0,Yie.oauth2AuthenticationPolicy)({authSchemes:i,credential:n,allowInsecureConnection:r}))),e}function $ie(){return pI||(pI=(0,xie.createDefaultHttpClient)()),pI}});var uF=g(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.buildBodyPart=cF;Pg.buildMultipartBody=Qie;var zie=Pa(),Gie=ro(),iF=Yo(),sF=Sd();function aF(t,e){if(t.headers){let n=Object.keys(t.headers).find(i=>i.toLowerCase()===e.toLowerCase());if(n)return t.headers[n]}}function Wie(t){let e=aF(t,"content-type");if(e)return e;if(t.contentType===null)return;if(t.contentType)return t.contentType;let{body:n}=t;if(n!=null)return typeof n=="string"||typeof n=="number"||typeof n=="boolean"?"text/plain; charset=UTF-8":n instanceof Blob?n.type||"application/octet-stream":(0,sF.isBinaryBody)(n)?"application/octet-stream":"application/json"}function oF(t){return JSON.stringify(t)}function Kie(t){let e=aF(t,"content-disposition");if(e)return e;if(t.dispositionType===void 0&&t.name===void 0&&t.filename===void 0)return;let i=t.dispositionType??"form-data";t.name&&(i+=`; name=${oF(t.name)}`);let r;if(t.filename)r=t.filename;else if(typeof File<"u"&&t.body instanceof File){let o=t.body.name;o!==""&&(r=o)}return r&&(i+=`; filename=${oF(r)}`),i}function Xie(t,e){if(t===void 0)return new Uint8Array([]);if((0,sF.isBinaryBody)(t))return t;if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return(0,iF.stringToUint8Array)(String(t),"utf-8");if(e&&/application\/(.+\+)?json(;.+)?/i.test(String(e)))return(0,iF.stringToUint8Array)(JSON.stringify(t),"utf-8");throw new zie.RestError(`Unsupported body/content-type combination: ${t}, ${e}`)}function cF(t){let e=Wie(t),n=Kie(t),i=(0,Gie.createHttpHeaders)(t.headers??{});e&&i.set("content-type",e),n&&i.set("content-disposition",n);let r=Xie(t.body,e);return{headers:i,body:r}}function Qie(t){return{parts:t.map(cF)}}});var lF=g(_I=>{"use strict";Object.defineProperty(_I,"__esModule",{value:!0});_I.sendRequest=roe;var gI=Pa(),Zie=ro(),Jie=Mw(),eoe=mI(),toe=Sd(),noe=uF();async function roe(t,e,n,i={},r){let o=r??(0,eoe.getCachedDefaultHttpsClient)(),s=soe(t,e,i);try{let a=await n.sendRequest(o,s),c=a.headers.toJSON(),u=a.readableStreamBody??a.browserStreamBody,l=i.responseAsStream||u!==void 0?void 0:coe(a),d=u??l;return i?.onResponse&&i.onResponse({...a,request:s,rawHeaders:c,parsedBody:l}),{request:s,headers:c,status:`${a.status}`,body:d}}catch(a){if((0,gI.isRestError)(a)&&a.response&&i.onResponse){let{response:c}=a,u=c.headers.toJSON();i?.onResponse({...c,request:s,rawHeaders:u},a)}throw a}}function ioe(t={}){return t.contentType??t.headers?.["content-type"]??ooe(t.body)}function ooe(t){if(ArrayBuffer.isView(t))return"application/octet-stream";if(typeof t=="string")try{return JSON.parse(t),"application/json"}catch{return}return"application/json"}function soe(t,e,n={}){let i=ioe(n),{body:r,multipartBody:o}=aoe(n.body,i),s=r!==void 0||o!==void 0,a=(0,Zie.createHttpHeaders)({...n.headers?n.headers:{},accept:n.accept??n.headers?.accept??"application/json",...s&&i&&{"content-type":i}});return(0,Jie.createPipelineRequest)({url:e,method:t,body:r,multipartBody:o,headers:a,allowInsecureConnection:n.allowInsecureConnection,abortSignal:n.abortSignal,onUploadProgress:n.onUploadProgress,onDownloadProgress:n.onDownloadProgress,timeout:n.timeout,enableBrowserStreams:!0,streamResponseStatusCodes:n.responseAsStream?new Set([Number.POSITIVE_INFINITY]):void 0})}function aoe(t,e=""){if(t===void 0)return{body:void 0};if(typeof FormData<"u"&&t instanceof FormData)return{body:t};if((0,toe.isReadableStream)(t))return{body:t};if(ArrayBuffer.isView(t))return{body:t instanceof Uint8Array?t:JSON.stringify(t)};switch(e.split(";")[0]){case"application/json":return{body:JSON.stringify(t)};case"multipart/form-data":return Array.isArray(t)?{multipartBody:(0,noe.buildMultipartBody)(t)}:{body:JSON.stringify(t)};case"text/plain":return{body:String(t)};default:return typeof t=="string"?{body:t}:{body:JSON.stringify(t)}}}function coe(t){let n=(t.headers.get("content-type")??"").split(";")[0],i=t.bodyAsText??"";if(n==="text/plain")return String(i);try{return i?JSON.parse(i):void 0}catch(r){if(n==="application/json")throw uoe(t,r);return String(i)}}function uoe(t,e){let n=`Error "${e}" occurred while parsing the response body - ${t.bodyAsText}.`,i=e.code??gI.RestError.PARSE_ERROR;return new gI.RestError(n,{code:i,statusCode:t.status,request:t.request,response:t})}});var fF=g(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.buildRequestUrl=doe;Id.buildBaseUrl=dF;Id.replaceAll=hF;function loe(t){let e=t.value;return e!==void 0&&e.toString!==void 0&&typeof e.toString=="function"}function doe(t,e,n,i={}){if(e.startsWith("https://")||e.startsWith("http://"))return e;t=dF(t,i),e=foe(e,n,i);let r=hoe(`${t}/${e}`,i);return new URL(r).toString().replace(/([^:]\/)\/+/g,"$1")}function yI(t,e,n,i){let r;n==="pipeDelimited"?r="|":n==="spaceDelimited"?r="%20":r=",";let o;Array.isArray(i)?o=i:typeof i=="object"&&i.toString===Object.prototype.toString?o=Object.entries(i).flat():o=[i];let s=o.map(a=>{if(a==null)return"";if(!a.toString||typeof a.toString!="function")throw new Error(`Query parameters must be able to be represented as string, ${t} can't`);let c=a.toISOString!==void 0?a.toISOString():a.toString();return e?c:encodeURIComponent(c)}).join(r);return`${e?t:encodeURIComponent(t)}=${s}`}function hoe(t,e={}){if(!e.queryParameters)return t;let n=new URL(t),i=e.queryParameters,r=[];for(let o of Object.keys(i)){let s=i[o];if(s==null)continue;let a=loe(s),c=a?s.value:s,u=a?s.explode??!1:!1,l=a&&s.style?s.style:"form";if(u)if(Array.isArray(c))for(let d of c)r.push(yI(o,e.skipUrlEncoding??!1,l,d));else if(typeof c=="object")for(let[d,f]of Object.entries(c))r.push(yI(d,e.skipUrlEncoding??!1,l,f));else throw new Error("explode can only be set to true for objects and arrays");else r.push(yI(o,e.skipUrlEncoding??!1,l,c))}return n.search!==""&&(n.search+="&"),n.search+=r.join("&"),n.toString()}function dF(t,e){if(!e.pathParameters)return t;let n=e.pathParameters;for(let[i,r]of Object.entries(n)){if(r==null)throw new Error(`Path parameters ${i} must not be undefined or null`);if(!r.toString||typeof r.toString!="function")throw new Error(`Path parameters must be able to be represented as string, ${i} can't`);let o=r.toISOString!==void 0?r.toISOString():String(r);e.skipUrlEncoding||(o=encodeURIComponent(r)),t=hF(t,`{${i}}`,o)??""}return t}function foe(t,e,n={}){for(let i of e){let r=typeof i=="object"&&(i.allowReserved??!1),o=typeof i=="object"?i.value:i;!n.skipUrlEncoding&&!r&&(o=encodeURIComponent(o)),t=t.replace(/\{[\w-]+\}/,String(o))}return t}function hF(t,e,n){return!t||!e?t:t.split(e).join(n||"")}});var mF=g(TI=>{"use strict";Object.defineProperty(TI,"__esModule",{value:!0});TI.getClient=goe;var poe=mI(),EI=lF(),moe=fF(),pF=sd();function goe(t,e={}){let n=e.pipeline??(0,poe.createDefaultPipeline)(e);if(e.additionalPolicies?.length)for(let{policy:a,position:c}of e.additionalPolicies){let u=c==="perRetry"?"Sign":void 0;n.addPolicy(a,{afterPhase:u})}let{allowInsecureConnection:i,httpClient:r}=e,o=e.endpoint??t,s=(a,...c)=>{let u=l=>(0,moe.buildRequestUrl)(o,a,c,{allowInsecureConnection:i,...l});return{get:(l={})=>oo("GET",u(l),n,l,i,r),post:(l={})=>oo("POST",u(l),n,l,i,r),put:(l={})=>oo("PUT",u(l),n,l,i,r),patch:(l={})=>oo("PATCH",u(l),n,l,i,r),delete:(l={})=>oo("DELETE",u(l),n,l,i,r),head:(l={})=>oo("HEAD",u(l),n,l,i,r),options:(l={})=>oo("OPTIONS",u(l),n,l,i,r),trace:(l={})=>oo("TRACE",u(l),n,l,i,r)}};return{path:s,pathUnchecked:s,pipeline:n}}function oo(t,e,n,i,r,o){return r=i.allowInsecureConnection??r,{then:function(s,a){return(0,EI.sendRequest)(t,e,n,{...i,allowInsecureConnection:r},o).then(s,a)},async asBrowserStream(){if(pF.isNodeLike)throw new Error("`asBrowserStream` is supported only in the browser environment. Use `asNodeStream` instead to obtain the response body stream. If you require a Web stream of the response in Node, consider using `Readable.toWeb` on the result of `asNodeStream`.");return(0,EI.sendRequest)(t,e,n,{...i,allowInsecureConnection:r,responseAsStream:!0},o)},async asNodeStream(){if(pF.isNodeLike)return(0,EI.sendRequest)(t,e,n,{...i,allowInsecureConnection:r,responseAsStream:!0},o);throw new Error("`isNodeStream` is not supported in the browser environment. Use `asBrowserStream` to obtain the response body stream.")}}}});var gF=g(AI=>{"use strict";Object.defineProperty(AI,"__esModule",{value:!0});AI.operationOptionsToRequestParameters=_oe;function _oe(t){return{allowInsecureConnection:t.requestOptions?.allowInsecureConnection,timeout:t.requestOptions?.timeout,skipUrlEncoding:t.requestOptions?.skipUrlEncoding,abortSignal:t.abortSignal,onUploadProgress:t.requestOptions?.onUploadProgress,onDownloadProgress:t.requestOptions?.onDownloadProgress,headers:{...t.requestOptions?.headers},onResponse:t.onResponse}}});var yF=g(CI=>{"use strict";Object.defineProperty(CI,"__esModule",{value:!0});CI.createRestError=Toe;var yoe=Pa(),Eoe=ro();function Toe(t,e){let n=typeof t=="string"?e:t,i=n.body?.error??n.body,r=typeof t=="string"?t:i?.message??`Unexpected status code: ${n.status}`;return new yoe.RestError(r,{statusCode:_F(n.status),code:i?.code,request:n.request,response:Aoe(n)})}function Aoe(t){return{headers:(0,Eoe.createHttpHeaders)(t.headers),request:t.request,status:_F(t.status)??-1}}function _F(t){let e=Number.parseInt(t);return Number.isNaN(e)?void 0:e}});var Ja=g(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.createRestError=ve.operationOptionsToRequestParameters=ve.getClient=ve.createDefaultHttpClient=ve.uint8ArrayToString=ve.stringToUint8Array=ve.isRestError=ve.RestError=ve.createEmptyPipeline=ve.createPipelineRequest=ve.createHttpHeaders=ve.TypeSpecRuntimeLogger=ve.setLogLevel=ve.getLogLevel=ve.createClientLogger=ve.AbortError=void 0;var EF=(un(),At(cn)),Coe=gd();Object.defineProperty(ve,"AbortError",{enumerable:!0,get:function(){return Coe.AbortError}});var Dg=nu();Object.defineProperty(ve,"createClientLogger",{enumerable:!0,get:function(){return Dg.createClientLogger}});Object.defineProperty(ve,"getLogLevel",{enumerable:!0,get:function(){return Dg.getLogLevel}});Object.defineProperty(ve,"setLogLevel",{enumerable:!0,get:function(){return Dg.setLogLevel}});Object.defineProperty(ve,"TypeSpecRuntimeLogger",{enumerable:!0,get:function(){return Dg.TypeSpecRuntimeLogger}});var Soe=ro();Object.defineProperty(ve,"createHttpHeaders",{enumerable:!0,get:function(){return Soe.createHttpHeaders}});EF.__exportStar(BU(),ve);EF.__exportStar(YU(),ve);var woe=Mw();Object.defineProperty(ve,"createPipelineRequest",{enumerable:!0,get:function(){return woe.createPipelineRequest}});var Ioe=Uw();Object.defineProperty(ve,"createEmptyPipeline",{enumerable:!0,get:function(){return Ioe.createEmptyPipeline}});var TF=Pa();Object.defineProperty(ve,"RestError",{enumerable:!0,get:function(){return TF.RestError}});Object.defineProperty(ve,"isRestError",{enumerable:!0,get:function(){return TF.isRestError}});var AF=Yo();Object.defineProperty(ve,"stringToUint8Array",{enumerable:!0,get:function(){return AF.stringToUint8Array}});Object.defineProperty(ve,"uint8ArrayToString",{enumerable:!0,get:function(){return AF.uint8ArrayToString}});var voe=jw();Object.defineProperty(ve,"createDefaultHttpClient",{enumerable:!0,get:function(){return voe.createDefaultHttpClient}});var boe=mF();Object.defineProperty(ve,"getClient",{enumerable:!0,get:function(){return boe.getClient}});var Ooe=gF();Object.defineProperty(ve,"operationOptionsToRequestParameters",{enumerable:!0,get:function(){return Ooe.operationOptionsToRequestParameters}});var Roe=yF();Object.defineProperty(ve,"createRestError",{enumerable:!0,get:function(){return Roe.createRestError}})});var wI=g(SI=>{"use strict";Object.defineProperty(SI,"__esModule",{value:!0});SI.createEmptyPipeline=Poe;var Noe=Ja();function Poe(){return(0,Noe.createEmptyPipeline)()}});var vd=g(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.logger=void 0;var Doe=vo();Mg.logger=(0,Doe.createClientLogger)("core-rest-pipeline")});var CF=g(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.exponentialRetryPolicyName=void 0;bd.exponentialRetryPolicy=Uoe;var Moe=Eg(),koe=Fa(),Loe=$o();bd.exponentialRetryPolicyName="exponentialRetryPolicy";function Uoe(t={}){return(0,koe.retryPolicy)([(0,Moe.exponentialRetryStrategy)({...t,ignoreSystemErrors:!0})],{maxRetries:t.maxRetries??Loe.DEFAULT_RETRY_POLICY_COUNT})}});var SF=g(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.systemErrorRetryPolicyName=void 0;ec.systemErrorRetryPolicy=Hoe;var xoe=Eg(),Foe=Fa(),qoe=$o();ec.systemErrorRetryPolicyName="systemErrorRetryPolicy";function Hoe(t={}){return{name:ec.systemErrorRetryPolicyName,sendRequest:(0,Foe.retryPolicy)([(0,xoe.exponentialRetryStrategy)({...t,ignoreHttpStatusCodes:!0})],{maxRetries:t.maxRetries??qoe.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}});var wF=g(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.throttlingRetryPolicyName=void 0;tc.throttlingRetryPolicy=Voe;var Boe=yg(),joe=Fa(),Yoe=$o();tc.throttlingRetryPolicyName="throttlingRetryPolicy";function Voe(t={}){return{name:tc.throttlingRetryPolicyName,sendRequest:(0,joe.retryPolicy)([(0,Boe.throttlingRetryStrategy)()],{maxRetries:t.maxRetries??Yoe.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}});var Nn=g(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.userAgentPolicyName=ne.userAgentPolicy=ne.tlsPolicyName=ne.tlsPolicy=ne.redirectPolicyName=ne.redirectPolicy=ne.getDefaultProxySettings=ne.proxyPolicyName=ne.proxyPolicy=ne.multipartPolicyName=ne.multipartPolicy=ne.logPolicyName=ne.logPolicy=ne.formDataPolicyName=ne.formDataPolicy=ne.throttlingRetryPolicyName=ne.throttlingRetryPolicy=ne.systemErrorRetryPolicyName=ne.systemErrorRetryPolicy=ne.retryPolicy=ne.exponentialRetryPolicyName=ne.exponentialRetryPolicy=ne.defaultRetryPolicyName=ne.defaultRetryPolicy=ne.decompressResponsePolicyName=ne.decompressResponsePolicy=ne.agentPolicyName=ne.agentPolicy=void 0;var IF=aI();Object.defineProperty(ne,"agentPolicy",{enumerable:!0,get:function(){return IF.agentPolicy}});Object.defineProperty(ne,"agentPolicyName",{enumerable:!0,get:function(){return IF.agentPolicyName}});var vF=Ww();Object.defineProperty(ne,"decompressResponsePolicy",{enumerable:!0,get:function(){return vF.decompressResponsePolicy}});Object.defineProperty(ne,"decompressResponsePolicyName",{enumerable:!0,get:function(){return vF.decompressResponsePolicyName}});var bF=Zw();Object.defineProperty(ne,"defaultRetryPolicy",{enumerable:!0,get:function(){return bF.defaultRetryPolicy}});Object.defineProperty(ne,"defaultRetryPolicyName",{enumerable:!0,get:function(){return bF.defaultRetryPolicyName}});var OF=CF();Object.defineProperty(ne,"exponentialRetryPolicy",{enumerable:!0,get:function(){return OF.exponentialRetryPolicy}});Object.defineProperty(ne,"exponentialRetryPolicyName",{enumerable:!0,get:function(){return OF.exponentialRetryPolicyName}});var $oe=Fa();Object.defineProperty(ne,"retryPolicy",{enumerable:!0,get:function(){return $oe.retryPolicy}});var RF=SF();Object.defineProperty(ne,"systemErrorRetryPolicy",{enumerable:!0,get:function(){return RF.systemErrorRetryPolicy}});Object.defineProperty(ne,"systemErrorRetryPolicyName",{enumerable:!0,get:function(){return RF.systemErrorRetryPolicyName}});var NF=wF();Object.defineProperty(ne,"throttlingRetryPolicy",{enumerable:!0,get:function(){return NF.throttlingRetryPolicy}});Object.defineProperty(ne,"throttlingRetryPolicyName",{enumerable:!0,get:function(){return NF.throttlingRetryPolicyName}});var PF=Jw();Object.defineProperty(ne,"formDataPolicy",{enumerable:!0,get:function(){return PF.formDataPolicy}});Object.defineProperty(ne,"formDataPolicyName",{enumerable:!0,get:function(){return PF.formDataPolicyName}});var DF=Yw();Object.defineProperty(ne,"logPolicy",{enumerable:!0,get:function(){return DF.logPolicy}});Object.defineProperty(ne,"logPolicyName",{enumerable:!0,get:function(){return DF.logPolicyName}});var MF=dI();Object.defineProperty(ne,"multipartPolicy",{enumerable:!0,get:function(){return MF.multipartPolicy}});Object.defineProperty(ne,"multipartPolicyName",{enumerable:!0,get:function(){return MF.multipartPolicyName}});var II=sI();Object.defineProperty(ne,"proxyPolicy",{enumerable:!0,get:function(){return II.proxyPolicy}});Object.defineProperty(ne,"proxyPolicyName",{enumerable:!0,get:function(){return II.proxyPolicyName}});Object.defineProperty(ne,"getDefaultProxySettings",{enumerable:!0,get:function(){return II.getDefaultProxySettings}});var kF=Vw();Object.defineProperty(ne,"redirectPolicy",{enumerable:!0,get:function(){return kF.redirectPolicy}});Object.defineProperty(ne,"redirectPolicyName",{enumerable:!0,get:function(){return kF.redirectPolicyName}});var LF=cI();Object.defineProperty(ne,"tlsPolicy",{enumerable:!0,get:function(){return LF.tlsPolicy}});Object.defineProperty(ne,"tlsPolicyName",{enumerable:!0,get:function(){return LF.tlsPolicyName}});var UF=Gw();Object.defineProperty(ne,"userAgentPolicy",{enumerable:!0,get:function(){return UF.userAgentPolicy}});Object.defineProperty(ne,"userAgentPolicyName",{enumerable:!0,get:function(){return UF.userAgentPolicyName}})});var vI=g(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.logPolicyName=void 0;Od.logPolicy=Goe;var zoe=vd(),xF=Nn();Od.logPolicyName=xF.logPolicyName;function Goe(t={}){return(0,xF.logPolicy)({logger:zoe.logger.info,...t})}});var bI=g(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.redirectPolicyName=void 0;Rd.redirectPolicy=Woe;var FF=Nn();Rd.redirectPolicyName=FF.redirectPolicyName;function Woe(t={}){return(0,FF.redirectPolicy)(t)}});var HF=g(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});kg.getHeaderName=Koe;kg.setPlatformSpecificData=Xoe;var qF=(un(),At(cn)),OI=qF.__importDefault(x("os")),RI=qF.__importDefault(x("process"));function Koe(){return"User-Agent"}async function Xoe(t){if(RI.default&&RI.default.versions){let e=`${OI.default.type()} ${OI.default.release()}; ${OI.default.arch()}`,n=RI.default.versions;n.bun?t.set("Bun",`${n.bun} (${e})`):n.deno?t.set("Deno",`${n.deno} (${e})`):n.node&&t.set("Node",`${n.node} (${e})`)}}});var Lg=g(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.DEFAULT_RETRY_POLICY_COUNT=nc.SDK_VERSION=void 0;nc.SDK_VERSION="1.22.2";nc.DEFAULT_RETRY_POLICY_COUNT=3});var NI=g(Ug=>{"use strict";Object.defineProperty(Ug,"__esModule",{value:!0});Ug.getUserAgentHeaderName=Joe;Ug.getUserAgentValue=ese;var BF=HF(),Qoe=Lg();function Zoe(t){let e=[];for(let[n,i]of t){let r=i?`${n}/${i}`:n;e.push(r)}return e.join(" ")}function Joe(){return(0,BF.getHeaderName)()}async function ese(t){let e=new Map;e.set("core-rest-pipeline",Qoe.SDK_VERSION),await(0,BF.setPlatformSpecificData)(e);let n=Zoe(e);return t?`${t} ${n}`:n}});var PI=g(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.userAgentPolicyName=void 0;rc.userAgentPolicy=tse;var YF=NI(),jF=(0,YF.getUserAgentHeaderName)();rc.userAgentPolicyName="userAgentPolicy";function tse(t={}){let e=(0,YF.getUserAgentValue)(t.userAgentPrefix);return{name:rc.userAgentPolicyName,async sendRequest(n,i){return n.headers.has(jF)||n.headers.set(jF,await e),i(n)}}}});var DI=g(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.hasRawContent=zF;ic.getRawContent=ise;ic.createFileFromStream=ose;ic.createFile=sse;var nse=nr();function rse(t){return!!(t&&typeof t.pipe=="function")}var $F={arrayBuffer:()=>{throw new Error("Not implemented")},bytes:()=>{throw new Error("Not implemented")},slice:()=>{throw new Error("Not implemented")},text:()=>{throw new Error("Not implemented")}},xg=Symbol("rawContent");function zF(t){return typeof t[xg]=="function"}function ise(t){return zF(t)?t[xg]():t}function ose(t,e,n={}){return{...$F,type:n.type??"",lastModified:n.lastModified??new Date().getTime(),webkitRelativePath:n.webkitRelativePath??"",size:n.size??-1,name:e,stream:()=>{let i=t();if(rse(i))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return i},[xg]:t}}function sse(t,e,n={}){return nse.isNodeLike?{...$F,type:n.type??"",lastModified:n.lastModified??new Date().getTime(),webkitRelativePath:n.webkitRelativePath??"",size:t.byteLength,name:e,arrayBuffer:async()=>t.buffer,stream:()=>new Blob([VF(t)]).stream(),[xg]:()=>t}:new File([VF(t)],e,n)}function VF(t){return"resize"in t.buffer?t:t.map(e=>e)}});var MI=g(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.multipartPolicyName=void 0;oc.multipartPolicy=ase;var WF=Nn(),GF=DI();oc.multipartPolicyName=WF.multipartPolicyName;function ase(){let t=(0,WF.multipartPolicy)();return{name:oc.multipartPolicyName,sendRequest:async(e,n)=>{if(e.multipartBody)for(let i of e.multipartBody.parts)(0,GF.hasRawContent)(i.body)&&(i.body=(0,GF.getRawContent)(i.body));return t.sendRequest(e,n)}}}});var kI=g(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.decompressResponsePolicyName=void 0;Nd.decompressResponsePolicy=cse;var KF=Nn();Nd.decompressResponsePolicyName=KF.decompressResponsePolicyName;function cse(){return(0,KF.decompressResponsePolicy)()}});var LI=g(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.defaultRetryPolicyName=void 0;Pd.defaultRetryPolicy=use;var XF=Nn();Pd.defaultRetryPolicyName=XF.defaultRetryPolicyName;function use(t={}){return(0,XF.defaultRetryPolicy)(t)}});var UI=g(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.formDataPolicyName=void 0;Dd.formDataPolicy=lse;var QF=Nn();Dd.formDataPolicyName=QF.formDataPolicyName;function lse(){return(0,QF.formDataPolicy)()}});var FI=g(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.proxyPolicyName=void 0;sc.getDefaultProxySettings=dse;sc.proxyPolicy=hse;var xI=Nn();sc.proxyPolicyName=xI.proxyPolicyName;function dse(t){return(0,xI.getDefaultProxySettings)(t)}function hse(t,e){return(0,xI.proxyPolicy)(t,e)}});var qI=g(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.setClientRequestIdPolicyName=void 0;ac.setClientRequestIdPolicy=fse;ac.setClientRequestIdPolicyName="setClientRequestIdPolicy";function fse(t="x-ms-client-request-id"){return{name:ac.setClientRequestIdPolicyName,async sendRequest(e,n){return e.headers.has(t)||e.headers.set(t,e.requestId),n(e)}}}});var HI=g(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.agentPolicyName=void 0;Md.agentPolicy=pse;var ZF=Nn();Md.agentPolicyName=ZF.agentPolicyName;function pse(t){return(0,ZF.agentPolicy)(t)}});var BI=g(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.tlsPolicyName=void 0;kd.tlsPolicy=mse;var JF=Nn();kd.tlsPolicyName=JF.tlsPolicyName;function mse(t){return(0,JF.tlsPolicy)(t)}});var Fg=g(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.RestError=void 0;Ld.isRestError=gse;var eq=Ja();Ld.RestError=eq.RestError;function gse(t){return(0,eq.isRestError)(t)}});var jI=g(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.tracingPolicyName=void 0;cc.tracingPolicy=Cse;var _se=AA(),yse=Lg(),Ese=NI(),qg=vd(),Ud=nr(),Tse=Fg(),Ase=cd();cc.tracingPolicyName="tracingPolicy";function Cse(t={}){let e=(0,Ese.getUserAgentValue)(t.userAgentPrefix),n=new Ase.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),i=Sse();return{name:cc.tracingPolicyName,async sendRequest(r,o){if(!i)return o(r);let s=await e,a={"http.url":n.sanitizeUrl(r.url),"http.method":r.method,"http.user_agent":s,requestId:r.requestId};s&&(a["http.user_agent"]=s);let{span:c,tracingContext:u}=wse(i,r,a)??{};if(!c||!u)return o(r);try{let l=await i.withContext(u,o,r);return vse(c,l),l}catch(l){throw Ise(c,l),l}}}}function Sse(){try{return(0,_se.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:yse.SDK_VERSION})}catch(t){qg.logger.warning(`Error when creating the TracingClient: ${(0,Ud.getErrorMessage)(t)}`);return}}function wse(t,e,n){try{let{span:i,updatedOptions:r}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:n});if(!i.isRecording()){i.end();return}let o=t.createRequestHeaders(r.tracingOptions.tracingContext);for(let[s,a]of Object.entries(o))e.headers.set(s,a);return{span:i,tracingContext:r.tracingOptions.tracingContext}}catch(i){qg.logger.warning(`Skipping creating a tracing span due to an error: ${(0,Ud.getErrorMessage)(i)}`);return}}function Ise(t,e){try{t.setStatus({status:"error",error:(0,Ud.isError)(e)?e:void 0}),(0,Tse.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(n){qg.logger.warning(`Skipping tracing span processing due to an error: ${(0,Ud.getErrorMessage)(n)}`)}}function vse(t,e){try{t.setAttribute("http.status_code",e.status);let n=e.headers.get("x-ms-request-id");n&&t.setAttribute("serviceRequestId",n),e.status>=400&&t.setStatus({status:"error"}),t.end()}catch(n){qg.logger.warning(`Skipping tracing span processing due to an error: ${(0,Ud.getErrorMessage)(n)}`)}}});var VI=g(YI=>{"use strict";Object.defineProperty(YI,"__esModule",{value:!0});YI.wrapAbortSignalLike=bse;function bse(t){if(t instanceof AbortSignal)return{abortSignal:t};if(t.aborted)return{abortSignal:AbortSignal.abort(t.reason)};let e=new AbortController,n=!0;function i(){n&&(t.removeEventListener("abort",r),n=!1)}function r(){e.abort(t.reason),i()}return t.addEventListener("abort",r),{abortSignal:e.signal,cleanup:i}}});var tq=g(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.wrapAbortSignalLikePolicyName=void 0;uc.wrapAbortSignalLikePolicy=Rse;var Ose=VI();uc.wrapAbortSignalLikePolicyName="wrapAbortSignalLikePolicy";function Rse(){return{name:uc.wrapAbortSignalLikePolicyName,sendRequest:async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:n,cleanup:i}=(0,Ose.wrapAbortSignalLike)(t.abortSignal);t.abortSignal=n;try{return await e(t)}finally{i?.()}}}}});var iq=g($I=>{"use strict";Object.defineProperty($I,"__esModule",{value:!0});$I.createPipelineFromOptions=Yse;var Nse=vI(),Pse=wI(),Dse=bI(),Mse=PI(),nq=MI(),kse=kI(),Lse=LI(),Use=UI(),rq=nr(),xse=FI(),Fse=qI(),qse=HI(),Hse=BI(),Bse=jI(),jse=tq();function Yse(t){let e=(0,Pse.createEmptyPipeline)();return rq.isNodeLike&&(t.agent&&e.addPolicy((0,qse.agentPolicy)(t.agent)),t.tlsOptions&&e.addPolicy((0,Hse.tlsPolicy)(t.tlsOptions)),e.addPolicy((0,xse.proxyPolicy)(t.proxyOptions)),e.addPolicy((0,kse.decompressResponsePolicy)())),e.addPolicy((0,jse.wrapAbortSignalLikePolicy)()),e.addPolicy((0,Use.formDataPolicy)(),{beforePolicies:[nq.multipartPolicyName]}),e.addPolicy((0,Mse.userAgentPolicy)(t.userAgentOptions)),e.addPolicy((0,Fse.setClientRequestIdPolicy)(t.telemetryOptions?.clientRequestIdHeaderName)),e.addPolicy((0,nq.multipartPolicy)(),{afterPhase:"Deserialize"}),e.addPolicy((0,Lse.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),e.addPolicy((0,Bse.tracingPolicy)({...t.userAgentOptions,...t.loggingOptions}),{afterPhase:"Retry"}),rq.isNodeLike&&e.addPolicy((0,Dse.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),e.addPolicy((0,Nse.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),e}});var oq=g(zI=>{"use strict";Object.defineProperty(zI,"__esModule",{value:!0});zI.createDefaultHttpClient=zse;var Vse=Ja(),$se=VI();function zse(){let t=(0,Vse.createDefaultHttpClient)();return{async sendRequest(e){let{abortSignal:n,cleanup:i}=e.abortSignal?(0,$se.wrapAbortSignalLike)(e.abortSignal):{};try{return e.abortSignal=n,await t.sendRequest(e)}finally{i?.()}}}}});var sq=g(GI=>{"use strict";Object.defineProperty(GI,"__esModule",{value:!0});GI.createHttpHeaders=Wse;var Gse=Ja();function Wse(t){return(0,Gse.createHttpHeaders)(t)}});var aq=g(WI=>{"use strict";Object.defineProperty(WI,"__esModule",{value:!0});WI.createPipelineRequest=Xse;var Kse=Ja();function Xse(t){return(0,Kse.createPipelineRequest)(t)}});var uq=g(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.exponentialRetryPolicyName=void 0;xd.exponentialRetryPolicy=Qse;var cq=Nn();xd.exponentialRetryPolicyName=cq.exponentialRetryPolicyName;function Qse(t={}){return(0,cq.exponentialRetryPolicy)(t)}});var dq=g(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.systemErrorRetryPolicyName=void 0;Fd.systemErrorRetryPolicy=Zse;var lq=Nn();Fd.systemErrorRetryPolicyName=lq.systemErrorRetryPolicyName;function Zse(t={}){return(0,lq.systemErrorRetryPolicy)(t)}});var fq=g(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.throttlingRetryPolicyName=void 0;qd.throttlingRetryPolicy=Jse;var hq=Nn();qd.throttlingRetryPolicyName=hq.throttlingRetryPolicyName;function Jse(t={}){return(0,hq.throttlingRetryPolicy)(t)}});var pq=g(KI=>{"use strict";Object.defineProperty(KI,"__esModule",{value:!0});KI.retryPolicy=iae;var eae=vo(),tae=Lg(),nae=Nn(),rae=(0,eae.createClientLogger)("core-rest-pipeline retryPolicy");function iae(t,e={maxRetries:tae.DEFAULT_RETRY_POLICY_COUNT}){return(0,nae.retryPolicy)(t,{logger:rae,...e})}});var XI=g(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.DEFAULT_CYCLER_OPTIONS=void 0;lc.createTokenCycler=aae;var oae=nr();lc.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function sae(t,e,n){async function i(){if(Date.now()<n)try{return await t()}catch{return null}else{let o=await t();if(o===null)throw new Error("Failed to refresh access token.");return o}}let r=await i();for(;r===null;)await(0,oae.delay)(e),r=await i();return r}function aae(t,e){let n=null,i=null,r,o={...lc.DEFAULT_CYCLER_OPTIONS,...e},s={get isRefreshing(){return n!==null},get shouldRefresh(){return s.isRefreshing?!1:i?.refreshAfterTimestamp&&i.refreshAfterTimestamp<Date.now()?!0:(i?.expiresOnTimestamp??0)-o.refreshWindowInMs<Date.now()},get mustRefresh(){return i===null||i.expiresOnTimestamp-o.forcedRefreshWindowInMs<Date.now()}};function a(c,u){return s.isRefreshing||(n=sae(()=>t.getToken(c,u),o.retryIntervalInMs,i?.expiresOnTimestamp??Date.now()).then(d=>(n=null,i=d,r=u.tenantId,i)).catch(d=>{throw n=null,i=null,r=void 0,d})),n}return async(c,u)=>{let l=!!u.claims,d=r!==u.tenantId;return l&&(i=null),d||l||s.mustRefresh?a(c,u):(s.shouldRefresh&&a(c,u),i)}}});var Eq=g(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.bearerTokenAuthenticationPolicyName=void 0;Go.bearerTokenAuthenticationPolicy=hae;Go.parseChallenges=yq;var cae=XI(),uae=vd(),lae=Fg();Go.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function Hg(t,e){try{return[await e(t),void 0]}catch(n){if((0,lae.isRestError)(n)&&n.response)return[n.response,n];throw n}}async function dae(t){let{scopes:e,getAccessToken:n,request:i}=t,r={abortSignal:i.abortSignal,tracingOptions:i.tracingOptions,enableCae:!0},o=await n(e,r);o&&t.request.headers.set("Authorization",`Bearer ${o.token}`)}function mq(t){return t.status===401&&t.headers.has("WWW-Authenticate")}async function gq(t,e){let{scopes:n}=t,i=await t.getAccessToken(n,{enableCae:!0,claims:e});return i?(t.request.headers.set("Authorization",`${i.tokenType??"Bearer"} ${i.token}`),!0):!1}function hae(t){let{credential:e,scopes:n,challengeCallbacks:i}=t,r=t.logger||uae.logger,o={authorizeRequest:i?.authorizeRequest?.bind(i)??dae,authorizeRequestOnChallenge:i?.authorizeRequestOnChallenge?.bind(i)},s=e?(0,cae.createTokenCycler)(e):()=>Promise.resolve(null);return{name:Go.bearerTokenAuthenticationPolicyName,async sendRequest(a,c){if(!a.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await o.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:a,getAccessToken:s,logger:r});let u,l,d;if([u,l]=await Hg(a,c),mq(u)){let f=_q(u.headers.get("WWW-Authenticate"));if(f){let m;try{m=atob(f)}catch{return r.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${f}`),u}d=await gq({scopes:Array.isArray(n)?n:[n],response:u,request:a,getAccessToken:s,logger:r},m),d&&([u,l]=await Hg(a,c))}else if(o.authorizeRequestOnChallenge&&(d=await o.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:a,response:u,getAccessToken:s,logger:r}),d&&([u,l]=await Hg(a,c)),mq(u)&&(f=_q(u.headers.get("WWW-Authenticate")),f))){let m;try{m=atob(f)}catch{return r.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${f}`),u}d=await gq({scopes:Array.isArray(n)?n:[n],response:u,request:a,getAccessToken:s,logger:r},m),d&&([u,l]=await Hg(a,c))}}if(l)throw l;return u}}}function yq(t){let e=/(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g,n=/(\w+)="([^"]*)"/g,i=[],r;for(;(r=e.exec(t))!==null;){let o=r[1],s=r[2],a={},c;for(;(c=n.exec(s))!==null;)a[c[1]]=c[2];i.push({scheme:o,params:a})}return i}function _q(t){return t?yq(t).find(n=>n.scheme==="Bearer"&&n.params.claims&&n.params.error==="insufficient_claims")?.params.claims:void 0}});var Tq=g(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.ndJsonPolicyName=void 0;dc.ndJsonPolicy=fae;dc.ndJsonPolicyName="ndJsonPolicy";function fae(){return{name:dc.ndJsonPolicyName,async sendRequest(t,e){if(typeof t.body=="string"&&t.body.startsWith("[")){let n=JSON.parse(t.body);Array.isArray(n)&&(t.body=n.map(i=>JSON.stringify(i)+`
|
|
60
|
+
`).join(""))}return e(t)}}}});var Cq=g(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.auxiliaryAuthenticationHeaderPolicyName=void 0;Wo.auxiliaryAuthenticationHeaderPolicy=_ae;var pae=XI(),mae=vd();Wo.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var Aq="x-ms-authorization-auxiliary";async function gae(t){let{scopes:e,getAccessToken:n,request:i}=t,r={abortSignal:i.abortSignal,tracingOptions:i.tracingOptions};return(await n(e,r))?.token??""}function _ae(t){let{credentials:e,scopes:n}=t,i=t.logger||mae.logger,r=new WeakMap;return{name:Wo.auxiliaryAuthenticationHeaderPolicyName,async sendRequest(o,s){if(!o.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication for auxiliary header is not permitted for non-TLS protected (non-https) URLs.");if(!e||e.length===0)return i.info(`${Wo.auxiliaryAuthenticationHeaderPolicyName} header will not be set due to empty credentials.`),s(o);let a=[];for(let u of e){let l=r.get(u);l||(l=(0,pae.createTokenCycler)(u),r.set(u,l)),a.push(gae({scopes:Array.isArray(n)?n:[n],request:o,getAccessToken:l,logger:i}))}let c=(await Promise.all(a)).filter(u=>!!u);return c.length===0?(i.warning(`None of the auxiliary tokens are valid. ${Aq} header will not be set.`),s(o)):(o.headers.set(Aq,c.map(u=>`Bearer ${u}`).join(", ")),s(o))}}}});var Gr=g(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.createFileFromStream=B.createFile=B.agentPolicyName=B.agentPolicy=B.auxiliaryAuthenticationHeaderPolicyName=B.auxiliaryAuthenticationHeaderPolicy=B.ndJsonPolicyName=B.ndJsonPolicy=B.bearerTokenAuthenticationPolicyName=B.bearerTokenAuthenticationPolicy=B.formDataPolicyName=B.formDataPolicy=B.tlsPolicyName=B.tlsPolicy=B.userAgentPolicyName=B.userAgentPolicy=B.defaultRetryPolicy=B.tracingPolicyName=B.tracingPolicy=B.retryPolicy=B.throttlingRetryPolicyName=B.throttlingRetryPolicy=B.systemErrorRetryPolicyName=B.systemErrorRetryPolicy=B.redirectPolicyName=B.redirectPolicy=B.getDefaultProxySettings=B.proxyPolicyName=B.proxyPolicy=B.multipartPolicyName=B.multipartPolicy=B.logPolicyName=B.logPolicy=B.setClientRequestIdPolicyName=B.setClientRequestIdPolicy=B.exponentialRetryPolicyName=B.exponentialRetryPolicy=B.decompressResponsePolicyName=B.decompressResponsePolicy=B.isRestError=B.RestError=B.createPipelineRequest=B.createHttpHeaders=B.createDefaultHttpClient=B.createPipelineFromOptions=B.createEmptyPipeline=void 0;var yae=wI();Object.defineProperty(B,"createEmptyPipeline",{enumerable:!0,get:function(){return yae.createEmptyPipeline}});var Eae=iq();Object.defineProperty(B,"createPipelineFromOptions",{enumerable:!0,get:function(){return Eae.createPipelineFromOptions}});var Tae=oq();Object.defineProperty(B,"createDefaultHttpClient",{enumerable:!0,get:function(){return Tae.createDefaultHttpClient}});var Aae=sq();Object.defineProperty(B,"createHttpHeaders",{enumerable:!0,get:function(){return Aae.createHttpHeaders}});var Cae=aq();Object.defineProperty(B,"createPipelineRequest",{enumerable:!0,get:function(){return Cae.createPipelineRequest}});var Sq=Fg();Object.defineProperty(B,"RestError",{enumerable:!0,get:function(){return Sq.RestError}});Object.defineProperty(B,"isRestError",{enumerable:!0,get:function(){return Sq.isRestError}});var wq=kI();Object.defineProperty(B,"decompressResponsePolicy",{enumerable:!0,get:function(){return wq.decompressResponsePolicy}});Object.defineProperty(B,"decompressResponsePolicyName",{enumerable:!0,get:function(){return wq.decompressResponsePolicyName}});var Iq=uq();Object.defineProperty(B,"exponentialRetryPolicy",{enumerable:!0,get:function(){return Iq.exponentialRetryPolicy}});Object.defineProperty(B,"exponentialRetryPolicyName",{enumerable:!0,get:function(){return Iq.exponentialRetryPolicyName}});var vq=qI();Object.defineProperty(B,"setClientRequestIdPolicy",{enumerable:!0,get:function(){return vq.setClientRequestIdPolicy}});Object.defineProperty(B,"setClientRequestIdPolicyName",{enumerable:!0,get:function(){return vq.setClientRequestIdPolicyName}});var bq=vI();Object.defineProperty(B,"logPolicy",{enumerable:!0,get:function(){return bq.logPolicy}});Object.defineProperty(B,"logPolicyName",{enumerable:!0,get:function(){return bq.logPolicyName}});var Oq=MI();Object.defineProperty(B,"multipartPolicy",{enumerable:!0,get:function(){return Oq.multipartPolicy}});Object.defineProperty(B,"multipartPolicyName",{enumerable:!0,get:function(){return Oq.multipartPolicyName}});var QI=FI();Object.defineProperty(B,"proxyPolicy",{enumerable:!0,get:function(){return QI.proxyPolicy}});Object.defineProperty(B,"proxyPolicyName",{enumerable:!0,get:function(){return QI.proxyPolicyName}});Object.defineProperty(B,"getDefaultProxySettings",{enumerable:!0,get:function(){return QI.getDefaultProxySettings}});var Rq=bI();Object.defineProperty(B,"redirectPolicy",{enumerable:!0,get:function(){return Rq.redirectPolicy}});Object.defineProperty(B,"redirectPolicyName",{enumerable:!0,get:function(){return Rq.redirectPolicyName}});var Nq=dq();Object.defineProperty(B,"systemErrorRetryPolicy",{enumerable:!0,get:function(){return Nq.systemErrorRetryPolicy}});Object.defineProperty(B,"systemErrorRetryPolicyName",{enumerable:!0,get:function(){return Nq.systemErrorRetryPolicyName}});var Pq=fq();Object.defineProperty(B,"throttlingRetryPolicy",{enumerable:!0,get:function(){return Pq.throttlingRetryPolicy}});Object.defineProperty(B,"throttlingRetryPolicyName",{enumerable:!0,get:function(){return Pq.throttlingRetryPolicyName}});var Sae=pq();Object.defineProperty(B,"retryPolicy",{enumerable:!0,get:function(){return Sae.retryPolicy}});var Dq=jI();Object.defineProperty(B,"tracingPolicy",{enumerable:!0,get:function(){return Dq.tracingPolicy}});Object.defineProperty(B,"tracingPolicyName",{enumerable:!0,get:function(){return Dq.tracingPolicyName}});var wae=LI();Object.defineProperty(B,"defaultRetryPolicy",{enumerable:!0,get:function(){return wae.defaultRetryPolicy}});var Mq=PI();Object.defineProperty(B,"userAgentPolicy",{enumerable:!0,get:function(){return Mq.userAgentPolicy}});Object.defineProperty(B,"userAgentPolicyName",{enumerable:!0,get:function(){return Mq.userAgentPolicyName}});var kq=BI();Object.defineProperty(B,"tlsPolicy",{enumerable:!0,get:function(){return kq.tlsPolicy}});Object.defineProperty(B,"tlsPolicyName",{enumerable:!0,get:function(){return kq.tlsPolicyName}});var Lq=UI();Object.defineProperty(B,"formDataPolicy",{enumerable:!0,get:function(){return Lq.formDataPolicy}});Object.defineProperty(B,"formDataPolicyName",{enumerable:!0,get:function(){return Lq.formDataPolicyName}});var Uq=Eq();Object.defineProperty(B,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:function(){return Uq.bearerTokenAuthenticationPolicy}});Object.defineProperty(B,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:function(){return Uq.bearerTokenAuthenticationPolicyName}});var xq=Tq();Object.defineProperty(B,"ndJsonPolicy",{enumerable:!0,get:function(){return xq.ndJsonPolicy}});Object.defineProperty(B,"ndJsonPolicyName",{enumerable:!0,get:function(){return xq.ndJsonPolicyName}});var Fq=Cq();Object.defineProperty(B,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:function(){return Fq.auxiliaryAuthenticationHeaderPolicy}});Object.defineProperty(B,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:function(){return Fq.auxiliaryAuthenticationHeaderPolicyName}});var qq=HI();Object.defineProperty(B,"agentPolicy",{enumerable:!0,get:function(){return qq.agentPolicy}});Object.defineProperty(B,"agentPolicyName",{enumerable:!0,get:function(){return qq.agentPolicyName}});var Hq=DI();Object.defineProperty(B,"createFile",{enumerable:!0,get:function(){return Hq.createFile}});Object.defineProperty(B,"createFileFromStream",{enumerable:!0,get:function(){return Hq.createFileFromStream}})});var Bq=g(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.state=void 0;Bg.state={operationRequestMap:new WeakMap}});var Hd=g(jg=>{"use strict";Object.defineProperty(jg,"__esModule",{value:!0});jg.getOperationArgumentValueFromParameter=Vq;jg.getOperationRequestInfo=zq;var jq=Bq();function Vq(t,e,n){let i=e.parameterPath,r=e.mapper,o;if(typeof i=="string"&&(i=[i]),Array.isArray(i)){if(i.length>0)if(r.isConstant)o=r.defaultValue;else{let s=Yq(t,i);!s.propertyFound&&n&&(s=Yq(n,i));let a=!1;s.propertyFound||(a=r.required||i[0]==="options"&&i.length===2),o=a?r.defaultValue:s.propertyValue}}else{r.required&&(o={});for(let s in i){let a=r.type.modelProperties[s],c=i[s],u=Vq(t,{parameterPath:c,mapper:a},n);u!==void 0&&(o||(o={}),o[s]=u)}}return o}function Yq(t,e){let n={propertyFound:!1},i=0;for(;i<e.length;++i){let r=e[i];if(t&&r in t)t=t[r];else break}return i===e.length&&(n.propertyValue=t,n.propertyFound=!0),n}var $q=Symbol.for("@azure/core-client original request");function Iae(t){return $q in t}function zq(t){if(Iae(t))return zq(t[$q]);let e=jq.state.operationRequestMap.get(t);return e||(e={},jq.state.operationRequestMap.set(t,e)),e}});var JI=g(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.deserializationPolicyName=void 0;hc.deserializationPolicy=Rae;var vae=fd(),Yg=Gr(),Gq=md(),ZI=Hd(),bae=["application/json","text/json"],Oae=["application/xml","application/atom+xml"];hc.deserializationPolicyName="deserializationPolicy";function Rae(t={}){let e=t.expectedContentTypes?.json??bae,n=t.expectedContentTypes?.xml??Oae,i=t.parseXML,r=t.serializerOptions,o={xml:{rootName:r?.xml.rootName??"",includeRoot:r?.xml.includeRoot??!1,xmlCharKey:r?.xml.xmlCharKey??vae.XML_CHARKEY}};return{name:hc.deserializationPolicyName,async sendRequest(s,a){let c=await a(s);return Dae(e,n,c,o,i)}}}function Nae(t){let e,n=t.request,i=(0,ZI.getOperationRequestInfo)(n),r=i?.operationSpec;return r&&(i?.operationResponseGetter?e=i?.operationResponseGetter(r,t):e=r.responses[t.status]),e}function Pae(t){let e=t.request,i=(0,ZI.getOperationRequestInfo)(e)?.shouldDeserialize,r;return i===void 0?r=!0:typeof i=="boolean"?r=i:r=i(t),r}async function Dae(t,e,n,i,r){let o=await Lae(t,e,n,i,r);if(!Pae(o))return o;let a=(0,ZI.getOperationRequestInfo)(o.request)?.operationSpec;if(!a||!a.responses)return o;let c=Nae(o),{error:u,shouldReturnResponse:l}=kae(o,a,c,i);if(u)throw u;if(l)return o;if(c){if(c.bodyMapper){let d=o.parsedBody;a.isXML&&c.bodyMapper.type.name===Gq.MapperTypeNames.Sequence&&(d=typeof d=="object"?d[c.bodyMapper.xmlElementName]:[]);try{o.parsedBody=a.serializer.deserialize(c.bodyMapper,d,"operationRes.parsedBody",i)}catch(f){throw new Yg.RestError(`Error ${f} occurred in deserializing the responseBody - ${o.bodyAsText}`,{statusCode:o.status,request:o.request,response:o})}}else a.httpMethod==="HEAD"&&(o.parsedBody=n.status>=200&&n.status<300);c.headersMapper&&(o.parsedHeaders=a.serializer.deserialize(c.headersMapper,o.headers.toJSON(),"operationRes.parsedHeaders",{xml:{},ignoreUnknownProperties:!0}))}return o}function Mae(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}function kae(t,e,n,i){let r=200<=t.status&&t.status<300;if(Mae(e)?r:!!n)if(n){if(!n.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1};let s=n??e.responses.default,a=t.request.streamResponseStatusCodes?.has(t.status)?`Unexpected status code: ${t.status}`:t.bodyAsText,c=new Yg.RestError(a,{statusCode:t.status,request:t.request,response:t});if(!s&&!(t.parsedBody?.error?.code&&t.parsedBody?.error?.message))throw c;let u=s?.bodyMapper,l=s?.headersMapper;try{if(t.parsedBody){let d=t.parsedBody,f;if(u){let _=d;if(e.isXML&&u.type.name===Gq.MapperTypeNames.Sequence){_=[];let E=u.xmlElementName;typeof d=="object"&&E&&(_=d[E])}f=e.serializer.deserialize(u,_,"error.response.parsedBody",i)}let m=d.error||f||d;c.code=m.code,m.message&&(c.message=m.message),u&&(c.response.parsedBody=f)}t.headers&&l&&(c.response.parsedHeaders=e.serializer.deserialize(l,t.headers.toJSON(),"operationRes.parsedHeaders"))}catch(d){c.message=`Error "${d.message}" occurred in deserializing the responseBody - "${t.bodyAsText}" for the default response.`}return{error:c,shouldReturnResponse:!1}}async function Lae(t,e,n,i,r){if(!n.request.streamResponseStatusCodes?.has(n.status)&&n.bodyAsText){let o=n.bodyAsText,s=n.headers.get("Content-Type")||"",a=s?s.split(";").map(c=>c.toLowerCase()):[];try{if(a.length===0||a.some(c=>t.indexOf(c)!==-1))return n.parsedBody=JSON.parse(o),n;if(a.some(c=>e.indexOf(c)!==-1)){if(!r)throw new Error("Parsing XML not supported.");let c=await r(o,i.xml);return n.parsedBody=c,n}}catch(c){let u=`Error "${c}" occurred while parsing the response body - ${n.bodyAsText}.`,l=c.code||Yg.RestError.PARSE_ERROR;throw new Yg.RestError(u,{code:l,statusCode:n.status,request:n.request,response:n})}}return n}});var $g=g(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});Vg.getStreamingResponseStatusCodes=xae;Vg.getPathStringFromParameter=Fae;var Uae=md();function xae(t){let e=new Set;for(let n in t.responses){let i=t.responses[n];i.bodyMapper&&i.bodyMapper.type.name===Uae.MapperTypeNames.Stream&&e.add(Number(n))}return e}function Fae(t){let{parameterPath:e,mapper:n}=t,i;return typeof e=="string"?i=e:Array.isArray(e)?i=e.join("."):i=n.serializedName,i}});var n0=g(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.serializationPolicyName=void 0;so.serializationPolicy=qae;so.serializeHeaders=Wq;so.serializeRequestBody=Kq;var t0=fd(),zg=Hd(),e0=md(),Bd=$g();so.serializationPolicyName="serializationPolicy";function qae(t={}){let e=t.stringifyXML;return{name:so.serializationPolicyName,async sendRequest(n,i){let r=(0,zg.getOperationRequestInfo)(n),o=r?.operationSpec,s=r?.operationArguments;return o&&s&&(Wq(n,s,o),Kq(n,s,o,e)),i(n)}}}function Wq(t,e,n){if(n.headerParameters)for(let r of n.headerParameters){let o=(0,zg.getOperationArgumentValueFromParameter)(e,r);if(o!=null||r.mapper.required){o=n.serializer.serialize(r.mapper,o,(0,Bd.getPathStringFromParameter)(r));let s=r.mapper.headerCollectionPrefix;if(s)for(let a of Object.keys(o))t.headers.set(s+a,o[a]);else t.headers.set(r.mapper.serializedName||(0,Bd.getPathStringFromParameter)(r),o)}}let i=e.options?.requestOptions?.customHeaders;if(i)for(let r of Object.keys(i))t.headers.set(r,i[r])}function Kq(t,e,n,i=function(){throw new Error("XML serialization unsupported!")}){let r=e.options?.serializerOptions,o={xml:{rootName:r?.xml.rootName??"",includeRoot:r?.xml.includeRoot??!1,xmlCharKey:r?.xml.xmlCharKey??t0.XML_CHARKEY}},s=o.xml.xmlCharKey;if(n.requestBody&&n.requestBody.mapper){t.body=(0,zg.getOperationArgumentValueFromParameter)(e,n.requestBody);let a=n.requestBody.mapper,{required:c,serializedName:u,xmlName:l,xmlElementName:d,xmlNamespace:f,xmlNamespacePrefix:m,nullable:_}=a,E=a.type.name;try{if(t.body!==void 0&&t.body!==null||_&&t.body===null||c){let I=(0,Bd.getPathStringFromParameter)(n.requestBody);t.body=n.serializer.serialize(a,t.body,I,o);let y=E===e0.MapperTypeNames.Stream;if(n.isXML){let A=m?`xmlns:${m}`:"xmlns",S=Hae(f,A,E,t.body,o);E===e0.MapperTypeNames.Sequence?t.body=i(Bae(S,d||l||u,A,f),{rootName:l||u,xmlCharKey:s}):y||(t.body=i(S,{rootName:l||u,xmlCharKey:s}))}else{if(E===e0.MapperTypeNames.String&&(n.contentType?.match("text/plain")||n.mediaType==="text"))return;y||(t.body=JSON.stringify(t.body))}}}catch(I){throw new Error(`Error "${I.message}" occurred in serializing the payload - ${JSON.stringify(u,void 0," ")}.`)}}else if(n.formDataParameters&&n.formDataParameters.length>0){t.formData={};for(let a of n.formDataParameters){let c=(0,zg.getOperationArgumentValueFromParameter)(e,a);if(c!=null){let u=a.mapper.serializedName||(0,Bd.getPathStringFromParameter)(a);t.formData[u]=n.serializer.serialize(a.mapper,c,(0,Bd.getPathStringFromParameter)(a),o)}}}}function Hae(t,e,n,i,r){if(t&&!["Composite","Sequence","Dictionary"].includes(n)){let o={};return o[r.xml.xmlCharKey]=i,o[t0.XML_ATTRKEY]={[e]:t},o}return i}function Bae(t,e,n,i){if(Array.isArray(t)||(t=[t]),!n||!i)return{[e]:t};let r={[e]:t};return r[t0.XML_ATTRKEY]={[n]:i},r}});var i0=g(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});r0.createClientPipeline=Vae;var jae=JI(),Xq=Gr(),Yae=n0();function Vae(t={}){let e=(0,Xq.createPipelineFromOptions)(t??{});return t.credentialOptions&&e.addPolicy((0,Xq.bearerTokenAuthenticationPolicy)({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy((0,Yae.serializationPolicy)(t.serializationOptions),{phase:"Serialize"}),e.addPolicy((0,jae.deserializationPolicy)(t.deserializationOptions),{phase:"Deserialize"}),e}});var Qq=g(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.getCachedDefaultHttpClient=zae;var $ae=Gr(),o0;function zae(){return o0||(o0=(0,$ae.createDefaultHttpClient)()),o0}});var tH=g(Gg=>{"use strict";Object.defineProperty(Gg,"__esModule",{value:!0});Gg.getRequestUrl=Wae;Gg.appendQueryParams=eH;var Jq=Hd(),a0=$g(),Gae={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function Wae(t,e,n,i){let r=Kae(e,n,i),o=!1,s=Zq(t,r);if(e.path){let u=Zq(e.path,r);e.path==="/{nextLink}"&&u.startsWith("/")&&(u=u.substring(1)),Xae(u)?(s=u,o=!0):s=Qae(s,u)}let{queryParams:a,sequenceParams:c}=Zae(e,n,i);return s=eH(s,a,c,o),s}function Zq(t,e){let n=t;for(let[i,r]of e)n=n.split(i).join(r);return n}function Kae(t,e,n){let i=new Map;if(t.urlParameters?.length)for(let r of t.urlParameters){let o=(0,Jq.getOperationArgumentValueFromParameter)(e,r,n),s=(0,a0.getPathStringFromParameter)(r);o=t.serializer.serialize(r.mapper,o,s),r.skipEncoding||(o=encodeURIComponent(o)),i.set(`{${r.mapper.serializedName||s}}`,o)}return i}function Xae(t){return t.includes("://")}function Qae(t,e){if(!e)return t;let n=new URL(t),i=n.pathname;i.endsWith("/")||(i=`${i}/`),e.startsWith("/")&&(e=e.substring(1));let r=e.indexOf("?");if(r!==-1){let o=e.substring(0,r),s=e.substring(r+1);i=i+o,s&&(n.search=n.search?`${n.search}&${s}`:s)}else i=i+e;return n.pathname=i,n.toString()}function Zae(t,e,n){let i=new Map,r=new Set;if(t.queryParameters?.length)for(let o of t.queryParameters){o.mapper.type.name==="Sequence"&&o.mapper.serializedName&&r.add(o.mapper.serializedName);let s=(0,Jq.getOperationArgumentValueFromParameter)(e,o,n);if(s!=null||o.mapper.required){s=t.serializer.serialize(o.mapper,s,(0,a0.getPathStringFromParameter)(o));let a=o.collectionFormat?Gae[o.collectionFormat]:"";if(Array.isArray(s)&&(s=s.map(c=>c??"")),o.collectionFormat==="Multi"&&s.length===0)continue;Array.isArray(s)&&(o.collectionFormat==="SSV"||o.collectionFormat==="TSV")&&(s=s.join(a)),o.skipEncoding||(Array.isArray(s)?s=s.map(c=>encodeURIComponent(c)):s=encodeURIComponent(s)),Array.isArray(s)&&(o.collectionFormat==="CSV"||o.collectionFormat==="Pipes")&&(s=s.join(a)),i.set(o.mapper.serializedName||(0,a0.getPathStringFromParameter)(o),s)}}return{queryParams:i,sequenceParams:r}}function Jae(t){let e=new Map;if(!t||t[0]!=="?")return e;t=t.slice(1);let n=t.split("&");for(let i of n){let[r,o]=i.split("=",2),s=e.get(r);s?Array.isArray(s)?s.push(o):e.set(r,[s,o]):e.set(r,o)}return e}function eH(t,e,n,i=!1){if(e.size===0)return t;let r=new URL(t),o=Jae(r.search);for(let[a,c]of e){let u=o.get(a);if(Array.isArray(u))if(Array.isArray(c)){u.push(...c);let l=new Set(u);o.set(a,Array.from(l))}else u.push(c);else u?(Array.isArray(c)?c.unshift(u):n.has(a)&&o.set(a,[u,c]),i||o.set(a,c)):o.set(a,c)}let s=[];for(let[a,c]of o)if(typeof c=="string")s.push(`${a}=${c}`);else if(Array.isArray(c))for(let u of c)s.push(`${a}=${u}`);else s.push(`${a}=${c}`);return r.search=s.length?`?${s.join("&")}`:"",r.toString()}});var c0=g(Wg=>{"use strict";Object.defineProperty(Wg,"__esModule",{value:!0});Wg.logger=void 0;var ece=vo();Wg.logger=(0,ece.createClientLogger)("core-client")});var rH=g(Kg=>{"use strict";Object.defineProperty(Kg,"__esModule",{value:!0});Kg.ServiceClient=void 0;var tce=Gr(),nce=i0(),nH=Iw(),rce=Qq(),ice=Hd(),oce=tH(),sce=$g(),ace=c0(),u0=class{_endpoint;_requestContentType;_allowInsecureConnection;_httpClient;pipeline;constructor(e={}){if(this._requestContentType=e.requestContentType,this._endpoint=e.endpoint??e.baseUri,e.baseUri&&ace.logger.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||(0,rce.getCachedDefaultHttpClient)(),this.pipeline=e.pipeline||cce(e),e.additionalPolicies?.length)for(let{policy:n,position:i}of e.additionalPolicies){let r=i==="perRetry"?"Sign":void 0;this.pipeline.addPolicy(n,{afterPhase:r})}}async sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,n){let i=n.baseUrl||this._endpoint;if(!i)throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.");let r=(0,oce.getRequestUrl)(i,n,e,this),o=(0,tce.createPipelineRequest)({url:r});o.method=n.httpMethod;let s=(0,ice.getOperationRequestInfo)(o);s.operationSpec=n,s.operationArguments=e;let a=n.contentType||this._requestContentType;a&&n.requestBody&&o.headers.set("Content-Type",a);let c=e.options;if(c){let u=c.requestOptions;u&&(u.timeout&&(o.timeout=u.timeout),u.onUploadProgress&&(o.onUploadProgress=u.onUploadProgress),u.onDownloadProgress&&(o.onDownloadProgress=u.onDownloadProgress),u.shouldDeserialize!==void 0&&(s.shouldDeserialize=u.shouldDeserialize),u.allowInsecureConnection&&(o.allowInsecureConnection=!0)),c.abortSignal&&(o.abortSignal=c.abortSignal),c.tracingOptions&&(o.tracingOptions=c.tracingOptions)}this._allowInsecureConnection&&(o.allowInsecureConnection=!0),o.streamResponseStatusCodes===void 0&&(o.streamResponseStatusCodes=(0,sce.getStreamingResponseStatusCodes)(n));try{let u=await this.sendRequest(o),l=(0,nH.flattenResponse)(u,n.responses[u.status]);return c?.onResponse&&c.onResponse(u,l),l}catch(u){if(typeof u=="object"&&u?.response){let l=u.response,d=(0,nH.flattenResponse)(l,n.responses[u.statusCode]||n.responses.default);u.details=d,c?.onResponse&&c.onResponse(l,d,u)}throw u}}};Kg.ServiceClient=u0;function cce(t){let e=uce(t),n=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return(0,nce.createClientPipeline)({...t,credentialOptions:n})}function uce(t){if(t.credentialScopes)return t.credentialScopes;if(t.endpoint)return`${t.endpoint}/.default`;if(t.baseUri)return`${t.baseUri}/.default`;if(t.credential&&!t.credentialScopes)throw new Error("When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy")}});var oH=g(Xg=>{"use strict";Object.defineProperty(Xg,"__esModule",{value:!0});Xg.parseCAEChallenge=iH;Xg.authorizeRequestOnClaimChallenge=hce;var lce=c0(),dce=ww();function iH(t){return`, ${t.trim()}`.split(", Bearer ").filter(n=>n).map(n=>`${n.trim()}, `.split('", ').filter(o=>o).map(o=>(([s,a])=>({[s]:a}))(o.trim().split('="'))).reduce((o,s)=>({...o,...s}),{}))}async function hce(t){let{scopes:e,response:n}=t,i=t.logger||lce.logger,r=n.headers.get("WWW-Authenticate");if(!r)return i.info("The WWW-Authenticate header was missing. Failed to perform the Continuous Access Evaluation authentication flow."),!1;let s=(iH(r)||[]).find(c=>c.claims);if(!s)return i.info('The WWW-Authenticate header was missing the necessary "claims" to perform the Continuous Access Evaluation authentication flow.'),!1;let a=await t.getAccessToken(s.scope?[s.scope]:e,{claims:(0,dce.decodeStringToString)(s.claims)});return a?(t.request.headers.set("Authorization",`${a.tokenType??"Bearer"} ${a.token}`),!0):!1}});var aH=g(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});Qg.authorizeRequestOnTenantChallenge=void 0;var sH={DefaultScope:"/.default",HeaderConstants:{AUTHORIZATION:"authorization"}};function fce(t){return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/.test(t)}var pce=async t=>{let e=Ece(t.request),n=_ce(t.response);if(n){let i=yce(n),r=gce(t,i),o=mce(i);if(!o)return!1;let s=await t.getAccessToken(r,{...e,tenantId:o});return s?(t.request.headers.set(sH.HeaderConstants.AUTHORIZATION,`${s.tokenType??"Bearer"} ${s.token}`),!0):!1}return!1};Qg.authorizeRequestOnTenantChallenge=pce;function mce(t){let i=new URL(t.authorization_uri).pathname.split("/")[1];if(i&&fce(i))return i}function gce(t,e){if(!e.resource_id)return t.scopes;let n=new URL(e.resource_id);n.pathname=sH.DefaultScope;let i=n.toString();return i==="https://disk.azure.com/.default"&&(i="https://disk.azure.com//.default"),[i]}function _ce(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}function yce(t){return`${t.slice(7).trim()} `.split(" ").filter(r=>r).map(r=>(([o,s])=>({[o]:s}))(r.trim().split("="))).reduce((r,o)=>({...r,...o}),{})}function Ece(t){return{abortSignal:t.abortSignal,requestOptions:{timeout:t.timeout},tracingOptions:t.tracingOptions}}});var hH=g(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.authorizeRequestOnTenantChallenge=Ke.authorizeRequestOnClaimChallenge=Ke.serializationPolicyName=Ke.serializationPolicy=Ke.deserializationPolicyName=Ke.deserializationPolicy=Ke.XML_CHARKEY=Ke.XML_ATTRKEY=Ke.createClientPipeline=Ke.ServiceClient=Ke.MapperTypeNames=Ke.createSerializer=void 0;var cH=md();Object.defineProperty(Ke,"createSerializer",{enumerable:!0,get:function(){return cH.createSerializer}});Object.defineProperty(Ke,"MapperTypeNames",{enumerable:!0,get:function(){return cH.MapperTypeNames}});var Tce=rH();Object.defineProperty(Ke,"ServiceClient",{enumerable:!0,get:function(){return Tce.ServiceClient}});var Ace=i0();Object.defineProperty(Ke,"createClientPipeline",{enumerable:!0,get:function(){return Ace.createClientPipeline}});var uH=fd();Object.defineProperty(Ke,"XML_ATTRKEY",{enumerable:!0,get:function(){return uH.XML_ATTRKEY}});Object.defineProperty(Ke,"XML_CHARKEY",{enumerable:!0,get:function(){return uH.XML_CHARKEY}});var lH=JI();Object.defineProperty(Ke,"deserializationPolicy",{enumerable:!0,get:function(){return lH.deserializationPolicy}});Object.defineProperty(Ke,"deserializationPolicyName",{enumerable:!0,get:function(){return lH.deserializationPolicyName}});var dH=n0();Object.defineProperty(Ke,"serializationPolicy",{enumerable:!0,get:function(){return dH.serializationPolicy}});Object.defineProperty(Ke,"serializationPolicyName",{enumerable:!0,get:function(){return dH.serializationPolicyName}});var Cce=oH();Object.defineProperty(Ke,"authorizeRequestOnClaimChallenge",{enumerable:!0,get:function(){return Cce.authorizeRequestOnClaimChallenge}});var Sce=aH();Object.defineProperty(Ke,"authorizeRequestOnTenantChallenge",{enumerable:!0,get:function(){return Sce.authorizeRequestOnTenantChallenge}})});var fH=g(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});l0.getIdentityTokenEndpointSuffix=wce;function wce(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}});var Zg=g(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.serviceFabricErrorMessage=void 0;Ko.mapScopesToResource=Ice;Ko.parseExpirationTimestamp=vce;Ko.parseRefreshTimestamp=bce;var pH="/.default";Ko.serviceFabricErrorMessage="Specifying a `clientId` or `resourceId` is not supported by the Service Fabric managed identity environment. The managed identity configuration is determined by the Service Fabric cluster resource configuration. See https://aka.ms/servicefabricmi for more information";function Ice(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(pH)?e.substr(0,e.lastIndexOf(pH)):e}function vce(t){if(typeof t.expires_on=="number")return t.expires_on*1e3;if(typeof t.expires_on=="string"){let e=+t.expires_on;if(!isNaN(e))return e*1e3;let n=Date.parse(t.expires_on);if(!isNaN(n))return n}if(typeof t.expires_in=="number")return Date.now()+t.expires_in*1e3;throw new Error(`Failed to parse token expiration from body. expires_in="${t.expires_in}", expires_on="${t.expires_on}"`)}function bce(t){if(t.refresh_on){if(typeof t.refresh_on=="number")return t.refresh_on*1e3;if(typeof t.refresh_on=="string"){let e=+t.refresh_on;if(!isNaN(e))return e*1e3;let n=Date.parse(t.refresh_on);if(!isNaN(n))return n}throw new Error(`Failed to parse refresh_on from body. refresh_on="${t.refresh_on}"`)}else return}});var Jg=g(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.IdentityClient=void 0;Yd.getIdentityClientAuthorityHost=yH;var Oce=hH(),Rce=nr(),fc=Gr(),mH=_t(),Nce=fH(),_H=Fr(),Pce=Rt(),bi=He(),gH=Zg(),jd="noCorrelationId";function yH(t){let e=t?.authorityHost;return Rce.isNode&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??_H.DefaultAuthorityHost}var d0=class extends Oce.ServiceClient{authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let n=`azsdk-js-identity/${_H.SDK_VERSION}`,i=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${n}`:`${n}`,r=yH(e);if(!r.startsWith("https:"))throw new Error("The authorityHost address must use the 'https' protocol.");super({requestContentType:"application/json; charset=utf-8",retryOptions:{maxRetries:3},...e,userAgentOptions:{userAgentPrefix:i},baseUri:r}),this.authorityHost=r,this.abortControllers=new Map,this.allowLoggingAccountIdentifiers=e?.loggingOptions?.allowLoggingAccountIdentifiers,this.tokenCredentialOptions={...e},e?.allowInsecureConnection&&(this.allowInsecureConnection=e.allowInsecureConnection)}async sendTokenRequest(e){bi.logger.info(`IdentityClient: sending token request to [${e.url}]`);let n=await this.sendRequest(e);if(n.bodyAsText&&(n.status===200||n.status===201)){let i=JSON.parse(n.bodyAsText);if(!i.access_token)return null;this.logIdentifiers(n);let r={accessToken:{token:i.access_token,expiresOnTimestamp:(0,gH.parseExpirationTimestamp)(i),refreshAfterTimestamp:(0,gH.parseRefreshTimestamp)(i),tokenType:"Bearer"},refreshToken:i.refresh_token};return bi.logger.info(`IdentityClient: [${e.url}] token acquired, expires on ${r.accessToken.expiresOnTimestamp}`),r}else{let i=new mH.AuthenticationError(n.status,n.bodyAsText);throw bi.logger.warning(`IdentityClient: authentication error. HTTP status: ${n.status}, ${i.errorResponse.errorDescription}`),i}}async refreshAccessToken(e,n,i,r,o,s={}){if(r===void 0)return null;bi.logger.info(`IdentityClient: refreshing access token with client ID: ${n}, scopes: ${i} started`);let a={grant_type:"refresh_token",client_id:n,refresh_token:r,scope:i};o!==void 0&&(a.client_secret=o);let c=new URLSearchParams(a);return Pce.tracingClient.withSpan("IdentityClient.refreshAccessToken",s,async u=>{try{let l=(0,Nce.getIdentityTokenEndpointSuffix)(e),d=(0,fc.createPipelineRequest)({url:`${this.authorityHost}/${e}/${l}`,method:"POST",body:c.toString(),abortSignal:s.abortSignal,headers:(0,fc.createHttpHeaders)({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:u.tracingOptions}),f=await this.sendTokenRequest(d);return bi.logger.info(`IdentityClient: refreshed token for client ID: ${n}`),f}catch(l){if(l.name===mH.AuthenticationErrorName&&l.errorResponse.error==="interaction_required")return bi.logger.info(`IdentityClient: interaction required for client ID: ${n}`),null;throw bi.logger.warning(`IdentityClient: failed refreshing token for client ID: ${n}: ${l}`),l}})}generateAbortSignal(e){let n=new AbortController,i=this.abortControllers.get(e)||[];i.push(n),this.abortControllers.set(e,i);let r=n.signal.onabort;return n.signal.onabort=(...o)=>{this.abortControllers.set(e,void 0),r&&r.apply(n.signal,o)},n.signal}abortRequests(e){let n=e||jd,i=[...this.abortControllers.get(n)||[],...this.abortControllers.get(jd)||[]];if(i.length){for(let r of i)r.abort();this.abortControllers.set(n,void 0)}}getCorrelationId(e){let n=e?.body?.split("&").map(i=>i.split("=")).find(([i])=>i==="client-request-id");return n&&n.length&&n[1]||jd}async sendGetRequestAsync(e,n){let i=(0,fc.createPipelineRequest)({url:e,method:"GET",body:n?.body,allowInsecureConnection:this.allowInsecureConnection,headers:(0,fc.createHttpHeaders)(n?.headers),abortSignal:this.generateAbortSignal(jd)}),r=await this.sendRequest(i);return this.logIdentifiers(r),{body:r.bodyAsText?JSON.parse(r.bodyAsText):void 0,headers:r.headers.toJSON(),status:r.status}}async sendPostRequestAsync(e,n){let i=(0,fc.createPipelineRequest)({url:e,method:"POST",body:n?.body,headers:(0,fc.createHttpHeaders)(n?.headers),allowInsecureConnection:this.allowInsecureConnection,abortSignal:this.generateAbortSignal(this.getCorrelationId(n))}),r=await this.sendRequest(i);return this.logIdentifiers(r),{body:r.bodyAsText?JSON.parse(r.bodyAsText):void 0,headers:r.headers.toJSON(),status:r.status}}getTokenCredentialOptions(){return this.tokenCredentialOptions}logIdentifiers(e){if(!this.allowLoggingAccountIdentifiers||!e.bodyAsText)return;let n="No User Principal Name available";try{let r=(e.parsedBody||JSON.parse(e.bodyAsText)).access_token;if(!r)return;let o=r.split(".")[1],{appid:s,upn:a,tid:c,oid:u}=JSON.parse(Buffer.from(o,"base64").toString("utf8"));bi.logger.info(`[Authenticated account] Client ID: ${s}. Tenant ID: ${c}. User Principal Name: ${a||n}. Object ID (user): ${u}`)}catch(i){bi.logger.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",i.message)}}};Yd.IdentityClient=d0});var EH=g(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.RegionalAuthority=void 0;Vd.calculateRegionalAuthority=Dce;var h0;(function(t){t.AutoDiscoverRegion="AutoDiscoverRegion",t.USWest="westus",t.USWest2="westus2",t.USCentral="centralus",t.USEast="eastus",t.USEast2="eastus2",t.USNorthCentral="northcentralus",t.USSouthCentral="southcentralus",t.USWestCentral="westcentralus",t.CanadaCentral="canadacentral",t.CanadaEast="canadaeast",t.BrazilSouth="brazilsouth",t.EuropeNorth="northeurope",t.EuropeWest="westeurope",t.UKSouth="uksouth",t.UKWest="ukwest",t.FranceCentral="francecentral",t.FranceSouth="francesouth",t.SwitzerlandNorth="switzerlandnorth",t.SwitzerlandWest="switzerlandwest",t.GermanyNorth="germanynorth",t.GermanyWestCentral="germanywestcentral",t.NorwayWest="norwaywest",t.NorwayEast="norwayeast",t.AsiaEast="eastasia",t.AsiaSouthEast="southeastasia",t.JapanEast="japaneast",t.JapanWest="japanwest",t.AustraliaEast="australiaeast",t.AustraliaSouthEast="australiasoutheast",t.AustraliaCentral="australiacentral",t.AustraliaCentral2="australiacentral2",t.IndiaCentral="centralindia",t.IndiaSouth="southindia",t.IndiaWest="westindia",t.KoreaSouth="koreasouth",t.KoreaCentral="koreacentral",t.UAECentral="uaecentral",t.UAENorth="uaenorth",t.SouthAfricaNorth="southafricanorth",t.SouthAfricaWest="southafricawest",t.ChinaNorth="chinanorth",t.ChinaEast="chinaeast",t.ChinaNorth2="chinanorth2",t.ChinaEast2="chinaeast2",t.GermanyCentral="germanycentral",t.GermanyNorthEast="germanynortheast",t.GovernmentUSVirginia="usgovvirginia",t.GovernmentUSIowa="usgoviowa",t.GovernmentUSArizona="usgovarizona",t.GovernmentUSTexas="usgovtexas",t.GovernmentUSDodEast="usdodeast",t.GovernmentUSDodCentral="usdodcentral"})(h0||(Vd.RegionalAuthority=h0={}));function Dce(t){let e=t;return e===void 0&&globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME!==void 0&&(e=process.env.AZURE_REGIONAL_AUTHORITY_NAME),e===h0.AutoDiscoverRegion?"AUTO_DISCOVER":e}});var TH=g(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});f0.processMultiTenantRequest=Lce;var Mce=_t();function kce(t){return`The current credential is not configured to acquire tokens for tenant ${t}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`}function Lce(t,e,n=[],i){let r;if(process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH||t==="adfs"?r=t:r=e?.tenantId??t,t&&r!==t&&!n.includes("*")&&!n.some(o=>o.localeCompare(r)===0)){let o=kce(r);throw i?.info(o),new Mce.CredentialUnavailableError(o)}return r}});var Et=g(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.processMultiTenantRequest=void 0;Xo.checkTenantId=AH;Xo.resolveTenantId=Fce;Xo.resolveAdditionallyAllowedTenantIds=qce;var p0=Fr(),Uce=He(),xce=TH();Object.defineProperty(Xo,"processMultiTenantRequest",{enumerable:!0,get:function(){return xce.processMultiTenantRequest}});function AH(t,e){if(!e.match(/^[0-9a-zA-Z-.]+$/)){let n=new Error("Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names.");throw t.info((0,Uce.formatError)("",n)),n}}function Fce(t,e,n){return e?(AH(t,e),e):(n||(n=p0.DeveloperSignOnClientId),n!==p0.DeveloperSignOnClientId?"common":"organizations")}function qce(t){return!t||t.length===0?[]:t.includes("*")?p0.ALL_TENANTS:t}});var wr=g(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0});e_.generateMsalConfiguration=SH;e_.createMsalClient=$ce;var Hce=(un(),At(cn)),CH=Hce.__importStar(Wm()),Qo=He(),Bce=Xh(),pt=hd(),m0=_t(),jce=Jg(),g0=EH(),Yce=vo(),Vce=Et(),gn=(0,Qo.credentialLogger)("MsalClient");function SH(t,e,n={}){let i=(0,Vce.resolveTenantId)(n.logger??gn,e,t),r=(0,pt.getAuthority)(i,(0,pt.getAuthorityHost)(n)),o=new jce.IdentityClient({...n.tokenCredentialOptions,authorityHost:r,loggingOptions:n.loggingOptions});return{auth:{clientId:t,authority:r,knownAuthorities:(0,pt.getKnownAuthorities)(i,r,n.disableInstanceDiscovery)},system:{networkClient:o,loggerOptions:{loggerCallback:(0,pt.defaultLoggerCallback)(n.logger??gn),logLevel:(0,pt.getMSALLogLevel)((0,Yce.getLogLevel)()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging}}}}function $ce(t,e,n={}){let i={msalConfig:SH(t,e,n),cachedAccount:n.authenticationRecord?(0,pt.publicToMsal)(n.authenticationRecord):null,pluginConfiguration:Bce.msalPlugins.generatePluginConfiguration(n),logger:n.logger??gn},r=new Map;async function o(R={}){let L=R.enableCae?"CAE":"default",b=r.get(L);if(b)return i.logger.getToken.info("Existing PublicClientApplication found in cache, returning it."),b;i.logger.getToken.info(`Creating new PublicClientApplication with CAE ${R.enableCae?"enabled":"disabled"}.`);let X=R.enableCae?i.pluginConfiguration.cache.cachePluginCae:i.pluginConfiguration.cache.cachePlugin;return i.msalConfig.auth.clientCapabilities=R.enableCae?["cp1"]:void 0,b=new CH.PublicClientApplication({...i.msalConfig,broker:{nativeBrokerPlugin:i.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await X}}),r.set(L,b),b}let s=new Map;async function a(R={}){let L=R.enableCae?"CAE":"default",b=s.get(L);if(b)return i.logger.getToken.info("Existing ConfidentialClientApplication found in cache, returning it."),b;i.logger.getToken.info(`Creating new ConfidentialClientApplication with CAE ${R.enableCae?"enabled":"disabled"}.`);let X=R.enableCae?i.pluginConfiguration.cache.cachePluginCae:i.pluginConfiguration.cache.cachePlugin;return i.msalConfig.auth.clientCapabilities=R.enableCae?["cp1"]:void 0,b=new CH.ConfidentialClientApplication({...i.msalConfig,broker:{nativeBrokerPlugin:i.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await X}}),s.set(L,b),b}async function c(R,L,b={}){if(i.cachedAccount===null)throw i.logger.getToken.info("No cached account found in local state."),new m0.AuthenticationRequiredError({scopes:L});b.claims&&(i.cachedClaims=b.claims);let X={account:i.cachedAccount,scopes:L,claims:i.cachedClaims};i.pluginConfiguration.broker.isEnabled&&(X.tokenQueryParameters||={},i.pluginConfiguration.broker.enableMsaPassthrough&&(X.tokenQueryParameters.msal_request_type="consumer_passthrough")),b.proofOfPossessionOptions&&(X.shrNonce=b.proofOfPossessionOptions.nonce,X.authenticationScheme="pop",X.resourceRequestMethod=b.proofOfPossessionOptions.resourceRequestMethod,X.resourceRequestUri=b.proofOfPossessionOptions.resourceRequestUrl),i.logger.getToken.info("Attempting to acquire token silently");try{return await R.acquireTokenSilent(X)}catch(K){throw(0,pt.handleMsalError)(L,K,b)}}function u(R){return R?.tenantId?(0,pt.getAuthority)(R.tenantId,(0,pt.getAuthorityHost)(n)):i.msalConfig.auth.authority}async function l(R,L,b,X){let K=null;try{K=await c(R,L,b)}catch(Fe){if(Fe.name!=="AuthenticationRequiredError")throw Fe;if(b.disableAutomaticAuthentication)throw new m0.AuthenticationRequiredError({scopes:L,getTokenOptions:b,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(K===null)try{K=await X()}catch(Fe){throw(0,pt.handleMsalError)(L,Fe,b)}return(0,pt.ensureValidMsalToken)(L,K,b),i.cachedAccount=K?.account??null,i.logger.getToken.info((0,Qo.formatSuccess)(L)),{token:K.accessToken,expiresOnTimestamp:K.expiresOn.getTime(),refreshAfterTimestamp:K.refreshOn?.getTime(),tokenType:K.tokenType}}async function d(R,L,b={}){i.logger.getToken.info("Attempting to acquire token using client secret"),i.msalConfig.auth.clientSecret=L;let X=await a(b);try{let K=await X.acquireTokenByClientCredential({scopes:R,authority:u(b),azureRegion:(0,g0.calculateRegionalAuthority)(),claims:b?.claims});return(0,pt.ensureValidMsalToken)(R,K,b),i.logger.getToken.info((0,Qo.formatSuccess)(R)),{token:K.accessToken,expiresOnTimestamp:K.expiresOn.getTime(),refreshAfterTimestamp:K.refreshOn?.getTime(),tokenType:K.tokenType}}catch(K){throw(0,pt.handleMsalError)(R,K,b)}}async function f(R,L,b={}){i.logger.getToken.info("Attempting to acquire token using client assertion"),i.msalConfig.auth.clientAssertion=L;let X=await a(b);try{let K=await X.acquireTokenByClientCredential({scopes:R,authority:u(b),azureRegion:(0,g0.calculateRegionalAuthority)(),claims:b?.claims,clientAssertion:L});return(0,pt.ensureValidMsalToken)(R,K,b),i.logger.getToken.info((0,Qo.formatSuccess)(R)),{token:K.accessToken,expiresOnTimestamp:K.expiresOn.getTime(),refreshAfterTimestamp:K.refreshOn?.getTime(),tokenType:K.tokenType}}catch(K){throw(0,pt.handleMsalError)(R,K,b)}}async function m(R,L,b={}){i.logger.getToken.info("Attempting to acquire token using client certificate"),i.msalConfig.auth.clientCertificate=L;let X=await a(b);try{let K=await X.acquireTokenByClientCredential({scopes:R,authority:u(b),azureRegion:(0,g0.calculateRegionalAuthority)(),claims:b?.claims});return(0,pt.ensureValidMsalToken)(R,K,b),i.logger.getToken.info((0,Qo.formatSuccess)(R)),{token:K.accessToken,expiresOnTimestamp:K.expiresOn.getTime(),refreshAfterTimestamp:K.refreshOn?.getTime(),tokenType:K.tokenType}}catch(K){throw(0,pt.handleMsalError)(R,K,b)}}async function _(R,L,b={}){i.logger.getToken.info("Attempting to acquire token using device code");let X=await o(b);return l(X,R,b,()=>{let K={scopes:R,cancel:b?.abortSignal?.aborted??!1,deviceCodeCallback:L,authority:u(b),claims:b?.claims},Fe=X.acquireTokenByDeviceCode(K);return b.abortSignal&&b.abortSignal.addEventListener("abort",()=>{K.cancel=!0}),Fe})}async function E(R,L,b,X={}){i.logger.getToken.info("Attempting to acquire token using username and password");let K=await o(X);return l(K,R,X,()=>{let Fe={scopes:R,username:L,password:b,authority:u(X),claims:X?.claims};return K.acquireTokenByUsernamePassword(Fe)})}function I(){if(i.cachedAccount)return(0,pt.msalToPublic)(t,i.cachedAccount)}async function y(R,L,b,X,K={}){i.logger.getToken.info("Attempting to acquire token using authorization code");let Fe;return X?(i.msalConfig.auth.clientSecret=X,Fe=await a(K)):Fe=await o(K),l(Fe,R,K,()=>Fe.acquireTokenByCode({scopes:R,redirectUri:L,code:b,authority:u(K),claims:K?.claims}))}async function A(R,L,b,X={}){gn.getToken.info("Attempting to acquire token on behalf of another user"),typeof b=="string"?(gn.getToken.info("Using client secret for on behalf of flow"),i.msalConfig.auth.clientSecret=b):typeof b=="function"?(gn.getToken.info("Using client assertion callback for on behalf of flow"),i.msalConfig.auth.clientAssertion=b):(gn.getToken.info("Using client certificate for on behalf of flow"),i.msalConfig.auth.clientCertificate=b);let K=await a(X);try{let Fe=await K.acquireTokenOnBehalfOf({scopes:R,authority:u(X),claims:X.claims,oboAssertion:L});return(0,pt.ensureValidMsalToken)(R,Fe,X),gn.getToken.info((0,Qo.formatSuccess)(R)),{token:Fe.accessToken,expiresOnTimestamp:Fe.expiresOn.getTime(),refreshAfterTimestamp:Fe.refreshOn?.getTime(),tokenType:Fe.tokenType}}catch(Fe){throw(0,pt.handleMsalError)(R,Fe,X)}}function S(R,L){return{openBrowser:async b=>{await(await import("./open-NGBTRDPN.js")).default(b,{newInstance:!0})},scopes:R,authority:u(L),claims:L?.claims,loginHint:L?.loginHint,errorTemplate:L?.browserCustomizationOptions?.errorMessage,successTemplate:L?.browserCustomizationOptions?.successMessage,prompt:L?.loginHint?"login":"select_account"}}async function w(R,L,b={}){gn.verbose("Authentication will resume through the broker");let X=await o(b),K=S(R,b);i.pluginConfiguration.broker.parentWindowHandle?K.windowHandle=Buffer.from(i.pluginConfiguration.broker.parentWindowHandle):gn.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle."),i.pluginConfiguration.broker.enableMsaPassthrough&&((K.tokenQueryParameters??={}).msal_request_type="consumer_passthrough"),L?(K.prompt="none",gn.verbose("Attempting broker authentication using the default broker account")):gn.verbose("Attempting broker authentication without the default broker account"),b.proofOfPossessionOptions&&(K.shrNonce=b.proofOfPossessionOptions.nonce,K.authenticationScheme="pop",K.resourceRequestMethod=b.proofOfPossessionOptions.resourceRequestMethod,K.resourceRequestUri=b.proofOfPossessionOptions.resourceRequestUrl);try{return await X.acquireTokenInteractive(K)}catch(Fe){if(gn.verbose(`Failed to authenticate through the broker: ${Fe.message}`),b.disableAutomaticAuthentication)throw new m0.AuthenticationRequiredError({scopes:R,getTokenOptions:b,message:"Cannot silently authenticate with default broker account."});if(L)return w(R,!1,b);throw Fe}}async function N(R,L,b={}){gn.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${L}`);let X=await w(R,L,b);return(0,pt.ensureValidMsalToken)(R,X,b),i.cachedAccount=X?.account??null,i.logger.getToken.info((0,Qo.formatSuccess)(R)),{token:X.accessToken,expiresOnTimestamp:X.expiresOn.getTime(),refreshAfterTimestamp:X.refreshOn?.getTime(),tokenType:X.tokenType}}async function W(R,L={}){gn.getToken.info("Attempting to acquire token interactively");let b=await o(L);return l(b,R,L,async()=>{let X=S(R,L);return i.pluginConfiguration.broker.isEnabled?w(R,i.pluginConfiguration.broker.useDefaultBrokerAccount??!1,L):(L.proofOfPossessionOptions&&(X.shrNonce=L.proofOfPossessionOptions.nonce,X.authenticationScheme="pop",X.resourceRequestMethod=L.proofOfPossessionOptions.resourceRequestMethod,X.resourceRequestUri=L.proofOfPossessionOptions.resourceRequestUrl),b.acquireTokenInteractive(X))})}return{getActiveAccount:I,getBrokeredToken:N,getTokenByClientSecret:d,getTokenByClientAssertion:f,getTokenByClientCertificate:m,getTokenByDeviceCode:_,getTokenByUsernamePassword:E,getTokenByAuthorizationCode:y,getTokenOnBehalfOf:A,getTokenByInteractiveRequest:W}}});var E0=g(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.ClientCertificateCredential=void 0;zd.parseCertificate=vH;var zce=wr(),_0=x("crypto"),wH=Et(),Gce=He(),Wce=x("fs/promises"),Kce=Rt(),$d="ClientCertificateCredential",IH=(0,Gce.credentialLogger)($d),y0=class{tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,n,i,r={}){if(!e||!n)throw new Error(`${$d}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=(0,wH.resolveAdditionallyAllowedTenantIds)(r?.additionallyAllowedTenants),this.sendCertificateChain=r.sendCertificateChain,this.certificateConfiguration={...typeof i=="string"?{certificatePath:i}:i};let o=this.certificateConfiguration.certificate,s=this.certificateConfiguration.certificatePath;if(!this.certificateConfiguration||!(o||s))throw new Error(`${$d}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(o&&s)throw new Error(`${$d}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.msalClient=(0,zce.createMsalClient)(n,e,{...r,logger:IH,tokenCredentialOptions:r})}async getToken(e,n={}){return Kce.tracingClient.withSpan(`${$d}.getToken`,n,async i=>{i.tenantId=(0,wH.processMultiTenantRequest)(this.tenantId,i,this.additionallyAllowedTenantIds,IH);let r=Array.isArray(e)?e:[e],o=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(r,o,i)})}async buildClientCertificate(){let e=await vH(this.certificateConfiguration,this.sendCertificateChain??!1),n;return this.certificateConfiguration.certificatePassword!==void 0?n=(0,_0.createPrivateKey)({key:e.certificateContents,passphrase:this.certificateConfiguration.certificatePassword,format:"pem"}).export({format:"pem",type:"pkcs8"}).toString():n=e.certificateContents,{thumbprint:e.thumbprint,thumbprintSha256:e.thumbprintSha256,privateKey:n,x5c:e.x5c}}};zd.ClientCertificateCredential=y0;async function vH(t,e){let n=t.certificate,i=t.certificatePath,r=n||await(0,Wce.readFile)(i,"utf8"),o=e?r:void 0,s=/(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g,a=[],c;do c=s.exec(r),c&&a.push(c[3]);while(c);if(a.length===0)throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");let u=(0,_0.createHash)("sha1").update(Buffer.from(a[0],"base64")).digest("hex").toUpperCase(),l=(0,_0.createHash)("sha256").update(Buffer.from(a[0],"base64")).digest("hex").toUpperCase();return{certificateContents:r,thumbprintSha256:l,thumbprint:u,x5c:o}}});var ar=g(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.ensureScopes=Qce;Gd.ensureValidScopeForDevTimeCreds=Zce;Gd.getScopeResource=Jce;var Xce=He();function Qce(t){return Array.isArray(t)?t:[t]}function Zce(t,e){if(!t.match(/^[0-9a-zA-Z-_.:/]+$/)){let n=new Error("Invalid scope was specified by the user or calling client");throw e.getToken.info((0,Xce.formatError)(t,n)),n}}function Jce(t){return t.replace(/\/.default$/,"")}});var C0=g(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});t_.ClientSecretCredential=void 0;var eue=wr(),bH=Et(),T0=_t(),tue=He(),nue=ar(),rue=Rt(),OH=(0,tue.credentialLogger)("ClientSecretCredential"),A0=class{tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,n,i,r={}){if(!e)throw new T0.CredentialUnavailableError("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new T0.CredentialUnavailableError("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!i)throw new T0.CredentialUnavailableError("ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");this.clientSecret=i,this.tenantId=e,this.additionallyAllowedTenantIds=(0,bH.resolveAdditionallyAllowedTenantIds)(r?.additionallyAllowedTenants),this.msalClient=(0,eue.createMsalClient)(n,e,{...r,logger:OH,tokenCredentialOptions:r})}async getToken(e,n={}){return rue.tracingClient.withSpan(`${this.constructor.name}.getToken`,n,async i=>{i.tenantId=(0,bH.processMultiTenantRequest)(this.tenantId,i,this.additionallyAllowedTenantIds,OH);let r=(0,nue.ensureScopes)(e);return this.msalClient.getTokenByClientSecret(r,this.clientSecret,i)})}};t_.ClientSecretCredential=A0});var w0=g(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.UsernamePasswordCredential=void 0;var iue=wr(),RH=Et(),n_=_t(),oue=He(),sue=ar(),aue=Rt(),cue=(0,oue.credentialLogger)("UsernamePasswordCredential"),S0=class{tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,n,i,r,o={}){if(!e)throw new n_.CredentialUnavailableError("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new n_.CredentialUnavailableError("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!i)throw new n_.CredentialUnavailableError("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new n_.CredentialUnavailableError("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=(0,RH.resolveAdditionallyAllowedTenantIds)(o?.additionallyAllowedTenants),this.username=i,this.password=r,this.msalClient=(0,iue.createMsalClient)(n,this.tenantId,{...o,tokenCredentialOptions:o??{}})}async getToken(e,n={}){return aue.tracingClient.withSpan(`${this.constructor.name}.getToken`,n,async i=>{i.tenantId=(0,RH.processMultiTenantRequest)(this.tenantId,i,this.additionallyAllowedTenantIds,cue);let r=(0,sue.ensureScopes)(e);return this.msalClient.getTokenByUsernamePassword(r,this.username,this.password,i)})}};r_.UsernamePasswordCredential=S0});var v0=g(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.EnvironmentCredential=ao.AllSupportedEnvironmentVariables=void 0;ao.getSendCertificateChain=PH;var NH=_t(),i_=He(),uue=E0(),lue=C0(),due=w0(),hue=Et(),fue=Rt();ao.AllSupportedEnvironmentVariables=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_CLIENT_SECRET","AZURE_CLIENT_CERTIFICATE_PATH","AZURE_CLIENT_CERTIFICATE_PASSWORD","AZURE_USERNAME","AZURE_PASSWORD","AZURE_ADDITIONALLY_ALLOWED_TENANTS","AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"];function pue(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}var o_="EnvironmentCredential",Oi=(0,i_.credentialLogger)(o_);function PH(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return Oi.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}var I0=class{_credential=void 0;constructor(e){let n=(0,i_.processEnvVars)(ao.AllSupportedEnvironmentVariables).assigned.join(", ");Oi.info(`Found the following environment variables: ${n}`);let i=process.env.AZURE_TENANT_ID,r=process.env.AZURE_CLIENT_ID,o=process.env.AZURE_CLIENT_SECRET,s=pue(),a=PH(),c={...e,additionallyAllowedTenantIds:s,sendCertificateChain:a};if(i&&(0,hue.checkTenantId)(Oi,i),i&&r&&o){Oi.info(`Invoking ClientSecretCredential with tenant ID: ${i}, clientId: ${r} and clientSecret: [REDACTED]`),this._credential=new lue.ClientSecretCredential(i,r,o,c);return}let u=process.env.AZURE_CLIENT_CERTIFICATE_PATH,l=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(i&&r&&u){Oi.info(`Invoking ClientCertificateCredential with tenant ID: ${i}, clientId: ${r} and certificatePath: ${u}`),this._credential=new uue.ClientCertificateCredential(i,r,{certificatePath:u,certificatePassword:l},c);return}let d=process.env.AZURE_USERNAME,f=process.env.AZURE_PASSWORD;i&&r&&d&&f&&(Oi.info(`Invoking UsernamePasswordCredential with tenant ID: ${i}, clientId: ${r} and username: ${d}`),Oi.warning("Environment is configured to use username and password authentication. This authentication method is deprecated, as it doesn't support multifactor authentication (MFA). Use a more secure credential. For more details, see https://aka.ms/azsdk/identity/mfa."),this._credential=new due.UsernamePasswordCredential(i,r,d,f,c))}async getToken(e,n={}){return fue.tracingClient.withSpan(`${o_}.getToken`,n,async i=>{if(this._credential)try{let r=await this._credential.getToken(e,i);return Oi.getToken.info((0,i_.formatSuccess)(e)),r}catch(r){let o=new NH.AuthenticationError(400,{error:`${o_} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:r.message.toString().split("More details:").join("")});throw Oi.getToken.info((0,i_.formatError)(e,o)),o}throw new NH.CredentialUnavailableError(`${o_} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};ao.EnvironmentCredential=I0});var DH=g(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});b0.imdsRetryPolicy=Eue;var mue=Gr(),gue=nr(),_ue=1e3*64,yue=3e3;function Eue(t){return(0,mue.retryPolicy)([{name:"imdsRetryPolicy",retry:({retryCount:e,response:n})=>{if(n?.status!==404&&n?.status!==410)return{skipStrategy:!0};let i=n?.status===410?Math.max(yue,t.startDelayInMs):t.startDelayInMs;return(0,gue.calculateRetryDelay)(e,{retryDelayInMs:i,maxRetryDelayInMs:_ue})}}],{maxRetries:t.maxRetries})}});var LH=g(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});s_.imdsMsi=void 0;var MH=Gr(),Tue=nr(),Aue=He(),kH=Zg(),Cue=Rt(),Ri="ManagedIdentityCredential - IMDS",Zo=(0,Aue.credentialLogger)(Ri),Sue="http://169.254.169.254",wue="/metadata/identity/oauth2/token";function Iue(t){if(!(0,kH.mapScopesToResource)(t))throw new Error(`${Ri}: Multiple scopes are not supported.`);let n=new URL(wue,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??Sue),i={Accept:"application/json"};return{url:`${n}`,method:"GET",headers:(0,MH.createHttpHeaders)(i)}}s_.imdsMsi={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:n,getTokenOptions:i}=t,r=(0,kH.mapScopesToResource)(e);if(!r)return Zo.info(`${Ri}: Unavailable. Multiple scopes are not supported.`),!1;if(process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST)return!0;if(!n)throw new Error("Missing IdentityClient");let o=Iue(r);return Cue.tracingClient.withSpan("ManagedIdentityCredential-pingImdsEndpoint",i??{},async s=>{o.tracingOptions=s.tracingOptions;let a=(0,MH.createPipelineRequest)(o);a.timeout=s.requestOptions?.timeout||1e3,a.allowInsecureConnection=!0;let c;try{Zo.info(`${Ri}: Pinging the Azure IMDS endpoint`),c=await n.sendRequest(a)}catch(u){return(0,Tue.isError)(u)&&Zo.verbose(`${Ri}: Caught error ${u.name}: ${u.message}`),Zo.info(`${Ri}: The Azure IMDS endpoint is unavailable`),!1}return c.status===403&&c.bodyAsText?.includes("unreachable")?(Zo.info(`${Ri}: The Azure IMDS endpoint is unavailable`),Zo.info(`${Ri}: ${c.bodyAsText}`),!1):(Zo.info(`${Ri}: The Azure IMDS endpoint is available`),!0)})}}});var c_=g(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});a_.ClientAssertionCredential=void 0;var vue=wr(),UH=Et(),O0=_t(),bue=He(),Oue=Rt(),xH=(0,bue.credentialLogger)("ClientAssertionCredential"),R0=class{msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,n,i,r={}){if(!e)throw new O0.CredentialUnavailableError("ClientAssertionCredential: tenantId is a required parameter.");if(!n)throw new O0.CredentialUnavailableError("ClientAssertionCredential: clientId is a required parameter.");if(!i)throw new O0.CredentialUnavailableError("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=(0,UH.resolveAdditionallyAllowedTenantIds)(r?.additionallyAllowedTenants),this.options=r,this.getAssertion=i,this.msalClient=(0,vue.createMsalClient)(n,e,{...r,logger:xH,tokenCredentialOptions:this.options})}async getToken(e,n={}){return Oue.tracingClient.withSpan(`${this.constructor.name}.getToken`,n,async i=>{i.tenantId=(0,UH.processMultiTenantRequest)(this.tenantId,i,this.additionallyAllowedTenantIds,xH);let r=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(r,this.getAssertion,i)})}};a_.ClientAssertionCredential=R0});var u_=g(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.WorkloadIdentityCredential=es.SupportedWorkloadEnvironmentVariables=void 0;var FH=He(),Rue=c_(),pc=_t(),Nue=Et(),Pue=x("fs/promises"),Jo="WorkloadIdentityCredential";es.SupportedWorkloadEnvironmentVariables=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"];var Wd=(0,FH.credentialLogger)(Jo),N0=class{client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let n=(0,FH.processEnvVars)(es.SupportedWorkloadEnvironmentVariables).assigned.join(", ");Wd.info(`Found the following environment variables: ${n}`);let i=e??{},r=i.tenantId||process.env.AZURE_TENANT_ID,o=i.clientId||process.env.AZURE_CLIENT_ID;if(this.federatedTokenFilePath=i.tokenFilePath||process.env.AZURE_FEDERATED_TOKEN_FILE,r&&(0,Nue.checkTenantId)(Wd,r),!o)throw new pc.CredentialUnavailableError(`${Jo}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID".
|
|
61
|
+
See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!r)throw new pc.CredentialUnavailableError(`${Jo}: is unavailable. tenantId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_TENANT_ID".
|
|
62
|
+
See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!this.federatedTokenFilePath)throw new pc.CredentialUnavailableError(`${Jo}: is unavailable. federatedTokenFilePath is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_FEDERATED_TOKEN_FILE".
|
|
63
|
+
See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);Wd.info(`Invoking ClientAssertionCredential with tenant ID: ${r}, clientId: ${i.clientId} and federated token path: [REDACTED]`),this.client=new Rue.ClientAssertionCredential(r,o,this.readFileContents.bind(this),e)}async getToken(e,n){if(!this.client){let i=`${Jo}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters.
|
|
64
|
+
In DefaultAzureCredential and ManagedIdentityCredential, these can be provided as environment variables -
|
|
65
|
+
"AZURE_TENANT_ID",
|
|
66
|
+
"AZURE_CLIENT_ID",
|
|
67
|
+
"AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;throw Wd.info(i),new pc.CredentialUnavailableError(i)}return Wd.info("Invoking getToken() of Client Assertion Credential"),this.client.getToken(e,n)}async readFileContents(){if(this.cacheDate!==void 0&&Date.now()-this.cacheDate>=1e3*60*5&&(this.azureFederatedTokenFileContent=void 0),!this.federatedTokenFilePath)throw new pc.CredentialUnavailableError(`${Jo}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let n=(await(0,Pue.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(n)this.azureFederatedTokenFileContent=n,this.cacheDate=Date.now();else throw new pc.CredentialUnavailableError(`${Jo}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};es.WorkloadIdentityCredential=N0});var HH=g(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});l_.tokenExchangeMsi=void 0;var Due=u_(),Mue=He(),qH="ManagedIdentityCredential - Token Exchange",kue=(0,Mue.credentialLogger)(qH);l_.tokenExchangeMsi={name:"tokenExchangeMsi",async isAvailable(t){let e=process.env,n=!!((t||e.AZURE_CLIENT_ID)&&e.AZURE_TENANT_ID&&process.env.AZURE_FEDERATED_TOKEN_FILE);return n||kue.info(`${qH}: Unavailable. The environment variables needed are: AZURE_CLIENT_ID (or the client ID sent through the parameters), AZURE_TENANT_ID and AZURE_FEDERATED_TOKEN_FILE`),n},async getToken(t,e={}){let{scopes:n,clientId:i}=t,r={};return new Due.WorkloadIdentityCredential({clientId:i,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...r,disableInstanceDiscovery:!0}).getToken(n,e)}}});var M0=g(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});d_.ManagedIdentityCredential=void 0;var Lue=vo(),Uue=Wm(),BH=Jg(),co=_t(),jH=hd(),xue=DH(),P0=He(),Fue=Rt(),que=LH(),YH=HH(),VH=Zg(),Bn=(0,P0.credentialLogger)("ManagedIdentityCredential"),D0=class{managedIdentityApp;identityClient;clientId;resourceId;objectId;msiRetryConfig={maxRetries:5,startDelayInMs:800,intervalIncrement:2};isAvailableIdentityClient;sendProbeRequest;constructor(e,n){let i;typeof e=="string"?(this.clientId=e,i=n??{}):(this.clientId=e?.clientId,i=e??{}),this.resourceId=i?.resourceId,this.objectId=i?.objectId,this.sendProbeRequest=i?.sendProbeRequest??!1;let r=[{key:"clientId",value:this.clientId},{key:"resourceId",value:this.resourceId},{key:"objectId",value:this.objectId}].filter(s=>s.value);if(r.length>1)throw new Error(`ManagedIdentityCredential: only one of 'clientId', 'resourceId', or 'objectId' can be provided. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}`);i.allowInsecureConnection=!0,i.retryOptions?.maxRetries!==void 0&&(this.msiRetryConfig.maxRetries=i.retryOptions.maxRetries),this.identityClient=new BH.IdentityClient({...i,additionalPolicies:[{policy:(0,xue.imdsRetryPolicy)(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Uue.ManagedIdentityApplication({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:(0,jH.getMSALLogLevel)((0,Lue.getLogLevel)()),piiLoggingEnabled:i.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:(0,jH.defaultLoggerCallback)(Bn)}}}),this.isAvailableIdentityClient=new BH.IdentityClient({...i,retryOptions:{maxRetries:0}});let o=this.managedIdentityApp.getManagedIdentitySource();if(o==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw Bn.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new co.CredentialUnavailableError("ManagedIdentityCredential: Specifying a user-assigned managed identity is not supported for CloudShell at runtime. When using Managed Identity in CloudShell, omit the clientId, resourceId, and objectId parameters.");if(o==="ServiceFabric"&&(this.clientId||this.resourceId||this.objectId))throw Bn.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new co.CredentialUnavailableError(`ManagedIdentityCredential: ${VH.serviceFabricErrorMessage}`);if(Bn.info(`Using ${o} managed identity.`),r.length===1){let{key:s,value:a}=r[0];Bn.info(`${o} with ${s}: ${a}`)}}async getToken(e,n={}){Bn.getToken.info("Using the MSAL provider for Managed Identity.");let i=(0,VH.mapScopesToResource)(e);if(!i)throw new co.CredentialUnavailableError(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Fue.tracingClient.withSpan("ManagedIdentityCredential.getToken",n,async()=>{try{let r=await YH.tokenExchangeMsi.isAvailable(this.clientId),o=this.managedIdentityApp.getManagedIdentitySource(),s=o==="DefaultToImds"||o==="Imds";if(Bn.getToken.info(`MSAL Identity source: ${o}`),r){Bn.getToken.info("Using the token exchange managed identity.");let c=await YH.tokenExchangeMsi.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(c===null)throw new co.CredentialUnavailableError("Attempted to use the token exchange managed identity, but received a null response.");return c}else if(s&&this.sendProbeRequest&&(Bn.getToken.info("Using the IMDS endpoint to probe for availability."),!await que.imdsMsi.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:n,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new co.CredentialUnavailableError("Attempted to use the IMDS endpoint, but it is not available.");Bn.getToken.info("Calling into MSAL for managed identity token.");let a=await this.managedIdentityApp.acquireToken({resource:i});return this.ensureValidMsalToken(e,a,n),Bn.getToken.info((0,P0.formatSuccess)(e)),{expiresOnTimestamp:a.expiresOn.getTime(),token:a.accessToken,refreshAfterTimestamp:a.refreshOn?.getTime(),tokenType:"Bearer"}}catch(r){throw Bn.getToken.error((0,P0.formatError)(e,r)),r.name==="AuthenticationRequiredError"?r:Hue(r)?new co.CredentialUnavailableError(`ManagedIdentityCredential: Network unreachable. Message: ${r.message}`,{cause:r}):new co.CredentialUnavailableError(`ManagedIdentityCredential: Authentication failed. Message ${r.message}`,{cause:r})}})}ensureValidMsalToken(e,n,i){let r=o=>(Bn.getToken.info(o),new co.AuthenticationRequiredError({scopes:Array.isArray(e)?e:[e],getTokenOptions:i,message:o}));if(!n)throw r("No response.");if(!n.expiresOn)throw r('Response had no "expiresOn" property.');if(!n.accessToken)throw r('Response had no "accessToken" property.')}};d_.ManagedIdentityCredential=D0;function Hue(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}});var L0=g(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.AzureDeveloperCliCredential=Pn.developerCliCredentialInternals=Pn.azureDeveloperCliPublicErrorMessages=void 0;var Bue=(un(),At(cn)),mc=He(),Kd=_t(),jue=Bue.__importDefault(x("child_process")),h_=Et(),Yue=Rt(),Vue=ar(),Wr=(0,mc.credentialLogger)("AzureDeveloperCliCredential");Pn.azureDeveloperCliPublicErrorMessages={notInstalled:"Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",login:"Please run 'azd auth login' from a command prompt to authenticate before using this credential. For more information, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",unknown:"Unknown error while trying to retrieve the access token",claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:"};Pn.developerCliCredentialInternals={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(Wr.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure Developer CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzdAccessToken(t,e,n,i){let r=[];e&&(r=["--tenant-id",e]);let o=[];return i&&(o=["--claims",btoa(i)]),new Promise((s,a)=>{try{let u=["azd",...["auth","token","--output","json","--no-prompt",...t.reduce((l,d)=>l.concat("--scope",d),[]),...r,...o]].join(" ");jue.default.exec(u,{cwd:Pn.developerCliCredentialInternals.getSafeWorkingDir(),timeout:n},(l,d,f)=>{s({stdout:d,stderr:f,error:l})})}catch(c){a(c)}})}};var k0=class{tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&((0,h_.checkTenantId)(Wr,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=(0,h_.resolveAdditionallyAllowedTenantIds)(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,n={}){let i=(0,h_.processMultiTenantRequest)(this.tenantId,n,this.additionallyAllowedTenantIds);i&&(0,h_.checkTenantId)(Wr,i);let r;return typeof e=="string"?r=[e]:r=e,Wr.getToken.info(`Using the scopes ${e}`),Yue.tracingClient.withSpan(`${this.constructor.name}.getToken`,n,async()=>{try{r.forEach(u=>{(0,Vue.ensureValidScopeForDevTimeCreds)(u,Wr)});let o=await Pn.developerCliCredentialInternals.getAzdAccessToken(r,i,this.timeout,n.claims),s=o.stderr?.match("must use multi-factor authentication")||o.stderr?.match("reauthentication required"),a=o.stderr?.match("not logged in, run `azd login` to login")||o.stderr?.match("not logged in, run `azd auth login` to login");if(o.stderr?.match("azd:(.*)not found")||o.stderr?.startsWith("'azd' is not recognized")||o.error&&o.error.code==="ENOENT"){let u=new Kd.CredentialUnavailableError(Pn.azureDeveloperCliPublicErrorMessages.notInstalled);throw Wr.getToken.info((0,mc.formatError)(e,u)),u}if(a){let u=new Kd.CredentialUnavailableError(Pn.azureDeveloperCliPublicErrorMessages.login);throw Wr.getToken.info((0,mc.formatError)(e,u)),u}if(s){let l=`azd auth login ${r.reduce((f,m)=>f.concat("--scope",m),[]).join(" ")}`,d=new Kd.CredentialUnavailableError(`${Pn.azureDeveloperCliPublicErrorMessages.claim} ${l}`);throw Wr.getToken.info((0,mc.formatError)(e,d)),d}try{let u=JSON.parse(o.stdout);return Wr.getToken.info((0,mc.formatSuccess)(e)),{token:u.token,expiresOnTimestamp:new Date(u.expiresOn).getTime(),tokenType:"Bearer"}}catch(u){throw o.stderr?new Kd.CredentialUnavailableError(o.stderr):u}}catch(o){let s=o.name==="CredentialUnavailableError"?o:new Kd.CredentialUnavailableError(o.message||Pn.azureDeveloperCliPublicErrorMessages.unknown);throw Wr.getToken.info((0,mc.formatError)(e,s)),s}})}};Pn.AzureDeveloperCliCredential=k0});var $H=g(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});U0.checkSubscription=zue;var $ue=He();function zue(t,e){if(!e.match(/^[0-9a-zA-Z-._ ]+$/)){let n=new Error(`Subscription '${e}' contains invalid characters. If this is the name of a subscription, use its ID instead. You can locate your subscription by following the instructions listed here: https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id`);throw t.info((0,$ue.formatError)("",n)),n}}});var F0=g(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.AzureCliCredential=_n.cliCredentialInternals=_n.azureCliPublicErrorMessages=void 0;var Gue=(un(),At(cn)),f_=Et(),_c=He(),zH=ar(),gc=_t(),Wue=Gue.__importDefault(x("child_process")),Kue=Rt(),GH=$H(),jn=(0,_c.credentialLogger)("AzureCliCredential");_n.azureCliPublicErrorMessages={claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",notInstalled:"Azure CLI could not be found. Please visit https://aka.ms/azure-cli for installation instructions and then, once installed, authenticate to your Azure account using 'az login'.",login:"Please run 'az login' from a command prompt to authenticate before using this credential.",unknown:"Unknown error while trying to retrieve the access token",unexpectedResponse:'Unexpected response from Azure CLI when getting token. Expected "expiresOn" to be a RFC3339 date string. Got:'};_n.cliCredentialInternals={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(jn.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzureCliAccessToken(t,e,n,i){let r=[],o=[];return e&&(r=["--tenant",e]),n&&(o=["--subscription",`"${n}"`]),new Promise((s,a)=>{try{let u=["az",...["account","get-access-token","--output","json","--resource",t,...r,...o]].join(" ");Wue.default.exec(u,{cwd:_n.cliCredentialInternals.getSafeWorkingDir(),timeout:i},(l,d,f)=>{s({stdout:d,stderr:f,error:l})})}catch(c){a(c)}})}};var x0=class{tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&((0,f_.checkTenantId)(jn,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&((0,GH.checkSubscription)(jn,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=(0,f_.resolveAdditionallyAllowedTenantIds)(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,n={}){let i=typeof e=="string"?e:e[0],r=n.claims;if(r&&r.trim()){let a=`az login --claims-challenge ${btoa(r)} --scope ${i}`,c=n.tenantId;c&&(a+=` --tenant ${c}`);let u=new gc.CredentialUnavailableError(`${_n.azureCliPublicErrorMessages.claim} ${a}`);throw jn.getToken.info((0,_c.formatError)(i,u)),u}let o=(0,f_.processMultiTenantRequest)(this.tenantId,n,this.additionallyAllowedTenantIds);return o&&(0,f_.checkTenantId)(jn,o),this.subscription&&(0,GH.checkSubscription)(jn,this.subscription),jn.getToken.info(`Using the scope ${i}`),Kue.tracingClient.withSpan(`${this.constructor.name}.getToken`,n,async()=>{try{(0,zH.ensureValidScopeForDevTimeCreds)(i,jn);let s=(0,zH.getScopeResource)(i),a=await _n.cliCredentialInternals.getAzureCliAccessToken(s,o,this.subscription,this.timeout),c=a.stderr?.match("(.*)az login --scope(.*)"),u=a.stderr?.match("(.*)az login(.*)")&&!c;if(a.stderr?.match("az:(.*)not found")||a.stderr?.startsWith("'az' is not recognized")){let d=new gc.CredentialUnavailableError(_n.azureCliPublicErrorMessages.notInstalled);throw jn.getToken.info((0,_c.formatError)(e,d)),d}if(u){let d=new gc.CredentialUnavailableError(_n.azureCliPublicErrorMessages.login);throw jn.getToken.info((0,_c.formatError)(e,d)),d}try{let d=a.stdout,f=this.parseRawResponse(d);return jn.getToken.info((0,_c.formatSuccess)(e)),f}catch(d){throw a.stderr?new gc.CredentialUnavailableError(a.stderr):d}}catch(s){let a=s.name==="CredentialUnavailableError"?s:new gc.CredentialUnavailableError(s.message||_n.azureCliPublicErrorMessages.unknown);throw jn.getToken.info((0,_c.formatError)(e,a)),a}})}parseRawResponse(e){let n=JSON.parse(e),i=n.accessToken,r=Number.parseInt(n.expires_on,10)*1e3;if(!isNaN(r))return jn.getToken.info("expires_on is available and is valid, using it"),{token:i,expiresOnTimestamp:r,tokenType:"Bearer"};if(r=new Date(n.expiresOn).getTime(),isNaN(r))throw new gc.CredentialUnavailableError(`${_n.azureCliPublicErrorMessages.unexpectedResponse} "${n.expiresOn}"`);return{token:i,expiresOnTimestamp:r,tokenType:"Bearer"}}};_n.AzureCliCredential=x0});var WH=g(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});p_.processUtils=void 0;var Xue=(un(),At(cn)),Que=Xue.__importDefault(x("child_process"));p_.processUtils={execFile(t,e,n){return new Promise((i,r)=>{Que.default.execFile(t,e,n,(o,s,a)=>{Buffer.isBuffer(s)&&(s=s.toString("utf8")),Buffer.isBuffer(a)&&(a=a.toString("utf8")),a||o?r(a?new Error(a):o):i(s)})})}}});var B0=g(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.AzurePowerShellCredential=mt.commandStack=mt.powerShellPublicErrorMessages=mt.powerShellErrors=void 0;mt.formatCommand=H0;mt.parseJsonToken=ZH;var m_=Et(),yc=He(),KH=ar(),g_=_t(),Zue=WH(),Jue=Rt(),Kr=(0,yc.credentialLogger)("AzurePowerShellCredential"),QH=process.platform==="win32";function H0(t){return QH?`${t}.exe`:t}async function XH(t,e){let n=[];for(let i of t){let[r,...o]=i,s=await Zue.processUtils.execFile(r,o,{encoding:"utf8",timeout:e});n.push(s)}return n}mt.powerShellErrors={login:"Run Connect-AzAccount to login",installed:"The specified module 'Az.Accounts' with version '2.2.0' was not loaded because no valid module file was found in any module directory"};mt.powerShellPublicErrorMessages={login:"Please run 'Connect-AzAccount' from PowerShell to authenticate before using this credential.",installed:`The 'Az.Account' module >= 2.2.0 is not installed. Install the Azure Az PowerShell module with: "Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force".`,claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",troubleshoot:"To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot."};var ele=t=>t.message.match(`(.*)${mt.powerShellErrors.login}(.*)`),tle=t=>t.message.match(mt.powerShellErrors.installed);mt.commandStack=[H0("pwsh")];QH&&mt.commandStack.push(H0("powershell"));var q0=class{tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&((0,m_.checkTenantId)(Kr,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=(0,m_.resolveAdditionallyAllowedTenantIds)(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,n,i){for(let r of[...mt.commandStack]){try{await XH([[r,"/?"]],i)}catch{mt.commandStack.shift();continue}let s=(await XH([[r,"-NoProfile","-NonInteractive","-Command",`
|
|
68
|
+
$tenantId = "${n??""}"
|
|
69
|
+
$m = Import-Module Az.Accounts -MinimumVersion 2.2.0 -PassThru
|
|
70
|
+
$useSecureString = $m.Version -ge [version]'2.17.0' -and $m.Version -lt [version]'5.0.0'
|
|
71
|
+
|
|
72
|
+
$params = @{
|
|
73
|
+
ResourceUrl = "${e}"
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if ($tenantId.Length -gt 0) {
|
|
77
|
+
$params["TenantId"] = $tenantId
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if ($useSecureString) {
|
|
81
|
+
$params["AsSecureString"] = $true
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
$token = Get-AzAccessToken @params
|
|
85
|
+
|
|
86
|
+
$result = New-Object -TypeName PSObject
|
|
87
|
+
$result | Add-Member -MemberType NoteProperty -Name ExpiresOn -Value $token.ExpiresOn
|
|
88
|
+
|
|
89
|
+
if ($token.Token -is [System.Security.SecureString]) {
|
|
90
|
+
if ($PSVersionTable.PSVersion.Major -lt 7) {
|
|
91
|
+
$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($token.Token)
|
|
92
|
+
try {
|
|
93
|
+
$result | Add-Member -MemberType NoteProperty -Name Token -Value ([System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr))
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
[System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
$result | Add-Member -MemberType NoteProperty -Name Token -Value ($token.Token | ConvertFrom-SecureString -AsPlainText)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
$result | Add-Member -MemberType NoteProperty -Name Token -Value $token.Token
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
Write-Output (ConvertTo-Json $result)
|
|
108
|
+
`]]))[0];return ZH(s)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,n={}){return Jue.tracingClient.withSpan(`${this.constructor.name}.getToken`,n,async()=>{let i=typeof e=="string"?e:e[0],r=n.claims;if(r&&r.trim()){let a=`Connect-AzAccount -ClaimsChallenge ${btoa(r)}`,c=n.tenantId;c&&(a+=` -Tenant ${c}`);let u=new g_.CredentialUnavailableError(`${mt.powerShellPublicErrorMessages.claim} ${a}`);throw Kr.getToken.info((0,yc.formatError)(i,u)),u}let o=(0,m_.processMultiTenantRequest)(this.tenantId,n,this.additionallyAllowedTenantIds);o&&(0,m_.checkTenantId)(Kr,o);try{(0,KH.ensureValidScopeForDevTimeCreds)(i,Kr),Kr.getToken.info(`Using the scope ${i}`);let s=(0,KH.getScopeResource)(i),a=await this.getAzurePowerShellAccessToken(s,o,this.timeout);return Kr.getToken.info((0,yc.formatSuccess)(e)),{token:a.Token,expiresOnTimestamp:new Date(a.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(s){if(tle(s)){let c=new g_.CredentialUnavailableError(mt.powerShellPublicErrorMessages.installed);throw Kr.getToken.info((0,yc.formatError)(i,c)),c}else if(ele(s)){let c=new g_.CredentialUnavailableError(mt.powerShellPublicErrorMessages.login);throw Kr.getToken.info((0,yc.formatError)(i,c)),c}let a=new g_.CredentialUnavailableError(`${s}. ${mt.powerShellPublicErrorMessages.troubleshoot}`);throw Kr.getToken.info((0,yc.formatError)(i,a)),a}})}};mt.AzurePowerShellCredential=q0;async function ZH(t){let e=/{[^{}]*}/g,n=t.match(e),i=t;if(n)try{for(let r of n)try{let o=JSON.parse(r);if(o?.Token)return i=i.replace(r,""),i&&Kr.getToken.warning(i),o}catch{continue}}catch{throw new Error(`Unable to parse the output of PowerShell. Received output: ${t}`)}throw new Error(`No access token found in the output. Received output: ${t}`)}});var $0=g(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});y_.VisualStudioCodeCredential=void 0;var eB=He(),JH=Et(),__=_t(),nle=Et(),rle=wr(),ile=ar(),j0=Xh(),ole=hd(),sle=x("fs/promises"),ale="common",cle="aebc6443-996d-45c2-90f0-388ff96faa56",Y0=(0,eB.credentialLogger)("VisualStudioCodeCredential"),ule={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function lle(t){let e=ule[t];if(e)throw new __.CredentialUnavailableError(e)}var V0=class{tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?((0,nle.checkTenantId)(Y0,e.tenantId),this.tenantId=e.tenantId):this.tenantId=ale,this.additionallyAllowedTenantIds=(0,JH.resolveAdditionallyAllowedTenantIds)(e?.additionallyAllowedTenants),lle(this.tenantId)}async prepare(e){let n=(0,JH.processMultiTenantRequest)(this.tenantId,this.options,this.additionallyAllowedTenantIds,Y0)||this.tenantId;if(!(0,j0.hasVSCodePlugin)()||!j0.vsCodeAuthRecordPath)throw new __.CredentialUnavailableError("Visual Studio Code Authentication is not available. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");let i=await this.loadAuthRecord(j0.vsCodeAuthRecordPath,e);this.msalClient=(0,rle.createMsalClient)(cle,n,{...this.options,isVSCodeCredential:!0,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0},authenticationRecord:i})}preparePromise;prepareOnce(e){return this.preparePromise||(this.preparePromise=this.prepare(e)),this.preparePromise}async getToken(e,n){let i=(0,ile.ensureScopes)(e);if(await this.prepareOnce(i),!this.msalClient)throw new __.CredentialUnavailableError("Visual Studio Code Authentication failed to initialize. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");return this.msalClient.getTokenByInteractiveRequest(i,{...n,disableAutomaticAuthentication:!0})}async loadAuthRecord(e,n){try{let i=await(0,sle.readFile)(e,{encoding:"utf8"});return(0,ole.deserializeAuthenticationRecord)(i)}catch(i){throw Y0.getToken.info((0,eB.formatError)(n,i)),new __.CredentialUnavailableError("Cannot load authentication record in Visual Studio Code. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.")}}};y_.VisualStudioCodeCredential=V0});var nB=g(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});T_.BrokerCredential=void 0;var z0=Et(),tB=He(),dle=ar(),hle=Rt(),fle=wr(),ple=Fr(),mle=_t(),E_=(0,tB.credentialLogger)("BrokerCredential"),G0=class{brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=(0,z0.resolveTenantId)(E_,e.tenantId),this.brokerAdditionallyAllowedTenantIds=(0,z0.resolveAdditionallyAllowedTenantIds)(e?.additionallyAllowedTenants);let n={...e,tokenCredentialOptions:e,logger:E_,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=(0,fle.createMsalClient)(ple.DeveloperSignOnClientId,this.brokerTenantId,n)}async getToken(e,n={}){return hle.tracingClient.withSpan(`${this.constructor.name}.getToken`,n,async i=>{i.tenantId=(0,z0.processMultiTenantRequest)(this.brokerTenantId,i,this.brokerAdditionallyAllowedTenantIds,E_);let r=(0,dle.ensureScopes)(e);try{return this.brokerMsalClient.getBrokeredToken(r,!0,{...i,disableAutomaticAuthentication:!0})}catch(o){throw E_.getToken.info((0,tB.formatError)(r,o)),new mle.CredentialUnavailableError("Failed to acquire token using broker authentication",{cause:o})}})}};T_.BrokerCredential=G0});var rB=g(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.createDefaultBrokerCredential=Cle;Xr.createDefaultVisualStudioCodeCredential=Sle;Xr.createDefaultManagedIdentityCredential=wle;Xr.createDefaultWorkloadIdentityCredential=Ile;Xr.createDefaultAzureDeveloperCliCredential=vle;Xr.createDefaultAzureCliCredential=ble;Xr.createDefaultAzurePowershellCredential=Ole;Xr.createDefaultEnvironmentCredential=Rle;var gle=v0(),A_=M0(),W0=u_(),_le=L0(),yle=F0(),Ele=B0(),Tle=$0(),Ale=nB();function Cle(t={}){return new Ale.BrokerCredential(t)}function Sle(t={}){return new Tle.VisualStudioCodeCredential(t)}function wle(t={}){t.retryOptions??={maxRetries:5,retryDelayInMs:800},t.sendProbeRequest??=!0;let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,n=t?.workloadIdentityClientId??e,i=t?.managedIdentityResourceId,r=process.env.AZURE_FEDERATED_TOKEN_FILE,o=t?.tenantId??process.env.AZURE_TENANT_ID;if(i){let s={...t,resourceId:i};return new A_.ManagedIdentityCredential(s)}if(r&&n){let s={...t,tenantId:o};return new A_.ManagedIdentityCredential(n,s)}if(e){let s={...t,clientId:e};return new A_.ManagedIdentityCredential(s)}return new A_.ManagedIdentityCredential(t)}function Ile(t){let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,n=t?.workloadIdentityClientId??e,i=process.env.AZURE_FEDERATED_TOKEN_FILE,r=t?.tenantId??process.env.AZURE_TENANT_ID;if(i&&n){let o={...t,tenantId:r,clientId:n,tokenFilePath:i};return new W0.WorkloadIdentityCredential(o)}if(r){let o={...t,tenantId:r};return new W0.WorkloadIdentityCredential(o)}return new W0.WorkloadIdentityCredential(t)}function vle(t={}){return new _le.AzureDeveloperCliCredential(t)}function ble(t={}){return new yle.AzureCliCredential(t)}function Ole(t={}){return new Ele.AzurePowerShellCredential(t)}function Rle(t={}){return new gle.EnvironmentCredential(t)}});var X0=g(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.DefaultAzureCredential=Ec.UnavailableDefaultCredential=void 0;var Nle=SA(),Ple=He(),yn=rB(),C_=(0,Ple.credentialLogger)("DefaultAzureCredential"),S_=class{credentialUnavailableErrorMessage;credentialName;constructor(e,n){this.credentialName=e,this.credentialUnavailableErrorMessage=n}getToken(){return C_.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}};Ec.UnavailableDefaultCredential=S_;var K0=class extends Nle.ChainedTokenCredential{constructor(e){Dle(e);let n=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,i=[yn.createDefaultVisualStudioCodeCredential,yn.createDefaultAzureCliCredential,yn.createDefaultAzurePowershellCredential,yn.createDefaultAzureDeveloperCliCredential,yn.createDefaultBrokerCredential],r=[yn.createDefaultEnvironmentCredential,yn.createDefaultWorkloadIdentityCredential,yn.createDefaultManagedIdentityCredential],o=[],s="EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential";if(n)switch(n){case"dev":o=i;break;case"prod":o=r;break;case"environmentcredential":o=[yn.createDefaultEnvironmentCredential];break;case"workloadidentitycredential":o=[yn.createDefaultWorkloadIdentityCredential];break;case"managedidentitycredential":o=[()=>(0,yn.createDefaultManagedIdentityCredential)({sendProbeRequest:!1})];break;case"visualstudiocodecredential":o=[yn.createDefaultVisualStudioCodeCredential];break;case"azureclicredential":o=[yn.createDefaultAzureCliCredential];break;case"azurepowershellcredential":o=[yn.createDefaultAzurePowershellCredential];break;case"azuredeveloperclicredential":o=[yn.createDefaultAzureDeveloperCliCredential];break;default:{let c=`Invalid value for AZURE_TOKEN_CREDENTIALS = ${process.env.AZURE_TOKEN_CREDENTIALS}. Valid values are 'prod' or 'dev' or any of these credentials - ${s}.`;throw C_.warning(c),new Error(c)}}else o=[...r,...i];let a=o.map(c=>{try{return c(e??{})}catch(u){return C_.warning(`Skipped ${c.name} because of an error creating the credential: ${u}`),new S_(c.name,u.message)}});super(...a)}};Ec.DefaultAzureCredential=K0;function Dle(t){if(t?.requiredEnvVars){let n=(Array.isArray(t.requiredEnvVars)?t.requiredEnvVars:[t.requiredEnvVars]).filter(i=>!process.env[i]);if(n.length>0){let i=`Required environment ${n.length===1?"variable":"variables"} '${n.join(", ")}' for DefaultAzureCredential ${n.length===1?"is":"are"} not set or empty.`;throw C_.warning(i),new Error(i)}}}});var sB=g(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});w_.InteractiveBrowserCredential=void 0;var Q0=Et(),Mle=He(),iB=ar(),oB=Rt(),kle=wr(),Lle=Fr(),Z0=(0,Mle.credentialLogger)("InteractiveBrowserCredential"),J0=class{tenantId;additionallyAllowedTenantIds;msalClient;disableAutomaticAuthentication;browserCustomizationOptions;loginHint;constructor(e){this.tenantId=(0,Q0.resolveTenantId)(Z0,e.tenantId,e.clientId),this.additionallyAllowedTenantIds=(0,Q0.resolveAdditionallyAllowedTenantIds)(e?.additionallyAllowedTenants);let n={...e,tokenCredentialOptions:e,logger:Z0},i=e;if(this.browserCustomizationOptions=i.browserCustomizationOptions,this.loginHint=i.loginHint,i?.brokerOptions?.enabled)if(i?.brokerOptions?.parentWindowHandle)n.brokerOptions={enabled:!0,parentWindowHandle:i.brokerOptions.parentWindowHandle,legacyEnableMsaPassthrough:i.brokerOptions?.legacyEnableMsaPassthrough,useDefaultBrokerAccount:i.brokerOptions?.useDefaultBrokerAccount};else throw new Error("In order to do WAM authentication, `parentWindowHandle` under `brokerOptions` is a required parameter");this.msalClient=(0,kle.createMsalClient)(e.clientId??Lle.DeveloperSignOnClientId,this.tenantId,n),this.disableAutomaticAuthentication=e?.disableAutomaticAuthentication}async getToken(e,n={}){return oB.tracingClient.withSpan(`${this.constructor.name}.getToken`,n,async i=>{i.tenantId=(0,Q0.processMultiTenantRequest)(this.tenantId,i,this.additionallyAllowedTenantIds,Z0);let r=(0,iB.ensureScopes)(e);return this.msalClient.getTokenByInteractiveRequest(r,{...i,disableAutomaticAuthentication:this.disableAutomaticAuthentication,browserCustomizationOptions:this.browserCustomizationOptions,loginHint:this.loginHint})})}async authenticate(e,n={}){return oB.tracingClient.withSpan(`${this.constructor.name}.authenticate`,n,async i=>{let r=(0,iB.ensureScopes)(e);return await this.msalClient.getTokenByInteractiveRequest(r,{...i,disableAutomaticAuthentication:!1,browserCustomizationOptions:this.browserCustomizationOptions,loginHint:this.loginHint}),this.msalClient.getActiveAccount()})}};w_.InteractiveBrowserCredential=J0});var uB=g(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.DeviceCodeCredential=void 0;Xd.defaultDeviceCodePromptCallback=cB;var ev=Et(),Ule=He(),xle=ar(),aB=Rt(),Fle=wr(),qle=Fr(),tv=(0,Ule.credentialLogger)("DeviceCodeCredential");function cB(t){console.log(t.message)}var nv=class{tenantId;additionallyAllowedTenantIds;disableAutomaticAuthentication;msalClient;userPromptCallback;constructor(e){this.tenantId=e?.tenantId,this.additionallyAllowedTenantIds=(0,ev.resolveAdditionallyAllowedTenantIds)(e?.additionallyAllowedTenants);let n=e?.clientId??qle.DeveloperSignOnClientId,i=(0,ev.resolveTenantId)(tv,e?.tenantId,n);this.userPromptCallback=e?.userPromptCallback??cB,this.msalClient=(0,Fle.createMsalClient)(n,i,{...e,logger:tv,tokenCredentialOptions:e||{}}),this.disableAutomaticAuthentication=e?.disableAutomaticAuthentication}async getToken(e,n={}){return aB.tracingClient.withSpan(`${this.constructor.name}.getToken`,n,async i=>{i.tenantId=(0,ev.processMultiTenantRequest)(this.tenantId,i,this.additionallyAllowedTenantIds,tv);let r=(0,xle.ensureScopes)(e);return this.msalClient.getTokenByDeviceCode(r,this.userPromptCallback,{...i,disableAutomaticAuthentication:this.disableAutomaticAuthentication})})}async authenticate(e,n={}){return aB.tracingClient.withSpan(`${this.constructor.name}.authenticate`,n,async i=>{let r=Array.isArray(e)?e:[e];return await this.msalClient.getTokenByDeviceCode(r,this.userPromptCallback,{...i,disableAutomaticAuthentication:!1}),this.msalClient.getActiveAccount()})}};Xd.DeviceCodeCredential=nv});var hB=g(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.AzurePipelinesCredential=void 0;Qd.handleOidcResponse=dB;var Ni=_t(),lB=Gr(),Hle=c_(),Ble=Jg(),jle=Et(),Yle=He(),Ir="AzurePipelinesCredential",cr=(0,Yle.credentialLogger)(Ir),Vle="7.1",rv=class{clientAssertionCredential;identityClient;constructor(e,n,i,r,o={}){if(!n)throw new Ni.CredentialUnavailableError(`${Ir}: is unavailable. clientId is a required parameter.`);if(!e)throw new Ni.CredentialUnavailableError(`${Ir}: is unavailable. tenantId is a required parameter.`);if(!i)throw new Ni.CredentialUnavailableError(`${Ir}: is unavailable. serviceConnectionId is a required parameter.`);if(!r)throw new Ni.CredentialUnavailableError(`${Ir}: is unavailable. systemAccessToken is a required parameter.`);if(o.loggingOptions={...o?.loggingOptions,additionalAllowedHeaderNames:[...o.loggingOptions?.additionalAllowedHeaderNames??[],"x-vss-e2eid","x-msedge-ref"]},this.identityClient=new Ble.IdentityClient(o),(0,jle.checkTenantId)(cr,e),cr.info(`Invoking AzurePipelinesCredential with tenant ID: ${e}, client ID: ${n}, and service connection ID: ${i}`),!process.env.SYSTEM_OIDCREQUESTURI)throw new Ni.CredentialUnavailableError(`${Ir}: is unavailable. Ensure that you're running this task in an Azure Pipeline, so that following missing system variable(s) can be defined- "SYSTEM_OIDCREQUESTURI"`);let s=`${process.env.SYSTEM_OIDCREQUESTURI}?api-version=${Vle}&serviceConnectionId=${i}`;cr.info(`Invoking ClientAssertionCredential with tenant ID: ${e}, client ID: ${n} and service connection ID: ${i}`),this.clientAssertionCredential=new Hle.ClientAssertionCredential(e,n,this.requestOidcToken.bind(this,s,r),o)}async getToken(e,n){if(!this.clientAssertionCredential){let i=`${Ir}: is unavailable. To use Federation Identity in Azure Pipelines, the following parameters are required -
|
|
109
|
+
tenantId,
|
|
110
|
+
clientId,
|
|
111
|
+
serviceConnectionId,
|
|
112
|
+
systemAccessToken,
|
|
113
|
+
"SYSTEM_OIDCREQUESTURI".
|
|
114
|
+
See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/azurepipelinescredential/troubleshoot`;throw cr.error(i),new Ni.CredentialUnavailableError(i)}return cr.info("Invoking getToken() of Client Assertion Credential"),this.clientAssertionCredential.getToken(e,n)}async requestOidcToken(e,n){cr.info("Requesting OIDC token from Azure Pipelines..."),cr.info(e);let i=(0,lB.createPipelineRequest)({url:e,method:"POST",headers:(0,lB.createHttpHeaders)({"Content-Type":"application/json",Authorization:`Bearer ${n}`,"X-TFS-FedAuthRedirect":"Suppress"})}),r=await this.identityClient.sendRequest(i);return dB(r)}};Qd.AzurePipelinesCredential=rv;function dB(t){let e=t.bodyAsText;if(!e)throw cr.error(`${Ir}: Authentication Failed. Received null token from OIDC request. Response status- ${t.status}. Complete response - ${JSON.stringify(t)}`),new Ni.AuthenticationError(t.status,{error:`${Ir}: Authentication Failed. Received null token from OIDC request.`,error_description:`${JSON.stringify(t)}. See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/azurepipelinescredential/troubleshoot`});try{let n=JSON.parse(e);if(n?.oidcToken)return n.oidcToken;{let i=`${Ir}: Authentication Failed. oidcToken field not detected in the response.`,r="";throw t.status!==200&&(r=`Response body = ${e}. Response Headers ["x-vss-e2eid"] = ${t.headers.get("x-vss-e2eid")} and ["x-msedge-ref"] = ${t.headers.get("x-msedge-ref")}. See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/azurepipelinescredential/troubleshoot`),cr.error(i),cr.error(r),new Ni.AuthenticationError(t.status,{error:i,error_description:r})}}catch(n){let i=`${Ir}: Authentication Failed. oidcToken field not detected in the response.`;throw cr.error(`Response from service = ${e}, Response Headers ["x-vss-e2eid"] = ${t.headers.get("x-vss-e2eid")}
|
|
115
|
+
and ["x-msedge-ref"] = ${t.headers.get("x-msedge-ref")}, error message = ${n.message}`),cr.error(i),new Ni.AuthenticationError(t.status,{error:i,error_description:`Response = ${e}. Response headers ["x-vss-e2eid"] = ${t.headers.get("x-vss-e2eid")} and ["x-msedge-ref"] = ${t.headers.get("x-msedge-ref")}. See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/azurepipelinescredential/troubleshoot`})}}});var mB=g(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});I_.AuthorizationCodeCredential=void 0;var fB=Et(),$le=Et(),zle=He(),Gle=ar(),Wle=Rt(),Kle=wr(),pB=(0,zle.credentialLogger)("AuthorizationCodeCredential"),iv=class{msalClient;disableAutomaticAuthentication;authorizationCode;redirectUri;tenantId;additionallyAllowedTenantIds;clientSecret;constructor(e,n,i,r,o,s){(0,$le.checkTenantId)(pB,e),this.clientSecret=i,typeof o=="string"?(this.authorizationCode=r,this.redirectUri=o):(this.authorizationCode=i,this.redirectUri=r,this.clientSecret=void 0,s=o),this.tenantId=e,this.additionallyAllowedTenantIds=(0,fB.resolveAdditionallyAllowedTenantIds)(s?.additionallyAllowedTenants),this.msalClient=(0,Kle.createMsalClient)(n,e,{...s,logger:pB,tokenCredentialOptions:s??{}})}async getToken(e,n={}){return Wle.tracingClient.withSpan(`${this.constructor.name}.getToken`,n,async i=>{let r=(0,fB.processMultiTenantRequest)(this.tenantId,i,this.additionallyAllowedTenantIds);i.tenantId=r;let o=(0,Gle.ensureScopes)(e);return this.msalClient.getTokenByAuthorizationCode(o,this.redirectUri,this.authorizationCode,this.clientSecret,{...i,disableAutomaticAuthentication:this.disableAutomaticAuthentication})})}};I_.AuthorizationCodeCredential=iv});var EB=g(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});b_.OnBehalfOfCredential=void 0;var Xle=wr(),yB=He(),gB=Et(),v_=_t(),_B=x("crypto"),Qle=ar(),Zle=x("fs/promises"),Jle=Rt(),Tc="OnBehalfOfCredential",ov=(0,yB.credentialLogger)(Tc),sv=class{tenantId;additionallyAllowedTenantIds;msalClient;sendCertificateChain;certificatePath;clientSecret;userAssertionToken;clientAssertion;constructor(e){let{clientSecret:n}=e,{certificatePath:i,sendCertificateChain:r}=e,{getAssertion:o}=e,{tenantId:s,clientId:a,userAssertionToken:c,additionallyAllowedTenants:u}=e;if(!s)throw new v_.CredentialUnavailableError(`${Tc}: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(!a)throw new v_.CredentialUnavailableError(`${Tc}: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(!n&&!i&&!o)throw new v_.CredentialUnavailableError(`${Tc}: You must provide one of clientSecret, certificatePath, or a getAssertion callback but none were provided. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(!c)throw new v_.CredentialUnavailableError(`${Tc}: userAssertionToken is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.certificatePath=i,this.clientSecret=n,this.userAssertionToken=c,this.sendCertificateChain=r,this.clientAssertion=o,this.tenantId=s,this.additionallyAllowedTenantIds=(0,gB.resolveAdditionallyAllowedTenantIds)(u),this.msalClient=(0,Xle.createMsalClient)(a,this.tenantId,{...e,logger:ov,tokenCredentialOptions:e})}async getToken(e,n={}){return Jle.tracingClient.withSpan(`${Tc}.getToken`,n,async i=>{i.tenantId=(0,gB.processMultiTenantRequest)(this.tenantId,i,this.additionallyAllowedTenantIds,ov);let r=(0,Qle.ensureScopes)(e);if(this.certificatePath){let o=await this.buildClientCertificate(this.certificatePath);return this.msalClient.getTokenOnBehalfOf(r,this.userAssertionToken,o,i)}else{if(this.clientSecret)return this.msalClient.getTokenOnBehalfOf(r,this.userAssertionToken,this.clientSecret,n);if(this.clientAssertion)return this.msalClient.getTokenOnBehalfOf(r,this.userAssertionToken,this.clientAssertion,n);throw new Error("Expected either clientSecret or certificatePath or clientAssertion to be defined.")}})}async buildClientCertificate(e){try{let n=await this.parseCertificate({certificatePath:e},this.sendCertificateChain);return{thumbprint:n.thumbprint,thumbprintSha256:n.thumbprintSha256,privateKey:n.certificateContents,x5c:n.x5c}}catch(n){throw ov.info((0,yB.formatError)("",n)),n}}async parseCertificate(e,n){let i=e.certificatePath,r=await(0,Zle.readFile)(i,"utf8"),o=n?r:void 0,s=/(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g,a=[],c;do c=s.exec(r),c&&a.push(c[3]);while(c);if(a.length===0)throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");let u=(0,_B.createHash)("sha1").update(Buffer.from(a[0],"base64")).digest("hex").toUpperCase(),l=(0,_B.createHash)("sha256").update(Buffer.from(a[0],"base64")).digest("hex").toUpperCase();return{certificateContents:r,thumbprintSha256:l,thumbprint:u,x5c:o}}};b_.OnBehalfOfCredential=sv});var TB=g(cv=>{"use strict";Object.defineProperty(cv,"__esModule",{value:!0});cv.getBearerTokenProvider=ede;var av=Gr();function ede(t,e,n){let{abortSignal:i,tracingOptions:r}=n||{},o=(0,av.createEmptyPipeline)();o.addPolicy((0,av.bearerTokenAuthenticationPolicy)({credential:t,scopes:e}));async function s(){let c=(await o.sendRequest({sendRequest:u=>Promise.resolve({request:u,status:200,headers:u.headers})},(0,av.createPipelineRequest)({url:"https://example.com",abortSignal:i,tracingOptions:r}))).headers.get("authorization")?.split(" ")[1];if(!c)throw new Error("Failed to get access token");return c}return s}});var CB=g(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.getBearerTokenProvider=Q.AzureAuthorityHosts=Q.logger=Q.WorkloadIdentityCredential=Q.OnBehalfOfCredential=Q.VisualStudioCodeCredential=Q.UsernamePasswordCredential=Q.AzurePowerShellCredential=Q.AuthorizationCodeCredential=Q.AzurePipelinesCredential=Q.DeviceCodeCredential=Q.ManagedIdentityCredential=Q.InteractiveBrowserCredential=Q.AzureDeveloperCliCredential=Q.AzureCliCredential=Q.ClientAssertionCredential=Q.ClientCertificateCredential=Q.EnvironmentCredential=Q.DefaultAzureCredential=Q.ClientSecretCredential=Q.ChainedTokenCredential=Q.deserializeAuthenticationRecord=Q.serializeAuthenticationRecord=Q.AuthenticationRequiredError=Q.CredentialUnavailableErrorName=Q.CredentialUnavailableError=Q.AggregateAuthenticationErrorName=Q.AuthenticationErrorName=Q.AggregateAuthenticationError=Q.AuthenticationError=void 0;Q.getDefaultAzureCredential=Sde;var tde=(un(),At(cn));tde.__exportStar(yN(),Q);var nde=X0(),ts=_t();Object.defineProperty(Q,"AuthenticationError",{enumerable:!0,get:function(){return ts.AuthenticationError}});Object.defineProperty(Q,"AggregateAuthenticationError",{enumerable:!0,get:function(){return ts.AggregateAuthenticationError}});Object.defineProperty(Q,"AuthenticationErrorName",{enumerable:!0,get:function(){return ts.AuthenticationErrorName}});Object.defineProperty(Q,"AggregateAuthenticationErrorName",{enumerable:!0,get:function(){return ts.AggregateAuthenticationErrorName}});Object.defineProperty(Q,"CredentialUnavailableError",{enumerable:!0,get:function(){return ts.CredentialUnavailableError}});Object.defineProperty(Q,"CredentialUnavailableErrorName",{enumerable:!0,get:function(){return ts.CredentialUnavailableErrorName}});Object.defineProperty(Q,"AuthenticationRequiredError",{enumerable:!0,get:function(){return ts.AuthenticationRequiredError}});var AB=hd();Object.defineProperty(Q,"serializeAuthenticationRecord",{enumerable:!0,get:function(){return AB.serializeAuthenticationRecord}});Object.defineProperty(Q,"deserializeAuthenticationRecord",{enumerable:!0,get:function(){return AB.deserializeAuthenticationRecord}});var rde=SA();Object.defineProperty(Q,"ChainedTokenCredential",{enumerable:!0,get:function(){return rde.ChainedTokenCredential}});var ide=C0();Object.defineProperty(Q,"ClientSecretCredential",{enumerable:!0,get:function(){return ide.ClientSecretCredential}});var ode=X0();Object.defineProperty(Q,"DefaultAzureCredential",{enumerable:!0,get:function(){return ode.DefaultAzureCredential}});var sde=v0();Object.defineProperty(Q,"EnvironmentCredential",{enumerable:!0,get:function(){return sde.EnvironmentCredential}});var ade=E0();Object.defineProperty(Q,"ClientCertificateCredential",{enumerable:!0,get:function(){return ade.ClientCertificateCredential}});var cde=c_();Object.defineProperty(Q,"ClientAssertionCredential",{enumerable:!0,get:function(){return cde.ClientAssertionCredential}});var ude=F0();Object.defineProperty(Q,"AzureCliCredential",{enumerable:!0,get:function(){return ude.AzureCliCredential}});var lde=L0();Object.defineProperty(Q,"AzureDeveloperCliCredential",{enumerable:!0,get:function(){return lde.AzureDeveloperCliCredential}});var dde=sB();Object.defineProperty(Q,"InteractiveBrowserCredential",{enumerable:!0,get:function(){return dde.InteractiveBrowserCredential}});var hde=M0();Object.defineProperty(Q,"ManagedIdentityCredential",{enumerable:!0,get:function(){return hde.ManagedIdentityCredential}});var fde=uB();Object.defineProperty(Q,"DeviceCodeCredential",{enumerable:!0,get:function(){return fde.DeviceCodeCredential}});var pde=hB();Object.defineProperty(Q,"AzurePipelinesCredential",{enumerable:!0,get:function(){return pde.AzurePipelinesCredential}});var mde=mB();Object.defineProperty(Q,"AuthorizationCodeCredential",{enumerable:!0,get:function(){return mde.AuthorizationCodeCredential}});var gde=B0();Object.defineProperty(Q,"AzurePowerShellCredential",{enumerable:!0,get:function(){return gde.AzurePowerShellCredential}});var _de=w0();Object.defineProperty(Q,"UsernamePasswordCredential",{enumerable:!0,get:function(){return _de.UsernamePasswordCredential}});var yde=$0();Object.defineProperty(Q,"VisualStudioCodeCredential",{enumerable:!0,get:function(){return yde.VisualStudioCodeCredential}});var Ede=EB();Object.defineProperty(Q,"OnBehalfOfCredential",{enumerable:!0,get:function(){return Ede.OnBehalfOfCredential}});var Tde=u_();Object.defineProperty(Q,"WorkloadIdentityCredential",{enumerable:!0,get:function(){return Tde.WorkloadIdentityCredential}});var Ade=He();Object.defineProperty(Q,"logger",{enumerable:!0,get:function(){return Ade.logger}});var Cde=Fr();Object.defineProperty(Q,"AzureAuthorityHosts",{enumerable:!0,get:function(){return Cde.AzureAuthorityHosts}});function Sde(){return new nde.DefaultAzureCredential}var wde=TB();Object.defineProperty(Q,"getBearerTokenProvider",{enumerable:!0,get:function(){return wde.getBearerTokenProvider}})});var SB=g(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});O_.AzureKeyCredential=void 0;var uv=class{_key;get key(){return this._key}constructor(e){if(!e)throw new Error("key must be a non-empty string");this._key=e}update(e){this._key=e}};O_.AzureKeyCredential=uv});var wB=g(lv=>{"use strict";Object.defineProperty(lv,"__esModule",{value:!0});lv.isKeyCredential=vde;var Ide=nr();function vde(t){return(0,Ide.isObjectWithProperties)(t,["key"])&&typeof t.key=="string"}});var IB=g(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.AzureNamedKeyCredential=void 0;Zd.isNamedKeyCredential=Ode;var bde=nr(),dv=class{_key;_name;get key(){return this._key}get name(){return this._name}constructor(e,n){if(!e||!n)throw new TypeError("name and key must be non-empty strings");this._name=e,this._key=n}update(e,n){if(!e||!n)throw new TypeError("newName and newKey must be non-empty strings");this._name=e,this._key=n}};Zd.AzureNamedKeyCredential=dv;function Ode(t){return(0,bde.isObjectWithProperties)(t,["name","key"])&&typeof t.key=="string"&&typeof t.name=="string"}});var vB=g(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});Jd.AzureSASCredential=void 0;Jd.isSASCredential=Nde;var Rde=nr(),hv=class{_signature;get signature(){return this._signature}constructor(e){if(!e)throw new Error("shared access signature must be a non-empty string");this._signature=e}update(e){if(!e)throw new Error("shared access signature must be a non-empty string");this._signature=e}};Jd.AzureSASCredential=hv;function Nde(t){return(0,Rde.isObjectWithProperties)(t,["signature"])&&typeof t.signature=="string"}});var bB=g(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.isBearerToken=Pde;eh.isPopToken=Dde;eh.isTokenCredential=Mde;function Pde(t){return!t.tokenType||t.tokenType==="Bearer"}function Dde(t){return t.tokenType==="pop"}function Mde(t){let e=t;return e&&typeof e.getToken=="function"&&(e.signRequest===void 0||e.getToken.length>0)}});var NB=g(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.isTokenCredential=Jt.isSASCredential=Jt.AzureSASCredential=Jt.isNamedKeyCredential=Jt.AzureNamedKeyCredential=Jt.isKeyCredential=Jt.AzureKeyCredential=void 0;var kde=SB();Object.defineProperty(Jt,"AzureKeyCredential",{enumerable:!0,get:function(){return kde.AzureKeyCredential}});var Lde=wB();Object.defineProperty(Jt,"isKeyCredential",{enumerable:!0,get:function(){return Lde.isKeyCredential}});var OB=IB();Object.defineProperty(Jt,"AzureNamedKeyCredential",{enumerable:!0,get:function(){return OB.AzureNamedKeyCredential}});Object.defineProperty(Jt,"isNamedKeyCredential",{enumerable:!0,get:function(){return OB.isNamedKeyCredential}});var RB=vB();Object.defineProperty(Jt,"AzureSASCredential",{enumerable:!0,get:function(){return RB.AzureSASCredential}});Object.defineProperty(Jt,"isSASCredential",{enumerable:!0,get:function(){return RB.isSASCredential}});var Ude=bB();Object.defineProperty(Jt,"isTokenCredential",{enumerable:!0,get:function(){return Ude.isTokenCredential}})});var MB=g((N_,DB)=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.default=void 0;var xde=x("events"),Fde=PB(x("util"));function PB(t,e){if(typeof WeakMap=="function")var n=new WeakMap,i=new WeakMap;return(PB=function(r,o){if(!o&&r&&r.__esModule)return r;var s,a,c={__proto__:null,default:r};if(r===null||typeof r!="object"&&typeof r!="function")return c;if(s=o?i:n){if(s.has(r))return s.get(r);s.set(r,c)}for(let u in r)u!=="default"&&{}.hasOwnProperty.call(r,u)&&((a=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(r,u))&&(a.get||a.set)?s(c,u,a):c[u]=r[u]);return c})(t,e)}var R_=class extends xde.EventEmitter{constructor({data:e=!1,payload:n=!1,packet:i=!1,token:r=!1}={}){super(),this.options={data:e,payload:n,packet:i,token:r},this.indent=" "}packet(e,n){this.haveListeners()&&this.options.packet&&(this.log(""),this.log(e),this.log(n.headerToString(this.indent)))}data(e){this.haveListeners()&&this.options.data&&this.log(e.dataToString(this.indent))}payload(e){this.haveListeners()&&this.options.payload&&this.log(e())}token(e){this.haveListeners()&&this.options.token&&this.log(Fde.inspect(e,{showHidden:!1,depth:5,colors:!0}))}haveListeners(){return this.listeners("debug").length>0}log(e){this.emit("debug",e)}},tOe=N_.default=R_;DB.exports=R_});var UB=g(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});P_.sendInParallel=LB;P_.sendMessage=Bde;var qde=fv(x("dgram")),kB=fv(x("net")),Hde=fv(x("url"));function fv(t){return t&&t.__esModule?t:{default:t}}async function LB(t,e,n,i){return i.throwIfAborted(),await new Promise((r,o)=>{let s=[],a=0,c=f=>{a++,a===t.length&&(i.removeEventListener("abort",l),d(),o(f))},u=f=>{i.removeEventListener("abort",l),d(),r(f)},l=()=>{d(),o(i.reason)},d=()=>{for(let f of s)f.removeListener("error",c),f.removeListener("message",u),f.close()};i.addEventListener("abort",l,{once:!0});for(let f=0;f<t.length;f++){let m=t[f].family===6?"udp6":"udp4",_=qde.default.createSocket(m);s.push(_),_.on("error",c),_.on("message",u),_.send(n,0,n.length,e,t[f].address)}})}async function Bde(t,e,n,i,r){i.throwIfAborted();let o;return kB.default.isIP(t)?o=[{address:t,family:kB.default.isIPv6(t)?6:4}]:o=await new Promise((s,a)=>{let c=()=>{a(i.reason)},u=Hde.default.domainToASCII(t);n(u===""?t:u,{all:!0},(l,d)=>{i.removeEventListener("abort",c),l?a(l):s(d)})}),await LB(o,e,r,i)}});var FB=g(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});D_.instanceLookup=Kde;D_.parseBrowserResponse=xB;var jde=Vde(x("dns")),Yde=UB();function Vde(t){return t&&t.__esModule?t:{default:t}}var $de=1434,zde=2*1e3,Gde=3,Wde=3;async function Kde(t){let e=t.server;if(typeof e!="string")throw new TypeError('Invalid arguments: "server" must be a string');let n=t.instanceName;if(typeof n!="string")throw new TypeError('Invalid arguments: "instanceName" must be a string');let i=t.timeout===void 0?zde:t.timeout;if(typeof i!="number")throw new TypeError('Invalid arguments: "timeout" must be a number');let r=t.retries===void 0?Gde:t.retries;if(typeof r!="number")throw new TypeError('Invalid arguments: "retries" must be a number');if(t.lookup!==void 0&&typeof t.lookup!="function")throw new TypeError('Invalid arguments: "lookup" must be a function');let o=t.lookup??jde.default.lookup;if(t.port!==void 0&&typeof t.port!="number")throw new TypeError('Invalid arguments: "port" must be a number');let s=t.port??$de,a=t.signal;a.throwIfAborted();let c,u=Buffer.from([2]);for(let f=0;f<=r;f++){let m=AbortSignal.timeout(i);try{c=await(0,Yde.sendMessage)(t.server,s,o,AbortSignal.any([a,m]),u)}catch(_){if(m.aborted)continue;throw _}}if(!c)throw new Error("Failed to get response from SQL Server Browser on "+e);let l=c.toString("ascii",Wde),d=xB(l,n);if(!d)throw new Error("Port for "+n+" not found in "+t.server);return d}function xB(t,e){let n,i=t.split(";;");for(let r=0,o=i.length;r<o;r++){let a=i[r].split(";");for(let c=0,u=a.length;c<u;c+=2){let l=a[c],d=a[c+1];if(l==="tcp"&&n)return parseInt(d,10);l==="InstanceName"&&(d.toUpperCase()===e.toUpperCase()?n=!0:n=!1)}}}});var qB=g(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});M_.TransientErrorLookup=void 0;var pv=class{isTransientError(e){return[4060,10928,10929,40197,40501,40613].indexOf(e)!==-1}};M_.TransientErrorLookup=pv});var Ac=g(k_=>{"use strict";(function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(s){return i(o(s),arguments)}function n(s,a){return e.apply(null,[s].concat(a||[]))}function i(s,a){var c=1,u=s.length,l,d="",f,m,_,E,I,y,A,S;for(f=0;f<u;f++)if(typeof s[f]=="string")d+=s[f];else if(typeof s[f]=="object"){if(_=s[f],_.keys)for(l=a[c],m=0;m<_.keys.length;m++){if(l==null)throw new Error(e('[sprintf] Cannot access property "%s" of undefined value "%s"',_.keys[m],_.keys[m-1]));l=l[_.keys[m]]}else _.param_no?l=a[_.param_no]:l=a[c++];if(t.not_type.test(_.type)&&t.not_primitive.test(_.type)&&l instanceof Function&&(l=l()),t.numeric_arg.test(_.type)&&typeof l!="number"&&isNaN(l))throw new TypeError(e("[sprintf] expecting number but found %T",l));switch(t.number.test(_.type)&&(A=l>=0),_.type){case"b":l=parseInt(l,10).toString(2);break;case"c":l=String.fromCharCode(parseInt(l,10));break;case"d":case"i":l=parseInt(l,10);break;case"j":l=JSON.stringify(l,null,_.width?parseInt(_.width):0);break;case"e":l=_.precision?parseFloat(l).toExponential(_.precision):parseFloat(l).toExponential();break;case"f":l=_.precision?parseFloat(l).toFixed(_.precision):parseFloat(l);break;case"g":l=_.precision?String(Number(l.toPrecision(_.precision))):parseFloat(l);break;case"o":l=(parseInt(l,10)>>>0).toString(8);break;case"s":l=String(l),l=_.precision?l.substring(0,_.precision):l;break;case"t":l=String(!!l),l=_.precision?l.substring(0,_.precision):l;break;case"T":l=Object.prototype.toString.call(l).slice(8,-1).toLowerCase(),l=_.precision?l.substring(0,_.precision):l;break;case"u":l=parseInt(l,10)>>>0;break;case"v":l=l.valueOf(),l=_.precision?l.substring(0,_.precision):l;break;case"x":l=(parseInt(l,10)>>>0).toString(16);break;case"X":l=(parseInt(l,10)>>>0).toString(16).toUpperCase();break}t.json.test(_.type)?d+=l:(t.number.test(_.type)&&(!A||_.sign)?(S=A?"+":"-",l=l.toString().replace(t.sign,"")):S="",I=_.pad_char?_.pad_char==="0"?"0":_.pad_char.charAt(1):" ",y=_.width-(S+l).length,E=_.width&&y>0?I.repeat(y):"",d+=_.align?S+l+E:I==="0"?S+E+l:E+S+l)}return d}var r=Object.create(null);function o(s){if(r[s])return r[s];for(var a=s,c,u=[],l=0;a;){if((c=t.text.exec(a))!==null)u.push(c[0]);else if((c=t.modulo.exec(a))!==null)u.push("%");else if((c=t.placeholder.exec(a))!==null){if(c[2]){l|=1;var d=[],f=c[2],m=[];if((m=t.key.exec(f))!==null)for(d.push(m[1]);(f=f.substring(m[0].length))!=="";)if((m=t.key_access.exec(f))!==null)d.push(m[1]);else if((m=t.index_access.exec(f))!==null)d.push(m[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");c[2]=d}else l|=2;if(l===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");u.push({placeholder:c[0],param_no:c[1],keys:c[2],sign:c[3],pad_char:c[4],align:c[5],width:c[6],precision:c[7],type:c[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");a=a.substring(c[0].length)}return r[s]=u}typeof k_<"u"&&(k_.sprintf=e,k_.vsprintf=n),typeof window<"u"&&(window.sprintf=e,window.vsprintf=n,typeof define=="function"&&define.amd&&define(function(){return{sprintf:e,vsprintf:n}}))})()});var th=g(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.TYPE=ur.Packet=ur.OFFSET=ur.HEADER_LENGTH=void 0;ur.isPacketComplete=ehe;ur.packetLength=the;var mv=Ac(),gv=ur.HEADER_LENGTH=8,HB=ur.TYPE={SQL_BATCH:1,RPC_REQUEST:3,TABULAR_RESULT:4,ATTENTION:6,BULK_LOAD:7,TRANSACTION_MANAGER:14,LOGIN7:16,NTLMAUTH_PKT:17,PRELOGIN:18,FEDAUTH_TOKEN:8},BB={};for(let t in HB)BB[HB[t]]=t;var Qr={NORMAL:0,EOM:1,IGNORE:2,RESETCONNECTION:8,RESETCONNECTIONSKIPTRAN:16},ze=ur.OFFSET={Type:0,Status:1,Length:2,SPID:4,PacketID:6,Window:7},Xde=0,Qde=1,Zde=0,Jde=`
|
|
116
|
+
`,_v=class{constructor(e){if(e instanceof Buffer)this.buffer=e;else{let n=e;this.buffer=Buffer.alloc(gv,0),this.buffer.writeUInt8(n,ze.Type),this.buffer.writeUInt8(Qr.NORMAL,ze.Status),this.buffer.writeUInt16BE(Xde,ze.SPID),this.buffer.writeUInt8(Qde,ze.PacketID),this.buffer.writeUInt8(Zde,ze.Window),this.setLength()}}setLength(){this.buffer.writeUInt16BE(this.buffer.length,ze.Length)}length(){return this.buffer.readUInt16BE(ze.Length)}resetConnection(e){let n=this.buffer.readUInt8(ze.Status);e?n|=Qr.RESETCONNECTION:n&=255-Qr.RESETCONNECTION,this.buffer.writeUInt8(n,ze.Status)}last(e){let n=this.buffer.readUInt8(ze.Status);return arguments.length>0&&(e?n|=Qr.EOM:n&=255-Qr.EOM,this.buffer.writeUInt8(n,ze.Status)),this.isLast()}ignore(e){let n=this.buffer.readUInt8(ze.Status);e?n|=Qr.IGNORE:n&=255-Qr.IGNORE,this.buffer.writeUInt8(n,ze.Status)}isLast(){return!!(this.buffer.readUInt8(ze.Status)&Qr.EOM)}packetId(e){return e&&this.buffer.writeUInt8(e%256,ze.PacketID),this.buffer.readUInt8(ze.PacketID)}addData(e){return this.buffer=Buffer.concat([this.buffer,e]),this.setLength(),this}data(){return this.buffer.slice(gv)}type(){return this.buffer.readUInt8(ze.Type)}statusAsString(){let e=this.buffer.readUInt8(ze.Status),n=[];for(let i in Qr){let r=Qr[i];e&r?n.push(i):n.push(void 0)}return n.join(" ").trim()}headerToString(e=""){let n=(0,mv.sprintf)("type:0x%02X(%s), status:0x%02X(%s), length:0x%04X, spid:0x%04X, packetId:0x%02X, window:0x%02X",this.buffer.readUInt8(ze.Type),BB[this.buffer.readUInt8(ze.Type)],this.buffer.readUInt8(ze.Status),this.statusAsString(),this.buffer.readUInt16BE(ze.Length),this.buffer.readUInt16BE(ze.SPID),this.buffer.readUInt8(ze.PacketID),this.buffer.readUInt8(ze.Window));return e+n}dataToString(e=""){let o=this.data(),s="",a="";for(let c=0;c<o.length;c++)c%32===0&&(s+=e,s+=(0,mv.sprintf)("%04X ",c)),o[c]<32||o[c]>126?(a+=".",(c+1)%8===0&&(c+1)%32!==0&&(a+=" ")):a+=String.fromCharCode(o[c]),o[c]!=null&&(s+=(0,mv.sprintf)("%02X",o[c])),(c+1)%4===0&&(c+1)%32!==0&&(s+=" "),(c+1)%32===0&&(s+=" "+a,a="",c<o.length-1&&(s+=Jde));return a.length&&(s+=" "+a),s}toString(e=""){return this.headerToString(e)+`
|
|
117
|
+
`+this.dataToString(e+e)}payloadString(){return""}};ur.Packet=_v;function ehe(t){return t.length<gv?!1:t.length>=t.readUInt16BE(ze.Length)}function the(t){return t.readUInt16BE(ze.Length)}});var $B=g((x_,VB)=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});x_.default=void 0;var nhe=Ac(),ns=ihe(wn()),rhe=x("crypto");function ihe(t){return t&&t.__esModule?t:{default:t}}var Cc=20,yv=36,en={VERSION:0,ENCRYPTION:1,INSTOPT:2,THREADID:3,MARS:4,TRACEID:5,FEDAUTHREQUIRED:6,TERMINATOR:255},L_={OFF:0,ON:1,NOT_SUP:2,REQ:3},jB={};for(let t in L_){let e=L_[t];jB[e]=t}var Ev={OFF:0,ON:1},YB={};for(let t in Ev){let e=Ev[t];YB[e]=t}var U_=class{constructor(e={encrypt:!1,version:{major:0,minor:0,build:0,subbuild:0}}){e instanceof Buffer?(this.data=e,this.options={encrypt:!1,version:{major:0,minor:0,build:0,subbuild:0}}):(this.options=e,this.createOptions()),this.extractOptions()}createOptions(){let e=[this.createVersionOption(),this.createEncryptionOption(),this.createInstanceOption(),this.createThreadIdOption(),this.createMarsOption(),this.createTraceIdOption(),this.createFedAuthOption()],n=0;for(let o=0,s=e.length;o<s;o++){let a=e[o];n+=5+a.data.length}n++,this.data=Buffer.alloc(n,0);let i=0,r=5*e.length+1;for(let o=0,s=e.length;o<s;o++){let a=e[o];this.data.writeUInt8(a.token,i+0),this.data.writeUInt16BE(r,i+1),this.data.writeUInt16BE(a.data.length,i+3),i+=5,a.data.copy(this.data,r),r+=a.data.length}this.data.writeUInt8(en.TERMINATOR,i)}createVersionOption(){let e=new ns.default(Cc);return e.writeUInt8(this.options.version.major),e.writeUInt8(this.options.version.minor),e.writeUInt16BE(this.options.version.build),e.writeUInt16BE(this.options.version.subbuild),{token:en.VERSION,data:e.data}}createEncryptionOption(){let e=new ns.default(Cc);return this.options.encrypt?e.writeUInt8(L_.ON):e.writeUInt8(L_.NOT_SUP),{token:en.ENCRYPTION,data:e.data}}createInstanceOption(){let e=new ns.default(Cc);return e.writeUInt8(0),{token:en.INSTOPT,data:e.data}}createThreadIdOption(){let e=new ns.default(Cc);return e.writeUInt32BE(0),{token:en.THREADID,data:e.data}}createMarsOption(){let e=new ns.default(Cc);return e.writeUInt8(Ev.OFF),{token:en.MARS,data:e.data}}createTraceIdOption(){let e=new ns.default(yv);return e.writeBuffer((0,rhe.randomBytes)(yv)),{token:en.TRACEID,data:e.data}}createFedAuthOption(){let e=new ns.default(Cc);return e.writeUInt8(1),{token:en.FEDAUTHREQUIRED,data:e.data}}extractOptions(){let e=0;for(;this.data[e]!==en.TERMINATOR;){let n=this.data.readUInt16BE(e+1),i=this.data.readUInt16BE(e+3);switch(this.data[e]){case en.VERSION:this.extractVersion(n);break;case en.ENCRYPTION:this.extractEncryption(n);break;case en.INSTOPT:this.extractInstance(n);break;case en.THREADID:i>0&&this.extractThreadId(n);break;case en.MARS:this.extractMars(n);break;case en.TRACEID:this.extractTraceId(n);break;case en.FEDAUTHREQUIRED:this.extractFedAuth(n);break}e+=5,n+=i}}extractVersion(e){this.version={major:this.data.readUInt8(e+0),minor:this.data.readUInt8(e+1),build:this.data.readUInt16BE(e+2),subbuild:this.data.readUInt16BE(e+4)}}extractEncryption(e){this.encryption=this.data.readUInt8(e),this.encryptionString=jB[this.encryption]}extractInstance(e){this.instance=this.data.readUInt8(e)}extractThreadId(e){this.threadId=this.data.readUInt32BE(e)}extractMars(e){this.mars=this.data.readUInt8(e),this.marsString=YB[this.mars]}extractTraceId(e){this.traceId=this.data.subarray(e,e+yv)}extractFedAuth(e){this.fedAuthRequired=this.data.readUInt8(e)}toString(e=""){return e+"PreLogin - "+(0,nhe.sprintf)("version:%d.%d.%d.%d, encryption:0x%02X(%s), instopt:0x%02X, threadId:0x%08X, mars:0x%02X(%s), traceId:%s",this.version.major,this.version.minor,this.version.build,this.version.subbuild,this.encryption?this.encryption:0,this.encryptionString?this.encryptionString:"",this.instance?this.instance:0,this.threadId?this.threadId:0,this.mars?this.mars:0,this.marsString?this.marsString:"",this.traceId?this.traceId.toString("hex"):"")}},aOe=x_.default=U_;VB.exports=U_});var nh=g(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.versionsByValue=Sc.versions=void 0;var zB=Sc.versions={"7_1":1895825409,"7_2":1913192450,"7_3_A":1930035203,"7_3_B":1930100739,"7_4":1946157060,"8_0":134217728},ohe=Sc.versionsByValue={};for(let t in zB)ohe[zB[t]]=t});var WB=g((B_,GB)=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});B_.default=void 0;var F_=Ac(),she=nh(),uo={ENDIAN_LITTLE:0,ENDIAN_BIG:1,CHARSET_ASCII:0,CHARSET_EBCDIC:2,FLOAT_IEEE_754:0,FLOAT_VAX:4,FLOAT_ND5000:8,BCP_DUMPLOAD_ON:0,BCP_DUMPLOAD_OFF:16,USE_DB_ON:0,USE_DB_OFF:32,INIT_DB_WARN:0,INIT_DB_FATAL:64,SET_LANG_WARN_OFF:0,SET_LANG_WARN_ON:128},rh={INIT_LANG_WARN:0,INIT_LANG_FATAL:1,ODBC_OFF:0,ODBC_ON:2,F_TRAN_BOUNDARY:4,F_CACHE_CONNECT:8,USER_NORMAL:0,USER_SERVER:16,USER_REMUSER:32,USER_SQLREPL:64,INTEGRATED_SECURITY_OFF:0,INTEGRATED_SECURITY_ON:128},q_={SQL_DFLT:0,SQL_TSQL:8,OLEDB_OFF:0,OLEDB_ON:16,READ_WRITE_INTENT:0,READ_ONLY_INTENT:32},Tv={CHANGE_PASSWORD_NO:0,CHANGE_PASSWORD_YES:1,BINARY_XML:2,SPAWN_USER_INSTANCE:4,UNKNOWN_COLLATION_HANDLING:8,EXTENSION_USED:16},Pi={FEATURE_ID:2,LIBRARY_SECURITYTOKEN:1,LIBRARY_ADAL:2,FEDAUTH_YES_ECHO:1,FEDAUTH_NO_ECHO:0,ADAL_WORKFLOW_USER_PASS:1,ADAL_WORKFLOW_INTEGRATED:2},ahe=255,H_=class{constructor({tdsVersion:e,packetSize:n,clientProgVer:i,clientPid:r,connectionId:o,clientTimeZone:s,clientLcid:a}){this.tdsVersion=e,this.packetSize=n,this.clientProgVer=i,this.clientPid=r,this.connectionId=o,this.clientTimeZone=s,this.clientLcid=a,this.readOnlyIntent=!1,this.initDbFatal=!1,this.fedAuth=void 0,this.userName=void 0,this.password=void 0,this.serverName=void 0,this.appName=void 0,this.hostname=void 0,this.libraryName=void 0,this.language=void 0,this.database=void 0,this.clientId=void 0,this.sspi=void 0,this.attachDbFile=void 0,this.changePassword=void 0}toBuffer(){let e=Buffer.alloc(94),n=[e],i=0,r=e.length;if(i=e.writeUInt32LE(0,i),i=e.writeUInt32LE(this.tdsVersion,i),i=e.writeUInt32LE(this.packetSize,i),i=e.writeUInt32LE(this.clientProgVer,i),i=e.writeUInt32LE(this.clientPid,i),i=e.writeUInt32LE(this.connectionId,i),i=e.writeUInt8(this.buildOptionFlags1(),i),i=e.writeUInt8(this.buildOptionFlags2(),i),i=e.writeUInt8(this.buildTypeFlags(),i),i=e.writeUInt8(this.buildOptionFlags3(),i),i=e.writeInt32LE(this.clientTimeZone,i),i=e.writeUInt32LE(this.clientLcid,i),i=e.writeUInt16LE(r,i),this.hostname){let s=Buffer.from(this.hostname,"ucs2");i=e.writeUInt16LE(s.length/2,i),r+=s.length,n.push(s)}else i=e.writeUInt16LE(r,i);if(i=e.writeUInt16LE(r,i),this.userName){let s=Buffer.from(this.userName,"ucs2");i=e.writeUInt16LE(s.length/2,i),r+=s.length,n.push(s)}else i=e.writeUInt16LE(0,i);if(i=e.writeUInt16LE(r,i),this.password){let s=Buffer.from(this.password,"ucs2");i=e.writeUInt16LE(s.length/2,i),r+=s.length,n.push(this.scramblePassword(s))}else i=e.writeUInt16LE(0,i);if(i=e.writeUInt16LE(r,i),this.appName){let s=Buffer.from(this.appName,"ucs2");i=e.writeUInt16LE(s.length/2,i),r+=s.length,n.push(s)}else i=e.writeUInt16LE(0,i);if(i=e.writeUInt16LE(r,i),this.serverName){let s=Buffer.from(this.serverName,"ucs2");i=e.writeUInt16LE(s.length/2,i),r+=s.length,n.push(s)}else i=e.writeUInt16LE(0,i);if(i=e.writeUInt16LE(r,i),this.tdsVersion>=she.versions["7_4"]){let s=this.buildFeatureExt();i=e.writeUInt16LE(4+s.length,i);let a=Buffer.alloc(4);a.writeUInt32LE(r+4,0),r+=4+s.length,n.push(a,s)}else i=e.writeUInt16LE(0,i);if(i=e.writeUInt16LE(r,i),this.libraryName){let s=Buffer.from(this.libraryName,"ucs2");i=e.writeUInt16LE(s.length/2,i),r+=s.length,n.push(s)}else i=e.writeUInt16LE(0,i);if(i=e.writeUInt16LE(r,i),this.language){let s=Buffer.from(this.language,"ucs2");i=e.writeUInt16LE(s.length/2,i),r+=s.length,n.push(s)}else i=e.writeUInt16LE(0,i);if(i=e.writeUInt16LE(r,i),this.database){let s=Buffer.from(this.database,"ucs2");i=e.writeUInt16LE(s.length/2,i),r+=s.length,n.push(s)}else i=e.writeUInt16LE(0,i);if(this.clientId&&this.clientId.copy(e,i,0,6),i+=6,i=e.writeUInt16LE(r,i),this.sspi?(this.sspi.length>65535?i=e.writeUInt16LE(65535,i):i=e.writeUInt16LE(this.sspi.length,i),n.push(this.sspi)):i=e.writeUInt16LE(0,i),i=e.writeUInt16LE(r,i),this.attachDbFile){let s=Buffer.from(this.attachDbFile,"ucs2");i=e.writeUInt16LE(s.length/2,i),r+=s.length,n.push(s)}else i=e.writeUInt16LE(0,i);if(i=e.writeUInt16LE(r,i),this.changePassword){let s=Buffer.from(this.changePassword,"ucs2");i=e.writeUInt16LE(s.length/2,i),r+=s.length,n.push(s)}else i=e.writeUInt16LE(0,i);this.sspi&&this.sspi.length>65535?e.writeUInt32LE(this.sspi.length,i):e.writeUInt32LE(0,i);let o=Buffer.concat(n);return o.writeUInt32LE(o.length,0),o}buildOptionFlags1(){let e=uo.ENDIAN_LITTLE|uo.CHARSET_ASCII|uo.FLOAT_IEEE_754|uo.BCP_DUMPLOAD_OFF|uo.USE_DB_OFF|uo.SET_LANG_WARN_ON;return this.initDbFatal?e|=uo.INIT_DB_FATAL:e|=uo.INIT_DB_WARN,e}buildFeatureExt(){let e=[],n=this.fedAuth;if(n)switch(n.type){case"ADAL":let s=Buffer.alloc(7);s.writeUInt8(Pi.FEATURE_ID,0),s.writeUInt32LE(2,1),s.writeUInt8(Pi.LIBRARY_ADAL<<1|(n.echo?Pi.FEDAUTH_YES_ECHO:Pi.FEDAUTH_NO_ECHO),5),s.writeUInt8(n.workflow==="integrated"?2:Pi.ADAL_WORKFLOW_USER_PASS,6),e.push(s);break;case"SECURITYTOKEN":let a=Buffer.from(n.fedAuthToken,"ucs2"),c=Buffer.alloc(10),u=0;u=c.writeUInt8(Pi.FEATURE_ID,u),u=c.writeUInt32LE(a.length+4+1,u),u=c.writeUInt8(Pi.LIBRARY_SECURITYTOKEN<<1|(n.echo?Pi.FEDAUTH_YES_ECHO:Pi.FEDAUTH_NO_ECHO),u),c.writeInt32LE(a.length,u),e.push(c),e.push(a);break}let i=10,r=1,o=Buffer.alloc(6);return o.writeUInt8(i,0),o.writeUInt32LE(1,1),o.writeUInt8(r,5),e.push(o),e.push(Buffer.from([ahe])),Buffer.concat(e)}buildOptionFlags2(){let e=rh.INIT_LANG_WARN|rh.ODBC_OFF|rh.USER_NORMAL;return this.sspi?e|=rh.INTEGRATED_SECURITY_ON:e|=rh.INTEGRATED_SECURITY_OFF,e}buildTypeFlags(){let e=q_.SQL_DFLT|q_.OLEDB_OFF;return this.readOnlyIntent?e|=q_.READ_ONLY_INTENT:e|=q_.READ_WRITE_INTENT,e}buildOptionFlags3(){return Tv.CHANGE_PASSWORD_NO|Tv.UNKNOWN_COLLATION_HANDLING|Tv.EXTENSION_USED}scramblePassword(e){for(let n=0,i=e.length;n<i;n++){let r=e[n],o=r&15,s=r>>4;r=o<<4|s,r=r^165,e[n]=r}return e}toString(e=""){return e+"Login7 - "+(0,F_.sprintf)("TDS:0x%08X, PacketSize:0x%08X, ClientProgVer:0x%08X, ClientPID:0x%08X, ConnectionID:0x%08X",this.tdsVersion,this.packetSize,this.clientProgVer,this.clientPid,this.connectionId)+`
|
|
118
|
+
`+e+" "+(0,F_.sprintf)("Flags1:0x%02X, Flags2:0x%02X, TypeFlags:0x%02X, Flags3:0x%02X, ClientTimezone:%d, ClientLCID:0x%08X",this.buildOptionFlags1(),this.buildOptionFlags2(),this.buildTypeFlags(),this.buildOptionFlags3(),this.clientTimeZone,this.clientLcid)+`
|
|
119
|
+
`+e+" "+(0,F_.sprintf)("Hostname:'%s', Username:'%s', Password:'%s', AppName:'%s', ServerName:'%s', LibraryName:'%s'",this.hostname,this.userName,this.password,this.appName,this.serverName,this.libraryName)+`
|
|
120
|
+
`+e+" "+(0,F_.sprintf)("Language:'%s', Database:'%s', SSPI:'%s', AttachDbFile:'%s', ChangePassword:'%s'",this.language,this.database,this.sspi,this.attachDbFile,this.changePassword)}},uOe=B_.default=H_;GB.exports=H_});var KB=g((lOe,j_)=>{"use strict";(function(){"use strict";var t=typeof window=="object"?window:{},e=!t.JS_MD4_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;e&&(t=global);var n=!t.JS_MD4_NO_COMMON_JS&&typeof j_=="object"&&j_.exports,i=typeof define=="function"&&define.amd,r=!t.JS_MD4_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",o="0123456789abcdef".split(""),s=[128,32768,8388608,-2147483648],a=[0,8,16,24],c=["hex","array","digest","buffer","arrayBuffer"],u=[],l;if(r){var d=new ArrayBuffer(68);l=new Uint8Array(d),u=new Uint32Array(d)}var f=function(y){return function(A){return new E(!0).update(A)[y]()}},m=function(){var y=f("hex");e&&(y=_(y)),y.create=function(){return new E},y.update=function(w){return y.create().update(w)};for(var A=0;A<c.length;++A){var S=c[A];y[S]=f(S)}return y},_=function(y){var A=x("crypto"),S=x("buffer").Buffer,w=function(N){if(typeof N=="string")return A.createHash("md4").update(N,"utf8").digest("hex");if(r&&N instanceof ArrayBuffer)N=new Uint8Array(N);else if(N.length===void 0)return y(N);return A.createHash("md4").update(new S(N)).digest("hex")};return w};function E(y){if(y)u[0]=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0,this.blocks=u,this.buffer8=l;else if(r){var A=new ArrayBuffer(68);this.buffer8=new Uint8Array(A),this.blocks=new Uint32Array(A)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=0,this.finalized=this.hashed=!1,this.first=!0}E.prototype.update=function(y){if(!this.finalized){var A=typeof y!="string";A&&r&&y instanceof ArrayBuffer&&(y=new Uint8Array(y));for(var S,w=0,N,W=y.length||0,R=this.blocks,L=this.buffer8;w<W;){if(this.hashed&&(this.hashed=!1,R[0]=R[16],R[16]=R[1]=R[2]=R[3]=R[4]=R[5]=R[6]=R[7]=R[8]=R[9]=R[10]=R[11]=R[12]=R[13]=R[14]=R[15]=0),A)if(r)for(N=this.start;w<W&&N<64;++w)L[N++]=y[w];else for(N=this.start;w<W&&N<64;++w)R[N>>2]|=y[w]<<a[N++&3];else if(r)for(N=this.start;w<W&&N<64;++w)S=y.charCodeAt(w),S<128?L[N++]=S:S<2048?(L[N++]=192|S>>6,L[N++]=128|S&63):S<55296||S>=57344?(L[N++]=224|S>>12,L[N++]=128|S>>6&63,L[N++]=128|S&63):(S=65536+((S&1023)<<10|y.charCodeAt(++w)&1023),L[N++]=240|S>>18,L[N++]=128|S>>12&63,L[N++]=128|S>>6&63,L[N++]=128|S&63);else for(N=this.start;w<W&&N<64;++w)S=y.charCodeAt(w),S<128?R[N>>2]|=S<<a[N++&3]:S<2048?(R[N>>2]|=(192|S>>6)<<a[N++&3],R[N>>2]|=(128|S&63)<<a[N++&3]):S<55296||S>=57344?(R[N>>2]|=(224|S>>12)<<a[N++&3],R[N>>2]|=(128|S>>6&63)<<a[N++&3],R[N>>2]|=(128|S&63)<<a[N++&3]):(S=65536+((S&1023)<<10|y.charCodeAt(++w)&1023),R[N>>2]|=(240|S>>18)<<a[N++&3],R[N>>2]|=(128|S>>12&63)<<a[N++&3],R[N>>2]|=(128|S>>6&63)<<a[N++&3],R[N>>2]|=(128|S&63)<<a[N++&3]);this.lastByteIndex=N,this.bytes+=N-this.start,N>=64?(this.start=N-64,this.hash(),this.hashed=!0):this.start=N}return this}},E.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var y=this.blocks,A=this.lastByteIndex;y[A>>2]|=s[A&3],A>=56&&(this.hashed||this.hash(),y[0]=y[16],y[16]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=0),y[14]=this.bytes<<3,this.hash()}},E.prototype.hash=function(){var y,A,S,w,N,W,R,L,b=this.blocks;this.first?(y=b[0]-1,y=y<<3|y>>>29,w=(y&4023233417|~y&2562383102)+b[1]+271733878,w=w<<7|w>>>25,S=(w&y|~w&4023233417)+b[2]-1732584194,S=S<<11|S>>>21,A=(S&w|~S&y)+b[3]-271733879,A=A<<19|A>>>13):(y=this.h0,A=this.h1,S=this.h2,w=this.h3,y+=(A&S|~A&w)+b[0],y=y<<3|y>>>29,w+=(y&A|~y&S)+b[1],w=w<<7|w>>>25,S+=(w&y|~w&A)+b[2],S=S<<11|S>>>21,A+=(S&w|~S&y)+b[3],A=A<<19|A>>>13),y+=(A&S|~A&w)+b[4],y=y<<3|y>>>29,w+=(y&A|~y&S)+b[5],w=w<<7|w>>>25,S+=(w&y|~w&A)+b[6],S=S<<11|S>>>21,A+=(S&w|~S&y)+b[7],A=A<<19|A>>>13,y+=(A&S|~A&w)+b[8],y=y<<3|y>>>29,w+=(y&A|~y&S)+b[9],w=w<<7|w>>>25,S+=(w&y|~w&A)+b[10],S=S<<11|S>>>21,A+=(S&w|~S&y)+b[11],A=A<<19|A>>>13,y+=(A&S|~A&w)+b[12],y=y<<3|y>>>29,w+=(y&A|~y&S)+b[13],w=w<<7|w>>>25,S+=(w&y|~w&A)+b[14],S=S<<11|S>>>21,A+=(S&w|~S&y)+b[15],A=A<<19|A>>>13,W=A&S,y+=(W|A&w|S&w)+b[0]+1518500249,y=y<<3|y>>>29,N=y&A,w+=(N|y&S|W)+b[4]+1518500249,w=w<<5|w>>>27,L=w&y,S+=(L|w&A|N)+b[8]+1518500249,S=S<<9|S>>>23,R=S&w,A+=(R|S&y|L)+b[12]+1518500249,A=A<<13|A>>>19,W=A&S,y+=(W|A&w|R)+b[1]+1518500249,y=y<<3|y>>>29,N=y&A,w+=(N|y&S|W)+b[5]+1518500249,w=w<<5|w>>>27,L=w&y,S+=(L|w&A|N)+b[9]+1518500249,S=S<<9|S>>>23,R=S&w,A+=(R|S&y|L)+b[13]+1518500249,A=A<<13|A>>>19,W=A&S,y+=(W|A&w|R)+b[2]+1518500249,y=y<<3|y>>>29,N=y&A,w+=(N|y&S|W)+b[6]+1518500249,w=w<<5|w>>>27,L=w&y,S+=(L|w&A|N)+b[10]+1518500249,S=S<<9|S>>>23,R=S&w,A+=(R|S&y|L)+b[14]+1518500249,A=A<<13|A>>>19,W=A&S,y+=(W|A&w|R)+b[3]+1518500249,y=y<<3|y>>>29,N=y&A,w+=(N|y&S|W)+b[7]+1518500249,w=w<<5|w>>>27,L=w&y,S+=(L|w&A|N)+b[11]+1518500249,S=S<<9|S>>>23,A+=(S&w|S&y|L)+b[15]+1518500249,A=A<<13|A>>>19,W=A^S,y+=(W^w)+b[0]+1859775393,y=y<<3|y>>>29,w+=(W^y)+b[8]+1859775393,w=w<<9|w>>>23,L=w^y,S+=(L^A)+b[4]+1859775393,S=S<<11|S>>>21,A+=(L^S)+b[12]+1859775393,A=A<<15|A>>>17,W=A^S,y+=(W^w)+b[2]+1859775393,y=y<<3|y>>>29,w+=(W^y)+b[10]+1859775393,w=w<<9|w>>>23,L=w^y,S+=(L^A)+b[6]+1859775393,S=S<<11|S>>>21,A+=(L^S)+b[14]+1859775393,A=A<<15|A>>>17,W=A^S,y+=(W^w)+b[1]+1859775393,y=y<<3|y>>>29,w+=(W^y)+b[9]+1859775393,w=w<<9|w>>>23,L=w^y,S+=(L^A)+b[5]+1859775393,S=S<<11|S>>>21,A+=(L^S)+b[13]+1859775393,A=A<<15|A>>>17,W=A^S,y+=(W^w)+b[3]+1859775393,y=y<<3|y>>>29,w+=(W^y)+b[11]+1859775393,w=w<<9|w>>>23,L=w^y,S+=(L^A)+b[7]+1859775393,S=S<<11|S>>>21,A+=(L^S)+b[15]+1859775393,A=A<<15|A>>>17,this.first?(this.h0=y+1732584193<<0,this.h1=A-271733879<<0,this.h2=S-1732584194<<0,this.h3=w+271733878<<0,this.first=!1):(this.h0=this.h0+y<<0,this.h1=this.h1+A<<0,this.h2=this.h2+S<<0,this.h3=this.h3+w<<0)},E.prototype.hex=function(){this.finalize();var y=this.h0,A=this.h1,S=this.h2,w=this.h3;return o[y>>4&15]+o[y&15]+o[y>>12&15]+o[y>>8&15]+o[y>>20&15]+o[y>>16&15]+o[y>>28&15]+o[y>>24&15]+o[A>>4&15]+o[A&15]+o[A>>12&15]+o[A>>8&15]+o[A>>20&15]+o[A>>16&15]+o[A>>28&15]+o[A>>24&15]+o[S>>4&15]+o[S&15]+o[S>>12&15]+o[S>>8&15]+o[S>>20&15]+o[S>>16&15]+o[S>>28&15]+o[S>>24&15]+o[w>>4&15]+o[w&15]+o[w>>12&15]+o[w>>8&15]+o[w>>20&15]+o[w>>16&15]+o[w>>28&15]+o[w>>24&15]},E.prototype.toString=E.prototype.hex,E.prototype.digest=function(){this.finalize();var y=this.h0,A=this.h1,S=this.h2,w=this.h3;return[y&255,y>>8&255,y>>16&255,y>>24&255,A&255,A>>8&255,A>>16&255,A>>24&255,S&255,S>>8&255,S>>16&255,S>>24&255,w&255,w>>8&255,w>>16&255,w>>24&255]},E.prototype.array=E.prototype.digest,E.prototype.arrayBuffer=function(){this.finalize();var y=new ArrayBuffer(16),A=new Uint32Array(y);return A[0]=this.h0,A[1]=this.h1,A[2]=this.h2,A[3]=this.h3,y},E.prototype.buffer=E.prototype.arrayBuffer;var I=m();n?j_.exports=I:(t.md4=I,i&&define(function(){return I}))})()});var JB=g((V_,ZB)=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});V_.default=void 0;var che=QB(wn()),uhe=XB(x("crypto")),lhe=QB(KB());function XB(t,e){if(typeof WeakMap=="function")var n=new WeakMap,i=new WeakMap;return(XB=function(r,o){if(!o&&r&&r.__esModule)return r;var s,a,c={__proto__:null,default:r};if(r===null||typeof r!="object"&&typeof r!="function")return c;if(s=o?i:n){if(s.has(r))return s.get(r);s.set(r,c)}for(let u in r)u!=="default"&&{}.hasOwnProperty.call(r,u)&&((a=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(r,u))&&(a.get||a.set)?s(c,u,a):c[u]=r[u]);return c})(t,e)}function QB(t){return t&&t.__esModule?t:{default:t}}var Y_=class{constructor(e){this.data=this.createResponse(e)}toString(e=""){return e+"NTLM Auth"}createResponse(e){let n=this.createClientNonce(),i=24,r=16,o=e.domain,s=e.userName,a=e.password,c=e.ntlmpacket,u=c.target,l=c.nonce,d=64+o.length*2+s.length*2+i+r+8+8+8+4+u.length+4,f=new che.default(d);f.position=0,f.writeString("NTLMSSP\0","utf8"),f.writeUInt32LE(3);let m=64,_=m,E=_+o.length*2,I=E+s.length*2,y=I+i;f.writeUInt16LE(i),f.writeUInt16LE(i),f.writeUInt32LE(I),f.writeUInt16LE(r),f.writeUInt16LE(r),f.writeUInt32LE(y),f.writeUInt16LE(o.length*2),f.writeUInt16LE(o.length*2),f.writeUInt32LE(_),f.writeUInt16LE(s.length*2),f.writeUInt16LE(s.length*2),f.writeUInt32LE(E),f.writeUInt16LE(0),f.writeUInt16LE(0),f.writeUInt32LE(m),f.writeUInt16LE(0),f.writeUInt16LE(0),f.writeUInt32LE(m),f.writeUInt16LE(33281),f.writeUInt16LE(8),f.writeString(o,"ucs2"),f.writeString(s,"ucs2");let A=this.lmv2Response(o,s,a,l,n);f.copyFrom(A);let S=new Date().getTime(),w=this.ntlmv2Response(o,s,a,l,u,n,S);f.copyFrom(w),f.writeUInt32LE(257),f.writeUInt32LE(0);let N=this.createTimestamp(S);return f.copyFrom(N),f.copyFrom(n),f.writeUInt32LE(0),f.copyFrom(u),f.writeUInt32LE(0),f.data}createClientNonce(){let e=Buffer.alloc(8,0),n=0;for(;n<8;)e.writeUInt8(Math.ceil(Math.random()*255),n),n++;return e}ntlmv2Response(e,n,i,r,o,s,a){let c=this.createTimestamp(a),u=this.ntv2Hash(e,n,i),l=40+o.length,d=Buffer.alloc(l,0);return r.copy(d,0,0,8),d.writeUInt32LE(257,8),d.writeUInt32LE(0,12),c.copy(d,16,0,8),s.copy(d,24,0,8),d.writeUInt32LE(0,32),o.copy(d,36,0,o.length),d.writeUInt32LE(0,36+o.length),this.hmacMD5(d,u)}createTimestamp(e){let n=(BigInt(e)+BigInt(11644473600))*BigInt(1e7),i=Number(n&BigInt(4294967295)),r=Number(n>>BigInt(32)&BigInt(4294967295)),o=Buffer.alloc(8);return o.writeUInt32LE(i,0),o.writeUInt32LE(r,4),o}lmv2Response(e,n,i,r,o){let s=this.ntv2Hash(e,n,i),a=Buffer.alloc(r.length+o.length,0);r.copy(a),o.copy(a,r.length,0,o.length);let c=this.hmacMD5(a,s),u=Buffer.alloc(c.length+o.length,0);return c.copy(u),o.copy(u,c.length,0,o.length),u}ntv2Hash(e,n,i){let r=this.ntHash(i),o=Buffer.from(n.toUpperCase()+e.toUpperCase(),"ucs2");return this.hmacMD5(o,r)}ntHash(e){let n=Buffer.from(e,"ucs2");return Buffer.from(lhe.default.arrayBuffer(n))}hmacMD5(e,n){return uhe.createHmac("MD5",n).update(e).digest()}},dOe=V_.default=Y_;ZB.exports=Y_});var ho=g(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.RequestError=lo.InputError=lo.ConnectionError=void 0;var Av=class extends Error{constructor(e,n,i){super(e,i),this.code=n}};lo.ConnectionError=Av;var Cv=class extends Error{constructor(e,n,i){super(e,i),this.code=n}};lo.RequestError=Cv;var Sv=class extends TypeError{};lo.InputError=Sv});var ej=g(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.SQLServerStatementColumnEncryptionSetting=Zr.SQLServerEncryptionType=Zr.DescribeParameterEncryptionResultSet2=Zr.DescribeParameterEncryptionResultSet1=void 0;var fOe=Zr.SQLServerEncryptionType=(function(t){return t[t.Deterministic=1]="Deterministic",t[t.Randomized=2]="Randomized",t[t.PlainText=0]="PlainText",t})({}),pOe=Zr.DescribeParameterEncryptionResultSet1=(function(t){return t[t.KeyOrdinal=0]="KeyOrdinal",t[t.DbId=1]="DbId",t[t.KeyId=2]="KeyId",t[t.KeyVersion=3]="KeyVersion",t[t.KeyMdVersion=4]="KeyMdVersion",t[t.EncryptedKey=5]="EncryptedKey",t[t.ProviderName=6]="ProviderName",t[t.KeyPath=7]="KeyPath",t[t.KeyEncryptionAlgorithm=8]="KeyEncryptionAlgorithm",t})({}),mOe=Zr.DescribeParameterEncryptionResultSet2=(function(t){return t[t.ParameterOrdinal=0]="ParameterOrdinal",t[t.ParameterName=1]="ParameterName",t[t.ColumnEncryptionAlgorithm=2]="ColumnEncryptionAlgorithm",t[t.ColumnEncrytionType=3]="ColumnEncrytionType",t[t.ColumnEncryptionKeyOrdinal=4]="ColumnEncryptionKeyOrdinal",t[t.NormalizationRuleVersion=5]="NormalizationRuleVersion",t})({}),gOe=Zr.SQLServerStatementColumnEncryptionSetting=(function(t){return t[t.UseConnectionSetting=0]="UseConnectionSetting",t[t.Enabled=1]="Enabled",t[t.ResultSetOnly=2]="ResultSetOnly",t[t.Disabled=3]="Disabled",t})({})});var G_=g((z_,tj)=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});z_.default=void 0;var dhe=x("events"),hhe=ho(),fhe=ej(),$_=class extends dhe.EventEmitter{on(e,n){return super.on(e,n)}emit(e,...n){return super.emit(e,...n)}constructor(e,n,i){super(),this.sqlTextOrProcedure=e,this.parameters=[],this.parametersByName={},this.preparing=!1,this.handle=void 0,this.canceled=!1,this.paused=!1,this.error=void 0,this.connection=void 0,this.timeout=void 0,this.userCallback=n,this.statementColumnEncryptionSetting=i&&i.statementColumnEncryptionSetting||fhe.SQLServerStatementColumnEncryptionSetting.UseConnectionSetting,this.cryptoMetadataLoaded=!1,this.callback=function(r,o,s){this.preparing?(this.preparing=!1,r?this.emit("error",r):this.emit("prepared")):(this.userCallback(r,o,s),this.emit("requestCompleted"))}}addParameter(e,n,i,r){let{output:o=!1,length:s,precision:a,scale:c}=r??{},u={type:n,name:e,value:i,output:o,length:s,precision:a,scale:c};this.parameters.push(u),this.parametersByName[e]=u}addOutputParameter(e,n,i,r){this.addParameter(e,n,i,{...r,output:!0})}makeParamsParameter(e){let n="";for(let i=0,r=e.length;i<r;i++){let o=e[i];n.length>0&&(n+=", "),n+="@"+o.name+" ",n+=o.type.declaration(o),o.output&&(n+=" OUTPUT")}return n}validateParameters(e){for(let n=0,i=this.parameters.length;n<i;n++){let r=this.parameters[n];try{r.value=r.type.validate(r.value,e)}catch(o){throw new hhe.RequestError("Validation failed for parameter '"+r.name+"'. "+o.message,"EPARAM",{cause:o})}}}pause(){this.paused||(this.emit("pause"),this.paused=!0)}resume(){this.paused&&(this.paused=!1,this.emit("resume"))}cancel(){this.canceled||(this.canceled=!0,this.emit("cancel"))}setTimeout(e){this.timeout=e}},yOe=z_.default=$_;tj.exports=$_});var W_=g(wv=>{"use strict";Object.defineProperty(wv,"__esModule",{value:!0});wv.writeToTrackingBuffer=_he;var phe={QUERY_NOTIFICATIONS:1,TXN_DESCRIPTOR:2,TRACE_ACTIVITY:3},mhe=12,ghe=6+mhe;function _he(t,e,n){t.writeUInt32LE(0),t.writeUInt32LE(ghe),t.writeUInt16LE(phe.TXN_DESCRIPTOR),t.writeBuffer(e),t.writeUInt32LE(n);let i=t.data;return i.writeUInt32LE(i.length,0),t}});var ij=g((X_,rj)=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.default=void 0;var nj=The(wn()),yhe=W_(),Ehe=ho();function The(t){return t&&t.__esModule?t:{default:t}}var Ahe={BY_REF_VALUE:1,DEFAULT_VALUE:2},K_=class{constructor(e,n,i,r,o){this.procedure=e,this.parameters=n,this.options=r,this.txnDescriptor=i,this.collation=o}[Symbol.iterator](){return this.generateData()}*generateData(){let e=new nj.default(500);this.options.tdsVersion>="7_2"&&(0,yhe.writeToTrackingBuffer)(e,this.txnDescriptor,1),typeof this.procedure=="string"?e.writeUsVarchar(this.procedure):(e.writeUShort(65535),e.writeUShort(this.procedure)),e.writeUInt16LE(0),yield e.data;let i=this.parameters.length;for(let r=0;r<i;r++)yield*this.generateParameterData(this.parameters[r])}toString(e=""){return e+("RPC Request - "+this.procedure)}*generateParameterData(e){let n=new nj.default(3+Buffer.byteLength(e.name,"ucs-2")+1);e.name?n.writeBVarchar("@"+e.name):n.writeBVarchar("");let i=0;e.output&&(i|=Ahe.BY_REF_VALUE),n.writeUInt8(i),yield n.data;let r={value:e.value},o=e.type;(o.id&48)===32&&(e.length?r.length=e.length:o.resolveLength&&(r.length=o.resolveLength(e))),e.precision?r.precision=e.precision:o.resolvePrecision&&(r.precision=o.resolvePrecision(e)),e.scale?r.scale=e.scale:o.resolveScale&&(r.scale=o.resolveScale(e)),this.collation&&(r.collation=this.collation),yield o.generateTypeInfo(r,this.options),yield o.generateParameterLength(r,this.options);try{yield*o.generateParameterData(r,this.options)}catch(s){throw new Ehe.InputError(`Input parameter '${e.name}' could not be validated`,{cause:s})}}},TOe=X_.default=K_;rj.exports=K_});var sj=g((Z_,oj)=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});Z_.default=void 0;var Che=whe(wn()),She=W_();function whe(t){return t&&t.__esModule?t:{default:t}}var Q_=class{constructor(e,n,i){this.sqlText=e,this.txnDescriptor=n,this.options=i}*[Symbol.iterator](){if(this.options.tdsVersion>="7_2"){let e=new Che.default(18,"ucs2");(0,She.writeToTrackingBuffer)(e,this.txnDescriptor,1),yield e.data}yield Buffer.from(this.sqlText,"ucs2")}toString(e=""){return e+("SQL Batch - "+this.sqlText)}},AOe=Z_.default=Q_;oj.exports=Q_});var cj=g((COe,aj)=>{"use strict";var Ihe=x("stream").Duplex,J_=Symbol("Callback"),rs=Symbol("Other"),ey=class extends Ihe{constructor(e){super(e),this[J_]=null,this[rs]=null}_read(){let e=this[J_];e&&(this[J_]=null,e())}_write(e,n,i){this[rs][J_]=i,this[rs].push(e)}_final(e){this[rs].on("end",e),this[rs].push(null)}},Iv=class{constructor(e){this.socket1=new ey(e),this.socket2=new ey(e),this.socket1[rs]=this.socket2,this.socket2[rs]=this.socket1}};aj.exports=Iv});var ry=g((ny,uj)=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.default=void 0;var vhe=x("stream"),ty=class extends vhe.PassThrough{constructor({type:e,resetConnection:n=!1}){super(),this.type=e,this.resetConnection=n,this.ignore=!1}},SOe=ny.default=ty;uj.exports=ty});var it=g((wOe,lj)=>{"use strict";var vv=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let n="";for(let i=0;i<e.length;i++)n+=` ${e[i].stack}
|
|
121
|
+
`;super(n),this.name="AggregateError",this.errors=e}};lj.exports={AggregateError:vv,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,n){return t.slice(e,n)},Error,FunctionPrototypeCall(t,e,...n){return t.call(e,...n)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,n){return Object.defineProperty(t,e,n)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,n){return t.then(e,n)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,n){return t.slice(e,n)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,n){return t.set(e,n)},Boolean,Uint8Array}});var bv=g((IOe,dj)=>{"use strict";dj.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[n,i]){let r=e.shift();return i==="f"?r.toFixed(6):i==="j"?JSON.stringify(r):i==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}});var tn=g((vOe,pj)=>{"use strict";var{format:bhe,inspect:iy}=bv(),{AggregateError:Ohe}=it(),Rhe=globalThis.AggregateError||Ohe,Nhe=Symbol("kIsNodeError"),Phe=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Dhe=/^([A-Z][a-z0-9]*)+$/,Mhe="__node_internal_",oy={};function is(t,e){if(!t)throw new oy.ERR_INTERNAL_ASSERTION(e)}function hj(t){let e="",n=t.length,i=t[0]==="-"?1:0;for(;n>=i+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function khe(t,e,n){if(typeof e=="function")return is(e.length<=n.length,`Code: ${t}; The provided arguments length (${n.length}) does not match the required ones (${e.length}).`),e(...n);let i=(e.match(/%[dfijoOs]/g)||[]).length;return is(i===n.length,`Code: ${t}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),n.length===0?e:bhe(e,...n)}function $t(t,e,n){n||(n=Error);class i extends n{constructor(...o){super(khe(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[Nhe]=!0,oy[t]=i}function fj(t){let e=Mhe+t.name;return Object.defineProperty(t,"name",{value:e}),t}function Lhe(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let n=new Rhe([e,t],e.message);return n.code=e.code,n}return t||e}var Ov=class extends Error{constructor(e="The operation was aborted",n=void 0){if(n!==void 0&&typeof n!="object")throw new oy.ERR_INVALID_ARG_TYPE("options","Object",n);super(e,n),this.code="ABORT_ERR",this.name="AbortError"}};$t("ERR_ASSERTION","%s",Error);$t("ERR_INVALID_ARG_TYPE",(t,e,n)=>{is(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";let r=[],o=[],s=[];for(let c of e)is(typeof c=="string","All expected entries have to be of type string"),Phe.includes(c)?r.push(c.toLowerCase()):Dhe.test(c)?o.push(c):(is(c!=="object",'The value "object" should be written as "Object"'),s.push(c));if(o.length>0){let c=r.indexOf("object");c!==-1&&(r.splice(r,c,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:i+=`of type ${r[0]}`;break;case 2:i+=`one of type ${r[0]} or ${r[1]}`;break;default:{let c=r.pop();i+=`one of type ${r.join(", ")}, or ${c}`}}(o.length>0||s.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let c=o.pop();i+=`an instance of ${o.join(", ")}, or ${c}`}}s.length>0&&(i+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(i+="an "),i+=`${s[0]}`;break;case 2:i+=`one of ${s[0]} or ${s[1]}`;break;default:{let c=s.pop();i+=`one of ${s.join(", ")}, or ${c}`}}if(n==null)i+=`. Received ${n}`;else if(typeof n=="function"&&n.name)i+=`. Received function ${n.name}`;else if(typeof n=="object"){var a;if((a=n.constructor)!==null&&a!==void 0&&a.name)i+=`. Received an instance of ${n.constructor.name}`;else{let c=iy(n,{depth:-1});i+=`. Received ${c}`}}else{let c=iy(n,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),i+=`. Received type ${typeof n} (${c})`}return i},TypeError);$t("ERR_INVALID_ARG_VALUE",(t,e,n="is invalid")=>{let i=iy(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${n}. Received ${i}`},TypeError);$t("ERR_INVALID_RETURN_VALUE",(t,e,n)=>{var i;let r=n!=null&&(i=n.constructor)!==null&&i!==void 0&&i.name?`instance of ${n.constructor.name}`:`type ${typeof n}`;return`Expected ${t} to be returned from the "${e}" function but got ${r}.`},TypeError);$t("ERR_MISSING_ARGS",(...t)=>{is(t.length>0,"At least one arg needs to be specified");let e,n=t.length;switch(t=(Array.isArray(t)?t:[t]).map(i=>`"${i}"`).join(" or "),n){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);$t("ERR_OUT_OF_RANGE",(t,e,n)=>{is(e,'Missing "range" argument');let i;if(Number.isInteger(n)&&Math.abs(n)>2**32)i=hj(String(n));else if(typeof n=="bigint"){i=String(n);let r=BigInt(2)**BigInt(32);(n>r||n<-r)&&(i=hj(i)),i+="n"}else i=iy(n);return`The value of "${t}" is out of range. It must be ${e}. Received ${i}`},RangeError);$t("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);$t("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);$t("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);$t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);$t("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);$t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);$t("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);$t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);$t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);$t("ERR_STREAM_WRITE_AFTER_END","write after end",Error);$t("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);pj.exports={AbortError:Ov,aggregateTwoErrors:fj(Lhe),hideStackFrames:fj,codes:oy}});var wj=g((sh,oh)=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var Tj=new WeakMap,Rv=new WeakMap;function tt(t){let e=Tj.get(t);return console.assert(e!=null,"'this' is expected an Event object, but got",t),e}function mj(t){if(t.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",t.passiveListener);return}t.event.cancelable&&(t.canceled=!0,typeof t.event.preventDefault=="function"&&t.event.preventDefault())}function wc(t,e){Tj.set(this,{eventTarget:t,event:e,eventPhase:2,currentTarget:t,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:e.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let n=Object.keys(e);for(let i=0;i<n.length;++i){let r=n[i];r in this||Object.defineProperty(this,r,Aj(r))}}wc.prototype={get type(){return tt(this).event.type},get target(){return tt(this).eventTarget},get currentTarget(){return tt(this).currentTarget},composedPath(){let t=tt(this).currentTarget;return t==null?[]:[t]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return tt(this).eventPhase},stopPropagation(){let t=tt(this);t.stopped=!0,typeof t.event.stopPropagation=="function"&&t.event.stopPropagation()},stopImmediatePropagation(){let t=tt(this);t.stopped=!0,t.immediateStopped=!0,typeof t.event.stopImmediatePropagation=="function"&&t.event.stopImmediatePropagation()},get bubbles(){return!!tt(this).event.bubbles},get cancelable(){return!!tt(this).event.cancelable},preventDefault(){mj(tt(this))},get defaultPrevented(){return tt(this).canceled},get composed(){return!!tt(this).event.composed},get timeStamp(){return tt(this).timeStamp},get srcElement(){return tt(this).eventTarget},get cancelBubble(){return tt(this).stopped},set cancelBubble(t){if(!t)return;let e=tt(this);e.stopped=!0,typeof e.event.cancelBubble=="boolean"&&(e.event.cancelBubble=!0)},get returnValue(){return!tt(this).canceled},set returnValue(t){t||mj(tt(this))},initEvent(){}};Object.defineProperty(wc.prototype,"constructor",{value:wc,configurable:!0,writable:!0});typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(wc.prototype,window.Event.prototype),Rv.set(window.Event.prototype,wc));function Aj(t){return{get(){return tt(this).event[t]},set(e){tt(this).event[t]=e},configurable:!0,enumerable:!0}}function Uhe(t){return{value(){let e=tt(this).event;return e[t].apply(e,arguments)},configurable:!0,enumerable:!0}}function xhe(t,e){let n=Object.keys(e);if(n.length===0)return t;function i(r,o){t.call(this,r,o)}i.prototype=Object.create(t.prototype,{constructor:{value:i,configurable:!0,writable:!0}});for(let r=0;r<n.length;++r){let o=n[r];if(!(o in t.prototype)){let a=typeof Object.getOwnPropertyDescriptor(e,o).value=="function";Object.defineProperty(i.prototype,o,a?Uhe(o):Aj(o))}}return i}function Cj(t){if(t==null||t===Object.prototype)return wc;let e=Rv.get(t);return e==null&&(e=xhe(Cj(Object.getPrototypeOf(t)),t),Rv.set(t,e)),e}function Fhe(t,e){let n=Cj(Object.getPrototypeOf(e));return new n(t,e)}function qhe(t){return tt(t).immediateStopped}function Hhe(t,e){tt(t).eventPhase=e}function Bhe(t,e){tt(t).currentTarget=e}function gj(t,e){tt(t).passiveListener=e}var Sj=new WeakMap,_j=1,yj=2,sy=3;function ay(t){return t!==null&&typeof t=="object"}function ih(t){let e=Sj.get(t);if(e==null)throw new TypeError("'this' is expected an EventTarget object, but got another value.");return e}function jhe(t){return{get(){let n=ih(this).get(t);for(;n!=null;){if(n.listenerType===sy)return n.listener;n=n.next}return null},set(e){typeof e!="function"&&!ay(e)&&(e=null);let n=ih(this),i=null,r=n.get(t);for(;r!=null;)r.listenerType===sy?i!==null?i.next=r.next:r.next!==null?n.set(t,r.next):n.delete(t):i=r,r=r.next;if(e!==null){let o={listener:e,listenerType:sy,passive:!1,once:!1,next:null};i===null?n.set(t,o):i.next=o}},configurable:!0,enumerable:!0}}function Nv(t,e){Object.defineProperty(t,`on${e}`,jhe(e))}function Ej(t){function e(){vr.call(this)}e.prototype=Object.create(vr.prototype,{constructor:{value:e,configurable:!0,writable:!0}});for(let n=0;n<t.length;++n)Nv(e.prototype,t[n]);return e}function vr(){if(this instanceof vr){Sj.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return Ej(arguments[0]);if(arguments.length>0){let t=new Array(arguments.length);for(let e=0;e<arguments.length;++e)t[e]=arguments[e];return Ej(t)}throw new TypeError("Cannot call a class as a function")}vr.prototype={addEventListener(t,e,n){if(e==null)return;if(typeof e!="function"&&!ay(e))throw new TypeError("'listener' should be a function or an object.");let i=ih(this),r=ay(n),s=(r?!!n.capture:!!n)?_j:yj,a={listener:e,listenerType:s,passive:r&&!!n.passive,once:r&&!!n.once,next:null},c=i.get(t);if(c===void 0){i.set(t,a);return}let u=null;for(;c!=null;){if(c.listener===e&&c.listenerType===s)return;u=c,c=c.next}u.next=a},removeEventListener(t,e,n){if(e==null)return;let i=ih(this),o=(ay(n)?!!n.capture:!!n)?_j:yj,s=null,a=i.get(t);for(;a!=null;){if(a.listener===e&&a.listenerType===o){s!==null?s.next=a.next:a.next!==null?i.set(t,a.next):i.delete(t);return}s=a,a=a.next}},dispatchEvent(t){if(t==null||typeof t.type!="string")throw new TypeError('"event.type" should be a string.');let e=ih(this),n=t.type,i=e.get(n);if(i==null)return!0;let r=Fhe(this,t),o=null;for(;i!=null;){if(i.once?o!==null?o.next=i.next:i.next!==null?e.set(n,i.next):e.delete(n):o=i,gj(r,i.passive?i.listener:null),typeof i.listener=="function")try{i.listener.call(this,r)}catch(s){typeof console<"u"&&typeof console.error=="function"&&console.error(s)}else i.listenerType!==sy&&typeof i.listener.handleEvent=="function"&&i.listener.handleEvent(r);if(qhe(r))break;i=i.next}return gj(r,null),Hhe(r,0),Bhe(r,null),!r.defaultPrevented}};Object.defineProperty(vr.prototype,"constructor",{value:vr,configurable:!0,writable:!0});typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(vr.prototype,window.EventTarget.prototype);sh.defineEventAttribute=Nv;sh.EventTarget=vr;sh.default=vr;oh.exports=vr;oh.exports.EventTarget=oh.exports.default=vr;oh.exports.defineEventAttribute=Nv});var Ic=g((ch,ah)=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});var Pv=wj(),fo=class extends Pv.EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")}get aborted(){let e=cy.get(this);if(typeof e!="boolean")throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return e}};Pv.defineEventAttribute(fo.prototype,"abort");function Yhe(){let t=Object.create(fo.prototype);return Pv.EventTarget.call(t),cy.set(t,!1),t}function Vhe(t){cy.get(t)===!1&&(cy.set(t,!0),t.dispatchEvent({type:"abort"}))}var cy=new WeakMap;Object.defineProperties(fo.prototype,{aborted:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(fo.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});var po=class{constructor(){vj.set(this,Yhe())}get signal(){return Ij(this)}abort(){Vhe(Ij(this))}},vj=new WeakMap;function Ij(t){let e=vj.get(t);if(e==null)throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${t===null?"null":typeof t}`);return e}Object.defineProperties(po.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(po.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});ch.AbortController=po;ch.AbortSignal=fo;ch.default=po;ah.exports=po;ah.exports.AbortController=ah.exports.default=po;ah.exports.AbortSignal=fo});var En=g((bOe,Mv)=>{"use strict";var $he=x("buffer"),{format:zhe,inspect:Ghe}=bv(),{codes:{ERR_INVALID_ARG_TYPE:Dv}}=tn(),{kResistStopPropagation:Whe,AggregateError:Khe,SymbolDispose:Xhe}=it(),Qhe=globalThis.AbortSignal||Ic().AbortSignal,Zhe=globalThis.AbortController||Ic().AbortController,Jhe=Object.getPrototypeOf(async function(){}).constructor,bj=globalThis.Blob||$he.Blob,efe=typeof bj<"u"?function(e){return e instanceof bj}:function(e){return!1},Oj=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Dv(e,"AbortSignal",t)},tfe=(t,e)=>{if(typeof t!="function")throw new Dv(e,"Function",t)};Mv.exports={AggregateError:Khe,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...n){e||(e=!0,t.apply(this,n))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((i,r)=>{t=i,e=r}),resolve:t,reject:e}},promisify(t){return new Promise((e,n)=>{t((i,...r)=>i?n(i):e(...r))})},debuglog(){return function(){}},format:zhe,inspect:Ghe,types:{isAsyncFunction(t){return t instanceof Jhe},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:efe,deprecate(t,e){return t},addAbortListener:x("events").addAbortListener||function(e,n){if(e===void 0)throw new Dv("signal","AbortSignal",e);Oj(e,"signal"),tfe(n,"listener");let i;return e.aborted?queueMicrotask(()=>n()):(e.addEventListener("abort",n,{__proto__:null,once:!0,[Whe]:!0}),i=()=>{e.removeEventListener("abort",n)}),{__proto__:null,[Xhe](){var r;(r=i)===null||r===void 0||r()}}},AbortSignalAny:Qhe.any||function(e){if(e.length===1)return e[0];let n=new Zhe,i=()=>n.abort();return e.forEach(r=>{Oj(r,"signals"),r.addEventListener("abort",i,{once:!0})}),n.signal.addEventListener("abort",()=>{e.forEach(r=>r.removeEventListener("abort",i))},{once:!0}),n.signal}};Mv.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var bc=g((OOe,Fj)=>{"use strict";var{ArrayIsArray:Lv,ArrayPrototypeIncludes:Dj,ArrayPrototypeJoin:Mj,ArrayPrototypeMap:nfe,NumberIsInteger:Uv,NumberIsNaN:rfe,NumberMAX_SAFE_INTEGER:ife,NumberMIN_SAFE_INTEGER:ofe,NumberParseInt:sfe,ObjectPrototypeHasOwnProperty:afe,RegExpPrototypeExec:kj,String:cfe,StringPrototypeToUpperCase:ufe,StringPrototypeTrim:lfe}=it(),{hideStackFrames:lr,codes:{ERR_SOCKET_BAD_PORT:dfe,ERR_INVALID_ARG_TYPE:nn,ERR_INVALID_ARG_VALUE:vc,ERR_OUT_OF_RANGE:os,ERR_UNKNOWN_SIGNAL:Rj}}=tn(),{normalizeEncoding:hfe}=En(),{isAsyncFunction:ffe,isArrayBufferView:pfe}=En().types,Nj={};function mfe(t){return t===(t|0)}function gfe(t){return t===t>>>0}var _fe=/^[0-7]+$/,yfe="must be a 32-bit unsigned integer or an octal string";function Efe(t,e,n){if(typeof t>"u"&&(t=n),typeof t=="string"){if(kj(_fe,t)===null)throw new vc(e,t,yfe);t=sfe(t,8)}return Lj(t,e),t}var Tfe=lr((t,e,n=ofe,i=ife)=>{if(typeof t!="number")throw new nn(e,"number",t);if(!Uv(t))throw new os(e,"an integer",t);if(t<n||t>i)throw new os(e,`>= ${n} && <= ${i}`,t)}),Afe=lr((t,e,n=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new nn(e,"number",t);if(!Uv(t))throw new os(e,"an integer",t);if(t<n||t>i)throw new os(e,`>= ${n} && <= ${i}`,t)}),Lj=lr((t,e,n=!1)=>{if(typeof t!="number")throw new nn(e,"number",t);if(!Uv(t))throw new os(e,"an integer",t);let i=n?1:0,r=4294967295;if(t<i||t>r)throw new os(e,`>= ${i} && <= ${r}`,t)});function xv(t,e){if(typeof t!="string")throw new nn(e,"string",t)}function Cfe(t,e,n=void 0,i){if(typeof t!="number")throw new nn(e,"number",t);if(n!=null&&t<n||i!=null&&t>i||(n!=null||i!=null)&&rfe(t))throw new os(e,`${n!=null?`>= ${n}`:""}${n!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}var Sfe=lr((t,e,n)=>{if(!Dj(n,t)){let r="must be one of: "+Mj(nfe(n,o=>typeof o=="string"?`'${o}'`:cfe(o)),", ");throw new vc(e,t,r)}});function Uj(t,e){if(typeof t!="boolean")throw new nn(e,"boolean",t)}function kv(t,e,n){return t==null||!afe(t,e)?n:t[e]}var wfe=lr((t,e,n=null)=>{let i=kv(n,"allowArray",!1),r=kv(n,"allowFunction",!1);if(!kv(n,"nullable",!1)&&t===null||!i&&Lv(t)||typeof t!="object"&&(!r||typeof t!="function"))throw new nn(e,"Object",t)}),Ife=lr((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new nn(e,"a dictionary",t)}),uy=lr((t,e,n=0)=>{if(!Lv(t))throw new nn(e,"Array",t);if(t.length<n){let i=`must be longer than ${n}`;throw new vc(e,t,i)}});function vfe(t,e){uy(t,e);for(let n=0;n<t.length;n++)xv(t[n],`${e}[${n}]`)}function bfe(t,e){uy(t,e);for(let n=0;n<t.length;n++)Uj(t[n],`${e}[${n}]`)}function Ofe(t,e){uy(t,e);for(let n=0;n<t.length;n++){let i=t[n],r=`${e}[${n}]`;if(i==null)throw new nn(r,"AbortSignal",i);xj(i,r)}}function Rfe(t,e="signal"){if(xv(t,e),Nj[t]===void 0)throw Nj[ufe(t)]!==void 0?new Rj(t+" (signals must use all capital letters)"):new Rj(t)}var Nfe=lr((t,e="buffer")=>{if(!pfe(t))throw new nn(e,["Buffer","TypedArray","DataView"],t)});function Pfe(t,e){let n=hfe(e),i=t.length;if(n==="hex"&&i%2!==0)throw new vc("encoding",e,`is invalid for data of length ${i}`)}function Dfe(t,e="Port",n=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&lfe(t).length===0||+t!==+t>>>0||t>65535||t===0&&!n)throw new dfe(e,t,n);return t|0}var xj=lr((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new nn(e,"AbortSignal",t)}),Mfe=lr((t,e)=>{if(typeof t!="function")throw new nn(e,"Function",t)}),kfe=lr((t,e)=>{if(typeof t!="function"||ffe(t))throw new nn(e,"Function",t)}),Lfe=lr((t,e)=>{if(t!==void 0)throw new nn(e,"undefined",t)});function Ufe(t,e,n){if(!Dj(n,t))throw new nn(e,`('${Mj(n,"|")}')`,t)}var xfe=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Pj(t,e){if(typeof t>"u"||!kj(xfe,t))throw new vc(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Ffe(t){if(typeof t=="string")return Pj(t,"hints"),t;if(Lv(t)){let e=t.length,n="";if(e===0)return n;for(let i=0;i<e;i++){let r=t[i];Pj(r,"hints"),n+=r,i!==e-1&&(n+=", ")}return n}throw new vc("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Fj.exports={isInt32:mfe,isUint32:gfe,parseFileMode:Efe,validateArray:uy,validateStringArray:vfe,validateBooleanArray:bfe,validateAbortSignalArray:Ofe,validateBoolean:Uj,validateBuffer:Nfe,validateDictionary:Ife,validateEncoding:Pfe,validateFunction:Mfe,validateInt32:Afe,validateInteger:Tfe,validateNumber:Cfe,validateObject:wfe,validateOneOf:Sfe,validatePlainFunction:kfe,validatePort:Dfe,validateSignalName:Rfe,validateString:xv,validateUint32:Lj,validateUndefined:Lfe,validateUnion:Ufe,validateAbortSignal:xj,validateLinkHeaderValue:Ffe}});var mo=g((ROe,qj)=>{"use strict";qj.exports=global.process});var ei=g((NOe,e2)=>{"use strict";var{SymbolAsyncIterator:Hj,SymbolIterator:Bj,SymbolFor:ss}=it(),jj=ss("nodejs.stream.destroyed"),Yj=ss("nodejs.stream.errored"),Fv=ss("nodejs.stream.readable"),qv=ss("nodejs.stream.writable"),Vj=ss("nodejs.stream.disturbed"),qfe=ss("nodejs.webstream.isClosedPromise"),Hfe=ss("nodejs.webstream.controllerErrorFunction");function ly(t,e=!1){var n;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((n=t._readableState)===null||n===void 0?void 0:n.readable)!==!1)&&(!t._writableState||t._readableState))}function dy(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function Bfe(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function Jr(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function $j(t){return!!(t&&!Jr(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function zj(t){return!!(t&&!Jr(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Gj(t){return!!(t&&!Jr(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function jfe(t){return $j(t)||zj(t)||Gj(t)}function Yfe(t,e){return t==null?!1:e===!0?typeof t[Hj]=="function":e===!1?typeof t[Bj]=="function":typeof t[Hj]=="function"||typeof t[Bj]=="function"}function hy(t){if(!Jr(t))return null;let e=t._writableState,n=t._readableState,i=e||n;return!!(t.destroyed||t[jj]||i!=null&&i.destroyed)}function Wj(t){if(!dy(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function Vfe(t,e){if(!dy(t))return null;if(t.writableFinished===!0)return!0;let n=t._writableState;return n!=null&&n.errored?!1:typeof n?.finished!="boolean"?null:!!(n.finished||e===!1&&n.ended===!0&&n.length===0)}function $fe(t){if(!ly(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function Kj(t,e){if(!ly(t))return null;let n=t._readableState;return n!=null&&n.errored?!1:typeof n?.endEmitted!="boolean"?null:!!(n.endEmitted||e===!1&&n.ended===!0&&n.length===0)}function Xj(t){return t&&t[Fv]!=null?t[Fv]:typeof t?.readable!="boolean"?null:hy(t)?!1:ly(t)&&t.readable&&!Kj(t)}function Qj(t){return t&&t[qv]!=null?t[qv]:typeof t?.writable!="boolean"?null:hy(t)?!1:dy(t)&&t.writable&&!Wj(t)}function zfe(t,e){return Jr(t)?hy(t)?!0:!(e?.readable!==!1&&Xj(t)||e?.writable!==!1&&Qj(t)):null}function Gfe(t){var e,n;return Jr(t)?t.writableErrored?t.writableErrored:(e=(n=t._writableState)===null||n===void 0?void 0:n.errored)!==null&&e!==void 0?e:null:null}function Wfe(t){var e,n;return Jr(t)?t.readableErrored?t.readableErrored:(e=(n=t._readableState)===null||n===void 0?void 0:n.errored)!==null&&e!==void 0?e:null:null}function Kfe(t){if(!Jr(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,n=t._readableState;return typeof e?.closed=="boolean"||typeof n?.closed=="boolean"?e?.closed||n?.closed:typeof t._closed=="boolean"&&Zj(t)?t._closed:null}function Zj(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Jj(t){return typeof t._sent100=="boolean"&&Zj(t)}function Xfe(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function Qfe(t){if(!Jr(t))return null;let e=t._writableState,n=t._readableState,i=e||n;return!i&&Jj(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function Zfe(t){var e;return!!(t&&((e=t[Vj])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function Jfe(t){var e,n,i,r,o,s,a,c,u,l;return!!(t&&((e=(n=(i=(r=(o=(s=t[Yj])!==null&&s!==void 0?s:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&r!==void 0?r:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&n!==void 0?n:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((l=t._writableState)===null||l===void 0)&&l.errored))}e2.exports={isDestroyed:hy,kIsDestroyed:jj,isDisturbed:Zfe,kIsDisturbed:Vj,isErrored:Jfe,kIsErrored:Yj,isReadable:Xj,kIsReadable:Fv,kIsClosedPromise:qfe,kControllerErrorFunction:Hfe,kIsWritable:qv,isClosed:Kfe,isDuplexNodeStream:Bfe,isFinished:zfe,isIterable:Yfe,isReadableNodeStream:ly,isReadableStream:$j,isReadableEnded:$fe,isReadableFinished:Kj,isReadableErrored:Wfe,isNodeStream:Jr,isWebStream:jfe,isWritable:Qj,isWritableNodeStream:dy,isWritableStream:zj,isWritableEnded:Wj,isWritableFinished:Vfe,isWritableErrored:Gfe,isServerRequest:Xfe,isServerResponse:Jj,willEmitClose:Qfe,isTransformStream:Gj}});var Di=g((POe,Vv)=>{"use strict";var go=mo(),{AbortError:u2,codes:epe}=tn(),{ERR_INVALID_ARG_TYPE:tpe,ERR_STREAM_PREMATURE_CLOSE:t2}=epe,{kEmptyObject:Bv,once:jv}=En(),{validateAbortSignal:npe,validateFunction:rpe,validateObject:ipe,validateBoolean:ope}=bc(),{Promise:spe,PromisePrototypeThen:ape,SymbolDispose:l2}=it(),{isClosed:cpe,isReadable:n2,isReadableNodeStream:Hv,isReadableStream:upe,isReadableFinished:r2,isReadableErrored:i2,isWritable:o2,isWritableNodeStream:s2,isWritableStream:lpe,isWritableFinished:a2,isWritableErrored:c2,isNodeStream:dpe,willEmitClose:hpe,kIsClosedPromise:fpe}=ei(),Oc;function ppe(t){return t.setHeader&&typeof t.abort=="function"}var Yv=()=>{};function d2(t,e,n){var i,r;if(arguments.length===2?(n=e,e=Bv):e==null?e=Bv:ipe(e,"options"),rpe(n,"callback"),npe(e.signal,"options.signal"),n=jv(n),upe(t)||lpe(t))return mpe(t,e,n);if(!dpe(t))throw new tpe("stream",["ReadableStream","WritableStream","Stream"],t);let o=(i=e.readable)!==null&&i!==void 0?i:Hv(t),s=(r=e.writable)!==null&&r!==void 0?r:s2(t),a=t._writableState,c=t._readableState,u=()=>{t.writable||f()},l=hpe(t)&&Hv(t)===o&&s2(t)===s,d=a2(t,!1),f=()=>{d=!0,t.destroyed&&(l=!1),!(l&&(!t.readable||o))&&(!o||m)&&n.call(t)},m=r2(t,!1),_=()=>{m=!0,t.destroyed&&(l=!1),!(l&&(!t.writable||s))&&(!s||d)&&n.call(t)},E=N=>{n.call(t,N)},I=cpe(t),y=()=>{I=!0;let N=c2(t)||i2(t);if(N&&typeof N!="boolean")return n.call(t,N);if(o&&!m&&Hv(t,!0)&&!r2(t,!1))return n.call(t,new t2);if(s&&!d&&!a2(t,!1))return n.call(t,new t2);n.call(t)},A=()=>{I=!0;let N=c2(t)||i2(t);if(N&&typeof N!="boolean")return n.call(t,N);n.call(t)},S=()=>{t.req.on("finish",f)};ppe(t)?(t.on("complete",f),l||t.on("abort",y),t.req?S():t.on("request",S)):s&&!a&&(t.on("end",u),t.on("close",u)),!l&&typeof t.aborted=="boolean"&&t.on("aborted",y),t.on("end",_),t.on("finish",f),e.error!==!1&&t.on("error",E),t.on("close",y),I?go.nextTick(y):a!=null&&a.errorEmitted||c!=null&&c.errorEmitted?l||go.nextTick(A):(!o&&(!l||n2(t))&&(d||o2(t)===!1)||!s&&(!l||o2(t))&&(m||n2(t)===!1)||c&&t.req&&t.aborted)&&go.nextTick(A);let w=()=>{n=Yv,t.removeListener("aborted",y),t.removeListener("complete",f),t.removeListener("abort",y),t.removeListener("request",S),t.req&&t.req.removeListener("finish",f),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("end",_),t.removeListener("error",E),t.removeListener("close",y)};if(e.signal&&!I){let N=()=>{let W=n;w(),W.call(t,new u2(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)go.nextTick(N);else{Oc=Oc||En().addAbortListener;let W=Oc(e.signal,N),R=n;n=jv((...L)=>{W[l2](),R.apply(t,L)})}}return w}function mpe(t,e,n){let i=!1,r=Yv;if(e.signal)if(r=()=>{i=!0,n.call(t,new u2(void 0,{cause:e.signal.reason}))},e.signal.aborted)go.nextTick(r);else{Oc=Oc||En().addAbortListener;let s=Oc(e.signal,r),a=n;n=jv((...c)=>{s[l2](),a.apply(t,c)})}let o=(...s)=>{i||go.nextTick(()=>n.apply(t,s))};return ape(t[fpe].promise,o,o),Yv}function gpe(t,e){var n;let i=!1;return e===null&&(e=Bv),(n=e)!==null&&n!==void 0&&n.cleanup&&(ope(e.cleanup,"cleanup"),i=e.cleanup),new spe((r,o)=>{let s=d2(t,e,a=>{i&&s(),a?o(a):r()})})}Vv.exports=d2;Vv.exports.finished=gpe});var as=g((DOe,E2)=>{"use strict";var ti=mo(),{aggregateTwoErrors:_pe,codes:{ERR_MULTIPLE_CALLBACK:ype},AbortError:Epe}=tn(),{Symbol:p2}=it(),{kIsDestroyed:Tpe,isDestroyed:Ape,isFinished:Cpe,isServerRequest:Spe}=ei(),m2=p2("kDestroy"),$v=p2("kConstruct");function g2(t,e,n){t&&(t.stack,e&&!e.errored&&(e.errored=t),n&&!n.errored&&(n.errored=t))}function wpe(t,e){let n=this._readableState,i=this._writableState,r=i||n;return i!=null&&i.destroyed||n!=null&&n.destroyed?(typeof e=="function"&&e(),this):(g2(t,i,n),i&&(i.destroyed=!0),n&&(n.destroyed=!0),r.constructed?h2(this,t,e):this.once(m2,function(o){h2(this,_pe(o,t),e)}),this)}function h2(t,e,n){let i=!1;function r(o){if(i)return;i=!0;let s=t._readableState,a=t._writableState;g2(o,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof n=="function"&&n(o),o?ti.nextTick(Ipe,t,o):ti.nextTick(_2,t)}try{t._destroy(e||null,r)}catch(o){r(o)}}function Ipe(t,e){zv(t,e),_2(t)}function _2(t){let e=t._readableState,n=t._writableState;n&&(n.closeEmitted=!0),e&&(e.closeEmitted=!0),(n!=null&&n.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function zv(t,e){let n=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||n!=null&&n.errorEmitted||(i&&(i.errorEmitted=!0),n&&(n.errorEmitted=!0),t.emit("error",e))}function vpe(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function Gv(t,e,n){let i=t._readableState,r=t._writableState;if(r!=null&&r.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||r!=null&&r.autoDestroy?t.destroy(e):e&&(e.stack,r&&!r.errored&&(r.errored=e),i&&!i.errored&&(i.errored=e),n?ti.nextTick(zv,t,e):zv(t,e))}function bpe(t,e){if(typeof t._construct!="function")return;let n=t._readableState,i=t._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),t.once($v,e),!(t.listenerCount($v)>1)&&ti.nextTick(Ope,t)}function Ope(t){let e=!1;function n(i){if(e){Gv(t,i??new ype);return}e=!0;let r=t._readableState,o=t._writableState,s=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),s.destroyed?t.emit(m2,i):i?Gv(t,i,!0):ti.nextTick(Rpe,t)}try{t._construct(i=>{ti.nextTick(n,i)})}catch(i){ti.nextTick(n,i)}}function Rpe(t){t.emit($v)}function f2(t){return t?.setHeader&&typeof t.abort=="function"}function y2(t){t.emit("close")}function Npe(t,e){t.emit("error",e),ti.nextTick(y2,t)}function Ppe(t,e){!t||Ape(t)||(!e&&!Cpe(t)&&(e=new Epe),Spe(t)?(t.socket=null,t.destroy(e)):f2(t)?t.abort():f2(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?ti.nextTick(Npe,t,e):ti.nextTick(y2,t),t.destroyed||(t[Tpe]=!0))}E2.exports={construct:bpe,destroyer:Ppe,destroy:wpe,undestroy:vpe,errorOrDestroy:Gv}});var my=g((MOe,A2)=>{"use strict";var{ArrayIsArray:Dpe,ObjectSetPrototypeOf:T2}=it(),{EventEmitter:fy}=x("events");function py(t){fy.call(this,t)}T2(py.prototype,fy.prototype);T2(py,fy);py.prototype.pipe=function(t,e){let n=this;function i(l){t.writable&&t.write(l)===!1&&n.pause&&n.pause()}n.on("data",i);function r(){n.readable&&n.resume&&n.resume()}t.on("drain",r),!t._isStdio&&(!e||e.end!==!1)&&(n.on("end",s),n.on("close",a));let o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function c(l){u(),fy.listenerCount(this,"error")===0&&this.emit("error",l)}Wv(n,"error",c),Wv(t,"error",c);function u(){n.removeListener("data",i),t.removeListener("drain",r),n.removeListener("end",s),n.removeListener("close",a),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),t.removeListener("close",u)}return n.on("end",u),n.on("close",u),t.on("close",u),t.emit("pipe",n),t};function Wv(t,e,n){if(typeof t.prependListener=="function")return t.prependListener(e,n);!t._events||!t._events[e]?t.on(e,n):Dpe(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]}A2.exports={Stream:py,prependListener:Wv}});var uh=g((kOe,gy)=>{"use strict";var{SymbolDispose:Mpe}=it(),{AbortError:C2,codes:kpe}=tn(),{isNodeStream:S2,isWebStream:Lpe,kControllerErrorFunction:Upe}=ei(),xpe=Di(),{ERR_INVALID_ARG_TYPE:w2}=kpe,Kv,Fpe=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new w2(e,"AbortSignal",t)};gy.exports.addAbortSignal=function(e,n){if(Fpe(e,"signal"),!S2(n)&&!Lpe(n))throw new w2("stream",["ReadableStream","WritableStream","Stream"],n);return gy.exports.addAbortSignalNoValidate(e,n)};gy.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let n=S2(e)?()=>{e.destroy(new C2(void 0,{cause:t.reason}))}:()=>{e[Upe](new C2(void 0,{cause:t.reason}))};if(t.aborted)n();else{Kv=Kv||En().addAbortListener;let i=Kv(t,n);xpe(e,i[Mpe])}return e}});var b2=g((UOe,v2)=>{"use strict";var{StringPrototypeSlice:I2,SymbolIterator:qpe,TypedArrayPrototypeSet:_y,Uint8Array:Hpe}=it(),{Buffer:Xv}=x("buffer"),{inspect:Bpe}=En();v2.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let n={data:e,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}unshift(e){let n={data:e,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let n=this.head,i=""+n.data;for(;(n=n.next)!==null;)i+=e+n.data;return i}concat(e){if(this.length===0)return Xv.alloc(0);let n=Xv.allocUnsafe(e>>>0),i=this.head,r=0;for(;i;)_y(n,i.data,r),r+=i.data.length,i=i.next;return n}consume(e,n){let i=this.head.data;if(e<i.length){let r=i.slice(0,e);return this.head.data=i.slice(e),r}return e===i.length?this.shift():n?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[qpe](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let n="",i=this.head,r=0;do{let o=i.data;if(e>o.length)n+=o,e-=o.length;else{e===o.length?(n+=o,++r,i.next?this.head=i.next:this.head=this.tail=null):(n+=I2(o,0,e),this.head=i,i.data=I2(o,e));break}++r}while((i=i.next)!==null);return this.length-=r,n}_getBuffer(e){let n=Xv.allocUnsafe(e),i=e,r=this.head,o=0;do{let s=r.data;if(e>s.length)_y(n,s,i-e),e-=s.length;else{e===s.length?(_y(n,s,i-e),++o,r.next?this.head=r.next:this.head=this.tail=null):(_y(n,new Hpe(s.buffer,s.byteOffset,e),i-e),this.head=r,r.data=s.slice(e));break}++o}while((r=r.next)!==null);return this.length-=o,n}[Symbol.for("nodejs.util.inspect.custom")](e,n){return Bpe(this,{...n,depth:0,customInspect:!1})}}});var lh=g((xOe,P2)=>{"use strict";var{MathFloor:jpe,NumberIsInteger:Ype}=it(),{validateInteger:Vpe}=bc(),{ERR_INVALID_ARG_VALUE:$pe}=tn().codes,O2=16*1024,R2=16;function zpe(t,e,n){return t.highWaterMark!=null?t.highWaterMark:e?t[n]:null}function N2(t){return t?R2:O2}function Gpe(t,e){Vpe(e,"value",0),t?R2=e:O2=e}function Wpe(t,e,n,i){let r=zpe(e,i,n);if(r!=null){if(!Ype(r)||r<0){let o=i?`options.${n}`:"options.highWaterMark";throw new $pe(o,r)}return jpe(r)}return N2(t.objectMode)}P2.exports={getHighWaterMark:Wpe,getDefaultHighWaterMark:N2,setDefaultHighWaterMark:Gpe}});var k2=g(M2=>{"use strict";var Zv=Po().Buffer,D2=Zv.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Kpe(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function Xpe(t){var e=Kpe(t);if(typeof e!="string"&&(Zv.isEncoding===D2||!D2(t)))throw new Error("Unknown encoding: "+t);return e||t}M2.StringDecoder=dh;function dh(t){this.encoding=Xpe(t);var e;switch(this.encoding){case"utf16le":this.text=nme,this.end=rme,e=4;break;case"utf8":this.fillLast=Jpe,e=4;break;case"base64":this.text=ime,this.end=ome,e=3;break;default:this.write=sme,this.end=ame;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Zv.allocUnsafe(e)}dh.prototype.write=function(t){if(t.length===0)return"";var e,n;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""};dh.prototype.end=tme;dh.prototype.text=eme;dh.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Qv(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Qpe(t,e,n){var i=e.length-1;if(i<n)return 0;var r=Qv(e[i]);return r>=0?(r>0&&(t.lastNeed=r-1),r):--i<n||r===-2?0:(r=Qv(e[i]),r>=0?(r>0&&(t.lastNeed=r-2),r):--i<n||r===-2?0:(r=Qv(e[i]),r>=0?(r>0&&(r===2?r=0:t.lastNeed=r-3),r):0))}function Zpe(t,e,n){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function Jpe(t){var e=this.lastTotal-this.lastNeed,n=Zpe(this,t,e);if(n!==void 0)return n;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function eme(t,e){var n=Qpe(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function tme(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function nme(t,e){if((t.length-e)%2===0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function rme(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function ime(t,e){var n=(t.length-e)%3;return n===0?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function ome(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function sme(t){return t.toString(this.encoding)}function ame(t){return t&&t.length?this.write(t):""}});var Jv=g((qOe,F2)=>{"use strict";var L2=mo(),{PromisePrototypeThen:cme,SymbolAsyncIterator:U2,SymbolIterator:x2}=it(),{Buffer:ume}=x("buffer"),{ERR_INVALID_ARG_TYPE:lme,ERR_STREAM_NULL_VALUES:dme}=tn().codes;function hme(t,e,n){let i;if(typeof e=="string"||e instanceof ume)return new t({objectMode:!0,...n,read(){this.push(e),this.push(null)}});let r;if(e&&e[U2])r=!0,i=e[U2]();else if(e&&e[x2])r=!1,i=e[x2]();else throw new lme("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...n}),s=!1;o._read=function(){s||(s=!0,c())},o._destroy=function(u,l){cme(a(u),()=>L2.nextTick(l,u),d=>L2.nextTick(l,d||u))};async function a(u){let l=u!=null,d=typeof i.throw=="function";if(l&&d){let{value:f,done:m}=await i.throw(u);if(await f,m)return}if(typeof i.return=="function"){let{value:f}=await i.return();await f}}async function c(){for(;;){try{let{value:u,done:l}=r?await i.next():i.next();if(l)o.push(null);else{let d=u&&typeof u.then=="function"?await u:u;if(d===null)throw s=!1,new dme;if(o.push(d))continue;s=!1}}catch(u){o.destroy(u)}break}}return o}F2.exports=hme});var fh=g((HOe,nY)=>{"use strict";var br=mo(),{ArrayPrototypeIndexOf:fme,NumberIsInteger:pme,NumberIsNaN:mme,NumberParseInt:gme,ObjectDefineProperties:ab,ObjectKeys:_me,ObjectSetPrototypeOf:B2,Promise:j2,SafeSet:yme,SymbolAsyncDispose:Eme,SymbolAsyncIterator:Tme,Symbol:Ame}=it();nY.exports=ye;ye.ReadableState=Ay;var{EventEmitter:Cme}=x("events"),{Stream:_o,prependListener:Sme}=my(),{Buffer:eb}=x("buffer"),{addAbortSignal:wme}=uh(),Y2=Di(),be=En().debuglog("stream",t=>{be=t}),Ime=b2(),Pc=as(),{getHighWaterMark:vme,getDefaultHighWaterMark:bme}=lh(),{aggregateTwoErrors:q2,codes:{ERR_INVALID_ARG_TYPE:Ome,ERR_METHOD_NOT_IMPLEMENTED:Rme,ERR_OUT_OF_RANGE:Nme,ERR_STREAM_PUSH_AFTER_EOF:Pme,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Dme},AbortError:Mme}=tn(),{validateObject:kme}=bc(),cs=Ame("kPaused"),{StringDecoder:V2}=k2(),Lme=Jv();B2(ye.prototype,_o.prototype);B2(ye,_o);var tb=()=>{},{errorOrDestroy:Rc}=Pc,Nc=1,Ume=2,$2=4,hh=8,z2=16,yy=32,Ey=64,G2=128,xme=256,Fme=512,qme=1024,ob=2048,sb=4096,Hme=8192,Bme=16384,jme=32768,W2=65536,Yme=1<<17,Vme=1<<18;function bt(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}ab(Ay.prototype,{objectMode:bt(Nc),ended:bt(Ume),endEmitted:bt($2),reading:bt(hh),constructed:bt(z2),sync:bt(yy),needReadable:bt(Ey),emittedReadable:bt(G2),readableListening:bt(xme),resumeScheduled:bt(Fme),errorEmitted:bt(qme),emitClose:bt(ob),autoDestroy:bt(sb),destroyed:bt(Hme),closed:bt(Bme),closeEmitted:bt(jme),multiAwaitDrain:bt(W2),readingMore:bt(Yme),dataEmitted:bt(Vme)});function Ay(t,e,n){typeof n!="boolean"&&(n=e instanceof ni()),this.state=ob|sb|z2|yy,t&&t.objectMode&&(this.state|=Nc),n&&t&&t.readableObjectMode&&(this.state|=Nc),this.highWaterMark=t?vme(this,t,"readableHighWaterMark",n):bme(!1),this.buffer=new Ime,this.length=0,this.pipes=[],this.flowing=null,this[cs]=null,t&&t.emitClose===!1&&(this.state&=~ob),t&&t.autoDestroy===!1&&(this.state&=~sb),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new V2(t.encoding),this.encoding=t.encoding)}function ye(t){if(!(this instanceof ye))return new ye(t);let e=this instanceof ni();this._readableState=new Ay(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&wme(t.signal,this)),_o.call(this,t),Pc.construct(this,()=>{this._readableState.needReadable&&Ty(this,this._readableState)})}ye.prototype.destroy=Pc.destroy;ye.prototype._undestroy=Pc.undestroy;ye.prototype._destroy=function(t,e){e(t)};ye.prototype[Cme.captureRejectionSymbol]=function(t){this.destroy(t)};ye.prototype[Eme]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Mme,this.destroy(t)),new j2((e,n)=>Y2(this,i=>i&&i!==t?n(i):e(null)))};ye.prototype.push=function(t,e){return K2(this,t,e,!1)};ye.prototype.unshift=function(t,e){return K2(this,t,e,!0)};function K2(t,e,n,i){be("readableAddChunk",e);let r=t._readableState,o;if((r.state&Nc)===0&&(typeof e=="string"?(n=n||r.defaultEncoding,r.encoding!==n&&(i&&r.encoding?e=eb.from(e,n).toString(r.encoding):(e=eb.from(e,n),n=""))):e instanceof eb?n="":_o._isUint8Array(e)?(e=_o._uint8ArrayToBuffer(e),n=""):e!=null&&(o=new Ome("chunk",["string","Buffer","Uint8Array"],e))),o)Rc(t,o);else if(e===null)r.state&=~hh,Gme(t,r);else if((r.state&Nc)!==0||e&&e.length>0)if(i)if((r.state&$2)!==0)Rc(t,new Dme);else{if(r.destroyed||r.errored)return!1;nb(t,r,e,!0)}else if(r.ended)Rc(t,new Pme);else{if(r.destroyed||r.errored)return!1;r.state&=~hh,r.decoder&&!n?(e=r.decoder.write(e),r.objectMode||e.length!==0?nb(t,r,e,!1):Ty(t,r)):nb(t,r,e,!1)}else i||(r.state&=~hh,Ty(t,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}function nb(t,e,n,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&W2)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),(e.state&Ey)!==0&&Cy(t)),Ty(t,e)}ye.prototype.isPaused=function(){let t=this._readableState;return t[cs]===!0||t.flowing===!1};ye.prototype.setEncoding=function(t){let e=new V2(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let n=this._readableState.buffer,i="";for(let r of n)i+=e.write(r);return n.clear(),i!==""&&n.push(i),this._readableState.length=i.length,this};var $me=1073741824;function zme(t){if(t>$me)throw new Nme("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function H2(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Nc)!==0?1:mme(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}ye.prototype.read=function(t){be("read",t),t===void 0?t=NaN:pme(t)||(t=gme(t,10));let e=this._readableState,n=t;if(t>e.highWaterMark&&(e.highWaterMark=zme(t)),t!==0&&(e.state&=~G2),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return be("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?rb(this):Cy(this),null;if(t=H2(t,e),t===0&&e.ended)return e.length===0&&rb(this),null;let i=(e.state&Ey)!==0;if(be("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,be("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,be("reading, ended or constructing",i);else if(i){be("do read"),e.state|=hh|yy,e.length===0&&(e.state|=Ey);try{this._read(e.highWaterMark)}catch(o){Rc(this,o)}e.state&=~yy,e.reading||(t=H2(n,e))}let r;return t>0?r=eY(t,e):r=null,r===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&rb(this)),r!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",r)),r};function Gme(t,e){if(be("onEofChunk"),!e.ended){if(e.decoder){let n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?Cy(t):(e.needReadable=!1,e.emittedReadable=!0,X2(t))}}function Cy(t){let e=t._readableState;be("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(be("emitReadable",e.flowing),e.emittedReadable=!0,br.nextTick(X2,t))}function X2(t){let e=t._readableState;be("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Z2(t)}function Ty(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,br.nextTick(Wme,t,e))}function Wme(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let n=e.length;if(be("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}ye.prototype._read=function(t){throw new Rme("_read()")};ye.prototype.pipe=function(t,e){let n=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new yme(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(t),be("pipe count=%d opts=%j",i.pipes.length,e);let o=(!e||e.end!==!1)&&t!==br.stdout&&t!==br.stderr?a:I;i.endEmitted?br.nextTick(o):n.once("end",o),t.on("unpipe",s);function s(y,A){be("onunpipe"),y===n&&A&&A.hasUnpiped===!1&&(A.hasUnpiped=!0,l())}function a(){be("onend"),t.end()}let c,u=!1;function l(){be("cleanup"),t.removeListener("close",_),t.removeListener("finish",E),c&&t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",I),n.removeListener("data",f),u=!0,c&&i.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}function d(){u||(i.pipes.length===1&&i.pipes[0]===t?(be("false write response, pause",0),i.awaitDrainWriters=t,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(t)&&(be("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(t)),n.pause()),c||(c=Kme(n,t),t.on("drain",c))}n.on("data",f);function f(y){be("ondata");let A=t.write(y);be("dest.write",A),A===!1&&d()}function m(y){if(be("onerror",y),I(),t.removeListener("error",m),t.listenerCount("error")===0){let A=t._writableState||t._readableState;A&&!A.errorEmitted?Rc(t,y):t.emit("error",y)}}Sme(t,"error",m);function _(){t.removeListener("finish",E),I()}t.once("close",_);function E(){be("onfinish"),t.removeListener("close",_),I()}t.once("finish",E);function I(){be("unpipe"),n.unpipe(t)}return t.emit("pipe",n),t.writableNeedDrain===!0?d():i.flowing||(be("pipe resume"),n.resume()),t};function Kme(t,e){return function(){let i=t._readableState;i.awaitDrainWriters===e?(be("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(be("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}ye.prototype.unpipe=function(t){let e=this._readableState,n={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let r=e.pipes;e.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let i=fme(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,n),this)};ye.prototype.on=function(t,e){let n=_o.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,be("on readable",i.length,i.reading),i.length?Cy(this):i.reading||br.nextTick(Xme,this)),n};ye.prototype.addListener=ye.prototype.on;ye.prototype.removeListener=function(t,e){let n=_o.prototype.removeListener.call(this,t,e);return t==="readable"&&br.nextTick(Q2,this),n};ye.prototype.off=ye.prototype.removeListener;ye.prototype.removeAllListeners=function(t){let e=_o.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&br.nextTick(Q2,this),e};function Q2(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[cs]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function Xme(t){be("readable nexttick read 0"),t.read(0)}ye.prototype.resume=function(){let t=this._readableState;return t.flowing||(be("resume"),t.flowing=!t.readableListening,Qme(this,t)),t[cs]=!1,this};function Qme(t,e){e.resumeScheduled||(e.resumeScheduled=!0,br.nextTick(Zme,t,e))}function Zme(t,e){be("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Z2(t),e.flowing&&!e.reading&&t.read(0)}ye.prototype.pause=function(){return be("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(be("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[cs]=!0,this};function Z2(t){let e=t._readableState;for(be("flow",e.flowing);e.flowing&&t.read()!==null;);}ye.prototype.wrap=function(t){let e=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",i=>{Rc(this,i)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let n=_me(t);for(let i=1;i<n.length;i++){let r=n[i];this[r]===void 0&&typeof t[r]=="function"&&(this[r]=t[r].bind(t))}return this};ye.prototype[Tme]=function(){return J2(this)};ye.prototype.iterator=function(t){return t!==void 0&&kme(t,"options"),J2(this,t)};function J2(t,e){typeof t.read!="function"&&(t=ye.wrap(t,{objectMode:!0}));let n=Jme(t,e);return n.stream=t,n}async function*Jme(t,e){let n=tb;function i(s){this===t?(n(),n=tb):n=s}t.on("readable",i);let r,o=Y2(t,{writable:!1},s=>{r=s?q2(r,s):null,n(),n=tb});try{for(;;){let s=t.destroyed?null:t.read();if(s!==null)yield s;else{if(r)throw r;if(r===null)return;await new j2(i)}}}catch(s){throw r=q2(r,s),r}finally{(r||e?.destroyOnReturn!==!1)&&(r===void 0||t._readableState.autoDestroy)?Pc.destroyer(t,null):(t.off("readable",i),o())}}ab(ye.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});ab(Ay.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[cs]!==!1},set(t){this[cs]=!!t}}});ye._fromList=eY;function eY(t,e){if(e.length===0)return null;let n;return e.objectMode?n=e.buffer.shift():!t||t>=e.length?(e.decoder?n=e.buffer.join(""):e.buffer.length===1?n=e.buffer.first():n=e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n}function rb(t){let e=t._readableState;be("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,br.nextTick(ege,e,t))}function ege(t,e){if(be("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)br.nextTick(tge,e);else if(t.autoDestroy){let n=e._writableState;(!n||n.autoDestroy&&(n.finished||n.writable===!1))&&e.destroy()}}}function tge(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}ye.from=function(t,e){return Lme(ye,t,e)};var ib;function tY(){return ib===void 0&&(ib={}),ib}ye.fromWeb=function(t,e){return tY().newStreamReadableFromReadableStream(t,e)};ye.toWeb=function(t,e){return tY().newReadableStreamFromStreamReadable(t,e)};ye.wrap=function(t,e){var n,i;return new ye({objectMode:(n=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&n!==void 0?n:!0,...e,destroy(r,o){Pc.destroyer(t,r),o(r)}}).wrap(t)}});var by=g((BOe,pY)=>{"use strict";var us=mo(),{ArrayPrototypeSlice:oY,Error:nge,FunctionPrototypeSymbolHasInstance:sY,ObjectDefineProperty:aY,ObjectDefineProperties:rge,ObjectSetPrototypeOf:cY,StringPrototypeToLowerCase:ige,Symbol:oge,SymbolHasInstance:sge}=it();pY.exports=at;at.WritableState=gh;var{EventEmitter:age}=x("events"),ph=my().Stream,{Buffer:Sy}=x("buffer"),vy=as(),{addAbortSignal:cge}=uh(),{getHighWaterMark:uge,getDefaultHighWaterMark:lge}=lh(),{ERR_INVALID_ARG_TYPE:dge,ERR_METHOD_NOT_IMPLEMENTED:hge,ERR_MULTIPLE_CALLBACK:uY,ERR_STREAM_CANNOT_PIPE:fge,ERR_STREAM_DESTROYED:mh,ERR_STREAM_ALREADY_FINISHED:pge,ERR_STREAM_NULL_VALUES:mge,ERR_STREAM_WRITE_AFTER_END:gge,ERR_UNKNOWN_ENCODING:lY}=tn().codes,{errorOrDestroy:Dc}=vy;cY(at.prototype,ph.prototype);cY(at,ph);function lb(){}var Mc=oge("kOnFinished");function gh(t,e,n){typeof n!="boolean"&&(n=e instanceof ni()),this.objectMode=!!(t&&t.objectMode),n&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?uge(this,t,"writableHighWaterMark",n):lge(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=yge.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Iy(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Mc]=[]}function Iy(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}gh.prototype.getBuffer=function(){return oY(this.buffered,this.bufferedIndex)};aY(gh.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function at(t){let e=this instanceof ni();if(!e&&!sY(at,this))return new at(t);this._writableState=new gh(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&cge(t.signal,this)),ph.call(this,t),vy.construct(this,()=>{let n=this._writableState;n.writing||hb(this,n),fb(this,n)})}aY(at,sge,{__proto__:null,value:function(t){return sY(this,t)?!0:this!==at?!1:t&&t._writableState instanceof gh}});at.prototype.pipe=function(){Dc(this,new fge)};function dY(t,e,n,i){let r=t._writableState;if(typeof n=="function")i=n,n=r.defaultEncoding;else{if(!n)n=r.defaultEncoding;else if(n!=="buffer"&&!Sy.isEncoding(n))throw new lY(n);typeof i!="function"&&(i=lb)}if(e===null)throw new mge;if(!r.objectMode)if(typeof e=="string")r.decodeStrings!==!1&&(e=Sy.from(e,n),n="buffer");else if(e instanceof Sy)n="buffer";else if(ph._isUint8Array(e))e=ph._uint8ArrayToBuffer(e),n="buffer";else throw new dge("chunk",["string","Buffer","Uint8Array"],e);let o;return r.ending?o=new gge:r.destroyed&&(o=new mh("write")),o?(us.nextTick(i,o),Dc(t,o,!0),o):(r.pendingcb++,_ge(t,r,e,n,i))}at.prototype.write=function(t,e,n){return dY(this,t,e,n)===!0};at.prototype.cork=function(){this._writableState.corked++};at.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||hb(this,t))};at.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=ige(e)),!Sy.isEncoding(e))throw new lY(e);return this._writableState.defaultEncoding=e,this};function _ge(t,e,n,i,r){let o=e.objectMode?1:n.length;e.length+=o;let s=e.length<e.highWaterMark;return s||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:n,encoding:i,callback:r}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&r!==lb&&(e.allNoop=!1)):(e.writelen=o,e.writecb=r,e.writing=!0,e.sync=!0,t._write(n,i,e.onwrite),e.sync=!1),s&&!e.errored&&!e.destroyed}function rY(t,e,n,i,r,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new mh("write")):n?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}function iY(t,e,n,i){--e.pendingcb,i(n),db(e),Dc(t,n)}function yge(t,e){let n=t._writableState,i=n.sync,r=n.writecb;if(typeof r!="function"){Dc(t,new uY);return}n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,e?(e.stack,n.errored||(n.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),i?us.nextTick(iY,t,n,e,r):iY(t,n,e,r)):(n.buffered.length>n.bufferedIndex&&hb(t,n),i?n.afterWriteTickInfo!==null&&n.afterWriteTickInfo.cb===r?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:r,stream:t,state:n},us.nextTick(Ege,n.afterWriteTickInfo)):hY(t,n,1,r))}function Ege({stream:t,state:e,count:n,cb:i}){return e.afterWriteTickInfo=null,hY(t,e,n,i)}function hY(t,e,n,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));n-- >0;)e.pendingcb--,i();e.destroyed&&db(e),fb(t,e)}function db(t){if(t.writing)return;for(let r=t.bufferedIndex;r<t.buffered.length;++r){var e;let{chunk:o,callback:s}=t.buffered[r],a=t.objectMode?1:o.length;t.length-=a,s((e=t.errored)!==null&&e!==void 0?e:new mh("write"))}let n=t[Mc].splice(0);for(let r=0;r<n.length;r++){var i;n[r]((i=t.errored)!==null&&i!==void 0?i:new mh("end"))}Iy(t)}function hb(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:n,bufferedIndex:i,objectMode:r}=e,o=n.length-i;if(!o)return;let s=i;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let a=e.allNoop?lb:u=>{for(let l=s;l<n.length;++l)n[l].callback(u)},c=e.allNoop&&s===0?n:oY(n,s);c.allBuffers=e.allBuffers,rY(t,e,!0,e.length,c,"",a),Iy(e)}else{do{let{chunk:a,encoding:c,callback:u}=n[s];n[s++]=null;let l=r?1:a.length;rY(t,e,!1,l,a,c,u)}while(s<n.length&&!e.writing);s===n.length?Iy(e):s>256?(n.splice(0,s),e.bufferedIndex=0):e.bufferedIndex=s}e.bufferProcessing=!1}at.prototype._write=function(t,e,n){if(this._writev)this._writev([{chunk:t,encoding:e}],n);else throw new hge("_write()")};at.prototype._writev=null;at.prototype.end=function(t,e,n){let i=this._writableState;typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r;if(t!=null){let o=dY(this,t,e);o instanceof nge&&(r=o)}return i.corked&&(i.corked=1,this.uncork()),r||(!i.errored&&!i.ending?(i.ending=!0,fb(this,i,!0),i.ended=!0):i.finished?r=new pge("end"):i.destroyed&&(r=new mh("end"))),typeof n=="function"&&(r||i.finished?us.nextTick(n,r):i[Mc].push(n)),this};function wy(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function Tge(t,e){let n=!1;function i(r){if(n){Dc(t,r??uY());return}if(n=!0,e.pendingcb--,r){let o=e[Mc].splice(0);for(let s=0;s<o.length;s++)o[s](r);Dc(t,r,e.sync)}else wy(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,us.nextTick(ub,t,e))}e.sync=!0,e.pendingcb++;try{t._final(i)}catch(r){i(r)}e.sync=!1}function Age(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Tge(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function fb(t,e,n){wy(e)&&(Age(t,e),e.pendingcb===0&&(n?(e.pendingcb++,us.nextTick((i,r)=>{wy(r)?ub(i,r):r.pendingcb--},t,e)):wy(e)&&(e.pendingcb++,ub(t,e))))}function ub(t,e){e.pendingcb--,e.finished=!0;let n=e[Mc].splice(0);for(let i=0;i<n.length;i++)n[i]();if(t.emit("finish"),e.autoDestroy){let i=t._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&t.destroy()}}rge(at.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Cge=vy.destroy;at.prototype.destroy=function(t,e){let n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[Mc].length)&&us.nextTick(db,n),Cge.call(this,t,e),this};at.prototype._undestroy=vy.undestroy;at.prototype._destroy=function(t,e){e(t)};at.prototype[age.captureRejectionSymbol]=function(t){this.destroy(t)};var cb;function fY(){return cb===void 0&&(cb={}),cb}at.fromWeb=function(t,e){return fY().newStreamWritableFromWritableStream(t,e)};at.toWeb=function(t){return fY().newWritableStreamFromStreamWritable(t)}});var RY=g((jOe,OY)=>{"use strict";var pb=mo(),Sge=x("buffer"),{isReadable:wge,isWritable:Ige,isIterable:mY,isNodeStream:vge,isReadableNodeStream:gY,isWritableNodeStream:_Y,isDuplexNodeStream:bge,isReadableStream:yY,isWritableStream:EY}=ei(),TY=Di(),{AbortError:vY,codes:{ERR_INVALID_ARG_TYPE:Oge,ERR_INVALID_RETURN_VALUE:AY}}=tn(),{destroyer:Lc}=as(),Rge=ni(),bY=fh(),Nge=by(),{createDeferredPromise:CY}=En(),SY=Jv(),wY=globalThis.Blob||Sge.Blob,Pge=typeof wY<"u"?function(e){return e instanceof wY}:function(e){return!1},Dge=globalThis.AbortController||Ic().AbortController,{FunctionPrototypeCall:IY}=it(),yo=class extends Rge{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};OY.exports=function t(e,n){if(bge(e))return e;if(gY(e))return kc({readable:e});if(_Y(e))return kc({writable:e});if(vge(e))return kc({writable:!1,readable:!1});if(yY(e))return kc({readable:bY.fromWeb(e)});if(EY(e))return kc({writable:Nge.fromWeb(e)});if(typeof e=="function"){let{value:r,write:o,final:s,destroy:a}=Mge(e);if(mY(r))return SY(yo,r,{objectMode:!0,write:o,final:s,destroy:a});let c=r?.then;if(typeof c=="function"){let u,l=IY(c,r,d=>{if(d!=null)throw new AY("nully","body",d)},d=>{Lc(u,d)});return u=new yo({objectMode:!0,readable:!1,write:o,final(d){s(async()=>{try{await l,pb.nextTick(d,null)}catch(f){pb.nextTick(d,f)}})},destroy:a})}throw new AY("Iterable, AsyncIterable or AsyncFunction",n,r)}if(Pge(e))return t(e.arrayBuffer());if(mY(e))return SY(yo,e,{objectMode:!0,writable:!1});if(yY(e?.readable)&&EY(e?.writable))return yo.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let r=e!=null&&e.readable?gY(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?_Y(e?.writable)?e?.writable:t(e.writable):void 0;return kc({readable:r,writable:o})}let i=e?.then;if(typeof i=="function"){let r;return IY(i,e,o=>{o!=null&&r.push(o),r.push(null)},o=>{Lc(r,o)}),r=new yo({objectMode:!0,writable:!1,read(){}})}throw new Oge(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function Mge(t){let{promise:e,resolve:n}=CY(),i=new Dge,r=i.signal;return{value:t((async function*(){for(;;){let s=e;e=null;let{chunk:a,done:c,cb:u}=await s;if(pb.nextTick(u),c)return;if(r.aborted)throw new vY(void 0,{cause:r.reason});({promise:e,resolve:n}=CY()),yield a}})(),{signal:r}),write(s,a,c){let u=n;n=null,u({chunk:s,done:!1,cb:c})},final(s){let a=n;n=null,a({done:!0,cb:s})},destroy(s,a){i.abort(),a(s)}}}function kc(t){let e=t.readable&&typeof t.readable.read!="function"?bY.wrap(t.readable):t.readable,n=t.writable,i=!!wge(e),r=!!Ige(n),o,s,a,c,u;function l(d){let f=c;c=null,f?f(d):d&&u.destroy(d)}return u=new yo({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(n!=null&&n.writableObjectMode),readable:i,writable:r}),r&&(TY(n,d=>{r=!1,d&&Lc(e,d),l(d)}),u._write=function(d,f,m){n.write(d,f)?m():o=m},u._final=function(d){n.end(),s=d},n.on("drain",function(){if(o){let d=o;o=null,d()}}),n.on("finish",function(){if(s){let d=s;s=null,d()}})),i&&(TY(e,d=>{i=!1,d&&Lc(e,d),l(d)}),e.on("readable",function(){if(a){let d=a;a=null,d()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let d=e.read();if(d===null){a=u._read;return}if(!u.push(d))return}}),u._destroy=function(d,f){!d&&c!==null&&(d=new vY),a=null,o=null,s=null,c===null?f(d):(c=f,Lc(n,d),Lc(e,d))},u}});var ni=g((YOe,DY)=>{"use strict";var{ObjectDefineProperties:kge,ObjectGetOwnPropertyDescriptor:Mi,ObjectKeys:Lge,ObjectSetPrototypeOf:NY}=it();DY.exports=Or;var _b=fh(),dr=by();NY(Or.prototype,_b.prototype);NY(Or,_b);{let t=Lge(dr.prototype);for(let e=0;e<t.length;e++){let n=t[e];Or.prototype[n]||(Or.prototype[n]=dr.prototype[n])}}function Or(t){if(!(this instanceof Or))return new Or(t);_b.call(this,t),dr.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}kge(Or.prototype,{writable:{__proto__:null,...Mi(dr.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Mi(dr.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Mi(dr.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Mi(dr.prototype,"writableBuffer")},writableLength:{__proto__:null,...Mi(dr.prototype,"writableLength")},writableFinished:{__proto__:null,...Mi(dr.prototype,"writableFinished")},writableCorked:{__proto__:null,...Mi(dr.prototype,"writableCorked")},writableEnded:{__proto__:null,...Mi(dr.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Mi(dr.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var mb;function PY(){return mb===void 0&&(mb={}),mb}Or.fromWeb=function(t,e){return PY().newStreamDuplexFromReadableWritablePair(t,e)};Or.toWeb=function(t){return PY().newReadableWritablePairFromDuplex(t)};var gb;Or.from=function(t){return gb||(gb=RY()),gb(t,"body")}});var Tb=g((VOe,kY)=>{"use strict";var{ObjectSetPrototypeOf:MY,Symbol:Uge}=it();kY.exports=ki;var{ERR_METHOD_NOT_IMPLEMENTED:xge}=tn().codes,Eb=ni(),{getHighWaterMark:Fge}=lh();MY(ki.prototype,Eb.prototype);MY(ki,Eb);var _h=Uge("kCallback");function ki(t){if(!(this instanceof ki))return new ki(t);let e=t?Fge(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Eb.call(this,t),this._readableState.sync=!1,this[_h]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",qge)}function yb(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,n)=>{if(e){t?t(e):this.destroy(e);return}n!=null&&this.push(n),this.push(null),t&&t()}):(this.push(null),t&&t())}function qge(){this._final!==yb&&yb.call(this)}ki.prototype._final=yb;ki.prototype._transform=function(t,e,n){throw new xge("_transform()")};ki.prototype._write=function(t,e,n){let i=this._readableState,r=this._writableState,o=i.length;this._transform(t,e,(s,a)=>{if(s){n(s);return}a!=null&&this.push(a),r.ended||o===i.length||i.length<i.highWaterMark?n():this[_h]=n})};ki.prototype._read=function(){if(this[_h]){let t=this[_h];this[_h]=null,t()}}});var Cb=g(($Oe,UY)=>{"use strict";var{ObjectSetPrototypeOf:LY}=it();UY.exports=Uc;var Ab=Tb();LY(Uc.prototype,Ab.prototype);LY(Uc,Ab);function Uc(t){if(!(this instanceof Uc))return new Uc(t);Ab.call(this,t)}Uc.prototype._transform=function(t,e,n){n(null,t)}});var Py=g((zOe,BY)=>{"use strict";var yh=mo(),{ArrayIsArray:Hge,Promise:Bge,SymbolAsyncIterator:jge,SymbolDispose:Yge}=it(),Ny=Di(),{once:Vge}=En(),$ge=as(),xY=ni(),{aggregateTwoErrors:zge,codes:{ERR_INVALID_ARG_TYPE:Pb,ERR_INVALID_RETURN_VALUE:Sb,ERR_MISSING_ARGS:Gge,ERR_STREAM_DESTROYED:Wge,ERR_STREAM_PREMATURE_CLOSE:Kge},AbortError:Xge}=tn(),{validateFunction:Qge,validateAbortSignal:Zge}=bc(),{isIterable:ls,isReadable:wb,isReadableNodeStream:Ry,isNodeStream:FY,isTransformStream:xc,isWebStream:Jge,isReadableStream:Ib,isReadableFinished:e_e}=ei(),t_e=globalThis.AbortController||Ic().AbortController,vb,bb,Ob;function qY(t,e,n){let i=!1;t.on("close",()=>{i=!0});let r=Ny(t,{readable:e,writable:n},o=>{i=!o});return{destroy:o=>{i||(i=!0,$ge.destroyer(t,o||new Wge("pipe")))},cleanup:r}}function n_e(t){return Qge(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function Rb(t){if(ls(t))return t;if(Ry(t))return r_e(t);throw new Pb("val",["Readable","Iterable","AsyncIterable"],t)}async function*r_e(t){bb||(bb=fh()),yield*bb.prototype[jge].call(t)}async function Oy(t,e,n,{end:i}){let r,o=null,s=u=>{if(u&&(r=u),o){let l=o;o=null,l()}},a=()=>new Bge((u,l)=>{r?l(r):o=()=>{r?l(r):u()}});e.on("drain",s);let c=Ny(e,{readable:!1},s);try{e.writableNeedDrain&&await a();for await(let u of t)e.write(u)||await a();i&&(e.end(),await a()),n()}catch(u){n(r!==u?zge(r,u):u)}finally{c(),e.off("drain",s)}}async function Nb(t,e,n,{end:i}){xc(e)&&(e=e.writable);let r=e.getWriter();try{for await(let o of t)await r.ready,r.write(o).catch(()=>{});await r.ready,i&&await r.close(),n()}catch(o){try{await r.abort(o),n(o)}catch(s){n(s)}}}function i_e(...t){return HY(t,Vge(n_e(t)))}function HY(t,e,n){if(t.length===1&&Hge(t[0])&&(t=t[0]),t.length<2)throw new Gge("streams");let i=new t_e,r=i.signal,o=n?.signal,s=[];Zge(o,"options.signal");function a(){_(new Xge)}Ob=Ob||En().addAbortListener;let c;o&&(c=Ob(o,a));let u,l,d=[],f=0;function m(S){_(S,--f===0)}function _(S,w){var N;if(S&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=S),!(!u&&!w)){for(;d.length;)d.shift()(u);(N=c)===null||N===void 0||N[Yge](),i.abort(),w&&(u||s.forEach(W=>W()),yh.nextTick(e,u,l))}}let E;for(let S=0;S<t.length;S++){let w=t[S],N=S<t.length-1,W=S>0,R=N||n?.end!==!1,L=S===t.length-1;if(FY(w)){let b=function(X){X&&X.name!=="AbortError"&&X.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(X)};var A=b;if(R){let{destroy:X,cleanup:K}=qY(w,N,W);d.push(X),wb(w)&&L&&s.push(K)}w.on("error",b),wb(w)&&L&&s.push(()=>{w.removeListener("error",b)})}if(S===0)if(typeof w=="function"){if(E=w({signal:r}),!ls(E))throw new Sb("Iterable, AsyncIterable or Stream","source",E)}else ls(w)||Ry(w)||xc(w)?E=w:E=xY.from(w);else if(typeof w=="function"){if(xc(E)){var I;E=Rb((I=E)===null||I===void 0?void 0:I.readable)}else E=Rb(E);if(E=w(E,{signal:r}),N){if(!ls(E,!0))throw new Sb("AsyncIterable",`transform[${S-1}]`,E)}else{var y;vb||(vb=Cb());let b=new vb({objectMode:!0}),X=(y=E)===null||y===void 0?void 0:y.then;if(typeof X=="function")f++,X.call(E,Sn=>{l=Sn,Sn!=null&&b.write(Sn),R&&b.end(),yh.nextTick(m)},Sn=>{b.destroy(Sn),yh.nextTick(m,Sn)});else if(ls(E,!0))f++,Oy(E,b,m,{end:R});else if(Ib(E)||xc(E)){let Sn=E.readable||E;f++,Oy(Sn,b,m,{end:R})}else throw new Sb("AsyncIterable or Promise","destination",E);E=b;let{destroy:K,cleanup:Fe}=qY(E,!1,!0);d.push(K),L&&s.push(Fe)}}else if(FY(w)){if(Ry(E)){f+=2;let b=o_e(E,w,m,{end:R});wb(w)&&L&&s.push(b)}else if(xc(E)||Ib(E)){let b=E.readable||E;f++,Oy(b,w,m,{end:R})}else if(ls(E))f++,Oy(E,w,m,{end:R});else throw new Pb("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],E);E=w}else if(Jge(w)){if(Ry(E))f++,Nb(Rb(E),w,m,{end:R});else if(Ib(E)||ls(E))f++,Nb(E,w,m,{end:R});else if(xc(E))f++,Nb(E.readable,w,m,{end:R});else throw new Pb("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],E);E=w}else E=xY.from(w)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&yh.nextTick(a),E}function o_e(t,e,n,{end:i}){let r=!1;if(e.on("close",()=>{r||n(new Kge)}),t.pipe(e,{end:!1}),i){let s=function(){r=!0,e.end()};var o=s;e_e(t)?yh.nextTick(s):t.once("end",s)}else n();return Ny(t,{readable:!0,writable:!1},s=>{let a=t._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",n).once("error",n):n(s)}),Ny(e,{readable:!1,writable:!0},n)}BY.exports={pipelineImpl:HY,pipeline:i_e}});var Mb=g((GOe,GY)=>{"use strict";var{pipeline:s_e}=Py(),Dy=ni(),{destroyer:a_e}=as(),{isNodeStream:My,isReadable:jY,isWritable:YY,isWebStream:Db,isTransformStream:ds,isWritableStream:VY,isReadableStream:$Y}=ei(),{AbortError:c_e,codes:{ERR_INVALID_ARG_VALUE:zY,ERR_MISSING_ARGS:u_e}}=tn(),l_e=Di();GY.exports=function(...e){if(e.length===0)throw new u_e("streams");if(e.length===1)return Dy.from(e[0]);let n=[...e];if(typeof e[0]=="function"&&(e[0]=Dy.from(e[0])),typeof e[e.length-1]=="function"){let m=e.length-1;e[m]=Dy.from(e[m])}for(let m=0;m<e.length;++m)if(!(!My(e[m])&&!Db(e[m]))){if(m<e.length-1&&!(jY(e[m])||$Y(e[m])||ds(e[m])))throw new zY(`streams[${m}]`,n[m],"must be readable");if(m>0&&!(YY(e[m])||VY(e[m])||ds(e[m])))throw new zY(`streams[${m}]`,n[m],"must be writable")}let i,r,o,s,a;function c(m){let _=s;s=null,_?_(m):m?a.destroy(m):!f&&!d&&a.destroy()}let u=e[0],l=s_e(e,c),d=!!(YY(u)||VY(u)||ds(u)),f=!!(jY(l)||$Y(l)||ds(l));if(a=new Dy({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(l!=null&&l.readableObjectMode),writable:d,readable:f}),d){if(My(u))a._write=function(_,E,I){u.write(_,E)?I():i=I},a._final=function(_){u.end(),r=_},u.on("drain",function(){if(i){let _=i;i=null,_()}});else if(Db(u)){let E=(ds(u)?u.writable:u).getWriter();a._write=async function(I,y,A){try{await E.ready,E.write(I).catch(()=>{}),A()}catch(S){A(S)}},a._final=async function(I){try{await E.ready,E.close().catch(()=>{}),r=I}catch(y){I(y)}}}let m=ds(l)?l.readable:l;l_e(m,()=>{if(r){let _=r;r=null,_()}})}if(f){if(My(l))l.on("readable",function(){if(o){let m=o;o=null,m()}}),l.on("end",function(){a.push(null)}),a._read=function(){for(;;){let m=l.read();if(m===null){o=a._read;return}if(!a.push(m))return}};else if(Db(l)){let _=(ds(l)?l.readable:l).getReader();a._read=async function(){for(;;)try{let{value:E,done:I}=await _.read();if(!a.push(E))return;if(I){a.push(null);return}}catch{return}}}}return a._destroy=function(m,_){!m&&s!==null&&(m=new c_e),o=null,i=null,r=null,s===null?_(m):(s=_,My(l)&&a_e(l,m))},a}});var rV=g((WOe,Ub)=>{"use strict";var d_e=globalThis.AbortController||Ic().AbortController,{codes:{ERR_INVALID_ARG_VALUE:h_e,ERR_INVALID_ARG_TYPE:Eh,ERR_MISSING_ARGS:f_e,ERR_OUT_OF_RANGE:p_e},AbortError:ri}=tn(),{validateAbortSignal:hs,validateInteger:WY,validateObject:fs}=bc(),m_e=it().Symbol("kWeak"),g_e=it().Symbol("kResistStopPropagation"),{finished:__e}=Di(),y_e=Mb(),{addAbortSignalNoValidate:E_e}=uh(),{isWritable:T_e,isNodeStream:A_e}=ei(),{deprecate:C_e}=En(),{ArrayPrototypePush:S_e,Boolean:w_e,MathFloor:KY,Number:I_e,NumberIsNaN:v_e,Promise:XY,PromiseReject:QY,PromiseResolve:b_e,PromisePrototypeThen:ZY,Symbol:eV}=it(),ky=eV("kEmpty"),JY=eV("kEof");function O_e(t,e){if(e!=null&&fs(e,"options"),e?.signal!=null&&hs(e.signal,"options.signal"),A_e(t)&&!T_e(t))throw new h_e("stream",t,"must be writable");let n=y_e(this,t);return e!=null&&e.signal&&E_e(e.signal,n),n}function Ly(t,e){if(typeof t!="function")throw new Eh("fn",["Function","AsyncFunction"],t);e!=null&&fs(e,"options"),e?.signal!=null&&hs(e.signal,"options.signal");let n=1;e?.concurrency!=null&&(n=KY(e.concurrency));let i=n-1;return e?.highWaterMark!=null&&(i=KY(e.highWaterMark)),WY(n,"options.concurrency",1),WY(i,"options.highWaterMark",0),i+=n,async function*(){let o=En().AbortSignalAny([e?.signal].filter(w_e)),s=this,a=[],c={signal:o},u,l,d=!1,f=0;function m(){d=!0,_()}function _(){f-=1,E()}function E(){l&&!d&&f<n&&a.length<i&&(l(),l=null)}async function I(){try{for await(let y of s){if(d)return;if(o.aborted)throw new ri;try{if(y=t(y,c),y===ky)continue;y=b_e(y)}catch(A){y=QY(A)}f+=1,ZY(y,_,m),a.push(y),u&&(u(),u=null),!d&&(a.length>=i||f>=n)&&await new XY(A=>{l=A})}a.push(JY)}catch(y){let A=QY(y);ZY(A,_,m),a.push(A)}finally{d=!0,u&&(u(),u=null)}}I();try{for(;;){for(;a.length>0;){let y=await a[0];if(y===JY)return;if(o.aborted)throw new ri;y!==ky&&(yield y),a.shift(),E()}await new XY(y=>{u=y})}}finally{d=!0,l&&(l(),l=null)}}.call(this)}function R_e(t=void 0){return t!=null&&fs(t,"options"),t?.signal!=null&&hs(t.signal,"options.signal"),async function*(){let n=0;for await(let r of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new ri({cause:t.signal.reason});yield[n++,r]}}.call(this)}async function tV(t,e=void 0){for await(let n of Lb.call(this,t,e))return!0;return!1}async function N_e(t,e=void 0){if(typeof t!="function")throw new Eh("fn",["Function","AsyncFunction"],t);return!await tV.call(this,async(...n)=>!await t(...n),e)}async function P_e(t,e){for await(let n of Lb.call(this,t,e))return n}async function D_e(t,e){if(typeof t!="function")throw new Eh("fn",["Function","AsyncFunction"],t);async function n(i,r){return await t(i,r),ky}for await(let i of Ly.call(this,n,e));}function Lb(t,e){if(typeof t!="function")throw new Eh("fn",["Function","AsyncFunction"],t);async function n(i,r){return await t(i,r)?i:ky}return Ly.call(this,n,e)}var kb=class extends f_e{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function M_e(t,e,n){var i;if(typeof t!="function")throw new Eh("reducer",["Function","AsyncFunction"],t);n!=null&&fs(n,"options"),n?.signal!=null&&hs(n.signal,"options.signal");let r=arguments.length>1;if(n!=null&&(i=n.signal)!==null&&i!==void 0&&i.aborted){let u=new ri(void 0,{cause:n.signal.reason});throw this.once("error",()=>{}),await __e(this.destroy(u)),u}let o=new d_e,s=o.signal;if(n!=null&&n.signal){let u={once:!0,[m_e]:this,[g_e]:!0};n.signal.addEventListener("abort",()=>o.abort(),u)}let a=!1;try{for await(let u of this){var c;if(a=!0,n!=null&&(c=n.signal)!==null&&c!==void 0&&c.aborted)throw new ri;r?e=await t(e,u,{signal:s}):(e=u,r=!0)}if(!a&&!r)throw new kb}finally{o.abort()}return e}async function k_e(t){t!=null&&fs(t,"options"),t?.signal!=null&&hs(t.signal,"options.signal");let e=[];for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new ri(void 0,{cause:t.signal.reason});S_e(e,i)}return e}function L_e(t,e){let n=Ly.call(this,t,e);return async function*(){for await(let r of n)yield*r}.call(this)}function nV(t){if(t=I_e(t),v_e(t))return 0;if(t<0)throw new p_e("number",">= 0",t);return t}function U_e(t,e=void 0){return e!=null&&fs(e,"options"),e?.signal!=null&&hs(e.signal,"options.signal"),t=nV(t),async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new ri;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new ri;t--<=0&&(yield o)}}.call(this)}function x_e(t,e=void 0){return e!=null&&fs(e,"options"),e?.signal!=null&&hs(e.signal,"options.signal"),t=nV(t),async function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new ri;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new ri;if(t-- >0&&(yield o),t<=0)return}}.call(this)}Ub.exports.streamReturningOperators={asIndexedPairs:C_e(R_e,"readable.asIndexedPairs will be removed in a future version."),drop:U_e,filter:Lb,flatMap:L_e,map:Ly,take:x_e,compose:O_e};Ub.exports.promiseReturningOperators={every:N_e,forEach:D_e,reduce:M_e,toArray:k_e,some:tV,find:P_e}});var xb=g((KOe,iV)=>{"use strict";var{ArrayPrototypePop:F_e,Promise:q_e}=it(),{isIterable:H_e,isNodeStream:B_e,isWebStream:j_e}=ei(),{pipelineImpl:Y_e}=Py(),{finished:V_e}=Di();Fb();function $_e(...t){return new q_e((e,n)=>{let i,r,o=t[t.length-1];if(o&&typeof o=="object"&&!B_e(o)&&!H_e(o)&&!j_e(o)){let s=F_e(t);i=s.signal,r=s.end}Y_e(t,(s,a)=>{s?n(s):e(a)},{signal:i,end:r})})}iV.exports={finished:V_e,pipeline:$_e}});var Fb=g((XOe,fV)=>{"use strict";var{Buffer:z_e}=x("buffer"),{ObjectDefineProperty:Li,ObjectKeys:aV,ReflectApply:cV}=it(),{promisify:{custom:uV}}=En(),{streamReturningOperators:oV,promiseReturningOperators:sV}=rV(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:lV}}=tn(),G_e=Mb(),{setDefaultHighWaterMark:W_e,getDefaultHighWaterMark:K_e}=lh(),{pipeline:dV}=Py(),{destroyer:X_e}=as(),hV=Di(),qb=xb(),Th=ei(),nt=fV.exports=my().Stream;nt.isDestroyed=Th.isDestroyed;nt.isDisturbed=Th.isDisturbed;nt.isErrored=Th.isErrored;nt.isReadable=Th.isReadable;nt.isWritable=Th.isWritable;nt.Readable=fh();for(let t of aV(oV)){let n=function(...i){if(new.target)throw lV();return nt.Readable.from(cV(e,this,i))},e=oV[t];Li(n,"name",{__proto__:null,value:e.name}),Li(n,"length",{__proto__:null,value:e.length}),Li(nt.Readable.prototype,t,{__proto__:null,value:n,enumerable:!1,configurable:!0,writable:!0})}for(let t of aV(sV)){let n=function(...i){if(new.target)throw lV();return cV(e,this,i)},e=sV[t];Li(n,"name",{__proto__:null,value:e.name}),Li(n,"length",{__proto__:null,value:e.length}),Li(nt.Readable.prototype,t,{__proto__:null,value:n,enumerable:!1,configurable:!0,writable:!0})}nt.Writable=by();nt.Duplex=ni();nt.Transform=Tb();nt.PassThrough=Cb();nt.pipeline=dV;var{addAbortSignal:Q_e}=uh();nt.addAbortSignal=Q_e;nt.finished=hV;nt.destroy=X_e;nt.compose=G_e;nt.setDefaultHighWaterMark=W_e;nt.getDefaultHighWaterMark=K_e;Li(nt,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return qb}});Li(dV,uV,{__proto__:null,enumerable:!0,get(){return qb.pipeline}});Li(hV,uV,{__proto__:null,enumerable:!0,get(){return qb.finished}});nt.Stream=nt;nt._isUint8Array=function(e){return e instanceof Uint8Array};nt._uint8ArrayToBuffer=function(e){return z_e.from(e.buffer,e.byteOffset,e.byteLength)}});var pV=g((QOe,we)=>{"use strict";var Ot=x("stream");if(Ot&&process.env.READABLE_STREAM==="disable"){let t=Ot.promises;we.exports._uint8ArrayToBuffer=Ot._uint8ArrayToBuffer,we.exports._isUint8Array=Ot._isUint8Array,we.exports.isDisturbed=Ot.isDisturbed,we.exports.isErrored=Ot.isErrored,we.exports.isReadable=Ot.isReadable,we.exports.Readable=Ot.Readable,we.exports.Writable=Ot.Writable,we.exports.Duplex=Ot.Duplex,we.exports.Transform=Ot.Transform,we.exports.PassThrough=Ot.PassThrough,we.exports.addAbortSignal=Ot.addAbortSignal,we.exports.finished=Ot.finished,we.exports.destroy=Ot.destroy,we.exports.pipeline=Ot.pipeline,we.exports.compose=Ot.compose,Object.defineProperty(Ot,"promises",{configurable:!0,enumerable:!0,get(){return t}}),we.exports.Stream=Ot.Stream}else{let t=Fb(),e=xb(),n=t.Readable.destroy;we.exports=t.Readable,we.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,we.exports._isUint8Array=t._isUint8Array,we.exports.isDisturbed=t.isDisturbed,we.exports.isErrored=t.isErrored,we.exports.isReadable=t.isReadable,we.exports.Readable=t.Readable,we.exports.Writable=t.Writable,we.exports.Duplex=t.Duplex,we.exports.Transform=t.Transform,we.exports.PassThrough=t.PassThrough,we.exports.addAbortSignal=t.addAbortSignal,we.exports.finished=t.finished,we.exports.destroy=t.destroy,we.exports.destroy=n,we.exports.pipeline=t.pipeline,we.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return e}}),we.exports.Stream=t.Stream}we.exports.default=we.exports});var mV=g((ZOe,Hb)=>{"use strict";typeof Object.create=="function"?Hb.exports=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Hb.exports=function(e,n){if(n){e.super_=n;var i=function(){};i.prototype=n.prototype,e.prototype=new i,e.prototype.constructor=e}}});var gV=g((JOe,jb)=>{"use strict";try{if(Bb=x("util"),typeof Bb.inherits!="function")throw"";jb.exports=Bb.inherits}catch{jb.exports=mV()}var Bb});var EV=g((eRe,yV)=>{"use strict";var{Buffer:Rr}=x("buffer"),_V=Symbol.for("BufferList");function ke(t){if(!(this instanceof ke))return new ke(t);ke._init.call(this,t)}ke._init=function(e){Object.defineProperty(this,_V,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};ke.prototype._new=function(e){return new ke(e)};ke.prototype._offset=function(e){if(e===0)return[0,0];let n=0;for(let i=0;i<this._bufs.length;i++){let r=n+this._bufs[i].length;if(e<r||i===this._bufs.length-1)return[i,e-n];n=r}};ke.prototype._reverseOffset=function(t){let e=t[0],n=t[1];for(let i=0;i<e;i++)n+=this._bufs[i].length;return n};ke.prototype.getBuffers=function(){return this._bufs};ke.prototype.get=function(e){if(e>this.length||e<0)return;let n=this._offset(e);return this._bufs[n[0]][n[1]]};ke.prototype.slice=function(e,n){return typeof e=="number"&&e<0&&(e+=this.length),typeof n=="number"&&n<0&&(n+=this.length),this.copy(null,0,e,n)};ke.prototype.copy=function(e,n,i,r){if((typeof i!="number"||i<0)&&(i=0),(typeof r!="number"||r>this.length)&&(r=this.length),i>=this.length||r<=0)return e||Rr.alloc(0);let o=!!e,s=this._offset(i),a=r-i,c=a,u=o&&n||0,l=s[1];if(i===0&&r===this.length){if(!o)return this._bufs.length===1?this._bufs[0]:Rr.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(e,u),u+=this._bufs[d].length;return e}if(c<=this._bufs[s[0]].length-l)return o?this._bufs[s[0]].copy(e,n,l,l+c):this._bufs[s[0]].slice(l,l+c);o||(e=Rr.allocUnsafe(a));for(let d=s[0];d<this._bufs.length;d++){let f=this._bufs[d].length-l;if(c>f)this._bufs[d].copy(e,u,l),u+=f;else{this._bufs[d].copy(e,u,l,l+c),u+=f;break}c-=f,l&&(l=0)}return e.length>u?e.slice(0,u):e};ke.prototype.shallowSlice=function(e,n){if(e=e||0,n=typeof n!="number"?this.length:n,e<0&&(e+=this.length),n<0&&(n+=this.length),e===n)return this._new();let i=this._offset(e),r=this._offset(n),o=this._bufs.slice(i[0],r[0]+1);return r[1]===0?o.pop():o[o.length-1]=o[o.length-1].slice(0,r[1]),i[1]!==0&&(o[0]=o[0].slice(i[1])),this._new(o)};ke.prototype.toString=function(e,n,i){return this.slice(n,i).toString(e)};ke.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};ke.prototype.duplicate=function(){let e=this._new();for(let n=0;n<this._bufs.length;n++)e.append(this._bufs[n]);return e};ke.prototype.append=function(e){return this._attach(e,ke.prototype._appendBuffer)};ke.prototype.prepend=function(e){return this._attach(e,ke.prototype._prependBuffer,!0)};ke.prototype._attach=function(e,n,i){if(e==null)return this;if(e.buffer)n.call(this,Rr.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){let[r,o]=i?[e.length-1,-1]:[0,1];for(let s=r;s>=0&&s<e.length;s+=o)this._attach(e[s],n,i)}else if(this._isBufferList(e)){let[r,o]=i?[e._bufs.length-1,-1]:[0,1];for(let s=r;s>=0&&s<e._bufs.length;s+=o)this._attach(e._bufs[s],n,i)}else typeof e=="number"&&(e=e.toString()),n.call(this,Rr.from(e));return this};ke.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};ke.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length};ke.prototype.indexOf=function(t,e,n){if(n===void 0&&typeof e=="string"&&(n=e,e=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=Rr.from([t]):typeof t=="string"?t=Rr.from(t,n):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=Rr.from(t.buffer,t.byteOffset,t.byteLength):Rr.isBuffer(t)||(t=Rr.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let i=this._offset(e),r=i[0],o=i[1];for(;r<this._bufs.length;r++){let s=this._bufs[r];for(;o<s.length;)if(s.length-o>=t.length){let c=s.indexOf(t,o);if(c!==-1)return this._reverseOffset([r,c]);o=s.length-t.length+1}else{let c=this._reverseOffset([r,o]);if(this._match(c,t))return c;o++}o=0}return-1};ke.prototype._match=function(t,e){if(this.length-t<e.length)return!1;for(let n=0;n<e.length;n++)if(this.get(t+n)!==e[n])return!1;return!0};(function(){let t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in t)(function(n){t[n]===null?ke.prototype[n]=function(i,r){return this.slice(i,i+r)[n](0,r)}:ke.prototype[n]=function(i=0){return this.slice(i,i+t[n])[n](0)}})(e)})();ke.prototype._isBufferList=function(e){return e instanceof ke||ke.isBufferList(e)};ke.isBufferList=function(e){return e!=null&&e[_V]};yV.exports=ke});var Vb=g((tRe,Uy)=>{"use strict";var Yb=pV().Duplex,Z_e=gV(),Ah=EV();function rn(t){if(!(this instanceof rn))return new rn(t);if(typeof t=="function"){this._callback=t;let e=function(i){this._callback&&(this._callback(i),this._callback=null)}.bind(this);this.on("pipe",function(i){i.on("error",e)}),this.on("unpipe",function(i){i.removeListener("error",e)}),t=null}Ah._init.call(this,t),Yb.call(this)}Z_e(rn,Yb);Object.assign(rn.prototype,Ah.prototype);rn.prototype._new=function(e){return new rn(e)};rn.prototype._write=function(e,n,i){this._appendBuffer(e),typeof i=="function"&&i()};rn.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)};rn.prototype.end=function(e){Yb.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};rn.prototype._destroy=function(e,n){this._bufs.length=0,this.length=0,n(e)};rn.prototype._isBufferList=function(e){return e instanceof rn||e instanceof Ah||rn.isBufferList(e)};rn.isBufferList=Ah.isBufferList;Uy.exports=rn;Uy.exports.BufferListStream=rn;Uy.exports.BufferList=Ah});var CV=g((Fy,AV)=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});Fy.default=void 0;var J_e=TV(Vb()),eye=x("stream"),tye=TV(ry()),$b=th(),nye=ho();function TV(t){return t&&t.__esModule?t:{default:t}}var xy=class extends eye.Transform{constructor(e){super({readableObjectMode:!0}),this.debug=e,this.currentMessage=void 0,this.bl=new J_e.default}pause(){return super.pause(),this.currentMessage&&this.currentMessage.pause(),this}resume(){return super.resume(),this.currentMessage&&this.currentMessage.resume(),this}processBufferedData(e){for(;this.bl.length>=$b.HEADER_LENGTH;){let n=this.bl.readUInt16BE(2);if(n<$b.HEADER_LENGTH)return e(new nye.ConnectionError("Unable to process incoming packet"));if(this.bl.length>=n){let i=this.bl.slice(0,n);this.bl.consume(n);let r=new $b.Packet(i);this.debug.packet("Received",r),this.debug.data(r);let o=this.currentMessage;if(o===void 0&&(this.currentMessage=o=new tye.default({type:r.type(),resetConnection:!1}),this.push(o)),r.isLast()){o.once("end",()=>{this.currentMessage=void 0,this.processBufferedData(e)}),o.end(r.data());return}else if(!o.write(r.data())){o.once("drain",()=>{this.processBufferedData(e)});return}}else break}e()}_transform(e,n,i){this.bl.append(e),this.processBufferedData(i)}},nRe=Fy.default=xy;AV.exports=xy});var wV=g((Hy,SV)=>{"use strict";Object.defineProperty(Hy,"__esModule",{value:!0});Hy.default=void 0;var rye=oye(Vb()),iye=x("stream"),zb=th();function oye(t){return t&&t.__esModule?t:{default:t}}var qy=class extends iye.Duplex{constructor(e,{packetSize:n}){super({writableObjectMode:!0}),this.packetSize=n,this.debug=e,this.bl=new rye.default,this.on("finish",()=>{this.push(null)})}_write(e,n,i){let r=this.packetSize-zb.HEADER_LENGTH,o=0;this.currentMessage=e,this.currentMessage.on("data",s=>{if(!e.ignore)for(this.bl.append(s);this.bl.length>r;){let a=this.bl.slice(0,r);this.bl.consume(r);let c=new zb.Packet(e.type);c.packetId(o+=1),c.resetConnection(e.resetConnection),c.addData(a),this.debug.packet("Sent",c),this.debug.data(c),this.push(c.buffer)===!1&&e.pause()}}),this.currentMessage.on("end",()=>{let s=this.bl.slice();this.bl.consume(s.length);let a=new zb.Packet(e.type);a.packetId(o+=1),a.resetConnection(e.resetConnection),a.last(!0),a.ignore(e.ignore),a.addData(s),this.debug.packet("Sent",a),this.debug.data(a),this.push(a.buffer),this.currentMessage=void 0,i()})}_read(e){this.currentMessage&&this.currentMessage.resume()}},rRe=Hy.default=qy;SV.exports=qy});var RV=g((Yy,OV)=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});Yy.default=void 0;var sye=jy(cj()),IV=bV(x("tls")),aye=x("events"),vV=jy(ry()),cye=th(),uye=jy(CV()),lye=jy(wV());function bV(t,e){if(typeof WeakMap=="function")var n=new WeakMap,i=new WeakMap;return(bV=function(r,o){if(!o&&r&&r.__esModule)return r;var s,a,c={__proto__:null,default:r};if(r===null||typeof r!="object"&&typeof r!="function")return c;if(s=o?i:n){if(s.has(r))return s.get(r);s.set(r,c)}for(let u in r)u!=="default"&&{}.hasOwnProperty.call(r,u)&&((a=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(r,u))&&(a.get||a.set)?s(c,u,a):c[u]=r[u]);return c})(t,e)}function jy(t){return t&&t.__esModule?t:{default:t}}var By=class extends aye.EventEmitter{constructor(e,n,i){super(),this.socket=e,this.debug=i,this.tlsNegotiationComplete=!1,this.incomingMessageStream=new uye.default(this.debug),this.incomingMessageIterator=this.incomingMessageStream[Symbol.asyncIterator](),this.outgoingMessageStream=new lye.default(this.debug,{packetSize:n}),this.socket.pipe(this.incomingMessageStream),this.outgoingMessageStream.pipe(this.socket)}packetSize(...e){if(e.length>0){let n=e[0];this.debug.log("Packet size changed from "+this.outgoingMessageStream.packetSize+" to "+n),this.outgoingMessageStream.packetSize=n}return this.securePair&&this.securePair.cleartext.setMaxSendFragment(this.outgoingMessageStream.packetSize),this.outgoingMessageStream.packetSize}startTls(e,n,i){(!e.maxVersion||!["TLSv1.2","TLSv1.1","TLSv1"].includes(e.maxVersion))&&(e.maxVersion="TLSv1.2");let r=IV.createSecureContext(e);return new Promise((o,s)=>{let a=new sye.default,c=this.securePair={cleartext:IV.connect({socket:a.socket1,servername:n,secureContext:r,rejectUnauthorized:!i}),encrypted:a.socket2},u=()=>{c.encrypted.removeListener("readable",d),c.cleartext.removeListener("error",l),c.cleartext.removeListener("secureConnect",u),c.cleartext.once("error",m=>{this.socket.destroy(m)});let f=c.cleartext.getCipher();f&&this.debug.log("TLS negotiated ("+f.name+", "+f.version+")"),this.emit("secure",c.cleartext),c.cleartext.setMaxSendFragment(this.outgoingMessageStream.packetSize),this.outgoingMessageStream.unpipe(this.socket),this.socket.unpipe(this.incomingMessageStream),this.socket.pipe(c.encrypted),c.encrypted.pipe(this.socket),c.cleartext.pipe(this.incomingMessageStream),this.outgoingMessageStream.pipe(c.cleartext),this.tlsNegotiationComplete=!0,o()},l=f=>{c.encrypted.removeListener("readable",d),c.cleartext.removeListener("error",l),c.cleartext.removeListener("secureConnect",u),c.cleartext.destroy(),c.encrypted.destroy(),s(f)},d=()=>{let f=new vV.default({type:cye.TYPE.PRELOGIN,resetConnection:!1}),m;for(;m=c.encrypted.read();)f.write(m);this.outgoingMessageStream.write(f),f.end(),this.readMessage().then(async _=>{c.encrypted.once("readable",d);for await(let E of _)c.encrypted.write(E)}).catch(l)};c.cleartext.once("error",l),c.cleartext.once("secureConnect",u),c.encrypted.once("readable",d)})}sendMessage(e,n,i){let r=new vV.default({type:e,resetConnection:i});return r.end(n),this.outgoingMessageStream.write(r),r}async readMessage(){let e=await this.incomingMessageIterator.next();if(e.done)throw new Error("unexpected end of message stream");return e.value}},iRe=Yy.default=By;OV.exports=By});var Wb=g(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.codepageBySortId=ii.codepageByLanguageId=ii.Flags=ii.Collation=void 0;var dye=ii.codepageByLanguageId={1025:"CP1256",1028:"CP950",1029:"CP1250",1030:"CP1252",1032:"CP1253",1033:"CP1252",1034:"CP1252",1035:"CP1252",1036:"CP1252",1037:"CP1255",1038:"CP1250",1039:"CP1252",1041:"CP932",1042:"CP949",1044:"CP1252",1045:"CP1250",1047:"CP1252",1048:"CP1250",1049:"CP1251",1050:"CP1250",1051:"CP1250",1052:"CP1250",1054:"CP874",1055:"CP1254",1056:"CP1256",1058:"CP1251",1060:"CP1250",1061:"CP1257",1062:"CP1257",1063:"CP1257",1065:"CP1256",1066:"CP1258",1068:"CP1254",1070:"CP1252",1071:"CP1251",1083:"CP1252",1087:"CP1251",1090:"CP1250",1091:"CP1254",1092:"CP1251",1106:"CP1252",1122:"CP1252",1133:"CP1251",1146:"CP1252",1148:"CP1252",1150:"CP1252",1152:"CP1256",1155:"CP1252",1157:"CP1251",1164:"CP1256",2052:"CP936",2074:"CP1250",2092:"CP1251",2107:"CP1252",2143:"CP1252",3076:"CP950",3082:"CP1252",3098:"CP1251",5124:"CP950",5146:"CP1250",8218:"CP1251",1031:"CP1252",1079:"CP1252"},hye=ii.codepageBySortId={30:"CP437",31:"CP437",32:"CP437",33:"CP437",34:"CP437",40:"CP850",41:"CP850",42:"CP850",43:"CP850",44:"CP850",49:"CP850",51:"CP1252",52:"CP1252",53:"CP1252",54:"CP1252",55:"CP850",56:"CP850",57:"CP850",58:"CP850",59:"CP850",60:"CP850",61:"CP850",80:"CP1250",81:"CP1250",82:"CP1250",83:"CP1250",84:"CP1250",85:"CP1250",86:"CP1250",87:"CP1250",88:"CP1250",89:"CP1250",90:"CP1250",91:"CP1250",92:"CP1250",93:"CP1250",94:"CP1250",95:"CP1250",96:"CP1250",104:"CP1251",105:"CP1251",106:"CP1251",107:"CP1251",108:"CP1251",112:"CP1253",113:"CP1253",114:"CP1253",120:"CP1253",121:"CP1253",122:"CP1253",124:"CP1253",128:"CP1254",129:"CP1254",130:"CP1254",136:"CP1255",137:"CP1255",138:"CP1255",144:"CP1256",145:"CP1256",146:"CP1256",152:"CP1257",153:"CP1257",154:"CP1257",155:"CP1257",156:"CP1257",157:"CP1257",158:"CP1257",159:"CP1257",160:"CP1257",183:"CP1252",184:"CP1252",185:"CP1252",186:"CP1252"},fye=ii.Flags={IGNORE_CASE:1,IGNORE_ACCENT:2,IGNORE_KANA:4,IGNORE_WIDTH:8,BINARY:16,BINARY2:32,UTF8:64},Gb=class{static fromBuffer(e,n=0){let i=(e[n+2]&15)<<16;i|=e[n+1]<<8,i|=e[n+0];let r=(e[n+3]&15)<<4;r|=(e[n+2]&240)>>>4;let o=(e[n+3]&240)>>>4,s=e[n+4];return new this(i,r,o,s)}constructor(e,n,i,r){if(this.buffer=void 0,this.lcid=e,this.flags=n,this.version=i,this.sortId=r,this.flags&fye.UTF8)this.codepage="utf-8";else if(this.sortId)this.codepage=hye[this.sortId];else{let o=this.lcid&65535;this.codepage=dye[o]}}toBuffer(){return this.buffer?this.buffer:(this.buffer=Buffer.alloc(5),this.buffer[0]=this.lcid&255,this.buffer[1]=this.lcid>>>8&255,this.buffer[2]=this.lcid>>>16&15|(this.flags&15)<<4,this.buffer[3]=(this.flags&240)>>>4|(this.version&15)<<4,this.buffer[4]=this.sortId&255,this.buffer)}};ii.Collation=Gb});var DV=g((Vy,PV)=>{"use strict";Object.defineProperty(Vy,"__esModule",{value:!0});Vy.default=void 0;var NV={id:31,type:"NULL",name:"Null",declaration(){throw new Error("not implemented")},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},sRe=Vy.default=NV;PV.exports=NV});var Fc=g(($y,kV)=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0});$y.default=void 0;var MV={id:38,type:"INTN",name:"IntN",declaration(){throw new Error("not implemented")},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},aRe=$y.default=MV;kV.exports=MV});var xV=g((zy,UV)=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});zy.default=void 0;var pye=mye(Fc());function mye(t){return t&&t.__esModule?t:{default:t}}var gye=Buffer.from([1]),_ye=Buffer.from([0]),LV={id:48,type:"INT1",name:"TinyInt",declaration:function(){return"tinyint"},generateTypeInfo(){return Buffer.from([pye.default.id,1])},generateParameterLength(t,e){return t.value==null?_ye:gye},*generateParameterData(t,e){if(t.value==null)return;let n=Buffer.alloc(1);n.writeUInt8(Number(t.value),0),yield n},validate:function(t){if(t==null)return null;if(typeof t!="number"&&(t=Number(t)),isNaN(t))throw new TypeError("Invalid number.");if(t<0||t>255)throw new TypeError("Value must be between 0 and 255, inclusive.");return t|0}},cRe=zy.default=LV;UV.exports=LV});var Kb=g((Gy,qV)=>{"use strict";Object.defineProperty(Gy,"__esModule",{value:!0});Gy.default=void 0;var FV={id:104,type:"BITN",name:"BitN",declaration(){throw new Error("not implemented")},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},*generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},uRe=Gy.default=FV;qV.exports=FV});var jV=g((Wy,BV)=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});Wy.default=void 0;var yye=Eye(Kb());function Eye(t){return t&&t.__esModule?t:{default:t}}var Tye=Buffer.from([1]),Aye=Buffer.from([0]),HV={id:50,type:"BIT",name:"Bit",declaration:function(){return"bit"},generateTypeInfo(){return Buffer.from([yye.default.id,1])},generateParameterLength(t,e){return t.value==null?Aye:Tye},*generateParameterData(t,e){t.value!=null&&(yield t.value?Buffer.from([1]):Buffer.from([0]))},validate:function(t){return t==null?null:!!t}},lRe=Wy.default=HV;BV.exports=HV});var $V=g((Ky,VV)=>{"use strict";Object.defineProperty(Ky,"__esModule",{value:!0});Ky.default=void 0;var Cye=Sye(Fc());function Sye(t){return t&&t.__esModule?t:{default:t}}var wye=Buffer.from([2]),Iye=Buffer.from([0]),YV={id:52,type:"INT2",name:"SmallInt",declaration:function(){return"smallint"},generateTypeInfo(){return Buffer.from([Cye.default.id,2])},generateParameterLength(t,e){return t.value==null?Iye:wye},*generateParameterData(t,e){if(t.value==null)return;let n=Buffer.alloc(2);n.writeInt16LE(Number(t.value),0),yield n},validate:function(t){if(t==null)return null;if(typeof t!="number"&&(t=Number(t)),isNaN(t))throw new TypeError("Invalid number.");if(t<-32768||t>32767)throw new TypeError("Value must be between -32768 and 32767, inclusive.");return t|0}},dRe=Ky.default=YV;VV.exports=YV});var WV=g((Xy,GV)=>{"use strict";Object.defineProperty(Xy,"__esModule",{value:!0});Xy.default=void 0;var vye=bye(Fc());function bye(t){return t&&t.__esModule?t:{default:t}}var Oye=Buffer.from([0]),Rye=Buffer.from([4]),zV={id:56,type:"INT4",name:"Int",declaration:function(){return"int"},generateTypeInfo(){return Buffer.from([vye.default.id,4])},generateParameterLength(t,e){return t.value==null?Oye:Rye},*generateParameterData(t,e){if(t.value==null)return;let n=Buffer.alloc(4);n.writeInt32LE(Number(t.value),0),yield n},validate:function(t){if(t==null)return null;if(typeof t!="number"&&(t=Number(t)),isNaN(t))throw new TypeError("Invalid number.");if(t<-2147483648||t>2147483647)throw new TypeError("Value must be between -2147483648 and 2147483647, inclusive.");return t|0}},hRe=Xy.default=zV;GV.exports=zV});var Zy=g((Qy,XV)=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});Qy.default=void 0;var KV={id:111,type:"DATETIMN",name:"DateTimeN",declaration(){throw new Error("not implemented")},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},fRe=Qy.default=KV;XV.exports=KV});var e$=g((Jy,JV)=>{"use strict";Object.defineProperty(Jy,"__esModule",{value:!0});Jy.default=void 0;var Nye=Pye(Zy());function Pye(t){return t&&t.__esModule?t:{default:t}}var QV=new Date(1900,0,1),Dye=new Date(Date.UTC(1900,0,1)),Mye=Buffer.from([4]),kye=Buffer.from([0]),ZV={id:58,type:"DATETIM4",name:"SmallDateTime",declaration:function(){return"smalldatetime"},generateTypeInfo(){return Buffer.from([Nye.default.id,4])},generateParameterLength(t,e){return t.value==null?kye:Mye},generateParameterData:function*(t,e){if(t.value==null)return;let n=Buffer.alloc(4),i,r,o;e.useUTC?(i=Math.floor((t.value.getTime()-Dye.getTime())/(1e3*60*60*24)),o=t.value.getUTCHours()*60+t.value.getUTCMinutes()):(r=-(t.value.getTimezoneOffset()-QV.getTimezoneOffset())*60*1e3,i=Math.floor((t.value.getTime()-QV.getTime()+r)/(1e3*60*60*24)),o=t.value.getHours()*60+t.value.getMinutes()),n.writeUInt16LE(i,0),n.writeUInt16LE(o,2),yield n},validate:function(t,e,n){if(t==null)return null;t instanceof Date||(t=new Date(Date.parse(t))),t=t;let i,r,o;if(n&&n.useUTC?(i=t.getUTCFullYear(),r=t.getUTCMonth(),o=t.getUTCDate()):(i=t.getFullYear(),r=t.getMonth(),o=t.getDate()),i<1900||i>2079)throw new TypeError("Out of range.");if(i===2079&&(r>5||r===5&&o>6))throw new TypeError("Out of range.");if(isNaN(t))throw new TypeError("Invalid date.");return t}},pRe=Jy.default=ZV;JV.exports=ZV});var tE=g((eE,n$)=>{"use strict";Object.defineProperty(eE,"__esModule",{value:!0});eE.default=void 0;var t$={id:109,type:"FLTN",name:"FloatN",declaration(){throw new Error("not implemented")},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},mRe=eE.default=t$;n$.exports=t$});var o$=g((nE,i$)=>{"use strict";Object.defineProperty(nE,"__esModule",{value:!0});nE.default=void 0;var Lye=Uye(tE());function Uye(t){return t&&t.__esModule?t:{default:t}}var xye=Buffer.from([0]),Fye=Buffer.from([4]),r$={id:59,type:"FLT4",name:"Real",declaration:function(){return"real"},generateTypeInfo(){return Buffer.from([Lye.default.id,4])},generateParameterLength(t,e){return t.value==null?xye:Fye},*generateParameterData(t,e){if(t.value==null)return;let n=Buffer.alloc(4);n.writeFloatLE(parseFloat(t.value),0),yield n},validate:function(t){if(t==null)return null;if(t=parseFloat(t),isNaN(t))throw new TypeError("Invalid number.");return t}},gRe=nE.default=r$;i$.exports=r$});var iE=g((rE,a$)=>{"use strict";Object.defineProperty(rE,"__esModule",{value:!0});rE.default=void 0;var s$={id:110,type:"MONEYN",name:"MoneyN",declaration(){throw new Error("not implemented")},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},_Re=rE.default=s$;a$.exports=s$});var l$=g((oE,u$)=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});oE.default=void 0;var qye=Hye(iE());function Hye(t){return t&&t.__esModule?t:{default:t}}var Bye=65536*65536,jye=1/Bye,Yye=Buffer.from([0]),Vye=Buffer.from([8]),c$={id:60,type:"MONEY",name:"Money",declaration:function(){return"money"},generateTypeInfo:function(){return Buffer.from([qye.default.id,8])},generateParameterLength(t,e){return t.value==null?Yye:Vye},*generateParameterData(t,e){if(t.value==null)return;let n=t.value*1e4,i=Buffer.alloc(8);i.writeInt32LE(Math.floor(n*jye),0),i.writeInt32LE(n&-1,4),yield i},validate:function(t){if(t==null)return null;if(t=parseFloat(t),isNaN(t))throw new TypeError("Invalid number.");if(t<-9223372036854776e-1||t>9223372036854776e-1)throw new TypeError("Value must be between -922337203685477.5808 and 922337203685477.5807, inclusive.");return t}},yRe=oE.default=c$;u$.exports=c$});var Ph={};AT(Ph,{ArithmeticException:()=>fr,ChronoField:()=>h,ChronoLocalDate:()=>$c,ChronoLocalDateTime:()=>hO,ChronoUnit:()=>T,ChronoZonedDateTime:()=>dO,Clock:()=>xe,DateTimeException:()=>$,DateTimeFormatter:()=>fe,DateTimeFormatterBuilder:()=>Le,DateTimeParseException:()=>pr,DayOfWeek:()=>je,DecimalStyle:()=>vh,Duration:()=>ot,IllegalArgumentException:()=>Z,IllegalStateException:()=>Vc,Instant:()=>Ye,IsoChronology:()=>Ne,IsoFields:()=>hr,LocalDate:()=>ee,LocalDateTime:()=>De,LocalTime:()=>v,Month:()=>oe,MonthDay:()=>bh,NullPointerException:()=>ui,OffsetDateTime:()=>gr,OffsetTime:()=>Dr,ParsePosition:()=>uO,Period:()=>si,ResolverStyle:()=>ce,SignStyle:()=>Oe,Temporal:()=>An,TemporalAccessor:()=>xi,TemporalAdjuster:()=>Nh,TemporalAdjusters:()=>lO,TemporalAmount:()=>Eo,TemporalField:()=>Mr,TemporalQueries:()=>k,TemporalQuery:()=>Xc,TemporalUnit:()=>li,TextStyle:()=>Re,UnsupportedTemporalTypeException:()=>_e,ValueRange:()=>ue,Year:()=>mr,YearConstants:()=>Tn,YearMonth:()=>Wc,ZoneId:()=>Pe,ZoneOffset:()=>ae,ZoneOffsetTransition:()=>v$,ZoneRegion:()=>Pr,ZoneRules:()=>Oh,ZoneRulesProvider:()=>Rh,ZonedDateTime:()=>_r,_:()=>R$,convert:()=>b$,nativeJs:()=>O$,use:()=>P$});function ms(t,e,n){n===void 0&&(n=Error);function i(r){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,e&&e.apply(this,arguments),this.toString=function(){return this.name+": "+this.message}}return i.prototype=Object.create(n.prototype),i.prototype.name=t,i.prototype.constructor=i,i}function $ye(t,e){e===void 0&&(e=null);var n=t||this.name;e!==null&&e instanceof Error&&(n+=`
|
|
122
|
+
-------
|
|
123
|
+
Caused by: `+e.stack+`
|
|
124
|
+
-------
|
|
125
|
+
`),this.message=n}function zye(t,e,n,i){e===void 0&&(e=""),n===void 0&&(n=0),i===void 0&&(i=null);var r=t||this.name;r+=": "+e+", at index: "+n,i!==null&&i instanceof Error&&(r+=`
|
|
126
|
+
-------
|
|
127
|
+
Caused by: `+i.stack+`
|
|
128
|
+
-------
|
|
129
|
+
`),this.message=r,this.parsedString=function(){return e},this.errorIndex=function(){return n}}function le(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,eO(t,e)}function eO(t,e){return eO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},eO(t,e)}function Ih(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ue(t,e,n){if(!t)throw n?new n(e):new Error(e)}function C(t,e){if(t==null)throw new ui(e+" must not be null");return t}function J(t,e,n){if(!(t instanceof e))throw new Z(n+" must be an instance of "+(e.name?e.name:e)+(t&&t.constructor&&t.constructor.name?", but is "+t.constructor.name:""));return t}function se(t){throw new TypeError('abstract method "'+t+'" is not implemented')}function Wye(){ot.ZERO=new ot(0,0)}function Kye(){Tn.MIN_VALUE=-999999,Tn.MAX_VALUE=999999}function Xye(){T.NANOS=new T("Nanos",ot.ofNanos(1)),T.MICROS=new T("Micros",ot.ofNanos(1e3)),T.MILLIS=new T("Millis",ot.ofNanos(1e6)),T.SECONDS=new T("Seconds",ot.ofSeconds(1)),T.MINUTES=new T("Minutes",ot.ofSeconds(60)),T.HOURS=new T("Hours",ot.ofSeconds(3600)),T.HALF_DAYS=new T("HalfDays",ot.ofSeconds(43200)),T.DAYS=new T("Days",ot.ofSeconds(86400)),T.WEEKS=new T("Weeks",ot.ofSeconds(7*86400)),T.MONTHS=new T("Months",ot.ofSeconds(31556952/12)),T.YEARS=new T("Years",ot.ofSeconds(31556952)),T.DECADES=new T("Decades",ot.ofSeconds(31556952*10)),T.CENTURIES=new T("Centuries",ot.ofSeconds(31556952*100)),T.MILLENNIA=new T("Millennia",ot.ofSeconds(31556952*1e3)),T.ERAS=new T("Eras",ot.ofSeconds(31556952*(Tn.MAX_VALUE+1))),T.FOREVER=new T("Forever",ot.ofSeconds(p.MAX_SAFE_INTEGER,999999999))}function Qye(){h.NANO_OF_SECOND=new h("NanoOfSecond",T.NANOS,T.SECONDS,ue.of(0,999999999)),h.NANO_OF_DAY=new h("NanoOfDay",T.NANOS,T.DAYS,ue.of(0,86400*1e9-1)),h.MICRO_OF_SECOND=new h("MicroOfSecond",T.MICROS,T.SECONDS,ue.of(0,999999)),h.MICRO_OF_DAY=new h("MicroOfDay",T.MICROS,T.DAYS,ue.of(0,86400*1e6-1)),h.MILLI_OF_SECOND=new h("MilliOfSecond",T.MILLIS,T.SECONDS,ue.of(0,999)),h.MILLI_OF_DAY=new h("MilliOfDay",T.MILLIS,T.DAYS,ue.of(0,86400*1e3-1)),h.SECOND_OF_MINUTE=new h("SecondOfMinute",T.SECONDS,T.MINUTES,ue.of(0,59)),h.SECOND_OF_DAY=new h("SecondOfDay",T.SECONDS,T.DAYS,ue.of(0,86399)),h.MINUTE_OF_HOUR=new h("MinuteOfHour",T.MINUTES,T.HOURS,ue.of(0,59)),h.MINUTE_OF_DAY=new h("MinuteOfDay",T.MINUTES,T.DAYS,ue.of(0,1439)),h.HOUR_OF_AMPM=new h("HourOfAmPm",T.HOURS,T.HALF_DAYS,ue.of(0,11)),h.CLOCK_HOUR_OF_AMPM=new h("ClockHourOfAmPm",T.HOURS,T.HALF_DAYS,ue.of(1,12)),h.HOUR_OF_DAY=new h("HourOfDay",T.HOURS,T.DAYS,ue.of(0,23)),h.CLOCK_HOUR_OF_DAY=new h("ClockHourOfDay",T.HOURS,T.DAYS,ue.of(1,24)),h.AMPM_OF_DAY=new h("AmPmOfDay",T.HALF_DAYS,T.DAYS,ue.of(0,1)),h.DAY_OF_WEEK=new h("DayOfWeek",T.DAYS,T.WEEKS,ue.of(1,7)),h.ALIGNED_DAY_OF_WEEK_IN_MONTH=new h("AlignedDayOfWeekInMonth",T.DAYS,T.WEEKS,ue.of(1,7)),h.ALIGNED_DAY_OF_WEEK_IN_YEAR=new h("AlignedDayOfWeekInYear",T.DAYS,T.WEEKS,ue.of(1,7)),h.DAY_OF_MONTH=new h("DayOfMonth",T.DAYS,T.MONTHS,ue.of(1,28,31),"day"),h.DAY_OF_YEAR=new h("DayOfYear",T.DAYS,T.YEARS,ue.of(1,365,366)),h.EPOCH_DAY=new h("EpochDay",T.DAYS,T.FOREVER,ue.of(-365961662,364522971)),h.ALIGNED_WEEK_OF_MONTH=new h("AlignedWeekOfMonth",T.WEEKS,T.MONTHS,ue.of(1,4,5)),h.ALIGNED_WEEK_OF_YEAR=new h("AlignedWeekOfYear",T.WEEKS,T.YEARS,ue.of(1,53)),h.MONTH_OF_YEAR=new h("MonthOfYear",T.MONTHS,T.YEARS,ue.of(1,12),"month"),h.PROLEPTIC_MONTH=new h("ProlepticMonth",T.MONTHS,T.FOREVER,ue.of(Tn.MIN_VALUE*12,Tn.MAX_VALUE*12+11)),h.YEAR_OF_ERA=new h("YearOfEra",T.YEARS,T.FOREVER,ue.of(1,Tn.MAX_VALUE,Tn.MAX_VALUE+1)),h.YEAR=new h("Year",T.YEARS,T.FOREVER,ue.of(Tn.MIN_VALUE,Tn.MAX_VALUE),"year"),h.ERA=new h("Era",T.ERAS,T.FOREVER,ue.of(0,1)),h.INSTANT_SECONDS=new h("InstantSeconds",T.SECONDS,T.FOREVER,ue.of(Yn,Nr)),h.OFFSET_SECONDS=new h("OffsetSeconds",T.SECONDS,T.FOREVER,ue.of(-18*3600,18*3600))}function Tt(t,e){var n=(function(i){le(r,i);function r(){return i.apply(this,arguments)||this}return r})(Xc);return n.prototype.queryFrom=e,new n(t)}function Zye(){je.MONDAY=new je(0,"MONDAY"),je.TUESDAY=new je(1,"TUESDAY"),je.WEDNESDAY=new je(2,"WEDNESDAY"),je.THURSDAY=new je(3,"THURSDAY"),je.FRIDAY=new je(4,"FRIDAY"),je.SATURDAY=new je(5,"SATURDAY"),je.SUNDAY=new je(6,"SUNDAY"),je.FROM=Tt("DayOfWeek.FROM",function(t){return je.from(t)}),Bc=[je.MONDAY,je.TUESDAY,je.WEDNESDAY,je.THURSDAY,je.FRIDAY,je.SATURDAY,je.SUNDAY]}function Jye(){oe.JANUARY=new oe(1,"JANUARY"),oe.FEBRUARY=new oe(2,"FEBRUARY"),oe.MARCH=new oe(3,"MARCH"),oe.APRIL=new oe(4,"APRIL"),oe.MAY=new oe(5,"MAY"),oe.JUNE=new oe(6,"JUNE"),oe.JULY=new oe(7,"JULY"),oe.AUGUST=new oe(8,"AUGUST"),oe.SEPTEMBER=new oe(9,"SEPTEMBER"),oe.OCTOBER=new oe(10,"OCTOBER"),oe.NOVEMBER=new oe(11,"NOVEMBER"),oe.DECEMBER=new oe(12,"DECEMBER"),Sh=[oe.JANUARY,oe.FEBRUARY,oe.MARCH,oe.APRIL,oe.MAY,oe.JUNE,oe.JULY,oe.AUGUST,oe.SEPTEMBER,oe.OCTOBER,oe.NOVEMBER,oe.DECEMBER]}function tEe(){si.ofDays(0)}function rEe(){ae.MAX_SECONDS=18*v.SECONDS_PER_HOUR,ae.UTC=ae.ofTotalSeconds(0),ae.MIN=ae.ofTotalSeconds(-ae.MAX_SECONDS),ae.MAX=ae.ofTotalSeconds(ae.MAX_SECONDS)}function uEe(){tO=new oEe,ps=new sEe,nO=new aEe,kr=new cEe,zc=new p$("WeekBasedYears",ot.ofSeconds(31556952)),Gc=new p$("QuarterYears",ot.ofSeconds(31556952/4)),hr.DAY_OF_QUARTER=tO,hr.QUARTER_OF_YEAR=ps,hr.WEEK_OF_WEEK_BASED_YEAR=nO,hr.WEEK_BASED_YEAR=kr,hr.WEEK_BASED_YEARS=zc,hr.QUARTER_YEARS=Gc,ee.prototype.isoWeekOfWeekyear=function(){return this.get(hr.WEEK_OF_WEEK_BASED_YEAR)},ee.prototype.isoWeekyear=function(){return this.get(hr.WEEK_BASED_YEAR)}}function fEe(){wh.BASE_DATE=ee.of(2e3,1,1),Le.CompositePrinterParser=rO,Le.PadPrinterParserDecorator=iO,Le.SettingsParser=Vn,Le.CharLiteralPrinterParser=oO,Le.StringLiteralPrinterParser=oO,Le.CharLiteralPrinterParser=T$,Le.NumberPrinterParser=Yc,Le.ReducedPrinterParser=wh,Le.FractionPrinterParser=A$,Le.OffsetIdPrinterParser=ci,Le.ZoneIdPrinterParser=C$}function pEe(){fe.ISO_LOCAL_DATE=new Le().appendValue(h.YEAR,4,10,Oe.EXCEEDS_PAD).appendLiteral("-").appendValue(h.MONTH_OF_YEAR,2).appendLiteral("-").appendValue(h.DAY_OF_MONTH,2).toFormatter(ce.STRICT).withChronology(Ne.INSTANCE),fe.ISO_LOCAL_TIME=new Le().appendValue(h.HOUR_OF_DAY,2).appendLiteral(":").appendValue(h.MINUTE_OF_HOUR,2).optionalStart().appendLiteral(":").appendValue(h.SECOND_OF_MINUTE,2).optionalStart().appendFraction(h.NANO_OF_SECOND,0,9,!0).toFormatter(ce.STRICT),fe.ISO_LOCAL_DATE_TIME=new Le().parseCaseInsensitive().append(fe.ISO_LOCAL_DATE).appendLiteral("T").append(fe.ISO_LOCAL_TIME).toFormatter(ce.STRICT).withChronology(Ne.INSTANCE),fe.ISO_INSTANT=new Le().parseCaseInsensitive().appendInstant().toFormatter(ce.STRICT),fe.ISO_OFFSET_DATE_TIME=new Le().parseCaseInsensitive().append(fe.ISO_LOCAL_DATE_TIME).appendOffsetId().toFormatter(ce.STRICT).withChronology(Ne.INSTANCE),fe.ISO_ZONED_DATE_TIME=new Le().append(fe.ISO_OFFSET_DATE_TIME).optionalStart().appendLiteral("[").parseCaseSensitive().appendZoneId().appendLiteral("]").toFormatter(ce.STRICT).withChronology(Ne.INSTANCE),fe.BASIC_ISO_DATE=new Le().appendValue(h.YEAR,4,10,Oe.EXCEEDS_PAD).appendValue(h.MONTH_OF_YEAR,2).appendValue(h.DAY_OF_MONTH,2).toFormatter(ce.STRICT).withChronology(Ne.INSTANCE),fe.ISO_OFFSET_DATE=new Le().parseCaseInsensitive().append(fe.ISO_LOCAL_DATE).appendOffsetId().toFormatter(ce.STRICT).withChronology(Ne.INSTANCE),fe.ISO_OFFSET_TIME=new Le().parseCaseInsensitive().append(fe.ISO_LOCAL_TIME).appendOffsetId().toFormatter(ce.STRICT).withChronology(Ne.INSTANCE),fe.ISO_ORDINAL_DATE=new Le().appendValue(h.YEAR,4,10,Oe.EXCEEDS_PAD).appendLiteral("-").appendValue(h.DAY_OF_YEAR).toFormatter(ce.STRICT),fe.ISO_WEEK_DATE=new Le().appendValue(h.YEAR,4,10,Oe.EXCEEDS_PAD).appendLiteral("-W").appendValue(h.ALIGNED_WEEK_OF_YEAR).appendLiteral("-").appendValue(h.DAY_OF_WEEK).toFormatter(ce.STRICT),fe.ISO_DATE=new Le().parseCaseInsensitive().append(fe.ISO_LOCAL_DATE).optionalStart().appendOffsetId().optionalEnd().toFormatter(ce.STRICT).withChronology(Ne.INSTANCE),fe.ISO_TIME=new Le().parseCaseInsensitive().append(fe.ISO_LOCAL_TIME).optionalStart().appendOffsetId().optionalEnd().toFormatter(ce.STRICT),fe.ISO_DATE_TIME=new Le().append(fe.ISO_LOCAL_DATE_TIME).optionalStart().appendOffsetId().optionalEnd().toFormatter(ce.STRICT).withChronology(Ne.INSTANCE),fe.PARSED_EXCESS_DAYS=Tt("PARSED_EXCESS_DAYS",function(t){return t instanceof lE?t.excessDays:si.ZERO}),fe.PARSED_LEAP_SECOND=Tt("PARSED_LEAP_SECOND",function(t){return t instanceof lE?t.leapSecond:!1})}function mEe(){I$=new Le().appendLiteral("--").appendValue(h.MONTH_OF_YEAR,2).appendLiteral("-").appendValue(h.DAY_OF_MONTH,2).toFormatter(),bh.FROM=Tt("MonthDay.FROM",function(t){return bh.from(t)})}function gEe(){sO=new Le().appendValue(h.YEAR,4,10,Oe.EXCEEDS_PAD).appendLiteral("-").appendValue(h.MONTH_OF_YEAR,2).toFormatter(),Wc.FROM=Tt("YearMonth.FROM",function(t){return Wc.from(t)})}function _Ee(){mr.MIN_VALUE=Tn.MIN_VALUE,mr.MAX_VALUE=Tn.MAX_VALUE,aO=new Le().appendValue(h.YEAR,4,10,Oe.EXCEEDS_PAD).toFormatter(),mr.FROM=Tt("Year.FROM",function(t){return mr.from(t)})}function yEe(){Ne.INSTANCE=new Ne("IsoChronology")}function EEe(){Dr.MIN=Dr.ofNumbers(0,0,0,0,ae.MAX),Dr.MAX=Dr.ofNumbers(23,59,59,999999999,ae.MIN),Dr.FROM=Tt("OffsetTime.FROM",function(t){return Dr.from(t)})}function TEe(t,e){return t<e?-1:t>e?1:0}function AEe(){_r.FROM=Tt("ZonedDateTime.FROM",function(t){return _r.from(t)})}function CEe(){gr.MIN=De.MIN.atOffset(ae.MAX),gr.MAX=De.MAX.atOffset(ae.MIN),gr.FROM=Tt("OffsetDateTime.FROM",function(t){return gr.from(t)})}function SEe(){ee.MIN=ee.of(Tn.MIN_VALUE,1,1),ee.MAX=ee.of(Tn.MAX_VALUE,12,31),ee.EPOCH_0=ee.ofEpochDay(0),ee.FROM=Tt("LocalDate.FROM",function(t){return ee.from(t)})}function wEe(){De.MIN=De.of(ee.MIN,v.MIN),De.MAX=De.of(ee.MAX,v.MAX),De.FROM=Tt("LocalDateTime.FROM",function(t){return De.from(t)})}function IEe(){v.HOURS=[];for(var t=0;t<24;t++)v.of(t,0,0,0);v.MIN=v.HOURS[0],v.MAX=new v(23,59,59,999999999),v.MIDNIGHT=v.HOURS[0],v.NOON=v.HOURS[12],v.FROM=Tt("LocalTime.FROM",function(e){return v.from(e)})}function vEe(){Ye.MIN_SECONDS=-31619119219200,Ye.MAX_SECONDS=31494816403199,Ye.EPOCH=new Ye(0,0),Ye.MIN=Ye.ofEpochSecond(Ye.MIN_SECONDS,0),Ye.MAX=Ye.ofEpochSecond(Ye.MAX_SECONDS,999999999),Ye.FROM=Tt("Instant.FROM",function(t){return Ye.from(t)})}function REe(){k.ZONE_ID=Tt("ZONE_ID",function(t){return t.query(k.ZONE_ID)}),k.CHRONO=Tt("CHRONO",function(t){return t.query(k.CHRONO)}),k.PRECISION=Tt("PRECISION",function(t){return t.query(k.PRECISION)}),k.OFFSET=Tt("OFFSET",function(t){return t.isSupported(h.OFFSET_SECONDS)?ae.ofTotalSeconds(t.get(h.OFFSET_SECONDS)):null}),k.ZONE=Tt("ZONE",function(t){var e=t.query(k.ZONE_ID);return e??t.query(k.OFFSET)}),k.LOCAL_DATE=Tt("LOCAL_DATE",function(t){return t.isSupported(h.EPOCH_DAY)?ee.ofEpochDay(t.getLong(h.EPOCH_DAY)):null}),k.LOCAL_TIME=Tt("LOCAL_TIME",function(t){return t.isSupported(h.NANO_OF_DAY)?v.ofNanoOfDay(t.getLong(h.NANO_OF_DAY)):null})}function DEe(){cO=new PEe,Pe.systemDefault=Hc.systemDefault,Pe.getAvailableZoneIds=Hc.getAvailableZoneIds,Pe.of=Hc.of,Pe.ofOffset=Hc.ofOffset,Pe.from=Hc.from,ae.from=Hc.from,Pe.SYSTEM=cO,Pe.UTC=ae.ofTotalSeconds(0)}function MEe(){g$||(g$=!0,Kye(),Wye(),Xye(),Qye(),IEe(),uEe(),REe(),Zye(),vEe(),SEe(),wEe(),_Ee(),Jye(),gEe(),mEe(),tEe(),rEe(),AEe(),DEe(),yEe(),pEe(),fEe(),CEe(),EEe())}function b$(t,e){return new kEe(t,e)}function O$(t,e){if(e===void 0&&(e=Pe.systemDefault()),C(t,"date"),C(e,"zone"),t instanceof Date)return Ye.ofEpochMilli(t.getTime()).atZone(e);if(typeof t.toDate=="function"&&t.toDate()instanceof Date)return Ye.ofEpochMilli(t.toDate().getTime()).atZone(e);throw new Z("date must be a javascript Date or a moment instance")}function LEe(t){var e=[];return function(i){return~e.indexOf(i)||(i(t),e.push(i)),t}}var $,pr,_e,fr,Z,Vc,ui,Gye,Nr,Yn,p,Kc,Eo,li,ot,Tn,T,Mr,ue,h,k,xi,Xc,je,Bc,oe,Sh,eEe,si,uO,_$,ce,An,$c,oi,Pe,Oh,nEe,d$,h$,ae,lE,y$,f$,E$,hr,iEe,ai,oEe,sEe,aEe,cEe,p$,tO,ps,nO,kr,zc,Gc,vh,Oe,Re,T$,rO,A$,Xb,jc,Yc,wh,cE,ci,iO,Vn,oO,Rh,Pr,C$,S$,lEe,Qb,Ui,Le,qc,Ch,dEe,hEe,w$,fe,bh,I$,Wc,sO,mr,aO,Nh,lO,Lt,Zb,sE,Ne,Dr,dO,_r,gr,uE,m$,ee,hO,De,v,aE,Ye,xe,Jb,bEe,OEe,v$,NEe,PEe,Hc,cO,g$,kEe,R$,N$,P$,Dh=xt(()=>{"use strict";$=ms("DateTimeException",$ye),pr=ms("DateTimeParseException",zye),_e=ms("UnsupportedTemporalTypeException",null,$),fr=ms("ArithmeticException"),Z=ms("IllegalArgumentException"),Vc=ms("IllegalStateException"),ui=ms("NullPointerException");Gye=Object.freeze({__proto__:null,abstractMethodFail:se,assert:Ue,requireInstance:J,requireNonNull:C});Nr=9007199254740991,Yn=-9007199254740991,p=(function(){function t(){}return t.intDiv=function(n,i){var r=n/i;return r=t.roundDown(r),t.safeZero(r)},t.intMod=function(n,i){var r=n-t.intDiv(n,i)*i;return r=t.roundDown(r),t.safeZero(r)},t.roundDown=function(n){return n<0?Math.ceil(n):Math.floor(n)},t.floorDiv=function(n,i){var r=Math.floor(n/i);return t.safeZero(r)},t.floorMod=function(n,i){var r=n-t.floorDiv(n,i)*i;return t.safeZero(r)},t.safeAdd=function(n,i){if(t.verifyInt(n),t.verifyInt(i),n===0)return t.safeZero(i);if(i===0)return t.safeZero(n);var r=t.safeToInt(n+i);if(r===n||r===i)throw new fr("Invalid addition beyond MAX_SAFE_INTEGER!");return r},t.safeSubtract=function(n,i){return t.verifyInt(n),t.verifyInt(i),n===0&&i===0?0:n===0?t.safeZero(-1*i):i===0?t.safeZero(n):t.safeToInt(n-i)},t.safeMultiply=function(n,i){if(t.verifyInt(n),t.verifyInt(i),n===1)return t.safeZero(i);if(i===1)return t.safeZero(n);if(n===0||i===0)return 0;var r=t.safeToInt(n*i);if(r/i!==n||n===Yn&&i===-1||i===Yn&&n===-1)throw new fr("Multiplication overflows: "+n+" * "+i);return r},t.parseInt=(function(e){function n(i){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n})(function(e){var n=parseInt(e);return t.safeToInt(n)}),t.safeToInt=function(n){return t.verifyInt(n),t.safeZero(n)},t.verifyInt=function(n){if(n==null)throw new fr("Invalid value: '"+n+"', using null or undefined as argument");if(isNaN(n))throw new fr("Invalid int value, using NaN as argument");if(Number.isInteger){if(!Number.isInteger(Number(n)))throw new fr("Invalid value: '"+n+"' is a float")}else if(n%1!==0)throw new fr("Invalid value: '"+n+"' is a float");if(n>Nr||n<Yn)throw new fr("Calculation overflows an int: "+n)},t.safeZero=function(n){return n===0?0:+n},t.compareNumbers=function(n,i){return n<i?-1:n>i?1:0},t.smi=function(n){return n>>>1&1073741824|n&3221225471},t.hash=function(n){if(n!==n||n===1/0)return 0;for(var i=n;n>4294967295;)n/=4294967295,i^=n;return t.smi(i)},t.hashCode=function(){for(var n=17,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];for(var s=0,a=r;s<a.length;s++){var c=a[s];n=(n<<5)-n+t.hash(c)}return t.hash(n)},t})();p.MAX_SAFE_INTEGER=Nr;p.MIN_SAFE_INTEGER=Yn;Kc=(function(){function t(n){this._name=n}var e=t.prototype;return e.equals=function(i){return this===i},e.toString=function(){return this._name},e.toJSON=function(){return this.toString()},t})();Eo=(function(){function t(){}var e=t.prototype;return e.get=function(i){se("get")},e.units=function(){se("units")},e.addTo=function(i){se("addTo")},e.subtractFrom=function(i){se("subtractFrom")},t})();typeof Symbol<"u"&&Symbol.toPrimitive&&(Eo.prototype[Symbol.toPrimitive]=function(t){if(t!=="number")return this.toString();throw new TypeError("A conversion from TemporalAmount to a number is not allowed. To compare use the methods .equals(), .compareTo(), .isBefore() or one that is more suitable to your use case.")});li=(function(){function t(){}var e=t.prototype;return e.duration=function(){se("duration")},e.isDurationEstimated=function(){se("isDurationEstimated")},e.isDateBased=function(){se("isDateBased")},e.isTimeBased=function(){se("isTimeBased")},e.isSupportedBy=function(i){se("isSupportedBy")},e.addTo=function(i,r){se("addTo")},e.between=function(i,r){se("between")},t})(),ot=(function(t){le(e,t);function e(i,r){var o;return o=t.call(this)||this,o._seconds=p.safeToInt(i),o._nanos=p.safeToInt(r),o}e.ofDays=function(r){return e._create(p.safeMultiply(r,v.SECONDS_PER_DAY),0)},e.ofHours=function(r){return e._create(p.safeMultiply(r,v.SECONDS_PER_HOUR),0)},e.ofMinutes=function(r){return e._create(p.safeMultiply(r,v.SECONDS_PER_MINUTE),0)},e.ofSeconds=function(r,o){o===void 0&&(o=0);var s=p.safeAdd(r,p.floorDiv(o,v.NANOS_PER_SECOND)),a=p.floorMod(o,v.NANOS_PER_SECOND);return e._create(s,a)},e.ofMillis=function(r){var o=p.intDiv(r,1e3),s=p.intMod(r,1e3);return s<0&&(s+=1e3,o--),e._create(o,s*1e6)},e.ofNanos=function(r){var o=p.intDiv(r,v.NANOS_PER_SECOND),s=p.intMod(r,v.NANOS_PER_SECOND);return s<0&&(s+=v.NANOS_PER_SECOND,o--),this._create(o,s)},e.of=function(r,o){return e.ZERO.plus(r,o)},e.from=function(r){C(r,"amount"),J(r,Eo);var o=e.ZERO;return r.units().forEach(function(s){o=o.plus(r.get(s),s)}),o},e.between=function(r,o){C(r,"startInclusive"),C(o,"endExclusive");var s=r.until(o,T.SECONDS),a=0;if(r.isSupported(h.NANO_OF_SECOND)&&o.isSupported(h.NANO_OF_SECOND))try{var c=r.getLong(h.NANO_OF_SECOND);if(a=o.getLong(h.NANO_OF_SECOND)-c,s>0&&a<0)a+=v.NANOS_PER_SECOND;else if(s<0&&a>0)a-=v.NANOS_PER_SECOND;else if(s===0&&a!==0){var u=o.with(h.NANO_OF_SECOND,c);s=r.until(u,T.SECONDS)}}catch{}return this.ofSeconds(s,a)},e.parse=function(r){C(r,"text");var o=new RegExp("([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?","i"),s=o.exec(r);if(s!==null&&s[3]!=="T"){var a=s[1]==="-",c=s[2],u=s[4],l=s[5],d=s[6],f=s[7];if(c!=null||u!=null||l!=null||d!=null){var m=e._parseNumber(r,c,v.SECONDS_PER_DAY,"days"),_=e._parseNumber(r,u,v.SECONDS_PER_HOUR,"hours"),E=e._parseNumber(r,l,v.SECONDS_PER_MINUTE,"minutes"),I=e._parseNumber(r,d,1,"seconds"),y=d!=null&&d.charAt(0)==="-",A=e._parseFraction(r,f,y?-1:1);try{return e._create(a,m,_,E,I,A)}catch(S){throw new pr("Text cannot be parsed to a Duration: overflow",r,0,S)}}}throw new pr("Text cannot be parsed to a Duration",r,0)},e._parseNumber=function(r,o,s,a){if(o==null)return 0;try{return o[0]==="+"&&(o=o.substring(1)),p.safeMultiply(parseFloat(o),s)}catch(c){throw new pr("Text cannot be parsed to a Duration: "+a,r,0,c)}},e._parseFraction=function(r,o,s){return o==null||o.length===0?0:(o=(o+"000000000").substring(0,9),parseFloat(o)*s)},e._create=function(){return arguments.length<=2?e._createSecondsNanos(arguments[0],arguments[1]):e._createNegateDaysHoursMinutesSecondsNanos(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},e._createNegateDaysHoursMinutesSecondsNanos=function(r,o,s,a,c,u){var l=p.safeAdd(o,p.safeAdd(s,p.safeAdd(a,c)));return r?e.ofSeconds(l,u).negated():e.ofSeconds(l,u)},e._createSecondsNanos=function(r,o){return r===void 0&&(r=0),o===void 0&&(o=0),r===0&&o===0?e.ZERO:new e(r,o)};var n=e.prototype;return n.get=function(r){if(r===T.SECONDS)return this._seconds;if(r===T.NANOS)return this._nanos;throw new _e("Unsupported unit: "+r)},n.units=function(){return[T.SECONDS,T.NANOS]},n.isZero=function(){return this._seconds===0&&this._nanos===0},n.isNegative=function(){return this._seconds<0},n.seconds=function(){return this._seconds},n.nano=function(){return this._nanos},n.withSeconds=function(r){return e._create(r,this._nanos)},n.withNanos=function(r){return h.NANO_OF_SECOND.checkValidIntValue(r),e._create(this._seconds,r)},n.plusDuration=function(r){return C(r,"duration"),this.plus(r.seconds(),r.nano())},n.plus=function(r,o){return arguments.length===1?this.plusDuration(r):arguments.length===2&&o instanceof li?this.plusAmountUnit(r,o):this.plusSecondsNanos(r,o)},n.plusAmountUnit=function(r,o){if(C(r,"amountToAdd"),C(o,"unit"),o===T.DAYS)return this.plusSecondsNanos(p.safeMultiply(r,v.SECONDS_PER_DAY),0);if(o.isDurationEstimated())throw new _e("Unit must not have an estimated duration");if(r===0)return this;if(o instanceof T){switch(o){case T.NANOS:return this.plusNanos(r);case T.MICROS:return this.plusSecondsNanos(p.intDiv(r,1e6*1e3)*1e3,p.intMod(r,1e6*1e3)*1e3);case T.MILLIS:return this.plusMillis(r);case T.SECONDS:return this.plusSeconds(r)}return this.plusSecondsNanos(p.safeMultiply(o.duration().seconds(),r),0)}var s=o.duration().multipliedBy(r);return this.plusSecondsNanos(s.seconds(),s.nano())},n.plusDays=function(r){return this.plusSecondsNanos(p.safeMultiply(r,v.SECONDS_PER_DAY),0)},n.plusHours=function(r){return this.plusSecondsNanos(p.safeMultiply(r,v.SECONDS_PER_HOUR),0)},n.plusMinutes=function(r){return this.plusSecondsNanos(p.safeMultiply(r,v.SECONDS_PER_MINUTE),0)},n.plusSeconds=function(r){return this.plusSecondsNanos(r,0)},n.plusMillis=function(r){return this.plusSecondsNanos(p.intDiv(r,1e3),p.intMod(r,1e3)*1e6)},n.plusNanos=function(r){return this.plusSecondsNanos(0,r)},n.plusSecondsNanos=function(r,o){if(C(r,"secondsToAdd"),C(o,"nanosToAdd"),r===0&&o===0)return this;var s=p.safeAdd(this._seconds,r);s=p.safeAdd(s,p.intDiv(o,v.NANOS_PER_SECOND)),o=p.intMod(o,v.NANOS_PER_SECOND);var a=p.safeAdd(this._nanos,o);return e.ofSeconds(s,a)},n.minus=function(r,o){return arguments.length===1?this.minusDuration(r):this.minusAmountUnit(r,o)},n.minusDuration=function(r){C(r,"duration");var o=r.seconds(),s=r.nano();return o===Yn?this.plus(Nr,-s):this.plus(-o,-s)},n.minusAmountUnit=function(r,o){return C(r,"amountToSubtract"),C(o,"unit"),r===Yn?this.plusAmountUnit(Nr,o):this.plusAmountUnit(-r,o)},n.minusDays=function(r){return r===Yn?this.plusDays(Nr):this.plusDays(-r)},n.minusHours=function(r){return r===Yn?this.plusHours(Nr):this.plusHours(-r)},n.minusMinutes=function(r){return r===Yn?this.plusMinutes(Nr):this.plusMinutes(-r)},n.minusSeconds=function(r){return r===Yn?this.plusSeconds(Nr):this.plusSeconds(-r)},n.minusMillis=function(r){return r===Yn?this.plusMillis(Nr):this.plusMillis(-r)},n.minusNanos=function(r){return r===Yn?this.plusNanos(Nr):this.plusNanos(-r)},n.multipliedBy=function(r){if(r===0)return e.ZERO;if(r===1)return this;var o=p.safeMultiply(this._seconds,r),s=p.safeMultiply(this._nanos,r);return o=o+p.intDiv(s,v.NANOS_PER_SECOND),s=p.intMod(s,v.NANOS_PER_SECOND),e.ofSeconds(o,s)},n.dividedBy=function(r){if(r===0)throw new fr("Cannot divide by zero");if(r===1)return this;var o=p.intDiv(this._seconds,r),s=p.roundDown((this._seconds/r-o)*v.NANOS_PER_SECOND),a=p.intDiv(this._nanos,r);return a=s+a,e.ofSeconds(o,a)},n.negated=function(){return this.multipliedBy(-1)},n.abs=function(){return this.isNegative()?this.negated():this},n.addTo=function(r){return C(r,"temporal"),this._seconds!==0&&(r=r.plus(this._seconds,T.SECONDS)),this._nanos!==0&&(r=r.plus(this._nanos,T.NANOS)),r},n.subtractFrom=function(r){return C(r,"temporal"),this._seconds!==0&&(r=r.minus(this._seconds,T.SECONDS)),this._nanos!==0&&(r=r.minus(this._nanos,T.NANOS)),r},n.toDays=function(){return p.intDiv(this._seconds,v.SECONDS_PER_DAY)},n.toHours=function(){return p.intDiv(this._seconds,v.SECONDS_PER_HOUR)},n.toMinutes=function(){return p.intDiv(this._seconds,v.SECONDS_PER_MINUTE)},n.toMillis=function(){var r=Math.round(p.safeMultiply(this._seconds,1e3));return r=p.safeAdd(r,p.intDiv(this._nanos,1e6)),r},n.toNanos=function(){var r=p.safeMultiply(this._seconds,v.NANOS_PER_SECOND);return r=p.safeAdd(r,this._nanos),r},n.compareTo=function(r){C(r,"otherDuration"),J(r,e,"otherDuration");var o=p.compareNumbers(this._seconds,r.seconds());return o!==0?o:this._nanos-r.nano()},n.equals=function(r){return this===r?!0:r instanceof e?this.seconds()===r.seconds()&&this.nano()===r.nano():!1},n.toString=function(){if(this===e.ZERO)return"PT0S";var r=p.intDiv(this._seconds,v.SECONDS_PER_HOUR),o=p.intDiv(p.intMod(this._seconds,v.SECONDS_PER_HOUR),v.SECONDS_PER_MINUTE),s=p.intMod(this._seconds,v.SECONDS_PER_MINUTE),a="PT";if(r!==0&&(a+=r+"H"),o!==0&&(a+=o+"M"),s===0&&this._nanos===0&&a.length>2)return a;if(s<0&&this._nanos>0?s===-1?a+="-0":a+=s+1:a+=s,this._nanos>0){a+=".";var c;for(s<0?c=""+(2*v.NANOS_PER_SECOND-this._nanos):c=""+(v.NANOS_PER_SECOND+this._nanos),c=c.slice(1,c.length),a+=c;a.charAt(a.length-1)==="0";)a=a.slice(0,a.length-1)}return a+="S",a},n.toJSON=function(){return this.toString()},e})(Eo);Tn=function(){};T=(function(t){le(e,t);function e(i,r){var o;return o=t.call(this)||this,o._name=i,o._duration=r,o}var n=e.prototype;return n.duration=function(){return this._duration},n.isDurationEstimated=function(){return this.isDateBased()||this===e.FOREVER},n.isDateBased=function(){return this.compareTo(e.DAYS)>=0&&this!==e.FOREVER},n.isTimeBased=function(){return this.compareTo(e.DAYS)<0},n.isSupportedBy=function(r){if(this===e.FOREVER)return!1;try{return r.plus(1,this),!0}catch{try{return r.plus(-1,this),!0}catch{return!1}}},n.addTo=function(r,o){return r.plus(o,this)},n.between=function(r,o){return r.until(o,this)},n.toString=function(){return this._name},n.compareTo=function(r){return this.duration().compareTo(r.duration())},e})(li);Mr=(function(){function t(){}var e=t.prototype;return e.isDateBased=function(){se("isDateBased")},e.isTimeBased=function(){se("isTimeBased")},e.baseUnit=function(){se("baseUnit")},e.rangeUnit=function(){se("rangeUnit")},e.range=function(){se("range")},e.rangeRefinedBy=function(i){se("rangeRefinedBy")},e.getFrom=function(i){se("getFrom")},e.adjustInto=function(i,r){se("adjustInto")},e.isSupportedBy=function(i){se("isSupportedBy")},e.displayName=function(){se("displayName")},e.equals=function(i){se("equals")},e.name=function(){se("name")},t})();ue=(function(){function t(n,i,r,o){Ue(!(n>i),"Smallest minimum value '"+n+"' must be less than largest minimum value '"+i+"'",Z),Ue(!(r>o),"Smallest maximum value '"+r+"' must be less than largest maximum value '"+o+"'",Z),Ue(!(i>o),"Minimum value '"+i+"' must be less than maximum value '"+o+"'",Z),this._minSmallest=n,this._minLargest=i,this._maxLargest=o,this._maxSmallest=r}var e=t.prototype;return e.isFixed=function(){return this._minSmallest===this._minLargest&&this._maxSmallest===this._maxLargest},e.minimum=function(){return this._minSmallest},e.largestMinimum=function(){return this._minLargest},e.maximum=function(){return this._maxLargest},e.smallestMaximum=function(){return this._maxSmallest},e.isValidValue=function(i){return this.minimum()<=i&&i<=this.maximum()},e.checkValidValue=function(i,r){var o;return this.isValidValue(i)?i:(r!=null?o="Invalid value for "+r+" (valid values "+this.toString()+"): "+i:o="Invalid value (valid values "+this.toString()+"): "+i,Ue(!1,o,$))},e.checkValidIntValue=function(i,r){if(this.isValidIntValue(i)===!1)throw new $("Invalid int value for "+r+": "+i);return i},e.isValidIntValue=function(i){return this.isIntValue()&&this.isValidValue(i)},e.isIntValue=function(){return this.minimum()>=p.MIN_SAFE_INTEGER&&this.maximum()<=p.MAX_SAFE_INTEGER},e.equals=function(i){return i===this?!0:i instanceof t?this._minSmallest===i._minSmallest&&this._minLargest===i._minLargest&&this._maxSmallest===i._maxSmallest&&this._maxLargest===i._maxLargest:!1},e.hashCode=function(){return p.hashCode(this._minSmallest,this._minLargest,this._maxSmallest,this._maxLargest)},e.toString=function(){var i=this.minimum()+(this.minimum()!==this.largestMinimum()?"/"+this.largestMinimum():"");return i+=" - ",i+=this.smallestMaximum()+(this.smallestMaximum()!==this.maximum()?"/"+this.maximum():""),i},t.of=function(){return arguments.length===2?new t(arguments[0],arguments[0],arguments[1],arguments[1]):arguments.length===3?new t(arguments[0],arguments[0],arguments[1],arguments[2]):arguments.length===4?new t(arguments[0],arguments[1],arguments[2],arguments[3]):Ue(!1,"Invalid number of arguments "+arguments.length,Z)},t})(),h=(function(t){le(e,t),e.byName=function(r){for(var o in e)if(e[o]&&e[o]instanceof e&&e[o].name()===r)return e[o]};function e(i,r,o,s){var a;return a=t.call(this)||this,a._name=i,a._baseUnit=r,a._rangeUnit=o,a._range=s,a}var n=e.prototype;return n.name=function(){return this._name},n.baseUnit=function(){return this._baseUnit},n.rangeUnit=function(){return this._rangeUnit},n.range=function(){return this._range},n.displayName=function(){return this.toString()},n.checkValidValue=function(r){return this.range().checkValidValue(r,this)},n.checkValidIntValue=function(r){return this.range().checkValidIntValue(r,this)},n.isDateBased=function(){var r=this===e.DAY_OF_WEEK||this===e.ALIGNED_DAY_OF_WEEK_IN_MONTH||this===e.ALIGNED_DAY_OF_WEEK_IN_YEAR||this===e.DAY_OF_MONTH||this===e.DAY_OF_YEAR||this===e.EPOCH_DAY||this===e.ALIGNED_WEEK_OF_MONTH||this===e.ALIGNED_WEEK_OF_YEAR||this===e.MONTH_OF_YEAR||this===e.PROLEPTIC_MONTH||this===e.YEAR_OF_ERA||this===e.YEAR||this===e.ERA;return r},n.isTimeBased=function(){var r=this===e.NANO_OF_SECOND||this===e.NANO_OF_DAY||this===e.MICRO_OF_SECOND||this===e.MICRO_OF_DAY||this===e.MILLI_OF_SECOND||this===e.MILLI_OF_DAY||this===e.SECOND_OF_MINUTE||this===e.SECOND_OF_DAY||this===e.MINUTE_OF_HOUR||this===e.MINUTE_OF_DAY||this===e.HOUR_OF_AMPM||this===e.CLOCK_HOUR_OF_AMPM||this===e.HOUR_OF_DAY||this===e.CLOCK_HOUR_OF_DAY||this===e.AMPM_OF_DAY;return r},n.rangeRefinedBy=function(r){return r.range(this)},n.getFrom=function(r){return r.getLong(this)},n.toString=function(){return this.name()},n.equals=function(r){return this===r},n.adjustInto=function(r,o){return r.with(this,o)},n.isSupportedBy=function(r){return r.isSupported(this)},e})(Mr);k=(function(){function t(){}return t.zoneId=function(){return t.ZONE_ID},t.chronology=function(){return t.CHRONO},t.precision=function(){return t.PRECISION},t.zone=function(){return t.ZONE},t.offset=function(){return t.OFFSET},t.localDate=function(){return t.LOCAL_DATE},t.localTime=function(){return t.LOCAL_TIME},t})();xi=(function(){function t(){}var e=t.prototype;return e.query=function(i){return i===k.zoneId()||i===k.chronology()||i===k.precision()?null:i.queryFrom(this)},e.get=function(i){return this.range(i).checkValidIntValue(this.getLong(i),i)},e.getLong=function(i){se("getLong")},e.range=function(i){if(i instanceof h){if(this.isSupported(i))return i.range();throw new _e("Unsupported field: "+i)}return i.rangeRefinedBy(this)},e.isSupported=function(i){se("isSupported")},t})(),Xc=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.queryFrom=function(r){se("queryFrom")},e})(Kc);je=(function(t){le(e,t);function e(i,r){var o;return o=t.call(this)||this,o._ordinal=i,o._name=r,o}var n=e.prototype;return n.ordinal=function(){return this._ordinal},n.name=function(){return this._name},e.values=function(){return Bc.slice()},e.valueOf=function(r){var o=0;for(o;o<Bc.length&&Bc[o].name()!==r;o++);return e.of(o+1)},e.of=function(r){if(r<1||r>7)throw new $("Invalid value for DayOfWeek: "+r);return Bc[r-1]},e.from=function(r){if(Ue(r!=null,"temporal",ui),r instanceof e)return r;try{return e.of(r.get(h.DAY_OF_WEEK))}catch(o){throw o instanceof $?new $("Unable to obtain DayOfWeek from TemporalAccessor: "+r+", type "+(r.constructor!=null?r.constructor.name:""),o):o}},n.value=function(){return this._ordinal+1},n.displayName=function(r,o){throw new Z("Pattern using (localized) text not implemented yet!")},n.isSupported=function(r){return r instanceof h?r===h.DAY_OF_WEEK:r!=null&&r.isSupportedBy(this)},n.range=function(r){if(r===h.DAY_OF_WEEK)return r.range();if(r instanceof h)throw new _e("Unsupported field: "+r);return r.rangeRefinedBy(this)},n.get=function(r){return r===h.DAY_OF_WEEK?this.value():this.range(r).checkValidIntValue(this.getLong(r),r)},n.getLong=function(r){if(r===h.DAY_OF_WEEK)return this.value();if(r instanceof h)throw new _e("Unsupported field: "+r);return r.getFrom(this)},n.plus=function(r){var o=p.floorMod(r,7);return Bc[p.floorMod(this._ordinal+(o+7),7)]},n.minus=function(r){return this.plus(-1*p.floorMod(r,7))},n.query=function(r){return r===k.precision()?T.DAYS:r===k.localDate()||r===k.localTime()||r===k.chronology()||r===k.zone()||r===k.zoneId()||r===k.offset()?null:(Ue(r!=null,"query",ui),r.queryFrom(this))},n.adjustInto=function(r){return C(r,"temporal"),r.with(h.DAY_OF_WEEK,this.value())},n.equals=function(r){return this===r},n.toString=function(){return this._name},n.compareTo=function(r){return C(r,"other"),J(r,e,"other"),this._ordinal-r._ordinal},n.toJSON=function(){return this.toString()},e})(xi);oe=(function(t){le(e,t);function e(i,r){var o;return o=t.call(this)||this,o._value=p.safeToInt(i),o._name=r,o}var n=e.prototype;return n.value=function(){return this._value},n.ordinal=function(){return this._value-1},n.name=function(){return this._name},n.displayName=function(r,o){throw new Z("Pattern using (localized) text not implemented yet!")},n.isSupported=function(r){return r===null?!1:r instanceof h?r===h.MONTH_OF_YEAR:r!=null&&r.isSupportedBy(this)},n.get=function(r){return r===h.MONTH_OF_YEAR?this.value():this.range(r).checkValidIntValue(this.getLong(r),r)},n.getLong=function(r){if(r===h.MONTH_OF_YEAR)return this.value();if(r instanceof h)throw new _e("Unsupported field: "+r);return r.getFrom(this)},n.plus=function(r){var o=p.intMod(r,12)+12,s=p.intMod(this.value()+o,12);return s=s===0?12:s,e.of(s)},n.minus=function(r){return this.plus(-1*p.intMod(r,12))},n.length=function(r){switch(this){case e.FEBRUARY:return r?29:28;case e.APRIL:case e.JUNE:case e.SEPTEMBER:case e.NOVEMBER:return 30;default:return 31}},n.minLength=function(){switch(this){case e.FEBRUARY:return 28;case e.APRIL:case e.JUNE:case e.SEPTEMBER:case e.NOVEMBER:return 30;default:return 31}},n.maxLength=function(){switch(this){case e.FEBRUARY:return 29;case e.APRIL:case e.JUNE:case e.SEPTEMBER:case e.NOVEMBER:return 30;default:return 31}},n.firstDayOfYear=function(r){var o=r?1:0;switch(this){case e.JANUARY:return 1;case e.FEBRUARY:return 32;case e.MARCH:return 60+o;case e.APRIL:return 91+o;case e.MAY:return 121+o;case e.JUNE:return 152+o;case e.JULY:return 182+o;case e.AUGUST:return 213+o;case e.SEPTEMBER:return 244+o;case e.OCTOBER:return 274+o;case e.NOVEMBER:return 305+o;case e.DECEMBER:default:return 335+o}},n.firstMonthOfQuarter=function(){switch(this){case e.JANUARY:case e.FEBRUARY:case e.MARCH:return e.JANUARY;case e.APRIL:case e.MAY:case e.JUNE:return e.APRIL;case e.JULY:case e.AUGUST:case e.SEPTEMBER:return e.JULY;case e.OCTOBER:case e.NOVEMBER:case e.DECEMBER:default:return e.OCTOBER}},n.query=function(r){return Ue(r!=null,"query() parameter must not be null",$),r===k.chronology()?Ne.INSTANCE:r===k.precision()?T.MONTHS:t.prototype.query.call(this,r)},n.toString=function(){switch(this){case e.JANUARY:return"JANUARY";case e.FEBRUARY:return"FEBRUARY";case e.MARCH:return"MARCH";case e.APRIL:return"APRIL";case e.MAY:return"MAY";case e.JUNE:return"JUNE";case e.JULY:return"JULY";case e.AUGUST:return"AUGUST";case e.SEPTEMBER:return"SEPTEMBER";case e.OCTOBER:return"OCTOBER";case e.NOVEMBER:return"NOVEMBER";case e.DECEMBER:return"DECEMBER";default:return"unknown Month, value: "+this.value()}},n.toJSON=function(){return this.toString()},n.adjustInto=function(r){return r.with(h.MONTH_OF_YEAR,this.value())},n.compareTo=function(r){return C(r,"other"),J(r,e,"other"),this._value-r._value},n.equals=function(r){return this===r},e.valueOf=function(r){var o=0;for(o;o<Sh.length&&Sh[o].name()!==r;o++);return e.of(o+1)},e.values=function(){return Sh.slice()},e.of=function(r){return(r<1||r>12)&&Ue(!1,"Invalid value for MonthOfYear: "+r,$),Sh[r-1]},e.from=function(r){if(r instanceof e)return r;try{return e.of(r.get(h.MONTH_OF_YEAR))}catch(o){throw new $("Unable to obtain Month from TemporalAccessor: "+r+" of type "+(r&&r.constructor!=null?r.constructor.name:""),o)}},e})(xi);eEe=/([-+]?)P(?:([-+]?[0-9]+)Y)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)W)?(?:([-+]?[0-9]+)D)?/,si=(function(t){le(e,t);function e(i,r,o){var s;s=t.call(this)||this;var a=p.safeToInt(i),c=p.safeToInt(r),u=p.safeToInt(o);return a===0&&c===0&&u===0?(e.ZERO||(s._years=a,s._months=c,s._days=u,e.ZERO=Ih(s)),e.ZERO||Ih(s)):(s._years=a,s._months=c,s._days=u,s)}e.ofYears=function(r){return e.create(r,0,0)},e.ofMonths=function(r){return e.create(0,r,0)},e.ofWeeks=function(r){return e.create(0,0,p.safeMultiply(r,7))},e.ofDays=function(r){return e.create(0,0,r)},e.of=function(r,o,s){return e.create(r,o,s)},e.from=function(r){if(r instanceof e)return r;C(r,"amount");for(var o=0,s=0,a=0,c=r.units(),u=0;u<c.length;u++){var l=c[u],d=r.get(l);if(l===T.YEARS)o=p.safeToInt(d);else if(l===T.MONTHS)s=p.safeToInt(d);else if(l===T.DAYS)a=p.safeToInt(d);else throw new $("Unit must be Years, Months or Days, but was "+l)}return e.create(o,s,a)},e.between=function(r,o){return C(r,"startDate"),C(o,"endDate"),J(r,ee,"startDate"),J(o,ee,"endDate"),r.until(o)},e.parse=function(r){C(r,"text");try{return e._parse(r)}catch(o){throw o instanceof fr?new pr("Text cannot be parsed to a Period",r,0,o):o}},e._parse=function(r){var o=eEe.exec(r);if(o!=null){var s=o[1]==="-"?-1:1,a=o[2],c=o[3],u=o[4],l=o[5];if(a!=null||c!=null||u!=null||l!=null){var d=e._parseNumber(r,a,s),f=e._parseNumber(r,c,s),m=e._parseNumber(r,u,s),_=e._parseNumber(r,l,s);return _=p.safeAdd(_,p.safeMultiply(m,7)),e.create(d,f,_)}}throw new pr("Text cannot be parsed to a Period",r,0)},e._parseNumber=function(r,o,s){if(o==null)return 0;var a=p.parseInt(o);return p.safeMultiply(a,s)},e.create=function(r,o,s){return new e(r,o,s)};var n=e.prototype;return n.units=function(){return[T.YEARS,T.MONTHS,T.DAYS]},n.chronology=function(){return Ne.INSTANCE},n.get=function(r){if(r===T.YEARS)return this._years;if(r===T.MONTHS)return this._months;if(r===T.DAYS)return this._days;throw new _e("Unsupported unit: "+r)},n.isZero=function(){return this===e.ZERO},n.isNegative=function(){return this._years<0||this._months<0||this._days<0},n.years=function(){return this._years},n.months=function(){return this._months},n.days=function(){return this._days},n.withYears=function(r){return r===this._years?this:e.create(r,this._months,this._days)},n.withMonths=function(r){return r===this._months?this:e.create(this._years,r,this._days)},n.withDays=function(r){return r===this._days?this:e.create(this._years,this._months,r)},n.plus=function(r){var o=e.from(r);return e.create(p.safeAdd(this._years,o._years),p.safeAdd(this._months,o._months),p.safeAdd(this._days,o._days))},n.plusYears=function(r){return r===0?this:e.create(p.safeToInt(p.safeAdd(this._years,r)),this._months,this._days)},n.plusMonths=function(r){return r===0?this:e.create(this._years,p.safeToInt(p.safeAdd(this._months,r)),this._days)},n.plusDays=function(r){return r===0?this:e.create(this._years,this._months,p.safeToInt(p.safeAdd(this._days,r)))},n.minus=function(r){var o=e.from(r);return e.create(p.safeSubtract(this._years,o._years),p.safeSubtract(this._months,o._months),p.safeSubtract(this._days,o._days))},n.minusYears=function(r){return this.plusYears(-1*r)},n.minusMonths=function(r){return this.plusMonths(-1*r)},n.minusDays=function(r){return this.plusDays(-1*r)},n.multipliedBy=function(r){return this===e.ZERO||r===1?this:e.create(p.safeMultiply(this._years,r),p.safeMultiply(this._months,r),p.safeMultiply(this._days,r))},n.negated=function(){return this.multipliedBy(-1)},n.normalized=function(){var r=this.toTotalMonths(),o=p.intDiv(r,12),s=p.intMod(r,12);return o===this._years&&s===this._months?this:e.create(p.safeToInt(o),s,this._days)},n.toTotalMonths=function(){return this._years*12+this._months},n.addTo=function(r){return C(r,"temporal"),this._years!==0?this._months!==0?r=r.plus(this.toTotalMonths(),T.MONTHS):r=r.plus(this._years,T.YEARS):this._months!==0&&(r=r.plus(this._months,T.MONTHS)),this._days!==0&&(r=r.plus(this._days,T.DAYS)),r},n.subtractFrom=function(r){return C(r,"temporal"),this._years!==0?this._months!==0?r=r.minus(this.toTotalMonths(),T.MONTHS):r=r.minus(this._years,T.YEARS):this._months!==0&&(r=r.minus(this._months,T.MONTHS)),this._days!==0&&(r=r.minus(this._days,T.DAYS)),r},n.equals=function(r){if(this===r)return!0;if(r instanceof e){var o=r;return this._years===o._years&&this._months===o._months&&this._days===o._days}return!1},n.hashCode=function(){return p.hashCode(this._years,this._months,this._days)},n.toString=function(){if(this===e.ZERO)return"P0D";var r="P";return this._years!==0&&(r+=this._years+"Y"),this._months!==0&&(r+=this._months+"M"),this._days!==0&&(r+=this._days+"D"),r},n.toJSON=function(){return this.toString()},e})(Eo);uO=(function(){function t(n){this._index=n,this._errorIndex=-1}var e=t.prototype;return e.getIndex=function(){return this._index},e.setIndex=function(i){this._index=i},e.getErrorIndex=function(){return this._errorIndex},e.setErrorIndex=function(i){this._errorIndex=i},t})();_$=(function(){function t(){this._map={}}var e=t.prototype;return e.putAll=function(i){for(var r in i._map)this._map[r]=i._map[r];return this},e.containsKey=function(i){return this._map.hasOwnProperty(i.name())&&this.get(i)!==void 0},e.get=function(i){return this._map[i.name()]},e.put=function(i,r){return this.set(i,r)},e.set=function(i,r){return this._map[i.name()]=r,this},e.retainAll=function(i){for(var r={},o=0;o<i.length;o++){var s=i[o].name();r[s]=this._map[s]}return this._map=r,this},e.remove=function(i){var r=i.name(),o=this._map[r];return this._map[r]=void 0,o},e.keySet=function(){return this._map},e.clear=function(){this._map={}},t})(),ce=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}return e})(Kc);ce.STRICT=new ce("STRICT");ce.SMART=new ce("SMART");ce.LENIENT=new ce("LENIENT");An=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.isSupported=function(r){se("isSupported")},n.minus=function(r,o){return arguments.length<2?this._minusAmount(r):this._minusUnit(r,o)},n._minusAmount=function(r){return C(r,"amount"),J(r,Eo,"amount"),r.subtractFrom(this)},n._minusUnit=function(r,o){return C(r,"amountToSubtract"),C(o,"unit"),J(o,li,"unit"),this._plusUnit(-r,o)},n.plus=function(r,o){return arguments.length<2?this._plusAmount(r):this._plusUnit(r,o)},n._plusAmount=function(r){return C(r,"amount"),J(r,Eo,"amount"),r.addTo(this)},n._plusUnit=function(r,o){se("_plusUnit")},n.until=function(r,o){se("until")},n.with=function(r,o){return arguments.length<2?this._withAdjuster(r):this._withField(r,o)},n._withAdjuster=function(r){return C(r,"adjuster"),Ue(typeof r.adjustInto=="function","adjuster must be a TemporalAdjuster",Z),r.adjustInto(this)},n._withField=function(r,o){se("_withField")},e})(xi);typeof Symbol<"u"&&Symbol.toPrimitive&&(An.prototype[Symbol.toPrimitive]=function(t){if(t!=="number")return this.toString();throw new TypeError("A conversion from Temporal to a number is not allowed. To compare use the methods .equals(), .compareTo(), .isBefore() or one that is more suitable to your use case.")});$c=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.isSupported=function(r){return r instanceof h||r instanceof T?r.isDateBased():r!=null&&r.isSupportedBy(this)},n.query=function(r){return r===k.chronology()?this.chronology():r===k.precision()?T.DAYS:r===k.localDate()?ee.ofEpochDay(this.toEpochDay()):r===k.localTime()||r===k.zone()||r===k.zoneId()||r===k.offset()?null:t.prototype.query.call(this,r)},n.adjustInto=function(r){return r.with(h.EPOCH_DAY,this.toEpochDay())},n.format=function(r){return C(r,"formatter"),J(r,fe,"formatter"),r.format(this)},e})(An);oi=(function(){function t(){}return t.startsWith=function(n,i){return n.indexOf(i)===0},t.hashCode=function(n){var i=n.length;if(i===0)return 0;for(var r=0,o=0;o<i;o++){var s=n.charCodeAt(o);r=(r<<5)-r+s,r|=0}return p.smi(r)},t})();Pe=(function(){function t(){}t.systemDefault=function(){throw new $("not supported operation")},t.getAvailableZoneIds=function(){throw new $("not supported operation")},t.of=function(i){throw new $("not supported operation"+i)},t.ofOffset=function(i,r){throw new $("not supported operation"+i+r)},t.from=function(i){throw new $("not supported operation"+i)};var e=t.prototype;return e.id=function(){se("ZoneId.id")},e.rules=function(){se("ZoneId.rules")},e.normalized=function(){var i=this.rules();return i.isFixedOffset()?i.offset(Ye.EPOCH):this},e.equals=function(i){return this===i?!0:i instanceof t?this.id()===i.id():!1},e.hashCode=function(){return oi.hashCode(this.id())},e.toString=function(){return this.id()},e.toJSON=function(){return this.toString()},t})(),Oh=(function(){function t(){}t.of=function(i){return C(i,"offset"),new nEe(i)};var e=t.prototype;return e.isFixedOffset=function(){se("ZoneRules.isFixedOffset")},e.offset=function(i){return i instanceof Ye?this.offsetOfInstant(i):this.offsetOfLocalDateTime(i)},e.offsetOfInstant=function(i){se("ZoneRules.offsetInstant")},e.offsetOfEpochMilli=function(i){se("ZoneRules.offsetOfEpochMilli")},e.offsetOfLocalDateTime=function(i){se("ZoneRules.offsetLocalDateTime")},e.validOffsets=function(i){se("ZoneRules.validOffsets")},e.transition=function(i){se("ZoneRules.transition")},e.standardOffset=function(i){se("ZoneRules.standardOffset")},e.daylightSavings=function(i){se("ZoneRules.daylightSavings")},e.isDaylightSavings=function(i){se("ZoneRules.isDaylightSavings")},e.isValidOffset=function(i,r){se("ZoneRules.isValidOffset")},e.nextTransition=function(i){se("ZoneRules.nextTransition")},e.previousTransition=function(i){se("ZoneRules.previousTransition")},e.transitions=function(){se("ZoneRules.transitions")},e.transitionRules=function(){se("ZoneRules.transitionRules")},e.toString=function(){se("ZoneRules.toString")},e.toJSON=function(){return this.toString()},t})(),nEe=(function(t){le(e,t);function e(i){var r;return r=t.call(this)||this,r._offset=i,r}var n=e.prototype;return n.isFixedOffset=function(){return!0},n.offsetOfInstant=function(){return this._offset},n.offsetOfEpochMilli=function(){return this._offset},n.offsetOfLocalDateTime=function(){return this._offset},n.validOffsets=function(){return[this._offset]},n.transition=function(){return null},n.standardOffset=function(){return this._offset},n.daylightSavings=function(){return ot.ZERO},n.isDaylightSavings=function(){return!1},n.isValidOffset=function(r,o){return this._offset.equals(o)},n.nextTransition=function(){return null},n.previousTransition=function(){return null},n.transitions=function(){return[]},n.transitionRules=function(){return[]},n.equals=function(r){return this===r?!0:r instanceof e?this._offset.equals(r._offset):!1},n.toString=function(){return"FixedRules:"+this._offset.toString()},e})(Oh),d$={},h$={},ae=(function(t){le(e,t);function e(i){var r;return r=t.call(this)||this,e._validateTotalSeconds(i),r._totalSeconds=p.safeToInt(i),r._rules=Oh.of(Ih(r)),r._id=e._buildId(i),r}var n=e.prototype;return n.totalSeconds=function(){return this._totalSeconds},n.id=function(){return this._id},e._buildId=function(r){if(r===0)return"Z";var o=Math.abs(r),s=p.intDiv(o,v.SECONDS_PER_HOUR),a=p.intMod(p.intDiv(o,v.SECONDS_PER_MINUTE),v.MINUTES_PER_HOUR),c=(r<0?"-":"+")+(s<10?"0":"")+s+(a<10?":0":":")+a,u=p.intMod(o,v.SECONDS_PER_MINUTE);return u!==0&&(c+=(u<10?":0":":")+u),c},e._validateTotalSeconds=function(r){if(Math.abs(r)>e.MAX_SECONDS)throw new $("Zone offset not in valid range: -18:00 to +18:00")},e._validate=function(r,o,s){if(r<-18||r>18)throw new $("Zone offset hours not in valid range: value "+r+" is not in the range -18 to 18");if(r>0){if(o<0||s<0)throw new $("Zone offset minutes and seconds must be positive because hours is positive")}else if(r<0){if(o>0||s>0)throw new $("Zone offset minutes and seconds must be negative because hours is negative")}else if(o>0&&s<0||o<0&&s>0)throw new $("Zone offset minutes and seconds must have the same sign");if(Math.abs(o)>59)throw new $("Zone offset minutes not in valid range: abs(value) "+Math.abs(o)+" is not in the range 0 to 59");if(Math.abs(s)>59)throw new $("Zone offset seconds not in valid range: abs(value) "+Math.abs(s)+" is not in the range 0 to 59");if(Math.abs(r)===18&&(Math.abs(o)>0||Math.abs(s)>0))throw new $("Zone offset not in valid range: -18:00 to +18:00")},e.of=function(r){C(r,"offsetId");var o=h$[r];if(o!=null)return o;var s,a,c;switch(r.length){case 2:r=r[0]+"0"+r[1];case 3:s=e._parseNumber(r,1,!1),a=0,c=0;break;case 5:s=e._parseNumber(r,1,!1),a=e._parseNumber(r,3,!1),c=0;break;case 6:s=e._parseNumber(r,1,!1),a=e._parseNumber(r,4,!0),c=0;break;case 7:s=e._parseNumber(r,1,!1),a=e._parseNumber(r,3,!1),c=e._parseNumber(r,5,!1);break;case 9:s=e._parseNumber(r,1,!1),a=e._parseNumber(r,4,!0),c=e._parseNumber(r,7,!0);break;default:throw new $("Invalid ID for ZoneOffset, invalid format: "+r)}var u=r[0];if(u!=="+"&&u!=="-")throw new $("Invalid ID for ZoneOffset, plus/minus not found when expected: "+r);return u==="-"?e.ofHoursMinutesSeconds(-s,-a,-c):e.ofHoursMinutesSeconds(s,a,c)},e._parseNumber=function(r,o,s){if(s&&r[o-1]!==":")throw new $("Invalid ID for ZoneOffset, colon not found when expected: "+r);var a=r[o],c=r[o+1];if(a<"0"||a>"9"||c<"0"||c>"9")throw new $("Invalid ID for ZoneOffset, non numeric characters found: "+r);return(a.charCodeAt(0)-48)*10+(c.charCodeAt(0)-48)},e.ofHours=function(r){return e.ofHoursMinutesSeconds(r,0,0)},e.ofHoursMinutes=function(r,o){return e.ofHoursMinutesSeconds(r,o,0)},e.ofHoursMinutesSeconds=function(r,o,s){e._validate(r,o,s);var a=r*v.SECONDS_PER_HOUR+o*v.SECONDS_PER_MINUTE+s;return e.ofTotalSeconds(a)},e.ofTotalMinutes=function(r){var o=r*v.SECONDS_PER_MINUTE;return e.ofTotalSeconds(o)},e.ofTotalSeconds=function(r){if(r%(15*v.SECONDS_PER_MINUTE)===0){var o=r,s=d$[o];return s==null&&(s=new e(r),d$[o]=s,h$[s.id()]=s),s}else return new e(r)},n.rules=function(){return this._rules},n.get=function(r){return this.getLong(r)},n.getLong=function(r){if(r===h.OFFSET_SECONDS)return this._totalSeconds;if(r instanceof h)throw new $("Unsupported field: "+r);return r.getFrom(this)},n.query=function(r){return C(r,"query"),r===k.offset()||r===k.zone()?this:r===k.localDate()||r===k.localTime()||r===k.precision()||r===k.chronology()||r===k.zoneId()?null:r.queryFrom(this)},n.adjustInto=function(r){return r.with(h.OFFSET_SECONDS,this._totalSeconds)},n.compareTo=function(r){return C(r,"other"),r._totalSeconds-this._totalSeconds},n.equals=function(r){return this===r?!0:r instanceof e?this._totalSeconds===r._totalSeconds:!1},n.hashCode=function(){return this._totalSeconds},n.toString=function(){return this._id},e})(Pe);lE=(function(t){le(e,t),e.create=function(r,o){var s=new e;return s._addFieldValue(r,o),s};function e(){var i;return i=t.call(this)||this,i.fieldValues=new _$,i.chrono=null,i.zone=null,i.date=null,i.time=null,i.leapSecond=!1,i.excessDays=null,i}var n=e.prototype;return n.getFieldValue0=function(r){return this.fieldValues.get(r)},n._addFieldValue=function(r,o){C(r,"field");var s=this.getFieldValue0(r);if(s!=null&&s!==o)throw new $("Conflict found: "+r+" "+s+" differs from "+r+" "+o+": "+this);return this._putFieldValue0(r,o)},n._putFieldValue0=function(r,o){return this.fieldValues.put(r,o),this},n.resolve=function(r,o){return o!=null&&this.fieldValues.retainAll(o),this._mergeDate(r),this._mergeTime(r),this._resolveTimeInferZeroes(r),this.excessDays!=null&&this.excessDays.isZero()===!1&&this.date!=null&&this.time!=null&&(this.date=this.date.plus(this.excessDays),this.excessDays=si.ZERO),this._resolveInstant(),this},n._mergeDate=function(r){this._checkDate(Ne.INSTANCE.resolveDate(this.fieldValues,r))},n._checkDate=function(r){if(r!=null){this._addObject(r);for(var o in this.fieldValues.keySet()){var s=h.byName(o);if(s&&this.fieldValues.get(s)!==void 0&&s.isDateBased()){var a=void 0;try{a=r.getLong(s)}catch(u){if(u instanceof $)continue;throw u}var c=this.fieldValues.get(s);if(a!==c)throw new $("Conflict found: Field "+s+" "+a+" differs from "+s+" "+c+" derived from "+r)}}}},n._mergeTime=function(r){if(this.fieldValues.containsKey(h.CLOCK_HOUR_OF_DAY)){var o=this.fieldValues.remove(h.CLOCK_HOUR_OF_DAY);r!==ce.LENIENT&&(r===ce.SMART&&o===0||h.CLOCK_HOUR_OF_DAY.checkValidValue(o)),this._addFieldValue(h.HOUR_OF_DAY,o===24?0:o)}if(this.fieldValues.containsKey(h.CLOCK_HOUR_OF_AMPM)){var s=this.fieldValues.remove(h.CLOCK_HOUR_OF_AMPM);r!==ce.LENIENT&&(r===ce.SMART&&s===0||h.CLOCK_HOUR_OF_AMPM.checkValidValue(s)),this._addFieldValue(h.HOUR_OF_AMPM,s===12?0:s)}if(r!==ce.LENIENT&&(this.fieldValues.containsKey(h.AMPM_OF_DAY)&&h.AMPM_OF_DAY.checkValidValue(this.fieldValues.get(h.AMPM_OF_DAY)),this.fieldValues.containsKey(h.HOUR_OF_AMPM)&&h.HOUR_OF_AMPM.checkValidValue(this.fieldValues.get(h.HOUR_OF_AMPM))),this.fieldValues.containsKey(h.AMPM_OF_DAY)&&this.fieldValues.containsKey(h.HOUR_OF_AMPM)){var a=this.fieldValues.remove(h.AMPM_OF_DAY),c=this.fieldValues.remove(h.HOUR_OF_AMPM);this._addFieldValue(h.HOUR_OF_DAY,a*12+c)}if(this.fieldValues.containsKey(h.NANO_OF_DAY)){var u=this.fieldValues.remove(h.NANO_OF_DAY);r!==ce.LENIENT&&h.NANO_OF_DAY.checkValidValue(u),this._addFieldValue(h.SECOND_OF_DAY,p.intDiv(u,1e9)),this._addFieldValue(h.NANO_OF_SECOND,p.intMod(u,1e9))}if(this.fieldValues.containsKey(h.MICRO_OF_DAY)){var l=this.fieldValues.remove(h.MICRO_OF_DAY);r!==ce.LENIENT&&h.MICRO_OF_DAY.checkValidValue(l),this._addFieldValue(h.SECOND_OF_DAY,p.intDiv(l,1e6)),this._addFieldValue(h.MICRO_OF_SECOND,p.intMod(l,1e6))}if(this.fieldValues.containsKey(h.MILLI_OF_DAY)){var d=this.fieldValues.remove(h.MILLI_OF_DAY);r!==ce.LENIENT&&h.MILLI_OF_DAY.checkValidValue(d),this._addFieldValue(h.SECOND_OF_DAY,p.intDiv(d,1e3)),this._addFieldValue(h.MILLI_OF_SECOND,p.intMod(d,1e3))}if(this.fieldValues.containsKey(h.SECOND_OF_DAY)){var f=this.fieldValues.remove(h.SECOND_OF_DAY);r!==ce.LENIENT&&h.SECOND_OF_DAY.checkValidValue(f),this._addFieldValue(h.HOUR_OF_DAY,p.intDiv(f,3600)),this._addFieldValue(h.MINUTE_OF_HOUR,p.intMod(p.intDiv(f,60),60)),this._addFieldValue(h.SECOND_OF_MINUTE,p.intMod(f,60))}if(this.fieldValues.containsKey(h.MINUTE_OF_DAY)){var m=this.fieldValues.remove(h.MINUTE_OF_DAY);r!==ce.LENIENT&&h.MINUTE_OF_DAY.checkValidValue(m),this._addFieldValue(h.HOUR_OF_DAY,p.intDiv(m,60)),this._addFieldValue(h.MINUTE_OF_HOUR,p.intMod(m,60))}if(r!==ce.LENIENT&&(this.fieldValues.containsKey(h.MILLI_OF_SECOND)&&h.MILLI_OF_SECOND.checkValidValue(this.fieldValues.get(h.MILLI_OF_SECOND)),this.fieldValues.containsKey(h.MICRO_OF_SECOND)&&h.MICRO_OF_SECOND.checkValidValue(this.fieldValues.get(h.MICRO_OF_SECOND))),this.fieldValues.containsKey(h.MILLI_OF_SECOND)&&this.fieldValues.containsKey(h.MICRO_OF_SECOND)){var _=this.fieldValues.remove(h.MILLI_OF_SECOND),E=this.fieldValues.get(h.MICRO_OF_SECOND);this._putFieldValue0(h.MICRO_OF_SECOND,_*1e3+p.intMod(E,1e3))}if(this.fieldValues.containsKey(h.MICRO_OF_SECOND)&&this.fieldValues.containsKey(h.NANO_OF_SECOND)){var I=this.fieldValues.get(h.NANO_OF_SECOND);this._putFieldValue0(h.MICRO_OF_SECOND,p.intDiv(I,1e3)),this.fieldValues.remove(h.MICRO_OF_SECOND)}if(this.fieldValues.containsKey(h.MILLI_OF_SECOND)&&this.fieldValues.containsKey(h.NANO_OF_SECOND)){var y=this.fieldValues.get(h.NANO_OF_SECOND);this._putFieldValue0(h.MILLI_OF_SECOND,p.intDiv(y,1e6)),this.fieldValues.remove(h.MILLI_OF_SECOND)}if(this.fieldValues.containsKey(h.MICRO_OF_SECOND)){var A=this.fieldValues.remove(h.MICRO_OF_SECOND);this._putFieldValue0(h.NANO_OF_SECOND,A*1e3)}else if(this.fieldValues.containsKey(h.MILLI_OF_SECOND)){var S=this.fieldValues.remove(h.MILLI_OF_SECOND);this._putFieldValue0(h.NANO_OF_SECOND,S*1e6)}},n._resolveTimeInferZeroes=function(r){var o=this.fieldValues.get(h.HOUR_OF_DAY),s=this.fieldValues.get(h.MINUTE_OF_HOUR),a=this.fieldValues.get(h.SECOND_OF_MINUTE),c=this.fieldValues.get(h.NANO_OF_SECOND);if(o!=null&&!(s==null&&(a!=null||c!=null))&&!(s!=null&&a==null&&c!=null)){if(r!==ce.LENIENT){if(o!=null){r===ce.SMART&&o===24&&(s==null||s===0)&&(a==null||a===0)&&(c==null||c===0)&&(o=0,this.excessDays=si.ofDays(1));var u=h.HOUR_OF_DAY.checkValidIntValue(o);if(s!=null){var l=h.MINUTE_OF_HOUR.checkValidIntValue(s);if(a!=null){var d=h.SECOND_OF_MINUTE.checkValidIntValue(a);if(c!=null){var f=h.NANO_OF_SECOND.checkValidIntValue(c);this._addObject(v.of(u,l,d,f))}else this._addObject(v.of(u,l,d))}else c==null&&this._addObject(v.of(u,l))}else a==null&&c==null&&this._addObject(v.of(u,0))}}else if(o!=null){var m=o;if(s!=null)if(a!=null){c==null&&(c=0);var _=p.safeMultiply(m,36e11);_=p.safeAdd(_,p.safeMultiply(s,6e10)),_=p.safeAdd(_,p.safeMultiply(a,1e9)),_=p.safeAdd(_,c);var E=p.floorDiv(_,864e11),I=p.floorMod(_,864e11);this._addObject(v.ofNanoOfDay(I)),this.excessDays=si.ofDays(E)}else{var y=p.safeMultiply(m,3600);y=p.safeAdd(y,p.safeMultiply(s,60));var A=p.floorDiv(y,86400),S=p.floorMod(y,86400);this._addObject(v.ofSecondOfDay(S)),this.excessDays=si.ofDays(A)}else{var w=p.safeToInt(p.floorDiv(m,24));m=p.floorMod(m,24),this._addObject(v.of(m,0)),this.excessDays=si.ofDays(w)}}this.fieldValues.remove(h.HOUR_OF_DAY),this.fieldValues.remove(h.MINUTE_OF_HOUR),this.fieldValues.remove(h.SECOND_OF_MINUTE),this.fieldValues.remove(h.NANO_OF_SECOND)}},n._addObject=function(r){r instanceof $c?this.date=r:r instanceof v&&(this.time=r)},n._resolveInstant=function(){if(this.date!=null&&this.time!=null){var r=this.fieldValues.get(h.OFFSET_SECONDS);if(r!=null){var o=ae.ofTotalSeconds(r),s=this.date.atTime(this.time).atZone(o).getLong(h.INSTANT_SECONDS);this.fieldValues.put(h.INSTANT_SECONDS,s)}else if(this.zone!=null){var a=this.date.atTime(this.time).atZone(this.zone).getLong(h.INSTANT_SECONDS);this.fieldValues.put(h.INSTANT_SECONDS,a)}}},n.build=function(r){return r.queryFrom(this)},n.isSupported=function(r){return r==null?!1:this.fieldValues.containsKey(r)&&this.fieldValues.get(r)!==void 0||this.date!=null&&this.date.isSupported(r)||this.time!=null&&this.time.isSupported(r)},n.getLong=function(r){C(r,"field");var o=this.getFieldValue0(r);if(o==null){if(this.date!=null&&this.date.isSupported(r))return this.date.getLong(r);if(this.time!=null&&this.time.isSupported(r))return this.time.getLong(r);throw new $("Field not found: "+r)}return o},n.query=function(r){return r===k.zoneId()?this.zone:r===k.chronology()?this.chrono:r===k.localDate()?this.date!=null?ee.from(this.date):null:r===k.localTime()?this.time:r===k.zone()||r===k.offset()?r.queryFrom(this):r===k.precision()?null:r.queryFrom(this)},e})(xi),y$=(function(){function t(){if(arguments.length===1)if(arguments[0]instanceof t){this._constructorSelf.apply(this,arguments);return}else this._constructorFormatter.apply(this,arguments);else this._constructorParam.apply(this,arguments);this._caseSensitive=!0,this._strict=!0,this._parsed=[new f$(this)]}var e=t.prototype;return e._constructorParam=function(i,r,o){this._locale=i,this._symbols=r,this._overrideChronology=o},e._constructorFormatter=function(i){this._locale=i.locale(),this._symbols=i.decimalStyle(),this._overrideChronology=i.chronology()},e._constructorSelf=function(i){this._locale=i._locale,this._symbols=i._symbols,this._overrideChronology=i._overrideChronology,this._overrideZone=i._overrideZone,this._caseSensitive=i._caseSensitive,this._strict=i._strict,this._parsed=[new f$(this)]},e.copy=function(){return new t(this)},e.symbols=function(){return this._symbols},e.isStrict=function(){return this._strict},e.setStrict=function(i){this._strict=i},e.locale=function(){return this._locale},e.setLocale=function(i){this._locale=i},e.startOptional=function(){this._parsed.push(this.currentParsed().copy())},e.endOptional=function(i){i?this._parsed.splice(this._parsed.length-2,1):this._parsed.splice(this._parsed.length-1,1)},e.isCaseSensitive=function(){return this._caseSensitive},e.setCaseSensitive=function(i){this._caseSensitive=i},e.subSequenceEquals=function(i,r,o,s,a){if(r+a>i.length||s+a>o.length)return!1;this.isCaseSensitive()||(i=i.toLowerCase(),o=o.toLowerCase());for(var c=0;c<a;c++){var u=i[r+c],l=o[s+c];if(u!==l)return!1}return!0},e.charEquals=function(i,r){return this.isCaseSensitive()?i===r:this.charEqualsIgnoreCase(i,r)},e.charEqualsIgnoreCase=function(i,r){return i===r||i.toLowerCase()===r.toLowerCase()},e.setParsedField=function(i,r,o,s){var a=this.currentParsed().fieldValues,c=a.get(i);return a.set(i,r),c!=null&&c!==r?~o:s},e.setParsedZone=function(i){C(i,"zone"),this.currentParsed().zone=i},e.getParsed=function(i){return this.currentParsed().fieldValues.get(i)},e.toParsed=function(){return this.currentParsed()},e.currentParsed=function(){return this._parsed[this._parsed.length-1]},e.setParsedLeapSecond=function(){this.currentParsed().leapSecond=!0},e.getEffectiveChronology=function(){var i=this.currentParsed().chrono;return i==null&&(i=this._overrideChronology,i==null&&(i=Ne.INSTANCE)),i},t})(),f$=(function(t){le(e,t);function e(i){var r;return r=t.call(this)||this,r.chrono=null,r.zone=null,r.fieldValues=new _$,r.leapSecond=!1,r.dateTimeParseContext=i,r}var n=e.prototype;return n.copy=function(){var r=new e;return r.chrono=this.chrono,r.zone=this.zone,r.fieldValues.putAll(this.fieldValues),r.leapSecond=this.leapSecond,r.dateTimeParseContext=this.dateTimeParseContext,r},n.toString=function(){return this.fieldValues+", "+this.chrono+", "+this.zone},n.isSupported=function(r){return this.fieldValues.containsKey(r)},n.get=function(r){var o=this.fieldValues.get(r);return Ue(o!=null),o},n.query=function(r){return r===k.chronology()?this.chrono:r===k.zoneId()||r===k.zone()?this.zone:t.prototype.query.call(this,r)},n.toBuilder=function(){var r=new lE;return r.fieldValues.putAll(this.fieldValues),r.chrono=this.dateTimeParseContext.getEffectiveChronology(),this.zone!=null?r.zone=this.zone:r.zone=this.overrideZone,r.leapSecond=this.leapSecond,r.excessDays=this.excessDays,r},e})(An);E$=(function(){function t(n,i,r){arguments.length===2&&arguments[1]instanceof fe?(this._temporal=t.adjust(n,i),this._locale=i.locale(),this._symbols=i.decimalStyle()):(this._temporal=n,this._locale=i,this._symbols=r),this._optional=0}t.adjust=function(i,r){return i};var e=t.prototype;return e.symbols=function(){return this._symbols},e.startOptional=function(){this._optional++},e.endOptional=function(){this._optional--},e.getValueQuery=function(i){var r=this._temporal.query(i);if(r==null&&this._optional===0)throw new $("Unable to extract value: "+this._temporal);return r},e.getValue=function(i){try{return this._temporal.getLong(i)}catch(r){if(r instanceof $&&this._optional>0)return null;throw r}},e.temporal=function(){return this._temporal},e.locale=function(){return this._locale},e.setDateTime=function(i){this._temporal=i},e.setLocale=function(i){this._locale=i},t})(),hr={},iEe=[0,90,181,273,0,91,182,274],ai=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.isDateBased=function(){return!0},n.isTimeBased=function(){return!1},n._isIso=function(){return!0},e._getWeekRangeByLocalDate=function(r){var o=e._getWeekBasedYear(r);return ue.of(1,e._getWeekRangeByYear(o))},e._getWeekRangeByYear=function(r){var o=ee.of(r,1,1);return o.dayOfWeek()===je.THURSDAY||o.dayOfWeek()===je.WEDNESDAY&&o.isLeapYear()?53:52},e._getWeek=function(r){var o=r.dayOfWeek().ordinal(),s=r.dayOfYear()-1,a=s+(3-o),c=p.intDiv(a,7),u=a-c*7,l=u-3;if(l<-3&&(l+=7),s<l)return e._getWeekRangeByLocalDate(r.withDayOfYear(180).minusYears(1)).maximum();var d=p.intDiv(s-l,7)+1;return d===53&&(l===-3||l===-2&&r.isLeapYear())===!1&&(d=1),d},e._getWeekBasedYear=function(r){var o=r.year(),s=r.dayOfYear();if(s<=3){var a=r.dayOfWeek().ordinal();s-a<-2&&o--}else if(s>=363){var c=r.dayOfWeek().ordinal();s=s-363-(r.isLeapYear()?1:0),s-c>=0&&o++}return o},n.displayName=function(){return this.toString()},n.resolve=function(){return null},n.name=function(){return this.toString()},e})(Mr),oEe=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(){return"DayOfQuarter"},n.baseUnit=function(){return T.DAYS},n.rangeUnit=function(){return Gc},n.range=function(){return ue.of(1,90,92)},n.isSupportedBy=function(r){return r.isSupported(h.DAY_OF_YEAR)&&r.isSupported(h.MONTH_OF_YEAR)&&r.isSupported(h.YEAR)&&this._isIso(r)},n.rangeRefinedBy=function(r){if(r.isSupported(this)===!1)throw new _e("Unsupported field: DayOfQuarter");var o=r.getLong(ps);if(o===1){var s=r.getLong(h.YEAR);return Ne.isLeapYear(s)?ue.of(1,91):ue.of(1,90)}else{if(o===2)return ue.of(1,91);if(o===3||o===4)return ue.of(1,92)}return this.range()},n.getFrom=function(r){if(r.isSupported(this)===!1)throw new _e("Unsupported field: DayOfQuarter");var o=r.get(h.DAY_OF_YEAR),s=r.get(h.MONTH_OF_YEAR),a=r.getLong(h.YEAR);return o-iEe[p.intDiv(s-1,3)+(Ne.isLeapYear(a)?4:0)]},n.adjustInto=function(r,o){var s=this.getFrom(r);return this.range().checkValidValue(o,this),r.with(h.DAY_OF_YEAR,r.getLong(h.DAY_OF_YEAR)+(o-s))},n.resolve=function(r,o,s){var a=r.get(h.YEAR),c=r.get(ps);if(a==null||c==null)return null;var u=h.YEAR.checkValidIntValue(a),l=r.get(tO),d;if(s===ce.LENIENT){var f=c;d=ee.of(u,1,1),d=d.plusMonths(p.safeMultiply(p.safeSubtract(f,1),3)),d=d.plusDays(p.safeSubtract(l,1))}else{var m=ps.range().checkValidIntValue(c,ps);if(s===ce.STRICT){var _=92;m===1?_=Ne.isLeapYear(u)?91:90:m===2&&(_=91),ue.of(1,_).checkValidValue(l,this)}else this.range().checkValidValue(l,this);d=ee.of(u,(m-1)*3+1,1).plusDays(l-1)}return r.remove(this),r.remove(h.YEAR),r.remove(ps),d},e})(ai),sEe=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(){return"QuarterOfYear"},n.baseUnit=function(){return Gc},n.rangeUnit=function(){return T.YEARS},n.range=function(){return ue.of(1,4)},n.isSupportedBy=function(r){return r.isSupported(h.MONTH_OF_YEAR)&&this._isIso(r)},n.rangeRefinedBy=function(r){return this.range()},n.getFrom=function(r){if(r.isSupported(this)===!1)throw new _e("Unsupported field: QuarterOfYear");var o=r.getLong(h.MONTH_OF_YEAR);return p.intDiv(o+2,3)},n.adjustInto=function(r,o){var s=this.getFrom(r);return this.range().checkValidValue(o,this),r.with(h.MONTH_OF_YEAR,r.getLong(h.MONTH_OF_YEAR)+(o-s)*3)},e})(ai),aEe=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(){return"WeekOfWeekBasedYear"},n.baseUnit=function(){return T.WEEKS},n.rangeUnit=function(){return zc},n.range=function(){return ue.of(1,52,53)},n.isSupportedBy=function(r){return r.isSupported(h.EPOCH_DAY)&&this._isIso(r)},n.rangeRefinedBy=function(r){if(r.isSupported(this)===!1)throw new _e("Unsupported field: WeekOfWeekBasedYear");return ai._getWeekRangeByLocalDate(ee.from(r))},n.getFrom=function(r){if(r.isSupported(this)===!1)throw new _e("Unsupported field: WeekOfWeekBasedYear");return ai._getWeek(ee.from(r))},n.adjustInto=function(r,o){return this.range().checkValidValue(o,this),r.plus(p.safeSubtract(o,this.getFrom(r)),T.WEEKS)},n.resolve=function(r,o,s){var a=r.get(kr),c=r.get(h.DAY_OF_WEEK);if(a==null||c==null)return null;var u=kr.range().checkValidIntValue(a,kr),l=r.get(nO),d;if(s===ce.LENIENT){var f=c,m=0;f>7?(m=p.intDiv(f-1,7),f=p.intMod(f-1,7)+1):f<1&&(m=p.intDiv(f,7)-1,f=p.intMod(f,7)+7),d=ee.of(u,1,4).plusWeeks(l-1).plusWeeks(m).with(h.DAY_OF_WEEK,f)}else{var _=h.DAY_OF_WEEK.checkValidIntValue(c);if(s===ce.STRICT){var E=ee.of(u,1,4),I=ai._getWeekRangeByLocalDate(E);I.checkValidValue(l,this)}else this.range().checkValidValue(l,this);d=ee.of(u,1,4).plusWeeks(l-1).with(h.DAY_OF_WEEK,_)}return r.remove(this),r.remove(kr),r.remove(h.DAY_OF_WEEK),d},n.displayName=function(){return"Week"},e})(ai),cEe=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(){return"WeekBasedYear"},n.baseUnit=function(){return zc},n.rangeUnit=function(){return T.FOREVER},n.range=function(){return h.YEAR.range()},n.isSupportedBy=function(r){return r.isSupported(h.EPOCH_DAY)&&this._isIso(r)},n.rangeRefinedBy=function(r){return h.YEAR.range()},n.getFrom=function(r){if(r.isSupported(this)===!1)throw new _e("Unsupported field: WeekBasedYear");return ai._getWeekBasedYear(ee.from(r))},n.adjustInto=function(r,o){if(this.isSupportedBy(r)===!1)throw new _e("Unsupported field: WeekBasedYear");var s=this.range().checkValidIntValue(o,kr),a=ee.from(r),c=a.get(h.DAY_OF_WEEK),u=ai._getWeek(a);u===53&&ai._getWeekRangeByYear(s)===52&&(u=52);var l=ee.of(s,1,4),d=c-l.get(h.DAY_OF_WEEK)+(u-1)*7;return l=l.plusDays(d),r.with(l)},e})(ai),p$=(function(t){le(e,t);function e(i,r){var o;return o=t.call(this)||this,o._name=i,o._duration=r,o}var n=e.prototype;return n.duration=function(){return this._duration},n.isDurationEstimated=function(){return!0},n.isDateBased=function(){return!0},n.isTimeBased=function(){return!1},n.isSupportedBy=function(r){return r.isSupported(h.EPOCH_DAY)},n.addTo=function(r,o){switch(this){case zc:{var s=p.safeAdd(r.get(kr),o);return r.with(kr,s)}case Gc:return r.plus(p.intDiv(o,256),T.YEARS).plus(p.intMod(o,256)*3,T.MONTHS);default:throw new Vc("Unreachable")}},n.between=function(r,o){switch(this){case zc:return p.safeSubtract(o.getLong(kr),r.getLong(kr));case Gc:return p.intDiv(r.until(o,T.MONTHS),3);default:throw new Vc("Unreachable")}},n.toString=function(){return this._name},e})(li),tO=null,ps=null,nO=null,kr=null,zc=null,Gc=null;vh=(function(){function t(n,i,r,o){this._zeroDigit=n,this._zeroDigitCharCode=n.charCodeAt(0),this._positiveSign=i,this._negativeSign=r,this._decimalSeparator=o}var e=t.prototype;return e.positiveSign=function(){return this._positiveSign},e.withPositiveSign=function(i){return i===this._positiveSign?this:new t(this._zeroDigit,i,this._negativeSign,this._decimalSeparator)},e.negativeSign=function(){return this._negativeSign},e.withNegativeSign=function(i){return i===this._negativeSign?this:new t(this._zeroDigit,this._positiveSign,i,this._decimalSeparator)},e.zeroDigit=function(){return this._zeroDigit},e.withZeroDigit=function(i){return i===this._zeroDigit?this:new t(i,this._positiveSign,this._negativeSign,this._decimalSeparator)},e.decimalSeparator=function(){return this._decimalSeparator},e.withDecimalSeparator=function(i){return i===this._decimalSeparator?this:new t(this._zeroDigit,this._positiveSign,this._negativeSign,i)},e.convertToDigit=function(i){var r=i.charCodeAt(0)-this._zeroDigitCharCode;return r>=0&&r<=9?r:-1},e.convertNumberToI18N=function(i){if(this._zeroDigit==="0")return i;for(var r=this._zeroDigitCharCode-48,o="",s=0;s<i.length;s++)o+=String.fromCharCode(i.charCodeAt(s)+r);return o},e.equals=function(i){return this===i?!0:i instanceof t?this._zeroDigit===i._zeroDigit&&this._positiveSign===i._positiveSign&&this._negativeSign===i._negativeSign&&this._decimalSeparator===i._decimalSeparator:!1},e.hashCode=function(){return this._zeroDigit+this._positiveSign+this._negativeSign+this._decimalSeparator},e.toString=function(){return"DecimalStyle["+this._zeroDigit+this._positiveSign+this._negativeSign+this._decimalSeparator+"]"},t.of=function(){throw new Error("not yet supported")},t.availableLocales=function(){throw new Error("not yet supported")},t})();vh.STANDARD=new vh("0","+","-",".");Oe=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.parse=function(r,o,s){switch(this){case e.NORMAL:return!r||!o;case e.ALWAYS:case e.EXCEEDS_PAD:return!0;default:return!o&&!s}},e})(Kc);Oe.NORMAL=new Oe("NORMAL");Oe.NEVER=new Oe("NEVER");Oe.ALWAYS=new Oe("ALWAYS");Oe.EXCEEDS_PAD=new Oe("EXCEEDS_PAD");Oe.NOT_NEGATIVE=new Oe("NOT_NEGATIVE");Re=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.isStandalone=function(){switch(this){case e.FULL_STANDALONE:case e.SHORT_STANDALONE:case e.NARROW_STANDALONE:return!0;default:return!1}},n.asStandalone=function(){switch(this){case e.FULL:return e.FULL_STANDALONE;case e.SHORT:return e.SHORT_STANDALONE;case e.NARROW:return e.NARROW_STANDALONE;default:return this}},n.asNormal=function(){switch(this){case e.FULL_STANDALONE:return e.FULL;case e.SHORT_STANDALONE:return e.SHORT;case e.NARROW_STANDALONE:return e.NARROW;default:return this}},e})(Kc);Re.FULL=new Re("FULL");Re.FULL_STANDALONE=new Re("FULL_STANDALONE");Re.SHORT=new Re("SHORT");Re.SHORT_STANDALONE=new Re("SHORT_STANDALONE");Re.NARROW=new Re("NARROW");Re.NARROW_STANDALONE=new Re("NARROW_STANDALONE");T$=(function(){function t(n){if(n.length>1)throw new Z('invalid literal, too long: "'+n+'"');this._literal=n}var e=t.prototype;return e.print=function(i,r){return r.append(this._literal),!0},e.parse=function(i,r,o){var s=r.length;if(o===s)return~o;var a=r.charAt(o);return i.charEquals(this._literal,a)===!1?~o:o+this._literal.length},e.toString=function(){return this._literal==="'"?"''":"'"+this._literal+"'"},t})();rO=(function(){function t(n,i){this._printerParsers=n,this._optional=i}var e=t.prototype;return e.withOptional=function(i){return i===this._optional?this:new t(this._printerParsers,i)},e.print=function(i,r){var o=r.length();this._optional&&i.startOptional();try{for(var s=0;s<this._printerParsers.length;s++){var a=this._printerParsers[s];if(a.print(i,r)===!1)return r.setLength(o),!0}}finally{this._optional&&i.endOptional()}return!0},e.parse=function(i,r,o){if(this._optional){i.startOptional();for(var s=o,a=0;a<this._printerParsers.length;a++){var c=this._printerParsers[a];if(s=c.parse(i,r,s),s<0)return i.endOptional(!1),o}return i.endOptional(!0),s}else{for(var u=0;u<this._printerParsers.length;u++){var l=this._printerParsers[u];if(o=l.parse(i,r,o),o<0)break}return o}},e.toString=function(){var i="";if(this._printerParsers!=null){i+=this._optional?"[":"(";for(var r=0;r<this._printerParsers.length;r++){var o=this._printerParsers[r];i+=o.toString()}i+=this._optional?"]":")"}return i},t})();A$=(function(){function t(n,i,r,o){if(C(n,"field"),n.range().isFixed()===!1)throw new Z("Field must have a fixed set of values: "+n);if(i<0||i>9)throw new Z("Minimum width must be from 0 to 9 inclusive but was "+i);if(r<1||r>9)throw new Z("Maximum width must be from 1 to 9 inclusive but was "+r);if(r<i)throw new Z("Maximum width must exceed or equal the minimum width but "+r+" < "+i);this.field=n,this.minWidth=i,this.maxWidth=r,this.decimalPoint=o}var e=t.prototype;return e.print=function(i,r){var o=i.getValue(this.field);if(o===null)return!1;var s=i.symbols();if(o===0){if(this.minWidth>0){this.decimalPoint&&r.append(s.decimalSeparator());for(var a=0;a<this.minWidth;a++)r.append(s.zeroDigit())}}else{var c=this.convertToFraction(o,s.zeroDigit()),u=Math.min(Math.max(c.length,this.minWidth),this.maxWidth);if(c=c.substr(0,u),c*1>0)for(;c.length>this.minWidth&&c[c.length-1]==="0";)c=c.substr(0,c.length-1);var l=c;l=s.convertNumberToI18N(l),this.decimalPoint&&r.append(s.decimalSeparator()),r.append(l)}return!0},e.parse=function(i,r,o){var s=i.isStrict()?this.minWidth:0,a=i.isStrict()?this.maxWidth:9,c=r.length;if(o===c)return s>0?~o:o;if(this.decimalPoint){if(r[o]!==i.symbols().decimalSeparator())return s>0?~o:o;o++}var u=o+s;if(u>c)return~o;for(var l=Math.min(o+a,c),d=0,f=o;f<l;){var m=r.charAt(f++),_=i.symbols().convertToDigit(m);if(_<0){if(f<u)return~o;f--;break}d=d*10+_}var E=f-o,I=Math.pow(10,E),y=this.convertFromFraction(d,I);return i.setParsedField(this.field,y,o,f)},e.convertToFraction=function(i,r){var o=this.field.range();o.checkValidValue(i,this.field);for(var s=o.minimum(),a=o.maximum()-s+1,c=i-s,u=p.intDiv(c*1e9,a),l=""+u;l.length<9;)l=r+l;return l},e.convertFromFraction=function(i,r){var o=this.field.range(),s=o.minimum(),a=o.maximum()-s+1,c=p.intDiv(i*a,r);return c},e.toString=function(){var i=this.decimalPoint?",DecimalPoint":"";return"Fraction("+this.field+","+this.minWidth+","+this.maxWidth+i+")"},t})(),Xb=15,jc=[0,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],Yc=(function(){function t(n,i,r,o,s){s===void 0&&(s=0),this._field=n,this._minWidth=i,this._maxWidth=r,this._signStyle=o,this._subsequentWidth=s}var e=t.prototype;return e.field=function(){return this._field},e.minWidth=function(){return this._minWidth},e.maxWidth=function(){return this._maxWidth},e.signStyle=function(){return this._signStyle},e.withFixedWidth=function(){return this._subsequentWidth===-1?this:new t(this._field,this._minWidth,this._maxWidth,this._signStyle,-1)},e.withSubsequentWidth=function(i){return new t(this._field,this._minWidth,this._maxWidth,this._signStyle,this._subsequentWidth+i)},e._isFixedWidth=function(){return this._subsequentWidth===-1||this._subsequentWidth>0&&this._minWidth===this._maxWidth&&this._signStyle===Oe.NOT_NEGATIVE},e.print=function(i,r){var o=i.getValue(this._field);if(o==null)return!1;var s=this._getValue(i,o),a=i.symbols(),c=""+Math.abs(s);if(c.length>this._maxWidth)throw new $("Field "+this._field+" cannot be printed as the value "+s+" exceeds the maximum print width of "+this._maxWidth);if(c=a.convertNumberToI18N(c),s>=0)switch(this._signStyle){case Oe.EXCEEDS_PAD:this._minWidth<Xb&&s>=jc[this._minWidth]&&r.append(a.positiveSign());break;case Oe.ALWAYS:r.append(a.positiveSign());break}else switch(this._signStyle){case Oe.NORMAL:case Oe.EXCEEDS_PAD:case Oe.ALWAYS:r.append(a.negativeSign());break;case Oe.NOT_NEGATIVE:throw new $("Field "+this._field+" cannot be printed as the value "+s+" cannot be negative according to the SignStyle")}for(var u=0;u<this._minWidth-c.length;u++)r.append(a.zeroDigit());return r.append(c),!0},e.parse=function(i,r,o){var s=r.length;if(o===s)return~o;Ue(o>=0&&o<s);var a=r.charAt(o),c=!1,u=!1;if(a===i.symbols().positiveSign()){if(this._signStyle.parse(!0,i.isStrict(),this._minWidth===this._maxWidth)===!1)return~o;u=!0,o++}else if(a===i.symbols().negativeSign()){if(this._signStyle.parse(!1,i.isStrict(),this._minWidth===this._maxWidth)===!1)return~o;c=!0,o++}else if(this._signStyle===Oe.ALWAYS&&i.isStrict())return~o;var l=i.isStrict()||this._isFixedWidth()?this._minWidth:1,d=o+l;if(d>s)return~o;for(var f=(i.isStrict()||this._isFixedWidth()?this._maxWidth:9)+Math.max(this._subsequentWidth,0),m=0,_=o,E=0;E<2;E++){for(var I=Math.min(_+f,s);_<I;){var y=r.charAt(_++),A=i.symbols().convertToDigit(y);if(A<0){if(_--,_<d)return~o;break}if(_-o>Xb)throw new fr("number text exceeds length");m=m*10+A}if(this._subsequentWidth>0&&E===0){var S=_-o;f=Math.max(l,S-this._subsequentWidth),_=o,m=0}else break}if(c){if(m===0&&i.isStrict())return~(o-1);m!==0&&(m=-m)}else if(this._signStyle===Oe.EXCEEDS_PAD&&i.isStrict()){var w=_-o;if(u){if(w<=this._minWidth)return~(o-1)}else if(w>this._minWidth)return~o}return this._setValue(i,m,o,_)},e._getValue=function(i,r){return r},e._setValue=function(i,r,o,s){return i.setParsedField(this._field,r,o,s)},e.toString=function(){return this._minWidth===1&&this._maxWidth===Xb&&this._signStyle===Oe.NORMAL?"Value("+this._field+")":this._minWidth===this._maxWidth&&this._signStyle===Oe.NOT_NEGATIVE?"Value("+this._field+","+this._minWidth+")":"Value("+this._field+","+this._minWidth+","+this._maxWidth+","+this._signStyle+")"},t})(),wh=(function(t){le(e,t);function e(i,r,o,s,a){var c;if(c=t.call(this,i,r,o,Oe.NOT_NEGATIVE)||this,r<1||r>10)throw new Z("The width must be from 1 to 10 inclusive but was "+r);if(o<1||o>10)throw new Z("The maxWidth must be from 1 to 10 inclusive but was "+o);if(o<r)throw new Z("The maxWidth must be greater than the width");if(a===null){if(i.range().isValidValue(s)===!1)throw new Z("The base value must be within the range of the field");if(s+jc[r]>p.MAX_SAFE_INTEGER)throw new $("Unable to add printer-parser as the range exceeds the capacity of an int")}return c._baseValue=s,c._baseDate=a,c}var n=e.prototype;return n._getValue=function(r,o){var s=Math.abs(o),a=this._baseValue;if(this._baseDate!==null){r.temporal();var c=Ne.INSTANCE;a=c.date(this._baseDate).get(this._field)}return o>=a&&o<a+jc[this._minWidth]?s%jc[this._minWidth]:s%jc[this._maxWidth]},n._setValue=function(r,o,s,a){var c=this._baseValue;if(this._baseDate!=null){var u=r.getEffectiveChronology();c=u.date(this._baseDate).get(this._field)}var l=a-s;if(l===this._minWidth&&o>=0){var d=jc[this._minWidth],f=c%d,m=c-f;c>0?o=m+o:o=m-o,o<c&&(o+=d)}return r.setParsedField(this._field,o,s,a)},n.withFixedWidth=function(){return this._subsequentWidth===-1?this:new e(this._field,this._minWidth,this._maxWidth,this._baseValue,this._baseDate)},n.withSubsequentWidth=function(r){return new e(this._field,this._minWidth,this._maxWidth,this._baseValue,this._baseDate,this._subsequentWidth+r)},n.isFixedWidth=function(r){return r.isStrict()===!1?!1:t.prototype.isFixedWidth.call(this,r)},n.toString=function(){return"ReducedValue("+this._field+","+this._minWidth+","+this._maxWidth+","+(this._baseDate!=null?this._baseDate:this._baseValue)+")"},e})(Yc);cE=["+HH","+HHmm","+HH:mm","+HHMM","+HH:MM","+HHMMss","+HH:MM:ss","+HHMMSS","+HH:MM:SS"],ci=(function(){function t(n,i){C(n,"noOffsetText"),C(i,"pattern"),this.noOffsetText=n,this.type=this._checkPattern(i)}var e=t.prototype;return e._checkPattern=function(i){for(var r=0;r<cE.length;r++)if(cE[r]===i)return r;throw new Z("Invalid zone offset pattern: "+i)},e.print=function(i,r){var o=i.getValue(h.OFFSET_SECONDS);if(o==null)return!1;var s=p.safeToInt(o);if(s===0)r.append(this.noOffsetText);else{var a=Math.abs(p.intMod(p.intDiv(s,3600),100)),c=Math.abs(p.intMod(p.intDiv(s,60),60)),u=Math.abs(p.intMod(s,60)),l=r.length(),d=a;r.append(s<0?"-":"+").appendChar(p.intDiv(a,10)+"0").appendChar(p.intMod(a,10)+"0"),(this.type>=3||this.type>=1&&c>0)&&(r.append(this.type%2===0?":":"").appendChar(p.intDiv(c,10)+"0").appendChar(c%10+"0"),d+=c,(this.type>=7||this.type>=5&&u>0)&&(r.append(this.type%2===0?":":"").appendChar(p.intDiv(u,10)+"0").appendChar(u%10+"0"),d+=u)),d===0&&(r.setLength(l),r.append(this.noOffsetText))}return!0},e.parse=function(i,r,o){var s=r.length,a=this.noOffsetText.length;if(a===0){if(o===s)return i.setParsedField(h.OFFSET_SECONDS,0,o,o)}else{if(o===s)return~o;if(i.subSequenceEquals(r,o,this.noOffsetText,0,a))return i.setParsedField(h.OFFSET_SECONDS,0,o,o+a)}var c=r[o];if(c==="+"||c==="-"){var u=c==="-"?-1:1,l=[0,0,0,0];if(l[0]=o+1,(this._parseNumber(l,1,r,!0)||this._parseNumber(l,2,r,this.type>=3)||this._parseNumber(l,3,r,!1))===!1){var d=p.safeZero(u*(l[1]*3600+l[2]*60+l[3]));return i.setParsedField(h.OFFSET_SECONDS,d,o,l[0])}}return a===0?i.setParsedField(h.OFFSET_SECONDS,0,o,o+a):~o},e._parseNumber=function(i,r,o,s){if((this.type+3)/2<r)return!1;var a=i[0];if(this.type%2===0&&r>1){if(a+1>o.length||o[a]!==":")return s;a++}if(a+2>o.length)return s;var c=o[a++],u=o[a++];if(c<"0"||c>"9"||u<"0"||u>"9")return s;var l=(c.charCodeAt(0)-48)*10+(u.charCodeAt(0)-48);return l<0||l>59?s:(i[r]=l,i[0]=a,!1)},e.toString=function(){var i=this.noOffsetText.replace("'","''");return"Offset("+cE[this.type]+",'"+i+"')"},t})();ci.INSTANCE_ID=new ci("Z","+HH:MM:ss");ci.PATTERNS=cE;iO=(function(){function t(n,i,r){this._printerParser=n,this._padWidth=i,this._padChar=r}var e=t.prototype;return e.print=function(i,r){var o=r.length();if(this._printerParser.print(i,r)===!1)return!1;var s=r.length()-o;if(s>this._padWidth)throw new $("Cannot print as output of "+s+" characters exceeds pad width of "+this._padWidth);for(var a=0;a<this._padWidth-s;a++)r.insert(o,this._padChar);return!0},e.parse=function(i,r,o){var s=i.isStrict(),a=i.isCaseSensitive();if(Ue(!(o>r.length)),Ue(o>=0),o===r.length)return~o;var c=o+this._padWidth;if(c>r.length){if(s)return~o;c=r.length}for(var u=o;u<c&&(a?r[u]===this._padChar:i.charEquals(r[u],this._padChar));)u++;r=r.substring(0,c);var l=this._printerParser.parse(i,r,u);return l!==c&&s?~(o+u):l},e.toString=function(){return"Pad("+this._printerParser+","+this._padWidth+(this._padChar===" "?")":",'"+this._padChar+"')")},t})(),Vn=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.print=function(){return!0},n.parse=function(r,o,s){switch(this){case e.SENSITIVE:r.setCaseSensitive(!0);break;case e.INSENSITIVE:r.setCaseSensitive(!1);break;case e.STRICT:r.setStrict(!0);break;case e.LENIENT:r.setStrict(!1);break}return s},n.toString=function(){switch(this){case e.SENSITIVE:return"ParseCaseSensitive(true)";case e.INSENSITIVE:return"ParseCaseSensitive(false)";case e.STRICT:return"ParseStrict(true)";case e.LENIENT:return"ParseStrict(false)"}},e})(Kc);Vn.SENSITIVE=new Vn("SENSITIVE");Vn.INSENSITIVE=new Vn("INSENSITIVE");Vn.STRICT=new Vn("STRICT");Vn.LENIENT=new Vn("LENIENT");oO=(function(){function t(n){this._literal=n}var e=t.prototype;return e.print=function(i,r){return r.append(this._literal),!0},e.parse=function(i,r,o){var s=r.length;return Ue(!(o>s||o<0)),i.subSequenceEquals(r,o,this._literal,0,this._literal.length)===!1?~o:o+this._literal.length},e.toString=function(){var i=this._literal.replace("'","''");return"'"+i+"'"},t})();Rh=(function(){function t(){}return t.getRules=function(n){throw new $("unsupported ZoneId:"+n)},t.getAvailableZoneIds=function(){return[]},t})(),Pr=(function(t){le(e,t),e.ofId=function(r){var o=Rh.getRules(r);return new e(r,o)};function e(i,r){var o;return o=t.call(this)||this,o._id=i,o._rules=r,o}var n=e.prototype;return n.id=function(){return this._id},n.rules=function(){return this._rules},e})(Pe);C$=(function(){function t(n,i){this.query=n,this.description=i}var e=t.prototype;return e.print=function(i,r){var o=i.getValueQuery(this.query);return o==null?!1:(r.append(o.id()),!0)},e.parse=function(i,r,o){var s=r.length;if(o>s||o===s)return~o;var a=r.charAt(o);if(a==="+"||a==="-"){var c=i.copy(),u=ci.INSTANCE_ID.parse(c,r,o);if(u<0)return u;var l=c.getParsed(h.OFFSET_SECONDS),d=ae.ofTotalSeconds(l);return i.setParsedZone(d),u}else if(s>=o+2){var f=r.charAt(o+1);if(i.charEquals(a,"U")&&i.charEquals(f,"T"))return s>=o+3&&i.charEquals(r.charAt(o+2),"C")?this._parsePrefixedOffset(i,r,o,o+3):this._parsePrefixedOffset(i,r,o,o+2);if(i.charEquals(a,"G")&&s>=o+3&&i.charEquals(f,"M")&&i.charEquals(r.charAt(o+2),"T"))return this._parsePrefixedOffset(i,r,o,o+3)}if(r.substr(o,6)==="SYSTEM")return i.setParsedZone(Pe.systemDefault()),o+6;if(i.charEquals(a,"Z"))return i.setParsedZone(ae.UTC),o+1;var m=Rh.getAvailableZoneIds();Qb.size!==m.length&&(Qb=S$.createTreeMap(m));for(var _=s-o,E=Qb.treeMap,I=null,y=0;E!=null;){var A=r.substr(o,Math.min(E.length,_));E=E.get(A),E!=null&&E.isLeaf&&(I=A,y=E.length)}return I!=null?(i.setParsedZone(Pr.ofId(I)),o+y):~o},e._parsePrefixedOffset=function(i,r,o,s){var a=r.substring(o,s).toUpperCase(),c=i.copy();if(s<r.length&&i.charEquals(r.charAt(s),"Z"))return i.setParsedZone(Pe.ofOffset(a,ae.UTC)),s;var u=ci.INSTANCE_ID.parse(c,r,s);if(u<0)return i.setParsedZone(Pe.ofOffset(a,ae.UTC)),s;var l=c.getParsed(h.OFFSET_SECONDS),d=ae.ofTotalSeconds(l);return i.setParsedZone(Pe.ofOffset(a,d)),u},e.toString=function(){return this.description},t})(),S$=(function(){t.createTreeMap=function(n){for(var i=n.sort(function(s,a){return s.length-a.length}),r=new lEe(i[0].length,!1),o=0;o<i.length;o++)r.add(i[o]);return new t(i.length,r)};function t(e,n){this.size=e,this.treeMap=n}return t})(),lEe=(function(){function t(n,i){n===void 0&&(n=0),i===void 0&&(i=!1),this.length=n,this.isLeaf=i,this._treeMap={}}var e=t.prototype;return e.add=function(i){var r=i.length;if(r===this.length)this._treeMap[i]=new t(r,!0);else if(r>this.length){var o=i.substr(0,this.length),s=this._treeMap[o];s==null&&(s=new t(r,!1),this._treeMap[o]=s),s.add(i)}},e.get=function(i){return this._treeMap[i]},t})(),Qb=new S$([]);Ui=15,Le=(function(){function t(){this._active=this,this._parent=null,this._printerParsers=[],this._optional=!1,this._padNextWidth=0,this._padNextChar=null,this._valueParserIndex=-1}t._of=function(i,r){C(i,"parent"),C(r,"optional");var o=new t;return o._parent=i,o._optional=r,o};var e=t.prototype;return e.parseCaseSensitive=function(){return this._appendInternalPrinterParser(Vn.SENSITIVE),this},e.parseCaseInsensitive=function(){return this._appendInternalPrinterParser(Vn.INSENSITIVE),this},e.parseStrict=function(){return this._appendInternalPrinterParser(Vn.STRICT),this},e.parseLenient=function(){return this._appendInternalPrinterParser(Vn.LENIENT),this},e.parseDefaulting=function(i,r){return C(i),this._appendInternal(new hEe(i,r)),this},e.appendValue=function(){return arguments.length===1?this._appendValue1.apply(this,arguments):arguments.length===2?this._appendValue2.apply(this,arguments):this._appendValue4.apply(this,arguments)},e._appendValue1=function(i){return C(i),this._appendValuePrinterParser(new Yc(i,1,Ui,Oe.NORMAL)),this},e._appendValue2=function(i,r){if(C(i),r<1||r>Ui)throw new Z("The width must be from 1 to "+Ui+" inclusive but was "+r);var o=new Yc(i,r,r,Oe.NOT_NEGATIVE);return this._appendValuePrinterParser(o),this},e._appendValue4=function(i,r,o,s){if(C(i),C(s),r===o&&s===Oe.NOT_NEGATIVE)return this._appendValue2(i,o);if(r<1||r>Ui)throw new Z("The minimum width must be from 1 to "+Ui+" inclusive but was "+r);if(o<1||o>Ui)throw new Z("The minimum width must be from 1 to "+Ui+" inclusive but was "+o);if(o<r)throw new Z("The maximum width must exceed or equal the minimum width but "+o+" < "+r);var a=new Yc(i,r,o,s);return this._appendValuePrinterParser(a),this},e.appendValueReduced=function(){return arguments.length===4&&arguments[3]instanceof $c?this._appendValueReducedFieldWidthMaxWidthBaseDate.apply(this,arguments):this._appendValueReducedFieldWidthMaxWidthBaseValue.apply(this,arguments)},e._appendValueReducedFieldWidthMaxWidthBaseValue=function(i,r,o,s){C(i,"field");var a=new wh(i,r,o,s,null);return this._appendValuePrinterParser(a),this},e._appendValueReducedFieldWidthMaxWidthBaseDate=function(i,r,o,s){C(i,"field"),C(s,"baseDate"),J(s,$c,"baseDate");var a=new wh(i,r,o,0,s);return this._appendValuePrinterParser(a),this},e._appendValuePrinterParser=function(i){if(Ue(i!=null),this._active._valueParserIndex>=0&&this._active._printerParsers[this._active._valueParserIndex]instanceof Yc){var r=this._active._valueParserIndex,o=this._active._printerParsers[r];i.minWidth()===i.maxWidth()&&i.signStyle()===Oe.NOT_NEGATIVE?(o=o.withSubsequentWidth(i.maxWidth()),this._appendInternal(i.withFixedWidth()),this._active._valueParserIndex=r):(o=o.withFixedWidth(),this._active._valueParserIndex=this._appendInternal(i)),this._active._printerParsers[r]=o}else this._active._valueParserIndex=this._appendInternal(i);return this},e.appendFraction=function(i,r,o,s){return this._appendInternal(new A$(i,r,o,s)),this},e.appendInstant=function(i){if(i===void 0&&(i=-2),i<-2||i>9)throw new Z("Invalid fractional digits: "+i);return this._appendInternal(new dEe(i)),this},e.appendOffsetId=function(){return this._appendInternal(ci.INSTANCE_ID),this},e.appendOffset=function(i,r){return this._appendInternalPrinterParser(new ci(r,i)),this},e.appendZoneId=function(){return this._appendInternal(new C$(k.zoneId(),"ZoneId()")),this},e.appendPattern=function(i){return C(i,"pattern"),this._parsePattern(i),this},e.appendZoneText=function(){throw new Z("Pattern using (localized) text not implemented, use @js-joda/locale plugin!")},e.appendText=function(){throw new Z("Pattern using (localized) text not implemented, use @js-joda/locale plugin!")},e.appendLocalizedOffset=function(){throw new Z("Pattern using (localized) text not implemented, use @js-joda/locale plugin!")},e.appendWeekField=function(){throw new Z("Pattern using (localized) text not implemented, use @js-joda/locale plugin!")},e._parsePattern=function(i){for(var r={G:h.ERA,y:h.YEAR_OF_ERA,u:h.YEAR,Q:hr.QUARTER_OF_YEAR,q:hr.QUARTER_OF_YEAR,M:h.MONTH_OF_YEAR,L:h.MONTH_OF_YEAR,D:h.DAY_OF_YEAR,d:h.DAY_OF_MONTH,F:h.ALIGNED_DAY_OF_WEEK_IN_MONTH,E:h.DAY_OF_WEEK,c:h.DAY_OF_WEEK,e:h.DAY_OF_WEEK,a:h.AMPM_OF_DAY,H:h.HOUR_OF_DAY,k:h.CLOCK_HOUR_OF_DAY,K:h.HOUR_OF_AMPM,h:h.CLOCK_HOUR_OF_AMPM,m:h.MINUTE_OF_HOUR,s:h.SECOND_OF_MINUTE,S:h.NANO_OF_SECOND,A:h.MILLI_OF_DAY,n:h.NANO_OF_SECOND,N:h.NANO_OF_DAY},o=0;o<i.length;o++){var s=i.charAt(o);if(s>="A"&&s<="Z"||s>="a"&&s<="z"){for(var a=o++;o<i.length&&i.charAt(o)===s;o++);var c=o-a;if(s==="p"){var u=0;if(o<i.length&&(s=i.charAt(o),s>="A"&&s<="Z"||s>="a"&&s<="z")){for(u=c,a=o++;o<i.length&&i.charAt(o)===s;o++);c=o-a}if(u===0)throw new Z("Pad letter 'p' must be followed by valid pad pattern: "+i);this.padNext(u)}var l=r[s];if(l!=null)this._parseField(s,c,l);else if(s==="z"){if(c>4)throw new Z("Too many pattern letters: "+s);c===4?this.appendZoneText(Re.FULL):this.appendZoneText(Re.SHORT)}else if(s==="V"){if(c!==2)throw new Z("Pattern letter count must be 2: "+s);this.appendZoneId()}else if(s==="Z")if(c<4)this.appendOffset("+HHMM","+0000");else if(c===4)this.appendLocalizedOffset(Re.FULL);else if(c===5)this.appendOffset("+HH:MM:ss","Z");else throw new Z("Too many pattern letters: "+s);else if(s==="O")if(c===1)this.appendLocalizedOffset(Re.SHORT);else if(c===4)this.appendLocalizedOffset(Re.FULL);else throw new Z("Pattern letter count must be 1 or 4: "+s);else if(s==="X"){if(c>5)throw new Z("Too many pattern letters: "+s);this.appendOffset(ci.PATTERNS[c+(c===1?0:1)],"Z")}else if(s==="x"){if(c>5)throw new Z("Too many pattern letters: "+s);var d=c===1?"+00":c%2===0?"+0000":"+00:00";this.appendOffset(ci.PATTERNS[c+(c===1?0:1)],d)}else if(s==="W"){if(c>1)throw new Z("Too many pattern letters: "+s);this.appendWeekField("W",c)}else if(s==="w"){if(c>2)throw new Z("Too many pattern letters: "+s);this.appendWeekField("w",c)}else if(s==="Y")this.appendWeekField("Y",c);else throw new Z("Unknown pattern letter: "+s);o--}else if(s==="'"){for(var f=o++;o<i.length;o++)if(i.charAt(o)==="'")if(o+1<i.length&&i.charAt(o+1)==="'")o++;else break;if(o>=i.length)throw new Z("Pattern ends with an incomplete string literal: "+i);var m=i.substring(f+1,o);m.length===0?this.appendLiteral("'"):this.appendLiteral(m.replace("''","'"))}else if(s==="[")this.optionalStart();else if(s==="]"){if(this._active._parent===null)throw new Z("Pattern invalid as it contains ] without previous [");this.optionalEnd()}else{if(s==="{"||s==="}"||s==="#")throw new Z("Pattern includes reserved character: '"+s+"'");this.appendLiteral(s)}}},e._parseField=function(i,r,o){switch(i){case"u":case"y":r===2?this.appendValueReduced(o,2,2,wh.BASE_DATE):r<4?this.appendValue(o,r,Ui,Oe.NORMAL):this.appendValue(o,r,Ui,Oe.EXCEEDS_PAD);break;case"M":case"Q":switch(r){case 1:this.appendValue(o);break;case 2:this.appendValue(o,2);break;case 3:this.appendText(o,Re.SHORT);break;case 4:this.appendText(o,Re.FULL);break;case 5:this.appendText(o,Re.NARROW);break;default:throw new Z("Too many pattern letters: "+i)}break;case"L":case"q":switch(r){case 1:this.appendValue(o);break;case 2:this.appendValue(o,2);break;case 3:this.appendText(o,Re.SHORT_STANDALONE);break;case 4:this.appendText(o,Re.FULL_STANDALONE);break;case 5:this.appendText(o,Re.NARROW_STANDALONE);break;default:throw new Z("Too many pattern letters: "+i)}break;case"e":switch(r){case 1:case 2:this.appendWeekField("e",r);break;case 3:this.appendText(o,Re.SHORT);break;case 4:this.appendText(o,Re.FULL);break;case 5:this.appendText(o,Re.NARROW);break;default:throw new Z("Too many pattern letters: "+i)}break;case"c":switch(r){case 1:this.appendWeekField("c",r);break;case 2:throw new Z("Invalid number of pattern letters: "+i);case 3:this.appendText(o,Re.SHORT_STANDALONE);break;case 4:this.appendText(o,Re.FULL_STANDALONE);break;case 5:this.appendText(o,Re.NARROW_STANDALONE);break;default:throw new Z("Too many pattern letters: "+i)}break;case"a":if(r===1)this.appendText(o,Re.SHORT);else throw new Z("Too many pattern letters: "+i);break;case"E":case"G":switch(r){case 1:case 2:case 3:this.appendText(o,Re.SHORT);break;case 4:this.appendText(o,Re.FULL);break;case 5:this.appendText(o,Re.NARROW);break;default:throw new Z("Too many pattern letters: "+i)}break;case"S":this.appendFraction(h.NANO_OF_SECOND,r,r,!1);break;case"F":if(r===1)this.appendValue(o);else throw new Z("Too many pattern letters: "+i);break;case"d":case"h":case"H":case"k":case"K":case"m":case"s":if(r===1)this.appendValue(o);else if(r===2)this.appendValue(o,r);else throw new Z("Too many pattern letters: "+i);break;case"D":if(r===1)this.appendValue(o);else if(r<=3)this.appendValue(o,r);else throw new Z("Too many pattern letters: "+i);break;default:r===1?this.appendValue(o):this.appendValue(o,r);break}},e.padNext=function(){return arguments.length===1?this._padNext1.apply(this,arguments):this._padNext2.apply(this,arguments)},e._padNext1=function(i){return this._padNext2(i," ")},e._padNext2=function(i,r){if(i<1)throw new Z("The pad width must be at least one but was "+i);return this._active._padNextWidth=i,this._active._padNextChar=r,this._active._valueParserIndex=-1,this},e.optionalStart=function(){return this._active._valueParserIndex=-1,this._active=t._of(this._active,!0),this},e.optionalEnd=function(){if(this._active._parent==null)throw new Vc("Cannot call optionalEnd() as there was no previous call to optionalStart()");if(this._active._printerParsers.length>0){var i=new rO(this._active._printerParsers,this._active._optional);this._active=this._active._parent,this._appendInternal(i)}else this._active=this._active._parent;return this},e._appendInternal=function(i){return Ue(i!=null),this._active._padNextWidth>0&&(i!=null&&(i=new iO(i,this._active._padNextWidth,this._active._padNextChar)),this._active._padNextWidth=0,this._active._padNextChar=0),this._active._printerParsers.push(i),this._active._valueParserIndex=-1,this._active._printerParsers.length-1},e.appendLiteral=function(i){return Ue(i!=null),i.length>0&&(i.length===1?this._appendInternalPrinterParser(new T$(i.charAt(0))):this._appendInternalPrinterParser(new oO(i))),this},e._appendInternalPrinterParser=function(i){return Ue(i!=null),this._active._padNextWidth>0&&(i!=null&&(i=new iO(i,this._active._padNextWidth,this._active._padNextChar)),this._active._padNextWidth=0,this._active._padNextChar=0),this._active._printerParsers.push(i),this._active._valueParserIndex=-1,this._active._printerParsers.length-1},e.append=function(i){return C(i,"formatter"),this._appendInternal(i._toPrinterParser(!1)),this},e.toFormatter=function(i){for(i===void 0&&(i=ce.SMART);this._active._parent!=null;)this.optionalEnd();var r=new rO(this._printerParsers,!1);return new fe(r,null,vh.STANDARD,i,null,null,null)},t})(),qc=146097*25*86400,Ch=(146097*5-(30*365+7))*86400,dEe=(function(){function t(n){this.fractionalDigits=n}var e=t.prototype;return e.print=function(i,r){var o=i.getValue(h.INSTANT_SECONDS),s=0;if(i.temporal().isSupported(h.NANO_OF_SECOND)&&(s=i.temporal().getLong(h.NANO_OF_SECOND)),o==null)return!1;var a=o,c=h.NANO_OF_SECOND.checkValidIntValue(s);if(a>=-Ch){var u=a-qc+Ch,l=p.floorDiv(u,qc)+1,d=p.floorMod(u,qc),f=De.ofEpochSecond(d-Ch,0,ae.UTC);l>0&&r.append("+").append(l),r.append(f.toString()),f.second()===0&&r.append(":00")}else{var m=a+Ch,_=p.intDiv(m,qc),E=p.intMod(m,qc),I=De.ofEpochSecond(E-Ch,0,ae.UTC),y=r.length();r.append(I.toString()),I.second()===0&&r.append(":00"),_<0&&(I.year()===-1e4?r.replace(y,y+2,""+(_-1)):E===0?r.insert(y,_):r.insert(y+1,Math.abs(_)))}if(this.fractionalDigits===-2)c!==0&&(r.append("."),p.intMod(c,1e6)===0?r.append((""+(p.intDiv(c,1e6)+1e3)).substring(1)):p.intMod(c,1e3)===0?r.append((""+(p.intDiv(c,1e3)+1e6)).substring(1)):r.append((""+(c+1e9)).substring(1)));else if(this.fractionalDigits>0||this.fractionalDigits===-1&&c>0){r.append(".");for(var A=1e8,S=0;this.fractionalDigits===-1&&c>0||S<this.fractionalDigits;S++){var w=p.intDiv(c,A);r.append(w),c=c-w*A,A=p.intDiv(A,10)}}return r.append("Z"),!0},e.parse=function(i,r,o){var s=i.copy(),a=this.fractionalDigits<0?0:this.fractionalDigits,c=this.fractionalDigits<0?9:this.fractionalDigits,u=new Le().append(fe.ISO_LOCAL_DATE).appendLiteral("T").appendValue(h.HOUR_OF_DAY,2).appendLiteral(":").appendValue(h.MINUTE_OF_HOUR,2).appendLiteral(":").appendValue(h.SECOND_OF_MINUTE,2).appendFraction(h.NANO_OF_SECOND,a,c,!0).appendLiteral("Z").toFormatter()._toPrinterParser(!1),l=u.parse(s,r,o);if(l<0)return l;var d=s.getParsed(h.YEAR),f=s.getParsed(h.MONTH_OF_YEAR),m=s.getParsed(h.DAY_OF_MONTH),_=s.getParsed(h.HOUR_OF_DAY),E=s.getParsed(h.MINUTE_OF_HOUR),I=s.getParsed(h.SECOND_OF_MINUTE),y=s.getParsed(h.NANO_OF_SECOND),A=I??0,S=y??0,w=p.intMod(d,1e4),N=0;_===24&&E===0&&A===0&&S===0?(_=0,N=1):_===23&&E===59&&A===60&&(i.setParsedLeapSecond(),A=59);var W;try{var R=De.of(w,f,m,_,E,A,0).plusDays(N);W=R.toEpochSecond(ae.UTC),W+=p.safeMultiply(p.intDiv(d,1e4),qc)}catch{return~o}var L=l;return L=i.setParsedField(h.INSTANT_SECONDS,W,o,L),i.setParsedField(h.NANO_OF_SECOND,S,o,L)},e.toString=function(){return"Instant()"},t})(),hEe=(function(){function t(n,i){this._field=n,this._value=i}var e=t.prototype;return e.print=function(){return!0},e.parse=function(i,r,o){return i.getParsed(this._field)==null&&i.setParsedField(this._field,this._value,o,o),o},t})();w$=(function(){function t(){this._str=""}var e=t.prototype;return e.append=function(i){return this._str+=i,this},e.appendChar=function(i){return this._str+=i[0],this},e.insert=function(i,r){return this._str=this._str.slice(0,i)+r+this._str.slice(i),this},e.replace=function(i,r,o){return this._str=this._str.slice(0,i)+o+this._str.slice(r),this},e.length=function(){return this._str.length},e.setLength=function(i){return this._str=this._str.slice(0,i),this},e.toString=function(){return this._str},t})();fe=(function(){t.parsedExcessDays=function(){return t.PARSED_EXCESS_DAYS},t.parsedLeapSecond=function(){return t.PARSED_LEAP_SECOND},t.ofPattern=function(i){return new Le().appendPattern(i).toFormatter()};function t(n,i,r,o,s,a,c){a===void 0&&(a=Ne.INSTANCE),Ue(n!=null),Ue(r!=null),Ue(o!=null),this._printerParser=n,this._locale=i,this._decimalStyle=r,this._resolverStyle=o,this._resolverFields=s,this._chrono=a,this._zone=c}var e=t.prototype;return e.locale=function(){return this._locale},e.decimalStyle=function(){return this._decimalStyle},e.chronology=function(){return this._chrono},e.withChronology=function(i){return this._chrono!=null&&this._chrono.equals(i)?this:new t(this._printerParser,this._locale,this._decimalStyle,this._resolverStyle,this._resolverFields,i,this._zone)},e.withLocale=function(){return this},e.withResolverStyle=function(i){return C(i,"resolverStyle"),i.equals(this._resolverStyle)?this:new t(this._printerParser,this._locale,this._decimalStyle,i,this._resolverFields,this._chrono,this._zone)},e.format=function(i){var r=new w$(32);return this._formatTo(i,r),r.toString()},e._formatTo=function(i,r){C(i,"temporal"),C(r,"appendable");var o=new E$(i,this);this._printerParser.print(o,r)},e.parse=function(i,r){return arguments.length===1?this.parse1(i):this.parse2(i,r)},e.parse1=function(i){C(i,"text");try{return this._parseToBuilder(i,null).resolve(this._resolverStyle,this._resolverFields)}catch(r){throw r instanceof pr?r:this._createError(i,r)}},e.parse2=function(i,r){C(i,"text"),C(r,"type");try{var o=this._parseToBuilder(i,null).resolve(this._resolverStyle,this._resolverFields);return o.build(r)}catch(s){throw s instanceof pr?s:this._createError(i,s)}},e._createError=function(i,r){var o="";return i.length>64?o=i.substring(0,64)+"...":o=i,new pr("Text '"+o+"' could not be parsed: "+r.message,i,0,r)},e._parseToBuilder=function(i,r){var o=r??new uO(0),s=this._parseUnresolved0(i,o);if(s==null||o.getErrorIndex()>=0||r==null&&o.getIndex()<i.length){var a="";throw i.length>64?a=i.substr(0,64).toString()+"...":a=i,o.getErrorIndex()>=0?new pr("Text '"+a+"' could not be parsed at index "+o.getErrorIndex(),i,o.getErrorIndex()):new pr("Text '"+a+"' could not be parsed, unparsed text found at index "+o.getIndex(),i,o.getIndex())}return s.toBuilder()},e.parseUnresolved=function(i,r){return this._parseUnresolved0(i,r)},e._parseUnresolved0=function(i,r){Ue(i!=null,"text",ui),Ue(r!=null,"position",ui);var o=new y$(this),s=r.getIndex();return s=this._printerParser.parse(o,i,s),s<0?(r.setErrorIndex(~s),null):(r.setIndex(s),o.toParsed())},e._toPrinterParser=function(i){return this._printerParser.withOptional(i)},e.toString=function(){var i=this._printerParser.toString();return i.indexOf("[")===0?i:i.substring(1,i.length-1)},t})();bh=(function(t){le(e,t),e.now=function(r){return arguments.length===0?e.now0():arguments.length===1&&r instanceof Pe?e.nowZoneId(r):e.nowClock(r)},e.now0=function(){return this.nowClock(xe.systemDefaultZone())},e.nowZoneId=function(r){return C(r,"zone"),this.nowClock(xe.system(r))},e.nowClock=function(r){C(r,"clock");var o=ee.now(r);return e.of(o.month(),o.dayOfMonth())},e.of=function(r,o){return arguments.length===2&&r instanceof oe?e.ofMonthNumber(r,o):e.ofNumberNumber(r,o)},e.ofMonthNumber=function(r,o){if(C(r,"month"),h.DAY_OF_MONTH.checkValidValue(o),o>r.maxLength())throw new $("Illegal value for DayOfMonth field, value "+o+" is not valid for month "+r.toString());return new e(r.value(),o)},e.ofNumberNumber=function(r,o){return C(r,"month"),C(o,"dayOfMonth"),e.of(oe.of(r),o)},e.from=function(r){if(C(r,"temporal"),J(r,xi,"temporal"),r instanceof e)return r;try{return e.of(r.get(h.MONTH_OF_YEAR),r.get(h.DAY_OF_MONTH))}catch{throw new $("Unable to obtain MonthDay from TemporalAccessor: "+r+", type "+(r&&r.constructor!=null?r.constructor.name:""))}},e.parse=function(r,o){return arguments.length===1?e.parseString(r):e.parseStringFormatter(r,o)},e.parseString=function(r){return e.parseStringFormatter(r,I$)},e.parseStringFormatter=function(r,o){return C(r,"text"),C(o,"formatter"),J(o,fe,"formatter"),o.parse(r,e.FROM)};function e(i,r){var o;return o=t.call(this)||this,o._month=p.safeToInt(i),o._day=p.safeToInt(r),o}var n=e.prototype;return n.monthValue=function(){return this._month},n.month=function(){return oe.of(this._month)},n.dayOfMonth=function(){return this._day},n.isSupported=function(r){return r instanceof h?r===h.MONTH_OF_YEAR||r===h.DAY_OF_MONTH:r!=null&&r.isSupportedBy(this)},n.range=function(r){return r===h.MONTH_OF_YEAR?r.range():r===h.DAY_OF_MONTH?ue.of(1,this.month().minLength(),this.month().maxLength()):t.prototype.range.call(this,r)},n.get=function(r){return this.range(r).checkValidIntValue(this.getLong(r),r)},n.getLong=function(r){if(C(r,"field"),r instanceof h){switch(r){case h.DAY_OF_MONTH:return this._day;case h.MONTH_OF_YEAR:return this._month}throw new _e("Unsupported field: "+r)}return r.getFrom(this)},n.isValidYear=function(r){return!(this._day===29&&this._month===2&&mr.isLeap(r)===!1)},n.withMonth=function(r){return this.with(oe.of(r))},n.with=function(r){if(C(r,"month"),r.value()===this._month)return this;var o=Math.min(this._day,r.maxLength());return new e(r.value(),o)},n.withDayOfMonth=function(r){return r===this._day?this:e.of(this._month,r)},n.query=function(r){return C(r,"query"),J(r,Xc,"query"),r===k.chronology()?Ne.INSTANCE:t.prototype.query.call(this,r)},n.adjustInto=function(r){return C(r,"temporal"),r=r.with(h.MONTH_OF_YEAR,this._month),r.with(h.DAY_OF_MONTH,Math.min(r.range(h.DAY_OF_MONTH).maximum(),this._day))},n.atYear=function(r){return ee.of(r,this._month,this.isValidYear(r)?this._day:28)},n.compareTo=function(r){C(r,"other"),J(r,e,"other");var o=this._month-r.monthValue();return o===0&&(o=this._day-r.dayOfMonth()),o},n.isAfter=function(r){return C(r,"other"),J(r,e,"other"),this.compareTo(r)>0},n.isBefore=function(r){return C(r,"other"),J(r,e,"other"),this.compareTo(r)<0},n.equals=function(r){if(this===r)return!0;if(r instanceof e){var o=r;return this.monthValue()===o.monthValue()&&this.dayOfMonth()===o.dayOfMonth()}return!1},n.toString=function(){return"--"+(this._month<10?"0":"")+this._month+(this._day<10?"-0":"-")+this._day},n.toJSON=function(){return this.toString()},n.format=function(r){return C(r,"formatter"),J(r,fe,"formatter"),r.format(this)},e})(xi);Wc=(function(t){le(e,t),e.now=function(r){return arguments.length===0?e.now0():arguments.length===1&&r instanceof Pe?e.nowZoneId(r):e.nowClock(r)},e.now0=function(){return e.nowClock(xe.systemDefaultZone())},e.nowZoneId=function(r){return e.nowClock(xe.system(r))},e.nowClock=function(r){var o=ee.now(r);return e.of(o.year(),o.month())},e.of=function(r,o){return arguments.length===2&&o instanceof oe?e.ofNumberMonth(r,o):e.ofNumberNumber(r,o)},e.ofNumberMonth=function(r,o){return C(o,"month"),J(o,oe,"month"),e.ofNumberNumber(r,o.value())},e.ofNumberNumber=function(r,o){return C(r,"year"),C(o,"month"),h.YEAR.checkValidValue(r),h.MONTH_OF_YEAR.checkValidValue(o),new e(r,o)},e.from=function(r){if(C(r,"temporal"),r instanceof e)return r;try{return e.of(r.get(h.YEAR),r.get(h.MONTH_OF_YEAR))}catch{throw new $("Unable to obtain YearMonth from TemporalAccessor: "+r+", type "+(r&&r.constructor!=null?r.constructor.name:""))}},e.parse=function(r,o){return arguments.length===1?e.parseString(r):e.parseStringFormatter(r,o)},e.parseString=function(r){return e.parseStringFormatter(r,sO)},e.parseStringFormatter=function(r,o){return C(o,"formatter"),o.parse(r,e.FROM)};function e(i,r){var o;return o=t.call(this)||this,o._year=p.safeToInt(i),o._month=p.safeToInt(r),o}var n=e.prototype;return n.isSupported=function(r){return arguments.length===1&&r instanceof Mr?this.isSupportedField(r):this.isSupportedUnit(r)},n.isSupportedField=function(r){return r instanceof h?r===h.YEAR||r===h.MONTH_OF_YEAR||r===h.PROLEPTIC_MONTH||r===h.YEAR_OF_ERA||r===h.ERA:r!=null&&r.isSupportedBy(this)},n.isSupportedUnit=function(r){return r instanceof T?r===T.MONTHS||r===T.YEARS||r===T.DECADES||r===T.CENTURIES||r===T.MILLENNIA||r===T.ERAS:r!=null&&r.isSupportedBy(this)},n.range=function(r){return r===h.YEAR_OF_ERA?this.year()<=0?ue.of(1,mr.MAX_VALUE+1):ue.of(1,mr.MAX_VALUE):t.prototype.range.call(this,r)},n.get=function(r){return C(r,"field"),J(r,Mr,"field"),this.range(r).checkValidIntValue(this.getLong(r),r)},n.getLong=function(r){if(C(r,"field"),J(r,Mr,"field"),r instanceof h){switch(r){case h.MONTH_OF_YEAR:return this._month;case h.PROLEPTIC_MONTH:return this._getProlepticMonth();case h.YEAR_OF_ERA:return this._year<1?1-this._year:this._year;case h.YEAR:return this._year;case h.ERA:return this._year<1?0:1}throw new _e("Unsupported field: "+r)}return r.getFrom(this)},n._getProlepticMonth=function(){return p.safeAdd(p.safeMultiply(this._year,12),this._month-1)},n.year=function(){return this._year},n.monthValue=function(){return this._month},n.month=function(){return oe.of(this._month)},n.isLeapYear=function(){return Ne.isLeapYear(this._year)},n.isValidDay=function(r){return r>=1&&r<=this.lengthOfMonth()},n.lengthOfMonth=function(){return this.month().length(this.isLeapYear())},n.lengthOfYear=function(){return this.isLeapYear()?366:365},n.with=function(r,o){return arguments.length===1?this._withAdjuster(r):this._withField(r,o)},n._withField=function(r,o){if(C(r,"field"),J(r,Mr,"field"),r instanceof h){var s=r;switch(s.checkValidValue(o),s){case h.MONTH_OF_YEAR:return this.withMonth(o);case h.PROLEPTIC_MONTH:return this.plusMonths(o-this.getLong(h.PROLEPTIC_MONTH));case h.YEAR_OF_ERA:return this.withYear(this._year<1?1-o:o);case h.YEAR:return this.withYear(o);case h.ERA:return this.getLong(h.ERA)===o?this:this.withYear(1-this._year)}throw new _e("Unsupported field: "+r)}return r.adjustInto(this,o)},n.withYear=function(r){return h.YEAR.checkValidValue(r),new e(r,this._month)},n.withMonth=function(r){return h.MONTH_OF_YEAR.checkValidValue(r),new e(this._year,r)},n._plusUnit=function(r,o){if(C(o,"unit"),J(o,li,"unit"),o instanceof T){switch(o){case T.MONTHS:return this.plusMonths(r);case T.YEARS:return this.plusYears(r);case T.DECADES:return this.plusYears(p.safeMultiply(r,10));case T.CENTURIES:return this.plusYears(p.safeMultiply(r,100));case T.MILLENNIA:return this.plusYears(p.safeMultiply(r,1e3));case T.ERAS:return this.with(h.ERA,p.safeAdd(this.getLong(h.ERA),r))}throw new _e("Unsupported unit: "+o)}return o.addTo(this,r)},n.plusYears=function(r){if(r===0)return this;var o=h.YEAR.checkValidIntValue(this._year+r);return this.withYear(o)},n.plusMonths=function(r){if(r===0)return this;var o=this._year*12+(this._month-1),s=o+r,a=h.YEAR.checkValidIntValue(p.floorDiv(s,12)),c=p.floorMod(s,12)+1;return new e(a,c)},n.minusYears=function(r){return r===p.MIN_SAFE_INTEGER?this.plusYears(p.MIN_SAFE_INTEGER).plusYears(1):this.plusYears(-r)},n.minusMonths=function(r){return r===p.MIN_SAFE_INTEGER?this.plusMonths(Math.MAX_SAFE_INTEGER).plusMonths(1):this.plusMonths(-r)},n.query=function(r){return C(r,"query"),J(r,Xc,"query"),r===k.chronology()?Ne.INSTANCE:r===k.precision()?T.MONTHS:r===k.localDate()||r===k.localTime()||r===k.zone()||r===k.zoneId()||r===k.offset()?null:t.prototype.query.call(this,r)},n.adjustInto=function(r){return C(r,"temporal"),J(r,An,"temporal"),r.with(h.PROLEPTIC_MONTH,this._getProlepticMonth())},n.until=function(r,o){C(r,"endExclusive"),C(o,"unit"),J(r,An,"endExclusive"),J(o,li,"unit");var s=e.from(r);if(o instanceof T){var a=s._getProlepticMonth()-this._getProlepticMonth();switch(o){case T.MONTHS:return a;case T.YEARS:return p.intDiv(a,12);case T.DECADES:return p.intDiv(a,120);case T.CENTURIES:return p.intDiv(a,1200);case T.MILLENNIA:return p.intDiv(a,12e3);case T.ERAS:return s.getLong(h.ERA)-this.getLong(h.ERA)}throw new _e("Unsupported unit: "+o)}return o.between(this,s)},n.atDay=function(r){return C(r,"dayOfMonth"),ee.of(this._year,this._month,r)},n.atEndOfMonth=function(){return ee.of(this._year,this._month,this.lengthOfMonth())},n.compareTo=function(r){C(r,"other"),J(r,e,"other");var o=this._year-r.year();return o===0&&(o=this._month-r.monthValue()),o},n.isAfter=function(r){return this.compareTo(r)>0},n.isBefore=function(r){return this.compareTo(r)<0},n.equals=function(r){if(this===r)return!0;if(r instanceof e){var o=r;return this.year()===o.year()&&this.monthValue()===o.monthValue()}return!1},n.toString=function(){return sO.format(this)},n.toJSON=function(){return this.toString()},n.format=function(r){return C(r,"formatter"),r.format(this)},e})(An);mr=(function(t){le(e,t);function e(i){var r;return r=t.call(this)||this,r._year=p.safeToInt(i),r}var n=e.prototype;return n.value=function(){return this._year},e.now=function(r){return r===void 0&&(r=void 0),r===void 0?e.now0():r instanceof Pe?e.nowZoneId(r):e.nowClock(r)},e.now0=function(){return e.nowClock(xe.systemDefaultZone())},e.nowZoneId=function(r){return C(r,"zone"),J(r,Pe,"zone"),e.nowClock(xe.system(r))},e.nowClock=function(r){C(r,"clock"),J(r,xe,"clock");var o=ee.now(r);return e.of(o.year())},e.of=function(r){return C(r,"isoYear"),h.YEAR.checkValidValue(r),new e(r)},e.from=function(r){if(C(r,"temporal"),J(r,xi,"temporal"),r instanceof e)return r;try{return e.of(r.get(h.YEAR))}catch{throw new $("Unable to obtain Year from TemporalAccessor: "+r+", type "+(r&&r.constructor!=null?r.constructor.name:""))}},e.parse=function(r,o){return arguments.length<=1?e.parseText(r):e.parseTextFormatter(r,o)},e.parseText=function(r){return C(r,"text"),e.parse(r,aO)},e.parseTextFormatter=function(r,o){return o===void 0&&(o=aO),C(r,"text"),C(o,"formatter"),J(o,fe,"formatter"),o.parse(r,e.FROM)},e.isLeap=function(r){return p.intMod(r,4)===0&&(p.intMod(r,100)!==0||p.intMod(r,400)===0)},n.isSupported=function(r){return arguments.length===1&&r instanceof Mr?this.isSupportedField(r):this.isSupportedUnit(r)},n.isSupportedField=function(r){return r instanceof h?r===h.YEAR||r===h.YEAR_OF_ERA||r===h.ERA:r!=null&&r.isSupportedBy(this)},n.isSupportedUnit=function(r){return r instanceof T?r===T.YEARS||r===T.DECADES||r===T.CENTURIES||r===T.MILLENNIA||r===T.ERAS:r!=null&&r.isSupportedBy(this)},n.range=function(r){if(this.isSupported(r))return r.range();if(r instanceof h)throw new _e("Unsupported field: "+r);return t.prototype.range.call(this,r)},n.get=function(r){return this.range(r).checkValidIntValue(this.getLong(r),r)},n.getLong=function(r){if(C(r,"field"),r instanceof h){switch(r){case h.YEAR_OF_ERA:return this._year<1?1-this._year:this._year;case h.YEAR:return this._year;case h.ERA:return this._year<1?0:1}throw new _e("Unsupported field: "+r)}return r.getFrom(this)},n.isLeap=function(){return e.isLeap(this._year)},n._withField=function(r,o){if(C(r,"field"),J(r,Mr,"field"),r instanceof h){switch(r.checkValidValue(o),r){case h.YEAR_OF_ERA:return e.of(this._year<1?1-o:o);case h.YEAR:return e.of(o);case h.ERA:return this.getLong(h.ERA)===o?this:e.of(1-this._year)}throw new _e("Unsupported field: "+r)}return r.adjustInto(this,o)},n._plusUnit=function(r,o){if(C(r,"amountToAdd"),C(o,"unit"),J(o,li,"unit"),o instanceof T){switch(o){case T.YEARS:return this.plusYears(r);case T.DECADES:return this.plusYears(p.safeMultiply(r,10));case T.CENTURIES:return this.plusYears(p.safeMultiply(r,100));case T.MILLENNIA:return this.plusYears(p.safeMultiply(r,1e3));case T.ERAS:return this.with(h.ERA,p.safeAdd(this.getLong(h.ERA),r))}throw new _e("Unsupported unit: "+o)}return o.addTo(this,r)},n.plusYears=function(r){return r===0?this:e.of(h.YEAR.checkValidIntValue(p.safeAdd(this._year,r)))},n.minusYears=function(r){return r===p.MIN_SAFE_INTEGER?this.plusYears(p.MAX_SAFE_INTEGER).plusYears(1):this.plusYears(-r)},n.adjustInto=function(r){return C(r,"temporal"),r.with(h.YEAR,this._year)},n.isValidMonthDay=function(r){return r!=null&&r.isValidYear(this._year)},n.length=function(){return this.isLeap()?366:365},n.atDay=function(r){return ee.ofYearDay(this._year,r)},n.atMonth=function(r){return arguments.length===1&&r instanceof oe?this.atMonthMonth(r):this.atMonthNumber(r)},n.atMonthMonth=function(r){return C(r,"month"),J(r,oe,"month"),Wc.of(this._year,r)},n.atMonthNumber=function(r){return C(r,"month"),Wc.of(this._year,r)},n.atMonthDay=function(r){return C(r,"monthDay"),J(r,bh,"monthDay"),r.atYear(this._year)},n.query=function(r){return C(r,"query()"),J(r,Xc,"query()"),r===k.chronology()?Ne.INSTANCE:r===k.precision()?T.YEARS:r===k.localDate()||r===k.localTime()||r===k.zone()||r===k.zoneId()||r===k.offset()?null:t.prototype.query.call(this,r)},n.compareTo=function(r){return C(r,"other"),J(r,e,"other"),this._year-r._year},n.isAfter=function(r){return C(r,"other"),J(r,e,"other"),this._year>r._year},n.isBefore=function(r){return C(r,"other"),J(r,e,"other"),this._year<r._year},n.format=function(r){return C(r,"formatter"),J(r,fe,"formatter"),r.format(this)},n.equals=function(r){return this===r?!0:r instanceof e?this.value()===r.value():!1},n.toString=function(){return""+this._year},n.toJSON=function(){return this.toString()},n.until=function(r,o){var s=e.from(r);if(o instanceof T){var a=s.value()-this.value();switch(o){case T.YEARS:return a;case T.DECADES:return p.intDiv(a,10);case T.CENTURIES:return p.intDiv(a,100);case T.MILLENNIA:return p.intDiv(a,1e3);case T.ERAS:return s.getLong(h.ERA)-this.getLong(h.ERA)}throw new _e("Unsupported unit: "+o)}return o.between(this,s)},e})(An);Nh=(function(){function t(){}var e=t.prototype;return e.adjustInto=function(i){se("adjustInto")},t})(),lO=(function(){function t(){}return t.firstDayOfMonth=function(){return Lt.FIRST_DAY_OF_MONTH},t.lastDayOfMonth=function(){return Lt.LAST_DAY_OF_MONTH},t.firstDayOfNextMonth=function(){return Lt.FIRST_DAY_OF_NEXT_MONTH},t.firstDayOfYear=function(){return Lt.FIRST_DAY_OF_YEAR},t.lastDayOfYear=function(){return Lt.LAST_DAY_OF_YEAR},t.firstDayOfNextYear=function(){return Lt.FIRST_DAY_OF_NEXT_YEAR},t.firstInMonth=function(n){return C(n,"dayOfWeek"),new Zb(1,n)},t.lastInMonth=function(n){return C(n,"dayOfWeek"),new Zb(-1,n)},t.dayOfWeekInMonth=function(n,i){return C(i,"dayOfWeek"),new Zb(n,i)},t.next=function(n){return new sE(2,n)},t.nextOrSame=function(n){return new sE(0,n)},t.previous=function(n){return new sE(3,n)},t.previousOrSame=function(n){return new sE(1,n)},t})(),Lt=(function(t){le(e,t);function e(i){var r;return r=t.call(this)||this,r._ordinal=i,r}var n=e.prototype;return n.adjustInto=function(r){switch(this._ordinal){case 0:return r.with(h.DAY_OF_MONTH,1);case 1:return r.with(h.DAY_OF_MONTH,r.range(h.DAY_OF_MONTH).maximum());case 2:return r.with(h.DAY_OF_MONTH,1).plus(1,T.MONTHS);case 3:return r.with(h.DAY_OF_YEAR,1);case 4:return r.with(h.DAY_OF_YEAR,r.range(h.DAY_OF_YEAR).maximum());case 5:return r.with(h.DAY_OF_YEAR,1).plus(1,T.YEARS)}throw new Vc("Unreachable")},e})(Nh);Lt.FIRST_DAY_OF_MONTH=new Lt(0);Lt.LAST_DAY_OF_MONTH=new Lt(1);Lt.FIRST_DAY_OF_NEXT_MONTH=new Lt(2);Lt.FIRST_DAY_OF_YEAR=new Lt(3);Lt.LAST_DAY_OF_YEAR=new Lt(4);Lt.FIRST_DAY_OF_NEXT_YEAR=new Lt(5);Zb=(function(t){le(e,t);function e(i,r){var o;return o=t.call(this)||this,o._ordinal=i,o._dowValue=r.value(),o}var n=e.prototype;return n.adjustInto=function(r){if(this._ordinal>=0){var o=r.with(h.DAY_OF_MONTH,1),s=o.get(h.DAY_OF_WEEK),a=p.intMod(this._dowValue-s+7,7);return a+=(this._ordinal-1)*7,o.plus(a,T.DAYS)}else{var c=r.with(h.DAY_OF_MONTH,r.range(h.DAY_OF_MONTH).maximum()),u=c.get(h.DAY_OF_WEEK),l=this._dowValue-u;return l=l===0?0:l>0?l-7:l,l-=(-this._ordinal-1)*7,c.plus(l,T.DAYS)}},e})(Nh),sE=(function(t){le(e,t);function e(i,r){var o;return o=t.call(this)||this,C(r,"dayOfWeek"),o._relative=i,o._dowValue=r.value(),o}var n=e.prototype;return n.adjustInto=function(r){var o=r.get(h.DAY_OF_WEEK);if(this._relative<2&&o===this._dowValue)return r;if((this._relative&1)===0){var s=o-this._dowValue;return r.plus(s>=0?7-s:-s,T.DAYS)}else{var a=this._dowValue-o;return r.minus(a>=0?7-a:-a,T.DAYS)}},e})(Nh),Ne=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}e.isLeapYear=function(r){return(r&3)===0&&(r%100!==0||r%400===0)};var n=e.prototype;return n._updateResolveMap=function(r,o,s){C(r,"fieldValues"),C(o,"field");var a=r.get(o);if(a!=null&&a!==s)throw new $("Invalid state, field: "+o+" "+a+" conflicts with "+o+" "+s);r.put(o,s)},n.resolveDate=function(r,o){if(r.containsKey(h.EPOCH_DAY))return ee.ofEpochDay(r.remove(h.EPOCH_DAY));var s=r.remove(h.PROLEPTIC_MONTH);s!=null&&(o!==ce.LENIENT&&h.PROLEPTIC_MONTH.checkValidValue(s),this._updateResolveMap(r,h.MONTH_OF_YEAR,p.floorMod(s,12)+1),this._updateResolveMap(r,h.YEAR,p.floorDiv(s,12)));var a=r.remove(h.YEAR_OF_ERA);if(a!=null){o!==ce.LENIENT&&h.YEAR_OF_ERA.checkValidValue(a);var c=r.remove(h.ERA);if(c==null){var u=r.get(h.YEAR);o===ce.STRICT?u!=null?this._updateResolveMap(r,h.YEAR,u>0?a:p.safeSubtract(1,a)):r.put(h.YEAR_OF_ERA,a):this._updateResolveMap(r,h.YEAR,u==null||u>0?a:p.safeSubtract(1,a))}else if(c===1)this._updateResolveMap(r,h.YEAR,a);else if(c===0)this._updateResolveMap(r,h.YEAR,p.safeSubtract(1,a));else throw new $("Invalid value for era: "+c)}else r.containsKey(h.ERA)&&h.ERA.checkValidValue(r.get(h.ERA));if(r.containsKey(h.YEAR)){if(r.containsKey(h.MONTH_OF_YEAR)&&r.containsKey(h.DAY_OF_MONTH)){var l=h.YEAR.checkValidIntValue(r.remove(h.YEAR)),d=r.remove(h.MONTH_OF_YEAR),f=r.remove(h.DAY_OF_MONTH);if(o===ce.LENIENT){var m=d-1,_=f-1;return ee.of(l,1,1).plusMonths(m).plusDays(_)}else return o===ce.SMART&&(h.DAY_OF_MONTH.checkValidValue(f),d===4||d===6||d===9||d===11?f=Math.min(f,30):d===2&&(f=Math.min(f,oe.FEBRUARY.length(mr.isLeap(l))))),ee.of(l,d,f)}if(r.containsKey(h.DAY_OF_YEAR)){var E=h.YEAR.checkValidIntValue(r.remove(h.YEAR));if(o===ce.LENIENT){var I=p.safeSubtract(r.remove(h.DAY_OF_YEAR),1);return ee.ofYearDay(E,1).plusDays(I)}var y=h.DAY_OF_YEAR.checkValidIntValue(r.remove(h.DAY_OF_YEAR));return ee.ofYearDay(E,y)}if(r.containsKey(h.ALIGNED_WEEK_OF_YEAR)){if(r.containsKey(h.ALIGNED_DAY_OF_WEEK_IN_YEAR)){var A=h.YEAR.checkValidIntValue(r.remove(h.YEAR));if(o===ce.LENIENT){var S=p.safeSubtract(r.remove(h.ALIGNED_WEEK_OF_YEAR),1),w=p.safeSubtract(r.remove(h.ALIGNED_DAY_OF_WEEK_IN_YEAR),1);return ee.of(A,1,1).plusWeeks(S).plusDays(w)}var N=h.ALIGNED_WEEK_OF_YEAR.checkValidIntValue(r.remove(h.ALIGNED_WEEK_OF_YEAR)),W=h.ALIGNED_DAY_OF_WEEK_IN_YEAR.checkValidIntValue(r.remove(h.ALIGNED_DAY_OF_WEEK_IN_YEAR)),R=ee.of(A,1,1).plusDays((N-1)*7+(W-1));if(o===ce.STRICT&&R.get(h.YEAR)!==A)throw new $("Strict mode rejected date parsed to a different year");return R}if(r.containsKey(h.DAY_OF_WEEK)){var L=h.YEAR.checkValidIntValue(r.remove(h.YEAR));if(o===ce.LENIENT){var b=p.safeSubtract(r.remove(h.ALIGNED_WEEK_OF_YEAR),1),X=p.safeSubtract(r.remove(h.DAY_OF_WEEK),1);return ee.of(L,1,1).plusWeeks(b).plusDays(X)}var K=h.ALIGNED_WEEK_OF_YEAR.checkValidIntValue(r.remove(h.ALIGNED_WEEK_OF_YEAR)),Fe=h.DAY_OF_WEEK.checkValidIntValue(r.remove(h.DAY_OF_WEEK)),Sn=ee.of(L,1,1).plusWeeks(K-1).with(lO.nextOrSame(je.of(Fe)));if(o===ce.STRICT&&Sn.get(h.YEAR)!==L)throw new $("Strict mode rejected date parsed to a different month");return Sn}}}return null},n.date=function(r){return ee.from(r)},e})(Kc);Dr=(function(t){le(e,t),e.from=function(r){if(C(r,"temporal"),r instanceof e)return r;if(r instanceof gr)return r.toOffsetTime();try{var o=v.from(r),s=ae.from(r);return new e(o,s)}catch{throw new $("Unable to obtain OffsetTime TemporalAccessor: "+r+", type "+(r.constructor!=null?r.constructor.name:""))}},e.now=function(r){return arguments.length===0?e._now(xe.systemDefaultZone()):r instanceof xe?e._now(r):e._now(xe.system(r))},e._now=function(r){C(r,"clock");var o=r.instant();return e.ofInstant(o,r.zone().rules().offset(o))},e.of=function(){return arguments.length<=2?e.ofTimeAndOffset.apply(this,arguments):e.ofNumbers.apply(this,arguments)},e.ofNumbers=function(r,o,s,a,c){var u=v.of(r,o,s,a);return new e(u,c)},e.ofTimeAndOffset=function(r,o){return new e(r,o)},e.ofInstant=function(r,o){C(r,"instant"),J(r,Ye,"instant"),C(o,"zone"),J(o,Pe,"zone");var s=o.rules(),a=s.offset(r),c=r.epochSecond()%v.SECONDS_PER_DAY;c=(c+a.totalSeconds())%v.SECONDS_PER_DAY,c<0&&(c+=v.SECONDS_PER_DAY);var u=v.ofSecondOfDay(c,r.nano());return new e(u,a)},e.parse=function(r,o){return o===void 0&&(o=fe.ISO_OFFSET_TIME),C(o,"formatter"),o.parse(r,e.FROM)};function e(i,r){var o;return o=t.call(this)||this,C(i,"time"),J(i,v,"time"),C(r,"offset"),J(r,ae,"offset"),o._time=i,o._offset=r,o}var n=e.prototype;return n.adjustInto=function(r){return r.with(h.NANO_OF_DAY,this._time.toNanoOfDay()).with(h.OFFSET_SECONDS,this.offset().totalSeconds())},n.atDate=function(r){return gr.of(r,this._time,this._offset)},n.format=function(r){return C(r,"formatter"),r.format(this,e.FROM)},n.get=function(r){return t.prototype.get.call(this,r)},n.getLong=function(r){return r instanceof h?r===h.OFFSET_SECONDS?this._offset.totalSeconds():this._time.getLong(r):r.getFrom(this)},n.hour=function(){return this._time.hour()},n.minute=function(){return this._time.minute()},n.second=function(){return this._time.second()},n.nano=function(){return this._time.nano()},n.offset=function(){return this._offset},n.isAfter=function(r){return C(r,"other"),this._toEpochNano()>r._toEpochNano()},n.isBefore=function(r){return C(r,"other"),this._toEpochNano()<r._toEpochNano()},n.isEqual=function(r){return C(r,"other"),this._toEpochNano()===r._toEpochNano()},n.isSupported=function(r){return r instanceof h?r.isTimeBased()||r===h.OFFSET_SECONDS:r instanceof T?r.isTimeBased():r!=null&&r.isSupportedBy(this)},n.minusHours=function(r){return this._withLocalTimeOffset(this._time.minusHours(r),this._offset)},n.minusMinutes=function(r){return this._withLocalTimeOffset(this._time.minusMinutes(r),this._offset)},n.minusSeconds=function(r){return this._withLocalTimeOffset(this._time.minusSeconds(r),this._offset)},n.minusNanos=function(r){return this._withLocalTimeOffset(this._time.minusNanos(r),this._offset)},n._minusAmount=function(r){return C(r),r.subtractFrom(this)},n._minusUnit=function(r,o){return this.plus(-1*r,o)},n._plusAmount=function(r){return C(r),r.addTo(this)},n._plusUnit=function(r,o){return o instanceof T?this._withLocalTimeOffset(this._time.plus(r,o),this._offset):o.addTo(this,r)},n.plusHours=function(r){return this._withLocalTimeOffset(this._time.plusHours(r),this._offset)},n.plusMinutes=function(r){return this._withLocalTimeOffset(this._time.plusMinutes(r),this._offset)},n.plusSeconds=function(r){return this._withLocalTimeOffset(this._time.plusSeconds(r),this._offset)},n.plusNanos=function(r){return this._withLocalTimeOffset(this._time.plusNanos(r),this._offset)},n.query=function(r){return C(r,"query"),r===k.precision()?T.NANOS:r===k.offset()||r===k.zone()?this.offset():r===k.localTime()?this._time:r===k.chronology()||r===k.localDate()||r===k.zoneId()?null:t.prototype.query.call(this,r)},n.range=function(r){return r instanceof h?r===h.OFFSET_SECONDS?r.range():this._time.range(r):r.rangeRefinedBy(this)},n.toLocalTime=function(){return this._time},n.truncatedTo=function(r){return this._withLocalTimeOffset(this._time.truncatedTo(r),this._offset)},n.until=function(r,o){C(r,"endExclusive"),C(o,"unit");var s=e.from(r);if(o instanceof T){var a=s._toEpochNano()-this._toEpochNano();switch(o){case T.NANOS:return a;case T.MICROS:return p.intDiv(a,1e3);case T.MILLIS:return p.intDiv(a,1e6);case T.SECONDS:return p.intDiv(a,v.NANOS_PER_SECOND);case T.MINUTES:return p.intDiv(a,v.NANOS_PER_MINUTE);case T.HOURS:return p.intDiv(a,v.NANOS_PER_HOUR);case T.HALF_DAYS:return p.intDiv(a,12*v.NANOS_PER_HOUR)}throw new _e("Unsupported unit: "+o)}return o.between(this,s)},n.withHour=function(r){return this._withLocalTimeOffset(this._time.withHour(r),this._offset)},n.withMinute=function(r){return this._withLocalTimeOffset(this._time.withMinute(r),this._offset)},n.withSecond=function(r){return this._withLocalTimeOffset(this._time.withSecond(r),this._offset)},n.withNano=function(r){return this._withLocalTimeOffset(this._time.withNano(r),this._offset)},n.withOffsetSameInstant=function(r){if(C(r,"offset"),r.equals(this._offset))return this;var o=r.totalSeconds()-this._offset.totalSeconds(),s=this._time.plusSeconds(o);return new e(s,r)},n.withOffsetSameLocal=function(r){return r!=null&&r.equals(this._offset)?this:new e(this._time,r)},n._toEpochNano=function(){var r=this._time.toNanoOfDay(),o=this._offset.totalSeconds()*v.NANOS_PER_SECOND;return r-o},n._withAdjuster=function(r){return C(r,"adjuster"),r instanceof v?this._withLocalTimeOffset(r,this._offset):r instanceof ae?this._withLocalTimeOffset(this._time,r):r instanceof e?r:r.adjustInto(this)},n._withField=function(r,o){return C(r,"field"),r instanceof h?r===h.OFFSET_SECONDS?this._withLocalTimeOffset(this._time,ae.ofTotalSeconds(r.checkValidIntValue(o))):this._withLocalTimeOffset(this._time.with(r,o),this._offset):r.adjustInto(this,o)},n._withLocalTimeOffset=function(r,o){return this._time===r&&this._offset.equals(o)?this:new e(r,o)},n.compareTo=function(r){if(C(r,"other"),J(r,e,"other"),this._offset.equals(r._offset))return this._time.compareTo(r._time);var o=p.compareNumbers(this._toEpochNano(),r._toEpochNano());return o===0?this._time.compareTo(r._time):o},n.equals=function(r){return this===r?!0:r instanceof e?this._time.equals(r._time)&&this._offset.equals(r._offset):!1},n.hashCode=function(){return this._time.hashCode()^this._offset.hashCode()},n.toString=function(){return this._time.toString()+this._offset.toString()},n.toJSON=function(){return this.toString()},e})(An);dO=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.query=function(r){return r===k.zoneId()||r===k.zone()?this.zone():r===k.chronology()?this.toLocalDate().chronology():r===k.precision()?T.NANOS:r===k.offset()?this.offset():r===k.localDate()?ee.ofEpochDay(this.toLocalDate().toEpochDay()):r===k.localTime()?this.toLocalTime():t.prototype.query.call(this,r)},n.format=function(r){return C(r,"formatter"),r.format(this)},n.toInstant=function(){return Ye.ofEpochSecond(this.toEpochSecond(),this.toLocalTime().nano())},n.toEpochSecond=function(){var r=this.toLocalDate().toEpochDay(),o=r*86400+this.toLocalTime().toSecondOfDay();return o-=this.offset().totalSeconds(),o},n.compareTo=function(r){C(r,"other");var o=p.compareNumbers(this.toEpochSecond(),r.toEpochSecond());return o===0&&(o=this.toLocalTime().nano()-r.toLocalTime().nano(),o===0&&(o=this.toLocalDateTime().compareTo(r.toLocalDateTime()),o===0&&(o=TEe(this.zone().id(),r.zone().id())))),o},n.isAfter=function(r){C(r,"other");var o=this.toEpochSecond(),s=r.toEpochSecond();return o>s||o===s&&this.toLocalTime().nano()>r.toLocalTime().nano()},n.isBefore=function(r){C(r,"other");var o=this.toEpochSecond(),s=r.toEpochSecond();return o<s||o===s&&this.toLocalTime().nano()<r.toLocalTime().nano()},n.isEqual=function(r){return C(r,"other"),this.toEpochSecond()===r.toEpochSecond()&&this.toLocalTime().nano()===r.toLocalTime().nano()},n.equals=function(r){return this===r?!0:r instanceof e?this.compareTo(r)===0:!1},e})(An);_r=(function(t){le(e,t),e.now=function(r){var o;return r instanceof Pe?o=xe.system(r):o=r??xe.systemDefaultZone(),e.ofInstant(o.instant(),o.zone())},e.of=function(){return arguments.length<=2?e.of2.apply(this,arguments):arguments.length===3&&arguments[0]instanceof ee?e.of3.apply(this,arguments):e.of8.apply(this,arguments)},e.of3=function(r,o,s){return e.of2(De.of(r,o),s)},e.of2=function(r,o){return e.ofLocal(r,o,null)},e.of8=function(r,o,s,a,c,u,l,d){var f=De.of(r,o,s,a,c,u,l);return e.ofLocal(f,d,null)},e.ofLocal=function(r,o,s){if(C(r,"localDateTime"),C(o,"zone"),o instanceof ae)return new e(r,o,o);var a=null,c=o.rules(),u=c.validOffsets(r);if(u.length===1)a=u[0];else if(u.length===0){var l=c.transition(r);r=r.plusSeconds(l.duration().seconds()),a=l.offsetAfter()}else s!=null&&u.some(function(d){return d.equals(s)})?a=s:a=C(u[0],"offset");return new e(r,a,o)},e.ofInstant=function(){return arguments.length===2?e.ofInstant2.apply(this,arguments):e.ofInstant3.apply(this,arguments)},e.ofInstant2=function(r,o){return C(r,"instant"),C(o,"zone"),e._create(r.epochSecond(),r.nano(),o)},e.ofInstant3=function(r,o,s){return C(r,"localDateTime"),C(o,"offset"),C(s,"zone"),e._create(r.toEpochSecond(o),r.nano(),s)},e._create=function(r,o,s){var a=s.rules(),c=Ye.ofEpochSecond(r,o),u=a.offset(c),l=De.ofEpochSecond(r,o,u);return new e(l,u,s)},e.ofStrict=function(r,o,s){C(r,"localDateTime"),C(o,"offset"),C(s,"zone");var a=s.rules();if(a.isValidOffset(r,o)===!1){var c=a.transition(r);throw c!=null&&c.isGap()?new $("LocalDateTime "+r+" does not exist in zone "+s+" due to a gap in the local time-line, typically caused by daylight savings"):new $('ZoneOffset "'+o+'" is not valid for LocalDateTime "'+r+'" in zone "'+s+'"')}return new e(r,o,s)},e.ofLenient=function(r,o,s){if(C(r,"localDateTime"),C(o,"offset"),C(s,"zone"),s instanceof ae&&o.equals(s)===!1)throw new Z("ZoneId must match ZoneOffset");return new e(r,o,s)},e.from=function(r){if(C(r,"temporal"),r instanceof e)return r;var o=Pe.from(r);if(r.isSupported(h.INSTANT_SECONDS)){var s=e._from(r,o);if(s!=null)return s}var a=De.from(r);return e.of2(a,o)},e._from=function(r,o){try{return e.__from(r,o)}catch(s){if(!(s instanceof $))throw s}},e.__from=function(r,o){var s=r.getLong(h.INSTANT_SECONDS),a=r.get(h.NANO_OF_SECOND);return e._create(s,a,o)},e.parse=function(r,o){return o===void 0&&(o=fe.ISO_ZONED_DATE_TIME),C(o,"formatter"),o.parse(r,e.FROM)};function e(i,r,o){var s;return C(i,"dateTime"),C(r,"offset"),C(o,"zone"),s=t.call(this)||this,s._dateTime=i,s._offset=r,s._zone=o,s}var n=e.prototype;return n._resolveLocal=function(r){return C(r,"newDateTime"),e.ofLocal(r,this._zone,this._offset)},n._resolveInstant=function(r){return e.ofInstant3(r,this._offset,this._zone)},n._resolveOffset=function(r){return r.equals(this._offset)===!1&&this._zone.rules().isValidOffset(this._dateTime,r)?new e(this._dateTime,r,this._zone):this},n.isSupported=function(r){return r instanceof h?!0:r instanceof T?r.isDateBased()||r.isTimeBased():r!=null&&r.isSupportedBy(this)},n.range=function(r){return r instanceof h?r===h.INSTANT_SECONDS||r===h.OFFSET_SECONDS?r.range():this._dateTime.range(r):r.rangeRefinedBy(this)},n.get=function(r){return this.getLong(r)},n.getLong=function(r){if(r instanceof h){switch(r){case h.INSTANT_SECONDS:return this.toEpochSecond();case h.OFFSET_SECONDS:return this._offset.totalSeconds()}return this._dateTime.getLong(r)}return C(r,"field"),r.getFrom(this)},n.offset=function(){return this._offset},n.withEarlierOffsetAtOverlap=function(){var r=this._zone.rules().transition(this._dateTime);if(r!=null&&r.isOverlap()){var o=r.offsetBefore();if(o.equals(this._offset)===!1)return new e(this._dateTime,o,this._zone)}return this},n.withLaterOffsetAtOverlap=function(){var r=this._zone.rules().transition(this.toLocalDateTime());if(r!=null){var o=r.offsetAfter();if(o.equals(this._offset)===!1)return new e(this._dateTime,o,this._zone)}return this},n.zone=function(){return this._zone},n.withZoneSameLocal=function(r){return C(r,"zone"),this._zone.equals(r)?this:e.ofLocal(this._dateTime,r,this._offset)},n.withZoneSameInstant=function(r){return C(r,"zone"),this._zone.equals(r)?this:e._create(this._dateTime.toEpochSecond(this._offset),this._dateTime.nano(),r)},n.withFixedOffsetZone=function(){return this._zone.equals(this._offset)?this:new e(this._dateTime,this._offset,this._offset)},n.year=function(){return this._dateTime.year()},n.monthValue=function(){return this._dateTime.monthValue()},n.month=function(){return this._dateTime.month()},n.dayOfMonth=function(){return this._dateTime.dayOfMonth()},n.dayOfYear=function(){return this._dateTime.dayOfYear()},n.dayOfWeek=function(){return this._dateTime.dayOfWeek()},n.hour=function(){return this._dateTime.hour()},n.minute=function(){return this._dateTime.minute()},n.second=function(){return this._dateTime.second()},n.nano=function(){return this._dateTime.nano()},n._withAdjuster=function(r){if(r instanceof ee)return this._resolveLocal(De.of(r,this._dateTime.toLocalTime()));if(r instanceof v)return this._resolveLocal(De.of(this._dateTime.toLocalDate(),r));if(r instanceof De)return this._resolveLocal(r);if(r instanceof Ye){var o=r;return e._create(o.epochSecond(),o.nano(),this._zone)}else if(r instanceof ae)return this._resolveOffset(r);return t.prototype._withAdjuster.call(this,r)},n._withField=function(r,o){if(r instanceof h){switch(r){case h.INSTANT_SECONDS:return e._create(o,this.nano(),this._zone);case h.OFFSET_SECONDS:{var s=ae.ofTotalSeconds(r.checkValidIntValue(o));return this._resolveOffset(s)}}return this._resolveLocal(this._dateTime.with(r,o))}return r.adjustInto(this,o)},n.withYear=function(r){return this._resolveLocal(this._dateTime.withYear(r))},n.withMonth=function(r){return this._resolveLocal(this._dateTime.withMonth(r))},n.withDayOfMonth=function(r){return this._resolveLocal(this._dateTime.withDayOfMonth(r))},n.withDayOfYear=function(r){return this._resolveLocal(this._dateTime.withDayOfYear(r))},n.withHour=function(r){return this._resolveLocal(this._dateTime.withHour(r))},n.withMinute=function(r){return this._resolveLocal(this._dateTime.withMinute(r))},n.withSecond=function(r){return this._resolveLocal(this._dateTime.withSecond(r))},n.withNano=function(r){return this._resolveLocal(this._dateTime.withNano(r))},n.truncatedTo=function(r){return this._resolveLocal(this._dateTime.truncatedTo(r))},n._plusUnit=function(r,o){return o instanceof T?o.isDateBased()?this._resolveLocal(this._dateTime.plus(r,o)):this._resolveInstant(this._dateTime.plus(r,o)):(C(o,"unit"),o.addTo(this,r))},n.plusYears=function(r){return this._resolveLocal(this._dateTime.plusYears(r))},n.plusMonths=function(r){return this._resolveLocal(this._dateTime.plusMonths(r))},n.plusWeeks=function(r){return this._resolveLocal(this._dateTime.plusWeeks(r))},n.plusDays=function(r){return this._resolveLocal(this._dateTime.plusDays(r))},n.plusHours=function(r){return this._resolveInstant(this._dateTime.plusHours(r))},n.plusMinutes=function(r){return this._resolveInstant(this._dateTime.plusMinutes(r))},n.plusSeconds=function(r){return this._resolveInstant(this._dateTime.plusSeconds(r))},n.plusNanos=function(r){return this._resolveInstant(this._dateTime.plusNanos(r))},n._minusUnit=function(r,o){return this._plusUnit(-1*r,o)},n.minusYears=function(r){return this.plusYears(-1*r)},n.minusMonths=function(r){return this.plusMonths(-1*r)},n.minusWeeks=function(r){return this.plusWeeks(-1*r)},n.minusDays=function(r){return this.plusDays(-1*r)},n.minusHours=function(r){return this.plusHours(-1*r)},n.minusMinutes=function(r){return this.plusMinutes(-1*r)},n.minusSeconds=function(r){return this.plusSeconds(-1*r)},n.minusNanos=function(r){return this.plusNanos(-1*r)},n.query=function(r){return r===k.localDate()?this.toLocalDate():(C(r,"query"),t.prototype.query.call(this,r))},n.until=function(r,o){var s=e.from(r);if(o instanceof T){if(s=s.withZoneSameInstant(this._zone),o.isDateBased())return this._dateTime.until(s._dateTime,o);var a=this._offset.totalSeconds()-s._offset.totalSeconds(),c=s._dateTime.plusSeconds(a);return this._dateTime.until(c,o)}return o.between(this,s)},n.toLocalDateTime=function(){return this._dateTime},n.toLocalDate=function(){return this._dateTime.toLocalDate()},n.toLocalTime=function(){return this._dateTime.toLocalTime()},n.toOffsetDateTime=function(){return gr.of(this._dateTime,this._offset)},n.equals=function(r){return this===r?!0:r instanceof e?this._dateTime.equals(r._dateTime)&&this._offset.equals(r._offset)&&this._zone.equals(r._zone):!1},n.hashCode=function(){return p.hashCode(this._dateTime.hashCode(),this._offset.hashCode(),this._zone.hashCode())},n.toString=function(){var r=this._dateTime.toString()+this._offset.toString();return this._offset!==this._zone&&(r+="["+this._zone.toString()+"]"),r},n.toJSON=function(){return this.toString()},n.format=function(r){return t.prototype.format.call(this,r)},e})(dO);gr=(function(t){le(e,t),e.from=function(r){if(C(r,"temporal"),r instanceof e)return r;try{var o=ae.from(r);try{var s=De.from(r);return e.of(s,o)}catch{var a=Ye.from(r);return e.ofInstant(a,o)}}catch{throw new $("Unable to obtain OffsetDateTime TemporalAccessor: "+r+", type "+(r.constructor!=null?r.constructor.name:""))}},e.now=function(r){if(arguments.length===0)return e.now(xe.systemDefaultZone());if(C(r,"clockOrZone"),r instanceof Pe)return e.now(xe.system(r));if(r instanceof xe){var o=r.instant();return e.ofInstant(o,r.zone().rules().offset(o))}else throw new Z("clockOrZone must be an instance of ZoneId or Clock")},e.of=function(){return arguments.length<=2?e.ofDateTime.apply(this,arguments):arguments.length===3?e.ofDateAndTime.apply(this,arguments):e.ofNumbers.apply(this,arguments)},e.ofDateTime=function(r,o){return new e(r,o)},e.ofDateAndTime=function(r,o,s){var a=De.of(r,o);return new e(a,s)},e.ofNumbers=function(r,o,s,a,c,u,l,d){a===void 0&&(a=0),c===void 0&&(c=0),u===void 0&&(u=0),l===void 0&&(l=0);var f=De.of(r,o,s,a,c,u,l);return new e(f,d)},e.ofInstant=function(r,o){C(r,"instant"),C(o,"zone");var s=o.rules(),a=s.offset(r),c=De.ofEpochSecond(r.epochSecond(),r.nano(),a);return new e(c,a)},e.parse=function(r,o){return o===void 0&&(o=fe.ISO_OFFSET_DATE_TIME),C(o,"formatter"),o.parse(r,e.FROM)};function e(i,r){var o;return o=t.call(this)||this,C(i,"dateTime"),J(i,De,"dateTime"),C(r,"offset"),J(r,ae,"offset"),o._dateTime=i,o._offset=r,o}var n=e.prototype;return n.adjustInto=function(r){return r.with(h.EPOCH_DAY,this.toLocalDate().toEpochDay()).with(h.NANO_OF_DAY,this.toLocalTime().toNanoOfDay()).with(h.OFFSET_SECONDS,this.offset().totalSeconds())},n.until=function(r,o){var s=e.from(r);return o instanceof T?(s=s.withOffsetSameInstant(this._offset),this._dateTime.until(s._dateTime,o)):o.between(this,s)},n.atZoneSameInstant=function(r){return _r.ofInstant(this._dateTime,this._offset,r)},n.atZoneSimilarLocal=function(r){return _r.ofLocal(this._dateTime,r,this._offset)},n.query=function(r){return C(r,"query"),r===k.chronology()?Ne.INSTANCE:r===k.precision()?T.NANOS:r===k.offset()||r===k.zone()?this.offset():r===k.localDate()?this.toLocalDate():r===k.localTime()?this.toLocalTime():r===k.zoneId()?null:t.prototype.query.call(this,r)},n.get=function(r){if(r instanceof h){switch(r){case h.INSTANT_SECONDS:throw new $("Field too large for an int: "+r);case h.OFFSET_SECONDS:return this.offset().totalSeconds()}return this._dateTime.get(r)}return t.prototype.get.call(this,r)},n.getLong=function(r){if(r instanceof h){switch(r){case h.INSTANT_SECONDS:return this.toEpochSecond();case h.OFFSET_SECONDS:return this.offset().totalSeconds()}return this._dateTime.getLong(r)}return r.getFrom(this)},n.offset=function(){return this._offset},n.year=function(){return this._dateTime.year()},n.monthValue=function(){return this._dateTime.monthValue()},n.month=function(){return this._dateTime.month()},n.dayOfMonth=function(){return this._dateTime.dayOfMonth()},n.dayOfYear=function(){return this._dateTime.dayOfYear()},n.dayOfWeek=function(){return this._dateTime.dayOfWeek()},n.hour=function(){return this._dateTime.hour()},n.minute=function(){return this._dateTime.minute()},n.second=function(){return this._dateTime.second()},n.nano=function(){return this._dateTime.nano()},n.toLocalDateTime=function(){return this._dateTime},n.toLocalDate=function(){return this._dateTime.toLocalDate()},n.toLocalTime=function(){return this._dateTime.toLocalTime()},n.toOffsetTime=function(){return Dr.of(this._dateTime.toLocalTime(),this._offset)},n.toZonedDateTime=function(){return _r.of(this._dateTime,this._offset)},n.toInstant=function(){return this._dateTime.toInstant(this._offset)},n.toEpochSecond=function(){return this._dateTime.toEpochSecond(this._offset)},n.isSupported=function(r){return r instanceof h||r instanceof T?r.isDateBased()||r.isTimeBased():r!=null&&r.isSupportedBy(this)},n.range=function(r){return r instanceof h?r===h.INSTANT_SECONDS||r===h.OFFSET_SECONDS?r.range():this._dateTime.range(r):r.rangeRefinedBy(this)},n._withAdjuster=function(r){return C(r),r instanceof ee||r instanceof v||r instanceof De?this._withDateTimeOffset(this._dateTime.with(r),this._offset):r instanceof Ye?e.ofInstant(r,this._offset):r instanceof ae?this._withDateTimeOffset(this._dateTime,r):r instanceof e?r:r.adjustInto(this)},n._withField=function(r,o){if(C(r),r instanceof h){var s=r;switch(s){case h.INSTANT_SECONDS:return e.ofInstant(Ye.ofEpochSecond(o,this.nano()),this._offset);case h.OFFSET_SECONDS:return this._withDateTimeOffset(this._dateTime,ae.ofTotalSeconds(s.checkValidIntValue(o)))}return this._withDateTimeOffset(this._dateTime.with(r,o),this._offset)}return r.adjustInto(this,o)},n._withDateTimeOffset=function(r,o){return this._dateTime===r&&this._offset.equals(o)?this:new e(r,o)},n.withYear=function(r){return this._withDateTimeOffset(this._dateTime.withYear(r),this._offset)},n.withMonth=function(r){return this._withDateTimeOffset(this._dateTime.withMonth(r),this._offset)},n.withDayOfMonth=function(r){return this._withDateTimeOffset(this._dateTime.withDayOfMonth(r),this._offset)},n.withDayOfYear=function(r){return this._withDateTimeOffset(this._dateTime.withDayOfYear(r),this._offset)},n.withHour=function(r){return this._withDateTimeOffset(this._dateTime.withHour(r),this._offset)},n.withMinute=function(r){return this._withDateTimeOffset(this._dateTime.withMinute(r),this._offset)},n.withSecond=function(r){return this._withDateTimeOffset(this._dateTime.withSecond(r),this._offset)},n.withNano=function(r){return this._withDateTimeOffset(this._dateTime.withNano(r),this._offset)},n.withOffsetSameLocal=function(r){return C(r,"offset"),this._withDateTimeOffset(this._dateTime,r)},n.withOffsetSameInstant=function(r){if(C(r,"offset"),r.equals(this._offset))return this;var o=r.totalSeconds()-this._offset.totalSeconds(),s=this._dateTime.plusSeconds(o);return new e(s,r)},n.truncatedTo=function(r){return this._withDateTimeOffset(this._dateTime.truncatedTo(r),this._offset)},n._plusAmount=function(r){return C(r,"amount"),r.addTo(this)},n._plusUnit=function(r,o){return o instanceof T?this._withDateTimeOffset(this._dateTime.plus(r,o),this._offset):o.addTo(this,r)},n.plusYears=function(r){return this._withDateTimeOffset(this._dateTime.plusYears(r),this._offset)},n.plusMonths=function(r){return this._withDateTimeOffset(this._dateTime.plusMonths(r),this._offset)},n.plusWeeks=function(r){return this._withDateTimeOffset(this._dateTime.plusWeeks(r),this._offset)},n.plusDays=function(r){return this._withDateTimeOffset(this._dateTime.plusDays(r),this._offset)},n.plusHours=function(r){return this._withDateTimeOffset(this._dateTime.plusHours(r),this._offset)},n.plusMinutes=function(r){return this._withDateTimeOffset(this._dateTime.plusMinutes(r),this._offset)},n.plusSeconds=function(r){return this._withDateTimeOffset(this._dateTime.plusSeconds(r),this._offset)},n.plusNanos=function(r){return this._withDateTimeOffset(this._dateTime.plusNanos(r),this._offset)},n._minusAmount=function(r){return C(r),r.subtractFrom(this)},n._minusUnit=function(r,o){return this.plus(-1*r,o)},n.minusYears=function(r){return this._withDateTimeOffset(this._dateTime.minusYears(r),this._offset)},n.minusMonths=function(r){return this._withDateTimeOffset(this._dateTime.minusMonths(r),this._offset)},n.minusWeeks=function(r){return this._withDateTimeOffset(this._dateTime.minusWeeks(r),this._offset)},n.minusDays=function(r){return this._withDateTimeOffset(this._dateTime.minusDays(r),this._offset)},n.minusHours=function(r){return this._withDateTimeOffset(this._dateTime.minusHours(r),this._offset)},n.minusMinutes=function(r){return this._withDateTimeOffset(this._dateTime.minusMinutes(r),this._offset)},n.minusSeconds=function(r){return this._withDateTimeOffset(this._dateTime.minusSeconds(r),this._offset)},n.minusNanos=function(r){return this._withDateTimeOffset(this._dateTime.minusNanos(r),this._offset)},n.compareTo=function(r){if(C(r,"other"),J(r,e,"other"),this.offset().equals(r.offset()))return this.toLocalDateTime().compareTo(r.toLocalDateTime());var o=p.compareNumbers(this.toEpochSecond(),r.toEpochSecond());return o===0&&(o=this.toLocalTime().nano()-r.toLocalTime().nano(),o===0&&(o=this.toLocalDateTime().compareTo(r.toLocalDateTime()))),o},n.isAfter=function(r){C(r,"other");var o=this.toEpochSecond(),s=r.toEpochSecond();return o>s||o===s&&this.toLocalTime().nano()>r.toLocalTime().nano()},n.isBefore=function(r){C(r,"other");var o=this.toEpochSecond(),s=r.toEpochSecond();return o<s||o===s&&this.toLocalTime().nano()<r.toLocalTime().nano()},n.isEqual=function(r){return C(r,"other"),this.toEpochSecond()===r.toEpochSecond()&&this.toLocalTime().nano()===r.toLocalTime().nano()},n.equals=function(r){return this===r?!0:r instanceof e?this._dateTime.equals(r._dateTime)&&this._offset.equals(r._offset):!1},n.hashCode=function(){return this._dateTime.hashCode()^this._offset.hashCode()},n.toString=function(){return this._dateTime.toString()+this._offset.toString()},n.toJSON=function(){return this.toString()},n.format=function(r){return C(r,"formatter"),r.format(this)},e})(An);uE=146097,m$=uE*5-(30*365+7),ee=(function(t){le(e,t),e.now=function(r){var o;return r==null?o=xe.systemDefaultZone():r instanceof Pe?o=xe.system(r):o=r,e.ofInstant(o.instant(),o.zone())},e.ofInstant=function(r,o){o===void 0&&(o=Pe.systemDefault()),C(r,"instant");var s=o.rules().offset(r),a=r.epochSecond()+s.totalSeconds(),c=p.floorDiv(a,v.SECONDS_PER_DAY);return e.ofEpochDay(c)},e.of=function(r,o,s){return new e(r,o,s)},e.ofYearDay=function(r,o){h.YEAR.checkValidValue(r);var s=Ne.isLeapYear(r);o===366&&s===!1&&Ue(!1,"Invalid date 'DayOfYear 366' as '"+r+"' is not a leap year",$);var a=oe.of(Math.floor((o-1)/31+1)),c=a.firstDayOfYear(s)+a.length(s)-1;o>c&&(a=a.plus(1));var u=o-a.firstDayOfYear(s)+1;return new e(r,a.value(),u)},e.ofEpochDay=function(r){r===void 0&&(r=0);var o,s,a,c,u;u=r+m$,u-=60,o=0,u<0&&(s=p.intDiv(u+1,uE)-1,o=s*400,u+=-s*uE),c=p.intDiv(400*u+591,uE),a=u-(365*c+p.intDiv(c,4)-p.intDiv(c,100)+p.intDiv(c,400)),a<0&&(c--,a=u-(365*c+p.intDiv(c,4)-p.intDiv(c,100)+p.intDiv(c,400))),c+=o;var l=a,d=p.intDiv(l*5+2,153),f=(d+2)%12+1,m=l-p.intDiv(d*306+5,10)+1;c+=p.intDiv(d,10);var _=c;return new e(_,f,m)},e.from=function(r){C(r,"temporal");var o=r.query(k.localDate());if(o==null)throw new $("Unable to obtain LocalDate from TemporalAccessor: "+r+", type "+(r.constructor!=null?r.constructor.name:""));return o},e.parse=function(r,o){return o===void 0&&(o=fe.ISO_LOCAL_DATE),Ue(o!=null,"formatter",ui),o.parse(r,e.FROM)},e._resolvePreviousValid=function(r,o,s){switch(o){case 2:s=Math.min(s,Ne.isLeapYear(r)?29:28);break;case 4:case 6:case 9:case 11:s=Math.min(s,30);break}return e.of(r,o,s)};function e(i,r,o){var s;return s=t.call(this)||this,C(i,"year"),C(r,"month"),C(o,"dayOfMonth"),r instanceof oe&&(r=r.value()),s._year=p.safeToInt(i),s._month=p.safeToInt(r),s._day=p.safeToInt(o),e._validate(s._year,s._month,s._day),s}e._validate=function(r,o,s){var a;if(h.YEAR.checkValidValue(r),h.MONTH_OF_YEAR.checkValidValue(o),h.DAY_OF_MONTH.checkValidValue(s),s>28){switch(a=31,o){case 2:a=Ne.isLeapYear(r)?29:28;break;case 4:case 6:case 9:case 11:a=30}s>a&&(s===29?Ue(!1,"Invalid date 'February 29' as '"+r+"' is not a leap year",$):Ue(!1,"Invalid date '"+r+"' '"+o+"' '"+s+"'",$))}};var n=e.prototype;return n.isSupported=function(r){return t.prototype.isSupported.call(this,r)},n.range=function(r){if(r instanceof h){if(r.isDateBased()){switch(r){case h.DAY_OF_MONTH:return ue.of(1,this.lengthOfMonth());case h.DAY_OF_YEAR:return ue.of(1,this.lengthOfYear());case h.ALIGNED_WEEK_OF_MONTH:return ue.of(1,this.month()===oe.FEBRUARY&&this.isLeapYear()===!1?4:5);case h.YEAR_OF_ERA:return this._year<=0?ue.of(1,mr.MAX_VALUE+1):ue.of(1,mr.MAX_VALUE)}return r.range()}throw new _e("Unsupported field: "+r)}return r.rangeRefinedBy(this)},n.get=function(r){return this.getLong(r)},n.getLong=function(r){return Ue(r!=null,"",ui),r instanceof h?this._get0(r):r.getFrom(this)},n._get0=function(r){switch(r){case h.DAY_OF_WEEK:return this.dayOfWeek().value();case h.ALIGNED_DAY_OF_WEEK_IN_MONTH:return p.intMod(this._day-1,7)+1;case h.ALIGNED_DAY_OF_WEEK_IN_YEAR:return p.intMod(this.dayOfYear()-1,7)+1;case h.DAY_OF_MONTH:return this._day;case h.DAY_OF_YEAR:return this.dayOfYear();case h.EPOCH_DAY:return this.toEpochDay();case h.ALIGNED_WEEK_OF_MONTH:return p.intDiv(this._day-1,7)+1;case h.ALIGNED_WEEK_OF_YEAR:return p.intDiv(this.dayOfYear()-1,7)+1;case h.MONTH_OF_YEAR:return this._month;case h.PROLEPTIC_MONTH:return this._prolepticMonth();case h.YEAR_OF_ERA:return this._year>=1?this._year:1-this._year;case h.YEAR:return this._year;case h.ERA:return this._year>=1?1:0}throw new _e("Unsupported field: "+r)},n._prolepticMonth=function(){return this._year*12+(this._month-1)},n.chronology=function(){return Ne.INSTANCE},n.year=function(){return this._year},n.monthValue=function(){return this._month},n.month=function(){return oe.of(this._month)},n.dayOfMonth=function(){return this._day},n.dayOfYear=function(){return this.month().firstDayOfYear(this.isLeapYear())+this._day-1},n.dayOfWeek=function(){var r=p.floorMod(this.toEpochDay()+3,7);return je.of(r+1)},n.isLeapYear=function(){return Ne.isLeapYear(this._year)},n.lengthOfMonth=function(){switch(this._month){case 2:return this.isLeapYear()?29:28;case 4:case 6:case 9:case 11:return 30;default:return 31}},n.lengthOfYear=function(){return this.isLeapYear()?366:365},n._withAdjuster=function(r){return C(r,"adjuster"),r instanceof e?r:t.prototype._withAdjuster.call(this,r)},n._withField=function(r,o){if(Ue(r!=null,"field",ui),r instanceof h){var s=r;switch(s.checkValidValue(o),s){case h.DAY_OF_WEEK:return this.plusDays(o-this.dayOfWeek().value());case h.ALIGNED_DAY_OF_WEEK_IN_MONTH:return this.plusDays(o-this.getLong(h.ALIGNED_DAY_OF_WEEK_IN_MONTH));case h.ALIGNED_DAY_OF_WEEK_IN_YEAR:return this.plusDays(o-this.getLong(h.ALIGNED_DAY_OF_WEEK_IN_YEAR));case h.DAY_OF_MONTH:return this.withDayOfMonth(o);case h.DAY_OF_YEAR:return this.withDayOfYear(o);case h.EPOCH_DAY:return e.ofEpochDay(o);case h.ALIGNED_WEEK_OF_MONTH:return this.plusWeeks(o-this.getLong(h.ALIGNED_WEEK_OF_MONTH));case h.ALIGNED_WEEK_OF_YEAR:return this.plusWeeks(o-this.getLong(h.ALIGNED_WEEK_OF_YEAR));case h.MONTH_OF_YEAR:return this.withMonth(o);case h.PROLEPTIC_MONTH:return this.plusMonths(o-this.getLong(h.PROLEPTIC_MONTH));case h.YEAR_OF_ERA:return this.withYear(this._year>=1?o:1-o);case h.YEAR:return this.withYear(o);case h.ERA:return this.getLong(h.ERA)===o?this:this.withYear(1-this._year)}throw new _e("Unsupported field: "+r)}return r.adjustInto(this,o)},n.withYear=function(r){return this._year===r?this:(h.YEAR.checkValidValue(r),e._resolvePreviousValid(r,this._month,this._day))},n.withMonth=function(r){var o=r instanceof oe?r.value():r;return this._month===o?this:(h.MONTH_OF_YEAR.checkValidValue(o),e._resolvePreviousValid(this._year,o,this._day))},n.withDayOfMonth=function(r){return this._day===r?this:e.of(this._year,this._month,r)},n.withDayOfYear=function(r){return this.dayOfYear()===r?this:e.ofYearDay(this._year,r)},n._plusUnit=function(r,o){if(C(r,"amountToAdd"),C(o,"unit"),o instanceof T){switch(o){case T.DAYS:return this.plusDays(r);case T.WEEKS:return this.plusWeeks(r);case T.MONTHS:return this.plusMonths(r);case T.YEARS:return this.plusYears(r);case T.DECADES:return this.plusYears(p.safeMultiply(r,10));case T.CENTURIES:return this.plusYears(p.safeMultiply(r,100));case T.MILLENNIA:return this.plusYears(p.safeMultiply(r,1e3));case T.ERAS:return this.with(h.ERA,p.safeAdd(this.getLong(h.ERA),r))}throw new _e("Unsupported unit: "+o)}return o.addTo(this,r)},n.plusYears=function(r){if(r===0)return this;var o=h.YEAR.checkValidIntValue(this._year+r);return e._resolvePreviousValid(o,this._month,this._day)},n.plusMonths=function(r){if(r===0)return this;var o=this._year*12+(this._month-1),s=o+r,a=h.YEAR.checkValidIntValue(p.floorDiv(s,12)),c=p.floorMod(s,12)+1;return e._resolvePreviousValid(a,c,this._day)},n.plusWeeks=function(r){return this.plusDays(p.safeMultiply(r,7))},n.plusDays=function(r){if(r===0)return this;var o=p.safeAdd(this.toEpochDay(),r);return e.ofEpochDay(o)},n._minusUnit=function(r,o){return C(r,"amountToSubtract"),C(o,"unit"),this._plusUnit(-1*r,o)},n.minusYears=function(r){return this.plusYears(r*-1)},n.minusMonths=function(r){return this.plusMonths(r*-1)},n.minusWeeks=function(r){return this.plusWeeks(r*-1)},n.minusDays=function(r){return this.plusDays(r*-1)},n.query=function(r){return C(r,"query"),r===k.localDate()?this:t.prototype.query.call(this,r)},n.adjustInto=function(r){return t.prototype.adjustInto.call(this,r)},n.until=function(r,o){return arguments.length<2?this.until1(r):this.until2(r,o)},n.until2=function(r,o){var s=e.from(r);if(o instanceof T){switch(o){case T.DAYS:return this.daysUntil(s);case T.WEEKS:return p.intDiv(this.daysUntil(s),7);case T.MONTHS:return this._monthsUntil(s);case T.YEARS:return p.intDiv(this._monthsUntil(s),12);case T.DECADES:return p.intDiv(this._monthsUntil(s),120);case T.CENTURIES:return p.intDiv(this._monthsUntil(s),1200);case T.MILLENNIA:return p.intDiv(this._monthsUntil(s),12e3);case T.ERAS:return s.getLong(h.ERA)-this.getLong(h.ERA)}throw new _e("Unsupported unit: "+o)}return o.between(this,s)},n.daysUntil=function(r){return r.toEpochDay()-this.toEpochDay()},n._monthsUntil=function(r){var o=this._prolepticMonth()*32+this.dayOfMonth(),s=r._prolepticMonth()*32+r.dayOfMonth();return p.intDiv(s-o,32)},n.until1=function(r){var o=e.from(r),s=o._prolepticMonth()-this._prolepticMonth(),a=o._day-this._day;if(s>0&&a<0){s--;var c=this.plusMonths(s);a=o.toEpochDay()-c.toEpochDay()}else s<0&&a>0&&(s++,a-=o.lengthOfMonth());var u=p.intDiv(s,12),l=p.intMod(s,12);return si.of(u,l,a)},n.atTime=function(){return arguments.length===1?this.atTime1.apply(this,arguments):this.atTime4.apply(this,arguments)},n.atTime1=function(r){if(C(r,"time"),r instanceof v)return De.of(this,r);if(r instanceof Dr)return this._atTimeOffsetTime(r);throw new Z("time must be an instance of LocalTime or OffsetTime"+(r&&r.constructor&&r.constructor.name?", but is "+r.constructor.name:""))},n.atTime4=function(r,o,s,a){return s===void 0&&(s=0),a===void 0&&(a=0),this.atTime1(v.of(r,o,s,a))},n._atTimeOffsetTime=function(r){return gr.of(De.of(this,r.toLocalTime()),r.offset())},n.atStartOfDay=function(r){return r!=null?this._atStartOfDayWithZone(r):De.of(this,v.MIDNIGHT)},n._atStartOfDayWithZone=function(r){C(r,"zone");var o=this.atTime(v.MIDNIGHT);if(!(r instanceof ae)){var s=r.rules().transition(o);s!=null&&s.isGap()&&(o=s.dateTimeAfter())}return _r.of(o,r)},n.toEpochDay=function(){var r=this._year,o=this._month,s=0;return s+=365*r,r>=0?s+=p.intDiv(r+3,4)-p.intDiv(r+99,100)+p.intDiv(r+399,400):s-=p.intDiv(r,-4)-p.intDiv(r,-100)+p.intDiv(r,-400),s+=p.intDiv(367*o-362,12),s+=this.dayOfMonth()-1,o>2&&(s--,Ne.isLeapYear(r)||s--),s-m$},n.compareTo=function(r){return C(r,"other"),J(r,e,"other"),this._compareTo0(r)},n._compareTo0=function(r){var o=this._year-r._year;return o===0&&(o=this._month-r._month,o===0&&(o=this._day-r._day)),o},n.isAfter=function(r){return this.compareTo(r)>0},n.isBefore=function(r){return this.compareTo(r)<0},n.isEqual=function(r){return this.compareTo(r)===0},n.equals=function(r){return this===r?!0:r instanceof e?this._compareTo0(r)===0:!1},n.hashCode=function(){var r=this._year,o=this._month,s=this._day;return p.hash(r&4294965248^(r<<11)+(o<<6)+s)},n.toString=function(){var r,o,s,a=this._year,c=this._month,u=this._day,l=Math.abs(a);return l<1e3?a<0?s="-"+(""+(a-1e4)).slice(-4):s=(""+(a+1e4)).slice(-4):a>9999?s="+"+a:s=""+a,c<10?o="-0"+c:o="-"+c,u<10?r="-0"+u:r="-"+u,s+o+r},n.toJSON=function(){return this.toString()},n.format=function(r){return C(r,"formatter"),J(r,fe,"formatter"),t.prototype.format.call(this,r)},e})($c);hO=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.chronology=function(){return this.toLocalDate().chronology()},n.query=function(r){return r===k.chronology()?this.chronology():r===k.precision()?T.NANOS:r===k.localDate()?ee.ofEpochDay(this.toLocalDate().toEpochDay()):r===k.localTime()?this.toLocalTime():r===k.zone()||r===k.zoneId()||r===k.offset()?null:t.prototype.query.call(this,r)},n.adjustInto=function(r){return r.with(h.EPOCH_DAY,this.toLocalDate().toEpochDay()).with(h.NANO_OF_DAY,this.toLocalTime().toNanoOfDay())},n.toInstant=function(r){return J(r,ae,"zoneId"),Ye.ofEpochSecond(this.toEpochSecond(r),this.toLocalTime().nano())},n.toEpochSecond=function(r){C(r,"offset");var o=this.toLocalDate().toEpochDay(),s=o*86400+this.toLocalTime().toSecondOfDay();return s-=r.totalSeconds(),p.safeToInt(s)},e})(An),De=(function(t){le(e,t),e.now=function(r){return r==null?e._now(xe.systemDefaultZone()):r instanceof xe?e._now(r):e._now(xe.system(r))},e._now=function(r){return C(r,"clock"),e.ofInstant(r.instant(),r.zone())},e._ofEpochMillis=function(r,o){var s=p.floorDiv(r,1e3)+o.totalSeconds(),a=p.floorDiv(s,v.SECONDS_PER_DAY),c=p.floorMod(s,v.SECONDS_PER_DAY),u=p.floorMod(r,1e3)*1e6,l=ee.ofEpochDay(a),d=v.ofSecondOfDay(c,u);return new e(l,d)},e.of=function(){return arguments.length<=2?e.ofDateAndTime.apply(this,arguments):e.ofNumbers.apply(this,arguments)},e.ofNumbers=function(r,o,s,a,c,u,l){a===void 0&&(a=0),c===void 0&&(c=0),u===void 0&&(u=0),l===void 0&&(l=0);var d=ee.of(r,o,s),f=v.of(a,c,u,l);return new e(d,f)},e.ofDateAndTime=function(r,o){return C(r,"date"),C(o,"time"),new e(r,o)},e.ofInstant=function(r,o){o===void 0&&(o=Pe.systemDefault()),C(r,"instant"),J(r,Ye,"instant"),C(o,"zone");var s=o.rules().offset(r);return e.ofEpochSecond(r.epochSecond(),r.nano(),s)},e.ofEpochSecond=function(r,o,s){r===void 0&&(r=0),o===void 0&&(o=0),arguments.length===2&&o instanceof ae&&(s=o,o=0),C(s,"offset");var a=r+s.totalSeconds(),c=p.floorDiv(a,v.SECONDS_PER_DAY),u=p.floorMod(a,v.SECONDS_PER_DAY),l=ee.ofEpochDay(c),d=v.ofSecondOfDay(u,o);return new e(l,d)},e.from=function(r){if(C(r,"temporal"),r instanceof e)return r;if(r instanceof _r)return r.toLocalDateTime();try{var o=ee.from(r),s=v.from(r);return new e(o,s)}catch{throw new $("Unable to obtain LocalDateTime TemporalAccessor: "+r+", type "+(r.constructor!=null?r.constructor.name:""))}},e.parse=function(r,o){return o===void 0&&(o=fe.ISO_LOCAL_DATE_TIME),C(o,"formatter"),o.parse(r,e.FROM)};function e(i,r){var o;return o=t.call(this)||this,J(i,ee,"date"),J(r,v,"time"),o._date=i,o._time=r,o}var n=e.prototype;return n._withDateTime=function(r,o){return this._date.equals(r)&&this._time.equals(o)?this:new e(r,o)},n.isSupported=function(r){return r instanceof h||r instanceof T?r.isDateBased()||r.isTimeBased():r!=null&&r.isSupportedBy(this)},n.range=function(r){return r instanceof h?r.isTimeBased()?this._time.range(r):this._date.range(r):r.rangeRefinedBy(this)},n.get=function(r){return r instanceof h?r.isTimeBased()?this._time.get(r):this._date.get(r):t.prototype.get.call(this,r)},n.getLong=function(r){return C(r,"field"),r instanceof h?r.isTimeBased()?this._time.getLong(r):this._date.getLong(r):r.getFrom(this)},n.year=function(){return this._date.year()},n.monthValue=function(){return this._date.monthValue()},n.month=function(){return this._date.month()},n.dayOfMonth=function(){return this._date.dayOfMonth()},n.dayOfYear=function(){return this._date.dayOfYear()},n.dayOfWeek=function(){return this._date.dayOfWeek()},n.hour=function(){return this._time.hour()},n.minute=function(){return this._time.minute()},n.second=function(){return this._time.second()},n.nano=function(){return this._time.nano()},n._withAdjuster=function(r){return C(r,"adjuster"),r instanceof ee?this._withDateTime(r,this._time):r instanceof v?this._withDateTime(this._date,r):r instanceof e?r:t.prototype._withAdjuster.call(this,r)},n._withField=function(r,o){return C(r,"field"),r instanceof h?r.isTimeBased()?this._withDateTime(this._date,this._time.with(r,o)):this._withDateTime(this._date.with(r,o),this._time):r.adjustInto(this,o)},n.withYear=function(r){return this._withDateTime(this._date.withYear(r),this._time)},n.withMonth=function(r){return this._withDateTime(this._date.withMonth(r),this._time)},n.withDayOfMonth=function(r){return this._withDateTime(this._date.withDayOfMonth(r),this._time)},n.withDayOfYear=function(r){return this._withDateTime(this._date.withDayOfYear(r),this._time)},n.withHour=function(r){var o=this._time.withHour(r);return this._withDateTime(this._date,o)},n.withMinute=function(r){var o=this._time.withMinute(r);return this._withDateTime(this._date,o)},n.withSecond=function(r){var o=this._time.withSecond(r);return this._withDateTime(this._date,o)},n.withNano=function(r){var o=this._time.withNano(r);return this._withDateTime(this._date,o)},n.truncatedTo=function(r){return this._withDateTime(this._date,this._time.truncatedTo(r))},n._plusUnit=function(r,o){if(C(o,"unit"),o instanceof T){switch(o){case T.NANOS:return this.plusNanos(r);case T.MICROS:return this.plusDays(p.intDiv(r,v.MICROS_PER_DAY)).plusNanos(p.intMod(r,v.MICROS_PER_DAY)*1e3);case T.MILLIS:return this.plusDays(p.intDiv(r,v.MILLIS_PER_DAY)).plusNanos(p.intMod(r,v.MILLIS_PER_DAY)*1e6);case T.SECONDS:return this.plusSeconds(r);case T.MINUTES:return this.plusMinutes(r);case T.HOURS:return this.plusHours(r);case T.HALF_DAYS:return this.plusDays(p.intDiv(r,256)).plusHours(p.intMod(r,256)*12)}return this._withDateTime(this._date.plus(r,o),this._time)}return o.addTo(this,r)},n.plusYears=function(r){var o=this._date.plusYears(r);return this._withDateTime(o,this._time)},n.plusMonths=function(r){var o=this._date.plusMonths(r);return this._withDateTime(o,this._time)},n.plusWeeks=function(r){var o=this._date.plusWeeks(r);return this._withDateTime(o,this._time)},n.plusDays=function(r){var o=this._date.plusDays(r);return this._withDateTime(o,this._time)},n.plusHours=function(r){return this._plusWithOverflow(this._date,r,0,0,0,1)},n.plusMinutes=function(r){return this._plusWithOverflow(this._date,0,r,0,0,1)},n.plusSeconds=function(r){return this._plusWithOverflow(this._date,0,0,r,0,1)},n.plusNanos=function(r){return this._plusWithOverflow(this._date,0,0,0,r,1)},n._minusUnit=function(r,o){return C(o,"unit"),this._plusUnit(-1*r,o)},n.minusYears=function(r){return this.plusYears(-1*r)},n.minusMonths=function(r){return this.plusMonths(-1*r)},n.minusWeeks=function(r){return this.plusWeeks(-1*r)},n.minusDays=function(r){return this.plusDays(-1*r)},n.minusHours=function(r){return this._plusWithOverflow(this._date,r,0,0,0,-1)},n.minusMinutes=function(r){return this._plusWithOverflow(this._date,0,r,0,0,-1)},n.minusSeconds=function(r){return this._plusWithOverflow(this._date,0,0,r,0,-1)},n.minusNanos=function(r){return this._plusWithOverflow(this._date,0,0,0,r,-1)},n._plusWithOverflow=function(r,o,s,a,c,u){if(o===0&&s===0&&a===0&&c===0)return this._withDateTime(r,this._time);var l=p.intDiv(c,v.NANOS_PER_DAY)+p.intDiv(a,v.SECONDS_PER_DAY)+p.intDiv(s,v.MINUTES_PER_DAY)+p.intDiv(o,v.HOURS_PER_DAY);l*=u;var d=p.intMod(c,v.NANOS_PER_DAY)+p.intMod(a,v.SECONDS_PER_DAY)*v.NANOS_PER_SECOND+p.intMod(s,v.MINUTES_PER_DAY)*v.NANOS_PER_MINUTE+p.intMod(o,v.HOURS_PER_DAY)*v.NANOS_PER_HOUR,f=this._time.toNanoOfDay();d=d*u+f,l+=p.floorDiv(d,v.NANOS_PER_DAY);var m=p.floorMod(d,v.NANOS_PER_DAY),_=m===f?this._time:v.ofNanoOfDay(m);return this._withDateTime(r.plusDays(l),_)},n.query=function(r){return C(r,"query"),r===k.localDate()?this.toLocalDate():t.prototype.query.call(this,r)},n.adjustInto=function(r){return t.prototype.adjustInto.call(this,r)},n.until=function(r,o){C(r,"endExclusive"),C(o,"unit");var s=e.from(r);if(o instanceof T){if(o.isTimeBased()){var a=this._date.daysUntil(s._date),c=s._time.toNanoOfDay()-this._time.toNanoOfDay();a>0&&c<0?(a--,c+=v.NANOS_PER_DAY):a<0&&c>0&&(a++,c-=v.NANOS_PER_DAY);var u=a;switch(o){case T.NANOS:return u=p.safeMultiply(u,v.NANOS_PER_DAY),p.safeAdd(u,c);case T.MICROS:return u=p.safeMultiply(u,v.MICROS_PER_DAY),p.safeAdd(u,p.intDiv(c,1e3));case T.MILLIS:return u=p.safeMultiply(u,v.MILLIS_PER_DAY),p.safeAdd(u,p.intDiv(c,1e6));case T.SECONDS:return u=p.safeMultiply(u,v.SECONDS_PER_DAY),p.safeAdd(u,p.intDiv(c,v.NANOS_PER_SECOND));case T.MINUTES:return u=p.safeMultiply(u,v.MINUTES_PER_DAY),p.safeAdd(u,p.intDiv(c,v.NANOS_PER_MINUTE));case T.HOURS:return u=p.safeMultiply(u,v.HOURS_PER_DAY),p.safeAdd(u,p.intDiv(c,v.NANOS_PER_HOUR));case T.HALF_DAYS:return u=p.safeMultiply(u,2),p.safeAdd(u,p.intDiv(c,v.NANOS_PER_HOUR*12))}throw new _e("Unsupported unit: "+o)}var l=s._date,d=s._time;return l.isAfter(this._date)&&d.isBefore(this._time)?l=l.minusDays(1):l.isBefore(this._date)&&d.isAfter(this._time)&&(l=l.plusDays(1)),this._date.until(l,o)}return o.between(this,s)},n.atOffset=function(r){return gr.of(this,r)},n.atZone=function(r){return _r.of(this,r)},n.toLocalDate=function(){return this._date},n.toLocalTime=function(){return this._time},n.compareTo=function(r){return C(r,"other"),J(r,e,"other"),this._compareTo0(r)},n._compareTo0=function(r){var o=this._date.compareTo(r.toLocalDate());return o===0&&(o=this._time.compareTo(r.toLocalTime())),o},n.isAfter=function(r){return this.compareTo(r)>0},n.isBefore=function(r){return this.compareTo(r)<0},n.isEqual=function(r){return this.compareTo(r)===0},n.equals=function(r){return this===r?!0:r instanceof e?this._date.equals(r._date)&&this._time.equals(r._time):!1},n.hashCode=function(){return this._date.hashCode()^this._time.hashCode()},n.toString=function(){return this._date.toString()+"T"+this._time.toString()},n.toJSON=function(){return this.toString()},n.format=function(r){return C(r,"formatter"),r.format(this)},e})(hO);v=(function(t){le(e,t),e.now=function(r){return r==null?e._now(xe.systemDefaultZone()):r instanceof xe?e._now(r):e._now(xe.system(r))},e._now=function(r){return r===void 0&&(r=xe.systemDefaultZone()),C(r,"clock"),e.ofInstant(r.instant(),r.zone())},e.ofInstant=function(r,o){o===void 0&&(o=Pe.systemDefault());var s=o.rules().offset(r),a=p.intMod(r.epochSecond(),e.SECONDS_PER_DAY);return a=p.intMod(a+s.totalSeconds(),e.SECONDS_PER_DAY),a<0&&(a+=e.SECONDS_PER_DAY),e.ofSecondOfDay(a,r.nano())},e.of=function(r,o,s,a){return new e(r,o,s,a)},e.ofSecondOfDay=function(r,o){r===void 0&&(r=0),o===void 0&&(o=0),h.SECOND_OF_DAY.checkValidValue(r),h.NANO_OF_SECOND.checkValidValue(o);var s=p.intDiv(r,e.SECONDS_PER_HOUR);r-=s*e.SECONDS_PER_HOUR;var a=p.intDiv(r,e.SECONDS_PER_MINUTE);return r-=a*e.SECONDS_PER_MINUTE,new e(s,a,r,o)},e.ofNanoOfDay=function(r){r===void 0&&(r=0),h.NANO_OF_DAY.checkValidValue(r);var o=p.intDiv(r,e.NANOS_PER_HOUR);r-=o*e.NANOS_PER_HOUR;var s=p.intDiv(r,e.NANOS_PER_MINUTE);r-=s*e.NANOS_PER_MINUTE;var a=p.intDiv(r,e.NANOS_PER_SECOND);return r-=a*e.NANOS_PER_SECOND,new e(o,s,a,r)},e.from=function(r){C(r,"temporal");var o=r.query(k.localTime());if(o==null)throw new $("Unable to obtain LocalTime TemporalAccessor: "+r+", type "+(r.constructor!=null?r.constructor.name:""));return o},e.parse=function(r,o){return o===void 0&&(o=fe.ISO_LOCAL_TIME),C(o,"formatter"),o.parse(r,e.FROM)};function e(i,r,o,s){var a;i===void 0&&(i=0),r===void 0&&(r=0),o===void 0&&(o=0),s===void 0&&(s=0),a=t.call(this)||this;var c=p.safeToInt(i),u=p.safeToInt(r),l=p.safeToInt(o),d=p.safeToInt(s);return e._validate(c,u,l,d),u===0&&l===0&&d===0?(e.HOURS[c]||(a._hour=c,a._minute=u,a._second=l,a._nano=d,e.HOURS[c]=Ih(a)),e.HOURS[c]||Ih(a)):(a._hour=c,a._minute=u,a._second=l,a._nano=d,a)}e._validate=function(r,o,s,a){h.HOUR_OF_DAY.checkValidValue(r),h.MINUTE_OF_HOUR.checkValidValue(o),h.SECOND_OF_MINUTE.checkValidValue(s),h.NANO_OF_SECOND.checkValidValue(a)};var n=e.prototype;return n.isSupported=function(r){return r instanceof h||r instanceof T?r.isTimeBased():r!=null&&r.isSupportedBy(this)},n.range=function(r){return C(r),t.prototype.range.call(this,r)},n.get=function(r){return this.getLong(r)},n.getLong=function(r){return C(r,"field"),r instanceof h?this._get0(r):r.getFrom(this)},n._get0=function(r){switch(r){case h.NANO_OF_SECOND:return this._nano;case h.NANO_OF_DAY:return this.toNanoOfDay();case h.MICRO_OF_SECOND:return p.intDiv(this._nano,1e3);case h.MICRO_OF_DAY:return p.intDiv(this.toNanoOfDay(),1e3);case h.MILLI_OF_SECOND:return p.intDiv(this._nano,1e6);case h.MILLI_OF_DAY:return p.intDiv(this.toNanoOfDay(),1e6);case h.SECOND_OF_MINUTE:return this._second;case h.SECOND_OF_DAY:return this.toSecondOfDay();case h.MINUTE_OF_HOUR:return this._minute;case h.MINUTE_OF_DAY:return this._hour*60+this._minute;case h.HOUR_OF_AMPM:return p.intMod(this._hour,12);case h.CLOCK_HOUR_OF_AMPM:{var o=p.intMod(this._hour,12);return o%12===0?12:o}case h.HOUR_OF_DAY:return this._hour;case h.CLOCK_HOUR_OF_DAY:return this._hour===0?24:this._hour;case h.AMPM_OF_DAY:return p.intDiv(this._hour,12)}throw new _e("Unsupported field: "+r)},n.hour=function(){return this._hour},n.minute=function(){return this._minute},n.second=function(){return this._second},n.nano=function(){return this._nano},n._withAdjuster=function(r){return C(r,"adjuster"),r instanceof e?r:t.prototype._withAdjuster.call(this,r)},n._withField=function(r,o){if(C(r,"field"),J(r,Mr,"field"),r instanceof h){switch(r.checkValidValue(o),r){case h.NANO_OF_SECOND:return this.withNano(o);case h.NANO_OF_DAY:return e.ofNanoOfDay(o);case h.MICRO_OF_SECOND:return this.withNano(o*1e3);case h.MICRO_OF_DAY:return e.ofNanoOfDay(o*1e3);case h.MILLI_OF_SECOND:return this.withNano(o*1e6);case h.MILLI_OF_DAY:return e.ofNanoOfDay(o*1e6);case h.SECOND_OF_MINUTE:return this.withSecond(o);case h.SECOND_OF_DAY:return this.plusSeconds(o-this.toSecondOfDay());case h.MINUTE_OF_HOUR:return this.withMinute(o);case h.MINUTE_OF_DAY:return this.plusMinutes(o-(this._hour*60+this._minute));case h.HOUR_OF_AMPM:return this.plusHours(o-p.intMod(this._hour,12));case h.CLOCK_HOUR_OF_AMPM:return this.plusHours((o===12?0:o)-p.intMod(this._hour,12));case h.HOUR_OF_DAY:return this.withHour(o);case h.CLOCK_HOUR_OF_DAY:return this.withHour(o===24?0:o);case h.AMPM_OF_DAY:return this.plusHours((o-p.intDiv(this._hour,12))*12)}throw new _e("Unsupported field: "+r)}return r.adjustInto(this,o)},n.withHour=function(r){return r===void 0&&(r=0),this._hour===r?this:new e(r,this._minute,this._second,this._nano)},n.withMinute=function(r){return r===void 0&&(r=0),this._minute===r?this:new e(this._hour,r,this._second,this._nano)},n.withSecond=function(r){return r===void 0&&(r=0),this._second===r?this:new e(this._hour,this._minute,r,this._nano)},n.withNano=function(r){return r===void 0&&(r=0),this._nano===r?this:new e(this._hour,this._minute,this._second,r)},n.truncatedTo=function(r){if(C(r,"unit"),r===T.NANOS)return this;var o=r.duration();if(o.seconds()>e.SECONDS_PER_DAY)throw new $("Unit is too large to be used for truncation");var s=o.toNanos();if(p.intMod(e.NANOS_PER_DAY,s)!==0)throw new $("Unit must divide into a standard day without remainder");var a=this.toNanoOfDay();return e.ofNanoOfDay(p.intDiv(a,s)*s)},n._plusUnit=function(r,o){if(C(o,"unit"),o instanceof T){switch(o){case T.NANOS:return this.plusNanos(r);case T.MICROS:return this.plusNanos(p.intMod(r,e.MICROS_PER_DAY)*1e3);case T.MILLIS:return this.plusNanos(p.intMod(r,e.MILLIS_PER_DAY)*1e6);case T.SECONDS:return this.plusSeconds(r);case T.MINUTES:return this.plusMinutes(r);case T.HOURS:return this.plusHours(r);case T.HALF_DAYS:return this.plusHours(p.intMod(r,2)*12)}throw new _e("Unsupported unit: "+o)}return o.addTo(this,r)},n.plusHours=function(r){if(r===0)return this;var o=p.intMod(p.intMod(r,e.HOURS_PER_DAY)+this._hour+e.HOURS_PER_DAY,e.HOURS_PER_DAY);return new e(o,this._minute,this._second,this._nano)},n.plusMinutes=function(r){if(r===0)return this;var o=this._hour*e.MINUTES_PER_HOUR+this._minute,s=p.intMod(p.intMod(r,e.MINUTES_PER_DAY)+o+e.MINUTES_PER_DAY,e.MINUTES_PER_DAY);if(o===s)return this;var a=p.intDiv(s,e.MINUTES_PER_HOUR),c=p.intMod(s,e.MINUTES_PER_HOUR);return new e(a,c,this._second,this._nano)},n.plusSeconds=function(r){if(r===0)return this;var o=this._hour*e.SECONDS_PER_HOUR+this._minute*e.SECONDS_PER_MINUTE+this._second,s=p.intMod(p.intMod(r,e.SECONDS_PER_DAY)+o+e.SECONDS_PER_DAY,e.SECONDS_PER_DAY);if(o===s)return this;var a=p.intDiv(s,e.SECONDS_PER_HOUR),c=p.intMod(p.intDiv(s,e.SECONDS_PER_MINUTE),e.MINUTES_PER_HOUR),u=p.intMod(s,e.SECONDS_PER_MINUTE);return new e(a,c,u,this._nano)},n.plusNanos=function(r){if(r===0)return this;var o=this.toNanoOfDay(),s=p.intMod(p.intMod(r,e.NANOS_PER_DAY)+o+e.NANOS_PER_DAY,e.NANOS_PER_DAY);if(o===s)return this;var a=p.intDiv(s,e.NANOS_PER_HOUR),c=p.intMod(p.intDiv(s,e.NANOS_PER_MINUTE),e.MINUTES_PER_HOUR),u=p.intMod(p.intDiv(s,e.NANOS_PER_SECOND),e.SECONDS_PER_MINUTE),l=p.intMod(s,e.NANOS_PER_SECOND);return new e(a,c,u,l)},n._minusUnit=function(r,o){return C(o,"unit"),this._plusUnit(-1*r,o)},n.minusHours=function(r){return this.plusHours(-1*p.intMod(r,e.HOURS_PER_DAY))},n.minusMinutes=function(r){return this.plusMinutes(-1*p.intMod(r,e.MINUTES_PER_DAY))},n.minusSeconds=function(r){return this.plusSeconds(-1*p.intMod(r,e.SECONDS_PER_DAY))},n.minusNanos=function(r){return this.plusNanos(-1*p.intMod(r,e.NANOS_PER_DAY))},n.query=function(r){return C(r,"query"),r===k.precision()?T.NANOS:r===k.localTime()?this:r===k.chronology()||r===k.zoneId()||r===k.zone()||r===k.offset()||r===k.localDate()?null:r.queryFrom(this)},n.adjustInto=function(r){return r.with(e.NANO_OF_DAY,this.toNanoOfDay())},n.until=function(r,o){C(r,"endExclusive"),C(o,"unit");var s=e.from(r);if(o instanceof T){var a=s.toNanoOfDay()-this.toNanoOfDay();switch(o){case T.NANOS:return a;case T.MICROS:return p.intDiv(a,1e3);case T.MILLIS:return p.intDiv(a,1e6);case T.SECONDS:return p.intDiv(a,e.NANOS_PER_SECOND);case T.MINUTES:return p.intDiv(a,e.NANOS_PER_MINUTE);case T.HOURS:return p.intDiv(a,e.NANOS_PER_HOUR);case T.HALF_DAYS:return p.intDiv(a,12*e.NANOS_PER_HOUR)}throw new _e("Unsupported unit: "+o)}return o.between(this,s)},n.atDate=function(r){return De.of(r,this)},n.atOffset=function(r){return Dr.of(this,r)},n.toSecondOfDay=function(){var r=this._hour*e.SECONDS_PER_HOUR;return r+=this._minute*e.SECONDS_PER_MINUTE,r+=this._second,r},n.toNanoOfDay=function(){var r=this._hour*e.NANOS_PER_HOUR;return r+=this._minute*e.NANOS_PER_MINUTE,r+=this._second*e.NANOS_PER_SECOND,r+=this._nano,r},n.compareTo=function(r){C(r,"other"),J(r,e,"other");var o=p.compareNumbers(this._hour,r._hour);return o===0&&(o=p.compareNumbers(this._minute,r._minute),o===0&&(o=p.compareNumbers(this._second,r._second),o===0&&(o=p.compareNumbers(this._nano,r._nano)))),o},n.isAfter=function(r){return this.compareTo(r)>0},n.isBefore=function(r){return this.compareTo(r)<0},n.equals=function(r){return this===r?!0:r instanceof e?this._hour===r._hour&&this._minute===r._minute&&this._second===r._second&&this._nano===r._nano:!1},n.hashCode=function(){var r=this.toNanoOfDay();return p.hash(r)},n.toString=function(){var r="",o=this._hour,s=this._minute,a=this._second,c=this._nano;return r+=o<10?"0":"",r+=o,r+=s<10?":0":":",r+=s,(a>0||c>0)&&(r+=a<10?":0":":",r+=a,c>0&&(r+=".",p.intMod(c,1e6)===0?r+=(""+(p.intDiv(c,1e6)+1e3)).substring(1):p.intMod(c,1e3)===0?r+=(""+(p.intDiv(c,1e3)+1e6)).substring(1):r+=(""+(c+1e9)).substring(1))),r},n.toJSON=function(){return this.toString()},n.format=function(r){return C(r,"formatter"),r.format(this)},e})(An);v.HOURS_PER_DAY=24;v.MINUTES_PER_HOUR=60;v.MINUTES_PER_DAY=v.MINUTES_PER_HOUR*v.HOURS_PER_DAY;v.SECONDS_PER_MINUTE=60;v.SECONDS_PER_HOUR=v.SECONDS_PER_MINUTE*v.MINUTES_PER_HOUR;v.SECONDS_PER_DAY=v.SECONDS_PER_HOUR*v.HOURS_PER_DAY;v.MILLIS_PER_DAY=v.SECONDS_PER_DAY*1e3;v.MICROS_PER_DAY=v.SECONDS_PER_DAY*1e6;v.NANOS_PER_SECOND=1e9;v.NANOS_PER_MINUTE=v.NANOS_PER_SECOND*v.SECONDS_PER_MINUTE;v.NANOS_PER_HOUR=v.NANOS_PER_MINUTE*v.MINUTES_PER_HOUR;v.NANOS_PER_DAY=v.NANOS_PER_HOUR*v.HOURS_PER_DAY;aE=1e6,Ye=(function(t){le(e,t),e.now=function(r){return r===void 0&&(r=xe.systemUTC()),r.instant()},e.ofEpochSecond=function(r,o){o===void 0&&(o=0);var s=r+p.floorDiv(o,v.NANOS_PER_SECOND),a=p.floorMod(o,v.NANOS_PER_SECOND);return e._create(s,a)},e.ofEpochMilli=function(r){var o=p.floorDiv(r,1e3),s=p.floorMod(r,1e3);return e._create(o,s*1e6)},e.ofEpochMicro=function(r){var o=p.floorDiv(r,1e6),s=p.floorMod(r,1e6);return e._create(o,s*1e3)},e.from=function(r){try{var o=r.getLong(h.INSTANT_SECONDS),s=r.get(h.NANO_OF_SECOND);return e.ofEpochSecond(o,s)}catch(a){throw new $("Unable to obtain Instant from TemporalAccessor: "+r+", type "+typeof r,a)}},e.parse=function(r){return fe.ISO_INSTANT.parse(r,e.FROM)},e._create=function(r,o){return r===0&&o===0?e.EPOCH:new e(r,o)},e._validate=function(r,o){if(r<e.MIN_SECONDS||r>e.MAX_SECONDS)throw new $("Instant exceeds minimum or maximum instant");if(o<0||o>v.NANOS_PER_SECOND)throw new $("Instant exceeds minimum or maximum instant")};function e(i,r){var o;return o=t.call(this)||this,e._validate(i,r),o._seconds=p.safeToInt(i),o._nanos=p.safeToInt(r),o}var n=e.prototype;return n.isSupported=function(r){return r instanceof h?r===h.INSTANT_SECONDS||r===h.NANO_OF_SECOND||r===h.MICRO_OF_SECOND||r===h.MILLI_OF_SECOND:r instanceof T?r.isTimeBased()||r===T.DAYS:r!=null&&r.isSupportedBy(this)},n.range=function(r){return t.prototype.range.call(this,r)},n.get=function(r){return this.getLong(r)},n.getLong=function(r){if(r instanceof h){switch(r){case h.NANO_OF_SECOND:return this._nanos;case h.MICRO_OF_SECOND:return p.intDiv(this._nanos,1e3);case h.MILLI_OF_SECOND:return p.intDiv(this._nanos,aE);case h.INSTANT_SECONDS:return this._seconds}throw new _e("Unsupported field: "+r)}return r.getFrom(this)},n.epochSecond=function(){return this._seconds},n.nano=function(){return this._nanos},n._withField=function(r,o){if(C(r,"field"),r instanceof h){switch(r.checkValidValue(o),r){case h.MILLI_OF_SECOND:{var s=o*aE;return s!==this._nanos?e._create(this._seconds,s):this}case h.MICRO_OF_SECOND:{var a=o*1e3;return a!==this._nanos?e._create(this._seconds,a):this}case h.NANO_OF_SECOND:return o!==this._nanos?e._create(this._seconds,o):this;case h.INSTANT_SECONDS:return o!==this._seconds?e._create(o,this._nanos):this}throw new _e("Unsupported field: "+r)}return r.adjustInto(this,o)},n.truncatedTo=function(r){if(C(r,"unit"),r===T.NANOS)return this;var o=r.duration();if(o.seconds()>v.SECONDS_PER_DAY)throw new $("Unit is too large to be used for truncation");var s=o.toNanos();if(p.intMod(v.NANOS_PER_DAY,s)!==0)throw new $("Unit must divide into a standard day without remainder");var a=p.intMod(this._seconds,v.SECONDS_PER_DAY)*v.NANOS_PER_SECOND+this._nanos,c=p.intDiv(a,s)*s;return this.plusNanos(c-a)},n._plusUnit=function(r,o){if(C(r,"amountToAdd"),C(o,"unit"),J(o,li),o instanceof T){switch(o){case T.NANOS:return this.plusNanos(r);case T.MICROS:return this.plusMicros(r);case T.MILLIS:return this.plusMillis(r);case T.SECONDS:return this.plusSeconds(r);case T.MINUTES:return this.plusSeconds(p.safeMultiply(r,v.SECONDS_PER_MINUTE));case T.HOURS:return this.plusSeconds(p.safeMultiply(r,v.SECONDS_PER_HOUR));case T.HALF_DAYS:return this.plusSeconds(p.safeMultiply(r,v.SECONDS_PER_DAY/2));case T.DAYS:return this.plusSeconds(p.safeMultiply(r,v.SECONDS_PER_DAY))}throw new _e("Unsupported unit: "+o)}return o.addTo(this,r)},n.plusSeconds=function(r){return this._plus(r,0)},n.plusMillis=function(r){return this._plus(p.intDiv(r,1e3),p.intMod(r,1e3)*aE)},n.plusNanos=function(r){return this._plus(0,r)},n.plusMicros=function(r){return this._plus(p.intDiv(r,1e6),p.intMod(r,1e6)*1e3)},n._plus=function(r,o){if(r===0&&o===0)return this;var s=this._seconds+r;s=s+p.intDiv(o,v.NANOS_PER_SECOND);var a=this._nanos+o%v.NANOS_PER_SECOND;return e.ofEpochSecond(s,a)},n._minusUnit=function(r,o){return this._plusUnit(-1*r,o)},n.minusSeconds=function(r){return this.plusSeconds(r*-1)},n.minusMillis=function(r){return this.plusMillis(-1*r)},n.minusNanos=function(r){return this.plusNanos(-1*r)},n.minusMicros=function(r){return this.plusMicros(-1*r)},n.query=function(r){return C(r,"query"),r===k.precision()?T.NANOS:r===k.localDate()||r===k.localTime()||r===k.chronology()||r===k.zoneId()||r===k.zone()||r===k.offset()?null:r.queryFrom(this)},n.adjustInto=function(r){return C(r,"temporal"),r.with(h.INSTANT_SECONDS,this._seconds).with(h.NANO_OF_SECOND,this._nanos)},n.until=function(r,o){C(r,"endExclusive"),C(o,"unit");var s=e.from(r);if(o instanceof T){switch(o){case T.NANOS:return this._nanosUntil(s);case T.MICROS:return this._microsUntil(s);case T.MILLIS:return p.safeSubtract(s.toEpochMilli(),this.toEpochMilli());case T.SECONDS:return this._secondsUntil(s);case T.MINUTES:return p.intDiv(this._secondsUntil(s),v.SECONDS_PER_MINUTE);case T.HOURS:return p.intDiv(this._secondsUntil(s),v.SECONDS_PER_HOUR);case T.HALF_DAYS:return p.intDiv(this._secondsUntil(s),12*v.SECONDS_PER_HOUR);case T.DAYS:return p.intDiv(this._secondsUntil(s),v.SECONDS_PER_DAY)}throw new _e("Unsupported unit: "+o)}return o.between(this,s)},n._microsUntil=function(r){var o=p.safeSubtract(r.epochSecond(),this.epochSecond()),s=p.safeMultiply(o,1e6);return p.safeAdd(s,p.intDiv(r.nano()-this.nano(),1e3))},n._nanosUntil=function(r){var o=p.safeSubtract(r.epochSecond(),this.epochSecond()),s=p.safeMultiply(o,v.NANOS_PER_SECOND);return p.safeAdd(s,r.nano()-this.nano())},n._secondsUntil=function(r){var o=p.safeSubtract(r.epochSecond(),this.epochSecond()),s=r.nano()-this.nano();return o>0&&s<0?o--:o<0&&s>0&&o++,o},n.atOffset=function(r){return gr.ofInstant(this,r)},n.atZone=function(r){return _r.ofInstant(this,r)},n.toEpochMilli=function(){var r=p.safeMultiply(this._seconds,1e3);return r+p.intDiv(this._nanos,aE)},n.compareTo=function(r){C(r,"otherInstant"),J(r,e,"otherInstant");var o=p.compareNumbers(this._seconds,r._seconds);return o!==0?o:this._nanos-r._nanos},n.isAfter=function(r){return this.compareTo(r)>0},n.isBefore=function(r){return this.compareTo(r)<0},n.equals=function(r){return this===r?!0:r instanceof e?this.epochSecond()===r.epochSecond()&&this.nano()===r.nano():!1},n.hashCode=function(){return p.hashCode(this._seconds,this._nanos)},n.toString=function(){return fe.ISO_INSTANT.format(this)},n.toJSON=function(){return this.toString()},e})(An);xe=(function(){function t(){}t.systemUTC=function(){return new Jb(ae.UTC)},t.systemDefaultZone=function(){return new Jb(Pe.systemDefault())},t.system=function(i){return new Jb(i)},t.fixed=function(i,r){return new bEe(i,r)},t.offset=function(i,r){return new OEe(i,r)};var e=t.prototype;return e.millis=function(){se("Clock.millis")},e.instant=function(){se("Clock.instant")},e.zone=function(){se("Clock.zone")},e.withZone=function(){se("Clock.withZone")},t})(),Jb=(function(t){le(e,t);function e(i){var r;return C(i,"zone"),r=t.call(this)||this,r._zone=i,r}var n=e.prototype;return n.zone=function(){return this._zone},n.millis=function(){return new Date().getTime()},n.instant=function(){return Ye.ofEpochMilli(this.millis())},n.equals=function(r){return r instanceof e?this._zone.equals(r._zone):!1},n.withZone=function(r){return r.equals(this._zone)?this:new e(r)},n.toString=function(){return"SystemClock["+this._zone.toString()+"]"},e})(xe),bEe=(function(t){le(e,t);function e(i,r){var o;return o=t.call(this)||this,o._instant=i,o._zoneId=r,o}var n=e.prototype;return n.instant=function(){return this._instant},n.millis=function(){return this._instant.toEpochMilli()},n.zone=function(){return this._zoneId},n.toString=function(){return"FixedClock[]"},n.equals=function(r){return r instanceof e?this._instant.equals(r._instant)&&this._zoneId.equals(r._zoneId):!1},n.withZone=function(r){return r.equals(this._zoneId)?this:new e(this._instant,r)},e})(xe),OEe=(function(t){le(e,t);function e(i,r){var o;return o=t.call(this)||this,o._baseClock=i,o._offset=r,o}var n=e.prototype;return n.zone=function(){return this._baseClock.zone()},n.withZone=function(r){return r.equals(this._baseClock.zone())?this:new e(this._baseClock.withZone(r),this._offset)},n.millis=function(){return this._baseClock.millis()+this._offset.toMillis()},n.instant=function(){return this._baseClock.instant().plus(this._offset)},n.equals=function(r){return r instanceof e?this._baseClock.equals(r._baseClock)&&this._offset.equals(r._offset):!1},n.toString=function(){return"OffsetClock["+this._baseClock+","+this._offset+"]"},e})(xe);v$=(function(){t.of=function(i,r,o){return new t(i,r,o)};function t(n,i,r){if(C(n,"transition"),C(i,"offsetBefore"),C(r,"offsetAfter"),i.equals(r))throw new Z("Offsets must not be equal");if(n.nano()!==0)throw new Z("Nano-of-second must be zero");n instanceof De?this._transition=n:this._transition=De.ofEpochSecond(n,0,i),this._offsetBefore=i,this._offsetAfter=r}var e=t.prototype;return e.instant=function(){return this._transition.toInstant(this._offsetBefore)},e.toEpochSecond=function(){return this._transition.toEpochSecond(this._offsetBefore)},e.dateTimeBefore=function(){return this._transition},e.dateTimeAfter=function(){return this._transition.plusSeconds(this.durationSeconds())},e.offsetBefore=function(){return this._offsetBefore},e.offsetAfter=function(){return this._offsetAfter},e.duration=function(){return ot.ofSeconds(this.durationSeconds())},e.durationSeconds=function(){return this._offsetAfter.totalSeconds()-this._offsetBefore.totalSeconds()},e.isGap=function(){return this._offsetAfter.totalSeconds()>this._offsetBefore.totalSeconds()},e.isOverlap=function(){return this._offsetAfter.totalSeconds()<this._offsetBefore.totalSeconds()},e.isValidOffset=function(i){return this.isGap()?!1:this._offsetBefore.equals(i)||this._offsetAfter.equals(i)},e.validOffsets=function(){return this.isGap()?[]:[this._offsetBefore,this._offsetAfter]},e.compareTo=function(i){return this.instant().compareTo(i.instant())},e.equals=function(i){if(i===this)return!0;if(i instanceof t){var r=i;return this._transition.equals(r._transition)&&this._offsetBefore.equals(r.offsetBefore())&&this._offsetAfter.equals(r.offsetAfter())}return!1},e.hashCode=function(){return this._transition.hashCode()^this._offsetBefore.hashCode()^this._offsetAfter.hashCode()>>>16},e.toString=function(){return"Transition["+(this.isGap()?"Gap":"Overlap")+" at "+this._transition.toString()+this._offsetBefore.toString()+" to "+this._offsetAfter+"]"},t})();NEe=(function(t){le(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.isFixedOffset=function(){return!1},n.offsetOfInstant=function(r){var o=new Date(r.toEpochMilli()).getTimezoneOffset();return ae.ofTotalMinutes(o*-1)},n.offsetOfEpochMilli=function(r){var o=new Date(r).getTimezoneOffset();return ae.ofTotalMinutes(o*-1)},n.offsetOfLocalDateTime=function(r){var o=r.toEpochSecond(ae.UTC)*1e3,s=new Date(o).getTimezoneOffset(),a=o+s*6e4,c=new Date(a).getTimezoneOffset();return ae.ofTotalMinutes(c*-1)},n.validOffsets=function(r){return[this.offsetOfLocalDateTime(r)]},n.transition=function(){return null},n.standardOffset=function(r){return this.offsetOfInstant(r)},n.daylightSavings=function(){this._throwNotSupported()},n.isDaylightSavings=function(){this._throwNotSupported()},n.isValidOffset=function(r,o){return this.offsetOfLocalDateTime(r).equals(o)},n.nextTransition=function(){this._throwNotSupported()},n.previousTransition=function(){this._throwNotSupported()},n.transitions=function(){this._throwNotSupported()},n.transitionRules=function(){this._throwNotSupported()},n._throwNotSupported=function(){throw new $("not supported operation")},n.equals=function(r){return this===r||r instanceof e},n.toString=function(){return"SYSTEM"},e})(Oh),PEe=(function(t){le(e,t);function e(){var i;return i=t.call(this)||this,i._rules=new NEe,i}var n=e.prototype;return n.rules=function(){return this._rules},n.equals=function(r){return this===r},n.id=function(){return"SYSTEM"},e})(Pe);Hc=(function(){function t(){}return t.systemDefault=function(){return cO},t.getAvailableZoneIds=function(){return Rh.getAvailableZoneIds()},t.of=function(n){if(C(n,"zoneId"),n==="Z")return ae.UTC;if(n.length===1)throw new $("Invalid zone: "+n);if(oi.startsWith(n,"+")||oi.startsWith(n,"-"))return ae.of(n);if(n==="UTC"||n==="GMT"||n==="GMT0"||n==="UT")return new Pr(n,ae.UTC.rules());if(oi.startsWith(n,"UTC+")||oi.startsWith(n,"GMT+")||oi.startsWith(n,"UTC-")||oi.startsWith(n,"GMT-")){var i=ae.of(n.substring(3));return i.totalSeconds()===0?new Pr(n.substring(0,3),i.rules()):new Pr(n.substring(0,3)+i.id(),i.rules())}if(oi.startsWith(n,"UT+")||oi.startsWith(n,"UT-")){var r=ae.of(n.substring(2));return r.totalSeconds()===0?new Pr("UT",r.rules()):new Pr("UT"+r.id(),r.rules())}return n==="SYSTEM"?Pe.systemDefault():Pr.ofId(n)},t.ofOffset=function(n,i){if(C(n,"prefix"),C(i,"offset"),n.length===0)return i;if(n==="GMT"||n==="UTC"||n==="UT")return i.totalSeconds()===0?new Pr(n,i.rules()):new Pr(n+i.id(),i.rules());throw new Z("Invalid prefix, must be GMT, UTC or UT: "+n)},t.from=function(n){C(n,"temporal");var i=n.query(k.zone());if(i==null)throw new $("Unable to obtain ZoneId from TemporalAccessor: "+n+", type "+(n.constructor!=null?n.constructor.name:""));return i},t})(),cO=null;g$=!1;MEe();kEe=(function(){function t(n,i){var r;if(n instanceof Ye){this.instant=n;return}else if(n instanceof ee)i=i??Pe.systemDefault(),r=n.atStartOfDay(i);else if(n instanceof De)i=i??Pe.systemDefault(),r=n.atZone(i);else if(n instanceof _r)i==null?r=n:r=n.withZoneSameInstant(i);else throw new Z("unsupported instance for convert operation:"+n);this.instant=r.toInstant()}var e=t.prototype;return e.toDate=function(){return new Date(this.instant.toEpochMilli())},e.toEpochMilli=function(){return this.instant.toEpochMilli()},t})();R$={assert:Gye,DateTimeBuilder:lE,DateTimeParseContext:y$,DateTimePrintContext:E$,MathUtil:p,StringUtil:oi,StringBuilder:w$},N$={_:R$,convert:b$,nativeJs:O$,ArithmeticException:fr,DateTimeException:$,DateTimeParseException:pr,IllegalArgumentException:Z,IllegalStateException:Vc,UnsupportedTemporalTypeException:_e,NullPointerException:ui,Clock:xe,DayOfWeek:je,Duration:ot,Instant:Ye,LocalDate:ee,LocalTime:v,LocalDateTime:De,OffsetTime:Dr,OffsetDateTime:gr,Month:oe,MonthDay:bh,ParsePosition:uO,Period:si,Year:mr,YearConstants:Tn,YearMonth:Wc,ZonedDateTime:_r,ZoneOffset:ae,ZoneId:Pe,ZoneRegion:Pr,ZoneOffsetTransition:v$,ZoneRules:Oh,ZoneRulesProvider:Rh,ChronoLocalDate:$c,ChronoLocalDateTime:hO,ChronoZonedDateTime:dO,IsoChronology:Ne,ChronoField:h,ChronoUnit:T,IsoFields:hr,Temporal:An,TemporalAccessor:xi,TemporalAdjuster:Nh,TemporalAdjusters:lO,TemporalAmount:Eo,TemporalField:Mr,TemporalQueries:k,TemporalQuery:Xc,TemporalUnit:li,ValueRange:ue,DateTimeFormatter:fe,DateTimeFormatterBuilder:Le,DecimalStyle:vh,ResolverStyle:ce,SignStyle:Oe,TextStyle:Re},P$=LEe(N$);N$.use=P$});var k$=g((hE,M$)=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});hE.default=void 0;var UEe=xEe(Zy()),dE=(Dh(),At(Ph));function xEe(t){return t&&t.__esModule?t:{default:t}}var FEe=dE.LocalDate.ofYearDay(1900,1),qEe=Buffer.from([0]),HEe=Buffer.from([8]),D$={id:61,type:"DATETIME",name:"DateTime",declaration:function(){return"datetime"},generateTypeInfo(){return Buffer.from([UEe.default.id,8])},generateParameterLength(t,e){return t.value==null?qEe:HEe},generateParameterData:function*(t,e){if(t.value==null)return;let n=t.value,i;e.useUTC?i=dE.LocalDate.of(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate()):i=dE.LocalDate.of(n.getFullYear(),n.getMonth()+1,n.getDate());let r=FEe.until(i,dE.ChronoUnit.DAYS),o,s;if(e.useUTC){let c=n.getUTCHours()*60*60;c+=n.getUTCMinutes()*60,c+=n.getUTCSeconds(),o=c*1e3+n.getUTCMilliseconds()}else{let c=n.getHours()*60*60;c+=n.getMinutes()*60,c+=n.getSeconds(),o=c*1e3+n.getMilliseconds()}s=o/(3+1/3),s=Math.round(s),s===2592e4&&(r+=1,s=0);let a=Buffer.alloc(8);a.writeInt32LE(r,0),a.writeUInt32LE(s,4),yield a},validate:function(t,e,n){if(t==null)return null;t instanceof Date||(t=new Date(Date.parse(t))),t=t;let i;if(n&&n.useUTC?i=t.getUTCFullYear():i=t.getFullYear(),i<1753||i>9999)throw new TypeError("Out of range.");if(isNaN(t))throw new TypeError("Invalid date.");return t}},ERe=hE.default=D$;M$.exports=D$});var x$=g((fE,U$)=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});fE.default=void 0;var BEe=jEe(tE());function jEe(t){return t&&t.__esModule?t:{default:t}}var YEe=Buffer.from([0]),L$={id:62,type:"FLT8",name:"Float",declaration:function(){return"float"},generateTypeInfo(){return Buffer.from([BEe.default.id,8])},generateParameterLength(t,e){return t.value==null?YEe:Buffer.from([8])},*generateParameterData(t,e){if(t.value==null)return;let n=Buffer.alloc(8);n.writeDoubleLE(parseFloat(t.value),0),yield n},validate:function(t){if(t==null)return null;if(t=parseFloat(t),isNaN(t))throw new TypeError("Invalid number.");return t}},TRe=fE.default=L$;U$.exports=L$});var fO=g((pE,q$)=>{"use strict";Object.defineProperty(pE,"__esModule",{value:!0});pE.default=void 0;var F$={id:106,type:"DECIMALN",name:"DecimalN",declaration(){throw new Error("not implemented")},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},ARe=pE.default=F$;q$.exports=F$});var Y$=g((mE,j$)=>{"use strict";Object.defineProperty(mE,"__esModule",{value:!0});mE.default=void 0;var VEe=H$(fO()),pO=H$(wn());function H$(t){return t&&t.__esModule?t:{default:t}}var $Ee=Buffer.from([0]),B$={id:55,type:"DECIMAL",name:"Decimal",declaration:function(t){return"decimal("+this.resolvePrecision(t)+", "+this.resolveScale(t)+")"},resolvePrecision:function(t){return t.precision!=null?t.precision:t.value===null?1:18},resolveScale:function(t){return t.scale!=null?t.scale:0},generateTypeInfo(t,e){let n;return t.precision<=9?n=5:t.precision<=19?n=9:t.precision<=28?n=13:n=17,Buffer.from([VEe.default.id,n,t.precision,t.scale])},generateParameterLength(t,e){if(t.value==null)return $Ee;let n=t.precision;return n<=9?Buffer.from([5]):n<=19?Buffer.from([9]):n<=28?Buffer.from([13]):Buffer.from([17])},*generateParameterData(t,e){if(t.value==null)return;let n=t.value<0?0:1,i=Math.round(Math.abs(t.value*Math.pow(10,t.scale))),r=t.precision;if(r<=9){let o=Buffer.alloc(5);o.writeUInt8(n,0),o.writeUInt32LE(i,1),yield o}else if(r<=19){let o=new pO.default(9);o.writeUInt8(n),o.writeUInt64LE(i),yield o.data}else if(r<=28){let o=new pO.default(13);o.writeUInt8(n),o.writeUInt64LE(i),o.writeUInt32LE(0),yield o.data}else{let o=new pO.default(17);o.writeUInt8(n),o.writeUInt64LE(i),o.writeUInt32LE(0),o.writeUInt32LE(0),yield o.data}},validate:function(t){if(t==null)return null;if(t=parseFloat(t),isNaN(t))throw new TypeError("Invalid number.");return t}},CRe=mE.default=B$;j$.exports=B$});var mO=g((gE,$$)=>{"use strict";Object.defineProperty(gE,"__esModule",{value:!0});gE.default=void 0;var V$={id:108,type:"NUMERICN",name:"NumericN",declaration(){throw new Error("not implemented")},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},SRe=gE.default=V$;$$.exports=V$});var K$=g((_E,W$)=>{"use strict";Object.defineProperty(_E,"__esModule",{value:!0});_E.default=void 0;var zEe=z$(mO()),gO=z$(wn());function z$(t){return t&&t.__esModule?t:{default:t}}var GEe=Buffer.from([0]),G$={id:63,type:"NUMERIC",name:"Numeric",declaration:function(t){return"numeric("+this.resolvePrecision(t)+", "+this.resolveScale(t)+")"},resolvePrecision:function(t){return t.precision!=null?t.precision:t.value===null?1:18},resolveScale:function(t){return t.scale!=null?t.scale:0},generateTypeInfo(t){let e;return t.precision<=9?e=5:t.precision<=19?e=9:t.precision<=28?e=13:e=17,Buffer.from([zEe.default.id,e,t.precision,t.scale])},generateParameterLength(t,e){if(t.value==null)return GEe;let n=t.precision;return n<=9?Buffer.from([5]):n<=19?Buffer.from([9]):n<=28?Buffer.from([13]):Buffer.from([17])},*generateParameterData(t,e){if(t.value==null)return;let n=t.value<0?0:1,i=Math.round(Math.abs(t.value*Math.pow(10,t.scale)));if(t.precision<=9){let r=Buffer.alloc(5);r.writeUInt8(n,0),r.writeUInt32LE(i,1),yield r}else if(t.precision<=19){let r=new gO.default(10);r.writeUInt8(n),r.writeUInt64LE(i),yield r.data}else if(t.precision<=28){let r=new gO.default(14);r.writeUInt8(n),r.writeUInt64LE(i),r.writeUInt32LE(0),yield r.data}else{let r=new gO.default(18);r.writeUInt8(n),r.writeUInt64LE(i),r.writeUInt32LE(0),r.writeUInt32LE(0),yield r.data}},validate:function(t){if(t==null)return null;if(t=parseFloat(t),isNaN(t))throw new TypeError("Invalid number.");return t}},wRe=_E.default=G$;W$.exports=G$});var Z$=g((yE,Q$)=>{"use strict";Object.defineProperty(yE,"__esModule",{value:!0});yE.default=void 0;var WEe=KEe(iE());function KEe(t){return t&&t.__esModule?t:{default:t}}var XEe=Buffer.from([4]),QEe=Buffer.from([0]),X$={id:122,type:"MONEY4",name:"SmallMoney",declaration:function(){return"smallmoney"},generateTypeInfo:function(){return Buffer.from([WEe.default.id,4])},generateParameterLength(t,e){return t.value==null?QEe:XEe},*generateParameterData(t,e){if(t.value==null)return;let n=Buffer.alloc(4);n.writeInt32LE(t.value*1e4,0),yield n},validate:function(t){if(t==null)return null;if(t=parseFloat(t),isNaN(t))throw new TypeError("Invalid number.");if(t<-214748.3648||t>214748.3647)throw new TypeError("Value must be between -214748.3648 and 214748.3647.");return t}},IRe=yE.default=X$;Q$.exports=X$});var iz=g((EE,rz)=>{"use strict";Object.defineProperty(EE,"__esModule",{value:!0});EE.default=void 0;var ZEe=tz(Fc()),JEe=tz(wn());function tz(t){return t&&t.__esModule?t:{default:t}}var eTe=Buffer.from([8]),tTe=Buffer.from([0]),J$=9223372036854775807n,ez=-9223372036854775808n,nz={id:127,type:"INT8",name:"BigInt",declaration:function(){return"bigint"},generateTypeInfo(){return Buffer.from([ZEe.default.id,8])},generateParameterLength(t,e){return t.value==null?tTe:eTe},*generateParameterData(t,e){if(t.value==null)return;let n=new JEe.default(8);n.writeBigInt64LE(typeof t.value=="bigint"?t.value:globalThis.BigInt(t.value)),yield n.data},validate:function(t){if(t==null)return null;if(typeof t!="bigint"&&(t=globalThis.BigInt(t)),t<ez||t>J$)throw new TypeError(`Value must be between ${ez} and ${J$}, inclusive.`);return t}},vRe=EE.default=nz;rz.exports=nz});var az=g((TE,sz)=>{"use strict";Object.defineProperty(TE,"__esModule",{value:!0});TE.default=void 0;var nTe=Buffer.from([255,255,255,255]),oz={id:34,type:"IMAGE",name:"Image",hasTableName:!0,declaration:function(){return"image"},resolveLength:function(t){return t.value!=null?t.value.length:-1},generateTypeInfo(t){let e=Buffer.alloc(5);return e.writeUInt8(this.id,0),e.writeInt32LE(t.length,1),e},generateParameterLength(t,e){if(t.value==null)return nTe;let n=Buffer.alloc(4);return n.writeInt32LE(t.value.length,0),n},*generateParameterData(t,e){t.value!=null&&(yield t.value)},validate:function(t){if(t==null)return null;if(!Buffer.isBuffer(t))throw new TypeError("Invalid buffer.");return t}},bRe=TE.default=oz;sz.exports=oz});var lz=g((AE,uz)=>{"use strict";Object.defineProperty(AE,"__esModule",{value:!0});AE.default=void 0;var rTe=iTe(wo());function iTe(t){return t&&t.__esModule?t:{default:t}}var oTe=Buffer.from([255,255,255,255]),cz={id:35,type:"TEXT",name:"Text",hasTableName:!0,declaration:function(){return"text"},resolveLength:function(t){let e=t.value;return e!=null?e.length:-1},generateTypeInfo(t,e){let n=Buffer.alloc(10);return n.writeUInt8(this.id,0),n.writeInt32LE(t.length,1),t.collation&&t.collation.toBuffer().copy(n,5,0,5),n},generateParameterLength(t,e){let n=t.value;if(n==null)return oTe;let i=Buffer.alloc(4);return i.writeInt32LE(n.length,0),i},generateParameterData:function*(t,e){let n=t.value;n!=null&&(yield n)},validate:function(t,e){if(t==null)return null;if(typeof t!="string")throw new TypeError("Invalid string.");if(!e)throw new Error("No collation was set by the server for the current connection.");if(!e.codepage)throw new Error("The collation set by the server has no associated encoding.");return rTe.default.encode(t,e.codepage)}},ORe=AE.default=cz;uz.exports=cz});var _O=g(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.bufferToLowerCaseGuid=aTe;Mh.bufferToUpperCaseGuid=sTe;Mh.guidToArray=cTe;var on=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],sn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function sTe(t){return on[t[3]]+on[t[2]]+on[t[1]]+on[t[0]]+"-"+on[t[5]]+on[t[4]]+"-"+on[t[7]]+on[t[6]]+"-"+on[t[8]]+on[t[9]]+"-"+on[t[10]]+on[t[11]]+on[t[12]]+on[t[13]]+on[t[14]]+on[t[15]]}function aTe(t){return sn[t[3]]+sn[t[2]]+sn[t[1]]+sn[t[0]]+"-"+sn[t[5]]+sn[t[4]]+"-"+sn[t[7]]+sn[t[6]]+"-"+sn[t[8]]+sn[t[9]]+"-"+sn[t[10]]+sn[t[11]]+sn[t[12]]+sn[t[13]]+sn[t[14]]+sn[t[15]]}var zt={},Qc=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","A","B","C","D","E","F"].map(t=>t.charCodeAt(0));for(let t=0;t<Qc.length;t++){let e=zt[Qc[t]]={};for(let n=0;n<Qc.length;n++){let i=String.fromCharCode(Qc[t],Qc[n]),r=parseInt(i,16);e[Qc[n]]=r}}function cTe(t){return[zt[t.charCodeAt(6)][t.charCodeAt(7)],zt[t.charCodeAt(4)][t.charCodeAt(5)],zt[t.charCodeAt(2)][t.charCodeAt(3)],zt[t.charCodeAt(0)][t.charCodeAt(1)],zt[t.charCodeAt(11)][t.charCodeAt(12)],zt[t.charCodeAt(9)][t.charCodeAt(10)],zt[t.charCodeAt(16)][t.charCodeAt(17)],zt[t.charCodeAt(14)][t.charCodeAt(15)],zt[t.charCodeAt(19)][t.charCodeAt(20)],zt[t.charCodeAt(21)][t.charCodeAt(22)],zt[t.charCodeAt(24)][t.charCodeAt(25)],zt[t.charCodeAt(26)][t.charCodeAt(27)],zt[t.charCodeAt(28)][t.charCodeAt(29)],zt[t.charCodeAt(30)][t.charCodeAt(31)],zt[t.charCodeAt(32)][t.charCodeAt(33)],zt[t.charCodeAt(34)][t.charCodeAt(35)]]}});var fz=g((CE,hz)=>{"use strict";Object.defineProperty(CE,"__esModule",{value:!0});CE.default=void 0;var uTe=_O(),lTe=Buffer.from([0]),dTe=Buffer.from([16]),dz={id:36,type:"GUIDN",name:"UniqueIdentifier",declaration:function(){return"uniqueidentifier"},resolveLength:function(){return 16},generateTypeInfo(){return Buffer.from([this.id,16])},generateParameterLength(t,e){return t.value==null?lTe:dTe},generateParameterData:function*(t,e){t.value!=null&&(yield Buffer.from((0,uTe.guidToArray)(t.value)))},validate:function(t){if(t==null)return null;if(typeof t!="string")throw new TypeError("Invalid string.");if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))throw new TypeError("Invalid GUID.");return t}},NRe=CE.default=dz;hz.exports=dz});var gz=g((SE,mz)=>{"use strict";Object.defineProperty(SE,"__esModule",{value:!0});SE.default=void 0;var hTe=Buffer.from([255,255,255,255]),pz={id:99,type:"NTEXT",name:"NText",hasTableName:!0,declaration:function(){return"ntext"},resolveLength:function(t){let e=t.value;return e!=null?e.length:-1},generateTypeInfo(t,e){let n=Buffer.alloc(10);return n.writeUInt8(this.id,0),n.writeInt32LE(t.length,1),t.collation&&t.collation.toBuffer().copy(n,5,0,5),n},generateParameterLength(t,e){if(t.value==null)return hTe;let n=Buffer.alloc(4);return n.writeInt32LE(Buffer.byteLength(t.value,"ucs2"),0),n},generateParameterData:function*(t,e){t.value!=null&&(yield Buffer.from(t.value.toString(),"ucs2"))},validate:function(t){if(t==null)return null;if(typeof t!="string")throw new TypeError("Invalid string.");return t}},PRe=SE.default=pz;mz.exports=pz});var Ez=g((wE,yz)=>{"use strict";Object.defineProperty(wE,"__esModule",{value:!0});wE.default=void 0;var fTe=65535,pTe=Buffer.from([254,255,255,255,255,255,255,255]),mTe=Buffer.from([0,0,0,0]),gTe=Buffer.from([255,255]),_Te=Buffer.from([255,255,255,255,255,255,255,255]),_z={id:165,type:"BIGVARBIN",name:"VarBinary",maximumLength:8e3,declaration:function(t){let e=t.value,n;return t.length?n=t.length:e!=null?n=e.length||1:e===null&&!t.output?n=1:n=this.maximumLength,n<=this.maximumLength?"varbinary("+n+")":"varbinary(max)"},resolveLength:function(t){let e=t.value;return t.length!=null?t.length:e!=null?e.length:this.maximumLength},generateTypeInfo:function(t){let e=Buffer.alloc(3);return e.writeUInt8(this.id,0),t.length<=this.maximumLength?e.writeUInt16LE(t.length,1):e.writeUInt16LE(fTe,1),e},generateParameterLength(t,e){if(t.value==null)return t.length<=this.maximumLength?gTe:_Te;let n=t.value;Buffer.isBuffer(n)||(n=n.toString());let i=Buffer.byteLength(n,"ucs2");if(t.length<=this.maximumLength){let r=Buffer.alloc(2);return r.writeUInt16LE(i,0),r}else return pTe},*generateParameterData(t,e){if(t.value==null)return;let n=t.value;if(t.length<=this.maximumLength)Buffer.isBuffer(n)?yield n:yield Buffer.from(n.toString(),"ucs2");else{Buffer.isBuffer(n)||(n=n.toString());let i=Buffer.byteLength(n,"ucs2");if(i>0){let r=Buffer.alloc(4);r.writeUInt32LE(i,0),yield r,Buffer.isBuffer(n)?yield n:yield Buffer.from(n,"ucs2")}yield mTe}},validate:function(t){if(t==null)return null;if(!Buffer.isBuffer(t))throw new TypeError("Invalid buffer.");return t}},DRe=wE.default=_z;yz.exports=_z});var Cz=g((IE,Az)=>{"use strict";Object.defineProperty(IE,"__esModule",{value:!0});IE.default=void 0;var yTe=ETe(wo());function ETe(t){return t&&t.__esModule?t:{default:t}}var TTe=65535,ATe=Buffer.from([254,255,255,255,255,255,255,255]),CTe=Buffer.from([0,0,0,0]),STe=Buffer.from([255,255]),wTe=Buffer.from([255,255,255,255,255,255,255,255]),Tz={id:167,type:"BIGVARCHR",name:"VarChar",maximumLength:8e3,declaration:function(t){let e=t.value,n;return t.length?n=t.length:e!=null?n=e.length||1:e===null&&!t.output?n=1:n=this.maximumLength,n<=this.maximumLength?"varchar("+n+")":"varchar(max)"},resolveLength:function(t){let e=t.value;return t.length!=null?t.length:e!=null?e.length||1:this.maximumLength},generateTypeInfo(t){let e=Buffer.alloc(8);return e.writeUInt8(this.id,0),t.length<=this.maximumLength?e.writeUInt16LE(t.length,1):e.writeUInt16LE(TTe,1),t.collation&&t.collation.toBuffer().copy(e,3,0,5),e},generateParameterLength(t,e){let n=t.value;if(n==null)return t.length<=this.maximumLength?STe:wTe;if(t.length<=this.maximumLength){let i=Buffer.alloc(2);return i.writeUInt16LE(n.length,0),i}else return ATe},*generateParameterData(t,e){let n=t.value;if(n!=null)if(t.length<=this.maximumLength)yield n;else{if(n.length>0){let i=Buffer.alloc(4);i.writeUInt32LE(n.length,0),yield i,yield n}yield CTe}},validate:function(t,e){if(t==null)return null;if(typeof t!="string")throw new TypeError("Invalid string.");if(!e)throw new Error("No collation was set by the server for the current connection.");if(!e.codepage)throw new Error("The collation set by the server has no associated encoding.");return yTe.default.encode(t,e.codepage)}},MRe=IE.default=Tz;Az.exports=Tz});var Iz=g((vE,wz)=>{"use strict";Object.defineProperty(vE,"__esModule",{value:!0});vE.default=void 0;var ITe=Buffer.from([255,255]),Sz={id:173,type:"BIGBinary",name:"Binary",maximumLength:8e3,declaration:function(t){let e=t.value,n;return t.length?n=t.length:e!=null?n=e.length||1:e===null&&!t.output?n=1:n=this.maximumLength,"binary("+n+")"},resolveLength:function(t){let e=t.value;return e!=null?e.length:this.maximumLength},generateTypeInfo(t){let e=Buffer.alloc(3);return e.writeUInt8(this.id,0),e.writeUInt16LE(t.length,1),e},generateParameterLength(t,e){if(t.value==null)return ITe;let n=Buffer.alloc(2);return n.writeUInt16LE(t.length,0),n},*generateParameterData(t,e){t.value!=null&&(yield t.value.slice(0,t.length!==void 0?Math.min(t.length,this.maximumLength):this.maximumLength))},validate:function(t){if(t==null)return null;if(!Buffer.isBuffer(t))throw new TypeError("Invalid buffer.");return t}},kRe=vE.default=Sz;wz.exports=Sz});var Oz=g((bE,bz)=>{"use strict";Object.defineProperty(bE,"__esModule",{value:!0});bE.default=void 0;var vTe=bTe(wo());function bTe(t){return t&&t.__esModule?t:{default:t}}var OTe=Buffer.from([255,255]),vz={id:175,type:"BIGCHAR",name:"Char",maximumLength:8e3,declaration:function(t){let e=t.value,n;return t.length?n=t.length:e!=null?n=e.length||1:e===null&&!t.output?n=1:n=this.maximumLength,n<this.maximumLength?"char("+n+")":"char("+this.maximumLength+")"},resolveLength:function(t){let e=t.value;return t.length!=null?t.length:e!=null?e.length||1:this.maximumLength},generateTypeInfo(t){let e=Buffer.alloc(8);return e.writeUInt8(this.id,0),e.writeUInt16LE(t.length,1),t.collation&&t.collation.toBuffer().copy(e,3,0,5),e},generateParameterLength(t,e){let n=t.value;if(n==null)return OTe;let i=Buffer.alloc(2);return i.writeUInt16LE(n.length,0),i},*generateParameterData(t,e){t.value!=null&&(yield Buffer.from(t.value,"ascii"))},validate:function(t,e){if(t==null)return null;if(typeof t!="string")throw new TypeError("Invalid string.");if(!e)throw new Error("No collation was set by the server for the current connection.");if(!e.codepage)throw new Error("The collation set by the server has no associated encoding.");return vTe.default.encode(t,e.codepage)}},LRe=bE.default=vz;bz.exports=vz});var Pz=g((OE,Nz)=>{"use strict";Object.defineProperty(OE,"__esModule",{value:!0});OE.default=void 0;var RTe=65535,NTe=Buffer.from([254,255,255,255,255,255,255,255]),PTe=Buffer.from([0,0,0,0]),DTe=Buffer.from([255,255]),MTe=Buffer.from([255,255,255,255,255,255,255,255]),Rz={id:231,type:"NVARCHAR",name:"NVarChar",maximumLength:4e3,declaration:function(t){let e=t.value,n;return t.length?n=t.length:e!=null?n=e.toString().length||1:e===null&&!t.output?n=1:n=this.maximumLength,n<=this.maximumLength?"nvarchar("+n+")":"nvarchar(max)"},resolveLength:function(t){let e=t.value;return t.length!=null?t.length:e!=null?Buffer.isBuffer(e)?e.length/2||1:e.toString().length||1:this.maximumLength},generateTypeInfo(t){let e=Buffer.alloc(8);return e.writeUInt8(this.id,0),t.length<=this.maximumLength?e.writeUInt16LE(t.length*2,1):e.writeUInt16LE(RTe,1),t.collation&&t.collation.toBuffer().copy(e,3,0,5),e},generateParameterLength(t,e){if(t.value==null)return t.length<=this.maximumLength?DTe:MTe;let n=t.value;if(t.length<=this.maximumLength){let i;n instanceof Buffer?i=n.length:(n=n.toString(),i=Buffer.byteLength(n,"ucs2"));let r=Buffer.alloc(2);return r.writeUInt16LE(i,0),r}else return NTe},*generateParameterData(t,e){if(t.value==null)return;let n=t.value;if(t.length<=this.maximumLength)n instanceof Buffer?yield n:(n=n.toString(),yield Buffer.from(n,"ucs2"));else{if(n instanceof Buffer){let i=n.length;if(i>0){let r=Buffer.alloc(4);r.writeUInt32LE(i,0),yield r,yield n}}else{n=n.toString();let i=Buffer.byteLength(n,"ucs2");if(i>0){let r=Buffer.alloc(4);r.writeUInt32LE(i,0),yield r,yield Buffer.from(n,"ucs2")}}yield PTe}},validate:function(t){if(t==null)return null;if(typeof t!="string")throw new TypeError("Invalid string.");return t}},URe=OE.default=Rz;Nz.exports=Rz});var kz=g((RE,Mz)=>{"use strict";Object.defineProperty(RE,"__esModule",{value:!0});RE.default=void 0;var kTe=Buffer.from([255,255]),Dz={id:239,type:"NCHAR",name:"NChar",maximumLength:4e3,declaration:function(t){let e=t.value,n;return t.length?n=t.length:t.value!=null?n=e.toString().length||1:t.value===null&&!t.output?n=1:n=this.maximumLength,n<this.maximumLength?"nchar("+n+")":"nchar("+this.maximumLength+")"},resolveLength:function(t){let e=t.value;return t.length!=null?t.length:t.value!=null?Buffer.isBuffer(t.value)?t.value.length/2||1:e.toString().length||1:this.maximumLength},generateTypeInfo:function(t){let e=Buffer.alloc(8);return e.writeUInt8(this.id,0),e.writeUInt16LE(t.length*2,1),t.collation&&t.collation.toBuffer().copy(e,3,0,5),e},generateParameterLength(t,e){if(t.value==null)return kTe;let{value:n}=t;if(n instanceof Buffer){let i=n.length,r=Buffer.alloc(2);return r.writeUInt16LE(i,0),r}else{let i=Buffer.byteLength(n.toString(),"ucs2"),r=Buffer.alloc(2);return r.writeUInt16LE(i,0),r}},*generateParameterData(t,e){if(t.value==null)return;let n=t.value;n instanceof Buffer?yield n:yield Buffer.from(n,"ucs2")},validate:function(t){if(t==null)return null;if(typeof t!="string")throw new TypeError("Invalid string.");return t}},xRe=RE.default=Dz;Mz.exports=Dz});var xz=g((NE,Uz)=>{"use strict";Object.defineProperty(NE,"__esModule",{value:!0});NE.default=void 0;var Lz={id:241,type:"XML",name:"Xml",declaration(){throw new Error("not implemented")},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},FRe=NE.default=Lz;Uz.exports=Lz});var Hz=g((PE,qz)=>{"use strict";Object.defineProperty(PE,"__esModule",{value:!0});PE.default=void 0;var LTe=UTe(wn());function UTe(t){return t&&t.__esModule?t:{default:t}}var xTe=Buffer.from([0]),Fz={id:41,type:"TIMEN",name:"Time",declaration:function(t){return"time("+this.resolveScale(t)+")"},resolveScale:function(t){return t.scale!=null?t.scale:t.value===null?0:7},generateTypeInfo(t){return Buffer.from([this.id,t.scale])},generateParameterLength(t,e){if(t.value==null)return xTe;switch(t.scale){case 0:case 1:case 2:return Buffer.from([3]);case 3:case 4:return Buffer.from([4]);case 5:case 6:case 7:return Buffer.from([5]);default:throw new Error("invalid scale")}},*generateParameterData(t,e){if(t.value==null)return;let n=new LTe.default(16),i=t.value,r;switch(e.useUTC?r=((i.getUTCHours()*60+i.getUTCMinutes())*60+i.getUTCSeconds())*1e3+i.getUTCMilliseconds():r=((i.getHours()*60+i.getMinutes())*60+i.getSeconds())*1e3+i.getMilliseconds(),r=r*Math.pow(10,t.scale-3),r+=(t.value.nanosecondDelta!=null?t.value.nanosecondDelta:0)*Math.pow(10,t.scale),r=Math.round(r),t.scale){case 0:case 1:case 2:n.writeUInt24LE(r);break;case 3:case 4:n.writeUInt32LE(r);break;case 5:case 6:case 7:n.writeUInt40LE(r)}yield n.data},validate:function(t){if(t==null)return null;if(t instanceof Date||(t=new Date(Date.parse(t))),isNaN(t))throw new TypeError("Invalid time.");return t}},qRe=PE.default=Fz;qz.exports=Fz});var Yz=g((ME,jz)=>{"use strict";Object.defineProperty(ME,"__esModule",{value:!0});ME.default=void 0;var DE=(Dh(),At(Ph)),yO=global.Date,FTe=DE.LocalDate.ofYearDay(1,1),qTe=Buffer.from([0]),HTe=Buffer.from([3]),Bz={id:40,type:"DATEN",name:"Date",declaration:function(){return"date"},generateTypeInfo:function(){return Buffer.from([this.id])},generateParameterLength(t,e){return t.value==null?qTe:HTe},*generateParameterData(t,e){if(t.value==null)return;let n=t.value,i;e.useUTC?i=DE.LocalDate.of(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate()):i=DE.LocalDate.of(n.getFullYear(),n.getMonth()+1,n.getDate());let r=FTe.until(i,DE.ChronoUnit.DAYS),o=Buffer.alloc(3);o.writeUIntLE(r,0,3),yield o},validate:function(t,e,n){if(t==null)return null;t instanceof yO||(t=new yO(yO.parse(t))),t=t;let i;if(n&&n.useUTC?i=t.getUTCFullYear():i=t.getFullYear(),i<1||i>9999)throw new TypeError("Out of range.");if(isNaN(t))throw new TypeError("Invalid date.");return t}},HRe=ME.default=Bz;jz.exports=Bz});var zz=g((LE,$z)=>{"use strict";Object.defineProperty(LE,"__esModule",{value:!0});LE.default=void 0;var kE=(Dh(),At(Ph)),BTe=jTe(wn());function jTe(t){return t&&t.__esModule?t:{default:t}}var YTe=kE.LocalDate.ofYearDay(1,1),VTe=Buffer.from([0]),Vz={id:42,type:"DATETIME2N",name:"DateTime2",declaration:function(t){return"datetime2("+this.resolveScale(t)+")"},resolveScale:function(t){return t.scale!=null?t.scale:t.value===null?0:7},generateTypeInfo(t,e){return Buffer.from([this.id,t.scale])},generateParameterLength(t,e){if(t.value==null)return VTe;switch(t.scale){case 0:case 1:case 2:return Buffer.from([6]);case 3:case 4:return Buffer.from([7]);case 5:case 6:case 7:return Buffer.from([8]);default:throw new Error("invalid scale")}},*generateParameterData(t,e){if(t.value==null)return;let n=t.value,i=t.scale,r=new BTe.default(16);i=i;let o;switch(e.useUTC?o=((n.getUTCHours()*60+n.getUTCMinutes())*60+n.getUTCSeconds())*1e3+n.getUTCMilliseconds():o=((n.getHours()*60+n.getMinutes())*60+n.getSeconds())*1e3+n.getMilliseconds(),o=o*Math.pow(10,i-3),o+=(n.nanosecondDelta!=null?n.nanosecondDelta:0)*Math.pow(10,i),o=Math.round(o),i){case 0:case 1:case 2:r.writeUInt24LE(o);break;case 3:case 4:r.writeUInt32LE(o);break;case 5:case 6:case 7:r.writeUInt40LE(o)}let s;e.useUTC?s=kE.LocalDate.of(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate()):s=kE.LocalDate.of(n.getFullYear(),n.getMonth()+1,n.getDate());let a=YTe.until(s,kE.ChronoUnit.DAYS);r.writeUInt24LE(a),yield r.data},validate:function(t,e,n){if(t==null)return null;t instanceof Date||(t=new Date(Date.parse(t))),t=t;let i;if(n&&n.useUTC?i=t.getUTCFullYear():i=t.getFullYear(),i<1||i>9999)throw new TypeError("Out of range.");if(isNaN(t))throw new TypeError("Invalid date.");return t}},BRe=LE.default=Vz;$z.exports=Vz});var Kz=g((UE,Wz)=>{"use strict";Object.defineProperty(UE,"__esModule",{value:!0});UE.default=void 0;var EO=(Dh(),At(Ph)),$Te=zTe(wn());function zTe(t){return t&&t.__esModule?t:{default:t}}var GTe=EO.LocalDate.ofYearDay(1,1),WTe=Buffer.from([0]),Gz={id:43,type:"DATETIMEOFFSETN",name:"DateTimeOffset",declaration:function(t){return"datetimeoffset("+this.resolveScale(t)+")"},resolveScale:function(t){return t.scale!=null?t.scale:t.value===null?0:7},generateTypeInfo(t){return Buffer.from([this.id,t.scale])},generateParameterLength(t,e){if(t.value==null)return WTe;switch(t.scale){case 0:case 1:case 2:return Buffer.from([8]);case 3:case 4:return Buffer.from([9]);case 5:case 6:case 7:return Buffer.from([10]);default:throw new Error("invalid scale")}},*generateParameterData(t,e){if(t.value==null)return;let n=t.value,i=t.scale,r=new $Te.default(16);i=i;let o;switch(o=((n.getUTCHours()*60+n.getUTCMinutes())*60+n.getUTCSeconds())*1e3+n.getMilliseconds(),o=o*Math.pow(10,i-3),o+=(n.nanosecondDelta!=null?n.nanosecondDelta:0)*Math.pow(10,i),o=Math.round(o),i){case 0:case 1:case 2:r.writeUInt24LE(o);break;case 3:case 4:r.writeUInt32LE(o);break;case 5:case 6:case 7:r.writeUInt40LE(o)}let s=EO.LocalDate.of(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate()),a=GTe.until(s,EO.ChronoUnit.DAYS);r.writeUInt24LE(a);let c=-n.getTimezoneOffset();r.writeInt16LE(c),yield r.data},validate:function(t,e,n){if(t==null)return null;t instanceof Date||(t=new Date(Date.parse(t))),t=t;let i;if(n&&n.useUTC?i=t.getUTCFullYear():i=t.getFullYear(),i<1||i>9999)throw new TypeError("Out of range.");if(isNaN(t))throw new TypeError("Invalid date.");return t}},jRe=UE.default=Gz;Wz.exports=Gz});var Zz=g((xE,Qz)=>{"use strict";Object.defineProperty(xE,"__esModule",{value:!0});xE.default=void 0;var Xz={id:240,type:"UDTTYPE",name:"UDT",declaration(){throw new Error("not implemented")},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},YRe=xE.default=Xz;Qz.exports=Xz});var tG=g((qE,eG)=>{"use strict";Object.defineProperty(qE,"__esModule",{value:!0});qE.default=void 0;var KTe=ho(),XTe=QTe(wn());function QTe(t){return t&&t.__esModule?t:{default:t}}var ZTe=Buffer.from([1]),FE=Buffer.from([0]),JTe=Buffer.from([255,255]),Jz={id:243,type:"TVPTYPE",name:"TVP",declaration:function(t){return t.value.name+" readonly"},generateTypeInfo(t){let n=t.value?.schema??"",i=t.value?.name??"",r=2+Buffer.byteLength("","ucs2")+1+Buffer.byteLength(n,"ucs2")+1+Buffer.byteLength(i,"ucs2"),o=new XTe.default(r,"ucs2");return o.writeUInt8(this.id),o.writeBVarchar(""),o.writeBVarchar(n),o.writeBVarchar(i),o.data},generateParameterLength(t,e){if(t.value==null)return JTe;let{columns:n}=t.value,i=Buffer.alloc(2);return i.writeUInt16LE(n.length,0),i},*generateParameterData(t,e){if(t.value==null){yield FE,yield FE;return}let{columns:n,rows:i}=t.value;for(let r=0,o=n.length;r<o;r++){let s=n[r],a=Buffer.alloc(6);a.writeUInt32LE(0,0),a.writeUInt16LE(0,4),yield a,yield s.type.generateTypeInfo(s),yield Buffer.from([0])}yield FE;for(let r=0,o=i.length;r<o;r++){yield ZTe;let s=i[r];for(let a=0,c=s.length;a<c;a++){let u=n[a],l=s[a],d;try{d=u.type.validate(l,t.collation)}catch(m){throw new KTe.InputError(`TVP column '${u.name}' has invalid data at row index ${r}`,{cause:m})}let f={value:d,length:u.length,scale:u.scale,precision:u.precision};yield u.type.generateParameterLength(f,e),yield*u.type.generateParameterData(f,e)}}yield FE},validate:function(t){if(t==null)return null;if(typeof t!="object")throw new TypeError("Invalid table.");if(!Array.isArray(t.columns))throw new TypeError("Invalid table.");if(!Array.isArray(t.rows))throw new TypeError("Invalid table.");return t}},VRe=qE.default=Jz;eG.exports=Jz});var iG=g((HE,rG)=>{"use strict";Object.defineProperty(HE,"__esModule",{value:!0});HE.default=void 0;var nG={id:98,type:"SSVARIANTTYPE",name:"Variant",declaration:function(){return"sql_variant"},generateTypeInfo(){throw new Error("not implemented")},generateParameterLength(){throw new Error("not implemented")},generateParameterData(){throw new Error("not implemented")},validate(){throw new Error("not implemented")}},$Re=HE.default=nG;rG.exports=nG});var kh=g(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.typeByName=To.TYPES=To.TYPE=void 0;var oG=Ae(DV()),TO=Ae(xV()),AO=Ae(jV()),CO=Ae($V()),SO=Ae(WV()),wO=Ae(e$()),IO=Ae(o$()),vO=Ae(l$()),bO=Ae(k$()),OO=Ae(x$()),RO=Ae(Y$()),NO=Ae(K$()),PO=Ae(Z$()),DO=Ae(iz()),MO=Ae(az()),kO=Ae(lz()),LO=Ae(fz()),sG=Ae(Fc()),UO=Ae(gz()),aG=Ae(Kb()),cG=Ae(fO()),uG=Ae(mO()),lG=Ae(tE()),dG=Ae(iE()),hG=Ae(Zy()),xO=Ae(Ez()),FO=Ae(Cz()),qO=Ae(Iz()),HO=Ae(Oz()),BO=Ae(Pz()),jO=Ae(kz()),YO=Ae(xz()),VO=Ae(Hz()),$O=Ae(Yz()),zO=Ae(zz()),GO=Ae(Kz()),WO=Ae(Zz()),KO=Ae(tG()),XO=Ae(iG());function Ae(t){return t&&t.__esModule?t:{default:t}}var zRe=To.TYPE={[oG.default.id]:oG.default,[TO.default.id]:TO.default,[AO.default.id]:AO.default,[CO.default.id]:CO.default,[SO.default.id]:SO.default,[wO.default.id]:wO.default,[IO.default.id]:IO.default,[vO.default.id]:vO.default,[bO.default.id]:bO.default,[OO.default.id]:OO.default,[RO.default.id]:RO.default,[NO.default.id]:NO.default,[PO.default.id]:PO.default,[DO.default.id]:DO.default,[MO.default.id]:MO.default,[kO.default.id]:kO.default,[LO.default.id]:LO.default,[sG.default.id]:sG.default,[UO.default.id]:UO.default,[aG.default.id]:aG.default,[cG.default.id]:cG.default,[uG.default.id]:uG.default,[lG.default.id]:lG.default,[dG.default.id]:dG.default,[hG.default.id]:hG.default,[xO.default.id]:xO.default,[FO.default.id]:FO.default,[qO.default.id]:qO.default,[HO.default.id]:HO.default,[BO.default.id]:BO.default,[jO.default.id]:jO.default,[YO.default.id]:YO.default,[VO.default.id]:VO.default,[$O.default.id]:$O.default,[zO.default.id]:zO.default,[GO.default.id]:GO.default,[WO.default.id]:WO.default,[KO.default.id]:KO.default,[XO.default.id]:XO.default},eAe=To.TYPES={TinyInt:TO.default,Bit:AO.default,SmallInt:CO.default,Int:SO.default,SmallDateTime:wO.default,Real:IO.default,Money:vO.default,DateTime:bO.default,Float:OO.default,Decimal:RO.default,Numeric:NO.default,SmallMoney:PO.default,BigInt:DO.default,Image:MO.default,Text:kO.default,UniqueIdentifier:LO.default,NText:UO.default,VarBinary:xO.default,VarChar:FO.default,Binary:qO.default,Char:HO.default,NVarChar:BO.default,NChar:jO.default,Xml:YO.default,Time:VO.default,Date:$O.default,DateTime2:zO.default,DateTimeOffset:GO.default,UDT:WO.default,TVP:KO.default,Variant:XO.default},GRe=To.typeByName=eAe});var Gt=g(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.Result=rt.NotEnoughDataError=void 0;rt.readBVarByte=hAe;rt.readBVarChar=dAe;rt.readBigInt64LE=cAe;rt.readBigUInt64LE=aAe;rt.readDoubleLE=lAe;rt.readFloatLE=uAe;rt.readInt16LE=tAe;rt.readInt32LE=sAe;rt.readUInt16LE=ZO;rt.readUInt24LE=nAe;rt.readUInt32BE=iAe;rt.readUInt32LE=rAe;rt.readUInt40LE=oAe;rt.readUInt8=QO;rt.readUNumeric128LE=_Ae;rt.readUNumeric64LE=mAe;rt.readUNumeric96LE=gAe;rt.readUsVarByte=pAe;rt.readUsVarChar=fAe;var ut=class{constructor(e,n){this.value=e,this.offset=n}};rt.Result=ut;var lt=class extends Error{byteCount;constructor(e){super(),this.byteCount=e}};rt.NotEnoughDataError=lt;function QO(t,e){if(e=+e,t.length<e+1)throw new lt(e+1);return new ut(t.readUInt8(e),e+1)}function ZO(t,e){if(e=+e,t.length<e+2)throw new lt(e+2);return new ut(t.readUInt16LE(e),e+2)}function tAe(t,e){if(e=+e,t.length<e+2)throw new lt(e+2);return new ut(t.readInt16LE(e),e+2)}function nAe(t,e){if(e=+e,t.length<e+3)throw new lt(e+3);return new ut(t.readUIntLE(e,3),e+3)}function rAe(t,e){if(e=+e,t.length<e+4)throw new lt(e+4);return new ut(t.readUInt32LE(e),e+4)}function iAe(t,e){if(e=+e,t.length<e+4)throw new lt(e+4);return new ut(t.readUInt32BE(e),e+4)}function oAe(t,e){if(e=+e,t.length<e+5)throw new lt(e+5);return new ut(t.readUIntLE(e,5),e+5)}function sAe(t,e){if(e=+e,t.length<e+4)throw new lt(e+4);return new ut(t.readInt32LE(e),e+4)}function aAe(t,e){if(e=+e,t.length<e+8)throw new lt(e+8);return new ut(t.readBigUInt64LE(e),e+8)}function cAe(t,e){if(e=+e,t.length<e+8)throw new lt(e+8);return new ut(t.readBigInt64LE(e),e+8)}function uAe(t,e){if(e=+e,t.length<e+4)throw new lt(e+4);return new ut(t.readFloatLE(e),e+4)}function lAe(t,e){if(e=+e,t.length<e+8)throw new lt(e+8);return new ut(t.readDoubleLE(e),e+8)}function dAe(t,e){e=+e;let n;({offset:e,value:n}=QO(t,e));let i=n*2;if(t.length<e+i)throw new lt(e+i);return new ut(t.toString("ucs2",e,e+i),e+i)}function hAe(t,e){e=+e;let n;if({offset:e,value:n}=QO(t,e),t.length<e+n)throw new lt(e+n);return new ut(t.slice(e,e+n),e+n)}function fAe(t,e){e=+e;let n;({offset:e,value:n}=ZO(t,e));let i=n*2;if(t.length<e+i)throw new lt(e+i);return new ut(t.toString("ucs2",e,e+i),e+i)}function pAe(t,e){e=+e;let n;if({offset:e,value:n}=ZO(t,e),t.length<e+n)throw new lt(e+n);return new ut(t.slice(e,e+n),e+n)}function mAe(t,e){if(e=+e,t.length<e+8)throw new lt(e+8);let n=t.readUInt32LE(e),i=t.readUInt32LE(e+4);return new ut(4294967296*i+n,e+8)}function gAe(t,e){if(e=+e,t.length<e+12)throw new lt(e+12);let n=t.readUInt32LE(e),i=t.readUInt32LE(e+4),r=t.readUInt32LE(e+8);return new ut(n+4294967296*i+4294967296*4294967296*r,e+12)}function _Ae(t,e){if(e=+e,t.length<e+16)throw new lt(e+16);let n=t.readUInt32LE(e),i=t.readUInt32LE(e+4),r=t.readUInt32LE(e+8),o=t.readUInt32LE(e+12);return new ut(n+4294967296*i+4294967296*4294967296*r+4294967296*4294967296*4294967296*o,e+16)}});var YE=g((Zc,jE)=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.default=void 0;Zc.readCollation=BE;Zc.readMetadata=JO;var yAe=Wb(),EAe=kh(),fG=Ac(),Ee=Gt();function BE(t,e){if(e=+e,t.length<e+5)throw new Ee.NotEnoughDataError(e+5);let n=yAe.Collation.fromBuffer(t.slice(e,e+5));return new Ee.Result(n,e+5)}function TAe(t,e){e=+e;let n;if({offset:e,value:n}=(0,Ee.readUInt8)(t,e),n!==1)return new Ee.Result(void 0,e);let i;({offset:e,value:i}=(0,Ee.readBVarChar)(t,e));let r;({offset:e,value:r}=(0,Ee.readBVarChar)(t,e));let o;return{offset:e,value:o}=(0,Ee.readUsVarChar)(t,e),new Ee.Result({dbname:i,owningSchema:r,xmlSchemaCollection:o},e)}function AAe(t,e){let n;({offset:e,value:n}=(0,Ee.readUInt16LE)(t,e));let i;({offset:e,value:i}=(0,Ee.readBVarChar)(t,e));let r;({offset:e,value:r}=(0,Ee.readBVarChar)(t,e));let o;({offset:e,value:o}=(0,Ee.readBVarChar)(t,e));let s;return{offset:e,value:s}=(0,Ee.readUsVarChar)(t,e),new Ee.Result({maxByteSize:n,dbname:i,owningSchema:r,typeName:o,assemblyName:s},e)}function JO(t,e,n){let i;({offset:e,value:i}=(n.tdsVersion<"7_2"?Ee.readUInt16LE:Ee.readUInt32LE)(t,e));let r;({offset:e,value:r}=(0,Ee.readUInt16LE)(t,e));let o;({offset:e,value:o}=(0,Ee.readUInt8)(t,e));let s=EAe.TYPE[o];if(!s)throw new Error((0,fG.sprintf)("Unrecognised data type 0x%02X",o));switch(s.name){case"Null":case"TinyInt":case"SmallInt":case"Int":case"BigInt":case"Real":case"Float":case"SmallMoney":case"Money":case"Bit":case"SmallDateTime":case"DateTime":case"Date":return new Ee.Result({userType:i,flags:r,type:s,collation:void 0,precision:void 0,scale:void 0,dataLength:void 0,schema:void 0,udtInfo:void 0},e);case"IntN":case"FloatN":case"MoneyN":case"BitN":case"UniqueIdentifier":case"DateTimeN":{let a;return{offset:e,value:a}=(0,Ee.readUInt8)(t,e),new Ee.Result({userType:i,flags:r,type:s,collation:void 0,precision:void 0,scale:void 0,dataLength:a,schema:void 0,udtInfo:void 0},e)}case"Variant":{let a;return{offset:e,value:a}=(0,Ee.readUInt32LE)(t,e),new Ee.Result({userType:i,flags:r,type:s,collation:void 0,precision:void 0,scale:void 0,dataLength:a,schema:void 0,udtInfo:void 0},e)}case"VarChar":case"Char":case"NVarChar":case"NChar":{let a;({offset:e,value:a}=(0,Ee.readUInt16LE)(t,e));let c;return{offset:e,value:c}=BE(t,e),new Ee.Result({userType:i,flags:r,type:s,collation:c,precision:void 0,scale:void 0,dataLength:a,schema:void 0,udtInfo:void 0},e)}case"Text":case"NText":{let a;({offset:e,value:a}=(0,Ee.readUInt32LE)(t,e));let c;return{offset:e,value:c}=BE(t,e),new Ee.Result({userType:i,flags:r,type:s,collation:c,precision:void 0,scale:void 0,dataLength:a,schema:void 0,udtInfo:void 0},e)}case"VarBinary":case"Binary":{let a;return{offset:e,value:a}=(0,Ee.readUInt16LE)(t,e),new Ee.Result({userType:i,flags:r,type:s,collation:void 0,precision:void 0,scale:void 0,dataLength:a,schema:void 0,udtInfo:void 0},e)}case"Image":{let a;return{offset:e,value:a}=(0,Ee.readUInt32LE)(t,e),new Ee.Result({userType:i,flags:r,type:s,collation:void 0,precision:void 0,scale:void 0,dataLength:a,schema:void 0,udtInfo:void 0},e)}case"Xml":{let a;return{offset:e,value:a}=TAe(t,e),new Ee.Result({userType:i,flags:r,type:s,collation:void 0,precision:void 0,scale:void 0,dataLength:void 0,schema:a,udtInfo:void 0},e)}case"Time":case"DateTime2":case"DateTimeOffset":{let a;return{offset:e,value:a}=(0,Ee.readUInt8)(t,e),new Ee.Result({userType:i,flags:r,type:s,collation:void 0,precision:void 0,scale:a,dataLength:void 0,schema:void 0,udtInfo:void 0},e)}case"NumericN":case"DecimalN":{let a;({offset:e,value:a}=(0,Ee.readUInt8)(t,e));let c;({offset:e,value:c}=(0,Ee.readUInt8)(t,e));let u;return{offset:e,value:u}=(0,Ee.readUInt8)(t,e),new Ee.Result({userType:i,flags:r,type:s,collation:void 0,precision:c,scale:u,dataLength:a,schema:void 0,udtInfo:void 0},e)}case"UDT":{let a;return{offset:e,value:a}=AAe(t,e),new Ee.Result({userType:i,flags:r,type:s,collation:void 0,precision:void 0,scale:void 0,dataLength:void 0,schema:void 0,udtInfo:a},e)}default:throw new Error((0,fG.sprintf)("Unrecognised type %s",s.name))}}function pG(t,e,n){(async()=>{for(;;){let i;try{i=JO(t.buffer,t.position,e)}catch(r){if(r instanceof Ee.NotEnoughDataError){await t.waitForChunk();continue}throw r}return t.position=i.offset,n(i.value)}})()}var XRe=Zc.default=pG;jE.exports=pG;jE.exports.readCollation=BE;jE.exports.readMetadata=JO});var _G=g((VE,gG)=>{"use strict";Object.defineProperty(VE,"__esModule",{value:!0});VE.default=void 0;var CAe=YE(),SAe=Wt(),$n=Gt();function wAe(t,e,n,i){if(!n.type.hasTableName)return new $n.Result(void 0,e);if(i.tdsVersion<"7_2")return(0,$n.readUsVarChar)(t,e);let r;({offset:e,value:r}=(0,$n.readUInt8)(t,e));let o=[];for(let s=0;s<r;s++){let a;({offset:e,value:a}=(0,$n.readUsVarChar)(t,e)),o.push(a)}return new $n.Result(o,e)}function IAe(t,e,n,i,r){let o;return{offset:e,value:o}=(0,$n.readBVarChar)(t,e),r.columnNameReplacer?new $n.Result(r.columnNameReplacer(o,n,i),e):r.camelCaseColumns?new $n.Result(o.replace(/^[A-Z]/,function(s){return s.toLowerCase()}),e):new $n.Result(o,e)}function vAe(t,e,n,i){let r;({offset:e,value:r}=(0,CAe.readMetadata)(t,e,n));let o;({offset:e,value:o}=wAe(t,e,r,n));let s;return{offset:e,value:s}=IAe(t,e,i,r,n),new $n.Result({userType:r.userType,flags:r.flags,type:r.type,collation:r.collation,precision:r.precision,scale:r.scale,udtInfo:r.udtInfo,dataLength:r.dataLength,schema:r.schema,colName:s,tableName:o},e)}async function mG(t){let e;for(;;){let i;try{({offset:i,value:e}=(0,$n.readUInt16LE)(t.buffer,t.position))}catch(r){if(r instanceof $n.NotEnoughDataError){await t.waitForChunk();continue}throw r}t.position=i;break}let n=[];for(let i=0;i<e;i++)for(;;){let r,o;try{({offset:o,value:r}=vAe(t.buffer,t.position,t.options,i))}catch(s){if(s instanceof $n.NotEnoughDataError){await t.waitForChunk();continue}throw s}t.position=o,n.push(r);break}return new SAe.ColMetadataToken(n)}var QRe=VE.default=mG;gG.exports=mG});var yG=g(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.doneInProcParser=OAe;Uh.doneParser=bAe;Uh.doneProcParser=RAe;var eR=Wt(),Ao=Gt(),Lh={MORE:1,ERROR:2,INXACT:4,COUNT:16,ATTN:32,SRVERROR:256};function tR(t,e,n){let i;({offset:e,value:i}=(0,Ao.readUInt16LE)(t,e));let r=!!(i&Lh.MORE),o=!!(i&Lh.ERROR),s=!!(i&Lh.COUNT),a=!!(i&Lh.ATTN),c=!!(i&Lh.SRVERROR),u;({offset:e,value:u}=(0,Ao.readUInt16LE)(t,e));let l;return{offset:e,value:l}=(n.tdsVersion<"7_2"?Ao.readUInt32LE:Ao.readBigUInt64LE)(t,e),new Ao.Result({more:r,sqlError:o,attention:a,serverError:c,rowCount:s?Number(l):void 0,curCmd:u},e)}function bAe(t,e,n){let i;return{offset:e,value:i}=tR(t,e,n),new Ao.Result(new eR.DoneToken(i),e)}function OAe(t,e,n){let i;return{offset:e,value:i}=tR(t,e,n),new Ao.Result(new eR.DoneInProcToken(i),e)}function RAe(t,e,n){let i;return{offset:e,value:i}=tR(t,e,n),new Ao.Result(new eR.DoneProcToken(i),e)}});var CG=g(($E,AG)=>{"use strict";Object.defineProperty($E,"__esModule",{value:!0});$E.default=void 0;var EG=Wb(),Lr=Wt(),dt=Gt(),NAe={1:{name:"DATABASE",event:"databaseChange"},2:{name:"LANGUAGE",event:"languageChange"},3:{name:"CHARSET",event:"charsetChange"},4:{name:"PACKET_SIZE",event:"packetSizeChange"},7:{name:"SQL_COLLATION",event:"sqlCollationChange"},8:{name:"BEGIN_TXN",event:"beginTransaction"},9:{name:"COMMIT_TXN",event:"commitTransaction"},10:{name:"ROLLBACK_TXN",event:"rollbackTransaction"},13:{name:"DATABASE_MIRRORING_PARTNER",event:"partnerNode"},17:{name:"TXN_ENDED"},18:{name:"RESET_CONNECTION",event:"resetConnection"},20:{name:"ROUTING_CHANGE",event:"routingChange"}};function PAe(t,e,n,i){switch(i.name){case"DATABASE":case"LANGUAGE":case"CHARSET":case"PACKET_SIZE":case"DATABASE_MIRRORING_PARTNER":{let r;({offset:e,value:r}=(0,dt.readBVarChar)(t,e));let o;switch({offset:e,value:o}=(0,dt.readBVarChar)(t,e),i.name){case"PACKET_SIZE":return new dt.Result(new Lr.PacketSizeEnvChangeToken(parseInt(r),parseInt(o)),e);case"DATABASE":return new dt.Result(new Lr.DatabaseEnvChangeToken(r,o),e);case"LANGUAGE":return new dt.Result(new Lr.LanguageEnvChangeToken(r,o),e);case"CHARSET":return new dt.Result(new Lr.CharsetEnvChangeToken(r,o),e);case"DATABASE_MIRRORING_PARTNER":return new dt.Result(new Lr.DatabaseMirroringPartnerEnvChangeToken(r,o),e)}throw new Error("unreachable")}case"SQL_COLLATION":case"BEGIN_TXN":case"COMMIT_TXN":case"ROLLBACK_TXN":case"RESET_CONNECTION":{let r;({offset:e,value:r}=(0,dt.readBVarByte)(t,e));let o;switch({offset:e,value:o}=(0,dt.readBVarByte)(t,e),i.name){case"SQL_COLLATION":{let s=r.length?EG.Collation.fromBuffer(r):void 0,a=o.length?EG.Collation.fromBuffer(o):void 0;return new dt.Result(new Lr.CollationChangeToken(s,a),e)}case"BEGIN_TXN":return new dt.Result(new Lr.BeginTransactionEnvChangeToken(r,o),e);case"COMMIT_TXN":return new dt.Result(new Lr.CommitTransactionEnvChangeToken(r,o),e);case"ROLLBACK_TXN":return new dt.Result(new Lr.RollbackTransactionEnvChangeToken(r,o),e);case"RESET_CONNECTION":return new dt.Result(new Lr.ResetConnectionEnvChangeToken(r,o),e)}throw new Error("unreachable")}case"ROUTING_CHANGE":{let r;({offset:e,value:r}=(0,dt.readUsVarByte)(t,e));let o;({offset:e,value:o}=(0,dt.readUsVarByte)(t,e));let s=r.readUInt8(0);if(s!==0)throw new Error("Unknown protocol byte in routing change event");let a=r.readUInt16LE(1),c=r.readUInt16LE(3),u=r.toString("ucs2",5,5+c*2),l={protocol:s,port:a,server:u};return new dt.Result(new Lr.RoutingEnvChangeToken(l,o),e)}default:return console.error("Tedious > Unsupported ENVCHANGE type "+i.name),new dt.Result(void 0,e+n-1)}}function TG(t,e,n){let i;if({offset:e,value:i}=(0,dt.readUInt16LE)(t,e),t.length<e+i)throw new dt.NotEnoughDataError(e+i);let r;({offset:e,value:r}=(0,dt.readUInt8)(t,e));let o=NAe[r];return o?PAe(t,e,i,o):(console.error("Tedious > Unsupported ENVCHANGE type "+r),new dt.Result(void 0,e+i-1))}var JRe=$E.default=TG;AG.exports=TG});var IG=g(zE=>{"use strict";Object.defineProperty(zE,"__esModule",{value:!0});zE.errorParser=MAe;zE.infoParser=DAe;var zn=Gt(),SG=Wt();function wG(t,e,n){let i;if({offset:e,value:i}=(0,zn.readUInt16LE)(t,e),t.length<i+e)throw new zn.NotEnoughDataError(i+e);let r;({offset:e,value:r}=(0,zn.readUInt32LE)(t,e));let o;({offset:e,value:o}=(0,zn.readUInt8)(t,e));let s;({offset:e,value:s}=(0,zn.readUInt8)(t,e));let a;({offset:e,value:a}=(0,zn.readUsVarChar)(t,e));let c;({offset:e,value:c}=(0,zn.readBVarChar)(t,e));let u;({offset:e,value:u}=(0,zn.readBVarChar)(t,e));let l;return{offset:e,value:l}=n.tdsVersion<"7_2"?(0,zn.readUInt16LE)(t,e):(0,zn.readUInt32LE)(t,e),new zn.Result({number:r,state:o,class:s,message:a,serverName:c,procName:u,lineNumber:l},e)}function DAe(t,e,n){let i;return{offset:e,value:i}=wG(t,e,n),new zn.Result(new SG.InfoMessageToken(i),e)}function MAe(t,e,n){let i;return{offset:e,value:i}=wG(t,e,n),new zn.Result(new SG.ErrorMessageToken(i),e)}});var RG=g((GE,OG)=>{"use strict";Object.defineProperty(GE,"__esModule",{value:!0});GE.default=void 0;var nR=Gt(),kAe=Wt(),vG={STSURL:1,SPN:2};function LAe(t){let e=0,n,i,r=t.readUInt32LE(e);e+=4;for(let o=0;o<r;o++){let s=t.readUInt8(e);e+=1;let a=t.readUInt32LE(e);e+=4;let c=t.readUInt32LE(e);switch(e+=4,s){case vG.SPN:n=t.toString("ucs2",c,c+a);break;case vG.STSURL:i=t.toString("ucs2",c,c+a);break;default:break}}return{spn:n,stsurl:i}}function bG(t,e,n){let i;if({offset:e,value:i}=(0,nR.readUInt32LE)(t,e),t.length<e+i)throw new nR.NotEnoughDataError(e+i);let r=t.slice(e,e+i);e+=i;let{spn:o,stsurl:s}=LAe(r);return new nR.Result(new kAe.FedAuthInfoToken(o,s),e)}var tNe=GE.default=bG;OG.exports=bG});var DG=g((KE,PG)=>{"use strict";Object.defineProperty(KE,"__esModule",{value:!0});KE.default=void 0;var WE=Gt(),UAe=Wt(),rR={SESSIONRECOVERY:1,FEDAUTH:2,COLUMNENCRYPTION:4,GLOBALTRANSACTIONS:5,AZURESQLSUPPORT:8,UTF8_SUPPORT:10,TERMINATOR:255};function NG(t,e,n){let i,r;for(;;){let o;if({value:o,offset:e}=(0,WE.readUInt8)(t,e),o===rR.TERMINATOR)return new WE.Result(new UAe.FeatureExtAckToken(i,r),e);let s;if({value:s,offset:e}=(0,WE.readUInt32LE)(t,e),t.length<e+s)throw new WE.NotEnoughDataError(e+s);let a=t.slice(e,e+s);switch(e+=s,o){case rR.FEDAUTH:i=a;break;case rR.UTF8_SUPPORT:r=!!a[0];break}}}var nNe=KE.default=NG;PG.exports=NG});var LG=g((XE,kG)=>{"use strict";Object.defineProperty(XE,"__esModule",{value:!0});XE.default=void 0;var xAe=Wt(),FAe=nh(),di=Gt(),qAe={0:"SQL_DFLT",1:"SQL_TSQL"};function MG(t,e,n){let i;if({offset:e,value:i}=(0,di.readUInt16LE)(t,e),t.length<i+e)throw new di.NotEnoughDataError(i+e);let r;({offset:e,value:r}=(0,di.readUInt8)(t,e));let o=qAe[r],s;({offset:e,value:s}=(0,di.readUInt32BE)(t,e));let a=FAe.versionsByValue[s],c;({offset:e,value:c}=(0,di.readBVarChar)(t,e));let u;({offset:e,value:u}=(0,di.readUInt8)(t,e));let l;({offset:e,value:l}=(0,di.readUInt8)(t,e));let d;({offset:e,value:d}=(0,di.readUInt8)(t,e));let f;return{offset:e,value:f}=(0,di.readUInt8)(t,e),new di.Result(new xAe.LoginAckToken({interface:o,tdsVersion:a,progName:c,progVersion:{major:u,minor:l,buildNumHi:d,buildNumLow:f}}),e)}var rNe=XE.default=MG;kG.exports=MG});var FG=g((ZE,xG)=>{"use strict";Object.defineProperty(ZE,"__esModule",{value:!0});ZE.default=void 0;var HAe=Wt(),QE=Gt();function UG(t,e,n){let i;if({offset:e,value:i}=(0,QE.readUInt16LE)(t,e),t.length<e+i)throw new QE.NotEnoughDataError(e+i);let r=[];for(let o=0;o<i;o+=2){let s;({offset:e,value:s}=(0,QE.readUInt16LE)(t,e)),r.push(s)}return new QE.Result(new HAe.OrderToken(r),e)}var iNe=ZE.default=UG;xG.exports=UG});var jG=g((JE,BG)=>{"use strict";Object.defineProperty(JE,"__esModule",{value:!0});JE.default=void 0;var qG=Gt(),BAe=Wt();function HG(t,e,n){let i;return{value:i,offset:e}=(0,qG.readInt32LE)(t,e),new qG.Result(new BAe.ReturnStatusToken(i),e)}var oNe=JE.default=HG;BG.exports=HG});var nT=g((xh,tT)=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.isPLPStream=WG;xh.readPLPStream=QG;xh.readValue=GG;var YG=YE(),jAe=kh(),YAe=VAe(wo()),$G=Ac(),VG=_O(),H=Gt();function VAe(t){return t&&t.__esModule?t:{default:t}}var iR=65535,$Ae=65535,zAe=3+1/3,zG=1e4,GAe=0xFFFFFFFFFFFFFFFFn,WAe=0xFFFFFFFFFFFFFFFEn,KAe="utf8";function oR(t,e){return(0,H.readUInt8)(t,e)}function sR(t,e){return(0,H.readInt16LE)(t,e)}function aR(t,e){return(0,H.readInt32LE)(t,e)}function cR(t,e){let n;return{offset:e,value:n}=(0,H.readBigInt64LE)(t,e),new H.Result(n.toString(),e)}function uR(t,e){return(0,H.readFloatLE)(t,e)}function lR(t,e){return(0,H.readDoubleLE)(t,e)}function dR(t,e){let n;return{offset:e,value:n}=(0,H.readInt32LE)(t,e),new H.Result(n/zG,e)}function hR(t,e){let n;({offset:e,value:n}=(0,H.readInt32LE)(t,e));let i;return{offset:e,value:i}=(0,H.readUInt32LE)(t,e),new H.Result((i+4294967296*n)/zG,e)}function fR(t,e){let n;return{offset:e,value:n}=(0,H.readUInt8)(t,e),new H.Result(!!n,e)}function GG(t,e,n,i){switch(n.type.name){case"Null":return new H.Result(null,e);case"TinyInt":return oR(t,e);case"SmallInt":return sR(t,e);case"Int":return aR(t,e);case"BigInt":return cR(t,e);case"IntN":{let o;switch({offset:e,value:o}=(0,H.readUInt8)(t,e),o){case 0:return new H.Result(null,e);case 1:return oR(t,e);case 2:return sR(t,e);case 4:return aR(t,e);case 8:return cR(t,e);default:throw new Error("Unsupported dataLength "+o+" for IntN")}}case"Real":return uR(t,e);case"Float":return lR(t,e);case"FloatN":{let o;switch({offset:e,value:o}=(0,H.readUInt8)(t,e),o){case 0:return new H.Result(null,e);case 4:return uR(t,e);case 8:return lR(t,e);default:throw new Error("Unsupported dataLength "+o+" for FloatN")}}case"SmallMoney":return dR(t,e);case"Money":return hR(t,e);case"MoneyN":{let o;switch({offset:e,value:o}=(0,H.readUInt8)(t,e),o){case 0:return new H.Result(null,e);case 4:return dR(t,e);case 8:return hR(t,e);default:throw new Error("Unsupported dataLength "+o+" for MoneyN")}}case"Bit":return fR(t,e);case"BitN":{let o;switch({offset:e,value:o}=(0,H.readUInt8)(t,e),o){case 0:return new H.Result(null,e);case 1:return fR(t,e);default:throw new Error("Unsupported dataLength "+o+" for BitN")}}case"VarChar":case"Char":{let o=n.collation.codepage,s;return{offset:e,value:s}=(0,H.readUInt16LE)(t,e),s===iR?new H.Result(null,e):pR(t,e,s,o)}case"NVarChar":case"NChar":{let o;return{offset:e,value:o}=(0,H.readUInt16LE)(t,e),o===iR?new H.Result(null,e):mR(t,e,o)}case"VarBinary":case"Binary":{let o;return{offset:e,value:o}=(0,H.readUInt16LE)(t,e),o===iR?new H.Result(null,e):hi(t,e,o)}case"Text":{let o;if({offset:e,value:o}=(0,H.readUInt8)(t,e),o===0)return new H.Result(null,e);({offset:e}=hi(t,e,o)),{offset:e}=hi(t,e,8);let s;return{offset:e,value:s}=(0,H.readUInt32LE)(t,e),pR(t,e,s,n.collation.codepage)}case"NText":{let o;if({offset:e,value:o}=(0,H.readUInt8)(t,e),o===0)return new H.Result(null,e);({offset:e}=hi(t,e,o)),{offset:e}=hi(t,e,8);let s;return{offset:e,value:s}=(0,H.readUInt32LE)(t,e),mR(t,e,s)}case"Image":{let o;if({offset:e,value:o}=(0,H.readUInt8)(t,e),o===0)return new H.Result(null,e);({offset:e}=hi(t,e,o)),{offset:e}=hi(t,e,8);let s;return{offset:e,value:s}=(0,H.readUInt32LE)(t,e),hi(t,e,s)}case"SmallDateTime":return gR(t,e,i.useUTC);case"DateTime":return _R(t,e,i.useUTC);case"DateTimeN":{let o;switch({offset:e,value:o}=(0,H.readUInt8)(t,e),o){case 0:return new H.Result(null,e);case 4:return gR(t,e,i.useUTC);case 8:return _R(t,e,i.useUTC);default:throw new Error("Unsupported dataLength "+o+" for DateTimeN")}}case"Time":{let o;return{offset:e,value:o}=(0,H.readUInt8)(t,e),o===0?new H.Result(null,e):eT(t,e,o,n.scale,i.useUTC)}case"Date":{let o;return{offset:e,value:o}=(0,H.readUInt8)(t,e),o===0?new H.Result(null,e):ZG(t,e,i.useUTC)}case"DateTime2":{let o;return{offset:e,value:o}=(0,H.readUInt8)(t,e),o===0?new H.Result(null,e):JG(t,e,o,n.scale,i.useUTC)}case"DateTimeOffset":{let o;return{offset:e,value:o}=(0,H.readUInt8)(t,e),o===0?new H.Result(null,e):eW(t,e,o,n.scale)}case"NumericN":case"DecimalN":{let o;return{offset:e,value:o}=(0,H.readUInt8)(t,e),o===0?new H.Result(null,e):XG(t,e,o,n.precision,n.scale)}case"UniqueIdentifier":{let o;switch({offset:e,value:o}=(0,H.readUInt8)(t,e),o){case 0:return new H.Result(null,e);case 16:return KG(t,e,i);default:throw new Error((0,$G.sprintf)("Unsupported guid size %d",o-1))}}case"Variant":{let o;return{offset:e,value:o}=(0,H.readUInt32LE)(t,e),o===0?new H.Result(null,e):XAe(t,e,i,o)}default:throw new Error("Invalid type!")}}function WG(t){switch(t.type.name){case"VarChar":case"NVarChar":case"VarBinary":return t.dataLength===$Ae;case"Xml":return!0;case"UDT":return!0}}function KG(t,e,n){let i;return{value:i,offset:e}=hi(t,e,16),new H.Result(n.lowerCaseGuids?(0,VG.bufferToLowerCaseGuid)(i):(0,VG.bufferToUpperCaseGuid)(i),e)}function XG(t,e,n,i,r){let o;({offset:e,value:o}=(0,H.readUInt8)(t,e)),o=o===1?1:-1;let s;if(n===5)({offset:e,value:s}=(0,H.readUInt32LE)(t,e));else if(n===9)({offset:e,value:s}=(0,H.readUNumeric64LE)(t,e));else if(n===13)({offset:e,value:s}=(0,H.readUNumeric96LE)(t,e));else if(n===17)({offset:e,value:s}=(0,H.readUNumeric128LE)(t,e));else throw new Error((0,$G.sprintf)("Unsupported numeric dataLength %d",n));return new H.Result(s*o/Math.pow(10,r),e)}function XAe(t,e,n,i){let r;({value:r,offset:e}=(0,H.readUInt8)(t,e));let o=jAe.TYPE[r],s;switch({value:s,offset:e}=(0,H.readUInt8)(t,e),i=i-s-2,o.name){case"UniqueIdentifier":return KG(t,e,n);case"Bit":return fR(t,e);case"TinyInt":return oR(t,e);case"SmallInt":return sR(t,e);case"Int":return aR(t,e);case"BigInt":return cR(t,e);case"SmallDateTime":return gR(t,e,n.useUTC);case"DateTime":return _R(t,e,n.useUTC);case"Real":return uR(t,e);case"Float":return lR(t,e);case"SmallMoney":return dR(t,e);case"Money":return hR(t,e);case"Date":return ZG(t,e,n.useUTC);case"Time":{let a;return{value:a,offset:e}=(0,H.readUInt8)(t,e),eT(t,e,i,a,n.useUTC)}case"DateTime2":{let a;return{value:a,offset:e}=(0,H.readUInt8)(t,e),JG(t,e,i,a,n.useUTC)}case"DateTimeOffset":{let a;return{value:a,offset:e}=(0,H.readUInt8)(t,e),eW(t,e,i,a)}case"VarBinary":case"Binary":return{offset:e}=(0,H.readUInt16LE)(t,e),hi(t,e,i);case"NumericN":case"DecimalN":{let a;({value:a,offset:e}=(0,H.readUInt8)(t,e));let c;return{value:c,offset:e}=(0,H.readUInt8)(t,e),XG(t,e,i,a,c)}case"VarChar":case"Char":{({offset:e}=(0,H.readUInt16LE)(t,e));let a;return{value:a,offset:e}=(0,YG.readCollation)(t,e),pR(t,e,i,a.codepage)}case"NVarChar":case"NChar":return{offset:e}=(0,H.readUInt16LE)(t,e),{offset:e}=(0,YG.readCollation)(t,e),mR(t,e,i);default:throw new Error("Invalid type!")}}function hi(t,e,n){if(t.length<e+n)throw new H.NotEnoughDataError(e+n);return new H.Result(t.slice(e,e+n),e+n)}function pR(t,e,n,i){if(t.length<e+n)throw new H.NotEnoughDataError(e+n);return new H.Result(YAe.default.decode(t.slice(e,e+n),i??KAe),e+n)}function mR(t,e,n){if(t.length<e+n)throw new H.NotEnoughDataError(e+n);return new H.Result(t.toString("ucs2",e,e+n),e+n)}async function QG(t){for(;t.buffer.length<t.position+8;)await t.waitForChunk();let e=t.buffer.readBigUInt64LE(t.position);if(t.position+=8,e===GAe)return null;let n=[],i=0;for(;;){for(;t.buffer.length<t.position+4;)await t.waitForChunk();let r=t.buffer.readUInt32LE(t.position);if(t.position+=4,!r)break;for(;t.buffer.length<t.position+r;)await t.waitForChunk();n.push(t.buffer.slice(t.position,t.position+r)),t.position+=r,i+=r}if(e!==WAe&&i!==Number(e))throw new Error("Partially Length-prefixed Bytes unmatched lengths : expected "+e+", but got "+i+" bytes");return n}function gR(t,e,n){let i;({offset:e,value:i}=(0,H.readUInt16LE)(t,e));let r;({offset:e,value:r}=(0,H.readUInt16LE)(t,e));let o;return n?o=new Date(Date.UTC(1900,0,1+i,0,r)):o=new Date(1900,0,1+i,0,r),new H.Result(o,e)}function _R(t,e,n){let i;({offset:e,value:i}=(0,H.readInt32LE)(t,e));let r;({offset:e,value:r}=(0,H.readInt32LE)(t,e));let o=Math.round(r*zAe),s;return n?s=new Date(Date.UTC(1900,0,1+i,0,0,0,o)):s=new Date(1900,0,1+i,0,0,0,o),new H.Result(s,e)}function eT(t,e,n,i,r){let o;switch(n){case 3:{({value:o,offset:e}=(0,H.readUInt24LE)(t,e));break}case 4:{({value:o,offset:e}=(0,H.readUInt32LE)(t,e));break}case 5:{({value:o,offset:e}=(0,H.readUInt40LE)(t,e));break}default:throw new Error("unreachable")}if(i<7)for(let a=i;a<7;a++)o*=10;let s;return r?s=new Date(Date.UTC(1970,0,1,0,0,0,o/1e4)):s=new Date(1970,0,1,0,0,0,o/1e4),Object.defineProperty(s,"nanosecondsDelta",{enumerable:!1,value:o%1e4/Math.pow(10,7)}),new H.Result(s,e)}function ZG(t,e,n){let i;return{offset:e,value:i}=(0,H.readUInt24LE)(t,e),n?new H.Result(new Date(Date.UTC(2e3,0,i-730118)),e):new H.Result(new Date(2e3,0,i-730118),e)}function JG(t,e,n,i,r){let o;({offset:e,value:o}=eT(t,e,n-3,i,r));let s;({offset:e,value:s}=(0,H.readUInt24LE)(t,e));let a;return r?a=new Date(Date.UTC(2e3,0,s-730118,0,0,0,+o)):a=new Date(2e3,0,s-730118,o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()),Object.defineProperty(a,"nanosecondsDelta",{enumerable:!1,value:o.nanosecondsDelta}),new H.Result(a,e)}function eW(t,e,n,i){let r;({offset:e,value:r}=eT(t,e,n-5,i,!0));let o;({offset:e,value:o}=(0,H.readUInt24LE)(t,e)),{offset:e}=(0,H.readUInt16LE)(t,e);let s=new Date(Date.UTC(2e3,0,o-730118,0,0,0,+r));return Object.defineProperty(s,"nanosecondsDelta",{enumerable:!1,value:r.nanosecondsDelta}),new H.Result(s,e)}tT.exports.readValue=GG;tT.exports.isPLPStream=WG;tT.exports.readPLPStream=QG});var iW=g((rT,rW)=>{"use strict";Object.defineProperty(rT,"__esModule",{value:!0});rT.default=void 0;var QAe=Wt(),ZAe=YE(),yR=nT(),Fh=Gt(),JAe=tW(wo());function tW(t,e){if(typeof WeakMap=="function")var n=new WeakMap,i=new WeakMap;return(tW=function(r,o){if(!o&&r&&r.__esModule)return r;var s,a,c={__proto__:null,default:r};if(r===null||typeof r!="object"&&typeof r!="function")return c;if(s=o?i:n){if(s.has(r))return s.get(r);s.set(r,c)}for(let u in r)u!=="default"&&{}.hasOwnProperty.call(r,u)&&((a=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(r,u))&&(a.get||a.set)?s(c,u,a):c[u]=r[u]);return c})(t,e)}async function nW(t){let e,n,i;for(;;){let o=t.buffer,s=t.position;try{({offset:s,value:n}=(0,Fh.readUInt16LE)(o,s)),{offset:s,value:e}=(0,Fh.readBVarChar)(o,s),{offset:s}=(0,Fh.readUInt8)(o,s),{offset:s,value:i}=(0,ZAe.readMetadata)(o,s,t.options),e.charAt(0)==="@"&&(e=e.slice(1))}catch(a){if(a instanceof Fh.NotEnoughDataError){await t.waitForChunk();continue}throw a}t.position=s;break}let r;for(;;){let o=t.buffer,s=t.position;if((0,yR.isPLPStream)(i)){let a=await(0,yR.readPLPStream)(t);a===null?r=a:i.type.name==="NVarChar"||i.type.name==="Xml"?r=Buffer.concat(a).toString("ucs2"):i.type.name==="VarChar"?r=JAe.decode(Buffer.concat(a),i.collation?.codepage??"utf8"):(i.type.name==="VarBinary"||i.type.name==="UDT")&&(r=Buffer.concat(a))}else{try{({value:r,offset:s}=(0,yR.readValue)(o,s,i,t.options))}catch(a){if(a instanceof Fh.NotEnoughDataError){await t.waitForChunk();continue}throw a}t.position=s}break}return new QAe.ReturnValueToken({paramOrdinal:n,paramName:e,metadata:i,value:r})}var sNe=rT.default=nW;rW.exports=nW});var uW=g((iT,cW)=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});iT.default=void 0;var oW=Wt(),eCe=sW(wo()),ER=nT(),tCe=Gt();function sW(t,e){if(typeof WeakMap=="function")var n=new WeakMap,i=new WeakMap;return(sW=function(r,o){if(!o&&r&&r.__esModule)return r;var s,a,c={__proto__:null,default:r};if(r===null||typeof r!="object"&&typeof r!="function")return c;if(s=o?i:n){if(s.has(r))return s.get(r);s.set(r,c)}for(let u in r)u!=="default"&&{}.hasOwnProperty.call(r,u)&&((a=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(r,u))&&(a.get||a.set)?s(c,u,a):c[u]=r[u]);return c})(t,e)}async function aW(t){let e=[];for(let n of t.colMetadata)for(;;){if((0,ER.isPLPStream)(n)){let i=await(0,ER.readPLPStream)(t);i===null?e.push({value:i,metadata:n}):n.type.name==="NVarChar"||n.type.name==="Xml"?e.push({value:Buffer.concat(i).toString("ucs2"),metadata:n}):n.type.name==="VarChar"?e.push({value:eCe.decode(Buffer.concat(i),n.collation?.codepage??"utf8"),metadata:n}):(n.type.name==="VarBinary"||n.type.name==="UDT")&&e.push({value:Buffer.concat(i),metadata:n})}else{let i;try{i=(0,ER.readValue)(t.buffer,t.position,n,t.options)}catch(r){if(r instanceof tCe.NotEnoughDataError){await t.waitForChunk();continue}throw r}t.position=i.offset,e.push({value:i.value,metadata:n})}break}if(t.options.useColumnNames){let n=Object.create(null);return e.forEach(i=>{let r=i.metadata.colName;n[r]==null&&(n[r]=i)}),new oW.RowToken(n)}else return new oW.RowToken(e)}var aNe=iT.default=aW;cW.exports=aW});var pW=g((oT,fW)=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});oT.default=void 0;var lW=Wt(),nCe=dW(wo()),TR=nT(),rCe=Gt();function dW(t,e){if(typeof WeakMap=="function")var n=new WeakMap,i=new WeakMap;return(dW=function(r,o){if(!o&&r&&r.__esModule)return r;var s,a,c={__proto__:null,default:r};if(r===null||typeof r!="object"&&typeof r!="function")return c;if(s=o?i:n){if(s.has(r))return s.get(r);s.set(r,c)}for(let u in r)u!=="default"&&{}.hasOwnProperty.call(r,u)&&((a=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(r,u))&&(a.get||a.set)?s(c,u,a):c[u]=r[u]);return c})(t,e)}async function hW(t){let e=t.colMetadata,n=[],i=[],r=Math.ceil(e.length/8);for(;t.buffer.length-t.position<r;)await t.waitForChunk();let o=t.buffer.slice(t.position,t.position+r);t.position+=r;for(let s=0,a=o.length;s<a;s++){let c=o[s];i.push(!!(c&1)),i.push(!!(c&2)),i.push(!!(c&4)),i.push(!!(c&8)),i.push(!!(c&16)),i.push(!!(c&32)),i.push(!!(c&64)),i.push(!!(c&128))}for(let s=0;s<e.length;s++){let a=e[s];if(i[s]){n.push({value:null,metadata:a});continue}for(;;){if((0,TR.isPLPStream)(a)){let c=await(0,TR.readPLPStream)(t);c===null?n.push({value:c,metadata:a}):a.type.name==="NVarChar"||a.type.name==="Xml"?n.push({value:Buffer.concat(c).toString("ucs2"),metadata:a}):a.type.name==="VarChar"?n.push({value:nCe.decode(Buffer.concat(c),a.collation?.codepage??"utf8"),metadata:a}):(a.type.name==="VarBinary"||a.type.name==="UDT")&&n.push({value:Buffer.concat(c),metadata:a})}else{let c;try{c=(0,TR.readValue)(t.buffer,t.position,a,t.options)}catch(u){if(u instanceof rCe.NotEnoughDataError){await t.waitForChunk();continue}throw u}t.position=c.offset,n.push({value:c.value,metadata:a})}break}}if(t.options.useColumnNames){let s=Object.create(null);return n.forEach(a=>{let c=a.metadata.colName;s[c]==null&&(s[c]=a)}),new lW.NBCRowToken(s)}else return new lW.NBCRowToken(n)}var cNe=oT.default=hW;fW.exports=hW});var _W=g((sT,gW)=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});sT.default=void 0;var AR=Gt(),iCe=Wt();function oCe(t){let e={};return e.magic=t.slice(0,8).toString("utf8"),e.type=t.readInt32LE(8),e.domainLen=t.readInt16LE(12),e.domainMax=t.readInt16LE(14),e.domainOffset=t.readInt32LE(16),e.flags=t.readInt32LE(20),e.nonce=t.slice(24,32),e.zeroes=t.slice(32,40),e.targetLen=t.readInt16LE(40),e.targetMax=t.readInt16LE(42),e.targetOffset=t.readInt32LE(44),e.oddData=t.slice(48,56),e.domain=t.slice(56,56+e.domainLen).toString("ucs2"),e.target=t.slice(56+e.domainLen,56+e.domainLen+e.targetLen),e}function mW(t,e,n){let i;if({offset:e,value:i}=(0,AR.readUInt16LE)(t,e),t.length<e+i)throw new AR.NotEnoughDataError(e+i);let r=t.slice(e,e+i);return e+=i,new AR.Result(new iCe.SSPIToken(oCe(r),r),e)}var uNe=sT.default=mW;gW.exports=mW});var TW=g((cT,EW)=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});cT.default=void 0;var an=Wt(),sCe=Ur(_G()),CR=yG(),aCe=Ur(CG()),yW=IG(),cCe=Ur(RG()),uCe=Ur(DG()),lCe=Ur(LG()),dCe=Ur(FG()),hCe=Ur(jG()),fCe=Ur(iW()),pCe=Ur(uW()),mCe=Ur(pW()),gCe=Ur(_W()),yr=Gt();function Ur(t){return t&&t.__esModule?t:{default:t}}var aT=class t{debug;colMetadata;options;iterator;buffer;position;static async*parseTokens(e,n,i,r=[]){let o=new t(e,n,i);for(o.colMetadata=r;;){try{await o.waitForChunk()}catch(s){if(o.position===o.buffer.length)return;throw s}for(;o.buffer.length>=o.position+1;){let s=o.buffer.readUInt8(o.position);o.position+=1;let a=o.readToken(s);a!==void 0&&(yield a)}}}readToken(e){switch(e){case an.TYPE.DONE:return this.readDoneToken();case an.TYPE.DONEPROC:return this.readDoneProcToken();case an.TYPE.DONEINPROC:return this.readDoneInProcToken();case an.TYPE.ERROR:return this.readErrorToken();case an.TYPE.INFO:return this.readInfoToken();case an.TYPE.ENVCHANGE:return this.readEnvChangeToken();case an.TYPE.LOGINACK:return this.readLoginAckToken();case an.TYPE.RETURNSTATUS:return this.readReturnStatusToken();case an.TYPE.ORDER:return this.readOrderToken();case an.TYPE.FEDAUTHINFO:return this.readFedAuthInfoToken();case an.TYPE.SSPI:return this.readSSPIToken();case an.TYPE.COLMETADATA:return this.readColMetadataToken();case an.TYPE.RETURNVALUE:return this.readReturnValueToken();case an.TYPE.ROW:return this.readRowToken();case an.TYPE.NBCROW:return this.readNbcRowToken();case an.TYPE.FEATUREEXTACK:return this.readFeatureExtAckToken();default:throw new Error("Unknown type: "+e)}}readFeatureExtAckToken(){let e;try{e=(0,uCe.default)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readFeatureExtAckToken());throw n}return this.position=e.offset,e.value}async readNbcRowToken(){return await(0,mCe.default)(this)}async readReturnValueToken(){return await(0,fCe.default)(this)}async readColMetadataToken(){let e=await(0,sCe.default)(this);return this.colMetadata=e.columns,e}readSSPIToken(){let e;try{e=(0,gCe.default)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readSSPIToken());throw n}return this.position=e.offset,e.value}readFedAuthInfoToken(){let e;try{e=(0,cCe.default)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readFedAuthInfoToken());throw n}return this.position=e.offset,e.value}readOrderToken(){let e;try{e=(0,dCe.default)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readOrderToken());throw n}return this.position=e.offset,e.value}readReturnStatusToken(){let e;try{e=(0,hCe.default)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readReturnStatusToken());throw n}return this.position=e.offset,e.value}readLoginAckToken(){let e;try{e=(0,lCe.default)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readLoginAckToken());throw n}return this.position=e.offset,e.value}readEnvChangeToken(){let e;try{e=(0,aCe.default)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readEnvChangeToken());throw n}return this.position=e.offset,e.value}readRowToken(){return(0,pCe.default)(this)}readInfoToken(){let e;try{e=(0,yW.infoParser)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readInfoToken());throw n}return this.position=e.offset,e.value}readErrorToken(){let e;try{e=(0,yW.errorParser)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readErrorToken());throw n}return this.position=e.offset,e.value}readDoneInProcToken(){let e;try{e=(0,CR.doneInProcParser)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readDoneInProcToken());throw n}return this.position=e.offset,e.value}readDoneProcToken(){let e;try{e=(0,CR.doneProcParser)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readDoneProcToken());throw n}return this.position=e.offset,e.value}readDoneToken(){let e;try{e=(0,CR.doneParser)(this.buffer,this.position,this.options)}catch(n){if(n instanceof yr.NotEnoughDataError)return this.waitForChunk().then(()=>this.readDoneToken());throw n}return this.position=e.offset,e.value}constructor(e,n,i){this.debug=n,this.colMetadata=[],this.options=i,this.iterator=(e[Symbol.asyncIterator]||e[Symbol.iterator]).call(e),this.buffer=Buffer.alloc(0),this.position=0}async waitForChunk(){let e=await this.iterator.next();if(e.done)throw new Error("unexpected end of data");this.position===this.buffer.length?this.buffer=e.value:this.buffer=Buffer.concat([this.buffer.slice(this.position),e.value]),this.position=0}},lNe=cT.default=aT;EW.exports=aT});var AW=g(uT=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});uT.Parser=void 0;var _Ce=x("events"),yCe=TCe(TW()),ECe=x("stream");function TCe(t){return t&&t.__esModule?t:{default:t}}var SR=class extends _Ce.EventEmitter{constructor(e,n,i,r){super(),this.debug=n,this.options=r,this.parser=ECe.Readable.from(yCe.default.parseTokens(e,this.debug,this.options)),this.parser.on("data",o=>{n.token(o),i[o.handlerName](o)}),this.parser.on("drain",()=>{this.emit("drain")}),this.parser.on("end",()=>{this.emit("end")})}pause(){return this.parser.pause()}resume(){return this.parser.resume()}};uT.Parser=SR});var IR=g(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.Transaction=xr.OPERATION_TYPE=xr.ISOLATION_LEVEL=void 0;xr.assertValidIsolationLevel=CCe;xr.isolationLevelByValue=void 0;var lT=ACe(wn()),dT=W_();function ACe(t){return t&&t.__esModule?t:{default:t}}var hT=xr.OPERATION_TYPE={TM_GET_DTC_ADDRESS:0,TM_PROPAGATE_XACT:1,TM_BEGIN_XACT:5,TM_PROMOTE_XACT:6,TM_COMMIT_XACT:7,TM_ROLLBACK_XACT:8,TM_SAVE_XACT:9},Co=xr.ISOLATION_LEVEL={NO_CHANGE:0,READ_UNCOMMITTED:1,READ_COMMITTED:2,REPEATABLE_READ:3,SERIALIZABLE:4,SNAPSHOT:5},CW=xr.isolationLevelByValue={};for(let t in Co){let e=Co[t];CW[e]=t}function CCe(t,e){if(typeof t!="number")throw new TypeError(`The "${e}" ${e.includes(".")?"property":"argument"} must be of type number. Received type ${typeof t} (${t})`);if(!Number.isInteger(t))throw new RangeError(`The value of "${e}" is out of range. It must be an integer. Received: ${t}`);if(!(t>=0&&t<=5))throw new RangeError(`The value of "${e}" is out of range. It must be >= 0 && <= 5. Received: ${t}`)}var wR=class{constructor(e,n=Co.NO_CHANGE){this.name=e,this.isolationLevel=n,this.outstandingRequestCount=1}beginPayload(e){let n=new lT.default(100,"ucs2");return(0,dT.writeToTrackingBuffer)(n,e,this.outstandingRequestCount),n.writeUShort(hT.TM_BEGIN_XACT),n.writeUInt8(this.isolationLevel),n.writeUInt8(this.name.length*2),n.writeString(this.name,"ucs2"),{*[Symbol.iterator](){yield n.data},toString:()=>"Begin Transaction: name="+this.name+", isolationLevel="+CW[this.isolationLevel]}}commitPayload(e){let n=new lT.default(100,"ascii");return(0,dT.writeToTrackingBuffer)(n,e,this.outstandingRequestCount),n.writeUShort(hT.TM_COMMIT_XACT),n.writeUInt8(this.name.length*2),n.writeString(this.name,"ucs2"),n.writeUInt8(0),{*[Symbol.iterator](){yield n.data},toString:()=>"Commit Transaction: name="+this.name}}rollbackPayload(e){let n=new lT.default(100,"ascii");return(0,dT.writeToTrackingBuffer)(n,e,this.outstandingRequestCount),n.writeUShort(hT.TM_ROLLBACK_XACT),n.writeUInt8(this.name.length*2),n.writeString(this.name,"ucs2"),n.writeUInt8(0),{*[Symbol.iterator](){yield n.data},toString:()=>"Rollback Transaction: name="+this.name}}savePayload(e){let n=new lT.default(100,"ascii");return(0,dT.writeToTrackingBuffer)(n,e,this.outstandingRequestCount),n.writeUShort(hT.TM_SAVE_XACT),n.writeUInt8(this.name.length*2),n.writeString(this.name,"ucs2"),{*[Symbol.iterator](){yield n.data},toString:()=>"Save Transaction: name="+this.name}}isolationLevelToTSQL(){switch(this.isolationLevel){case Co.READ_UNCOMMITTED:return"READ UNCOMMITTED";case Co.READ_COMMITTED:return"READ COMMITTED";case Co.REPEATABLE_READ:return"REPEATABLE READ";case Co.SERIALIZABLE:return"SERIALIZABLE";case Co.SNAPSHOT:return"SNAPSHOT"}return""}};xr.Transaction=wR});var wW=g(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.connectInParallel=wCe;qh.connectInSequence=ICe;qh.lookupAllAddresses=vR;var fT=SW(x("net")),SCe=SW(x("url"));function SW(t){return t&&t.__esModule?t:{default:t}}async function wCe(t,e,n){n.throwIfAborted();let i=await vR(t.host,e,n);return await new Promise((r,o)=>{let s=new Array(i.length),a=[];function c(d){a.push(d),this.removeListener("error",c),this.removeListener("connect",u),this.destroy(),a.length===i.length&&(n.removeEventListener("abort",l),o(new AggregateError(a,"Could not connect (parallel)")))}function u(){n.removeEventListener("abort",l);for(let d=0;d<s.length;d++){let f=s[d];this!==f&&(f.removeListener("error",c),f.removeListener("connect",u),f.destroy())}r(this)}let l=()=>{for(let d=0;d<s.length;d++){let f=s[d];f.removeListener("error",c),f.removeListener("connect",u),f.destroy()}o(n.reason)};for(let d=0,f=i.length;d<f;d++){let m=s[d]=fT.default.connect({...t,host:i[d].address,family:i[d].family});m.on("error",c),m.on("connect",u)}n.addEventListener("abort",l,{once:!0})})}async function ICe(t,e,n){n.throwIfAborted();let i=[],r=await vR(t.host,e,n);for(let o of r)try{return await new Promise((s,a)=>{let c=fT.default.connect({...t,host:o.address,family:o.family}),u=()=>{c.removeListener("error",l),c.removeListener("connect",d),c.destroy(),a(n.reason)},l=f=>{n.removeEventListener("abort",u),c.removeListener("error",l),c.removeListener("connect",d),c.destroy(),a(f)},d=()=>{n.removeEventListener("abort",u),c.removeListener("error",l),c.removeListener("connect",d),s(c)};n.addEventListener("abort",u,{once:!0}),c.on("error",l),c.on("connect",d)})}catch(s){n.throwIfAborted(),i.push(s);continue}throw new AggregateError(i,"Could not connect (sequence)")}async function vR(t,e,n){return n.throwIfAborted(),fT.default.isIPv6(t)?[{address:t,family:6}]:fT.default.isIPv4(t)?[{address:t,family:4}]:await new Promise((i,r)=>{let o=()=>{r(n.reason)};n.addEventListener("abort",o);let s=SCe.default.domainToASCII(t);e(s===""?t:s,{all:!0},(a,c)=>{n.removeEventListener("abort",o),a?r(a):i(c)})})}});var bR=g(pT=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0});pT.name=void 0;var pNe=pT.name="Tedious"});var IW=g(OR=>{"use strict";Object.defineProperty(OR,"__esModule",{value:!0});OR.createNTLMRequest=vCe;var Er={NTLM_NegotiateUnicode:1,NTLM_NegotiateOEM:2,NTLM_RequestTarget:4,NTLM_Unknown9:8,NTLM_NegotiateSign:16,NTLM_NegotiateSeal:32,NTLM_NegotiateDatagram:64,NTLM_NegotiateLanManagerKey:128,NTLM_Unknown8:256,NTLM_NegotiateNTLM:512,NTLM_NegotiateNTOnly:1024,NTLM_Anonymous:2048,NTLM_NegotiateOemDomainSupplied:4096,NTLM_NegotiateOemWorkstationSupplied:8192,NTLM_Unknown6:16384,NTLM_NegotiateAlwaysSign:32768,NTLM_TargetTypeDomain:65536,NTLM_TargetTypeServer:131072,NTLM_TargetTypeShare:262144,NTLM_NegotiateExtendedSecurity:524288,NTLM_NegotiateIdentify:1048576,NTLM_Unknown5:2097152,NTLM_RequestNonNTSessionKey:4194304,NTLM_NegotiateTargetInfo:8388608,NTLM_Unknown4:16777216,NTLM_NegotiateVersion:33554432,NTLM_Unknown3:67108864,NTLM_Unknown2:134217728,NTLM_Unknown1:268435456,NTLM_Negotiate128:536870912,NTLM_NegotiateKeyExchange:1073741824,NTLM_Negotiate56:2147483648};function vCe(t){let e=escape(t.domain.toUpperCase()),n=t.workstation?escape(t.workstation.toUpperCase()):"",i=Er.NTLM_NegotiateUnicode+Er.NTLM_NegotiateOEM+Er.NTLM_RequestTarget+Er.NTLM_NegotiateNTLM+Er.NTLM_NegotiateOemDomainSupplied+Er.NTLM_NegotiateOemWorkstationSupplied+Er.NTLM_NegotiateAlwaysSign+Er.NTLM_NegotiateVersion+Er.NTLM_NegotiateExtendedSecurity+Er.NTLM_Negotiate128+Er.NTLM_Negotiate56;n===""&&(i-=Er.NTLM_NegotiateOemWorkstationSupplied);let r=Buffer.alloc(40),o=[r],s=0;return s+=r.write("NTLMSSP",s,7,"ascii"),s=r.writeUInt8(0,s),s=r.writeUInt32LE(1,s),s=r.writeUInt32LE(i,s),s=r.writeUInt16LE(e.length,s),s=r.writeUInt16LE(e.length,s),s=r.writeUInt32LE(r.length+n.length,s),s=r.writeUInt16LE(n.length,s),s=r.writeUInt16LE(n.length,s),s=r.writeUInt32LE(r.length,s),s=r.writeUInt8(5,s),s=r.writeUInt8(0,s),s=r.writeUInt16LE(2195,s),s=r.writeUInt8(0,s),s=r.writeUInt8(0,s),s=r.writeUInt8(0,s),r.writeUInt8(15,s),o.push(Buffer.from(n,"ascii")),o.push(Buffer.from(e,"ascii")),Buffer.concat(o)}});var vW=g(mT=>{"use strict";Object.defineProperty(mT,"__esModule",{value:!0});mT.BulkLoadPayload=void 0;var RR=class{constructor(e){this.bulkLoad=e,this.iterator=this.bulkLoad.rowToPacketTransform[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterator}toString(e=""){return e+"BulkLoad"}};mT.BulkLoadPayload=RR});var RW=g((gT,OW)=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});gT.default=void 0;var bW={Sp_Cursor:1,Sp_CursorOpen:2,Sp_CursorPrepare:3,Sp_CursorExecute:4,Sp_CursorPrepExec:5,Sp_CursorUnprepare:6,Sp_CursorFetch:7,Sp_CursorOption:8,Sp_CursorClose:9,Sp_ExecuteSql:10,Sp_Prepare:11,Sp_Execute:12,Sp_PrepExec:13,Sp_PrepExecRpc:14,Sp_Unprepare:15},yNe=gT.default=bW;OW.exports=bW});var NW=g((ENe,bCe)=>{bCe.exports={author:"Mike D Pilsbury <mike.pilsbury@gmail.com>",contributors:["Alex Robson","Arthur Schreiber","Bret Copeland <bret@atlantisflight.org> (https://github.com/bretcope)","Bryan Ross <bryan@rossipedia.com> (https://github.com/rossipedia)","Ciaran Jessup <ciaranj@gmail.com>","Cort Fritz <cfritz@caa.com>","lastonesky","Patrik Simek <patrik@patriksimek.cz>","Phil Dodderidge <pdodde@poyntz.com>","Zach Aller"],name:"tedious",description:"A TDS driver, for connecting to MS SQLServer databases.",keywords:["sql","database","mssql","sqlserver","sql-server","tds","msnodesql","azure"],homepage:"https://github.com/tediousjs/tedious",bugs:"https://github.com/tediousjs/tedious/issues",license:"MIT",version:"19.2.0",main:"./lib/tedious.js",types:"./lib/tedious.d.ts",repository:{type:"git",url:"https://github.com/tediousjs/tedious.git"},engines:{node:">=18.17"},publishConfig:{tag:"next",provenance:!0},dependencies:{"@azure/core-auth":"^1.7.2","@azure/identity":"^4.2.1","@azure/keyvault-keys":"^4.4.0","@js-joda/core":"^5.6.5","@types/node":">=18",bl:"^6.1.4","iconv-lite":"^0.7.0","js-md4":"^0.3.2","native-duplexpair":"^1.0.0","sprintf-js":"^1.1.3"},devDependencies:{"@babel/cli":"^7.28.3","@babel/core":"^7.28.5","@babel/node":"^7.28.0","@babel/preset-env":"^7.28.5","@babel/preset-typescript":"^7.28.5","@babel/register":"^7.28.3","@stylistic/eslint-plugin":"^5.5.0","@types/async":"^3.2.25","@types/chai":"^4.3.20","@types/depd":"^1.1.37","@types/lru-cache":"^5.1.1","@types/mitm":"^1.3.8","@types/mocha":"^10.0.10","@types/sinon":"^21.0.0","@types/sprintf-js":"^1.1.4","@typescript-eslint/eslint-plugin":"^8.46.3","@typescript-eslint/parser":"^8.46.3",async:"^3.2.6","babel-plugin-istanbul":"^7.0.1",chai:"^4.5.0",codecov:"^3.8.3",eslint:"^9.39.1",mitm:"^1.7.3",mocha:"^11.7.5",nyc:"^17.1.0",rimraf:"^5.0.10","semantic-release":"^22.0.12",sinon:"^21.0.0",typedoc:"^0.28.14",typescript:"^5.9.3"},scripts:{docs:"typedoc",lint:"eslint src test --ext .js,.ts && tsc",test:"mocha --forbid-only test/unit test/unit/token test/unit/tracking-buffer","test-integration":"mocha --forbid-only test/integration/","test-all":"mocha --forbid-only test/unit/ test/unit/token/ test/unit/tracking-buffer test/integration/","build:types":"tsc --project tsconfig.build-types.json",build:"rimraf lib && babel src --out-dir lib --extensions .js,.ts && npm run build:types",prepublish:"npm run build","semantic-release":"semantic-release"},babel:{sourceMaps:"both",ignore:["./src/**/*.d.ts"],presets:[["@babel/preset-env",{targets:{node:18}}],["@babel/preset-typescript",{allowDeclareFields:!0}]],plugins:[["@babel/transform-typescript",{allowDeclareFields:!0}]]},mocha:{require:"test/setup.js",timeout:1e4,extension:["js","ts"]},nyc:{sourceMap:!1,instrument:!1,extension:[".ts"]}}});var PW=g(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.UnexpectedTokenError=Dn.TokenHandler=Dn.RequestTokenHandler=Dn.Login7TokenHandler=Dn.InitialSqlTokenHandler=Dn.AttentionTokenHandler=void 0;var OCe=RCe(G_()),fi=ho();function RCe(t){return t&&t.__esModule?t:{default:t}}var $e=class extends Error{constructor(e,n){super("Unexpected token `"+n.name+"` in `"+e.constructor.name+"`")}};Dn.UnexpectedTokenError=$e;var gs=class{onInfoMessage(e){throw new $e(this,e)}onErrorMessage(e){throw new $e(this,e)}onSSPI(e){throw new $e(this,e)}onDatabaseChange(e){throw new $e(this,e)}onLanguageChange(e){throw new $e(this,e)}onCharsetChange(e){throw new $e(this,e)}onSqlCollationChange(e){throw new $e(this,e)}onRoutingChange(e){throw new $e(this,e)}onPacketSizeChange(e){throw new $e(this,e)}onResetConnection(e){throw new $e(this,e)}onBeginTransaction(e){throw new $e(this,e)}onCommitTransaction(e){throw new $e(this,e)}onRollbackTransaction(e){throw new $e(this,e)}onFedAuthInfo(e){throw new $e(this,e)}onFeatureExtAck(e){throw new $e(this,e)}onLoginAck(e){throw new $e(this,e)}onColMetadata(e){throw new $e(this,e)}onOrder(e){throw new $e(this,e)}onRow(e){throw new $e(this,e)}onReturnStatus(e){throw new $e(this,e)}onReturnValue(e){throw new $e(this,e)}onDoneProc(e){throw new $e(this,e)}onDoneInProc(e){throw new $e(this,e)}onDone(e){throw new $e(this,e)}onDatabaseMirroringPartner(e){throw new $e(this,e)}};Dn.TokenHandler=gs;var NR=class extends gs{constructor(e){super(),this.connection=e}onInfoMessage(e){this.connection.emit("infoMessage",e)}onErrorMessage(e){this.connection.emit("errorMessage",e)}onDatabaseChange(e){this.connection.emit("databaseChange",e.newValue)}onLanguageChange(e){this.connection.emit("languageChange",e.newValue)}onCharsetChange(e){this.connection.emit("charsetChange",e.newValue)}onSqlCollationChange(e){this.connection.databaseCollation=e.newValue}onPacketSizeChange(e){this.connection.messageIo.packetSize(e.newValue)}onBeginTransaction(e){this.connection.transactionDescriptors.push(e.newValue),this.connection.inTransaction=!0}onCommitTransaction(e){this.connection.transactionDescriptors.length=1,this.connection.inTransaction=!1}onRollbackTransaction(e){this.connection.transactionDescriptors.length=1,this.connection.inTransaction=!1,this.connection.emit("rollbackTransaction")}onColMetadata(e){this.connection.emit("error",new Error("Received 'columnMetadata' when no sqlRequest is in progress")),this.connection.close()}onOrder(e){this.connection.emit("error",new Error("Received 'order' when no sqlRequest is in progress")),this.connection.close()}onRow(e){this.connection.emit("error",new Error("Received 'row' when no sqlRequest is in progress")),this.connection.close()}onReturnStatus(e){}onReturnValue(e){}onDoneProc(e){}onDoneInProc(e){}onDone(e){}onResetConnection(e){this.connection.emit("resetConnection")}};Dn.InitialSqlTokenHandler=NR;var PR=class extends gs{constructor(e){super(),this.loginAckReceived=!1,this.connection=e}onInfoMessage(e){this.connection.emit("infoMessage",e)}onErrorMessage(e){this.connection.emit("errorMessage",e);let n=new fi.ConnectionError(e.message,"ELOGIN");this.connection.transientErrorLookup.isTransientError(e.number)&&this.connection.curTransientRetryCount!==this.connection.config.options.maxRetriesOnTransientErrors&&(n.isTransient=!0),this.connection.loginError=n}onSSPI(e){e.ntlmpacket&&(this.connection.ntlmpacket=e.ntlmpacket,this.connection.ntlmpacketBuffer=e.ntlmpacketBuffer)}onDatabaseChange(e){this.connection.emit("databaseChange",e.newValue)}onDatabaseMirroringPartner(e){this.connection.emit("databaseMirroringPartner",e.newValue)}onLanguageChange(e){this.connection.emit("languageChange",e.newValue)}onCharsetChange(e){this.connection.emit("charsetChange",e.newValue)}onSqlCollationChange(e){this.connection.databaseCollation=e.newValue}onFedAuthInfo(e){this.fedAuthInfoToken=e}onFeatureExtAck(e){let{authentication:n}=this.connection.config;n.type==="azure-active-directory-password"||n.type==="azure-active-directory-access-token"||n.type==="azure-active-directory-msi-vm"||n.type==="azure-active-directory-msi-app-service"||n.type==="azure-active-directory-service-principal-secret"||n.type==="azure-active-directory-default"?e.fedAuth===void 0?this.connection.loginError=new fi.ConnectionError("Did not receive Active Directory authentication acknowledgement"):e.fedAuth.length!==0&&(this.connection.loginError=new fi.ConnectionError(`Active Directory authentication acknowledgment for ${n.type} authentication method includes extra data`)):e.fedAuth===void 0&&e.utf8Support===void 0?this.connection.loginError=new fi.ConnectionError("Received acknowledgement for unknown feature"):e.fedAuth&&(this.connection.loginError=new fi.ConnectionError("Did not request Active Directory authentication, but received the acknowledgment"))}onLoginAck(e){if(!e.tdsVersion){this.connection.loginError=new fi.ConnectionError("Server responded with unknown TDS version.","ETDS");return}if(!e.interface){this.connection.loginError=new fi.ConnectionError("Server responded with unsupported interface.","EINTERFACENOTSUPP");return}this.connection.config.options.tdsVersion=e.tdsVersion,this.loginAckReceived=!0}onRoutingChange(e){let[n,i]=e.newValue.server.split("\\");this.routingData={server:n,port:e.newValue.port,instance:i}}onDoneInProc(e){}onDone(e){}onPacketSizeChange(e){this.connection.messageIo.packetSize(e.newValue)}};Dn.Login7TokenHandler=PR;var DR=class extends gs{constructor(e,n){super(),this.connection=e,this.request=n,this.errors=[]}onInfoMessage(e){this.connection.emit("infoMessage",e)}onErrorMessage(e){if(this.connection.emit("errorMessage",e),!this.request.canceled){let n=new fi.RequestError(e.message,"EREQUEST");n.number=e.number,n.state=e.state,n.class=e.class,n.serverName=e.serverName,n.procName=e.procName,n.lineNumber=e.lineNumber,this.errors.push(n),this.request.error=n,this.request instanceof OCe.default&&this.errors.length>1&&(this.request.error=new AggregateError(this.errors))}}onDatabaseChange(e){this.connection.emit("databaseChange",e.newValue)}onLanguageChange(e){this.connection.emit("languageChange",e.newValue)}onCharsetChange(e){this.connection.emit("charsetChange",e.newValue)}onSqlCollationChange(e){this.connection.databaseCollation=e.newValue}onPacketSizeChange(e){this.connection.messageIo.packetSize(e.newValue)}onBeginTransaction(e){this.connection.transactionDescriptors.push(e.newValue),this.connection.inTransaction=!0}onCommitTransaction(e){this.connection.transactionDescriptors.length=1,this.connection.inTransaction=!1}onRollbackTransaction(e){this.connection.transactionDescriptors.length=1,this.connection.inTransaction=!1,this.connection.emit("rollbackTransaction")}onColMetadata(e){if(!this.request.canceled)if(this.connection.config.options.useColumnNames){let n=Object.create(null);for(let i=0,r=e.columns.length;i<r;i++){let o=e.columns[i];n[o.colName]==null&&(n[o.colName]=o)}this.request.emit("columnMetadata",n)}else this.request.emit("columnMetadata",e.columns)}onOrder(e){this.request.canceled||this.request.emit("order",e.orderColumns)}onRow(e){this.request.canceled||(this.connection.config.options.rowCollectionOnRequestCompletion&&this.request.rows.push(e.columns),this.connection.config.options.rowCollectionOnDone&&this.request.rst.push(e.columns),this.request.emit("row",e.columns))}onReturnStatus(e){this.request.canceled||(this.connection.procReturnStatusValue=e.value)}onReturnValue(e){this.request.canceled||this.request.emit("returnValue",e.paramName,e.value,e.metadata)}onDoneProc(e){this.request.canceled||(e.sqlError&&!this.request.error&&(this.request.error=new fi.RequestError("An unknown error has occurred.","UNKNOWN")),this.request.emit("doneProc",e.rowCount,e.more,this.connection.procReturnStatusValue,this.request.rst),this.connection.procReturnStatusValue=void 0,e.rowCount!==void 0&&(this.request.rowCount+=e.rowCount),this.connection.config.options.rowCollectionOnDone&&(this.request.rst=[]))}onDoneInProc(e){this.request.canceled||(this.request.emit("doneInProc",e.rowCount,e.more,this.request.rst),e.rowCount!==void 0&&(this.request.rowCount+=e.rowCount),this.connection.config.options.rowCollectionOnDone&&(this.request.rst=[]))}onDone(e){this.request.canceled||(e.sqlError&&!this.request.error&&(this.request.error=new fi.RequestError("An unknown error has occurred.","UNKNOWN")),this.request.emit("done",e.rowCount,e.more,this.request.rst),e.rowCount!==void 0&&(this.request.rowCount+=e.rowCount),this.connection.config.options.rowCollectionOnDone&&(this.request.rst=[]))}onResetConnection(e){this.connection.emit("resetConnection")}};Dn.RequestTokenHandler=DR;var MR=class extends gs{constructor(e,n){super(),this.connection=e,this.request=n,this.attentionReceived=!1}onDone(e){e.attention&&(this.attentionReceived=!0)}};Dn.AttentionTokenHandler=MR});var FW=g((ET,xW)=>{"use strict";Object.defineProperty(ET,"__esModule",{value:!0});ET.default=void 0;var NCe=Cn(x("crypto")),PCe=Cn(x("os")),DW=LR(x("tls")),DCe=LR(x("net")),MCe=Cn(x("dns")),kCe=Cn(x("constants")),kR=x("stream"),_T=CB(),LCe=NB(),UCe=Cn(QT()),xCe=Cn(MB()),Jc=x("events"),FCe=FB(),qCe=qB(),Ut=th(),MW=Cn($B()),HCe=Cn(WB()),BCe=Cn(JB()),Mn=Cn(G_()),Hh=Cn(ij()),kW=Cn(sj()),jCe=Cn(RV()),YCe=AW(),Gn=IR(),gt=ho(),LW=wW(),VCe=bR(),$Ce=nh(),UW=Cn(ry()),zCe=IW(),_s=kh(),GCe=vW(),yT=Cn(RW()),WCe=NW(),KCe=x("url"),eu=PW();function LR(t,e){if(typeof WeakMap=="function")var n=new WeakMap,i=new WeakMap;return(LR=function(r,o){if(!o&&r&&r.__esModule)return r;var s,a,c={__proto__:null,default:r};if(r===null||typeof r!="object"&&typeof r!="function")return c;if(s=o?i:n){if(s.has(r))return s.get(r);s.set(r,c)}for(let u in r)u!=="default"&&{}.hasOwnProperty.call(r,u)&&((a=(s=Object.defineProperty)&&Object.getOwnPropertyDescriptor(r,u))&&(a.get||a.set)?s(c,u,a):c[u]=r[u]);return c})(t,e)}function Cn(t){return t&&t.__esModule?t:{default:t}}var XCe=30*1e3,QCe=15*1e3,ZCe=15*1e3,JCe=5*1e3,eSe=500,tSe=4*1024,nSe=2147483647,rSe=7,iSe=1433,oSe="7_4",sSe="us_english",aSe="mdy";function So(){let t,e;return{promise:new Promise((i,r)=>{t=i,e=r}),resolve:t,reject:e}}var Bh=class extends Jc.EventEmitter{constructor(e){if(super(),typeof e!="object"||e===null)throw new TypeError('The "config" argument is required and must be of type Object.');if(typeof e.server!="string")throw new TypeError('The "config.server" property is required and must be of type string.');this.fedAuthRequired=!1;let n;if(e.authentication!==void 0){if(typeof e.authentication!="object"||e.authentication===null)throw new TypeError('The "config.authentication" property must be of type Object.');let i=e.authentication.type,r=e.authentication.options===void 0?{}:e.authentication.options;if(typeof i!="string")throw new TypeError('The "config.authentication.type" property must be of type string.');if(i!=="default"&&i!=="ntlm"&&i!=="token-credential"&&i!=="azure-active-directory-password"&&i!=="azure-active-directory-access-token"&&i!=="azure-active-directory-msi-vm"&&i!=="azure-active-directory-msi-app-service"&&i!=="azure-active-directory-service-principal-secret"&&i!=="azure-active-directory-default")throw new TypeError('The "type" property must one of "default", "ntlm", "token-credential", "azure-active-directory-password", "azure-active-directory-access-token", "azure-active-directory-default", "azure-active-directory-msi-vm" or "azure-active-directory-msi-app-service" or "azure-active-directory-service-principal-secret".');if(typeof r!="object"||r===null)throw new TypeError('The "config.authentication.options" property must be of type object.');if(i==="ntlm"){if(typeof r.domain!="string")throw new TypeError('The "config.authentication.options.domain" property must be of type string.');if(r.userName!==void 0&&typeof r.userName!="string")throw new TypeError('The "config.authentication.options.userName" property must be of type string.');if(r.password!==void 0&&typeof r.password!="string")throw new TypeError('The "config.authentication.options.password" property must be of type string.');n={type:"ntlm",options:{userName:r.userName,password:r.password,domain:r.domain&&r.domain.toUpperCase()}}}else if(i==="token-credential"){if(!(0,LCe.isTokenCredential)(r.credential))throw new TypeError('The "config.authentication.options.credential" property must be an instance of the token credential class.');n={type:"token-credential",options:{credential:r.credential}}}else if(i==="azure-active-directory-password"){if(typeof r.clientId!="string")throw new TypeError('The "config.authentication.options.clientId" property must be of type string.');if(r.userName!==void 0&&typeof r.userName!="string")throw new TypeError('The "config.authentication.options.userName" property must be of type string.');if(r.password!==void 0&&typeof r.password!="string")throw new TypeError('The "config.authentication.options.password" property must be of type string.');if(r.tenantId!==void 0&&typeof r.tenantId!="string")throw new TypeError('The "config.authentication.options.tenantId" property must be of type string.');n={type:"azure-active-directory-password",options:{userName:r.userName,password:r.password,tenantId:r.tenantId,clientId:r.clientId}}}else if(i==="azure-active-directory-access-token"){if(typeof r.token!="string")throw new TypeError('The "config.authentication.options.token" property must be of type string.');n={type:"azure-active-directory-access-token",options:{token:r.token}}}else if(i==="azure-active-directory-msi-vm"){if(r.clientId!==void 0&&typeof r.clientId!="string")throw new TypeError('The "config.authentication.options.clientId" property must be of type string.');n={type:"azure-active-directory-msi-vm",options:{clientId:r.clientId}}}else if(i==="azure-active-directory-default"){if(r.clientId!==void 0&&typeof r.clientId!="string")throw new TypeError('The "config.authentication.options.clientId" property must be of type string.');n={type:"azure-active-directory-default",options:{clientId:r.clientId}}}else if(i==="azure-active-directory-msi-app-service"){if(r.clientId!==void 0&&typeof r.clientId!="string")throw new TypeError('The "config.authentication.options.clientId" property must be of type string.');n={type:"azure-active-directory-msi-app-service",options:{clientId:r.clientId}}}else if(i==="azure-active-directory-service-principal-secret"){if(typeof r.clientId!="string")throw new TypeError('The "config.authentication.options.clientId" property must be of type string.');if(typeof r.clientSecret!="string")throw new TypeError('The "config.authentication.options.clientSecret" property must be of type string.');if(typeof r.tenantId!="string")throw new TypeError('The "config.authentication.options.tenantId" property must be of type string.');n={type:"azure-active-directory-service-principal-secret",options:{clientId:r.clientId,clientSecret:r.clientSecret,tenantId:r.tenantId}}}else{if(r.userName!==void 0&&typeof r.userName!="string")throw new TypeError('The "config.authentication.options.userName" property must be of type string.');if(r.password!==void 0&&typeof r.password!="string")throw new TypeError('The "config.authentication.options.password" property must be of type string.');n={type:"default",options:{userName:r.userName,password:r.password}}}}else n={type:"default",options:{userName:void 0,password:void 0}};if(this.config={server:e.server,authentication:n,options:{abortTransactionOnError:!1,appName:void 0,camelCaseColumns:!1,cancelTimeout:JCe,columnEncryptionKeyCacheTTL:7200*1e3,columnEncryptionSetting:!1,columnNameReplacer:void 0,connectionRetryInterval:eSe,connectTimeout:QCe,connector:void 0,connectionIsolationLevel:Gn.ISOLATION_LEVEL.READ_COMMITTED,cryptoCredentialsDetails:{},database:void 0,datefirst:rSe,dateFormat:aSe,debug:{data:!1,packet:!1,payload:!1,token:!1},enableAnsiNull:!0,enableAnsiNullDefault:!0,enableAnsiPadding:!0,enableAnsiWarnings:!0,enableArithAbort:!0,enableConcatNullYieldsNull:!0,enableCursorCloseOnCommit:null,enableImplicitTransactions:!1,enableNumericRoundabort:!1,enableQuotedIdentifier:!0,encrypt:!0,fallbackToDefaultDb:!1,encryptionKeyStoreProviders:void 0,instanceName:void 0,isolationLevel:Gn.ISOLATION_LEVEL.READ_COMMITTED,language:sSe,localAddress:void 0,maxRetriesOnTransientErrors:3,multiSubnetFailover:!1,packetSize:tSe,port:iSe,readOnlyIntent:!1,requestTimeout:ZCe,rowCollectionOnDone:!1,rowCollectionOnRequestCompletion:!1,serverName:void 0,serverSupportsColumnEncryption:!1,tdsVersion:oSe,textsize:nSe,trustedServerNameAE:void 0,trustServerCertificate:!1,useColumnNames:!1,useUTC:!0,workstationId:void 0,lowerCaseGuids:!1}},e.options){if(e.options.port&&e.options.instanceName)throw new Error("Port and instanceName are mutually exclusive, but "+e.options.port+" and "+e.options.instanceName+" provided");if(e.options.abortTransactionOnError!==void 0){if(typeof e.options.abortTransactionOnError!="boolean"&&e.options.abortTransactionOnError!==null)throw new TypeError('The "config.options.abortTransactionOnError" property must be of type string or null.');this.config.options.abortTransactionOnError=e.options.abortTransactionOnError}if(e.options.appName!==void 0){if(typeof e.options.appName!="string")throw new TypeError('The "config.options.appName" property must be of type string.');this.config.options.appName=e.options.appName}if(e.options.camelCaseColumns!==void 0){if(typeof e.options.camelCaseColumns!="boolean")throw new TypeError('The "config.options.camelCaseColumns" property must be of type boolean.');this.config.options.camelCaseColumns=e.options.camelCaseColumns}if(e.options.cancelTimeout!==void 0){if(typeof e.options.cancelTimeout!="number")throw new TypeError('The "config.options.cancelTimeout" property must be of type number.');this.config.options.cancelTimeout=e.options.cancelTimeout}if(e.options.columnNameReplacer){if(typeof e.options.columnNameReplacer!="function")throw new TypeError('The "config.options.cancelTimeout" property must be of type function.');this.config.options.columnNameReplacer=e.options.columnNameReplacer}if(e.options.connectionIsolationLevel!==void 0&&((0,Gn.assertValidIsolationLevel)(e.options.connectionIsolationLevel,"config.options.connectionIsolationLevel"),this.config.options.connectionIsolationLevel=e.options.connectionIsolationLevel),e.options.connectTimeout!==void 0){if(typeof e.options.connectTimeout!="number")throw new TypeError('The "config.options.connectTimeout" property must be of type number.');this.config.options.connectTimeout=e.options.connectTimeout}if(e.options.connector!==void 0){if(typeof e.options.connector!="function")throw new TypeError('The "config.options.connector" property must be a function.');this.config.options.connector=e.options.connector}if(e.options.cryptoCredentialsDetails!==void 0){if(typeof e.options.cryptoCredentialsDetails!="object"||e.options.cryptoCredentialsDetails===null)throw new TypeError('The "config.options.cryptoCredentialsDetails" property must be of type Object.');this.config.options.cryptoCredentialsDetails=e.options.cryptoCredentialsDetails}if(e.options.database!==void 0){if(typeof e.options.database!="string")throw new TypeError('The "config.options.database" property must be of type string.');this.config.options.database=e.options.database}if(e.options.datefirst!==void 0){if(typeof e.options.datefirst!="number"&&e.options.datefirst!==null)throw new TypeError('The "config.options.datefirst" property must be of type number.');if(e.options.datefirst!==null&&(e.options.datefirst<1||e.options.datefirst>7))throw new RangeError('The "config.options.datefirst" property must be >= 1 and <= 7');this.config.options.datefirst=e.options.datefirst}if(e.options.dateFormat!==void 0){if(typeof e.options.dateFormat!="string"&&e.options.dateFormat!==null)throw new TypeError('The "config.options.dateFormat" property must be of type string or null.');this.config.options.dateFormat=e.options.dateFormat}if(e.options.debug){if(e.options.debug.data!==void 0){if(typeof e.options.debug.data!="boolean")throw new TypeError('The "config.options.debug.data" property must be of type boolean.');this.config.options.debug.data=e.options.debug.data}if(e.options.debug.packet!==void 0){if(typeof e.options.debug.packet!="boolean")throw new TypeError('The "config.options.debug.packet" property must be of type boolean.');this.config.options.debug.packet=e.options.debug.packet}if(e.options.debug.payload!==void 0){if(typeof e.options.debug.payload!="boolean")throw new TypeError('The "config.options.debug.payload" property must be of type boolean.');this.config.options.debug.payload=e.options.debug.payload}if(e.options.debug.token!==void 0){if(typeof e.options.debug.token!="boolean")throw new TypeError('The "config.options.debug.token" property must be of type boolean.');this.config.options.debug.token=e.options.debug.token}}if(e.options.enableAnsiNull!==void 0){if(typeof e.options.enableAnsiNull!="boolean"&&e.options.enableAnsiNull!==null)throw new TypeError('The "config.options.enableAnsiNull" property must be of type boolean or null.');this.config.options.enableAnsiNull=e.options.enableAnsiNull}if(e.options.enableAnsiNullDefault!==void 0){if(typeof e.options.enableAnsiNullDefault!="boolean"&&e.options.enableAnsiNullDefault!==null)throw new TypeError('The "config.options.enableAnsiNullDefault" property must be of type boolean or null.');this.config.options.enableAnsiNullDefault=e.options.enableAnsiNullDefault}if(e.options.enableAnsiPadding!==void 0){if(typeof e.options.enableAnsiPadding!="boolean"&&e.options.enableAnsiPadding!==null)throw new TypeError('The "config.options.enableAnsiPadding" property must be of type boolean or null.');this.config.options.enableAnsiPadding=e.options.enableAnsiPadding}if(e.options.enableAnsiWarnings!==void 0){if(typeof e.options.enableAnsiWarnings!="boolean"&&e.options.enableAnsiWarnings!==null)throw new TypeError('The "config.options.enableAnsiWarnings" property must be of type boolean or null.');this.config.options.enableAnsiWarnings=e.options.enableAnsiWarnings}if(e.options.enableArithAbort!==void 0){if(typeof e.options.enableArithAbort!="boolean"&&e.options.enableArithAbort!==null)throw new TypeError('The "config.options.enableArithAbort" property must be of type boolean or null.');this.config.options.enableArithAbort=e.options.enableArithAbort}if(e.options.enableConcatNullYieldsNull!==void 0){if(typeof e.options.enableConcatNullYieldsNull!="boolean"&&e.options.enableConcatNullYieldsNull!==null)throw new TypeError('The "config.options.enableConcatNullYieldsNull" property must be of type boolean or null.');this.config.options.enableConcatNullYieldsNull=e.options.enableConcatNullYieldsNull}if(e.options.enableCursorCloseOnCommit!==void 0){if(typeof e.options.enableCursorCloseOnCommit!="boolean"&&e.options.enableCursorCloseOnCommit!==null)throw new TypeError('The "config.options.enableCursorCloseOnCommit" property must be of type boolean or null.');this.config.options.enableCursorCloseOnCommit=e.options.enableCursorCloseOnCommit}if(e.options.enableImplicitTransactions!==void 0){if(typeof e.options.enableImplicitTransactions!="boolean"&&e.options.enableImplicitTransactions!==null)throw new TypeError('The "config.options.enableImplicitTransactions" property must be of type boolean or null.');this.config.options.enableImplicitTransactions=e.options.enableImplicitTransactions}if(e.options.enableNumericRoundabort!==void 0){if(typeof e.options.enableNumericRoundabort!="boolean"&&e.options.enableNumericRoundabort!==null)throw new TypeError('The "config.options.enableNumericRoundabort" property must be of type boolean or null.');this.config.options.enableNumericRoundabort=e.options.enableNumericRoundabort}if(e.options.enableQuotedIdentifier!==void 0){if(typeof e.options.enableQuotedIdentifier!="boolean"&&e.options.enableQuotedIdentifier!==null)throw new TypeError('The "config.options.enableQuotedIdentifier" property must be of type boolean or null.');this.config.options.enableQuotedIdentifier=e.options.enableQuotedIdentifier}if(e.options.encrypt!==void 0){if(typeof e.options.encrypt!="boolean"&&e.options.encrypt!=="strict")throw new TypeError('The "encrypt" property must be set to "strict", or of type boolean.');this.config.options.encrypt=e.options.encrypt}if(e.options.fallbackToDefaultDb!==void 0){if(typeof e.options.fallbackToDefaultDb!="boolean")throw new TypeError('The "config.options.fallbackToDefaultDb" property must be of type boolean.');this.config.options.fallbackToDefaultDb=e.options.fallbackToDefaultDb}if(e.options.instanceName!==void 0){if(typeof e.options.instanceName!="string")throw new TypeError('The "config.options.instanceName" property must be of type string.');this.config.options.instanceName=e.options.instanceName,this.config.options.port=void 0}if(e.options.isolationLevel!==void 0&&((0,Gn.assertValidIsolationLevel)(e.options.isolationLevel,"config.options.isolationLevel"),this.config.options.isolationLevel=e.options.isolationLevel),e.options.language!==void 0){if(typeof e.options.language!="string"&&e.options.language!==null)throw new TypeError('The "config.options.language" property must be of type string or null.');this.config.options.language=e.options.language}if(e.options.localAddress!==void 0){if(typeof e.options.localAddress!="string")throw new TypeError('The "config.options.localAddress" property must be of type string.');this.config.options.localAddress=e.options.localAddress}if(e.options.multiSubnetFailover!==void 0){if(typeof e.options.multiSubnetFailover!="boolean")throw new TypeError('The "config.options.multiSubnetFailover" property must be of type boolean.');this.config.options.multiSubnetFailover=e.options.multiSubnetFailover}if(e.options.packetSize!==void 0){if(typeof e.options.packetSize!="number")throw new TypeError('The "config.options.packetSize" property must be of type number.');this.config.options.packetSize=e.options.packetSize}if(e.options.port!==void 0){if(typeof e.options.port!="number")throw new TypeError('The "config.options.port" property must be of type number.');if(e.options.port<=0||e.options.port>=65536)throw new RangeError('The "config.options.port" property must be > 0 and < 65536');this.config.options.port=e.options.port,this.config.options.instanceName=void 0}if(e.options.readOnlyIntent!==void 0){if(typeof e.options.readOnlyIntent!="boolean")throw new TypeError('The "config.options.readOnlyIntent" property must be of type boolean.');this.config.options.readOnlyIntent=e.options.readOnlyIntent}if(e.options.requestTimeout!==void 0){if(typeof e.options.requestTimeout!="number")throw new TypeError('The "config.options.requestTimeout" property must be of type number.');this.config.options.requestTimeout=e.options.requestTimeout}if(e.options.maxRetriesOnTransientErrors!==void 0){if(typeof e.options.maxRetriesOnTransientErrors!="number")throw new TypeError('The "config.options.maxRetriesOnTransientErrors" property must be of type number.');if(e.options.maxRetriesOnTransientErrors<0)throw new TypeError('The "config.options.maxRetriesOnTransientErrors" property must be equal or greater than 0.');this.config.options.maxRetriesOnTransientErrors=e.options.maxRetriesOnTransientErrors}if(e.options.connectionRetryInterval!==void 0){if(typeof e.options.connectionRetryInterval!="number")throw new TypeError('The "config.options.connectionRetryInterval" property must be of type number.');if(e.options.connectionRetryInterval<=0)throw new TypeError('The "config.options.connectionRetryInterval" property must be greater than 0.');this.config.options.connectionRetryInterval=e.options.connectionRetryInterval}if(e.options.rowCollectionOnDone!==void 0){if(typeof e.options.rowCollectionOnDone!="boolean")throw new TypeError('The "config.options.rowCollectionOnDone" property must be of type boolean.');this.config.options.rowCollectionOnDone=e.options.rowCollectionOnDone}if(e.options.rowCollectionOnRequestCompletion!==void 0){if(typeof e.options.rowCollectionOnRequestCompletion!="boolean")throw new TypeError('The "config.options.rowCollectionOnRequestCompletion" property must be of type boolean.');this.config.options.rowCollectionOnRequestCompletion=e.options.rowCollectionOnRequestCompletion}if(e.options.tdsVersion!==void 0){if(typeof e.options.tdsVersion!="string")throw new TypeError('The "config.options.tdsVersion" property must be of type string.');this.config.options.tdsVersion=e.options.tdsVersion}if(e.options.textsize!==void 0){if(typeof e.options.textsize!="number"&&e.options.textsize!==null)throw new TypeError('The "config.options.textsize" property must be of type number or null.');if(e.options.textsize>2147483647)throw new TypeError(`The "config.options.textsize" can't be greater than 2147483647.`);if(e.options.textsize<-1)throw new TypeError(`The "config.options.textsize" can't be smaller than -1.`);this.config.options.textsize=e.options.textsize|0}if(e.options.trustServerCertificate!==void 0){if(typeof e.options.trustServerCertificate!="boolean")throw new TypeError('The "config.options.trustServerCertificate" property must be of type boolean.');this.config.options.trustServerCertificate=e.options.trustServerCertificate}if(e.options.serverName!==void 0){if(typeof e.options.serverName!="string")throw new TypeError('The "config.options.serverName" property must be of type string.');this.config.options.serverName=e.options.serverName}if(e.options.useColumnNames!==void 0){if(typeof e.options.useColumnNames!="boolean")throw new TypeError('The "config.options.useColumnNames" property must be of type boolean.');this.config.options.useColumnNames=e.options.useColumnNames}if(e.options.useUTC!==void 0){if(typeof e.options.useUTC!="boolean")throw new TypeError('The "config.options.useUTC" property must be of type boolean.');this.config.options.useUTC=e.options.useUTC}if(e.options.workstationId!==void 0){if(typeof e.options.workstationId!="string")throw new TypeError('The "config.options.workstationId" property must be of type string.');this.config.options.workstationId=e.options.workstationId}if(e.options.lowerCaseGuids!==void 0){if(typeof e.options.lowerCaseGuids!="boolean")throw new TypeError('The "config.options.lowerCaseGuids" property must be of type boolean.');this.config.options.lowerCaseGuids=e.options.lowerCaseGuids}}this.secureContextOptions=this.config.options.cryptoCredentialsDetails,this.secureContextOptions.secureOptions===void 0&&(this.secureContextOptions=Object.create(this.secureContextOptions,{secureOptions:{value:kCe.default.SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS}})),this.debug=this.createDebug(),this.inTransaction=!1,this.transactionDescriptors=[Buffer.from([0,0,0,0,0,0,0,0])],this.transactionDepth=0,this.isSqlBatch=!1,this.closed=!1,this.messageBuffer=Buffer.alloc(0),this.curTransientRetryCount=0,this.transientErrorLookup=new qCe.TransientErrorLookup,this.state=this.STATE.INITIALIZED,this._cancelAfterRequestSent=()=>{this.messageIo.sendMessage(Ut.TYPE.ATTENTION),this.createCancelTimer()},this._onSocketClose=()=>{this.socketClose()},this._onSocketEnd=()=>{this.socketEnd()},this._onSocketError=i=>{this.dispatchEvent("socketError",i),process.nextTick(()=>{this.emit("error",this.wrapSocketError(i))})}}connect(e){if(this.state!==this.STATE.INITIALIZED)throw new gt.ConnectionError("`.connect` can not be called on a Connection in `"+this.state.name+"` state.");if(e){let n=r=>{this.removeListener("error",i),e(r)},i=r=>{this.removeListener("connect",n),e(r)};this.once("connect",n),this.once("error",i)}this.transitionTo(this.STATE.CONNECTING),this.initialiseConnection().then(()=>{process.nextTick(()=>{this.emit("connect")})},n=>{this.transitionTo(this.STATE.FINAL),this.closed=!0,process.nextTick(()=>{this.emit("connect",n)}),process.nextTick(()=>{this.emit("end")})})}on(e,n){return super.on(e,n)}emit(e,...n){return super.emit(e,...n)}close(){this.transitionTo(this.STATE.FINAL),this.cleanupConnection()}async initialiseConnection(){let e=new AbortController,n=setTimeout(()=>{let i=this.config.options.port?`:${this.config.options.port}`:`\\${this.config.options.instanceName}`,r=this.routingData?this.routingData.server:this.config.server,o=this.routingData?`:${this.routingData.port}`:i,s=this.routingData?` (redirected from ${this.config.server}${i})`:"",a=`Failed to connect to ${r}${o}${s} in ${this.config.options.connectTimeout}ms`;this.debug.log(a),e.abort(new gt.ConnectionError(a,"ETIMEOUT"))},this.config.options.connectTimeout);try{let i=e.signal,r=this.config.options.port;if(!r)try{r=await(0,FCe.instanceLookup)({server:this.config.server,instanceName:this.config.options.instanceName,timeout:this.config.options.connectTimeout,signal:i})}catch(s){throw i.throwIfAborted(),new gt.ConnectionError(s.message,"EINSTLOOKUP",{cause:s})}let o;try{o=await this.connectOnPort(r,this.config.options.multiSubnetFailover,i,this.config.options.connector)}catch(s){throw i.throwIfAborted(),this.wrapSocketError(s)}try{let s=new AbortController,a=l=>{s.abort(this.wrapSocketError(l))},c=()=>{this.debug.log("connection to "+this.config.server+":"+this.config.options.port+" closed")},u=()=>{this.debug.log("socket ended");let l=new Error("socket hang up");l.code="ECONNRESET",s.abort(this.wrapSocketError(l))};o.once("error",a),o.once("close",c),o.once("end",u);try{i=AbortSignal.any([i,s.signal]),o.setKeepAlive(!0,XCe),this.messageIo=new jCe.default(o,this.config.options.packetSize,this.debug),this.messageIo.on("secure",d=>{this.emit("secure",d)}),this.socket=o,this.closed=!1,this.debug.log("connected to "+this.config.server+":"+this.config.options.port),this.sendPreLogin(),this.transitionTo(this.STATE.SENT_PRELOGIN);let l=await this.readPreloginResponse(i);await this.performTlsNegotiation(l,i),this.sendLogin7Packet();try{let{authentication:d}=this.config;switch(d.type){case"token-credential":case"azure-active-directory-password":case"azure-active-directory-msi-vm":case"azure-active-directory-msi-app-service":case"azure-active-directory-service-principal-secret":case"azure-active-directory-default":this.transitionTo(this.STATE.SENT_LOGIN7_WITH_FEDAUTH),this.routingData=await this.performSentLogin7WithFedAuth(i);break;case"ntlm":this.transitionTo(this.STATE.SENT_LOGIN7_WITH_NTLM),this.routingData=await this.performSentLogin7WithNTLMLogin(i);break;default:this.transitionTo(this.STATE.SENT_LOGIN7_WITH_STANDARD_LOGIN),this.routingData=await this.performSentLogin7WithStandardLogin(i);break}}catch(d){if(cSe(d))return this.debug.log("Initiating retry on transient error"),this.transitionTo(this.STATE.TRANSIENT_FAILURE_RETRY),await this.performTransientFailureRetry();throw d}if(this.routingData)return this.transitionTo(this.STATE.REROUTING),await this.performReRouting();this.transitionTo(this.STATE.LOGGED_IN_SENDING_INITIAL_SQL),await this.performLoggedInSendingInitialSql(i)}finally{o.removeListener("error",a),o.removeListener("close",c),o.removeListener("end",u)}}catch(s){throw o.destroy(),s}o.on("error",this._onSocketError),o.on("close",this._onSocketClose),o.on("end",this._onSocketEnd),this.transitionTo(this.STATE.LOGGED_IN)}finally{clearTimeout(n)}}cleanupConnection(){if(!this.closed){this.clearRequestTimer(),this.closeConnection(),process.nextTick(()=>{this.emit("end")});let e=this.request;if(e){let n=new gt.RequestError("Connection closed before request completed.","ECLOSE");e.callback(n),this.request=void 0}this.closed=!0}}createDebug(){let e=new xCe.default(this.config.options.debug);return e.on("debug",n=>{this.emit("debug",n)}),e}createTokenStreamParser(e,n){return new YCe.Parser(e,this.debug,n,this.config.options)}async wrapWithTls(e,n){n.throwIfAborted();let i=DW.createSecureContext(this.secureContextOptions),r=DCe.isIP(this.config.server)?"":this.config.server,o={host:this.config.server,socket:e,ALPNProtocols:["tds/8.0"],secureContext:i,servername:this.config.options.serverName?this.config.options.serverName:r},{promise:s,resolve:a,reject:c}=So(),u=DW.connect(o);try{let l=()=>{c(n.reason)};n.addEventListener("abort",l,{once:!0});try{let d=c,f=()=>{a(u)};u.once("error",d),u.once("secureConnect",f);try{return await s}finally{u.removeListener("error",d),u.removeListener("connect",f)}}finally{n.removeEventListener("abort",l)}}catch(l){throw u.destroy(),l}}async connectOnPort(e,n,i,r){let o={host:this.routingData?this.routingData.server:this.config.server,port:this.routingData?this.routingData.port:e,localAddress:this.config.options.localAddress},a=await(r||(n?LW.connectInParallel:LW.connectInSequence))(o,MCe.default.lookup,i);if(this.config.options.encrypt==="strict")try{a=await this.wrapWithTls(a,i)}catch(c){throw a.end(),c}return a}closeConnection(){this.socket&&this.socket.destroy()}createCancelTimer(){this.clearCancelTimer();let e=this.config.options.cancelTimeout;e>0&&(this.cancelTimer=setTimeout(()=>{this.cancelTimeout()},e))}createRequestTimer(){this.clearRequestTimer();let e=this.request,n=e.timeout!==void 0?e.timeout:this.config.options.requestTimeout;n&&(this.requestTimer=setTimeout(()=>{this.requestTimeout()},n))}cancelTimeout(){let e=`Failed to cancel request in ${this.config.options.cancelTimeout}ms`;this.debug.log(e),this.dispatchEvent("socketError",new gt.ConnectionError(e,"ETIMEOUT"))}requestTimeout(){this.requestTimer=void 0;let e=this.request;e.cancel();let i="Timeout: Request failed to complete in "+(e.timeout!==void 0?e.timeout:this.config.options.requestTimeout)+"ms";e.error=new gt.RequestError(i,"ETIMEOUT")}clearCancelTimer(){this.cancelTimer&&(clearTimeout(this.cancelTimer),this.cancelTimer=void 0)}clearRequestTimer(){this.requestTimer&&(clearTimeout(this.requestTimer),this.requestTimer=void 0)}transitionTo(e){if(this.state===e){this.debug.log("State is already "+e.name);return}this.state&&this.state.exit&&this.state.exit.call(this,e),this.debug.log("State change: "+(this.state?this.state.name:"undefined")+" -> "+e.name),this.state=e,this.state.enter&&this.state.enter.apply(this)}getEventHandler(e){let n=this.state.events[e];if(!n)throw new Error(`No event '${e}' in state '${this.state.name}'`);return n}dispatchEvent(e,...n){let i=this.state.events[e];i?i.apply(this,n):(this.emit("error",new Error(`No event '${e}' in state '${this.state.name}'`)),this.close())}wrapSocketError(e){if(this.state===this.STATE.CONNECTING||this.state===this.STATE.SENT_TLSSSLNEGOTIATION){let n=this.config.options.port?`:${this.config.options.port}`:`\\${this.config.options.instanceName}`,i=this.routingData?this.routingData.server:this.config.server,r=this.routingData?`:${this.routingData.port}`:n,o=this.routingData?` (redirected from ${this.config.server}${n})`:"",s=`Failed to connect to ${i}${r}${o} - ${e.message}`;return new gt.ConnectionError(s,"ESOCKET",{cause:e})}else{let n=`Connection lost - ${e.message}`;return new gt.ConnectionError(n,"ESOCKET",{cause:e})}}socketEnd(){if(this.debug.log("socket ended"),this.state!==this.STATE.FINAL){let e=new Error("socket hang up");e.code="ECONNRESET",this.dispatchEvent("socketError",e),process.nextTick(()=>{this.emit("error",this.wrapSocketError(e))})}}socketClose(){this.debug.log("connection to "+this.config.server+":"+this.config.options.port+" closed"),this.transitionTo(this.STATE.FINAL),this.cleanupConnection()}sendPreLogin(){let[,e,n,i]=/^(\d+)\.(\d+)\.(\d+)/.exec(WCe.version)??["0.0.0","0","0","0"],r=new MW.default({encrypt:typeof this.config.options.encrypt=="boolean"&&this.config.options.encrypt,version:{major:Number(e),minor:Number(n),build:Number(i),subbuild:0}});this.messageIo.sendMessage(Ut.TYPE.PRELOGIN,r.data),this.debug.payload(function(){return r.toString(" ")})}sendLogin7Packet(){let e=new HCe.default({tdsVersion:$Ce.versions[this.config.options.tdsVersion],packetSize:this.config.options.packetSize,clientProgVer:0,clientPid:process.pid,connectionId:0,clientTimeZone:new Date().getTimezoneOffset(),clientLcid:1033}),{authentication:n}=this.config;switch(n.type){case"azure-active-directory-password":e.fedAuth={type:"ADAL",echo:this.fedAuthRequired,workflow:"default"};break;case"azure-active-directory-access-token":e.fedAuth={type:"SECURITYTOKEN",echo:this.fedAuthRequired,fedAuthToken:n.options.token};break;case"token-credential":case"azure-active-directory-msi-vm":case"azure-active-directory-default":case"azure-active-directory-msi-app-service":case"azure-active-directory-service-principal-secret":e.fedAuth={type:"ADAL",echo:this.fedAuthRequired,workflow:"integrated"};break;case"ntlm":e.sspi=(0,zCe.createNTLMRequest)({domain:n.options.domain});break;default:e.userName=n.options.userName,e.password=n.options.password}e.hostname=this.config.options.workstationId||PCe.default.hostname(),e.serverName=this.routingData?`${this.routingData.server}${this.routingData.instance?"\\"+this.routingData.instance:""}`:this.config.server,e.appName=this.config.options.appName||"Tedious",e.libraryName=VCe.name,e.language=this.config.options.language,e.database=this.config.options.database,e.clientId=Buffer.from([1,2,3,4,5,6]),e.readOnlyIntent=this.config.options.readOnlyIntent,e.initDbFatal=!this.config.options.fallbackToDefaultDb,this.routingData=void 0,this.messageIo.sendMessage(Ut.TYPE.LOGIN7,e.toBuffer()),this.debug.payload(function(){return e.toString(" ")})}sendFedAuthTokenMessage(e){let n=Buffer.byteLength(e,"ucs2"),i=Buffer.alloc(8+n),r=0;r=i.writeUInt32LE(n+4,r),r=i.writeUInt32LE(n,r),i.write(e,r,"ucs2"),this.messageIo.sendMessage(Ut.TYPE.FEDAUTH_TOKEN,i)}sendInitialSql(){let e=new kW.default(this.getInitialSql(),this.currentTransactionDescriptor(),this.config.options),n=new UW.default({type:Ut.TYPE.SQL_BATCH});this.messageIo.outgoingMessageStream.write(n),kR.Readable.from(e).pipe(n)}getInitialSql(){let e=[];return this.config.options.enableAnsiNull===!0?e.push("set ansi_nulls on"):this.config.options.enableAnsiNull===!1&&e.push("set ansi_nulls off"),this.config.options.enableAnsiNullDefault===!0?e.push("set ansi_null_dflt_on on"):this.config.options.enableAnsiNullDefault===!1&&e.push("set ansi_null_dflt_on off"),this.config.options.enableAnsiPadding===!0?e.push("set ansi_padding on"):this.config.options.enableAnsiPadding===!1&&e.push("set ansi_padding off"),this.config.options.enableAnsiWarnings===!0?e.push("set ansi_warnings on"):this.config.options.enableAnsiWarnings===!1&&e.push("set ansi_warnings off"),this.config.options.enableArithAbort===!0?e.push("set arithabort on"):this.config.options.enableArithAbort===!1&&e.push("set arithabort off"),this.config.options.enableConcatNullYieldsNull===!0?e.push("set concat_null_yields_null on"):this.config.options.enableConcatNullYieldsNull===!1&&e.push("set concat_null_yields_null off"),this.config.options.enableCursorCloseOnCommit===!0?e.push("set cursor_close_on_commit on"):this.config.options.enableCursorCloseOnCommit===!1&&e.push("set cursor_close_on_commit off"),this.config.options.datefirst!==null&&e.push(`set datefirst ${this.config.options.datefirst}`),this.config.options.dateFormat!==null&&e.push(`set dateformat ${this.config.options.dateFormat}`),this.config.options.enableImplicitTransactions===!0?e.push("set implicit_transactions on"):this.config.options.enableImplicitTransactions===!1&&e.push("set implicit_transactions off"),this.config.options.language!==null&&e.push(`set language ${this.config.options.language}`),this.config.options.enableNumericRoundabort===!0?e.push("set numeric_roundabort on"):this.config.options.enableNumericRoundabort===!1&&e.push("set numeric_roundabort off"),this.config.options.enableQuotedIdentifier===!0?e.push("set quoted_identifier on"):this.config.options.enableQuotedIdentifier===!1&&e.push("set quoted_identifier off"),this.config.options.textsize!==null&&e.push(`set textsize ${this.config.options.textsize}`),this.config.options.connectionIsolationLevel!==null&&e.push(`set transaction isolation level ${this.getIsolationLevelText(this.config.options.connectionIsolationLevel)}`),this.config.options.abortTransactionOnError===!0?e.push("set xact_abort on"):this.config.options.abortTransactionOnError===!1&&e.push("set xact_abort off"),e.join(`
|
|
130
|
+
`)}execSqlBatch(e){this.makeRequest(e,Ut.TYPE.SQL_BATCH,new kW.default(e.sqlTextOrProcedure,this.currentTransactionDescriptor(),this.config.options))}execSql(e){try{e.validateParameters(this.databaseCollation)}catch(i){e.error=i,process.nextTick(()=>{this.debug.log(i.message),e.callback(i)});return}let n=[];n.push({type:_s.TYPES.NVarChar,name:"statement",value:e.sqlTextOrProcedure,output:!1,length:void 0,precision:void 0,scale:void 0}),e.parameters.length&&(n.push({type:_s.TYPES.NVarChar,name:"params",value:e.makeParamsParameter(e.parameters),output:!1,length:void 0,precision:void 0,scale:void 0}),n.push(...e.parameters)),this.makeRequest(e,Ut.TYPE.RPC_REQUEST,new Hh.default(yT.default.Sp_ExecuteSql,n,this.currentTransactionDescriptor(),this.config.options,this.databaseCollation))}newBulkLoad(e,n,i){let r;if(i===void 0?(i=n,r={}):r=n,typeof r!="object")throw new TypeError('"options" argument must be an object');return new UCe.default(e,this.databaseCollation,this.config.options,r,i)}execBulkLoad(e,n){if(e.executionStarted=!0,n){if(e.streamingMode)throw new Error("Connection.execBulkLoad can't be called with a BulkLoad that was put in streaming mode.");if(e.firstRowWritten)throw new Error("Connection.execBulkLoad can't be called with a BulkLoad that already has rows written to it.");let s=kR.Readable.from(n);s.on("error",a=>{e.rowToPacketTransform.destroy(a)}),e.rowToPacketTransform.on("error",a=>{s.destroy(a)}),s.pipe(e.rowToPacketTransform)}else e.streamingMode||e.rowToPacketTransform.end();let i=()=>{o.cancel()},r=new GCe.BulkLoadPayload(e),o=new Mn.default(e.getBulkInsertSql(),s=>{if(e.removeListener("cancel",i),s){s.code==="UNKNOWN"&&(s.message+=" This is likely because the schema of the BulkLoad does not match the schema of the table you are attempting to insert into."),e.error=s,e.callback(s);return}this.makeRequest(e,Ut.TYPE.BULK_LOAD,r)});e.once("cancel",i),this.execSqlBatch(o)}prepare(e){let n=[];n.push({type:_s.TYPES.Int,name:"handle",value:void 0,output:!0,length:void 0,precision:void 0,scale:void 0}),n.push({type:_s.TYPES.NVarChar,name:"params",value:e.parameters.length?e.makeParamsParameter(e.parameters):null,output:!1,length:void 0,precision:void 0,scale:void 0}),n.push({type:_s.TYPES.NVarChar,name:"stmt",value:e.sqlTextOrProcedure,output:!1,length:void 0,precision:void 0,scale:void 0}),e.preparing=!0,e.on("returnValue",(i,r)=>{i==="handle"?e.handle=r:e.error=new gt.RequestError(`Tedious > Unexpected output parameter ${i} from sp_prepare`)}),this.makeRequest(e,Ut.TYPE.RPC_REQUEST,new Hh.default(yT.default.Sp_Prepare,n,this.currentTransactionDescriptor(),this.config.options,this.databaseCollation))}unprepare(e){let n=[];n.push({type:_s.TYPES.Int,name:"handle",value:e.handle,output:!1,length:void 0,precision:void 0,scale:void 0}),this.makeRequest(e,Ut.TYPE.RPC_REQUEST,new Hh.default(yT.default.Sp_Unprepare,n,this.currentTransactionDescriptor(),this.config.options,this.databaseCollation))}execute(e,n){let i=[];i.push({type:_s.TYPES.Int,name:"",value:e.handle,output:!1,length:void 0,precision:void 0,scale:void 0});try{for(let r=0,o=e.parameters.length;r<o;r++){let s=e.parameters[r];i.push({...s,value:s.type.validate(n?n[s.name]:null,this.databaseCollation)})}}catch(r){e.error=r,process.nextTick(()=>{this.debug.log(r.message),e.callback(r)});return}this.makeRequest(e,Ut.TYPE.RPC_REQUEST,new Hh.default(yT.default.Sp_Execute,i,this.currentTransactionDescriptor(),this.config.options,this.databaseCollation))}callProcedure(e){try{e.validateParameters(this.databaseCollation)}catch(n){e.error=n,process.nextTick(()=>{this.debug.log(n.message),e.callback(n)});return}this.makeRequest(e,Ut.TYPE.RPC_REQUEST,new Hh.default(e.sqlTextOrProcedure,e.parameters,this.currentTransactionDescriptor(),this.config.options,this.databaseCollation))}beginTransaction(e,n="",i=this.config.options.isolationLevel){(0,Gn.assertValidIsolationLevel)(i,"isolationLevel");let r=new Gn.Transaction(n,i);if(this.config.options.tdsVersion<"7_2")return this.execSqlBatch(new Mn.default("SET TRANSACTION ISOLATION LEVEL "+r.isolationLevelToTSQL()+";BEGIN TRAN "+r.name,s=>{this.transactionDepth++,this.transactionDepth===1&&(this.inTransaction=!0),e(s)}));let o=new Mn.default(void 0,s=>e(s,this.currentTransactionDescriptor()));return this.makeRequest(o,Ut.TYPE.TRANSACTION_MANAGER,r.beginPayload(this.currentTransactionDescriptor()))}commitTransaction(e,n=""){let i=new Gn.Transaction(n);if(this.config.options.tdsVersion<"7_2")return this.execSqlBatch(new Mn.default("COMMIT TRAN "+i.name,o=>{this.transactionDepth--,this.transactionDepth===0&&(this.inTransaction=!1),e(o)}));let r=new Mn.default(void 0,e);return this.makeRequest(r,Ut.TYPE.TRANSACTION_MANAGER,i.commitPayload(this.currentTransactionDescriptor()))}rollbackTransaction(e,n=""){let i=new Gn.Transaction(n);if(this.config.options.tdsVersion<"7_2")return this.execSqlBatch(new Mn.default("ROLLBACK TRAN "+i.name,o=>{this.transactionDepth--,this.transactionDepth===0&&(this.inTransaction=!1),e(o)}));let r=new Mn.default(void 0,e);return this.makeRequest(r,Ut.TYPE.TRANSACTION_MANAGER,i.rollbackPayload(this.currentTransactionDescriptor()))}saveTransaction(e,n){let i=new Gn.Transaction(n);if(this.config.options.tdsVersion<"7_2")return this.execSqlBatch(new Mn.default("SAVE TRAN "+i.name,o=>{this.transactionDepth++,e(o)}));let r=new Mn.default(void 0,e);return this.makeRequest(r,Ut.TYPE.TRANSACTION_MANAGER,i.savePayload(this.currentTransactionDescriptor()))}transaction(e,n){if(typeof e!="function")throw new TypeError("`cb` must be a function");let i=this.inTransaction,r="_tedious_"+NCe.default.randomBytes(10).toString("hex"),o=(s,a,...c)=>{s?this.inTransaction&&this.state===this.STATE.LOGGED_IN?this.rollbackTransaction(u=>{a(u||s,...c)},r):a(s,...c):i?(this.config.options.tdsVersion<"7_2"&&this.transactionDepth--,a(null,...c)):this.commitTransaction(u=>{a(u,...c)},r)};return i?this.saveTransaction(s=>s?e(s):n?this.execSqlBatch(new Mn.default("SET transaction isolation level "+this.getIsolationLevelText(n),a=>e(a,o))):e(null,o),r):this.beginTransaction(s=>s?e(s):e(null,o),r,n)}makeRequest(e,n,i){if(this.state!==this.STATE.LOGGED_IN){let r="Requests can only be made in the "+this.STATE.LOGGED_IN.name+" state, not the "+this.state.name+" state";this.debug.log(r),e.callback(new gt.RequestError(r,"EINVALIDSTATE"))}else if(e.canceled)process.nextTick(()=>{e.callback(new gt.RequestError("Canceled.","ECANCEL"))});else{n===Ut.TYPE.SQL_BATCH?this.isSqlBatch=!0:this.isSqlBatch=!1,this.request=e,e.connection=this,e.rowCount=0,e.rows=[],e.rst=[];let r=()=>{s.unpipe(o),s.destroy(new gt.RequestError("Canceled.","ECANCEL")),o.ignore=!0,o.end(),e instanceof Mn.default&&e.paused&&e.resume()};e.once("cancel",r),this.createRequestTimer();let o=new UW.default({type:n,resetConnection:this.resetConnectionOnNextRequest});this.messageIo.outgoingMessageStream.write(o),this.transitionTo(this.STATE.SENT_CLIENT_REQUEST),o.once("finish",()=>{e.removeListener("cancel",r),e.once("cancel",this._cancelAfterRequestSent),this.resetConnectionOnNextRequest=!1,this.debug.payload(function(){return i.toString(" ")})});let s=kR.Readable.from(i);s.once("error",a=>{s.unpipe(o),e.error??=a,o.ignore=!0,o.end()}),s.pipe(o)}}cancel(){return!this.request||this.request.canceled?!1:(this.request.cancel(),!0)}reset(e){let n=new Mn.default(this.getInitialSql(),i=>{this.config.options.tdsVersion<"7_2"&&(this.inTransaction=!1),e(i)});this.resetConnectionOnNextRequest=!0,this.execSqlBatch(n)}currentTransactionDescriptor(){return this.transactionDescriptors[this.transactionDescriptors.length-1]}getIsolationLevelText(e){switch(e){case Gn.ISOLATION_LEVEL.READ_UNCOMMITTED:return"read uncommitted";case Gn.ISOLATION_LEVEL.REPEATABLE_READ:return"repeatable read";case Gn.ISOLATION_LEVEL.SERIALIZABLE:return"serializable";case Gn.ISOLATION_LEVEL.SNAPSHOT:return"snapshot";default:return"read committed"}}async performTlsNegotiation(e,n){n.throwIfAborted();let{promise:i,reject:r}=So(),o=()=>{r(n.reason)};n.addEventListener("abort",o,{once:!0});try{if(e.fedAuthRequired===1&&(this.fedAuthRequired=!0),this.config.options.encrypt!=="strict"&&(e.encryptionString==="ON"||e.encryptionString==="REQ")){if(!this.config.options.encrypt)throw new gt.ConnectionError("Server requires encryption, set 'encrypt' config option to true.","EENCRYPT");this.transitionTo(this.STATE.SENT_TLSSSLNEGOTIATION),await Promise.race([this.messageIo.startTls(this.secureContextOptions,this.config.options.serverName?this.config.options.serverName:this.routingData?.server??this.config.server,this.config.options.trustServerCertificate).catch(s=>{throw this.wrapSocketError(s)}),i])}}finally{n.removeEventListener("abort",o)}}async readPreloginResponse(e){e.throwIfAborted();let n=Buffer.alloc(0),{promise:i,reject:r}=So(),o=()=>{r(e.reason)};e.addEventListener("abort",o,{once:!0});try{let c=(await Promise.race([this.messageIo.readMessage().catch(u=>{throw this.wrapSocketError(u)}),i]))[Symbol.asyncIterator]();try{for(;;){let{done:u,value:l}=await Promise.race([c.next(),i]);if(u)break;n=Buffer.concat([n,l])}}finally{c.return&&await c.return()}}finally{e.removeEventListener("abort",o)}let s=new MW.default(n);return this.debug.payload(function(){return s.toString(" ")}),s}async performReRouting(){this.socket.removeListener("error",this._onSocketError),this.socket.removeListener("close",this._onSocketClose),this.socket.removeListener("end",this._onSocketEnd),this.socket.destroy(),this.debug.log("connection to "+this.config.server+":"+this.config.options.port+" closed"),this.emit("rerouting"),this.debug.log("Rerouting to "+this.routingData.server+":"+this.routingData.port),this.transitionTo(this.STATE.CONNECTING),await this.initialiseConnection()}async performTransientFailureRetry(){this.curTransientRetryCount++,this.socket.removeListener("error",this._onSocketError),this.socket.removeListener("close",this._onSocketClose),this.socket.removeListener("end",this._onSocketEnd),this.socket.destroy(),this.debug.log("connection to "+this.config.server+":"+this.config.options.port+" closed");let e=this.routingData?this.routingData.server:this.config.server,n=this.routingData?this.routingData.port:this.config.options.port;this.debug.log("Retry after transient failure connecting to "+e+":"+n);let{promise:i,resolve:r}=So();setTimeout(r,this.config.options.connectionRetryInterval),await i,this.emit("retry"),this.transitionTo(this.STATE.CONNECTING),await this.initialiseConnection()}async performSentLogin7WithStandardLogin(e){e.throwIfAborted();let{promise:n,reject:i}=So(),r=()=>{i(e.reason)};e.addEventListener("abort",r,{once:!0});try{let o=await Promise.race([this.messageIo.readMessage().catch(c=>{throw this.wrapSocketError(c)}),n]),s=new eu.Login7TokenHandler(this),a=this.createTokenStreamParser(o,s);if(await(0,Jc.once)(a,"end"),s.loginAckReceived)return s.routingData;throw this.loginError?this.loginError:new gt.ConnectionError("Login failed.","ELOGIN")}finally{this.loginError=void 0,e.removeEventListener("abort",r)}}async performSentLogin7WithNTLMLogin(e){e.throwIfAborted();let{promise:n,reject:i}=So(),r=()=>{i(e.reason)};e.addEventListener("abort",r,{once:!0});try{for(;;){let o=await Promise.race([this.messageIo.readMessage().catch(c=>{throw this.wrapSocketError(c)}),n]),s=new eu.Login7TokenHandler(this),a=this.createTokenStreamParser(o,s);if(await Promise.race([(0,Jc.once)(a,"end"),n]),s.loginAckReceived)return s.routingData;if(this.ntlmpacket){let c=this.config.authentication,u=new BCe.default({domain:c.options.domain,userName:c.options.userName,password:c.options.password,ntlmpacket:this.ntlmpacket});this.messageIo.sendMessage(Ut.TYPE.NTLMAUTH_PKT,u.data),this.debug.payload(function(){return u.toString(" ")}),this.ntlmpacket=void 0}else throw this.loginError?this.loginError:new gt.ConnectionError("Login failed.","ELOGIN")}}finally{this.loginError=void 0,e.removeEventListener("abort",r)}}async performSentLogin7WithFedAuth(e){e.throwIfAborted();let{promise:n,reject:i}=So(),r=()=>{i(e.reason)};e.addEventListener("abort",r,{once:!0});try{let o=await Promise.race([this.messageIo.readMessage().catch(u=>{throw this.wrapSocketError(u)}),n]),s=new eu.Login7TokenHandler(this),a=this.createTokenStreamParser(o,s);if(await Promise.race([(0,Jc.once)(a,"end"),n]),s.loginAckReceived)return s.routingData;let c=s.fedAuthInfoToken;if(c&&c.stsurl&&c.spn){let u=this.config.authentication,l=new KCe.URL("/.default",c.spn).toString(),d;switch(u.type){case"token-credential":d=u.options.credential;break;case"azure-active-directory-password":d=new _T.UsernamePasswordCredential(u.options.tenantId??"common",u.options.clientId,u.options.userName,u.options.password);break;case"azure-active-directory-msi-vm":case"azure-active-directory-msi-app-service":let m=u.options.clientId?[u.options.clientId,{}]:[{}];d=new _T.ManagedIdentityCredential(...m);break;case"azure-active-directory-default":let _=u.options.clientId?{managedIdentityClientId:u.options.clientId}:{};d=new _T.DefaultAzureCredential(_);break;case"azure-active-directory-service-principal-secret":d=new _T.ClientSecretCredential(u.options.tenantId,u.options.clientId,u.options.clientSecret);break}let f;try{f=await Promise.race([d.getToken(l),n])}catch(m){throw e.throwIfAborted(),new AggregateError([new gt.ConnectionError("Security token could not be authenticated or authorized.","EFEDAUTH"),m])}if(f===null)throw new AggregateError([new gt.ConnectionError("Security token could not be authenticated or authorized.","EFEDAUTH")]);return this.sendFedAuthTokenMessage(f.token),this.transitionTo(this.STATE.SENT_LOGIN7_WITH_STANDARD_LOGIN),await this.performSentLogin7WithStandardLogin(e)}else throw this.loginError?this.loginError:new gt.ConnectionError("Login failed.","ELOGIN")}finally{this.loginError=void 0,e.removeEventListener("abort",r)}}async performLoggedInSendingInitialSql(e){e.throwIfAborted();let{promise:n,reject:i}=So(),r=()=>{i(e.reason)};e.addEventListener("abort",r,{once:!0});try{this.sendInitialSql();let o=await Promise.race([this.messageIo.readMessage().catch(a=>{throw this.wrapSocketError(a)}),n]),s=this.createTokenStreamParser(o,new eu.InitialSqlTokenHandler(this));await Promise.race([(0,Jc.once)(s,"end"),n])}finally{e.removeEventListener("abort",r)}}};function cSe(t){return t instanceof AggregateError&&(t=t.errors[0]),t instanceof gt.ConnectionError&&!!t.isTransient}var ANe=ET.default=Bh;xW.exports=Bh;Bh.prototype.STATE={INITIALIZED:{name:"Initialized",events:{}},CONNECTING:{name:"Connecting",events:{}},SENT_PRELOGIN:{name:"SentPrelogin",events:{}},REROUTING:{name:"ReRouting",events:{}},TRANSIENT_FAILURE_RETRY:{name:"TRANSIENT_FAILURE_RETRY",events:{}},SENT_TLSSSLNEGOTIATION:{name:"SentTLSSSLNegotiation",events:{}},SENT_LOGIN7_WITH_STANDARD_LOGIN:{name:"SentLogin7WithStandardLogin",events:{}},SENT_LOGIN7_WITH_NTLM:{name:"SentLogin7WithNTLMLogin",events:{}},SENT_LOGIN7_WITH_FEDAUTH:{name:"SentLogin7WithFedauth",events:{}},LOGGED_IN_SENDING_INITIAL_SQL:{name:"LoggedInSendingInitialSql",events:{}},LOGGED_IN:{name:"LoggedIn",events:{socketError:function(){this.transitionTo(this.STATE.FINAL),this.cleanupConnection()}}},SENT_CLIENT_REQUEST:{name:"SentClientRequest",enter:function(){(async()=>{let t;try{t=await this.messageIo.readMessage()}catch(s){this.dispatchEvent("socketError",s),process.nextTick(()=>{this.emit("error",this.wrapSocketError(s))});return}this.clearRequestTimer();let e=this.createTokenStreamParser(t,new eu.RequestTokenHandler(this,this.request));if(this.request?.canceled&&this.cancelTimer)return this.transitionTo(this.STATE.SENT_ATTENTION);let n=()=>{e.resume()},i=()=>{e.pause(),this.request?.once("resume",n)};this.request?.on("pause",i),this.request instanceof Mn.default&&this.request.paused&&i();let r=()=>{e.removeListener("end",o),this.request instanceof Mn.default&&this.request.paused&&this.request.resume(),this.request?.removeListener("pause",i),this.request?.removeListener("resume",n),this.transitionTo(this.STATE.SENT_ATTENTION)},o=()=>{this.request?.removeListener("cancel",this._cancelAfterRequestSent),this.request?.removeListener("cancel",r),this.request?.removeListener("pause",i),this.request?.removeListener("resume",n),this.transitionTo(this.STATE.LOGGED_IN);let s=this.request;this.request=void 0,this.config.options.tdsVersion<"7_2"&&s.error&&this.isSqlBatch&&(this.inTransaction=!1),s.callback(s.error,s.rowCount,s.rows)};e.once("end",o),this.request?.once("cancel",r)})()},exit:function(t){this.clearRequestTimer()},events:{socketError:function(t){let e=this.request;this.request=void 0,this.transitionTo(this.STATE.FINAL),this.cleanupConnection(),e.callback(t)}}},SENT_ATTENTION:{name:"SentAttention",enter:function(){(async()=>{let t;try{t=await this.messageIo.readMessage()}catch(i){this.dispatchEvent("socketError",i),process.nextTick(()=>{this.emit("error",this.wrapSocketError(i))});return}let e=new eu.AttentionTokenHandler(this,this.request),n=this.createTokenStreamParser(t,e);if(await(0,Jc.once)(n,"end"),e.attentionReceived){this.clearCancelTimer();let i=this.request;this.request=void 0,this.transitionTo(this.STATE.LOGGED_IN),i.error&&i.error instanceof gt.RequestError&&i.error.code==="ETIMEOUT"?i.callback(i.error):i.callback(new gt.RequestError("Canceled.","ECANCEL"))}})().catch(t=>{process.nextTick(()=>{throw t})})},events:{socketError:function(t){let e=this.request;this.request=void 0,this.transitionTo(this.STATE.FINAL),this.cleanupConnection(),e.callback(t)}}},FINAL:{name:"Final",events:{}}}});var gSe=g(Wn=>{Object.defineProperty(Wn,"__esModule",{value:!0});Object.defineProperty(Wn,"BulkLoad",{enumerable:!0,get:function(){return uSe.default}});Object.defineProperty(Wn,"Connection",{enumerable:!0,get:function(){return qW.default}});Object.defineProperty(Wn,"ConnectionError",{enumerable:!0,get:function(){return HW.ConnectionError}});Object.defineProperty(Wn,"ISOLATION_LEVEL",{enumerable:!0,get:function(){return fSe.ISOLATION_LEVEL}});Object.defineProperty(Wn,"Request",{enumerable:!0,get:function(){return lSe.default}});Object.defineProperty(Wn,"RequestError",{enumerable:!0,get:function(){return HW.RequestError}});Object.defineProperty(Wn,"TDS_VERSION",{enumerable:!0,get:function(){return pSe.versions}});Object.defineProperty(Wn,"TYPES",{enumerable:!0,get:function(){return hSe.TYPES}});Wn.connect=mSe;Wn.library=void 0;var uSe=UR(QT()),qW=UR(FW()),lSe=UR(G_()),dSe=bR(),HW=ho(),hSe=kh(),fSe=IR(),pSe=nh();function UR(t){return t&&t.__esModule?t:{default:t}}var CNe=Wn.library={name:dSe.name};function mSe(t,e){let n=new qW.default(t);return n.connect(e),n}});export default gSe();
|
|
131
|
+
/*! Bundled license information:
|
|
132
|
+
|
|
133
|
+
@azure/msal-common/lib/index-node-4Jss3kYh.js:
|
|
134
|
+
@azure/msal-common/lib/index-browser.cjs:
|
|
135
|
+
@azure/msal-common/lib/index.cjs:
|
|
136
|
+
(*! @azure/msal-common v15.13.3 2025-12-04 *)
|
|
137
|
+
|
|
138
|
+
safe-buffer/index.js:
|
|
139
|
+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
140
|
+
|
|
141
|
+
@azure/msal-node/lib/msal-node.cjs:
|
|
142
|
+
(*! @azure/msal-node v3.8.4 2025-12-04 *)
|
|
143
|
+
(*! @azure/msal-common v15.13.3 2025-12-04 *)
|
|
144
|
+
|
|
145
|
+
js-md4/src/md4.js:
|
|
146
|
+
(**
|
|
147
|
+
* [js-md4]{@link https://github.com/emn178/js-md4}
|
|
148
|
+
*
|
|
149
|
+
* @namespace md4
|
|
150
|
+
* @version 0.3.2
|
|
151
|
+
* @author Yi-Cyuan Chen [emn178@gmail.com]
|
|
152
|
+
* @copyright Yi-Cyuan Chen 2015-2027
|
|
153
|
+
* @license MIT
|
|
154
|
+
*)
|
|
155
|
+
|
|
156
|
+
@js-joda/core/dist/js-joda.esm.js:
|
|
157
|
+
(*! @version @js-joda/core - 5.6.5 *)
|
|
158
|
+
(*! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors *)
|
|
159
|
+
(*! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos *)
|
|
160
|
+
(*! @license BSD-3-Clause (see LICENSE in the root directory of this source tree) *)
|
|
161
|
+
(**
|
|
162
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
163
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
164
|
+
*)
|
|
165
|
+
(**
|
|
166
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
167
|
+
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
168
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
169
|
+
*)
|
|
170
|
+
(*
|
|
171
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
172
|
+
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
173
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
174
|
+
*)
|
|
175
|
+
(*
|
|
176
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
177
|
+
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
178
|
+
*)
|
|
179
|
+
(*
|
|
180
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
181
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
182
|
+
*)
|
|
183
|
+
(*
|
|
184
|
+
* @copyright (c) 2016, Philipp Thürwächter, Pattrick Hüper
|
|
185
|
+
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
186
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
187
|
+
*)
|
|
188
|
+
(*
|
|
189
|
+
* @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
|
|
190
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
191
|
+
*)
|
|
192
|
+
*/
|