@thunderclient/cli 1.27.6 → 1.27.8

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/905.index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- "use strict";exports.id=905,exports.ids=[905],exports.modules={846(e,t,r){r.d(t,{Y:()=>j});var n=r(108),s=r(110);function o(e,t,r){if(r<=0||!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");const n=e.split(t);if(1===r)return n;const s=[];let o="";for(let e=0;e<n.length;e++)""===o?o=n[e]:o+=t+n[e],(e+1)%r===0&&(s.push(o),o="");return""!==o&&s.push(o),s}var i=r(847),a=r(33),c=r(842),u=r(111),f=r(848),l=r(115);class h extends l.t{async serializeRequest(e,t,r){const o={...t??{}},i=this.serializer,c={},u={},l=await r.endpoint(),h=n.l1.of(e?.input),d=[],w=[];let p,m=!1;const b=new a.K({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:c,headers:u,body:void 0});if(l){this.updateServiceEndpoint(b,l),this.setHostPrefix(b,e,o);const t=(0,s.c)(e.traits);if(t.http){b.method=t.http[0];const[e,r]=t.http[1].split("?");"/"==b.path?b.path=e:b.path+=e;const n=new URLSearchParams(r??"");Object.assign(c,Object.fromEntries(n))}}for(const[e,t]of h.structIterator()){const r=t.getMergedTraits()??{},n=o[e];if(null!=n||t.isIdempotencyToken())if(r.httpPayload){if(t.isStreaming()){t.isStructSchema()?o[e]&&(p=await this.serializeEventStream({eventStream:o[e],requestSchema:h})):p=n}else i.write(t,n),p=i.flush();delete o[e]}else if(r.httpLabel){i.write(t,n);const r=i.flush();b.path.includes(`{${e}+}`)?b.path=b.path.replace(`{${e}+}`,r.split("/").map(f.$).join("/")):b.path.includes(`{${e}}`)&&(b.path=b.path.replace(`{${e}}`,(0,f.$)(r))),delete o[e]}else if(r.httpHeader)i.write(t,n),u[r.httpHeader.toLowerCase()]=String(i.flush()),delete o[e];else if("string"==typeof r.httpPrefixHeaders){for(const[e,s]of Object.entries(n)){const n=r.httpPrefixHeaders+e;i.write([t.getValueSchema(),{httpHeader:n}],s),u[n.toLowerCase()]=i.flush()}delete o[e]}else r.httpQuery||r.httpQueryParams?(this.serializeQuery(t,n,c),delete o[e]):(m=!0,d.push(e),w.push(t));else if(r.httpLabel&&(b.path.includes(`{${e}+}`)||b.path.includes(`{${e}}`)))throw new Error(`No value provided for input HTTP label: ${e}.`)}if(m&&o){const[e,t]=(h.getName(!0)??"#Unknown").split("#"),r=h.getSchema()[6],n=[3,e,t,h.getMergedTraits(),d,w,void 0];r?n[6]=r:n.pop(),i.write(n,o),p=i.flush()}return b.headers=u,b.query=c,b.body=p,b}serializeQuery(e,t,r){const n=this.serializer,s=e.getMergedTraits();if(s.httpQueryParams){for(const[n,o]of Object.entries(t))if(!(n in r)){const t=e.getValueSchema();Object.assign(t.getMergedTraits(),{...s,httpQuery:n,httpQueryParams:void 0}),this.serializeQuery(t,o,r)}}else if(e.isListSchema()){const o=!!e.getMergedTraits().sparse,i=[];for(const r of t){n.write([e.getValueSchema(),s],r);const t=n.flush();(o||void 0!==t)&&i.push(t)}r[s.httpQuery]=i}else n.write([e,s],t),r[s.httpQuery]=n.flush()}async deserializeResponse(e,t,r){const s=this.deserializer,o=n.l1.of(e.output),i={};if(r.statusCode>=300){const n=await(0,u.P)(r.body,t);throw n.byteLength>0&&Object.assign(i,await s.read(15,n)),await this.handleError(e,t,r,i,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const e in r.headers){const t=r.headers[e];delete r.headers[e],r.headers[e.toLowerCase()]=t}const a=await this.deserializeHttpMessage(o,t,r,i);if(a.length){const e=await(0,u.P)(r.body,t);if(e.byteLength>0){const t=await s.read(o,e);for(const e of a)null!=t[e]&&(i[e]=t[e])}}else a.discardResponseBody&&await(0,u.P)(r.body,t);return i.$metadata=this.deserializeMetadata(r),i}async deserializeHttpMessage(e,t,r,s,a){let f;f=s instanceof Set?a:s;let l=!0;const h=this.deserializer,d=n.l1.of(e),w=[];for(const[e,n]of d.structIterator()){const s=n.getMemberTraits();if(s.httpPayload){l=!1;if(n.isStreaming()){const t=n.isStructSchema();f[e]=t?await this.deserializeEventStream({response:r,responseSchema:d}):(0,c.c)(r.body)}else if(r.body){const s=await(0,u.P)(r.body,t);s.byteLength>0&&(f[e]=await h.read(n,s))}}else if(s.httpHeader){const t=String(s.httpHeader).toLowerCase(),a=r.headers[t];if(null!=a)if(n.isListSchema()){const r=n.getValueSchema();let s;r.getMergedTraits().httpHeader=t,s=r.isTimestampSchema()&&4===r.getSchema()?o(a,",",2):(0,i.G)(a);const c=[];for(const e of s)c.push(await h.read(r,e.trim()));f[e]=c}else f[e]=await h.read(n,a)}else if(void 0!==s.httpPrefixHeaders){f[e]={};for(const[t,o]of Object.entries(r.headers))if(t.startsWith(s.httpPrefixHeaders)){const r=n.getValueSchema();r.getMergedTraits().httpHeader=t,f[e][t.slice(s.httpPrefixHeaders.length)]=await h.read(r,o)}}else s.httpResponseCode?f[e]=r.statusCode:w.push(e)}return w.discardResponseBody=l,w}}var d=r(123);function w(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}var p=r(124),m=r(76),b=r(113),y=r(117),g=r(122);class v extends y.f{settings;stringBuffer="";constructor(e){super(),this.settings=e}write(e,t){const r=n.l1.of(e);switch(typeof t){case"object":if(null===t)return void(this.stringBuffer="null");if(r.isTimestampSchema()){if(!(t instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${r.getName(!0)}`);switch((0,g.V)(r,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=(0,d.JV)(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1e3)}return}if(r.isBlobSchema()&&"byteLength"in t)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??b.n)(t));if(r.isListSchema()&&Array.isArray(t)){let e="";for(const n of t){this.write([r.getValueSchema(),r.getMergedTraits()],n);const t=this.flush();""!==e&&(e+=", "),e+=r.getValueSchema().isTimestampSchema()?t:w(t)}return void(this.stringBuffer=e)}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":const e=r.getMergedTraits().mediaType;let n=t;if(e){if(("application/json"===e||e.endsWith("+json"))&&(n=p.A.from(n)),r.getMergedTraits().httpHeader)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??b.n)(n.toString()))}this.stringBuffer=t;break;default:r.isIdempotencyToken()?this.stringBuffer=(0,m.v4)():this.stringBuffer=String(t)}}flush(){const e=this.stringBuffer;return this.stringBuffer="",e}}class ${codecSerializer;stringSerializer;buffer;constructor(e,t,r=new v(t)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){const r=n.l1.of(e),s=r.getMergedTraits();return s.httpHeader||s.httpLabel||s.httpQuery?(this.stringSerializer.write(r,t),void(this.buffer=this.stringSerializer.flush())):this.codecSerializer.write(r,t)}flush(){if(void 0!==this.buffer){const e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}var E=r(114),T=r(83),N=r(849);class S extends y.f{codecDeserializer;stringDeserializer;constructor(e,t){super(),this.codecDeserializer=e,this.stringDeserializer=new N.k(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){const r=n.l1.of(e),s=r.getMergedTraits(),o=this.serdeContext?.utf8Encoder??E.P;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(r,o(t));if(s.httpPayload){if(r.isBlobSchema()){const e=this.serdeContext?.utf8Decoder??T.a;return"string"==typeof t?e(t):t}if(r.isStringSchema())return"byteLength"in t?o(t):t}return this.codecDeserializer.read(r,t)}}var x=r(118),R=r(120),D=r(127);class j extends h{serializer;deserializer;codec;mixin=new x.U;constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t});const r={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new R.V(r),this.serializer=new $(this.codec.createSerializer(),r),this.deserializer=new S(this.codec.createDeserializer(),r)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,t,r){const s=await super.serializeRequest(e,t,r),o=n.l1.of(e.input);if(!s.headers["content-type"]){const e=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);e&&(s.headers["content-type"]=e)}return null==s.body&&s.headers["content-type"]===this.getDefaultContentType()&&(s.body="{}"),s}async deserializeResponse(e,t,r){const s=await super.deserializeResponse(e,t,r),o=n.l1.of(e.output);for(const[e,t]of o.structIterator())t.getMemberTraits().httpPayload&&!(e in s)&&(s[e]=null);return s}async handleError(e,t,r,s,o){const i=(0,D.cJ)(r,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);const{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,r,s,o),u=n.l1.of(a),f=s.message??s.Message??"UnknownError",l=new(this.compositeErrorRegistry.getErrorCtor(a)??Error)(f);await this.deserializeHttpMessage(a,t,r,s);const h={};for(const[e,t]of u.structIterator()){const r=t.getMergedTraits().jsonName??e;h[e]=this.codec.createDeserializer().readObject(t,s[r])}throw this.mixin.decorateServiceException(Object.assign(l,c,{$fault:u.getMergedTraits().error,message:f},h),s)}getDefaultContentType(){return"application/json"}}},848(e,t,r){function n(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}r.d(t,{$:()=>n})},849(e,t,r){r.d(t,{k:()=>E});var n=r(108),s=r(847);const o="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",i="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",a="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",c="(\\d?\\d)",u="(\\d{4})",f=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),l=new RegExp(`^${o}, ${c} ${i} ${u} ${a} GMT$`),h=new RegExp(`^${o}, ${c}-${i}-(\\d\\d) ${a} GMT$`),d=new RegExp(`^${o} ${i} ( [1-9]|\\d\\d) ${a} ${u}$`),w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function p(e,t,r){const n=Number(e);if(n<t||n>r)throw new Error(`Value ${n} out of range [${t}, ${r}]`)}var m=r(124),b=r(125),y=r(112),g=r(114),v=r(117),$=r(122);class E extends v.f{settings;constructor(e){super(),this.settings=e}read(e,t){const r=n.l1.of(e);if(r.isListSchema())return(0,s.G)(t).map(e=>this.read(r.getValueSchema(),e));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??y.E)(t);if(r.isTimestampSchema()){switch((0,$.V)(r,this.settings)){case 5:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC3339 timestamps must be strings");const t=f.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,r,n,s,o,i,a,,c,u]=t;p(n,1,12),p(s,1,31),p(o,0,23),p(i,0,59),p(a,0,60);const l=new Date(Date.UTC(Number(r),Number(n)-1,Number(s),Number(o),Number(i),Number(a),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(l.setUTCFullYear(Number(r)),"Z"!=u.toUpperCase()){const[,e,t,r]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],n="-"===e?1:-1;l.setTime(l.getTime()+n*(60*Number(t)*60*1e3+60*Number(r)*1e3))}return l})(t);case 6:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC7231 timestamps must be strings.");let t,r,n,s,o,i,a,c;if((c=l.exec(e))?[,t,r,n,s,o,i,a]=c:(c=h.exec(e))?([,t,r,n,s,o,i,a]=c,n=(Number(n)+1900).toString()):(c=d.exec(e))&&([,r,t,s,o,i,a,n]=c),n&&i){const e=Date.UTC(Number(n),w.indexOf(r),Number(t),Number(s),Number(o),Number(i),a?Math.round(1e3*parseFloat(`0.${a}`)):0);p(t,1,31),p(s,0,23),p(o,0,59),p(i,0,60);const c=new Date(e);return c.setUTCFullYear(Number(n)),c}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)})(t);case 7:return(e=>{if(null==e)return;let t=NaN;if("number"==typeof e)t=e;else if("string"==typeof e){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else"object"==typeof e&&1===e.tag&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*t))})(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}}if(r.isStringSchema()){const e=r.getMergedTraits().mediaType;let n=t;if(e){r.getMergedTraits().httpHeader&&(n=this.base64ToUtf8(n));return("application/json"===e||e.endsWith("+json"))&&(n=m.A.from(n)),n}}return r.isNumericSchema()?Number(t):r.isBigIntegerSchema()?BigInt(t):r.isBigDecimalSchema()?new b.D(t,"bigDecimal"):r.isBooleanSchema()?"true"===String(t).toLowerCase():t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??g.P)((this.serdeContext?.base64Decoder??y.E)(e))}}},847(e,t,r){r.d(t,{G:()=>n});const n=e=>{const t=e.length,r=[];let n,s=!1,o=0;for(let i=0;i<t;++i){const t=e[i];switch(t){case'"':"\\"!==n&&(s=!s);break;case",":s||(r.push(e.slice(o,i)),o=i+1)}n=t}return r.push(e.slice(o)),r.map(e=>{const t=(e=e.trim()).length;return t<2?e:('"'===e[0]&&'"'===e[t-1]&&(e=e.slice(1,t-1)),e.replace(/\\"/g,'"'))})}},850(e,t,r){r.d(t,{m:()=>n});class n{async sign(e,t,r){return e}}},842(e,t,r){r.d(t,{c:()=>m});var n=r(100),s=r(84),o=r(8),i=r(112);const a=async e=>"function"==typeof Blob&&e instanceof Blob||"Blob"===e.constructor?.name?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await e.arrayBuffer()):async function(e){const t=await function(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(2!==n.readyState)return r(new Error("Reader aborted too early"));const e=n.result??"",s=e.indexOf(","),o=s>-1?s+1:e.length;t(e.substring(o))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}(e),r=(0,i.E)(t);return new Uint8Array(r)}(e):async function(e){const t=[],r=e.getReader();let n=!1,s=0;for(;!n;){const{done:e,value:o}=await r.read();o&&(t.push(o),s+=o.length),n=e}const o=new Uint8Array(s);let i=0;for(const e of t)o.set(e,i),i+=e.length;return o}(e);var c=r(113),u=r(81),f=r(114);const l=e=>"function"==typeof ReadableStream&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),h="The stream has already been transformed.",d=e=>{if(!w(e)&&!l(e)){throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(h);return t=!0,await a(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if("base64"===e)return(0,c.n)(t);if("hex"===e)return(0,u.n)(t);if(void 0===e||"utf8"===e||"utf-8"===e)return(0,f.P)(t);if("function"==typeof TextDecoder)return new TextDecoder(e).decode(t);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(h);if(t=!0,w(e))return(e=>{if("function"!=typeof e.stream)throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return e.stream()})(e);if(l(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},w=e=>"function"==typeof Blob&&e instanceof Blob,p="The stream has already been transformed.",m=e=>{if(!(e instanceof o.Readable))try{return d(e)}catch(t){throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(p);return t=!0,await(0,n.k)(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if(void 0===e||Buffer.isEncoding(e))return(0,s.Q)(t.buffer,t.byteOffset,t.byteLength).toString(e);return new TextDecoder(e).decode(t)},transformToWebStream:()=>{if(t)throw new Error(p);if(null!==e.readableFlowing)throw new Error("The stream has been consumed by other callbacks.");if("function"!=typeof o.Readable.toWeb)throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,o.Readable.toWeb(e)}})}},845(e){e.exports={rE:"3.996.15"}}};
2
+ "use strict";exports.id=905,exports.ids=[905],exports.modules={846(e,t,r){r.d(t,{Y:()=>j});var n=r(108),s=r(110);function o(e,t,r){if(r<=0||!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");const n=e.split(t);if(1===r)return n;const s=[];let o="";for(let e=0;e<n.length;e++)""===o?o=n[e]:o+=t+n[e],(e+1)%r===0&&(s.push(o),o="");return""!==o&&s.push(o),s}var i=r(847),a=r(33),c=r(842),u=r(111),f=r(848),l=r(115);class h extends l.t{async serializeRequest(e,t,r){const o=t&&"object"==typeof t?t:{},i=this.serializer,c={},u={},l=await r.endpoint(),h=n.l1.of(e?.input),d=[],w=[];let p,m=!1;const b=new a.K({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:c,headers:u,body:void 0});if(l){this.updateServiceEndpoint(b,l),this.setHostPrefix(b,e,o);const t=(0,s.c)(e.traits);if(t.http){b.method=t.http[0];const[e,r]=t.http[1].split("?");"/"==b.path?b.path=e:b.path+=e;const n=new URLSearchParams(r??"");Object.assign(c,Object.fromEntries(n))}}for(const[e,t]of h.structIterator()){const r=t.getMergedTraits()??{},n=o[e];if(null!=n||t.isIdempotencyToken())if(r.httpPayload){if(t.isStreaming()){t.isStructSchema()?o[e]&&(p=await this.serializeEventStream({eventStream:o[e],requestSchema:h})):p=n}else i.write(t,n),p=i.flush()}else if(r.httpLabel){i.write(t,n);const r=i.flush();b.path.includes(`{${e}+}`)?b.path=b.path.replace(`{${e}+}`,r.split("/").map(f.$).join("/")):b.path.includes(`{${e}}`)&&(b.path=b.path.replace(`{${e}}`,(0,f.$)(r)))}else if(r.httpHeader)i.write(t,n),u[r.httpHeader.toLowerCase()]=String(i.flush());else if("string"==typeof r.httpPrefixHeaders)for(const[e,s]of Object.entries(n)){const n=r.httpPrefixHeaders+e;i.write([t.getValueSchema(),{httpHeader:n}],s),u[n.toLowerCase()]=i.flush()}else r.httpQuery||r.httpQueryParams?this.serializeQuery(t,n,c):(m=!0,d.push(e),w.push(t));else if(r.httpLabel&&(b.path.includes(`{${e}+}`)||b.path.includes(`{${e}}`)))throw new Error(`No value provided for input HTTP label: ${e}.`)}if(m&&o){const[e,t]=(h.getName(!0)??"#Unknown").split("#"),r=h.getSchema()[6],n=[3,e,t,h.getMergedTraits(),d,w,void 0];r?n[6]=r:n.pop(),i.write(n,o),p=i.flush()}return b.headers=u,b.query=c,b.body=p,b}serializeQuery(e,t,r){const n=this.serializer,s=e.getMergedTraits();if(s.httpQueryParams){for(const[n,o]of Object.entries(t))if(!(n in r)){const t=e.getValueSchema();Object.assign(t.getMergedTraits(),{...s,httpQuery:n,httpQueryParams:void 0}),this.serializeQuery(t,o,r)}}else if(e.isListSchema()){const o=!!e.getMergedTraits().sparse,i=[];for(const r of t){n.write([e.getValueSchema(),s],r);const t=n.flush();(o||void 0!==t)&&i.push(t)}r[s.httpQuery]=i}else n.write([e,s],t),r[s.httpQuery]=n.flush()}async deserializeResponse(e,t,r){const s=this.deserializer,o=n.l1.of(e.output),i={};if(r.statusCode>=300){const n=await(0,u.P)(r.body,t);throw n.byteLength>0&&Object.assign(i,await s.read(15,n)),await this.handleError(e,t,r,i,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const e in r.headers){const t=r.headers[e];delete r.headers[e],r.headers[e.toLowerCase()]=t}const a=await this.deserializeHttpMessage(o,t,r,i);if(a.length){const e=await(0,u.P)(r.body,t);if(e.byteLength>0){const t=await s.read(o,e);for(const e of a)null!=t[e]&&(i[e]=t[e])}}else a.discardResponseBody&&await(0,u.P)(r.body,t);return i.$metadata=this.deserializeMetadata(r),i}async deserializeHttpMessage(e,t,r,s,a){let f;f=s instanceof Set?a:s;let l=!0;const h=this.deserializer,d=n.l1.of(e),w=[];for(const[e,n]of d.structIterator()){const s=n.getMemberTraits();if(s.httpPayload){l=!1;if(n.isStreaming()){const t=n.isStructSchema();f[e]=t?await this.deserializeEventStream({response:r,responseSchema:d}):(0,c.c)(r.body)}else if(r.body){const s=await(0,u.P)(r.body,t);s.byteLength>0&&(f[e]=await h.read(n,s))}}else if(s.httpHeader){const t=String(s.httpHeader).toLowerCase(),a=r.headers[t];if(null!=a)if(n.isListSchema()){const r=n.getValueSchema();let s;r.getMergedTraits().httpHeader=t,s=r.isTimestampSchema()&&4===r.getSchema()?o(a,",",2):(0,i.G)(a);const c=[];for(const e of s)c.push(await h.read(r,e.trim()));f[e]=c}else f[e]=await h.read(n,a)}else if(void 0!==s.httpPrefixHeaders){f[e]={};for(const[t,o]of Object.entries(r.headers))if(t.startsWith(s.httpPrefixHeaders)){const r=n.getValueSchema();r.getMergedTraits().httpHeader=t,f[e][t.slice(s.httpPrefixHeaders.length)]=await h.read(r,o)}}else s.httpResponseCode?f[e]=r.statusCode:w.push(e)}return w.discardResponseBody=l,w}}var d=r(123);function w(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}var p=r(124),m=r(76),b=r(113),y=r(117),g=r(122);class v extends y.f{settings;stringBuffer="";constructor(e){super(),this.settings=e}write(e,t){const r=n.l1.of(e);switch(typeof t){case"object":if(null===t)return void(this.stringBuffer="null");if(r.isTimestampSchema()){if(!(t instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${r.getName(!0)}`);switch((0,g.V)(r,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=(0,d.JV)(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1e3)}return}if(r.isBlobSchema()&&"byteLength"in t)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??b.n)(t));if(r.isListSchema()&&Array.isArray(t)){let e="";for(const n of t){this.write([r.getValueSchema(),r.getMergedTraits()],n);const t=this.flush();""!==e&&(e+=", "),e+=r.getValueSchema().isTimestampSchema()?t:w(t)}return void(this.stringBuffer=e)}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":const e=r.getMergedTraits().mediaType;let n=t;if(e){if(("application/json"===e||e.endsWith("+json"))&&(n=p.A.from(n)),r.getMergedTraits().httpHeader)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??b.n)(n.toString()))}this.stringBuffer=t;break;default:r.isIdempotencyToken()?this.stringBuffer=(0,m.v4)():this.stringBuffer=String(t)}}flush(){const e=this.stringBuffer;return this.stringBuffer="",e}}class ${codecSerializer;stringSerializer;buffer;constructor(e,t,r=new v(t)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){const r=n.l1.of(e),s=r.getMergedTraits();return s.httpHeader||s.httpLabel||s.httpQuery?(this.stringSerializer.write(r,t),void(this.buffer=this.stringSerializer.flush())):this.codecSerializer.write(r,t)}flush(){if(void 0!==this.buffer){const e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}var E=r(114),T=r(83),N=r(849);class S extends y.f{codecDeserializer;stringDeserializer;constructor(e,t){super(),this.codecDeserializer=e,this.stringDeserializer=new N.k(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){const r=n.l1.of(e),s=r.getMergedTraits(),o=this.serdeContext?.utf8Encoder??E.P;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(r,o(t));if(s.httpPayload){if(r.isBlobSchema()){const e=this.serdeContext?.utf8Decoder??T.a;return"string"==typeof t?e(t):t}if(r.isStringSchema())return"byteLength"in t?o(t):t}return this.codecDeserializer.read(r,t)}}var x=r(118),R=r(120),D=r(127);class j extends h{serializer;deserializer;codec;mixin=new x.U;constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t});const r={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new R.V(r),this.serializer=new $(this.codec.createSerializer(),r),this.deserializer=new S(this.codec.createDeserializer(),r)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,t,r){const s=await super.serializeRequest(e,t,r),o=n.l1.of(e.input);if(!s.headers["content-type"]){const e=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);e&&(s.headers["content-type"]=e)}return null==s.body&&s.headers["content-type"]===this.getDefaultContentType()&&(s.body="{}"),s}async deserializeResponse(e,t,r){const s=await super.deserializeResponse(e,t,r),o=n.l1.of(e.output);for(const[e,t]of o.structIterator())t.getMemberTraits().httpPayload&&!(e in s)&&(s[e]=null);return s}async handleError(e,t,r,s,o){const i=(0,D.cJ)(r,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);const{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,r,s,o),u=n.l1.of(a),f=s.message??s.Message??"UnknownError",l=new(this.compositeErrorRegistry.getErrorCtor(a)??Error)(f);await this.deserializeHttpMessage(a,t,r,s);const h={};for(const[e,t]of u.structIterator()){const r=t.getMergedTraits().jsonName??e;h[e]=this.codec.createDeserializer().readObject(t,s[r])}throw this.mixin.decorateServiceException(Object.assign(l,c,{$fault:u.getMergedTraits().error,message:f},h),s)}getDefaultContentType(){return"application/json"}}},848(e,t,r){function n(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}r.d(t,{$:()=>n})},849(e,t,r){r.d(t,{k:()=>E});var n=r(108),s=r(847);const o="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",i="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",a="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",c="(\\d?\\d)",u="(\\d{4})",f=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),l=new RegExp(`^${o}, ${c} ${i} ${u} ${a} GMT$`),h=new RegExp(`^${o}, ${c}-${i}-(\\d\\d) ${a} GMT$`),d=new RegExp(`^${o} ${i} ( [1-9]|\\d\\d) ${a} ${u}$`),w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function p(e,t,r){const n=Number(e);if(n<t||n>r)throw new Error(`Value ${n} out of range [${t}, ${r}]`)}var m=r(124),b=r(125),y=r(112),g=r(114),v=r(117),$=r(122);class E extends v.f{settings;constructor(e){super(),this.settings=e}read(e,t){const r=n.l1.of(e);if(r.isListSchema())return(0,s.G)(t).map(e=>this.read(r.getValueSchema(),e));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??y.E)(t);if(r.isTimestampSchema()){switch((0,$.V)(r,this.settings)){case 5:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC3339 timestamps must be strings");const t=f.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,r,n,s,o,i,a,,c,u]=t;p(n,1,12),p(s,1,31),p(o,0,23),p(i,0,59),p(a,0,60);const l=new Date(Date.UTC(Number(r),Number(n)-1,Number(s),Number(o),Number(i),Number(a),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(l.setUTCFullYear(Number(r)),"Z"!=u.toUpperCase()){const[,e,t,r]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],n="-"===e?1:-1;l.setTime(l.getTime()+n*(60*Number(t)*60*1e3+60*Number(r)*1e3))}return l})(t);case 6:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC7231 timestamps must be strings.");let t,r,n,s,o,i,a,c;if((c=l.exec(e))?[,t,r,n,s,o,i,a]=c:(c=h.exec(e))?([,t,r,n,s,o,i,a]=c,n=(Number(n)+1900).toString()):(c=d.exec(e))&&([,r,t,s,o,i,a,n]=c),n&&i){const e=Date.UTC(Number(n),w.indexOf(r),Number(t),Number(s),Number(o),Number(i),a?Math.round(1e3*parseFloat(`0.${a}`)):0);p(t,1,31),p(s,0,23),p(o,0,59),p(i,0,60);const c=new Date(e);return c.setUTCFullYear(Number(n)),c}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)})(t);case 7:return(e=>{if(null==e)return;let t=NaN;if("number"==typeof e)t=e;else if("string"==typeof e){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else"object"==typeof e&&1===e.tag&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*t))})(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}}if(r.isStringSchema()){const e=r.getMergedTraits().mediaType;let n=t;if(e){r.getMergedTraits().httpHeader&&(n=this.base64ToUtf8(n));return("application/json"===e||e.endsWith("+json"))&&(n=m.A.from(n)),n}}return r.isNumericSchema()?Number(t):r.isBigIntegerSchema()?BigInt(t):r.isBigDecimalSchema()?new b.D(t,"bigDecimal"):r.isBooleanSchema()?"true"===String(t).toLowerCase():t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??g.P)((this.serdeContext?.base64Decoder??y.E)(e))}}},847(e,t,r){r.d(t,{G:()=>n});const n=e=>{const t=e.length,r=[];let n,s=!1,o=0;for(let i=0;i<t;++i){const t=e[i];switch(t){case'"':"\\"!==n&&(s=!s);break;case",":s||(r.push(e.slice(o,i)),o=i+1)}n=t}return r.push(e.slice(o)),r.map(e=>{const t=(e=e.trim()).length;return t<2?e:('"'===e[0]&&'"'===e[t-1]&&(e=e.slice(1,t-1)),e.replace(/\\"/g,'"'))})}},850(e,t,r){r.d(t,{m:()=>n});class n{async sign(e,t,r){return e}}},842(e,t,r){r.d(t,{c:()=>m});var n=r(100),s=r(84),o=r(8),i=r(112);const a=async e=>"function"==typeof Blob&&e instanceof Blob||"Blob"===e.constructor?.name?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await e.arrayBuffer()):async function(e){const t=await function(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(2!==n.readyState)return r(new Error("Reader aborted too early"));const e=n.result??"",s=e.indexOf(","),o=s>-1?s+1:e.length;t(e.substring(o))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}(e),r=(0,i.E)(t);return new Uint8Array(r)}(e):async function(e){const t=[],r=e.getReader();let n=!1,s=0;for(;!n;){const{done:e,value:o}=await r.read();o&&(t.push(o),s+=o.length),n=e}const o=new Uint8Array(s);let i=0;for(const e of t)o.set(e,i),i+=e.length;return o}(e);var c=r(113),u=r(81),f=r(114);const l=e=>"function"==typeof ReadableStream&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),h="The stream has already been transformed.",d=e=>{if(!w(e)&&!l(e)){throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(h);return t=!0,await a(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if("base64"===e)return(0,c.n)(t);if("hex"===e)return(0,u.n)(t);if(void 0===e||"utf8"===e||"utf-8"===e)return(0,f.P)(t);if("function"==typeof TextDecoder)return new TextDecoder(e).decode(t);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(h);if(t=!0,w(e))return(e=>{if("function"!=typeof e.stream)throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return e.stream()})(e);if(l(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},w=e=>"function"==typeof Blob&&e instanceof Blob,p="The stream has already been transformed.",m=e=>{if(!(e instanceof o.Readable))try{return d(e)}catch(t){throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(p);return t=!0,await(0,n.k)(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if(void 0===e||Buffer.isEncoding(e))return(0,s.Q)(t.buffer,t.byteOffset,t.byteLength).toString(e);return new TextDecoder(e).decode(t)},transformToWebStream:()=>{if(t)throw new Error(p);if(null!==e.readableFlowing)throw new Error("The stream has been consumed by other callbacks.");if("function"!=typeof o.Readable.toWeb)throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,o.Readable.toWeb(e)}})}},845(e){e.exports={rE:"3.996.18"}}};
3
3
  //# sourceMappingURL=905.index.js.map
package/dist/953.index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- "use strict";exports.id=953,exports.ids=[953],exports.modules={852(t,e,n){n.d(e,{getDefaultRoleAssumer:()=>Di,getDefaultRoleAssumerWithWebIdentity:()=>Ri});var i=n(80),r=n(95),s=n(57);const o={silence:!1};var a=n(133),c=n(134);const u={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var l=n(116),h=n(119);class d extends h.T{constructor(t){super(t),Object.setPrototypeOf(this,d.prototype)}}class f extends d{name="ExpiredTokenException";$fault="client";constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,f.prototype)}}class p extends d{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t}),Object.setPrototypeOf(this,p.prototype)}}class m extends d{name="PackedPolicyTooLargeException";$fault="client";constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t}),Object.setPrototypeOf(this,m.prototype)}}class g extends d{name="RegionDisabledException";$fault="client";constructor(t){super({name:"RegionDisabledException",$fault:"client",...t}),Object.setPrototypeOf(this,g.prototype)}}class w extends d{name="IDPRejectedClaimException";$fault="client";constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t}),Object.setPrototypeOf(this,w.prototype)}}class y extends d{name="InvalidIdentityTokenException";$fault="client";constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,y.prototype)}}class E extends d{name="IDPCommunicationErrorException";$fault="client";constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t}),Object.setPrototypeOf(this,E.prototype)}}const v="AssumedRoleUser",x="Credentials",b="DurationSeconds",S="Policy",I="PolicyArns",T="PackedPolicySize",$="RoleArn",A="RoleSessionName",P="SourceIdentity",N="awsQueryError",D="client",R="error",C="httpError",k="message",O="smithy.ts.sdk.synthetic.com.amazonaws.sts",j="com.amazonaws.sts",M=l.O.for(O);var _=[-3,O,"STSServiceException",0,[],[]];M.registerError(_,d);const F=l.O.for(j);var U=[-3,j,"ExpiredTokenException",{[N]:["ExpiredTokenException",400],[R]:D,[C]:400},[k],[0]];F.registerError(U,f);var L=[-3,j,"IDPCommunicationErrorException",{[N]:["IDPCommunicationError",400],[R]:D,[C]:400},[k],[0]];F.registerError(L,E);var W=[-3,j,"IDPRejectedClaimException",{[N]:["IDPRejectedClaim",403],[R]:D,[C]:403},[k],[0]];F.registerError(W,w);var z=[-3,j,"InvalidIdentityTokenException",{[N]:["InvalidIdentityToken",400],[R]:D,[C]:400},[k],[0]];F.registerError(z,y);var V=[-3,j,"MalformedPolicyDocumentException",{[N]:["MalformedPolicyDocument",400],[R]:D,[C]:400},[k],[0]];F.registerError(V,p);var Y=[-3,j,"PackedPolicyTooLargeException",{[N]:["PackedPolicyTooLarge",400],[R]:D,[C]:400},[k],[0]];F.registerError(Y,m);var q=[-3,j,"RegionDisabledException",{[N]:["RegionDisabledException",403],[R]:D,[C]:403},[k],[0]];F.registerError(q,g);const G=[M,F];var K=[0,j,"accessKeySecretType",8,0],B=[0,j,"clientTokenType",8,0],J=[3,j,v,0,["AssumedRoleId","Arn"],[0,0],2],Q=[3,j,"AssumeRoleRequest",0,[$,A,I,S,b,"Tags","TransitiveTagKeys","ExternalId","SerialNumber","TokenCode",P,"ProvidedContexts"],[0,0,()=>rt,0,1,()=>ot,64,0,0,0,0,()=>st],2],X=[3,j,"AssumeRoleResponse",0,[x,v,T,P],[[()=>tt,0],()=>J,1,0]],H=[3,j,"AssumeRoleWithWebIdentityRequest",0,[$,A,"WebIdentityToken","ProviderId",I,S,b],[0,0,[()=>B,0],0,()=>rt,0,1],3],Z=[3,j,"AssumeRoleWithWebIdentityResponse",0,[x,"SubjectFromWebIdentityToken",v,T,"Provider","Audience",P],[[()=>tt,0],0,()=>J,1,0,0,0]],tt=[3,j,x,0,["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],[0,[()=>K,0],0,4],4],et=[3,j,"PolicyDescriptorType",0,["arn"],[0]],nt=[3,j,"ProvidedContext",0,["ProviderArn","ContextAssertion"],[0,0]],it=[3,j,"Tag",0,["Key","Value"],[0,0],2],rt=[1,j,"policyDescriptorListType",0,()=>et],st=[1,j,"ProvidedContextsListType",0,()=>nt],ot=[1,j,"tagListType",0,()=>it],at=[9,j,"AssumeRole",0,()=>Q,()=>X],ct=[9,j,"AssumeRoleWithWebIdentity",0,()=>H,()=>Z];class ut extends(c.u.classBuilder().ep(u).m(function(t,e,n,i){return[(0,a.r)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").sc(at).build()){}class lt extends(c.u.classBuilder().ep(u).m(function(t,e,n,i){return[(0,a.r)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").sc(ct).build()){}const ht=t=>{if("string"==typeof t?.Arn){const e=t.Arn.split(":");if(e.length>4&&""!==e[4])return e[4]}},dt=async(t,e,n,i={})=>{const a="function"==typeof t?await t():t,c="function"==typeof e?await e():e;let u="";const l=a??c??(u=await function(t={}){return(0,s.Z)({...r.GG,default:async()=>(o.silence||console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."),"us-east-1")},{...r.zH,...t})}(i)());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${a} (credential provider clientConfig)`,`${c} (contextual client)`,`${u} (STS default: AWS_REGION, profile region, or us-east-1)`),l},ft=(t,e)=>{let n,r;return async(s,o)=>{if(r=s,!n){const{logger:i=t?.parentClientConfig?.logger,profile:s=t?.parentClientConfig?.profile,region:o,requestHandler:a=t?.parentClientConfig?.requestHandler,credentialProviderLogger:c,userAgentAppId:u=t?.parentClientConfig?.userAgentAppId}=t,l=await dt(o,t?.parentClientConfig?.region,c,{logger:i,profile:s}),h=!mt(a);n=new e({...t,userAgentAppId:u,profile:s,credentialDefaultProvider:()=>async()=>r,region:l,requestHandler:h?a:void 0,logger:i})}const{Credentials:a,AssumedRoleUser:c}=await n.send(new ut(o));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${o.RoleArn}`);const u=ht(c),l={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...u&&{accountId:u}};return(0,i.g)(l,"CREDENTIALS_STS_ASSUME_ROLE","i"),l}},pt=(t,e)=>{let n;return async r=>{if(!n){const{logger:i=t?.parentClientConfig?.logger,profile:r=t?.parentClientConfig?.profile,region:s,requestHandler:o=t?.parentClientConfig?.requestHandler,credentialProviderLogger:a,userAgentAppId:c=t?.parentClientConfig?.userAgentAppId}=t,u=await dt(s,t?.parentClientConfig?.region,a,{logger:i,profile:r}),l=!mt(o);n=new e({...t,userAgentAppId:c,profile:r,region:u,requestHandler:l?o:void 0,logger:i})}const{Credentials:s,AssumedRoleUser:o}=await n.send(new lt(r));if(!s||!s.AccessKeyId||!s.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);const a=ht(o),c={accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,sessionToken:s.SessionToken,expiration:s.Expiration,...s.CredentialScope&&{credentialScope:s.CredentialScope},...a&&{accountId:a}};return a&&(0,i.g)(c,"RESOLVED_ACCOUNT_ID","T"),(0,i.g)(c,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),c}},mt=t=>"h2"===t?.metadata?.handlerProtocol;var gt=n(32),wt=n(34),yt=n(35),Et=n(36),vt=n(38),xt=n(44),bt=n(46),St=n(45),It=n(49),Tt=n(50),$t=n(53),At=n(54),Pt=n(71),Nt=n(74),Dt=n(77),Rt=n(79),Ct=n(47),kt=n(55);const Ot=async(t,e,n)=>({operation:(0,Ct.u)(e).operation,region:await(0,kt.t)(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const jt=t=>{const e=[];if("AssumeRoleWithWebIdentity"===t.operation)e.push({schemeId:"smithy.api#noAuth"});else e.push(function(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(t,e)=>({signingProperties:{config:t,context:e}})}}(t));return e},Mt=t=>{const e=(n=t,Object.assign(n,{stsClientCtor:Pi}));var n;const i=(0,Rt.h)(e);return Object.assign(i,{authSchemePreference:(0,kt.t)(t.authSchemePreference??[])})};var _t=n(845),Ft=n(87),Ut=n(88),Lt=n(106),Wt=n(90),zt=n(94),Vt=n(96),Yt=n(97),qt=n(850),Gt=n(98),Kt=n(99),Bt=n(100),Jt=n(102),Qt=n(101),Xt=n(103),Ht=n(105),Zt=n(43),te=n(107),ee=n(111),ne=n(109),ie=n(108),re=n(118);const se=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",oe=new RegExp("^"+("["+se+"]["+(se+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*")+"$");function ae(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n}const ce=function(t){const e=oe.exec(t);return!(null==e)};const ue=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],le=["__proto__","constructor","prototype"],he=t=>ue.includes(t)?"__"+t:t,de={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:he};function fe(t,e){if("string"!=typeof t)return;const n=t.toLowerCase();if(ue.some(t=>n===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);if(le.some(t=>n===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`)}function pe(t){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??100),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:pe(!0)}const me=function(t){const e=Object.assign({},de,t),n=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(const{value:t,name:e}of n)t&&fe(t,e);return null===e.onDangerousProperty&&(e.onDangerousProperty=he),e.processEntities=pe(e.processEntities),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(t=>"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t)),e};let ge;ge="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class we{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][ge]={startIndex:e})}static getMetaDataSymbol(){return ge}}class ye{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,e){const n=Object.create(null);let i=0;if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let r=1,s=!1,o=!1,a="";for(;e<t.length;e++)if("<"!==t[e]||o)if(">"===t[e]){if(o?"-"===t[e-1]&&"-"===t[e-2]&&(o=!1,r--):r--,0===r)break}else"["===t[e]?s=!0:a+=t[e];else{if(s&&ve(t,"!ENTITY",e)){let r,s;if(e+=7,[r,s,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===s.indexOf("&")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&i>=this.options.maxEntityCount)throw new Error(`Entity count (${i+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);const t=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n[r]={regx:RegExp(`&${t};`,"g"),val:s},i++}}else if(s&&ve(t,"!ELEMENT",e)){e+=8;const{index:n}=this.readElementExp(t,e+1);e=n}else if(s&&ve(t,"!ATTLIST",e))e+=8;else if(s&&ve(t,"!NOTATION",e)){e+=9;const{index:n}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=n}else{if(!ve(t,"!--",e))throw new Error("Invalid DOCTYPE");o=!0}r++,a=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}readEntityExp(t,e){const n=e=Ee(t,e);for(;e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)e++;let i=t.substring(n,e);if(xe(i),e=Ee(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}let r="";if([e,r]=this.readIdentifierVal(t,e,"entity"),!1!==this.options.enabled&&null!=this.options.maxEntitySize&&r.length>this.options.maxEntitySize)throw new Error(`Entity "${i}" size (${r.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[i,r,--e]}readNotationExp(t,e){const n=e=Ee(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let i=t.substring(n,e);!this.suppressValidationErr&&xe(i),e=Ee(t,e);const r=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==r&&"PUBLIC"!==r)throw new Error(`Expected SYSTEM or PUBLIC, found "${r}"`);e+=r.length,e=Ee(t,e);let s=null,o=null;if("PUBLIC"===r)[e,s]=this.readIdentifierVal(t,e,"publicIdentifier"),'"'!==t[e=Ee(t,e)]&&"'"!==t[e]||([e,o]=this.readIdentifierVal(t,e,"systemIdentifier"));else if("SYSTEM"===r&&([e,o]=this.readIdentifierVal(t,e,"systemIdentifier"),!this.suppressValidationErr&&!o))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:i,publicIdentifier:s,systemIdentifier:o,index:--e}}readIdentifierVal(t,e,n){let i="";const r=t[e];if('"'!==r&&"'"!==r)throw new Error(`Expected quoted string, found "${r}"`);const s=++e;for(;e<t.length&&t[e]!==r;)e++;if(i=t.substring(s,e),t[e]!==r)throw new Error(`Unterminated ${n} value`);return[++e,i]}readElementExp(t,e){const n=e=Ee(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let i=t.substring(n,e);if(!this.suppressValidationErr&&!ce(i))throw new Error(`Invalid element name: "${i}"`);let r="";if("E"===t[e=Ee(t,e)]&&ve(t,"MPTY",e))e+=4;else if("A"===t[e]&&ve(t,"NY",e))e+=2;else if("("===t[e]){const n=++e;for(;e<t.length&&")"!==t[e];)e++;if(r=t.substring(n,e),")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[e]}"`);return{elementName:i,contentModel:r.trim(),index:e}}readAttlistExp(t,e){let n=e=Ee(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let i=t.substring(n,e);for(xe(i),n=e=Ee(t,e);e<t.length&&!/\s/.test(t[e]);)e++;let r=t.substring(n,e);if(!xe(r))throw new Error(`Invalid attribute name: "${r}"`);e=Ee(t,e);let s="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(s="NOTATION","("!==t[e=Ee(t,e+=8)])throw new Error(`Expected '(', found "${t[e]}"`);e++;let n=[];for(;e<t.length&&")"!==t[e];){const i=e;for(;e<t.length&&"|"!==t[e]&&")"!==t[e];)e++;let r=t.substring(i,e);if(r=r.trim(),!xe(r))throw new Error(`Invalid notation name: "${r}"`);n.push(r),"|"===t[e]&&(e++,e=Ee(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,s+=" ("+n.join("|")+")"}else{const n=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;s+=t.substring(n,e);const i=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!i.includes(s.toUpperCase()))throw new Error(`Invalid attribute type: "${s}"`)}e=Ee(t,e);let o="";return"#REQUIRED"===t.substring(e,e+8).toUpperCase()?(o="#REQUIRED",e+=8):"#IMPLIED"===t.substring(e,e+7).toUpperCase()?(o="#IMPLIED",e+=7):[e,o]=this.readIdentifierVal(t,e,"ATTLIST"),{elementName:i,attributeName:r,attributeType:s,defaultValue:o,index:e}}}const Ee=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function ve(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function xe(t){if(ce(t))return t;throw new Error(`Invalid entity name ${t}`)}const be=/^[-+]?0x[a-fA-F0-9]+$/,Se=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Ie={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function Te(t,e={}){if(e=Object.assign({},Ie,e),!t||"string"!=typeof t)return t;let n=t.trim();if(0===n.length)return t;if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===n)return 0;if(e.hex&&be.test(n))return function(t,e){if(parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n,16);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return function(t,e,n){if(!n.eNotation)return t;const i=e.match($e);if(i){let r=i[1]||"";const s=-1===i[3].indexOf("e")?"E":"e",o=i[2],a=r?t[o.length+1]===s:t[o.length]===s;return o.length>1&&a?t:(1!==o.length||!i[3].startsWith(`.${s}`)&&i[3][0]!==s)&&o.length>0?n.leadingZeros&&!a?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const i=Se.exec(n);if(i){const r=i[1]||"",s=i[2];let o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),t;return t}(i[3]);const a=r?"."===t[s.length+1]:"."===t[s.length];if(!e.leadingZeros&&(s.length>1||1===s.length&&!a))return t;{const i=Number(n),a=String(i);if(0===i)return i;if(-1!==a.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf("."))return"0"===a||a===o||a===`${r}${o}`?i:t;let c=s?o:n;return s?c===a||r+c===a?i:t:c===a||c===r+a?i:t}}return t}}return function(t,e,n){const i=e===1/0;switch(n.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";default:return t}}(t,Number(n),e)}const $e=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;const Ae=new Set(["push","pop","reset","updateCurrent","restore"]);class Pe{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[]}push(t,e=null,n=null){if(this.path.length>0){this.path[this.path.length-1].values=void 0}const i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);const r=this.siblingStacks[i],s=n?`${n}:${t}`:t,o=r.get(s)||0;let a=0;for(const t of r.values())a+=t;r.set(s,o+1);const c={tag:t,position:a,counter:o};null!=n&&(c.namespace=n),null!=e&&(c.values=e),this.path.push(c)}pop(){if(0===this.path.length)return;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0===this.path.length)return;const e=this.path[this.path.length-1];return e.values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const n=t||this.separator;return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(n)}toArray(){return this.path.map(t=>t.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++){const n=t[e],i=this.path[e],r=e===this.path.length-1;if(!this._matchSegment(n,i,r))return!1}return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,n=t.length-1;for(;n>=0&&e>=0;){const i=t[n];if("deep-wildcard"===i.type){if(n--,n<0)return!0;const i=t[n];let r=!1;for(let t=e;t>=0;t--){const s=t===this.path.length-1;if(this._matchSegment(i,this.path[t],s)){e=t-1,n--,r=!0;break}}if(!r)return!1}else{const t=e===this.path.length-1;if(!this._matchSegment(i,this.path[e],t))return!1;e--,n--}}return n<0}_matchSegment(t,e,n){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!n)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue){const n=e.values[t.attrName];if(String(n)!==String(t.attrValue))return!1}}if(void 0!==t.position){if(!n)return!1;const i=e.counter??0;if("first"===t.position&&0!==i)return!1;if("odd"===t.position&&i%2!=1)return!1;if("even"===t.position&&i%2!=0)return!1;if("nth"===t.position&&i!==t.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return new Proxy(this,{get(t,e,n){if(Ae.has(e))return()=>{throw new TypeError(`Cannot call '${e}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};const i=Reflect.get(t,e,n);return"path"===e||"siblingStacks"===e?Object.freeze(Array.isArray(i)?i.map(t=>t instanceof Map?Object.freeze(new Map(t)):Object.freeze({...t})):i):"function"==typeof i?i.bind(t):i},set(t,e){throw new TypeError(`Cannot set property '${String(e)}' on a read-only Matcher.`)},deleteProperty(t,e){throw new TypeError(`Cannot delete property '${String(e)}' from a read-only Matcher.`)}})}}class Ne{constructor(t,e={}){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let n=0,i="";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(i.trim()&&(e.push(this._parseSegment(i.trim())),i=""),e.push({type:"deep-wildcard"}),n+=2):(i.trim()&&e.push(this._parseSegment(i.trim())),i="",n++):(i+=t[n],n++);return i.trim()&&e.push(this._parseSegment(i.trim())),e}_parseSegment(t){const e={type:"tag"};let n=null,i=t;const r=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(r&&(i=r[1]+r[3],r[2])){const t=r[2].slice(1,-1);t&&(n=t)}let s,o,a=i;if(i.includes("::")){const e=i.indexOf("::");if(s=i.substring(0,e).trim(),a=i.substring(e+2).trim(),!s)throw new Error(`Invalid namespace in pattern: ${t}`)}let c=null;if(a.includes(":")){const t=a.lastIndexOf(":"),e=a.substring(0,t).trim(),n=a.substring(t+1).trim();["first","last","odd","even"].includes(n)||/^nth\(\d+\)$/.test(n)?(o=e,c=n):o=a}else o=a;if(!o)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=o,s&&(e.namespace=s),n)if(n.includes("=")){const t=n.indexOf("=");e.attrName=n.substring(0,t).trim(),e.attrValue=n.substring(t+1).trim()}else e.attrName=n.trim();if(c){const t=c.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=c}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}function De(t,e){if(!t)return{};const n=e.attributesGroupName?t[e.attributesGroupName]:t;if(!n)return{};const i={};for(const t in n)if(t.startsWith(e.attributeNamePrefix)){i[t.substring(e.attributeNamePrefix.length)]=n[t]}else i[t]=n[t];return i}function Re(t){if(!t||"string"!=typeof t)return;const e=t.indexOf(":");if(-1!==e&&e>0){const n=t.substring(0,e);if("xmlns"!==n)return n}}class Ce{constructor(t){var e;if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>Ke(e,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>Ke(e,16,"&#x")}},this.addExternalEntities=ke,this.parseXml=Fe,this.parseTextData=Oe,this.resolveNameSpace=je,this.buildAttributesMap=_e,this.isItStopNode=ze,this.replaceEntitiesValue=Le,this.readStopNodeData=qe,this.saveTextToParentTag=We,this.addChild=Ue,this.ignoreAttributesFn="function"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new Pe,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];"string"==typeof e?this.stopNodeExpressions.push(new Ne(e)):e instanceof Ne&&this.stopNodeExpressions.push(e)}}}}function ke(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n],r=i.replace(/[.\-+*:]/g,"\\.");this.lastEntities[i]={regex:new RegExp("&"+r+";","g"),val:t[i]}}}function Oe(t,e,n,i,r,s,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t,e,n));const i=this.options.jPath?n.toString():n,a=this.options.tagValueProcessor(e,t,i,r,s);if(null==a)return t;if(typeof a!=typeof t||a!==t)return a;if(this.options.trimValues)return Ge(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?Ge(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function je(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const Me=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function _e(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const i=ae(t,Me),r=i.length,s={},o={};for(let t=0;t<r;t++){const e=this.resolveNameSpace(i[t][1]),r=i[t][4];if(e.length&&void 0!==r){let t=r;this.options.trimValues&&(t=t.trim()),t=this.replaceEntitiesValue(t,n,this.readonlyMatcher),o[e]=t}}Object.keys(o).length>0&&"object"==typeof e&&e.updateCurrent&&e.updateCurrent(o);for(let t=0;t<r;t++){const r=this.resolveNameSpace(i[t][1]),o=this.options.jPath?e.toString():this.readonlyMatcher;if(this.ignoreAttributesFn(r,o))continue;let a=i[t][4],c=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c=Je(c,this.options),void 0!==a){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a,n,this.readonlyMatcher);const t=this.options.jPath?e.toString():this.readonlyMatcher,i=this.options.attributeValueProcessor(r,a,t);s[c]=null==i?a:typeof i!=typeof a||i!==a?i:Ge(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[c]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=s,t}return s}}const Fe=function(t){t=t.replace(/\r\n?/g,"\n");const e=new we("!xml");let n=e,i="";this.matcher.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const r=new ye(this.options.processEntities);for(let s=0;s<t.length;s++){if("<"===t[s])if("/"===t[s+1]){const e=Ve(t,">",s,"Closing Tag is not closed.");let r=t.substring(s+2,e).trim();if(this.options.removeNSPrefix){const t=r.indexOf(":");-1!==t&&(r=r.substr(t+1))}r=Be(this.options.transformTagName,r,"",this.options).tagName,n&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher));const o=this.matcher.getCurrentTag();if(r&&-1!==this.options.unpairedTags.indexOf(r))throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);o&&-1!==this.options.unpairedTags.indexOf(o)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),i="",s=e}else if("?"===t[s+1]){let e=Ye(t,s,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,this.readonlyMatcher),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new we(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,this.matcher,e.tagName)),this.addChild(n,t,this.readonlyMatcher,s)}s=e.closeIndex+1}else if("!--"===t.substr(s+1,3)){const e=Ve(t,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const r=t.substring(s+4,e-2);i=this.saveTextToParentTag(i,n,this.readonlyMatcher),n.add(this.options.commentPropName,[{[this.options.textNodeName]:r}])}s=e}else if("!D"===t.substr(s+1,2)){const e=r.readDocType(t,s);this.docTypeEntities=e.entities,s=e.i}else if("!["===t.substr(s+1,2)){const e=Ve(t,"]]>",s,"CDATA is not closed.")-2,r=t.substring(s+9,e);i=this.saveTextToParentTag(i,n,this.readonlyMatcher);let o=this.parseTextData(r,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);null==o&&(o=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:r}]):n.add(this.options.textNodeName,o),s=e+2}else{let r=Ye(t,s,this.options.removeNSPrefix);if(!r){const e=t.substring(Math.max(0,s-50),Math.min(t.length,s+50));throw new Error(`readTagExp returned undefined at position ${s}. Context: "${e}"`)}let o=r.tagName;const a=r.rawTagName;let c=r.tagExp,u=r.attrExpPresent,l=r.closeIndex;if(({tagName:o,tagExp:c}=Be(this.options.transformTagName,o,c,this.options)),this.options.strictReservedNames&&(o===this.options.commentPropName||o===this.options.cdataPropName||o===this.options.textNodeName||o===this.options.attributesGroupName))throw new Error(`Invalid tag name: ${o}`);n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher,!1));const h=n;h&&-1!==this.options.unpairedTags.indexOf(h.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let d=!1;c.length>0&&c.lastIndexOf("/")===c.length-1&&(d=!0,"/"===o[o.length-1]?(o=o.substr(0,o.length-1),c=o):c=c.substr(0,c.length-1),u=o!==c);let f,p=null,m={};f=Re(a),o!==e.tagname&&this.matcher.push(o,{},f),o!==c&&u&&(p=this.buildAttributesMap(c,this.matcher,o),p&&(m=De(p,this.options))),o!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));const g=s;if(this.isCurrentNodeStopNode){let e="";if(d)s=r.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(o))s=r.closeIndex;else{const n=this.readStopNodeData(t,a,l+1);if(!n)throw new Error(`Unexpected end of ${a}`);s=n.i,e=n.tagContent}const i=new we(o);p&&(i[":@"]=p),i.add(this.options.textNodeName,e),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,i,this.readonlyMatcher,g)}else{if(d){({tagName:o,tagExp:c}=Be(this.options.transformTagName,o,c,this.options));const t=new we(o);p&&(t[":@"]=p),this.addChild(n,t,this.readonlyMatcher,g),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(-1!==this.options.unpairedTags.indexOf(o)){const t=new we(o);p&&(t[":@"]=p),this.addChild(n,t,this.readonlyMatcher,g),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=r.closeIndex;continue}{const t=new we(o);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),p&&(t[":@"]=p),this.addChild(n,t,this.readonlyMatcher,g),n=t}}i="",s=l}}else i+=t[s]}return e.child};function Ue(t,e,n,i){this.options.captureMetaData||(i=void 0);const r=this.options.jPath?n.toString():n,s=this.options.updateTag(e.tagname,r,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,i)):t.addChild(e,i))}function Le(t,e,n){const i=this.options.processEntities;if(!i||!i.enabled)return t;if(i.allowedTags){const r=this.options.jPath?n.toString():n;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,r)))return t}if(i.tagFilter){const r=this.options.jPath?n.toString():n;if(!i.tagFilter(e,r))return t}for(const e of Object.keys(this.docTypeEntities)){const n=this.docTypeEntities[e],r=t.match(n.regx);if(r){if(this.entityExpansionCount+=r.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);const e=t.length;if(t=t.replace(n.regx,n.val),i.maxExpandedLength&&(this.currentExpandedLength+=t.length-e,this.currentExpandedLength>i.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${i.maxExpandedLength}`)}}for(const e of Object.keys(this.lastEntities)){const n=this.lastEntities[e],r=t.match(n.regex);if(r&&(this.entityExpansionCount+=r.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);t=t.replace(n.regex,n.val)}if(-1===t.indexOf("&"))return t;if(this.options.htmlEntities)for(const e of Object.keys(this.htmlEntities)){const n=this.htmlEntities[e],r=t.match(n.regex);if(r&&(this.entityExpansionCount+=r.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);t=t.replace(n.regex,n.val)}return t=t.replace(this.ampEntity.regex,this.ampEntity.val)}function We(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function ze(t,e){if(!t||0===t.length)return!1;for(let n=0;n<t.length;n++)if(e.matches(t[n]))return!0;return!1}function Ve(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function Ye(t,e,n,i=">"){const r=function(t,e,n=">"){let i,r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,i);if(!r)return;let s=r.data;const o=r.index,a=s.search(/\s/);let c=s,u=!0;-1!==a&&(c=s.substring(0,a),s=s.substring(a+1).trimStart());const l=c;if(n){const t=c.indexOf(":");-1!==t&&(c=c.substr(t+1),u=c!==r.data.substr(t+1))}return{tagName:c,tagExp:s,closeIndex:o,attrExpPresent:u,rawTagName:l}}function qe(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const s=Ve(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:s};n=s}else if("?"===t[n+1]){n=Ve(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=Ve(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=Ve(t,"]]>",n,"StopNode is not closed.")-2}else{const i=Ye(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex}}}function Ge(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&Te(t,n)}return function(t){return void 0!==t}(t)?t:""}function Ke(t,e,n){const i=Number.parseInt(t,e);return i>=0&&i<=1114111?String.fromCodePoint(i):n+t+";"}function Be(t,e,n,i){if(t){const i=t(e);n===e&&(n=i),e=i}return{tagName:e=Je(e,i),tagExp:n}}function Je(t,e){if(le.includes(t))throw new Error(`[SECURITY] Invalid name: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);return ue.includes(t)?e.onDangerousProperty(t):t}const Qe=we.getMetaDataSymbol();function Xe(t,e){if(!t||"object"!=typeof t)return{};if(!e)return t;const n={};for(const i in t)if(i.startsWith(e)){n[i.substring(e.length)]=t[i]}else n[i]=t[i];return n}function He(t,e,n,i){return Ze(t,e,n,i)}function Ze(t,e,n,i){let r;const s={};for(let o=0;o<t.length;o++){const a=t[o],c=tn(a);if(void 0!==c&&c!==e.textNodeName){const t=Xe(a[":@"]||{},e.attributeNamePrefix);n.push(c,t)}if(c===e.textNodeName)void 0===r?r=a[c]:r+=""+a[c];else{if(void 0===c)continue;if(a[c]){let t=Ze(a[c],e,n,i);const r=nn(t,e);if(a[":@"]?en(t,a[":@"],i,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==a[Qe]&&"object"==typeof t&&null!==t&&(t[Qe]=a[Qe]),void 0!==s[c]&&Object.prototype.hasOwnProperty.call(s,c))Array.isArray(s[c])||(s[c]=[s[c]]),s[c].push(t);else{const n=e.jPath?i.toString():i;e.isArray(c,n,r)?s[c]=[t]:s[c]=t}void 0!==c&&c!==e.textNodeName&&n.pop()}}}return"string"==typeof r?r.length>0&&(s[e.textNodeName]=r):void 0!==r&&(s[e.textNodeName]=r),s}function tn(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function en(t,e,n,i){if(e){const r=Object.keys(e),s=r.length;for(let o=0;o<s;o++){const s=r[o],a=s.startsWith(i.attributeNamePrefix)?s.substring(i.attributeNamePrefix.length):s,c=i.jPath?n.toString()+"."+a:n;i.isArray(s,c,!0,!0)?t[s]=[e[s]]:t[s]=e[s]}}}function nn(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}const rn={allowBooleanAttributes:!1,unpairedTags:[]};function sn(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function on(t,e){const n=e;for(;e<t.length;e++)if("?"==t[e]||" "==t[e]){const i=t.substr(n,e-n);if(e>5&&"xml"===i)return dn("InvalidXml","XML declaration allowed only at the start of the document.",mn(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}continue}return e}function an(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}function cn(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if('"'===t[e]||"'"===t[e])""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const un=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function ln(t,e){const n=ae(t,un),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return dn("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",gn(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return dn("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",gn(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return dn("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",gn(n[t]));const r=n[t][2];if(!fn(r))return dn("InvalidAttr","Attribute '"+r+"' is an invalid name.",gn(n[t]));if(Object.prototype.hasOwnProperty.call(i,r))return dn("InvalidAttr","Attribute '"+r+"' is repeated.",gn(n[t]));i[r]=1}return!0}function hn(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function dn(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function fn(t){return ce(t)}function pn(t){return ce(t)}function mn(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function gn(t){return t.startIndex+t[1].length}const wn=new class{constructor(t){this.externalEntities={},this.options=me(t)}parse(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});const n=function(t,e){e=Object.assign({},rn,e);const n=[];let i=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let s=0;s<t.length;s++)if("<"===t[s]&&"?"===t[s+1]){if(s+=2,s=on(t,s),s.err)return s}else{if("<"!==t[s]){if(sn(t[s]))continue;return dn("InvalidChar","char '"+t[s]+"' is not expected.",mn(t,s))}{let o=s;if(s++,"!"===t[s]){s=an(t,s);continue}{let a=!1;"/"===t[s]&&(a=!0,s++);let c="";for(;s<t.length&&">"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)c+=t[s];if(c=c.trim(),"/"===c[c.length-1]&&(c=c.substring(0,c.length-1),s--),!pn(c)){let e;return e=0===c.trim().length?"Invalid space after '<'.":"Tag '"+c+"' is an invalid name.",dn("InvalidTag",e,mn(t,s))}const u=cn(t,s);if(!1===u)return dn("InvalidAttr","Attributes for '"+c+"' have open quote.",mn(t,s));let l=u.value;if(s=u.index,"/"===l[l.length-1]){const n=s-l.length;l=l.substring(0,l.length-1);const r=ln(l,e);if(!0!==r)return dn(r.err.code,r.err.msg,mn(t,n+r.err.line));i=!0}else if(a){if(!u.tagClosed)return dn("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",mn(t,s));if(l.trim().length>0)return dn("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",mn(t,o));if(0===n.length)return dn("InvalidTag","Closing tag '"+c+"' has not been opened.",mn(t,o));{const e=n.pop();if(c!==e.tagName){let n=mn(t,e.tagStartPos);return dn("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+c+"'.",mn(t,o))}0==n.length&&(r=!0)}}else{const a=ln(l,e);if(!0!==a)return dn(a.err.code,a.err.msg,mn(t,s-l.length+a.err.line));if(!0===r)return dn("InvalidXml","Multiple possible root nodes found.",mn(t,s));-1!==e.unpairedTags.indexOf(c)||n.push({tagName:c,tagStartPos:o}),i=!0}for(s++;s<t.length;s++)if("<"===t[s]){if("!"===t[s+1]){s++,s=an(t,s);continue}if("?"!==t[s+1])break;if(s=on(t,++s),s.err)return s}else if("&"===t[s]){const e=hn(t,s);if(-1==e)return dn("InvalidChar","char '&' is not expected.",mn(t,s));s=e}else if(!0===r&&!sn(t[s]))return dn("InvalidXml","Extra text at the end",mn(t,s));"<"===t[s]&&s--}}}return i?1==n.length?dn("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",mn(t,n[0].tagStartPos)):!(n.length>0)||dn("InvalidXml","Invalid '"+JSON.stringify(n.map(t=>t.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):dn("InvalidXml","Start tag expected.",1)}(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Ce(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:He(i,this.options,n.matcher,n.readonlyMatcher)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return we.getMetaDataSymbol()}}({attributeNamePrefix:"",processEntities:{enabled:!0,maxTotalExpansions:1/0},htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(t,e)=>""===e.trim()&&e.includes("\n")?"":void 0,maxNestedTags:1/0});wn.addEntity("#xD","\r"),wn.addEntity("#10","\n");var yn=n(849);const En=t=>{const e="#text";for(const n in t)t.hasOwnProperty(n)&&void 0!==t[n][e]?t[n]=t[n][e]:"object"==typeof t[n]&&null!==t[n]&&(t[n]=En(t[n]));return t};var vn=n(114),xn=n(121),bn=n(126);class Sn extends xn.B{settings;stringDeserializer;constructor(t){super(),this.settings=t,this.stringDeserializer=new yn.k(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,e,n){const i=ie.l1.of(t),r=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(r).find(t=>!!t.getMemberTraits().eventPayload)){const t={},n=Object.keys(r)[0];return r[n].isBlobSchema()?t[n]=e:t[n]=this.read(r[n],e),t}const s=(this.serdeContext?.utf8Encoder??vn.P)(e),o=this.parseXml(s);return this.readSchema(t,n?o[n]:o)}readSchema(t,e){const n=ie.l1.of(t);if(n.isUnitSchema())return;const i=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(e))return this.readSchema(n,[e]);if(null==e)return e;if("object"==typeof e){const t=!!i.xmlFlattened;if(n.isListSchema()){const i=n.getValueSchema(),r=[],s=i.getMergedTraits().xmlName??"member",o=t?e:(e[0]??e)[s];if(null==o)return r;const a=Array.isArray(o)?o:[o];for(const t of a)r.push(this.readSchema(i,t));return r}const r={};if(n.isMapSchema()){const i=n.getKeySchema(),s=n.getValueSchema();let o;o=t?Array.isArray(e)?e:[e]:Array.isArray(e.entry)?e.entry:[e.entry];const a=i.getMergedTraits().xmlName??"key",c=s.getMergedTraits().xmlName??"value";for(const t of o){const e=t[a],n=t[c];r[e]=this.readSchema(s,n)}return r}if(n.isStructSchema()){const t=n.isUnionSchema();let i;t&&(i=new bn.F(e,r));for(const[s,o]of n.structIterator()){const n=o.getMergedTraits(),a=n.httpPayload?n.xmlName??o.getName():o.getMemberTraits().xmlName??s;t&&i.mark(a),null!=e[a]&&(r[s]=this.readSchema(o,e[a]))}return t&&i.writeUnknown(),r}if(n.isDocumentSchema())return e;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}return n.isListSchema()?[]:n.isMapSchema()||n.isStructSchema()?{}:this.stringDeserializer.read(n,e)}parseXml(t){if(t.length){let n;try{e=t,n=wn.parse(e,!0)}catch(e){throw e&&"object"==typeof e&&Object.defineProperty(e,"$responseBodyText",{value:t}),e}const i="#text",r=Object.keys(n)[0],s=n[r];return s[i]&&(s[r]=s[i],delete s[i]),En(s)}var e;return{}}}var In=n(122),Tn=n(848),$n=n(76),An=n(125),Pn=n(123),Nn=n(113);class Dn extends xn.B{settings;buffer;constructor(t){super(),this.settings=t}write(t,e,n=""){void 0===this.buffer&&(this.buffer="");const i=ie.l1.of(t);if(n&&!n.endsWith(".")&&(n+="."),i.isBlobSchema())("string"==typeof e||e instanceof Uint8Array)&&(this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??Nn.n)(e)));else if(i.isBooleanSchema()||i.isNumericSchema()||i.isStringSchema())null!=e?(this.writeKey(n),this.writeValue(String(e))):i.isIdempotencyToken()&&(this.writeKey(n),this.writeValue((0,$n.v4)()));else if(i.isBigIntegerSchema())null!=e&&(this.writeKey(n),this.writeValue(String(e)));else if(i.isBigDecimalSchema())null!=e&&(this.writeKey(n),this.writeValue(e instanceof An.D?e.string:String(e)));else if(i.isTimestampSchema()){if(e instanceof Date){this.writeKey(n);switch((0,In.V)(i,this.settings)){case 5:this.writeValue(e.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue((0,Pn.JV)(e));break;case 7:this.writeValue(String(e.getTime()/1e3))}}}else if(i.isDocumentSchema())Array.isArray(e)?this.write(79,e,n):e instanceof Date?this.write(4,e,n):e instanceof Uint8Array?this.write(21,e,n):e&&"object"==typeof e?this.write(143,e,n):(this.writeKey(n),this.writeValue(String(e)));else if(i.isListSchema()){if(Array.isArray(e))if(0===e.length)this.settings.serializeEmptyLists&&(this.writeKey(n),this.writeValue(""));else{const t=i.getValueSchema(),r=this.settings.flattenLists||i.getMergedTraits().xmlFlattened;let s=1;for(const i of e){if(null==i)continue;const e=t.getMergedTraits(),o=this.getKey("member",e.xmlName,e.ec2QueryName),a=r?`${n}${s}`:`${n}${o}.${s}`;this.write(t,i,a),++s}}}else if(i.isMapSchema()){if(e&&"object"==typeof e){const t=i.getKeySchema(),r=i.getValueSchema(),s=i.getMergedTraits().xmlFlattened;let o=1;for(const[i,a]of Object.entries(e)){if(null==a)continue;const e=t.getMergedTraits(),c=this.getKey("key",e.xmlName,e.ec2QueryName),u=s?`${n}${o}.${c}`:`${n}entry.${o}.${c}`,l=r.getMergedTraits(),h=this.getKey("value",l.xmlName,l.ec2QueryName),d=s?`${n}${o}.${h}`:`${n}entry.${o}.${h}`;this.write(t,i,u),this.write(r,a,d),++o}}}else if(i.isStructSchema()){if(e&&"object"==typeof e){let t=!1;for(const[r,s]of i.structIterator()){if(null==e[r]&&!s.isIdempotencyToken())continue;const i=s.getMergedTraits(),o=`${n}${this.getKey(r,i.xmlName,i.ec2QueryName,"struct")}`;this.write(s,e[r],o),t=!0}if(!t&&i.isUnionSchema()){const{$unknown:t}=e;if(Array.isArray(t)){const[e,i]=t,r=`${n}${e}`;this.write(15,i,r)}}}}else if(!i.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${i.getName(!0)}`)}flush(){if(void 0===this.buffer)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const t=this.buffer;return delete this.buffer,t}getKey(t,e,n,i){const{ec2:r,capitalizeKeys:s}=this.settings;if(r&&n)return n;const o=e??t;return s&&"struct"===i?o[0].toUpperCase()+o.slice(1):o}writeKey(t){t.endsWith(".")&&(t=t.slice(0,t.length-1)),this.buffer+=`&${(0,Tn.$)(t)}=`}writeValue(t){this.buffer+=(0,Tn.$)(t)}}class Rn extends te.M{options;serializer;deserializer;mixin=new re.U;constructor(t){super({defaultNamespace:t.defaultNamespace,errorTypeRegistries:t.errorTypeRegistries}),this.options=t;const e={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new Dn(e),this.deserializer=new Sn(e)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,e,n){const i=await super.serializeRequest(t,e,n);i.path.endsWith("/")||(i.path+="/"),Object.assign(i.headers,{"content-type":"application/x-www-form-urlencoded"}),"unit"!==(0,ne.L)(t.input)&&i.body||(i.body="");const r=t.name.split("#")[1]??t.name;return i.body=`Action=${r}&Version=${this.options.version}`+i.body,i.body.endsWith("&")&&(i.body=i.body.slice(-1)),i}async deserializeResponse(t,e,n){const i=this.deserializer,r=ie.l1.of(t.output),s={};if(n.statusCode>=300){const r=await(0,ee.P)(n.body,e);r.byteLength>0&&Object.assign(s,await i.read(15,r)),await this.handleError(t,e,n,s,this.deserializeMetadata(n))}for(const t in n.headers){const e=n.headers[t];delete n.headers[t],n.headers[t.toLowerCase()]=e}const o=t.name.split("#")[1]??t.name,a=r.isStructSchema()&&this.useNestedResult()?o+"Result":void 0,c=await(0,ee.P)(n.body,e);c.byteLength>0&&Object.assign(s,await i.read(r,c,a));return{$metadata:this.deserializeMetadata(n),...s}}useNestedResult(){return!0}async handleError(t,e,n,i,r){const s=this.loadQueryErrorCode(n,i)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,s,this.options.defaultNamespace);const o=this.loadQueryError(i)??{},a=this.loadQueryErrorMessage(i);o.message=a,o.Error={Type:o.Type,Code:o.Code,Message:a};const{errorSchema:c,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(s,this.options.defaultNamespace,n,o,r,this.mixin.findQueryCompatibleError),l=ie.l1.of(c),h=new(this.compositeErrorRegistry.getErrorCtor(c)??Error)(a),d={Type:o.Error.Type,Code:o.Error.Code,Error:o.Error};for(const[t,e]of l.structIterator()){const n=e.getMergedTraits().xmlName??t,r=o[n]??i[n];d[t]=this.deserializer.readSchema(e,r)}throw this.mixin.decorateServiceException(Object.assign(h,u,{$fault:l.getMergedTraits().error,message:a},d),i)}loadQueryErrorCode(t,e){const n=(e.Errors?.[0]?.Error??e.Errors?.Error??e.Error)?.Code;return void 0!==n?n:404==t.statusCode?"NotFound":void 0}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){const e=this.loadQueryError(t);return e?.message??e?.Message??t.message??t.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}var Cn=n(75),kn=n(52),On=n(112),jn=n(83),Mn=n(39),_n=n(128),Fn=n(129),Un=n(40);const Ln="required",Wn="type",zn="fn",Vn="argv",Yn="ref",qn=!1,Gn=!0,Kn="booleanEquals",Bn="stringEquals",Jn="sigv4",Qn="us-east-1",Xn="endpoint",Hn="https://sts.{Region}.{PartitionResult#dnsSuffix}",Zn="tree",ti="error",ei="getAttr",ni={[Ln]:!1,[Wn]:"string"},ii={[Ln]:!0,default:!1,[Wn]:"boolean"},ri={[Yn]:"Endpoint"},si={[zn]:"isSet",[Vn]:[{[Yn]:"Region"}]},oi={[Yn]:"Region"},ai={[zn]:"aws.partition",[Vn]:[oi],assign:"PartitionResult"},ci={[Yn]:"UseFIPS"},ui={[Yn]:"UseDualStack"},li={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:Jn,signingName:"sts",signingRegion:Qn}]},headers:{}},hi={},di={conditions:[{[zn]:Bn,[Vn]:[oi,"aws-global"]}],[Xn]:li,[Wn]:Xn},fi={[zn]:Kn,[Vn]:[ci,!0]},pi={[zn]:Kn,[Vn]:[ui,!0]},mi={[zn]:ei,[Vn]:[{[Yn]:"PartitionResult"},"supportsFIPS"]},gi={[Yn]:"PartitionResult"},wi={[zn]:Kn,[Vn]:[!0,{[zn]:ei,[Vn]:[gi,"supportsDualStack"]}]},yi=[{[zn]:"isSet",[Vn]:[ri]}],Ei=[fi],vi=[pi],xi={version:"1.0",parameters:{Region:ni,UseDualStack:ii,UseFIPS:ii,Endpoint:ni,UseGlobalEndpoint:ii},rules:[{conditions:[{[zn]:Kn,[Vn]:[{[Yn]:"UseGlobalEndpoint"},Gn]},{[zn]:"not",[Vn]:yi},si,ai,{[zn]:Kn,[Vn]:[ci,qn]},{[zn]:Kn,[Vn]:[ui,qn]}],rules:[{conditions:[{[zn]:Bn,[Vn]:[oi,"ap-northeast-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"ap-south-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"ap-southeast-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"ap-southeast-2"]}],endpoint:li,[Wn]:Xn},di,{conditions:[{[zn]:Bn,[Vn]:[oi,"ca-central-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"eu-central-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"eu-north-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"eu-west-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"eu-west-2"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"eu-west-3"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"sa-east-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,Qn]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"us-east-2"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"us-west-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"us-west-2"]}],endpoint:li,[Wn]:Xn},{endpoint:{url:Hn,properties:{authSchemes:[{name:Jn,signingName:"sts",signingRegion:"{Region}"}]},headers:hi},[Wn]:Xn}],[Wn]:Zn},{conditions:yi,rules:[{conditions:Ei,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Wn]:ti},{conditions:vi,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Wn]:ti},{endpoint:{url:ri,properties:hi,headers:hi},[Wn]:Xn}],[Wn]:Zn},{conditions:[si],rules:[{conditions:[ai],rules:[{conditions:[fi,pi],rules:[{conditions:[{[zn]:Kn,[Vn]:[Gn,mi]},wi],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:hi,headers:hi},[Wn]:Xn}],[Wn]:Zn},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Wn]:ti}],[Wn]:Zn},{conditions:Ei,rules:[{conditions:[{[zn]:Kn,[Vn]:[mi,Gn]}],rules:[{conditions:[{[zn]:Bn,[Vn]:[{[zn]:ei,[Vn]:[gi,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:hi,headers:hi},[Wn]:Xn},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:hi,headers:hi},[Wn]:Xn}],[Wn]:Zn},{error:"FIPS is enabled but this partition does not support FIPS",[Wn]:ti}],[Wn]:Zn},{conditions:vi,rules:[{conditions:[wi],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:hi,headers:hi},[Wn]:Xn}],[Wn]:Zn},{error:"DualStack is enabled but this partition does not support DualStack",[Wn]:ti}],[Wn]:Zn},di,{endpoint:{url:Hn,properties:hi,headers:hi},[Wn]:Xn}],[Wn]:Zn}],[Wn]:Zn},{error:"Invalid Configuration: Missing Region",[Wn]:ti}]},bi=new _n.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Si=(t,e={})=>bi.get(t,()=>(0,Fn.s)(xi,{endpointParams:t,logger:e.logger}));Un.m.aws=Mn.UF;const Ii=t=>{(0,Jt.I)(process.version);const e=(0,Ht.I)(t),n=()=>e().then(Qt.l),i=(t=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??On.E,base64Encoder:t?.base64Encoder??Nn.n,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??Si,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??jt,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new Lt.f2},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new qt.m}],logger:t?.logger??new Cn.N,protocol:t?.protocol??Rn,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:G,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:t?.serviceId??"STS",urlParser:t?.urlParser??kn.D,utf8Decoder:t?.utf8Decoder??jn.a,utf8Encoder:t?.utf8Encoder??vn.P}))(t);(0,Ft.I)(process.version);const o={profile:t?.profile,logger:i.logger};return{...i,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??(0,s.Z)(Ut.$,o),bodyLengthChecker:t?.bodyLengthChecker??Xt.n,defaultUserAgentProvider:t?.defaultUserAgentProvider??(0,Wt.pf)({serviceId:i.serviceId,clientVersion:_t.rE}),httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4")||(async e=>await t.credentialDefaultProvider(e?.o||{})()),signer:new Lt.f2},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new qt.m}],maxAttempts:t?.maxAttempts??(0,s.Z)(Pt.qs,t),region:t?.region??(0,s.Z)(r.GG,{...r.zH,...o}),requestHandler:Kt.$.create(t?.requestHandler??n),retryMode:t?.retryMode??(0,s.Z)({...Pt.kN,default:async()=>(await n()).retryMode||Zt.L0},t),sha256:t?.sha256??Gt.V.bind(null,"sha256"),streamCollector:t?.streamCollector??Bt.k,useDualstackEndpoint:t?.useDualstackEndpoint??(0,s.Z)(Vt.e$,o),useFipsEndpoint:t?.useFipsEndpoint??(0,s.Z)(Yt.Ko,o),userAgentAppId:t?.userAgentAppId??(0,s.Z)(zt.hV,o)}};var Ti=n(130),$i=n(131),Ai=n(132);class Pi extends Dt.K{config;constructor(...[t]){const e=Ii(t||{});super(e),this.initConfig=e;const n=(i=e,Object.assign(i,{useDualstackEndpoint:i.useDualstackEndpoint??!1,useFipsEndpoint:i.useFipsEndpoint??!1,useGlobalEndpoint:i.useGlobalEndpoint??!1,defaultSigningName:"sts"}));var i;const r=(0,Et.D)(n),s=(0,Pt.$z)(r),o=(0,xt.T)(s),a=(0,gt.OV)(o),c=(0,At.C)(a),u=((t,e)=>{const n=Object.assign((0,Ti.R)(t),(0,Ai.xA)(t),(0,$i.e)(t),(t=>{const e=t.httpAuthSchemes;let n=t.httpAuthSchemeProvider,i=t.credentials;return{setHttpAuthScheme(t){const n=e.findIndex(e=>e.schemeId===t.schemeId);-1===n?e.push(t):e.splice(n,1,t)},httpAuthSchemes:()=>e,setHttpAuthSchemeProvider(t){n=t},httpAuthSchemeProvider:()=>n,setCredentials(t){i=t},credentials:()=>i}})(t));return e.forEach(t=>t.configure(n)),Object.assign(t,(0,Ti.$)(n),(0,Ai.uv)(n),(0,$i.j)(n),{httpAuthSchemes:(i=n).httpAuthSchemes(),httpAuthSchemeProvider:i.httpAuthSchemeProvider(),credentials:i.credentials()});var i})(Mt(c),t?.extensions||[]);this.config=u,this.middlewareStack.use((0,Tt.wq)(this.config)),this.middlewareStack.use((0,vt.sM)(this.config)),this.middlewareStack.use((0,Nt.ey)(this.config)),this.middlewareStack.use((0,$t.vK)(this.config)),this.middlewareStack.use((0,gt.TC)(this.config)),this.middlewareStack.use((0,wt.Y7)(this.config)),this.middlewareStack.use((0,yt.n)(this.config)),this.middlewareStack.use((0,bt.w)(this.config,{httpAuthSchemeParametersProvider:Ot,identityProviderConfigProvider:async t=>new St.h({"aws.auth#sigv4":t.credentials})})),this.middlewareStack.use((0,It.l)(this.config))}destroy(){super.destroy()}}const Ni=(t,e)=>e?class extends t{constructor(t){super(t);for(const t of e)this.middlewareStack.use(t)}}:t,Di=(t={},e)=>ft(t,Ni(Pi,e)),Ri=(t={},e)=>pt(t,Ni(Pi,e))},848(t,e,n){function i(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}n.d(e,{$:()=>i})},849(t,e,n){n.d(e,{k:()=>b});var i=n(108),r=n(847);const s="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",o="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",a="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",c="(\\d?\\d)",u="(\\d{4})",l=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),h=new RegExp(`^${s}, ${c} ${o} ${u} ${a} GMT$`),d=new RegExp(`^${s}, ${c}-${o}-(\\d\\d) ${a} GMT$`),f=new RegExp(`^${s} ${o} ( [1-9]|\\d\\d) ${a} ${u}$`),p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(t,e,n){const i=Number(t);if(i<e||i>n)throw new Error(`Value ${i} out of range [${e}, ${n}]`)}var g=n(124),w=n(125),y=n(112),E=n(114),v=n(117),x=n(122);class b extends v.f{settings;constructor(t){super(),this.settings=t}read(t,e){const n=i.l1.of(t);if(n.isListSchema())return(0,r.G)(e).map(t=>this.read(n.getValueSchema(),t));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??y.E)(e);if(n.isTimestampSchema()){switch((0,x.V)(n,this.settings)){case 5:return(t=>{if(null==t)return;if("string"!=typeof t)throw new TypeError("RFC3339 timestamps must be strings");const e=l.exec(t);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${t}`);const[,n,i,r,s,o,a,,c,u]=e;m(i,1,12),m(r,1,31),m(s,0,23),m(o,0,59),m(a,0,60);const h=new Date(Date.UTC(Number(n),Number(i)-1,Number(r),Number(s),Number(o),Number(a),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(h.setUTCFullYear(Number(n)),"Z"!=u.toUpperCase()){const[,t,e,n]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],i="-"===t?1:-1;h.setTime(h.getTime()+i*(60*Number(e)*60*1e3+60*Number(n)*1e3))}return h})(e);case 6:return(t=>{if(null==t)return;if("string"!=typeof t)throw new TypeError("RFC7231 timestamps must be strings.");let e,n,i,r,s,o,a,c;if((c=h.exec(t))?[,e,n,i,r,s,o,a]=c:(c=d.exec(t))?([,e,n,i,r,s,o,a]=c,i=(Number(i)+1900).toString()):(c=f.exec(t))&&([,n,e,r,s,o,a,i]=c),i&&o){const t=Date.UTC(Number(i),p.indexOf(n),Number(e),Number(r),Number(s),Number(o),a?Math.round(1e3*parseFloat(`0.${a}`)):0);m(e,1,31),m(r,0,23),m(s,0,59),m(o,0,60);const c=new Date(t);return c.setUTCFullYear(Number(i)),c}throw new TypeError(`Invalid RFC7231 date-time value ${t}.`)})(e);case 7:return(t=>{if(null==t)return;let e=NaN;if("number"==typeof t)e=t;else if("string"==typeof t){if(!/^-?\d*\.?\d+$/.test(t))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(t)}else"object"==typeof t&&1===t.tag&&(e=t.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*e))})(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}}if(n.isStringSchema()){const t=n.getMergedTraits().mediaType;let i=e;if(t){n.getMergedTraits().httpHeader&&(i=this.base64ToUtf8(i));return("application/json"===t||t.endsWith("+json"))&&(i=g.A.from(i)),i}}return n.isNumericSchema()?Number(e):n.isBigIntegerSchema()?BigInt(e):n.isBigDecimalSchema()?new w.D(e,"bigDecimal"):n.isBooleanSchema()?"true"===String(e).toLowerCase():e}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??E.P)((this.serdeContext?.base64Decoder??y.E)(t))}}},847(t,e,n){n.d(e,{G:()=>i});const i=t=>{const e=t.length,n=[];let i,r=!1,s=0;for(let o=0;o<e;++o){const e=t[o];switch(e){case'"':"\\"!==i&&(r=!r);break;case",":r||(n.push(t.slice(s,o)),s=o+1)}i=e}return n.push(t.slice(s)),n.map(t=>{const e=(t=t.trim()).length;return e<2?t:('"'===t[0]&&'"'===t[e-1]&&(t=t.slice(1,e-1)),t.replace(/\\"/g,'"'))})}},850(t,e,n){n.d(e,{m:()=>i});class i{async sign(t,e,n){return t}}},845(t){t.exports={rE:"3.996.15"}}};
2
+ "use strict";exports.id=953,exports.ids=[953],exports.modules={852(t,e,n){n.d(e,{getDefaultRoleAssumer:()=>Di,getDefaultRoleAssumerWithWebIdentity:()=>Ri});var i=n(80),r=n(95),s=n(57);const o={silence:!1};var a=n(133),c=n(134);const u={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var l=n(116),h=n(119);class d extends h.T{constructor(t){super(t),Object.setPrototypeOf(this,d.prototype)}}class f extends d{name="ExpiredTokenException";$fault="client";constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,f.prototype)}}class p extends d{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t}),Object.setPrototypeOf(this,p.prototype)}}class m extends d{name="PackedPolicyTooLargeException";$fault="client";constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t}),Object.setPrototypeOf(this,m.prototype)}}class g extends d{name="RegionDisabledException";$fault="client";constructor(t){super({name:"RegionDisabledException",$fault:"client",...t}),Object.setPrototypeOf(this,g.prototype)}}class w extends d{name="IDPRejectedClaimException";$fault="client";constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t}),Object.setPrototypeOf(this,w.prototype)}}class y extends d{name="InvalidIdentityTokenException";$fault="client";constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,y.prototype)}}class E extends d{name="IDPCommunicationErrorException";$fault="client";constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t}),Object.setPrototypeOf(this,E.prototype)}}const v="AssumedRoleUser",x="Credentials",b="DurationSeconds",S="Policy",I="PolicyArns",T="PackedPolicySize",$="RoleArn",A="RoleSessionName",P="SourceIdentity",N="awsQueryError",D="client",R="error",C="httpError",k="message",O="smithy.ts.sdk.synthetic.com.amazonaws.sts",j="com.amazonaws.sts",M=l.O.for(O);var _=[-3,O,"STSServiceException",0,[],[]];M.registerError(_,d);const F=l.O.for(j);var U=[-3,j,"ExpiredTokenException",{[N]:["ExpiredTokenException",400],[R]:D,[C]:400},[k],[0]];F.registerError(U,f);var L=[-3,j,"IDPCommunicationErrorException",{[N]:["IDPCommunicationError",400],[R]:D,[C]:400},[k],[0]];F.registerError(L,E);var W=[-3,j,"IDPRejectedClaimException",{[N]:["IDPRejectedClaim",403],[R]:D,[C]:403},[k],[0]];F.registerError(W,w);var z=[-3,j,"InvalidIdentityTokenException",{[N]:["InvalidIdentityToken",400],[R]:D,[C]:400},[k],[0]];F.registerError(z,y);var V=[-3,j,"MalformedPolicyDocumentException",{[N]:["MalformedPolicyDocument",400],[R]:D,[C]:400},[k],[0]];F.registerError(V,p);var Y=[-3,j,"PackedPolicyTooLargeException",{[N]:["PackedPolicyTooLarge",400],[R]:D,[C]:400},[k],[0]];F.registerError(Y,m);var q=[-3,j,"RegionDisabledException",{[N]:["RegionDisabledException",403],[R]:D,[C]:403},[k],[0]];F.registerError(q,g);const G=[M,F];var K=[0,j,"accessKeySecretType",8,0],B=[0,j,"clientTokenType",8,0],J=[3,j,v,0,["AssumedRoleId","Arn"],[0,0],2],Q=[3,j,"AssumeRoleRequest",0,[$,A,I,S,b,"Tags","TransitiveTagKeys","ExternalId","SerialNumber","TokenCode",P,"ProvidedContexts"],[0,0,()=>rt,0,1,()=>ot,64,0,0,0,0,()=>st],2],X=[3,j,"AssumeRoleResponse",0,[x,v,T,P],[[()=>tt,0],()=>J,1,0]],H=[3,j,"AssumeRoleWithWebIdentityRequest",0,[$,A,"WebIdentityToken","ProviderId",I,S,b],[0,0,[()=>B,0],0,()=>rt,0,1],3],Z=[3,j,"AssumeRoleWithWebIdentityResponse",0,[x,"SubjectFromWebIdentityToken",v,T,"Provider","Audience",P],[[()=>tt,0],0,()=>J,1,0,0,0]],tt=[3,j,x,0,["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],[0,[()=>K,0],0,4],4],et=[3,j,"PolicyDescriptorType",0,["arn"],[0]],nt=[3,j,"ProvidedContext",0,["ProviderArn","ContextAssertion"],[0,0]],it=[3,j,"Tag",0,["Key","Value"],[0,0],2],rt=[1,j,"policyDescriptorListType",0,()=>et],st=[1,j,"ProvidedContextsListType",0,()=>nt],ot=[1,j,"tagListType",0,()=>it],at=[9,j,"AssumeRole",0,()=>Q,()=>X],ct=[9,j,"AssumeRoleWithWebIdentity",0,()=>H,()=>Z];class ut extends(c.u.classBuilder().ep(u).m(function(t,e,n,i){return[(0,a.r)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").sc(at).build()){}class lt extends(c.u.classBuilder().ep(u).m(function(t,e,n,i){return[(0,a.r)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").sc(ct).build()){}const ht=t=>{if("string"==typeof t?.Arn){const e=t.Arn.split(":");if(e.length>4&&""!==e[4])return e[4]}},dt=async(t,e,n,i={})=>{const a="function"==typeof t?await t():t,c="function"==typeof e?await e():e;let u="";const l=a??c??(u=await function(t={}){return(0,s.Z)({...r.GG,default:async()=>(o.silence||console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."),"us-east-1")},{...r.zH,...t})}(i)());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${a} (credential provider clientConfig)`,`${c} (contextual client)`,`${u} (STS default: AWS_REGION, profile region, or us-east-1)`),l},ft=(t,e)=>{let n,r;return async(s,o)=>{if(r=s,!n){const{logger:i=t?.parentClientConfig?.logger,profile:s=t?.parentClientConfig?.profile,region:o,requestHandler:a=t?.parentClientConfig?.requestHandler,credentialProviderLogger:c,userAgentAppId:u=t?.parentClientConfig?.userAgentAppId}=t,l=await dt(o,t?.parentClientConfig?.region,c,{logger:i,profile:s}),h=!mt(a);n=new e({...t,userAgentAppId:u,profile:s,credentialDefaultProvider:()=>async()=>r,region:l,requestHandler:h?a:void 0,logger:i})}const{Credentials:a,AssumedRoleUser:c}=await n.send(new ut(o));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${o.RoleArn}`);const u=ht(c),l={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...u&&{accountId:u}};return(0,i.g)(l,"CREDENTIALS_STS_ASSUME_ROLE","i"),l}},pt=(t,e)=>{let n;return async r=>{if(!n){const{logger:i=t?.parentClientConfig?.logger,profile:r=t?.parentClientConfig?.profile,region:s,requestHandler:o=t?.parentClientConfig?.requestHandler,credentialProviderLogger:a,userAgentAppId:c=t?.parentClientConfig?.userAgentAppId}=t,u=await dt(s,t?.parentClientConfig?.region,a,{logger:i,profile:r}),l=!mt(o);n=new e({...t,userAgentAppId:c,profile:r,region:u,requestHandler:l?o:void 0,logger:i})}const{Credentials:s,AssumedRoleUser:o}=await n.send(new lt(r));if(!s||!s.AccessKeyId||!s.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);const a=ht(o),c={accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,sessionToken:s.SessionToken,expiration:s.Expiration,...s.CredentialScope&&{credentialScope:s.CredentialScope},...a&&{accountId:a}};return a&&(0,i.g)(c,"RESOLVED_ACCOUNT_ID","T"),(0,i.g)(c,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),c}},mt=t=>"h2"===t?.metadata?.handlerProtocol;var gt=n(32),wt=n(34),yt=n(35),Et=n(36),vt=n(38),xt=n(44),bt=n(46),St=n(45),It=n(49),Tt=n(50),$t=n(53),At=n(54),Pt=n(71),Nt=n(74),Dt=n(77),Rt=n(79),Ct=n(47),kt=n(55);const Ot=async(t,e,n)=>({operation:(0,Ct.u)(e).operation,region:await(0,kt.t)(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const jt=t=>{const e=[];if("AssumeRoleWithWebIdentity"===t.operation)e.push({schemeId:"smithy.api#noAuth"});else e.push(function(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(t,e)=>({signingProperties:{config:t,context:e}})}}(t));return e},Mt=t=>{const e=(n=t,Object.assign(n,{stsClientCtor:Pi}));var n;const i=(0,Rt.h)(e);return Object.assign(i,{authSchemePreference:(0,kt.t)(t.authSchemePreference??[])})};var _t=n(845),Ft=n(87),Ut=n(88),Lt=n(106),Wt=n(90),zt=n(94),Vt=n(96),Yt=n(97),qt=n(850),Gt=n(98),Kt=n(99),Bt=n(100),Jt=n(102),Qt=n(101),Xt=n(103),Ht=n(105),Zt=n(43),te=n(107),ee=n(111),ne=n(109),ie=n(108),re=n(118);const se=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",oe=new RegExp("^"+("["+se+"]["+(se+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*")+"$");function ae(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n}const ce=function(t){const e=oe.exec(t);return!(null==e)};const ue=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],le=["__proto__","constructor","prototype"],he=t=>ue.includes(t)?"__"+t:t,de={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:he};function fe(t,e){if("string"!=typeof t)return;const n=t.toLowerCase();if(ue.some(t=>n===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);if(le.some(t=>n===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`)}function pe(t){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??100),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:pe(!0)}const me=function(t){const e=Object.assign({},de,t),n=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(const{value:t,name:e}of n)t&&fe(t,e);return null===e.onDangerousProperty&&(e.onDangerousProperty=he),e.processEntities=pe(e.processEntities),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(t=>"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t)),e};let ge;ge="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class we{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][ge]={startIndex:e})}static getMetaDataSymbol(){return ge}}class ye{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,e){const n=Object.create(null);let i=0;if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let r=1,s=!1,o=!1,a="";for(;e<t.length;e++)if("<"!==t[e]||o)if(">"===t[e]){if(o?"-"===t[e-1]&&"-"===t[e-2]&&(o=!1,r--):r--,0===r)break}else"["===t[e]?s=!0:a+=t[e];else{if(s&&ve(t,"!ENTITY",e)){let r,s;if(e+=7,[r,s,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===s.indexOf("&")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&i>=this.options.maxEntityCount)throw new Error(`Entity count (${i+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);const t=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n[r]={regx:RegExp(`&${t};`,"g"),val:s},i++}}else if(s&&ve(t,"!ELEMENT",e)){e+=8;const{index:n}=this.readElementExp(t,e+1);e=n}else if(s&&ve(t,"!ATTLIST",e))e+=8;else if(s&&ve(t,"!NOTATION",e)){e+=9;const{index:n}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=n}else{if(!ve(t,"!--",e))throw new Error("Invalid DOCTYPE");o=!0}r++,a=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}readEntityExp(t,e){const n=e=Ee(t,e);for(;e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)e++;let i=t.substring(n,e);if(xe(i),e=Ee(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}let r="";if([e,r]=this.readIdentifierVal(t,e,"entity"),!1!==this.options.enabled&&null!=this.options.maxEntitySize&&r.length>this.options.maxEntitySize)throw new Error(`Entity "${i}" size (${r.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[i,r,--e]}readNotationExp(t,e){const n=e=Ee(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let i=t.substring(n,e);!this.suppressValidationErr&&xe(i),e=Ee(t,e);const r=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==r&&"PUBLIC"!==r)throw new Error(`Expected SYSTEM or PUBLIC, found "${r}"`);e+=r.length,e=Ee(t,e);let s=null,o=null;if("PUBLIC"===r)[e,s]=this.readIdentifierVal(t,e,"publicIdentifier"),'"'!==t[e=Ee(t,e)]&&"'"!==t[e]||([e,o]=this.readIdentifierVal(t,e,"systemIdentifier"));else if("SYSTEM"===r&&([e,o]=this.readIdentifierVal(t,e,"systemIdentifier"),!this.suppressValidationErr&&!o))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:i,publicIdentifier:s,systemIdentifier:o,index:--e}}readIdentifierVal(t,e,n){let i="";const r=t[e];if('"'!==r&&"'"!==r)throw new Error(`Expected quoted string, found "${r}"`);const s=++e;for(;e<t.length&&t[e]!==r;)e++;if(i=t.substring(s,e),t[e]!==r)throw new Error(`Unterminated ${n} value`);return[++e,i]}readElementExp(t,e){const n=e=Ee(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let i=t.substring(n,e);if(!this.suppressValidationErr&&!ce(i))throw new Error(`Invalid element name: "${i}"`);let r="";if("E"===t[e=Ee(t,e)]&&ve(t,"MPTY",e))e+=4;else if("A"===t[e]&&ve(t,"NY",e))e+=2;else if("("===t[e]){const n=++e;for(;e<t.length&&")"!==t[e];)e++;if(r=t.substring(n,e),")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[e]}"`);return{elementName:i,contentModel:r.trim(),index:e}}readAttlistExp(t,e){let n=e=Ee(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let i=t.substring(n,e);for(xe(i),n=e=Ee(t,e);e<t.length&&!/\s/.test(t[e]);)e++;let r=t.substring(n,e);if(!xe(r))throw new Error(`Invalid attribute name: "${r}"`);e=Ee(t,e);let s="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(s="NOTATION","("!==t[e=Ee(t,e+=8)])throw new Error(`Expected '(', found "${t[e]}"`);e++;let n=[];for(;e<t.length&&")"!==t[e];){const i=e;for(;e<t.length&&"|"!==t[e]&&")"!==t[e];)e++;let r=t.substring(i,e);if(r=r.trim(),!xe(r))throw new Error(`Invalid notation name: "${r}"`);n.push(r),"|"===t[e]&&(e++,e=Ee(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,s+=" ("+n.join("|")+")"}else{const n=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;s+=t.substring(n,e);const i=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!i.includes(s.toUpperCase()))throw new Error(`Invalid attribute type: "${s}"`)}e=Ee(t,e);let o="";return"#REQUIRED"===t.substring(e,e+8).toUpperCase()?(o="#REQUIRED",e+=8):"#IMPLIED"===t.substring(e,e+7).toUpperCase()?(o="#IMPLIED",e+=7):[e,o]=this.readIdentifierVal(t,e,"ATTLIST"),{elementName:i,attributeName:r,attributeType:s,defaultValue:o,index:e}}}const Ee=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function ve(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function xe(t){if(ce(t))return t;throw new Error(`Invalid entity name ${t}`)}const be=/^[-+]?0x[a-fA-F0-9]+$/,Se=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Ie={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function Te(t,e={}){if(e=Object.assign({},Ie,e),!t||"string"!=typeof t)return t;let n=t.trim();if(0===n.length)return t;if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===n)return 0;if(e.hex&&be.test(n))return function(t,e){if(parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n,16);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return function(t,e,n){if(!n.eNotation)return t;const i=e.match($e);if(i){let r=i[1]||"";const s=-1===i[3].indexOf("e")?"E":"e",o=i[2],a=r?t[o.length+1]===s:t[o.length]===s;return o.length>1&&a?t:(1!==o.length||!i[3].startsWith(`.${s}`)&&i[3][0]!==s)&&o.length>0?n.leadingZeros&&!a?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const i=Se.exec(n);if(i){const r=i[1]||"",s=i[2];let o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),t;return t}(i[3]);const a=r?"."===t[s.length+1]:"."===t[s.length];if(!e.leadingZeros&&(s.length>1||1===s.length&&!a))return t;{const i=Number(n),a=String(i);if(0===i)return i;if(-1!==a.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf("."))return"0"===a||a===o||a===`${r}${o}`?i:t;let c=s?o:n;return s?c===a||r+c===a?i:t:c===a||c===r+a?i:t}}return t}}return function(t,e,n){const i=e===1/0;switch(n.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";default:return t}}(t,Number(n),e)}const $e=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;const Ae=new Set(["push","pop","reset","updateCurrent","restore"]);class Pe{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[]}push(t,e=null,n=null){if(this.path.length>0){this.path[this.path.length-1].values=void 0}const i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);const r=this.siblingStacks[i],s=n?`${n}:${t}`:t,o=r.get(s)||0;let a=0;for(const t of r.values())a+=t;r.set(s,o+1);const c={tag:t,position:a,counter:o};null!=n&&(c.namespace=n),null!=e&&(c.values=e),this.path.push(c)}pop(){if(0===this.path.length)return;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0===this.path.length)return;const e=this.path[this.path.length-1];return e.values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const n=t||this.separator;return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(n)}toArray(){return this.path.map(t=>t.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++){const n=t[e],i=this.path[e],r=e===this.path.length-1;if(!this._matchSegment(n,i,r))return!1}return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,n=t.length-1;for(;n>=0&&e>=0;){const i=t[n];if("deep-wildcard"===i.type){if(n--,n<0)return!0;const i=t[n];let r=!1;for(let t=e;t>=0;t--){const s=t===this.path.length-1;if(this._matchSegment(i,this.path[t],s)){e=t-1,n--,r=!0;break}}if(!r)return!1}else{const t=e===this.path.length-1;if(!this._matchSegment(i,this.path[e],t))return!1;e--,n--}}return n<0}_matchSegment(t,e,n){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!n)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue){const n=e.values[t.attrName];if(String(n)!==String(t.attrValue))return!1}}if(void 0!==t.position){if(!n)return!1;const i=e.counter??0;if("first"===t.position&&0!==i)return!1;if("odd"===t.position&&i%2!=1)return!1;if("even"===t.position&&i%2!=0)return!1;if("nth"===t.position&&i!==t.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return new Proxy(this,{get(t,e,n){if(Ae.has(e))return()=>{throw new TypeError(`Cannot call '${e}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};const i=Reflect.get(t,e,n);return"path"===e||"siblingStacks"===e?Object.freeze(Array.isArray(i)?i.map(t=>t instanceof Map?Object.freeze(new Map(t)):Object.freeze({...t})):i):"function"==typeof i?i.bind(t):i},set(t,e){throw new TypeError(`Cannot set property '${String(e)}' on a read-only Matcher.`)},deleteProperty(t,e){throw new TypeError(`Cannot delete property '${String(e)}' from a read-only Matcher.`)}})}}class Ne{constructor(t,e={}){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let n=0,i="";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(i.trim()&&(e.push(this._parseSegment(i.trim())),i=""),e.push({type:"deep-wildcard"}),n+=2):(i.trim()&&e.push(this._parseSegment(i.trim())),i="",n++):(i+=t[n],n++);return i.trim()&&e.push(this._parseSegment(i.trim())),e}_parseSegment(t){const e={type:"tag"};let n=null,i=t;const r=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(r&&(i=r[1]+r[3],r[2])){const t=r[2].slice(1,-1);t&&(n=t)}let s,o,a=i;if(i.includes("::")){const e=i.indexOf("::");if(s=i.substring(0,e).trim(),a=i.substring(e+2).trim(),!s)throw new Error(`Invalid namespace in pattern: ${t}`)}let c=null;if(a.includes(":")){const t=a.lastIndexOf(":"),e=a.substring(0,t).trim(),n=a.substring(t+1).trim();["first","last","odd","even"].includes(n)||/^nth\(\d+\)$/.test(n)?(o=e,c=n):o=a}else o=a;if(!o)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=o,s&&(e.namespace=s),n)if(n.includes("=")){const t=n.indexOf("=");e.attrName=n.substring(0,t).trim(),e.attrValue=n.substring(t+1).trim()}else e.attrName=n.trim();if(c){const t=c.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=c}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}function De(t,e){if(!t)return{};const n=e.attributesGroupName?t[e.attributesGroupName]:t;if(!n)return{};const i={};for(const t in n)if(t.startsWith(e.attributeNamePrefix)){i[t.substring(e.attributeNamePrefix.length)]=n[t]}else i[t]=n[t];return i}function Re(t){if(!t||"string"!=typeof t)return;const e=t.indexOf(":");if(-1!==e&&e>0){const n=t.substring(0,e);if("xmlns"!==n)return n}}class Ce{constructor(t){var e;if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>Ke(e,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>Ke(e,16,"&#x")}},this.addExternalEntities=ke,this.parseXml=Fe,this.parseTextData=Oe,this.resolveNameSpace=je,this.buildAttributesMap=_e,this.isItStopNode=ze,this.replaceEntitiesValue=Le,this.readStopNodeData=qe,this.saveTextToParentTag=We,this.addChild=Ue,this.ignoreAttributesFn="function"==typeof(e=this.options.ignoreAttributes)?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new Pe,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];"string"==typeof e?this.stopNodeExpressions.push(new Ne(e)):e instanceof Ne&&this.stopNodeExpressions.push(e)}}}}function ke(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n],r=i.replace(/[.\-+*:]/g,"\\.");this.lastEntities[i]={regex:new RegExp("&"+r+";","g"),val:t[i]}}}function Oe(t,e,n,i,r,s,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t,e,n));const i=this.options.jPath?n.toString():n,a=this.options.tagValueProcessor(e,t,i,r,s);if(null==a)return t;if(typeof a!=typeof t||a!==t)return a;if(this.options.trimValues)return Ge(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?Ge(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function je(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const Me=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function _e(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const i=ae(t,Me),r=i.length,s={},o={};for(let t=0;t<r;t++){const e=this.resolveNameSpace(i[t][1]),r=i[t][4];if(e.length&&void 0!==r){let t=r;this.options.trimValues&&(t=t.trim()),t=this.replaceEntitiesValue(t,n,this.readonlyMatcher),o[e]=t}}Object.keys(o).length>0&&"object"==typeof e&&e.updateCurrent&&e.updateCurrent(o);for(let t=0;t<r;t++){const r=this.resolveNameSpace(i[t][1]),o=this.options.jPath?e.toString():this.readonlyMatcher;if(this.ignoreAttributesFn(r,o))continue;let a=i[t][4],c=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c=Je(c,this.options),void 0!==a){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a,n,this.readonlyMatcher);const t=this.options.jPath?e.toString():this.readonlyMatcher,i=this.options.attributeValueProcessor(r,a,t);s[c]=null==i?a:typeof i!=typeof a||i!==a?i:Ge(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[c]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=s,t}return s}}const Fe=function(t){t=t.replace(/\r\n?/g,"\n");const e=new we("!xml");let n=e,i="";this.matcher.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const r=new ye(this.options.processEntities);for(let s=0;s<t.length;s++){if("<"===t[s])if("/"===t[s+1]){const e=Ve(t,">",s,"Closing Tag is not closed.");let r=t.substring(s+2,e).trim();if(this.options.removeNSPrefix){const t=r.indexOf(":");-1!==t&&(r=r.substr(t+1))}r=Be(this.options.transformTagName,r,"",this.options).tagName,n&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher));const o=this.matcher.getCurrentTag();if(r&&-1!==this.options.unpairedTags.indexOf(r))throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);o&&-1!==this.options.unpairedTags.indexOf(o)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),i="",s=e}else if("?"===t[s+1]){let e=Ye(t,s,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,this.readonlyMatcher),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new we(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,this.matcher,e.tagName)),this.addChild(n,t,this.readonlyMatcher,s)}s=e.closeIndex+1}else if("!--"===t.substr(s+1,3)){const e=Ve(t,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const r=t.substring(s+4,e-2);i=this.saveTextToParentTag(i,n,this.readonlyMatcher),n.add(this.options.commentPropName,[{[this.options.textNodeName]:r}])}s=e}else if("!D"===t.substr(s+1,2)){const e=r.readDocType(t,s);this.docTypeEntities=e.entities,s=e.i}else if("!["===t.substr(s+1,2)){const e=Ve(t,"]]>",s,"CDATA is not closed.")-2,r=t.substring(s+9,e);i=this.saveTextToParentTag(i,n,this.readonlyMatcher);let o=this.parseTextData(r,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);null==o&&(o=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:r}]):n.add(this.options.textNodeName,o),s=e+2}else{let r=Ye(t,s,this.options.removeNSPrefix);if(!r){const e=t.substring(Math.max(0,s-50),Math.min(t.length,s+50));throw new Error(`readTagExp returned undefined at position ${s}. Context: "${e}"`)}let o=r.tagName;const a=r.rawTagName;let c=r.tagExp,u=r.attrExpPresent,l=r.closeIndex;if(({tagName:o,tagExp:c}=Be(this.options.transformTagName,o,c,this.options)),this.options.strictReservedNames&&(o===this.options.commentPropName||o===this.options.cdataPropName||o===this.options.textNodeName||o===this.options.attributesGroupName))throw new Error(`Invalid tag name: ${o}`);n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher,!1));const h=n;h&&-1!==this.options.unpairedTags.indexOf(h.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let d=!1;c.length>0&&c.lastIndexOf("/")===c.length-1&&(d=!0,"/"===o[o.length-1]?(o=o.substr(0,o.length-1),c=o):c=c.substr(0,c.length-1),u=o!==c);let f,p=null,m={};f=Re(a),o!==e.tagname&&this.matcher.push(o,{},f),o!==c&&u&&(p=this.buildAttributesMap(c,this.matcher,o),p&&(m=De(p,this.options))),o!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));const g=s;if(this.isCurrentNodeStopNode){let e="";if(d)s=r.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(o))s=r.closeIndex;else{const n=this.readStopNodeData(t,a,l+1);if(!n)throw new Error(`Unexpected end of ${a}`);s=n.i,e=n.tagContent}const i=new we(o);p&&(i[":@"]=p),i.add(this.options.textNodeName,e),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,i,this.readonlyMatcher,g)}else{if(d){({tagName:o,tagExp:c}=Be(this.options.transformTagName,o,c,this.options));const t=new we(o);p&&(t[":@"]=p),this.addChild(n,t,this.readonlyMatcher,g),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(-1!==this.options.unpairedTags.indexOf(o)){const t=new we(o);p&&(t[":@"]=p),this.addChild(n,t,this.readonlyMatcher,g),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=r.closeIndex;continue}{const t=new we(o);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),p&&(t[":@"]=p),this.addChild(n,t,this.readonlyMatcher,g),n=t}}i="",s=l}}else i+=t[s]}return e.child};function Ue(t,e,n,i){this.options.captureMetaData||(i=void 0);const r=this.options.jPath?n.toString():n,s=this.options.updateTag(e.tagname,r,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,i)):t.addChild(e,i))}function Le(t,e,n){const i=this.options.processEntities;if(!i||!i.enabled)return t;if(i.allowedTags){const r=this.options.jPath?n.toString():n;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,r)))return t}if(i.tagFilter){const r=this.options.jPath?n.toString():n;if(!i.tagFilter(e,r))return t}for(const e of Object.keys(this.docTypeEntities)){const n=this.docTypeEntities[e],r=t.match(n.regx);if(r){if(this.entityExpansionCount+=r.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);const e=t.length;if(t=t.replace(n.regx,n.val),i.maxExpandedLength&&(this.currentExpandedLength+=t.length-e,this.currentExpandedLength>i.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${i.maxExpandedLength}`)}}for(const e of Object.keys(this.lastEntities)){const n=this.lastEntities[e],r=t.match(n.regex);if(r&&(this.entityExpansionCount+=r.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);t=t.replace(n.regex,n.val)}if(-1===t.indexOf("&"))return t;if(this.options.htmlEntities)for(const e of Object.keys(this.htmlEntities)){const n=this.htmlEntities[e],r=t.match(n.regex);if(r&&(this.entityExpansionCount+=r.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);t=t.replace(n.regex,n.val)}return t=t.replace(this.ampEntity.regex,this.ampEntity.val)}function We(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function ze(t,e){if(!t||0===t.length)return!1;for(let n=0;n<t.length;n++)if(e.matches(t[n]))return!0;return!1}function Ve(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function Ye(t,e,n,i=">"){const r=function(t,e,n=">"){let i,r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,i);if(!r)return;let s=r.data;const o=r.index,a=s.search(/\s/);let c=s,u=!0;-1!==a&&(c=s.substring(0,a),s=s.substring(a+1).trimStart());const l=c;if(n){const t=c.indexOf(":");-1!==t&&(c=c.substr(t+1),u=c!==r.data.substr(t+1))}return{tagName:c,tagExp:s,closeIndex:o,attrExpPresent:u,rawTagName:l}}function qe(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const s=Ve(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:s};n=s}else if("?"===t[n+1]){n=Ve(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=Ve(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=Ve(t,"]]>",n,"StopNode is not closed.")-2}else{const i=Ye(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex}}}function Ge(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&Te(t,n)}return function(t){return void 0!==t}(t)?t:""}function Ke(t,e,n){const i=Number.parseInt(t,e);return i>=0&&i<=1114111?String.fromCodePoint(i):n+t+";"}function Be(t,e,n,i){if(t){const i=t(e);n===e&&(n=i),e=i}return{tagName:e=Je(e,i),tagExp:n}}function Je(t,e){if(le.includes(t))throw new Error(`[SECURITY] Invalid name: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);return ue.includes(t)?e.onDangerousProperty(t):t}const Qe=we.getMetaDataSymbol();function Xe(t,e){if(!t||"object"!=typeof t)return{};if(!e)return t;const n={};for(const i in t)if(i.startsWith(e)){n[i.substring(e.length)]=t[i]}else n[i]=t[i];return n}function He(t,e,n,i){return Ze(t,e,n,i)}function Ze(t,e,n,i){let r;const s={};for(let o=0;o<t.length;o++){const a=t[o],c=tn(a);if(void 0!==c&&c!==e.textNodeName){const t=Xe(a[":@"]||{},e.attributeNamePrefix);n.push(c,t)}if(c===e.textNodeName)void 0===r?r=a[c]:r+=""+a[c];else{if(void 0===c)continue;if(a[c]){let t=Ze(a[c],e,n,i);const r=nn(t,e);if(a[":@"]?en(t,a[":@"],i,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==a[Qe]&&"object"==typeof t&&null!==t&&(t[Qe]=a[Qe]),void 0!==s[c]&&Object.prototype.hasOwnProperty.call(s,c))Array.isArray(s[c])||(s[c]=[s[c]]),s[c].push(t);else{const n=e.jPath?i.toString():i;e.isArray(c,n,r)?s[c]=[t]:s[c]=t}void 0!==c&&c!==e.textNodeName&&n.pop()}}}return"string"==typeof r?r.length>0&&(s[e.textNodeName]=r):void 0!==r&&(s[e.textNodeName]=r),s}function tn(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function en(t,e,n,i){if(e){const r=Object.keys(e),s=r.length;for(let o=0;o<s;o++){const s=r[o],a=s.startsWith(i.attributeNamePrefix)?s.substring(i.attributeNamePrefix.length):s,c=i.jPath?n.toString()+"."+a:n;i.isArray(s,c,!0,!0)?t[s]=[e[s]]:t[s]=e[s]}}}function nn(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}const rn={allowBooleanAttributes:!1,unpairedTags:[]};function sn(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function on(t,e){const n=e;for(;e<t.length;e++)if("?"==t[e]||" "==t[e]){const i=t.substr(n,e-n);if(e>5&&"xml"===i)return dn("InvalidXml","XML declaration allowed only at the start of the document.",mn(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}continue}return e}function an(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}function cn(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if('"'===t[e]||"'"===t[e])""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const un=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function ln(t,e){const n=ae(t,un),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return dn("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",gn(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return dn("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",gn(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return dn("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",gn(n[t]));const r=n[t][2];if(!fn(r))return dn("InvalidAttr","Attribute '"+r+"' is an invalid name.",gn(n[t]));if(Object.prototype.hasOwnProperty.call(i,r))return dn("InvalidAttr","Attribute '"+r+"' is repeated.",gn(n[t]));i[r]=1}return!0}function hn(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function dn(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function fn(t){return ce(t)}function pn(t){return ce(t)}function mn(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function gn(t){return t.startIndex+t[1].length}const wn=new class{constructor(t){this.externalEntities={},this.options=me(t)}parse(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});const n=function(t,e){e=Object.assign({},rn,e);const n=[];let i=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let s=0;s<t.length;s++)if("<"===t[s]&&"?"===t[s+1]){if(s+=2,s=on(t,s),s.err)return s}else{if("<"!==t[s]){if(sn(t[s]))continue;return dn("InvalidChar","char '"+t[s]+"' is not expected.",mn(t,s))}{let o=s;if(s++,"!"===t[s]){s=an(t,s);continue}{let a=!1;"/"===t[s]&&(a=!0,s++);let c="";for(;s<t.length&&">"!==t[s]&&" "!==t[s]&&"\t"!==t[s]&&"\n"!==t[s]&&"\r"!==t[s];s++)c+=t[s];if(c=c.trim(),"/"===c[c.length-1]&&(c=c.substring(0,c.length-1),s--),!pn(c)){let e;return e=0===c.trim().length?"Invalid space after '<'.":"Tag '"+c+"' is an invalid name.",dn("InvalidTag",e,mn(t,s))}const u=cn(t,s);if(!1===u)return dn("InvalidAttr","Attributes for '"+c+"' have open quote.",mn(t,s));let l=u.value;if(s=u.index,"/"===l[l.length-1]){const n=s-l.length;l=l.substring(0,l.length-1);const r=ln(l,e);if(!0!==r)return dn(r.err.code,r.err.msg,mn(t,n+r.err.line));i=!0}else if(a){if(!u.tagClosed)return dn("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",mn(t,s));if(l.trim().length>0)return dn("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",mn(t,o));if(0===n.length)return dn("InvalidTag","Closing tag '"+c+"' has not been opened.",mn(t,o));{const e=n.pop();if(c!==e.tagName){let n=mn(t,e.tagStartPos);return dn("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+c+"'.",mn(t,o))}0==n.length&&(r=!0)}}else{const a=ln(l,e);if(!0!==a)return dn(a.err.code,a.err.msg,mn(t,s-l.length+a.err.line));if(!0===r)return dn("InvalidXml","Multiple possible root nodes found.",mn(t,s));-1!==e.unpairedTags.indexOf(c)||n.push({tagName:c,tagStartPos:o}),i=!0}for(s++;s<t.length;s++)if("<"===t[s]){if("!"===t[s+1]){s++,s=an(t,s);continue}if("?"!==t[s+1])break;if(s=on(t,++s),s.err)return s}else if("&"===t[s]){const e=hn(t,s);if(-1==e)return dn("InvalidChar","char '&' is not expected.",mn(t,s));s=e}else if(!0===r&&!sn(t[s]))return dn("InvalidXml","Extra text at the end",mn(t,s));"<"===t[s]&&s--}}}return i?1==n.length?dn("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",mn(t,n[0].tagStartPos)):!(n.length>0)||dn("InvalidXml","Invalid '"+JSON.stringify(n.map(t=>t.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):dn("InvalidXml","Start tag expected.",1)}(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Ce(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:He(i,this.options,n.matcher,n.readonlyMatcher)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return we.getMetaDataSymbol()}}({attributeNamePrefix:"",processEntities:{enabled:!0,maxTotalExpansions:1/0},htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(t,e)=>""===e.trim()&&e.includes("\n")?"":void 0,maxNestedTags:1/0});wn.addEntity("#xD","\r"),wn.addEntity("#10","\n");var yn=n(849);const En=t=>{const e="#text";for(const n in t)t.hasOwnProperty(n)&&void 0!==t[n][e]?t[n]=t[n][e]:"object"==typeof t[n]&&null!==t[n]&&(t[n]=En(t[n]));return t};var vn=n(114),xn=n(121),bn=n(126);class Sn extends xn.B{settings;stringDeserializer;constructor(t){super(),this.settings=t,this.stringDeserializer=new yn.k(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,e,n){const i=ie.l1.of(t),r=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(r).find(t=>!!t.getMemberTraits().eventPayload)){const t={},n=Object.keys(r)[0];return r[n].isBlobSchema()?t[n]=e:t[n]=this.read(r[n],e),t}const s=(this.serdeContext?.utf8Encoder??vn.P)(e),o=this.parseXml(s);return this.readSchema(t,n?o[n]:o)}readSchema(t,e){const n=ie.l1.of(t);if(n.isUnitSchema())return;const i=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(e))return this.readSchema(n,[e]);if(null==e)return e;if("object"==typeof e){const t=!!i.xmlFlattened;if(n.isListSchema()){const i=n.getValueSchema(),r=[],s=i.getMergedTraits().xmlName??"member",o=t?e:(e[0]??e)[s];if(null==o)return r;const a=Array.isArray(o)?o:[o];for(const t of a)r.push(this.readSchema(i,t));return r}const r={};if(n.isMapSchema()){const i=n.getKeySchema(),s=n.getValueSchema();let o;o=t?Array.isArray(e)?e:[e]:Array.isArray(e.entry)?e.entry:[e.entry];const a=i.getMergedTraits().xmlName??"key",c=s.getMergedTraits().xmlName??"value";for(const t of o){const e=t[a],n=t[c];r[e]=this.readSchema(s,n)}return r}if(n.isStructSchema()){const t=n.isUnionSchema();let i;t&&(i=new bn.F(e,r));for(const[s,o]of n.structIterator()){const n=o.getMergedTraits(),a=n.httpPayload?n.xmlName??o.getName():o.getMemberTraits().xmlName??s;t&&i.mark(a),null!=e[a]&&(r[s]=this.readSchema(o,e[a]))}return t&&i.writeUnknown(),r}if(n.isDocumentSchema())return e;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}return n.isListSchema()?[]:n.isMapSchema()||n.isStructSchema()?{}:this.stringDeserializer.read(n,e)}parseXml(t){if(t.length){let n;try{e=t,n=wn.parse(e,!0)}catch(e){throw e&&"object"==typeof e&&Object.defineProperty(e,"$responseBodyText",{value:t}),e}const i="#text",r=Object.keys(n)[0],s=n[r];return s[i]&&(s[r]=s[i],delete s[i]),En(s)}var e;return{}}}var In=n(122),Tn=n(848),$n=n(76),An=n(125),Pn=n(123),Nn=n(113);class Dn extends xn.B{settings;buffer;constructor(t){super(),this.settings=t}write(t,e,n=""){void 0===this.buffer&&(this.buffer="");const i=ie.l1.of(t);if(n&&!n.endsWith(".")&&(n+="."),i.isBlobSchema())("string"==typeof e||e instanceof Uint8Array)&&(this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??Nn.n)(e)));else if(i.isBooleanSchema()||i.isNumericSchema()||i.isStringSchema())null!=e?(this.writeKey(n),this.writeValue(String(e))):i.isIdempotencyToken()&&(this.writeKey(n),this.writeValue((0,$n.v4)()));else if(i.isBigIntegerSchema())null!=e&&(this.writeKey(n),this.writeValue(String(e)));else if(i.isBigDecimalSchema())null!=e&&(this.writeKey(n),this.writeValue(e instanceof An.D?e.string:String(e)));else if(i.isTimestampSchema()){if(e instanceof Date){this.writeKey(n);switch((0,In.V)(i,this.settings)){case 5:this.writeValue(e.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue((0,Pn.JV)(e));break;case 7:this.writeValue(String(e.getTime()/1e3))}}}else if(i.isDocumentSchema())Array.isArray(e)?this.write(79,e,n):e instanceof Date?this.write(4,e,n):e instanceof Uint8Array?this.write(21,e,n):e&&"object"==typeof e?this.write(143,e,n):(this.writeKey(n),this.writeValue(String(e)));else if(i.isListSchema()){if(Array.isArray(e))if(0===e.length)this.settings.serializeEmptyLists&&(this.writeKey(n),this.writeValue(""));else{const t=i.getValueSchema(),r=this.settings.flattenLists||i.getMergedTraits().xmlFlattened;let s=1;for(const i of e){if(null==i)continue;const e=t.getMergedTraits(),o=this.getKey("member",e.xmlName,e.ec2QueryName),a=r?`${n}${s}`:`${n}${o}.${s}`;this.write(t,i,a),++s}}}else if(i.isMapSchema()){if(e&&"object"==typeof e){const t=i.getKeySchema(),r=i.getValueSchema(),s=i.getMergedTraits().xmlFlattened;let o=1;for(const[i,a]of Object.entries(e)){if(null==a)continue;const e=t.getMergedTraits(),c=this.getKey("key",e.xmlName,e.ec2QueryName),u=s?`${n}${o}.${c}`:`${n}entry.${o}.${c}`,l=r.getMergedTraits(),h=this.getKey("value",l.xmlName,l.ec2QueryName),d=s?`${n}${o}.${h}`:`${n}entry.${o}.${h}`;this.write(t,i,u),this.write(r,a,d),++o}}}else if(i.isStructSchema()){if(e&&"object"==typeof e){let t=!1;for(const[r,s]of i.structIterator()){if(null==e[r]&&!s.isIdempotencyToken())continue;const i=s.getMergedTraits(),o=`${n}${this.getKey(r,i.xmlName,i.ec2QueryName,"struct")}`;this.write(s,e[r],o),t=!0}if(!t&&i.isUnionSchema()){const{$unknown:t}=e;if(Array.isArray(t)){const[e,i]=t,r=`${n}${e}`;this.write(15,i,r)}}}}else if(!i.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${i.getName(!0)}`)}flush(){if(void 0===this.buffer)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const t=this.buffer;return delete this.buffer,t}getKey(t,e,n,i){const{ec2:r,capitalizeKeys:s}=this.settings;if(r&&n)return n;const o=e??t;return s&&"struct"===i?o[0].toUpperCase()+o.slice(1):o}writeKey(t){t.endsWith(".")&&(t=t.slice(0,t.length-1)),this.buffer+=`&${(0,Tn.$)(t)}=`}writeValue(t){this.buffer+=(0,Tn.$)(t)}}class Rn extends te.M{options;serializer;deserializer;mixin=new re.U;constructor(t){super({defaultNamespace:t.defaultNamespace,errorTypeRegistries:t.errorTypeRegistries}),this.options=t;const e={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new Dn(e),this.deserializer=new Sn(e)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,e,n){const i=await super.serializeRequest(t,e,n);i.path.endsWith("/")||(i.path+="/"),Object.assign(i.headers,{"content-type":"application/x-www-form-urlencoded"}),"unit"!==(0,ne.L)(t.input)&&i.body||(i.body="");const r=t.name.split("#")[1]??t.name;return i.body=`Action=${r}&Version=${this.options.version}`+i.body,i.body.endsWith("&")&&(i.body=i.body.slice(-1)),i}async deserializeResponse(t,e,n){const i=this.deserializer,r=ie.l1.of(t.output),s={};if(n.statusCode>=300){const r=await(0,ee.P)(n.body,e);r.byteLength>0&&Object.assign(s,await i.read(15,r)),await this.handleError(t,e,n,s,this.deserializeMetadata(n))}for(const t in n.headers){const e=n.headers[t];delete n.headers[t],n.headers[t.toLowerCase()]=e}const o=t.name.split("#")[1]??t.name,a=r.isStructSchema()&&this.useNestedResult()?o+"Result":void 0,c=await(0,ee.P)(n.body,e);c.byteLength>0&&Object.assign(s,await i.read(r,c,a));return{$metadata:this.deserializeMetadata(n),...s}}useNestedResult(){return!0}async handleError(t,e,n,i,r){const s=this.loadQueryErrorCode(n,i)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,s,this.options.defaultNamespace);const o=this.loadQueryError(i)??{},a=this.loadQueryErrorMessage(i);o.message=a,o.Error={Type:o.Type,Code:o.Code,Message:a};const{errorSchema:c,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(s,this.options.defaultNamespace,n,o,r,this.mixin.findQueryCompatibleError),l=ie.l1.of(c),h=new(this.compositeErrorRegistry.getErrorCtor(c)??Error)(a),d={Type:o.Error.Type,Code:o.Error.Code,Error:o.Error};for(const[t,e]of l.structIterator()){const n=e.getMergedTraits().xmlName??t,r=o[n]??i[n];d[t]=this.deserializer.readSchema(e,r)}throw this.mixin.decorateServiceException(Object.assign(h,u,{$fault:l.getMergedTraits().error,message:a},d),i)}loadQueryErrorCode(t,e){const n=(e.Errors?.[0]?.Error??e.Errors?.Error??e.Error)?.Code;return void 0!==n?n:404==t.statusCode?"NotFound":void 0}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){const e=this.loadQueryError(t);return e?.message??e?.Message??t.message??t.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}var Cn=n(75),kn=n(52),On=n(112),jn=n(83),Mn=n(39),_n=n(128),Fn=n(129),Un=n(40);const Ln="required",Wn="type",zn="fn",Vn="argv",Yn="ref",qn=!1,Gn=!0,Kn="booleanEquals",Bn="stringEquals",Jn="sigv4",Qn="us-east-1",Xn="endpoint",Hn="https://sts.{Region}.{PartitionResult#dnsSuffix}",Zn="tree",ti="error",ei="getAttr",ni={[Ln]:!1,[Wn]:"string"},ii={[Ln]:!0,default:!1,[Wn]:"boolean"},ri={[Yn]:"Endpoint"},si={[zn]:"isSet",[Vn]:[{[Yn]:"Region"}]},oi={[Yn]:"Region"},ai={[zn]:"aws.partition",[Vn]:[oi],assign:"PartitionResult"},ci={[Yn]:"UseFIPS"},ui={[Yn]:"UseDualStack"},li={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:Jn,signingName:"sts",signingRegion:Qn}]},headers:{}},hi={},di={conditions:[{[zn]:Bn,[Vn]:[oi,"aws-global"]}],[Xn]:li,[Wn]:Xn},fi={[zn]:Kn,[Vn]:[ci,!0]},pi={[zn]:Kn,[Vn]:[ui,!0]},mi={[zn]:ei,[Vn]:[{[Yn]:"PartitionResult"},"supportsFIPS"]},gi={[Yn]:"PartitionResult"},wi={[zn]:Kn,[Vn]:[!0,{[zn]:ei,[Vn]:[gi,"supportsDualStack"]}]},yi=[{[zn]:"isSet",[Vn]:[ri]}],Ei=[fi],vi=[pi],xi={version:"1.0",parameters:{Region:ni,UseDualStack:ii,UseFIPS:ii,Endpoint:ni,UseGlobalEndpoint:ii},rules:[{conditions:[{[zn]:Kn,[Vn]:[{[Yn]:"UseGlobalEndpoint"},Gn]},{[zn]:"not",[Vn]:yi},si,ai,{[zn]:Kn,[Vn]:[ci,qn]},{[zn]:Kn,[Vn]:[ui,qn]}],rules:[{conditions:[{[zn]:Bn,[Vn]:[oi,"ap-northeast-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"ap-south-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"ap-southeast-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"ap-southeast-2"]}],endpoint:li,[Wn]:Xn},di,{conditions:[{[zn]:Bn,[Vn]:[oi,"ca-central-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"eu-central-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"eu-north-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"eu-west-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"eu-west-2"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"eu-west-3"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"sa-east-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,Qn]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"us-east-2"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"us-west-1"]}],endpoint:li,[Wn]:Xn},{conditions:[{[zn]:Bn,[Vn]:[oi,"us-west-2"]}],endpoint:li,[Wn]:Xn},{endpoint:{url:Hn,properties:{authSchemes:[{name:Jn,signingName:"sts",signingRegion:"{Region}"}]},headers:hi},[Wn]:Xn}],[Wn]:Zn},{conditions:yi,rules:[{conditions:Ei,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Wn]:ti},{conditions:vi,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Wn]:ti},{endpoint:{url:ri,properties:hi,headers:hi},[Wn]:Xn}],[Wn]:Zn},{conditions:[si],rules:[{conditions:[ai],rules:[{conditions:[fi,pi],rules:[{conditions:[{[zn]:Kn,[Vn]:[Gn,mi]},wi],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:hi,headers:hi},[Wn]:Xn}],[Wn]:Zn},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Wn]:ti}],[Wn]:Zn},{conditions:Ei,rules:[{conditions:[{[zn]:Kn,[Vn]:[mi,Gn]}],rules:[{conditions:[{[zn]:Bn,[Vn]:[{[zn]:ei,[Vn]:[gi,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:hi,headers:hi},[Wn]:Xn},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:hi,headers:hi},[Wn]:Xn}],[Wn]:Zn},{error:"FIPS is enabled but this partition does not support FIPS",[Wn]:ti}],[Wn]:Zn},{conditions:vi,rules:[{conditions:[wi],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:hi,headers:hi},[Wn]:Xn}],[Wn]:Zn},{error:"DualStack is enabled but this partition does not support DualStack",[Wn]:ti}],[Wn]:Zn},di,{endpoint:{url:Hn,properties:hi,headers:hi},[Wn]:Xn}],[Wn]:Zn}],[Wn]:Zn},{error:"Invalid Configuration: Missing Region",[Wn]:ti}]},bi=new _n.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Si=(t,e={})=>bi.get(t,()=>(0,Fn.s)(xi,{endpointParams:t,logger:e.logger}));Un.m.aws=Mn.UF;const Ii=t=>{(0,Jt.I)(process.version);const e=(0,Ht.I)(t),n=()=>e().then(Qt.l),i=(t=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??On.E,base64Encoder:t?.base64Encoder??Nn.n,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??Si,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??jt,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new Lt.f2},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new qt.m}],logger:t?.logger??new Cn.N,protocol:t?.protocol??Rn,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:G,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:t?.serviceId??"STS",urlParser:t?.urlParser??kn.D,utf8Decoder:t?.utf8Decoder??jn.a,utf8Encoder:t?.utf8Encoder??vn.P}))(t);(0,Ft.I)(process.version);const o={profile:t?.profile,logger:i.logger};return{...i,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??(0,s.Z)(Ut.$,o),bodyLengthChecker:t?.bodyLengthChecker??Xt.n,defaultUserAgentProvider:t?.defaultUserAgentProvider??(0,Wt.pf)({serviceId:i.serviceId,clientVersion:_t.rE}),httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4")||(async e=>await t.credentialDefaultProvider(e?.o||{})()),signer:new Lt.f2},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new qt.m}],maxAttempts:t?.maxAttempts??(0,s.Z)(Pt.qs,t),region:t?.region??(0,s.Z)(r.GG,{...r.zH,...o}),requestHandler:Kt.$.create(t?.requestHandler??n),retryMode:t?.retryMode??(0,s.Z)({...Pt.kN,default:async()=>(await n()).retryMode||Zt.L0},t),sha256:t?.sha256??Gt.V.bind(null,"sha256"),streamCollector:t?.streamCollector??Bt.k,useDualstackEndpoint:t?.useDualstackEndpoint??(0,s.Z)(Vt.e$,o),useFipsEndpoint:t?.useFipsEndpoint??(0,s.Z)(Yt.Ko,o),userAgentAppId:t?.userAgentAppId??(0,s.Z)(zt.hV,o)}};var Ti=n(130),$i=n(131),Ai=n(132);class Pi extends Dt.K{config;constructor(...[t]){const e=Ii(t||{});super(e),this.initConfig=e;const n=(i=e,Object.assign(i,{useDualstackEndpoint:i.useDualstackEndpoint??!1,useFipsEndpoint:i.useFipsEndpoint??!1,useGlobalEndpoint:i.useGlobalEndpoint??!1,defaultSigningName:"sts"}));var i;const r=(0,Et.D)(n),s=(0,Pt.$z)(r),o=(0,xt.T)(s),a=(0,gt.OV)(o),c=(0,At.C)(a),u=((t,e)=>{const n=Object.assign((0,Ti.R)(t),(0,Ai.xA)(t),(0,$i.e)(t),(t=>{const e=t.httpAuthSchemes;let n=t.httpAuthSchemeProvider,i=t.credentials;return{setHttpAuthScheme(t){const n=e.findIndex(e=>e.schemeId===t.schemeId);-1===n?e.push(t):e.splice(n,1,t)},httpAuthSchemes:()=>e,setHttpAuthSchemeProvider(t){n=t},httpAuthSchemeProvider:()=>n,setCredentials(t){i=t},credentials:()=>i}})(t));return e.forEach(t=>t.configure(n)),Object.assign(t,(0,Ti.$)(n),(0,Ai.uv)(n),(0,$i.j)(n),{httpAuthSchemes:(i=n).httpAuthSchemes(),httpAuthSchemeProvider:i.httpAuthSchemeProvider(),credentials:i.credentials()});var i})(Mt(c),t?.extensions||[]);this.config=u,this.middlewareStack.use((0,Tt.wq)(this.config)),this.middlewareStack.use((0,vt.sM)(this.config)),this.middlewareStack.use((0,Nt.ey)(this.config)),this.middlewareStack.use((0,$t.vK)(this.config)),this.middlewareStack.use((0,gt.TC)(this.config)),this.middlewareStack.use((0,wt.Y7)(this.config)),this.middlewareStack.use((0,yt.n)(this.config)),this.middlewareStack.use((0,bt.w)(this.config,{httpAuthSchemeParametersProvider:Ot,identityProviderConfigProvider:async t=>new St.h({"aws.auth#sigv4":t.credentials})})),this.middlewareStack.use((0,It.l)(this.config))}destroy(){super.destroy()}}const Ni=(t,e)=>e?class extends t{constructor(t){super(t);for(const t of e)this.middlewareStack.use(t)}}:t,Di=(t={},e)=>ft(t,Ni(Pi,e)),Ri=(t={},e)=>pt(t,Ni(Pi,e))},848(t,e,n){function i(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}n.d(e,{$:()=>i})},849(t,e,n){n.d(e,{k:()=>b});var i=n(108),r=n(847);const s="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",o="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",a="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",c="(\\d?\\d)",u="(\\d{4})",l=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),h=new RegExp(`^${s}, ${c} ${o} ${u} ${a} GMT$`),d=new RegExp(`^${s}, ${c}-${o}-(\\d\\d) ${a} GMT$`),f=new RegExp(`^${s} ${o} ( [1-9]|\\d\\d) ${a} ${u}$`),p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(t,e,n){const i=Number(t);if(i<e||i>n)throw new Error(`Value ${i} out of range [${e}, ${n}]`)}var g=n(124),w=n(125),y=n(112),E=n(114),v=n(117),x=n(122);class b extends v.f{settings;constructor(t){super(),this.settings=t}read(t,e){const n=i.l1.of(t);if(n.isListSchema())return(0,r.G)(e).map(t=>this.read(n.getValueSchema(),t));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??y.E)(e);if(n.isTimestampSchema()){switch((0,x.V)(n,this.settings)){case 5:return(t=>{if(null==t)return;if("string"!=typeof t)throw new TypeError("RFC3339 timestamps must be strings");const e=l.exec(t);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${t}`);const[,n,i,r,s,o,a,,c,u]=e;m(i,1,12),m(r,1,31),m(s,0,23),m(o,0,59),m(a,0,60);const h=new Date(Date.UTC(Number(n),Number(i)-1,Number(r),Number(s),Number(o),Number(a),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(h.setUTCFullYear(Number(n)),"Z"!=u.toUpperCase()){const[,t,e,n]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],i="-"===t?1:-1;h.setTime(h.getTime()+i*(60*Number(e)*60*1e3+60*Number(n)*1e3))}return h})(e);case 6:return(t=>{if(null==t)return;if("string"!=typeof t)throw new TypeError("RFC7231 timestamps must be strings.");let e,n,i,r,s,o,a,c;if((c=h.exec(t))?[,e,n,i,r,s,o,a]=c:(c=d.exec(t))?([,e,n,i,r,s,o,a]=c,i=(Number(i)+1900).toString()):(c=f.exec(t))&&([,n,e,r,s,o,a,i]=c),i&&o){const t=Date.UTC(Number(i),p.indexOf(n),Number(e),Number(r),Number(s),Number(o),a?Math.round(1e3*parseFloat(`0.${a}`)):0);m(e,1,31),m(r,0,23),m(s,0,59),m(o,0,60);const c=new Date(t);return c.setUTCFullYear(Number(i)),c}throw new TypeError(`Invalid RFC7231 date-time value ${t}.`)})(e);case 7:return(t=>{if(null==t)return;let e=NaN;if("number"==typeof t)e=t;else if("string"==typeof t){if(!/^-?\d*\.?\d+$/.test(t))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(t)}else"object"==typeof t&&1===t.tag&&(e=t.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*e))})(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}}if(n.isStringSchema()){const t=n.getMergedTraits().mediaType;let i=e;if(t){n.getMergedTraits().httpHeader&&(i=this.base64ToUtf8(i));return("application/json"===t||t.endsWith("+json"))&&(i=g.A.from(i)),i}}return n.isNumericSchema()?Number(e):n.isBigIntegerSchema()?BigInt(e):n.isBigDecimalSchema()?new w.D(e,"bigDecimal"):n.isBooleanSchema()?"true"===String(e).toLowerCase():e}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??E.P)((this.serdeContext?.base64Decoder??y.E)(t))}}},847(t,e,n){n.d(e,{G:()=>i});const i=t=>{const e=t.length,n=[];let i,r=!1,s=0;for(let o=0;o<e;++o){const e=t[o];switch(e){case'"':"\\"!==i&&(r=!r);break;case",":r||(n.push(t.slice(s,o)),s=o+1)}i=e}return n.push(t.slice(s)),n.map(t=>{const e=(t=t.trim()).length;return e<2?t:('"'===t[0]&&'"'===t[e-1]&&(t=t.slice(1,e-1)),t.replace(/\\"/g,'"'))})}},850(t,e,n){n.d(e,{m:()=>i});class i{async sign(t,e,n){return t}}},845(t){t.exports={rE:"3.996.18"}}};
3
3
  //# sourceMappingURL=953.index.js.map