@moicky/dynamodb 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as e}from"module";var t={2311:(t,n,r)=>{r.r(n),r.d(n,{$Command:()=>xn,AttributeAction:()=>Ir,AttributeValue:()=>Bo,BackupInUseException:()=>Lr,BackupNotFoundException:()=>Fr,BackupStatus:()=>Cr,BackupType:()=>Tr,BackupTypeFilter:()=>zr,BatchExecuteStatementCommand:()=>Ap,BatchGetItemCommand:()=>kp,BatchStatementErrorCodeEnum:()=>Ur,BatchWriteItemCommand:()=>Dp,BillingMode:()=>Pr,ComparisonOperator:()=>Kr,ConditionalCheckFailedException:()=>Wr,ConditionalOperator:()=>Jr,ContinuousBackupsStatus:()=>Xr,ContinuousBackupsUnavailableException:()=>Zr,ContributorInsightsAction:()=>eo,ContributorInsightsStatus:()=>to,CreateBackupCommand:()=>Rp,CreateGlobalTableCommand:()=>Op,CreateTableCommand:()=>Lp,DeleteBackupCommand:()=>Fp,DeleteItemCommand:()=>zp,DeleteTableCommand:()=>Bp,DescribeBackupCommand:()=>Up,DescribeContinuousBackupsCommand:()=>$p,DescribeContributorInsightsCommand:()=>Mp,DescribeEndpointsCommand:()=>Ha,DescribeExportCommand:()=>jp,DescribeGlobalTableCommand:()=>qp,DescribeGlobalTableSettingsCommand:()=>Vp,DescribeImportCommand:()=>Gp,DescribeKinesisStreamingDestinationCommand:()=>Hp,DescribeLimitsCommand:()=>Kp,DescribeTableCommand:()=>Wp,DescribeTableReplicaAutoScalingCommand:()=>Jp,DescribeTimeToLiveCommand:()=>Qp,DestinationStatus:()=>Io,DisableKinesisStreamingDestinationCommand:()=>Xp,DuplicateItemException:()=>xo,DynamoDB:()=>Nm,DynamoDBClient:()=>Np,DynamoDBServiceException:()=>_r,EnableKinesisStreamingDestinationCommand:()=>Yp,ExecuteStatementCommand:()=>Zp,ExecuteTransactionCommand:()=>em,ExportConflictException:()=>Po,ExportFormat:()=>yo,ExportNotFoundException:()=>wo,ExportStatus:()=>fo,ExportTableToPointInTimeCommand:()=>tm,GetItemCommand:()=>nm,GlobalTableAlreadyExistsException:()=>co,GlobalTableNotFoundException:()=>Eo,GlobalTableStatus:()=>io,IdempotentParameterMismatchException:()=>Co,ImportConflictException:()=>ko,ImportNotFoundException:()=>_o,ImportStatus:()=>bo,ImportTableCommand:()=>rm,IndexNotFoundException:()=>zo,IndexStatus:()=>lo,InputCompressionType:()=>vo,InputFormat:()=>So,InternalServerError:()=>$r,InvalidEndpointException:()=>jr,InvalidExportTimeException:()=>No,InvalidRestoreTimeException:()=>Oo,ItemCollectionSizeLimitExceededException:()=>Hr,KeyType:()=>Nr,LimitExceededException:()=>no,ListBackupsCommand:()=>om,ListContributorInsightsCommand:()=>im,ListExportsCommand:()=>am,ListGlobalTablesCommand:()=>sm,ListImportsCommand:()=>cm,ListTablesCommand:()=>dm,ListTagsOfResourceCommand:()=>lm,PointInTimeRecoveryStatus:()=>Yr,PointInTimeRecoveryUnavailableException:()=>Ao,ProjectionType:()=>Ar,ProvisionedThroughputExceededException:()=>qr,PutItemCommand:()=>um,QueryCommand:()=>pm,ReplicaAlreadyExistsException:()=>Lo,ReplicaNotFoundException:()=>Fo,ReplicaStatus:()=>ao,RequestLimitExceeded:()=>Mr,ResourceInUseException:()=>po,ResourceNotFoundException:()=>Vr,RestoreTableFromBackupCommand:()=>mm,RestoreTableToPointInTimeCommand:()=>hm,ReturnConsumedCapacity:()=>Br,ReturnItemCollectionMetrics:()=>Gr,ReturnValue:()=>mo,ReturnValuesOnConditionCheckFailure:()=>Qr,S3SseAlgorithm:()=>go,SSEStatus:()=>Dr,SSEType:()=>kr,ScalarAttributeType:()=>xr,ScanCommand:()=>ym,Select:()=>Do,StreamViewType:()=>Rr,TableAlreadyExistsException:()=>Ro,TableClass:()=>so,TableInUseException:()=>ro,TableNotFoundException:()=>oo,TableStatus:()=>uo,TagResourceCommand:()=>fm,TimeToLiveStatus:()=>Or,TransactGetItemsCommand:()=>gm,TransactWriteItemsCommand:()=>wm,TransactionCanceledException:()=>Uo,TransactionConflictException:()=>ho,TransactionInProgressException:()=>To,UntagResourceCommand:()=>Em,UpdateContinuousBackupsCommand:()=>bm,UpdateContributorInsightsCommand:()=>vm,UpdateGlobalTableCommand:()=>Sm,UpdateGlobalTableSettingsCommand:()=>_m,UpdateItemCommand:()=>Im,UpdateTableCommand:()=>xm,UpdateTableReplicaAutoScalingCommand:()=>Cm,UpdateTimeToLiveCommand:()=>Tm,__Client:()=>In,paginateListContributorInsights:()=>km,paginateListExports:()=>Rm,paginateListImports:()=>Lm,paginateListTables:()=>zm,paginateQuery:()=>Um,paginateScan:()=>Mm,waitForTableExists:()=>Ym,waitForTableNotExists:()=>th,waitUntilTableExists:()=>Zm,waitUntilTableNotExists:()=>nh});var o={};r.r(o),r.d(o,{getUserAgentPrefix:()=>At,isVirtualHostableS3Bucket:()=>Bt,parseArn:()=>Ut,partition:()=>Tt,setPartitionInfo:()=>Pt,useDefaultPartitionInfo:()=>Nt});var i,a={};r.r(a),r.d(a,{aws:()=>o,booleanEquals:()=>$t,getAttr:()=>Mt,isSet:()=>jt,isValidHostLabel:()=>zt,not:()=>qt,parseURL:()=>Jt,stringEquals:()=>Qt,substring:()=>Xt,uriEncode:()=>Yt}),function(e){e.ENV="env",e.CONFIG="shared config entry"}(i||(i={}));const s=(e,t,n)=>{if(t in e){if("true"===e[t])return!0;if("false"===e[t])return!1;throw new Error(`Cannot load ${n} "${t}". Expected "true" or "false", got ${e[t]}.`)}},c={environmentVariableSelector:e=>s(e,"AWS_USE_DUALSTACK_ENDPOINT",i.ENV),configFileSelector:e=>s(e,"use_dualstack_endpoint",i.CONFIG),default:!1},d={environmentVariableSelector:e=>s(e,"AWS_USE_FIPS_ENDPOINT",i.ENV),configFileSelector:e=>s(e,"use_fips_endpoint",i.CONFIG),default:!1},l={environmentVariableSelector:e=>e.AWS_REGION,configFileSelector:e=>e.region,default:()=>{throw new Error("Region is missing")}},u={preferredFile:"credentials"},p=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips")),m=e=>p(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,h=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return{...e,region:async()=>{if("string"==typeof t)return m(t);const e=await t();return m(e)},useFipsEndpoint:async()=>{const e="string"==typeof t?t:await t();return!!p(e)||("function"!=typeof n?Promise.resolve(!!n):n())}}};var y,f;(f=y||(y={}))[f.HEADER=0]="HEADER",f[f.TRAILER=1]="TRAILER";class g{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/"}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){const e=new g({...this,headers:{...this.headers}});var t;return e.query&&(e.query=(t=e.query,Object.keys(t).reduce(((e,n)=>{const r=t[n];return{...e,[n]:Array.isArray(r)?[...r]:r}}),{}))),e}}class w{constructor(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}const E="content-length",b={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},v=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const r=t.request;if(g.isInstance(r)){const{body:e,headers:t}=r;if(e&&-1===Object.keys(t).map((e=>e.toLowerCase())).indexOf(E))try{const t=n(e);r.headers={...r.headers,[E]:String(t)}}catch(e){}}return e({...t,request:r})}),b)}}),S={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},_={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function I(e,t,n){return{applyToStack:r=>{r.add(((e,t)=>(n,r)=>async r=>{const{response:o}=await n(r);try{return{response:o,output:await t(o,e)}}catch(e){if(Object.defineProperty(e,"$response",{value:o}),!("$metadata"in e)){const t="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";e.message+="\n "+t}throw e}})(e,n),S),r.add(((e,t)=>(n,r)=>async o=>{const i=r.endpointV2?.url&&e.urlParser?async()=>e.urlParser(r.endpointV2.url):e.endpoint;if(!i)throw new Error("No valid endpoint provider available.");const a=await t(o.input,{...e,endpoint:i});return n({...o,request:a})})(e,t),_)}}}const x=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,C=/(\d+\.){3}\d+/,T=/\.\./,P=(e,t,n)=>{const r=async()=>{const r=n[e]??n[t];return"function"==typeof r?r():r};return"endpoint"===e||"endpoint"===t?async()=>{const e=await r();if(e&&"object"==typeof e){if("url"in e)return e.url.href;if("hostname"in e){const{protocol:t,hostname:n,port:r,path:o}=e;return`${t}//${n}${r?":"+r:""}${o}`}}return e}:r},N=async(e,t,n)=>{const r={},o=t?.getEndpointParameterInstructions?.()||{};for(const[t,i]of Object.entries(o))switch(i.type){case"staticContextParams":r[t]=i.value;break;case"contextParams":r[t]=e[i.name];break;case"clientContextParams":case"builtInParams":r[t]=await P(i.name,t,n)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(i))}return 0===Object.keys(o).length&&Object.assign(r,n),"s3"===String(n.serviceId).toLowerCase()&&await(async e=>{const t=e?.Bucket||"";if("string"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),(e=>{const[t,n,r,o,i,a]=e.split(":"),s="arn"===t&&e.split(":").length>=6,c=5===[t,n,r,i,a].filter(Boolean).length;if(s&&!c)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return!!("arn"===t&&n&&r&&i&&a)})(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else n=t,(!x.test(n)||C.test(n)||T.test(n)||-1!==t.indexOf(".")&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);var n;return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e})(r),r},A={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:_.name},k=(e,t)=>({applyToStack:n=>{n.addRelativeTo((({config:e,instructions:t})=>(n,r)=>async o=>{const i=await(async(e,t,n,r)=>{const o=await N(e,t,n);if("function"!=typeof n.endpointProvider)throw new Error("config.endpointProvider is not set.");return n.endpointProvider(o,r)})(o.input,{getEndpointParameterInstructions:()=>t},{...e},r);r.endpointV2=i,r.authSchemes=i.properties?.authSchemes;const a=r.authSchemes?.[0];return a&&(r.signing_region=a.signingRegion,r.signing_service=a.signingName),n({...o})})({config:e,instructions:t}),A)}}),D=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t},R=e=>{if("string"==typeof e)return R(new URL(e));const{hostname:t,pathname:n,port:r,protocol:o,search:i}=e;let a;return i&&(a=function(e){const t={};if(e=e.replace(/^\?/,""))for(const n of e.split("&")){let[e,r=null]=n.split("=");e=decodeURIComponent(e),r&&(r=decodeURIComponent(r)),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}(i)),{hostname:t,port:r?parseInt(r):void 0,protocol:o,path:n,query:a}},O=e=>{const t=e.tls??!0,{endpoint:n}=e,r=null!=n?async()=>(e=>"object"==typeof e?"url"in e?R(e.url):e:R(e))(await D(n)()):void 0,o=!!n;return{...e,endpoint:r,tls:t,isCustomEndpoint:o,useDualstackEndpoint:D(e.useDualstackEndpoint??!1),useFipsEndpoint:D(e.useFipsEndpoint??!1)}},L=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"],F="endpoint_discovery_enabled",z=e=>["false","0"].indexOf(e)>=0,B={environmentVariableSelector:e=>{for(let t=0;t<L.length;t++){const n=L[t];if(n in e){const t=e[n];if(""===t)throw Error(`Environment variable ${n} can't be empty of undefined, got "${t}"`);return!z(t)}}},configFileSelector:e=>{if(F in e){const t=e[F];if(void 0===t)throw Error(`Shared config entry ${F} can't be undefined, got "${t}"`);return!z(t)}},default:void 0};var U=r(6675),$=r.n(U);class M{constructor(e){this.cache=new($())(e)}getEndpoint(e){const t=this.get(e);if(!t||0===t.length)return;const n=t.map((e=>e.Address));return n[Math.floor(Math.random()*n.length)]}get(e){if(!this.has(e))return;const t=this.cache.get(e);if(!t)return;const n=Date.now(),r=t.filter((e=>n<e.Expires));if(0!==r.length)return r;this.delete(e)}set(e,t){const n=Date.now();this.cache.set(e,t.map((({Address:e,CachePeriodInMinutes:t})=>({Address:e,Expires:n+60*t*1e3}))))}delete(e){this.cache.set(e,[])}has(e){if(!this.cache.has(e))return!1;const t=this.cache.peek(e);return!!t&&t.length>0}clear(){this.cache.clear()}}const j={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},q=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{if(!g.isInstance(n.request))return t(n);const{request:r}=n,{handlerProtocol:o=""}=e.requestHandler.metadata||{};if(o.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]="";else if(!r.headers.host){let e=r.hostname;null!=r.port&&(e+=`:${r.port}`),r.headers.host=e}return t(n)})(e),j)}}),V={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},G=e=>({applyToStack:e=>{e.add(((e,t)=>async n=>{try{const r=await e(n),{clientName:o,commandName:i,logger:a,dynamoDbDocumentClientOptions:s={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:d}=s,l=c??t.inputFilterSensitiveLog,u=d??t.outputFilterSensitiveLog,{$metadata:p,...m}=r.output;return a?.info?.({clientName:o,commandName:i,input:l(n.input),output:u(m),metadata:p}),r}catch(e){const{clientName:r,commandName:o,logger:i,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:s}=a,c=s??t.inputFilterSensitiveLog;throw i?.error?.({clientName:r,commandName:o,input:c(n.input),error:e,metadata:e.$metadata}),e}}),V)}}),H="X-Amzn-Trace-Id",K={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},W=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{const{request:r}=n;if(!g.isInstance(r)||"node"!==e.runtime||r.headers.hasOwnProperty(H))return t(n);const o=process.env.AWS_LAMBDA_FUNCTION_NAME,i=process.env._X_AMZN_TRACE_ID,a=e=>"string"==typeof e&&e.length>0;return a(o)&&a(i)&&(r.headers[H]=i),t({...n,request:r})})(e),K)}});var J,Q;(Q=J||(J={})).STANDARD="standard",Q.ADAPTIVE="adaptive";const X=J.STANDARD,Y=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Z=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],ee=[500,502,503,504],te=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],ne=e=>429===e.$metadata?.httpStatusCode||Y.includes(e.name)||1==e.$retryable?.throttling,re=e=>Z.includes(e.name)||te.includes(e?.code||"")||ee.includes(e.$metadata?.httpStatusCode||0);class oe{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;const t=this.getCurrentTimeInSeconds();this.lastThrottleTime=t,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const t=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise((e=>setTimeout(e,t)))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp)return void(this.lastTimestamp=e);const t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}updateClientSendingRate(e){let t;if(this.updateMeasuredRate(),ne(e)){const e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){const e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}class ie{constructor(e){this.maxAttempts=e,this.mode=J.STANDARD,this.retryToken=((e,t,n,r)=>{const o=e,i=r?.retryCost??5,a=r?.timeoutRetryCost??10,s=r?.retryBackoffStrategy??(()=>{let e=100;return{computeNextBackoffDelay:t=>Math.floor(Math.min(2e4,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}})();let c,d=e,l=Math.min(2e4,t),u=n??0;const p=e=>"TRANSIENT"===e?a:i,m=e=>p(e)<=d;return{getRetryCount:()=>u,getRetryDelay:()=>l,getLastRetryCost:()=>c,hasRetryTokens:m,getRetryTokenCount:e=>{const t=e.errorType;if(!m(t))throw new Error("No retry token available");const n=p(t),r="THROTTLING"===t?500:100;s.setDelayBase(r);const o=s.computeNextBackoffDelay(u);if(e.retryAfterHint){const t=e.retryAfterHint.getTime()-Date.now();l=Math.max(t||0,o)}else l=o;return u++,c=n,d-=n,n},releaseRetryTokens:e=>{d+=e??1,d=Math.min(d,o)}}})(500,100),this.maxAttemptsProvider="function"==typeof e?e:async()=>e}async acquireInitialRetryToken(e){return this.retryToken}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts();if(this.shouldRetry(e,t,n))return e.getRetryTokenCount(t),e;throw new Error("No retry token available")}recordSuccess(e){this.retryToken.releaseRetryTokens(e.getLastRetryCost())}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn("Max attempts provider could not resolve. Using default of 3"),3}}shouldRetry(e,t,n){return e.getRetryCount()<n&&e.hasRetryTokens(t.errorType)&&this.isRetryableError(t.errorType)}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}}class ae{constructor(e,t){this.maxAttemptsProvider=e,this.mode=J.ADAPTIVE;const{rateLimiter:n}=t??{};this.rateLimiter=n??new oe,this.standardRetryStrategy=new ie(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}const se="AWS_MAX_ATTEMPTS",ce="max_attempts",de={environmentVariableSelector:e=>{const t=e[se];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Environment variable ${se} mast be a number, got "${t}"`);return n},configFileSelector:e=>{const t=e[ce];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Shared config file entry ${ce} mast be a number, got "${t}"`);return n},default:3},le=e=>{const{retryStrategy:t}=e,n=D(e.maxAttempts??3);return{...e,maxAttempts:n,retryStrategy:async()=>t||(await D(e.retryMode)()===J.ADAPTIVE?new ae(n):new ie(n))}},ue={environmentVariableSelector:e=>e.AWS_RETRY_MODE,configFileSelector:e=>e.retry_mode,default:X},pe=e(import.meta.url)("crypto");var me=r.n(pe);const he=new Uint8Array(256);let ye=he.length;function fe(){return ye>he.length-16&&(me().randomFillSync(he),ye=0),he.slice(ye,ye+=16)}const ge=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,we=[];for(let e=0;e<256;++e)we.push((e+256).toString(16).substr(1));const Ee=function(e,t=0){const n=(we[e[t+0]]+we[e[t+1]]+we[e[t+2]]+we[e[t+3]]+"-"+we[e[t+4]]+we[e[t+5]]+"-"+we[e[t+6]]+we[e[t+7]]+"-"+we[e[t+8]]+we[e[t+9]]+"-"+we[e[t+10]]+we[e[t+11]]+we[e[t+12]]+we[e[t+13]]+we[e[t+14]]+we[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&ge.test(e)}(n))throw TypeError("Stringified UUID is invalid");return n},be=function(e,t,n){const r=(e=e||{}).random||(e.rng||fe)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Ee(r)},ve=e=>{const t={errorType:Se(e)},n=xe(e.$response);return n&&(t.retryAfterHint=n),t},Se=e=>ne(e)?"THROTTLING":re(e)?"TRANSIENT":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!re(e)}return!1})(e)?"SERVER_ERROR":"CLIENT_ERROR",_e={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Ie=e=>({applyToStack:t=>{t.add((e=>(t,n)=>async r=>{let o=await e.retryStrategy();const i=await e.maxAttempts();if(!(e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess)(o))return o?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",o.mode]]),o.retry(t,r);{let e=await o.acquireInitialRetryToken(n.partition_id),s=new Error,c=0,d=0;const{request:l}=r;for(g.isInstance(l)&&(l.headers["amz-sdk-invocation-id"]=be());;)try{g.isInstance(l)&&(l.headers["amz-sdk-request"]=`attempt=${c+1}; max=${i}`);const{response:n,output:a}=await t(r);return o.recordSuccess(e),a.$metadata.attempts=c+1,a.$metadata.totalRetryDelay=d,{response:n,output:a}}catch(t){const n=ve(t);s=(a=t)instanceof Error?a:a instanceof Object?Object.assign(new Error,a):"string"==typeof a?new Error(a):new Error(`AWS SDK error wrapper for ${a}`);try{e=await o.refreshRetryTokenForRetry(e,n)}catch(e){throw s.$metadata||(s.$metadata={}),s.$metadata.attempts=c+1,s.$metadata.totalRetryDelay=d,s}c=e.getRetryCount();const r=e.getRetryDelay();d+=r,await new Promise((e=>setTimeout(e,r)))}}var a})(e),_e)}}),xe=e=>{if(!w.isInstance(e))return;const t=Object.keys(e.headers).find((e=>"retry-after"===e.toLowerCase()));if(!t)return;const n=e.headers[t],r=Number(n);return Number.isNaN(r)?new Date(n):new Date(1e3*r)};class Ce extends Error{constructor(e,t=!0){super(e),this.tryNextLink=t,this.name="ProviderError",Object.setPrototypeOf(this,Ce.prototype)}static from(e,t=!0){return Object.assign(new this(e.message,t),e)}}class Te extends Ce{constructor(e,t=!0){super(e,t),this.tryNextLink=t,this.name="CredentialsProviderError",Object.setPrototypeOf(this,Te.prototype)}}class Pe extends Ce{constructor(e,t=!0){super(e,t),this.tryNextLink=t,this.name="TokenProviderError",Object.setPrototypeOf(this,Pe.prototype)}}function Ne(...e){return()=>{let t=Promise.reject(new Ce("No providers in chain"));for(const n of e)t=t.catch((e=>{if(e?.tryNextLink)return n();throw e}));return t}}const Ae=(e,t,n)=>{let r,o,i,a=!1;const s=async()=>{o||(o=e());try{r=await o,i=!0,a=!1}finally{o=void 0}return r};return void 0===t?async e=>(i&&!e?.forceRefresh||(r=await s()),r):async e=>(i&&!e?.forceRefresh||(r=await s()),a?r:n&&!n(r)?(a=!0,r):t(r)?(await s(),r):r)},ke={},De={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),ke[e]=t,De[t]=e}function Re(e){let t="";for(let n=0;n<e.byteLength;n++)t+=ke[e[n]];return t}const Oe=e=>"function"==typeof ArrayBuffer&&e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e),Le=e(import.meta.url)("buffer"),Fe=(e,t=0,n=e.byteLength-t)=>{if(!Oe(e))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return Le.Buffer.from(e,t,n)},ze=(e,t)=>{if("string"!=typeof e)throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?Le.Buffer.from(e,t):Le.Buffer.from(e)},Be=e=>{const t=ze(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},Ue=e=>"string"==typeof e?Be(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),$e=e=>Fe(e.buffer,e.byteOffset,e.byteLength).toString("utf8"),Me="X-Amz-Date",je="X-Amz-Signature",qe="X-Amz-Security-Token",Ve="authorization",Ge=Me.toLowerCase(),He=[Ve,Ge,"date"],Ke=je.toLowerCase(),We="x-amz-content-sha256",Je=qe.toLowerCase(),Qe={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Xe=/^proxy-/,Ye=/^sec-/,Ze="AWS4-HMAC-SHA256",et="AWS4-HMAC-SHA256-PAYLOAD",tt="aws4_request",nt={},rt=[],ot=(e,t,n)=>`${e}/${t}/${n}/${tt}`,it=(e,t,n)=>{const r=new e(t);return r.update(Ue(n)),r.digest()},at=({headers:e},t,n)=>{const r={};for(const o of Object.keys(e).sort()){if(null==e[o])continue;const i=o.toLowerCase();(i in Qe||t?.has(i)||Xe.test(i)||Ye.test(i))&&(!n||n&&!n.has(i))||(r[i]=e[o].trim().replace(/\s+/g," "))}return r},st=e=>encodeURIComponent(e).replace(/[!'()*]/g,ct),ct=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,dt=async({headers:e,body:t},n)=>{for(const t of Object.keys(e))if(t.toLowerCase()===We)return e[t];if(null==t)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof t||ArrayBuffer.isView(t)||Oe(t)){const e=new n;return e.update(Ue(t)),Re(await e.digest())}return"UNSIGNED-PAYLOAD"},lt=({headers:e,query:t,...n})=>({...n,headers:{...e},query:t?ut(t):void 0}),ut=e=>Object.keys(e).reduce(((t,n)=>{const r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}}),{}),pt=e=>{e="function"==typeof e.clone?e.clone():lt(e);for(const t of Object.keys(e.headers))He.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e};class mt{constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:o,uriEscapePath:i=!0}){this.service=r,this.sha256=o,this.uriEscapePath=i,this.applyChecksum="boolean"!=typeof e||e,this.regionProvider=D(n),this.credentialProvider=D(t)}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:o,unhoistableHeaders:i,signableHeaders:a,signingRegion:s,signingService:c}=t,d=await this.credentialProvider();this.validateResolvedCredentials(d);const l=s??await this.regionProvider(),{longDate:u,shortDate:p}=ht(n);if(r>604800)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const m=ot(p,l,c??this.service),h=((e,t={})=>{const{headers:n,query:r={}}="function"==typeof e.clone?e.clone():lt(e);for(const e of Object.keys(n)){const o=e.toLowerCase();"x-amz-"!==o.slice(0,6)||t.unhoistableHeaders?.has(o)||(r[e]=n[e],delete n[e])}return{...e,headers:n,query:r}})(pt(e),{unhoistableHeaders:i});d.sessionToken&&(h.query[qe]=d.sessionToken),h.query["X-Amz-Algorithm"]=Ze,h.query["X-Amz-Credential"]=`${d.accessKeyId}/${m}`,h.query[Me]=u,h.query["X-Amz-Expires"]=r.toString(10);const y=at(h,o,a);return h.query["X-Amz-SignedHeaders"]=yt(y),h.query[je]=await this.getSignature(u,m,this.getSigningKey(d,l,p,c),this.createCanonicalRequest(h,y,await dt(e,this.sha256))),h}async sign(e,t){return"string"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:r,signingRegion:o,signingService:i}){const a=o??await this.regionProvider(),{shortDate:s,longDate:c}=ht(n),d=ot(s,a,i??this.service),l=await dt({headers:{},body:t},this.sha256),u=new this.sha256;u.update(e);const p=Re(await u.digest()),m=[et,c,d,r,p,l].join("\n");return this.signString(m,{signingDate:n,signingRegion:a,signingService:i})}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:r}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const i=n??await this.regionProvider(),{shortDate:a}=ht(t),s=new this.sha256(await this.getSigningKey(o,i,a,r));return s.update(Ue(e)),Re(await s.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:o,signingService:i}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const s=o??await this.regionProvider(),c=pt(e),{longDate:d,shortDate:l}=ht(t),u=ot(l,s,i??this.service);c.headers[Ge]=d,a.sessionToken&&(c.headers[Je]=a.sessionToken);const p=await dt(c,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(We,c.headers)&&this.applyChecksum&&(c.headers[We]=p);const m=at(c,r,n),h=await this.getSignature(d,u,this.getSigningKey(a,s,l,i),this.createCanonicalRequest(c,m,p));return c.headers[Ve]=`${Ze} Credential=${a.accessKeyId}/${u}, SignedHeaders=${yt(m)}, Signature=${h}`,c}createCanonicalRequest(e,t,n){const r=Object.keys(t).sort();return`${e.method}\n${this.getCanonicalPath(e)}\n${(({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e).sort()){if(r.toLowerCase()===Ke)continue;t.push(r);const o=e[r];"string"==typeof o?n[r]=`${st(r)}=${st(o)}`:Array.isArray(o)&&(n[r]=o.slice(0).sort().reduce(((e,t)=>e.concat([`${st(r)}=${st(t)}`])),[]).join("&"))}return t.map((e=>n[e])).filter((e=>e)).join("&")})(e)}\n${r.map((e=>`${e}:${t[e]}`)).join("\n")}\n\n${r.join(";")}\n${n}`}async createStringToSign(e,t,n){const r=new this.sha256;r.update(Ue(n));const o=await r.digest();return`${Ze}\n${e}\n${t}\n${Re(o)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const n of e.split("/"))0!==n?.length&&"."!==n&&(".."===n?t.pop():t.push(n));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return encodeURIComponent(n).replace(/%2F/g,"/")}return e}async getSignature(e,t,n,r){const o=await this.createStringToSign(e,t,r),i=new this.sha256(await n);return i.update(Ue(o)),Re(await i.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,o)=>{const i=`${n}:${r}:${o}:${Re(await it(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(i in nt)return nt[i];for(rt.push(i);rt.length>50;)delete nt[rt.shift()];let a=`AWS4${t.secretAccessKey}`;for(const t of[n,r,o,tt])a=await it(e,a,t);return nt[i]=a})(this.sha256,e,n,t,r||this.service)}validateResolvedCredentials(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")}}const ht=e=>{const t=(n=e,(e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e)(n).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");var n;return{longDate:t,shortDate:t.slice(0,8)}},yt=e=>Object.keys(e).sort().join(";"),ft=e=>{const t=e.credentials?gt(e.credentials):e.credentialDefaultProvider(e),{signingEscapePath:n=!0,systemClockOffset:r=e.systemClockOffset||0,sha256:o}=e;let i;return i=e.signer?D(e.signer):e.regionInfoProvider?()=>D(e.region)().then((async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t])).then((([r,i])=>{const{signingRegion:a,signingService:s}=r;e.signingRegion=e.signingRegion||a||i,e.signingName=e.signingName||s||e.serviceId;const c={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:n};return new(e.signerConstructor||mt)(c)})):async r=>{const i=(r=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await D(e.region)(),properties:{}},r)).signingRegion,a=r.signingName;e.signingRegion=e.signingRegion||i,e.signingName=e.signingName||a||e.serviceId;const s={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:n};return new(e.signerConstructor||mt)(s)},{...e,systemClockOffset:r,signingEscapePath:n,credentials:t,signer:i}},gt=e=>"function"==typeof e?Ae(e,(e=>void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5),(e=>void 0!==e.expiration)):D(e),wt=e=>new Date(Date.now()+e),Et=(e,t)=>{const n=Date.parse(e);return((e,t)=>Math.abs(wt(t).getTime()-e)>=3e5)(n,t)?n-Date.now():t},bt=e=>w.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,vt={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},St=e=>({applyToStack:t=>{t.addRelativeTo((e=>(t,n)=>async function(r){if(!g.isInstance(r.request))return t(r);const o=n.endpointV2?.properties?.authSchemes?.[0],i="sigv4a"===o?.name?o?.signingRegionSet?.join(","):void 0,a=await e.signer(o),s=await t({...r,request:await a.sign(r.request,{signingDate:wt(e.systemClockOffset),signingRegion:i||n.signing_region,signingService:n.signing_service})}).catch((t=>{const n=t.ServerTime??bt(t.$response);throw n&&(e.systemClockOffset=Et(n,e.systemClockOffset)),t})),c=bt(s.response);return c&&(e.systemClockOffset=Et(c,e.systemClockOffset)),s})(e),vt)}});function _t(e){return{...e,customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent}}const It=JSON.parse('{"partitions":[{"id":"aws","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","name":"aws","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^(us|eu|ap|sa|ca|me|af)\\\\-\\\\w+\\\\-\\\\d+$","regions":{"af-south-1":{"description":"Africa (Cape Town)"},"ap-east-1":{"description":"Asia Pacific (Hong Kong)"},"ap-northeast-1":{"description":"Asia Pacific (Tokyo)"},"ap-northeast-2":{"description":"Asia Pacific (Seoul)"},"ap-northeast-3":{"description":"Asia Pacific (Osaka)"},"ap-south-1":{"description":"Asia Pacific (Mumbai)"},"ap-south-2":{"description":"Asia Pacific (Hyderabad)"},"ap-southeast-1":{"description":"Asia Pacific (Singapore)"},"ap-southeast-2":{"description":"Asia Pacific (Sydney)"},"ap-southeast-3":{"description":"Asia Pacific (Jakarta)"},"ap-southeast-4":{"description":"Asia Pacific (Melbourne)"},"aws-global":{"description":"AWS Standard global region"},"ca-central-1":{"description":"Canada (Central)"},"eu-central-1":{"description":"Europe (Frankfurt)"},"eu-central-2":{"description":"Europe (Zurich)"},"eu-north-1":{"description":"Europe (Stockholm)"},"eu-south-1":{"description":"Europe (Milan)"},"eu-south-2":{"description":"Europe (Spain)"},"eu-west-1":{"description":"Europe (Ireland)"},"eu-west-2":{"description":"Europe (London)"},"eu-west-3":{"description":"Europe (Paris)"},"me-central-1":{"description":"Middle East (UAE)"},"me-south-1":{"description":"Middle East (Bahrain)"},"sa-east-1":{"description":"South America (Sao Paulo)"},"us-east-1":{"description":"US East (N. Virginia)"},"us-east-2":{"description":"US East (Ohio)"},"us-west-1":{"description":"US West (N. California)"},"us-west-2":{"description":"US West (Oregon)"}}},{"id":"aws-cn","outputs":{"dnsSuffix":"amazonaws.com.cn","dualStackDnsSuffix":"api.amazonwebservices.com.cn","name":"aws-cn","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^cn\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-cn-global":{"description":"AWS China global region"},"cn-north-1":{"description":"China (Beijing)"},"cn-northwest-1":{"description":"China (Ningxia)"}}},{"id":"aws-us-gov","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","name":"aws-us-gov","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-us-gov-global":{"description":"AWS GovCloud (US) global region"},"us-gov-east-1":{"description":"AWS GovCloud (US-East)"},"us-gov-west-1":{"description":"AWS GovCloud (US-West)"}}},{"id":"aws-iso","outputs":{"dnsSuffix":"c2s.ic.gov","dualStackDnsSuffix":"c2s.ic.gov","name":"aws-iso","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-global":{"description":"AWS ISO (US) global region"},"us-iso-east-1":{"description":"US ISO East"},"us-iso-west-1":{"description":"US ISO WEST"}}},{"id":"aws-iso-b","outputs":{"dnsSuffix":"sc2s.sgov.gov","dualStackDnsSuffix":"sc2s.sgov.gov","name":"aws-iso-b","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-b-global":{"description":"AWS ISOB (US) global region"},"us-isob-east-1":{"description":"US ISOB East (Ohio)"}}},{"id":"aws-iso-e","outputs":{"dnsSuffix":"cloud.adc-e.uk","dualStackDnsSuffix":"cloud.adc-e.uk","name":"aws-iso-e","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$","regions":{}}],"version":"1.1"}');let xt=It,Ct="";const Tt=e=>{const{partitions:t}=xt;for(const n of t){const{regions:t,outputs:r}=n;for(const[n,o]of Object.entries(t))if(n===e)return{...r,...o}}for(const n of t){const{regionRegex:t,outputs:r}=n;if(new RegExp(t).test(e))return{...r}}const n=t.find((e=>"aws"===e.id));if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},Pt=(e,t="")=>{xt=e,Ct=t},Nt=()=>{Pt(It,"")},At=()=>Ct,kt="endpoints";function Dt(e){return"object"!=typeof e||null==e?e:"ref"in e?`$${Dt(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(Dt).join(", ")})`:JSON.stringify(e,null,2)}class Rt extends Error{constructor(e){super(e),this.name="EndpointError"}}const Ot=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),Lt=e=>Ot.test(e)||e.startsWith("[")&&e.endsWith("]"),Ft=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),zt=(e,t=!1)=>{if(!t)return Ft.test(e);const n=e.split(".");for(const e of n)if(!zt(e))return!1;return!0},Bt=(e,t=!1)=>{if(t){for(const t of e.split("."))if(!Bt(t))return!1;return!0}return!(!zt(e)||e.length<3||e.length>63||e!==e.toLowerCase()||Lt(e))},Ut=e=>{const t=e.split(":");if(t.length<6)return null;const[n,r,o,i,a,...s]=t;return"arn"!==n||""===r||""===o||""===s[0]?null:{partition:r,service:o,region:i,accountId:a,resourceId:s[0].includes("/")?s[0].split("/"):s}},$t=(e,t)=>e===t,Mt=(e,t)=>(e=>{const t=e.split("."),n=[];for(const r of t){const t=r.indexOf("[");if(-1!==t){if(r.indexOf("]")!==r.length-1)throw new Rt(`Path: '${e}' does not end with ']'`);const o=r.slice(t+1,-1);if(Number.isNaN(parseInt(o)))throw new Rt(`Invalid array index: '${o}' in path: '${e}'`);0!==t&&n.push(r.slice(0,t)),n.push(o)}else n.push(r)}return n})(t).reduce(((n,r)=>{if("object"!=typeof n)throw new Rt(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(n)?n[parseInt(r)]:n[r]}),e),jt=e=>null!=e,qt=e=>!e;var Vt,Gt,Ht,Kt;!function(e){e.HEADER="header",e.QUERY="query"}(Vt||(Vt={})),function(e){e.AAAA="AAAA",e.A="A"}(Gt||(Gt={})),function(e){e.HTTP="http",e.HTTPS="https"}(Ht||(Ht={})),function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"}(Kt||(Kt={}));const Wt={[Ht.HTTP]:80,[Ht.HTTPS]:443},Jt=e=>{const t=(()=>{try{if(e instanceof URL)return e;if("object"==typeof e&&"hostname"in e){const{hostname:t,port:n,protocol:r="",path:o="",query:i={}}=e,a=new URL(`${r}//${t}${n?`:${n}`:""}${o}`);return a.search=Object.entries(i).map((([e,t])=>`${e}=${t}`)).join("&"),a}return new URL(e)}catch(e){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const n=t.href,{host:r,hostname:o,pathname:i,protocol:a,search:s}=t;if(s)return null;const c=a.slice(0,-1);if(!Object.values(Ht).includes(c))return null;const d=Lt(o);return{scheme:c,authority:`${r}${n.includes(`${r}:${Wt[c]}`)||"string"==typeof e&&e.includes(`${r}:${Wt[c]}`)?`:${Wt[c]}`:""}`,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:d}},Qt=(e,t)=>e===t,Xt=(e,t,n,r)=>t>=n||e.length<n?null:r?e.substring(e.length-n,e.length-t):e.substring(t,n),Yt=e=>encodeURIComponent(e).replace(/[!*'()]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),Zt=(e,t)=>{const n=[],r={...t.endpointParams,...t.referenceRecord};let o=0;for(;o<e.length;){const t=e.indexOf("{",o);if(-1===t){n.push(e.slice(o));break}n.push(e.slice(o,t));const i=e.indexOf("}",t);if(-1===i){n.push(e.slice(t));break}"{"===e[t+1]&&"}"===e[i+1]&&(n.push(e.slice(t+1,i)),o=i+2);const a=e.substring(t+1,i);if(a.includes("#")){const[e,t]=a.split("#");n.push(Mt(r[e],t))}else n.push(r[a]);o=i+1}return n.join("")},en=(e,t,n)=>{if("string"==typeof e)return Zt(e,n);if(e.fn)return tn(e,n);if(e.ref)return(({ref:e},t)=>({...t.endpointParams,...t.referenceRecord}[e]))(e,n);throw new Rt(`'${t}': ${String(e)} is not a string, function or reference.`)},tn=({fn:e,argv:t},n)=>{const r=t.map((e=>["boolean","number"].includes(typeof e)?e:en(e,"arg",n)));return e.split(".").reduce(((e,t)=>e[t]),a)(...r)},nn=({assign:e,...t},n)=>{if(e&&e in n.referenceRecord)throw new Rt(`'${e}' is already defined in Reference Record.`);const r=tn(t,n);return n.logger?.debug?.(kt,`evaluateCondition: ${Dt(t)} = ${Dt(r)}`),{result:""===r||!!r,...null!=e&&{toAssign:{name:e,value:r}}}},rn=(e=[],t)=>{const n={};for(const r of e){const{result:e,toAssign:o}=nn(r,{...t,referenceRecord:{...t.referenceRecord,...n}});if(!e)return{result:e};o&&(n[o.name]=o.value,t.logger?.debug?.(kt,`assign: ${o.name} := ${Dt(o.value)}`))}return{result:!0,referenceRecord:n}},on=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>({...e,[n]:r.map((e=>{const r=en(e,"Header value entry",t);if("string"!=typeof r)throw new Rt(`Header '${n}' value '${r}' is not a string`);return r}))})),{}),an=(e,t)=>{if(Array.isArray(e))return e.map((e=>an(e,t)));switch(typeof e){case"string":return Zt(e,t);case"object":if(null===e)throw new Rt(`Unexpected endpoint property: ${e}`);return sn(e,t);case"boolean":return e;default:throw new Rt("Unexpected endpoint property type: "+typeof e)}},sn=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>({...e,[n]:an(r,t)})),{}),cn=(e,t)=>{const n=en(e,"Endpoint URL",t);if("string"==typeof n)try{return new URL(n)}catch(e){throw console.error(`Failed to construct URL with ${n}`,e),e}throw new Rt("Endpoint URL must be a string, got "+typeof n)},dn=(e,t)=>{const{conditions:n,endpoint:r}=e,{result:o,referenceRecord:i}=rn(n,t);if(!o)return;const a={...t,referenceRecord:{...t.referenceRecord,...i}},{url:s,properties:c,headers:d}=r;return t.logger?.debug?.(kt,`Resolving endpoint from template: ${Dt(r)}`),{...null!=d&&{headers:on(d,a)},...null!=c&&{properties:sn(c,a)},url:cn(s,a)}},ln=(e,t)=>{const{conditions:n,error:r}=e,{result:o,referenceRecord:i}=rn(n,t);if(o)throw new Rt(en(r,"Error",{...t,referenceRecord:{...t.referenceRecord,...i}}))},un=(e,t)=>{const{conditions:n,rules:r}=e,{result:o,referenceRecord:i}=rn(n,t);if(o)return pn(r,{...t,referenceRecord:{...t.referenceRecord,...i}})},pn=(e,t)=>{for(const n of e)if("endpoint"===n.type){const e=dn(n,t);if(e)return e}else if("error"===n.type)ln(n,t);else{if("tree"!==n.type)throw new Rt(`Unknown endpoint rule: ${n}`);{const e=un(n,t);if(e)return e}}throw new Rt("Rules evaluation failed")},mn=(e,t)=>{const{endpointParams:n,logger:r}=t,{parameters:o,rules:i}=e;t.logger?.debug?.(`${kt} Initial EndpointParams: ${Dt(n)}`);const a=Object.entries(o).filter((([,e])=>null!=e.default)).map((([e,t])=>[e,t.default]));if(a.length>0)for(const[e,t]of a)n[e]=n[e]??t;const s=Object.entries(o).filter((([,e])=>e.required)).map((([e])=>e));for(const e of s)if(null==n[e])throw new Rt(`Missing required parameter: '${e}'`);const c=pn(i,{endpointParams:n,logger:r,referenceRecord:{}});if(t.endpointParams?.Endpoint)try{const e=new URL(t.endpointParams.Endpoint),{protocol:n,port:r}=e;c.url.protocol=n,c.url.port=r}catch(e){}return t.logger?.debug?.(`${kt} Resolved endpoint: ${Dt(c)}`),c},hn="user-agent",yn="x-amz-user-agent",fn=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,gn=([e,t])=>{const n=e.indexOf("/"),r=e.substring(0,n);let o=e.substring(n+1);return"api"===r&&(o=o.toLowerCase()),[r,o,t].filter((e=>e&&e.length>0)).map((e=>e?.replace(fn,"_"))).join("/")},wn={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},En=e=>({applyToStack:t=>{var n;t.add((n=e,(e,t)=>async r=>{const{request:o}=r;if(!g.isInstance(o))return e(r);const{headers:i}=o,a=t?.userAgent?.map(gn)||[],s=(await n.defaultUserAgentProvider()).map(gn),c=n?.customUserAgent?.map(gn)||[],d=At(),l=(d?[d]:[]).concat([...s,...a,...c]).join(" "),u=[...s.filter((e=>e.startsWith("aws-sdk-"))),...c].join(" ");return"browser"!==n.runtime?(u&&(i[yn]=i[yn]?`${i[hn]} ${u}`:u),i[hn]=l):i[yn]=l,e({...r,request:o})}),wn)}});class bn{trace(){}debug(){}info(){}warn(){}error(){}}const vn=()=>{let e=[],t=[];const n=new Set,r=n=>(e.forEach((e=>{n.add(e.middleware,{...e})})),t.forEach((e=>{n.addRelativeTo(e.middleware,{...e})})),n),o=e=>{const t=[];return e.before.forEach((e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...o(e))})),t.push(e),e.after.reverse().forEach((e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...o(e))})),t},i=(n=!1)=>{const r=[],i=[],a={};e.forEach((e=>{const t={...e,before:[],after:[]};t.name&&(a[t.name]=t),r.push(t)})),t.forEach((e=>{const t={...e,before:[],after:[]};t.name&&(a[t.name]=t),i.push(t)})),i.forEach((e=>{if(e.toMiddleware){const t=a[e.toMiddleware];if(void 0===t){if(n)return;throw new Error(`${e.toMiddleware} is not found when adding ${e.name||"anonymous"} middleware ${e.relation} ${e.toMiddleware}`)}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}}));const s=(c=r,c.sort(((e,t)=>Sn[t.step]-Sn[e.step]||_n[t.priority||"normal"]-_n[e.priority||"normal"]))).map(o).reduce(((e,t)=>(e.push(...t),e)),[]);var c;return s},a={add:(t,r={})=>{const{name:o,override:i}=r,a={step:"initialize",priority:"normal",middleware:t,...r};if(o){if(n.has(o)){if(!i)throw new Error(`Duplicate middleware name '${o}'`);const t=e.findIndex((e=>e.name===o)),n=e[t];if(n.step!==a.step||n.priority!==a.priority)throw new Error(`"${o}" middleware with ${n.priority} priority in ${n.step} step cannot be overridden by same-name middleware with ${a.priority} priority in ${a.step} step.`);e.splice(t,1)}n.add(o)}e.push(a)},addRelativeTo:(e,r)=>{const{name:o,override:i}=r,a={middleware:e,...r};if(o){if(n.has(o)){if(!i)throw new Error(`Duplicate middleware name '${o}'`);const e=t.findIndex((e=>e.name===o)),n=t[e];if(n.toMiddleware!==a.toMiddleware||n.relation!==a.relation)throw new Error(`"${o}" middleware ${n.relation} "${n.toMiddleware}" middleware cannot be overridden by same-name middleware ${a.relation} "${a.toMiddleware}" middleware.`);t.splice(e,1)}n.add(o)}t.push(a)},clone:()=>r(vn()),use:e=>{e.applyToStack(a)},remove:r=>"string"==typeof r?(r=>{let o=!1;const i=e=>!e.name||e.name!==r||(o=!0,n.delete(r),!1);return e=e.filter(i),t=t.filter(i),o})(r):(r=>{let o=!1;const i=e=>e.middleware!==r||(o=!0,e.name&&n.delete(e.name),!1);return e=e.filter(i),t=t.filter(i),o})(r),removeByTag:r=>{let o=!1;const i=e=>{const{tags:t,name:i}=e;return!t||!t.includes(r)||(i&&n.delete(i),o=!0,!1)};return e=e.filter(i),t=t.filter(i),o},concat:e=>{const t=r(vn());return t.use(e),t},applyToStack:r,identify:()=>i(!0).map((e=>e.name+": "+(e.tags||[]).join(","))),resolve:(e,t)=>{for(const n of i().map((e=>e.middleware)).reverse())e=n(e,t);return e}};return a},Sn={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},_n={high:3,normal:2,low:1};class In{constructor(e){this.middlewareStack=vn(),this.config=e}send(e,t,n){const r="function"!=typeof t?t:void 0,o="function"==typeof t?t:n,i=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!o)return i(e).then((e=>e.output));i(e).then((e=>o(null,e.output)),(e=>o(e))).catch((()=>{}))}destroy(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()}}class xn{constructor(){this.middlewareStack=vn()}}const Cn="***SensitiveInformation***",Tn=e=>{if(null!=e){if("number"==typeof e){if(0!==e&&1!==e||Vn.warn(qn(`Expected boolean, got ${typeof e}: ${e}`)),0===e)return!1;if(1===e)return!0}if("string"==typeof e){const t=e.toLowerCase();if("false"!==t&&"true"!==t||Vn.warn(qn(`Expected boolean, got ${typeof e}: ${e}`)),"false"===t)return!1;if("true"===t)return!0}if("boolean"==typeof e)return e;throw new TypeError(`Expected boolean, got ${typeof e}: ${e}`)}},Pn=e=>{if(null!=e){if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&Vn.warn(qn(`Expected number but observed string: ${e}`)),t}if("number"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},Nn=Math.ceil(2**127*(2-2**-23)),An=e=>{if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},kn=e=>Dn(e,32),Dn=(e,t)=>{const n=An(e);if(void 0!==n&&Rn(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},Rn=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},On=(e,t)=>{if(null==e){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError("Expected a non-null value")}return e},Ln=e=>{if(null==e)return;if("object"==typeof e&&!Array.isArray(e))return e;const t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},Fn=e=>{if(null!=e){if("string"==typeof e)return e;if(["boolean","number","bigint"].includes(typeof e))return Vn.warn(qn(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},zn=e=>{if(null==e)return;const t=Ln(e),n=Object.entries(t).filter((([,e])=>null!=e)).map((([e])=>e));if(0===n.length)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(n.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${n} were not null.`);return t},Bn=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,Un=e=>{const t=e.match(Bn);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},$n=e=>"string"==typeof e?Mn(e):Pn(e),Mn=e=>{switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${e}`)}},jn=e=>kn("string"==typeof e?Un(e):e),qn=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter((e=>!e.includes("stackTraceWarning"))).join("\n"),Vn={warn:console.warn},Gn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Hn=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Kn=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=Hn.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[n,r,o,i,a,s,c,d,l]=t,u=(e=>(e=>Dn(e,16))("string"==typeof e?Un(e):e))(nr(r)),p=Zn(o,"month",1,12),m=Zn(i,"day",1,31),h=Jn(u,p,m,{hours:a,minutes:s,seconds:c,fractionalMilliseconds:d});return"Z"!=l.toUpperCase()&&h.setTime(h.getTime()-tr(l)),h},Wn=e=>{if(null==e)return;let t;if("number"==typeof e)t=e;else{if("string"!=typeof e)throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");t=(e=>Pn("string"==typeof e?Un(e):e))(e)}if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(1e3*t))},Jn=(e,t,n,r)=>{const o=t-1;return Xn(e,o,n),new Date(Date.UTC(e,o,n,Zn(r.hours,"hour",0,23),Zn(r.minutes,"minute",0,59),Zn(r.seconds,"seconds",0,60),er(r.fractionalMilliseconds)))},Qn=[31,28,31,30,31,30,31,31,30,31,30,31],Xn=(e,t,n)=>{let r=Qn[t];if(1===t&&Yn(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${Gn[t]} in ${e}: ${n}`)},Yn=e=>e%4==0&&(e%100!=0||e%400==0),Zn=(e,t,n,r)=>{const o=(e=>(e=>Dn(e,8))("string"==typeof e?Un(e):e))(nr(e));if(o<n||o>r)throw new TypeError(`${t} must be between ${n} and ${r}, inclusive`);return o},er=e=>null==e?0:1e3*(e=>(e=>{const t=Pn(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>Nn)throw new TypeError(`Expected 32-bit float, got ${e}`);return t})("string"==typeof e?Un(e):e))("0."+e),tr=e=>{const t=e[0];let n=1;if("+"==t)n=1;else{if("-"!=t)throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);n=-1}return n*(60*Number(e.substring(1,3))+Number(e.substring(4,6)))*60*1e3},nr=e=>{let t=0;for(;t<e.length-1&&"0"===e.charAt(t);)t++;return 0===t?e:e.slice(t)};class rr extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,rr.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}const or=(e,t={})=>{Object.entries(t).filter((([,e])=>void 0!==e)).forEach((([t,n])=>{null!=e[t]&&""!==e[t]||(e[t]=n)}));const n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e},ir=e=>({output:t,parsedBody:n,errorCode:r})=>{(({output:e,parsedBody:t,exceptionCtor:n,errorCode:r})=>{const o=ar(e),i=o.httpStatusCode?o.httpStatusCode+"":void 0,a=new n({name:t?.code||t?.Code||r||i||"UnknownError",$fault:"client",$metadata:o});throw or(a,t)})({output:t,parsedBody:n,exceptionCtor:e,errorCode:r})},ar=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),sr=e=>{switch(e){case"standard":case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}};let cr=!1;const dr=e=>{e&&!cr&&parseInt(e.substring(1,e.indexOf(".")))<14&&(cr=!0)};function lr(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}const ur=e=>{const t="#text";for(const n in e)e.hasOwnProperty(n)&&void 0!==e[n][t]?e[n]=e[n][t]:"object"==typeof e[n]&&null!==e[n]&&(e[n]=ur(e[n]));return e},pr=function(){const e=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(t,e.prototype),t};function mr(e,t,n){let r,o,i;if(void 0===t&&void 0===n)r={},i=e;else{if(r=e,"function"==typeof t)return o=t,i=n,yr(r,o,i);i=t}for(const e of Object.keys(i))Array.isArray(i[e])?fr(r,null,i,e):r[e]=i[e];return r}pr.prototype=Object.create(String.prototype,{constructor:{value:pr,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(pr,String);const hr=(e,t)=>{const n={};for(const r in t)fr(n,e,t,r);return n},yr=(e,t,n)=>mr(e,Object.entries(n).reduce(((e,[n,r])=>(Array.isArray(r)?e[n]=r:e[n]="function"==typeof r?[t,r()]:[t,r],e)),{})),fr=(e,t,n,r)=>{if(null!==t){let o=n[r];"function"==typeof o&&(o=[,o]);const[i=gr,a=wr,s=r]=o;return void(("function"==typeof i&&i(t[s])||"function"!=typeof i&&i)&&(e[r]=a(t[s])))}let[o,i]=n[r];if("function"==typeof i){let t;const n=void 0===o&&null!=(t=i()),a="function"==typeof o&&!!o(void 0)||"function"!=typeof o&&!!o;n?e[r]=t:a&&(e[r]=i())}else{const t=void 0===o&&null!=i,n="function"==typeof o&&!!o(i)||"function"!=typeof o&&!!o;(t||n)&&(e[r]=i)}},gr=e=>null!=e,wr=e=>e,Er=e=>{if(e!=e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}},br=e=>{if(null==e)return{};if(Array.isArray(e))return e.filter((e=>null!=e));if("object"==typeof e){const t={};for(const n of Object.keys(e))null!=e[n]&&(t[n]=br(e[n]));return t}return e};var vr;!function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"}(vr||(vr={}));class Sr{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/"}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){const e=new Sr({...this,headers:{...this.headers}});var t;return e.query&&(e.query=(t=e.query,Object.keys(t).reduce(((e,n)=>{const r=t[n];return{...e,[n]:Array.isArray(r)?[...r]:r}}),{}))),e}}class _r extends rr{constructor(e){super(e),Object.setPrototypeOf(this,_r.prototype)}}const Ir={ADD:"ADD",DELETE:"DELETE",PUT:"PUT"},xr={B:"B",N:"N",S:"S"},Cr={AVAILABLE:"AVAILABLE",CREATING:"CREATING",DELETED:"DELETED"},Tr={AWS_BACKUP:"AWS_BACKUP",SYSTEM:"SYSTEM",USER:"USER"},Pr={PAY_PER_REQUEST:"PAY_PER_REQUEST",PROVISIONED:"PROVISIONED"},Nr={HASH:"HASH",RANGE:"RANGE"},Ar={ALL:"ALL",INCLUDE:"INCLUDE",KEYS_ONLY:"KEYS_ONLY"},kr={AES256:"AES256",KMS:"KMS"},Dr={DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLED:"ENABLED",ENABLING:"ENABLING",UPDATING:"UPDATING"},Rr={KEYS_ONLY:"KEYS_ONLY",NEW_AND_OLD_IMAGES:"NEW_AND_OLD_IMAGES",NEW_IMAGE:"NEW_IMAGE",OLD_IMAGE:"OLD_IMAGE"},Or={DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLED:"ENABLED",ENABLING:"ENABLING"};class Lr extends _r{constructor(e){super({name:"BackupInUseException",$fault:"client",...e}),this.name="BackupInUseException",this.$fault="client",Object.setPrototypeOf(this,Lr.prototype)}}class Fr extends _r{constructor(e){super({name:"BackupNotFoundException",$fault:"client",...e}),this.name="BackupNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Fr.prototype)}}const zr={ALL:"ALL",AWS_BACKUP:"AWS_BACKUP",SYSTEM:"SYSTEM",USER:"USER"},Br={INDEXES:"INDEXES",NONE:"NONE",TOTAL:"TOTAL"},Ur={AccessDenied:"AccessDenied",ConditionalCheckFailed:"ConditionalCheckFailed",DuplicateItem:"DuplicateItem",InternalServerError:"InternalServerError",ItemCollectionSizeLimitExceeded:"ItemCollectionSizeLimitExceeded",ProvisionedThroughputExceeded:"ProvisionedThroughputExceeded",RequestLimitExceeded:"RequestLimitExceeded",ResourceNotFound:"ResourceNotFound",ThrottlingError:"ThrottlingError",TransactionConflict:"TransactionConflict",ValidationError:"ValidationError"};class $r extends _r{constructor(e){super({name:"InternalServerError",$fault:"server",...e}),this.name="InternalServerError",this.$fault="server",Object.setPrototypeOf(this,$r.prototype)}}class Mr extends _r{constructor(e){super({name:"RequestLimitExceeded",$fault:"client",...e}),this.name="RequestLimitExceeded",this.$fault="client",Object.setPrototypeOf(this,Mr.prototype)}}class jr extends _r{constructor(e){super({name:"InvalidEndpointException",$fault:"client",...e}),this.name="InvalidEndpointException",this.$fault="client",Object.setPrototypeOf(this,jr.prototype),this.Message=e.Message}}class qr extends _r{constructor(e){super({name:"ProvisionedThroughputExceededException",$fault:"client",...e}),this.name="ProvisionedThroughputExceededException",this.$fault="client",Object.setPrototypeOf(this,qr.prototype)}}class Vr extends _r{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Vr.prototype)}}const Gr={NONE:"NONE",SIZE:"SIZE"};class Hr extends _r{constructor(e){super({name:"ItemCollectionSizeLimitExceededException",$fault:"client",...e}),this.name="ItemCollectionSizeLimitExceededException",this.$fault="client",Object.setPrototypeOf(this,Hr.prototype)}}const Kr={BEGINS_WITH:"BEGINS_WITH",BETWEEN:"BETWEEN",CONTAINS:"CONTAINS",EQ:"EQ",GE:"GE",GT:"GT",IN:"IN",LE:"LE",LT:"LT",NE:"NE",NOT_CONTAINS:"NOT_CONTAINS",NOT_NULL:"NOT_NULL",NULL:"NULL"};class Wr extends _r{constructor(e){super({name:"ConditionalCheckFailedException",$fault:"client",...e}),this.name="ConditionalCheckFailedException",this.$fault="client",Object.setPrototypeOf(this,Wr.prototype)}}const Jr={AND:"AND",OR:"OR"},Qr={ALL_OLD:"ALL_OLD",NONE:"NONE"},Xr={DISABLED:"DISABLED",ENABLED:"ENABLED"},Yr={DISABLED:"DISABLED",ENABLED:"ENABLED"};class Zr extends _r{constructor(e){super({name:"ContinuousBackupsUnavailableException",$fault:"client",...e}),this.name="ContinuousBackupsUnavailableException",this.$fault="client",Object.setPrototypeOf(this,Zr.prototype)}}const eo={DISABLE:"DISABLE",ENABLE:"ENABLE"},to={DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLED:"ENABLED",ENABLING:"ENABLING",FAILED:"FAILED"};class no extends _r{constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),this.name="LimitExceededException",this.$fault="client",Object.setPrototypeOf(this,no.prototype)}}class ro extends _r{constructor(e){super({name:"TableInUseException",$fault:"client",...e}),this.name="TableInUseException",this.$fault="client",Object.setPrototypeOf(this,ro.prototype)}}class oo extends _r{constructor(e){super({name:"TableNotFoundException",$fault:"client",...e}),this.name="TableNotFoundException",this.$fault="client",Object.setPrototypeOf(this,oo.prototype)}}const io={ACTIVE:"ACTIVE",CREATING:"CREATING",DELETING:"DELETING",UPDATING:"UPDATING"},ao={ACTIVE:"ACTIVE",CREATING:"CREATING",CREATION_FAILED:"CREATION_FAILED",DELETING:"DELETING",INACCESSIBLE_ENCRYPTION_CREDENTIALS:"INACCESSIBLE_ENCRYPTION_CREDENTIALS",REGION_DISABLED:"REGION_DISABLED",UPDATING:"UPDATING"},so={STANDARD:"STANDARD",STANDARD_INFREQUENT_ACCESS:"STANDARD_INFREQUENT_ACCESS"};class co extends _r{constructor(e){super({name:"GlobalTableAlreadyExistsException",$fault:"client",...e}),this.name="GlobalTableAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,co.prototype)}}const lo={ACTIVE:"ACTIVE",CREATING:"CREATING",DELETING:"DELETING",UPDATING:"UPDATING"},uo={ACTIVE:"ACTIVE",ARCHIVED:"ARCHIVED",ARCHIVING:"ARCHIVING",CREATING:"CREATING",DELETING:"DELETING",INACCESSIBLE_ENCRYPTION_CREDENTIALS:"INACCESSIBLE_ENCRYPTION_CREDENTIALS",UPDATING:"UPDATING"};class po extends _r{constructor(e){super({name:"ResourceInUseException",$fault:"client",...e}),this.name="ResourceInUseException",this.$fault="client",Object.setPrototypeOf(this,po.prototype)}}const mo={ALL_NEW:"ALL_NEW",ALL_OLD:"ALL_OLD",NONE:"NONE",UPDATED_NEW:"UPDATED_NEW",UPDATED_OLD:"UPDATED_OLD"};class ho extends _r{constructor(e){super({name:"TransactionConflictException",$fault:"client",...e}),this.name="TransactionConflictException",this.$fault="client",Object.setPrototypeOf(this,ho.prototype)}}const yo={DYNAMODB_JSON:"DYNAMODB_JSON",ION:"ION"},fo={COMPLETED:"COMPLETED",FAILED:"FAILED",IN_PROGRESS:"IN_PROGRESS"},go={AES256:"AES256",KMS:"KMS"};class wo extends _r{constructor(e){super({name:"ExportNotFoundException",$fault:"client",...e}),this.name="ExportNotFoundException",this.$fault="client",Object.setPrototypeOf(this,wo.prototype)}}class Eo extends _r{constructor(e){super({name:"GlobalTableNotFoundException",$fault:"client",...e}),this.name="GlobalTableNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Eo.prototype)}}const bo={CANCELLED:"CANCELLED",CANCELLING:"CANCELLING",COMPLETED:"COMPLETED",FAILED:"FAILED",IN_PROGRESS:"IN_PROGRESS"},vo={GZIP:"GZIP",NONE:"NONE",ZSTD:"ZSTD"},So={CSV:"CSV",DYNAMODB_JSON:"DYNAMODB_JSON",ION:"ION"};class _o extends _r{constructor(e){super({name:"ImportNotFoundException",$fault:"client",...e}),this.name="ImportNotFoundException",this.$fault="client",Object.setPrototypeOf(this,_o.prototype)}}const Io={ACTIVE:"ACTIVE",DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLE_FAILED:"ENABLE_FAILED",ENABLING:"ENABLING"};class xo extends _r{constructor(e){super({name:"DuplicateItemException",$fault:"client",...e}),this.name="DuplicateItemException",this.$fault="client",Object.setPrototypeOf(this,xo.prototype)}}class Co extends _r{constructor(e){super({name:"IdempotentParameterMismatchException",$fault:"client",...e}),this.name="IdempotentParameterMismatchException",this.$fault="client",Object.setPrototypeOf(this,Co.prototype),this.Message=e.Message}}class To extends _r{constructor(e){super({name:"TransactionInProgressException",$fault:"client",...e}),this.name="TransactionInProgressException",this.$fault="client",Object.setPrototypeOf(this,To.prototype),this.Message=e.Message}}class Po extends _r{constructor(e){super({name:"ExportConflictException",$fault:"client",...e}),this.name="ExportConflictException",this.$fault="client",Object.setPrototypeOf(this,Po.prototype)}}class No extends _r{constructor(e){super({name:"InvalidExportTimeException",$fault:"client",...e}),this.name="InvalidExportTimeException",this.$fault="client",Object.setPrototypeOf(this,No.prototype)}}class Ao extends _r{constructor(e){super({name:"PointInTimeRecoveryUnavailableException",$fault:"client",...e}),this.name="PointInTimeRecoveryUnavailableException",this.$fault="client",Object.setPrototypeOf(this,Ao.prototype)}}class ko extends _r{constructor(e){super({name:"ImportConflictException",$fault:"client",...e}),this.name="ImportConflictException",this.$fault="client",Object.setPrototypeOf(this,ko.prototype)}}const Do={ALL_ATTRIBUTES:"ALL_ATTRIBUTES",ALL_PROJECTED_ATTRIBUTES:"ALL_PROJECTED_ATTRIBUTES",COUNT:"COUNT",SPECIFIC_ATTRIBUTES:"SPECIFIC_ATTRIBUTES"};class Ro extends _r{constructor(e){super({name:"TableAlreadyExistsException",$fault:"client",...e}),this.name="TableAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,Ro.prototype)}}class Oo extends _r{constructor(e){super({name:"InvalidRestoreTimeException",$fault:"client",...e}),this.name="InvalidRestoreTimeException",this.$fault="client",Object.setPrototypeOf(this,Oo.prototype)}}class Lo extends _r{constructor(e){super({name:"ReplicaAlreadyExistsException",$fault:"client",...e}),this.name="ReplicaAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,Lo.prototype)}}class Fo extends _r{constructor(e){super({name:"ReplicaNotFoundException",$fault:"client",...e}),this.name="ReplicaNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Fo.prototype)}}class zo extends _r{constructor(e){super({name:"IndexNotFoundException",$fault:"client",...e}),this.name="IndexNotFoundException",this.$fault="client",Object.setPrototypeOf(this,zo.prototype)}}var Bo;!function(e){e.visit=(e,t)=>void 0!==e.S?t.S(e.S):void 0!==e.N?t.N(e.N):void 0!==e.B?t.B(e.B):void 0!==e.SS?t.SS(e.SS):void 0!==e.NS?t.NS(e.NS):void 0!==e.BS?t.BS(e.BS):void 0!==e.M?t.M(e.M):void 0!==e.L?t.L(e.L):void 0!==e.NULL?t.NULL(e.NULL):void 0!==e.BOOL?t.BOOL(e.BOOL):t._(e.$unknown[0],e.$unknown[1])}(Bo||(Bo={}));class Uo extends _r{constructor(e){super({name:"TransactionCanceledException",$fault:"client",...e}),this.name="TransactionCanceledException",this.$fault="client",Object.setPrototypeOf(this,Uo.prototype),this.Message=e.Message,this.CancellationReasons=e.CancellationReasons}}const $o=async(e,t)=>{const n=e.body,r=br(n),o=new Lr({$metadata:Ba(e),...r});return or(o,n)},Mo=async(e,t)=>{const n=e.body,r=br(n),o=new Fr({$metadata:Ba(e),...r});return or(o,n)},jo=async(e,t)=>{const n=e.body,r=br(n),o=new Wr({$metadata:Ba(e),...r});return or(o,n)},qo=async(e,t)=>{const n=e.body,r=br(n),o=new Zr({$metadata:Ba(e),...r});return or(o,n)},Vo=async(e,t)=>{const n=e.body,r=br(n),o=new xo({$metadata:Ba(e),...r});return or(o,n)},Go=async(e,t)=>{const n=e.body,r=br(n),o=new Po({$metadata:Ba(e),...r});return or(o,n)},Ho=async(e,t)=>{const n=e.body,r=br(n),o=new wo({$metadata:Ba(e),...r});return or(o,n)},Ko=async(e,t)=>{const n=e.body,r=br(n),o=new co({$metadata:Ba(e),...r});return or(o,n)},Wo=async(e,t)=>{const n=e.body,r=br(n),o=new Eo({$metadata:Ba(e),...r});return or(o,n)},Jo=async(e,t)=>{const n=e.body,r=br(n),o=new Co({$metadata:Ba(e),...r});return or(o,n)},Qo=async(e,t)=>{const n=e.body,r=br(n),o=new ko({$metadata:Ba(e),...r});return or(o,n)},Xo=async(e,t)=>{const n=e.body,r=br(n),o=new _o({$metadata:Ba(e),...r});return or(o,n)},Yo=async(e,t)=>{const n=e.body,r=br(n),o=new zo({$metadata:Ba(e),...r});return or(o,n)},Zo=async(e,t)=>{const n=e.body,r=br(n),o=new $r({$metadata:Ba(e),...r});return or(o,n)},ei=async(e,t)=>{const n=e.body,r=br(n),o=new jr({$metadata:Ba(e),...r});return or(o,n)},ti=async(e,t)=>{const n=e.body,r=br(n),o=new No({$metadata:Ba(e),...r});return or(o,n)},ni=async(e,t)=>{const n=e.body,r=br(n),o=new Oo({$metadata:Ba(e),...r});return or(o,n)},ri=async(e,t)=>{const n=e.body,r=br(n),o=new Hr({$metadata:Ba(e),...r});return or(o,n)},oi=async(e,t)=>{const n=e.body,r=br(n),o=new no({$metadata:Ba(e),...r});return or(o,n)},ii=async(e,t)=>{const n=e.body,r=br(n),o=new Ao({$metadata:Ba(e),...r});return or(o,n)},ai=async(e,t)=>{const n=e.body,r=br(n),o=new qr({$metadata:Ba(e),...r});return or(o,n)},si=async(e,t)=>{const n=e.body,r=br(n),o=new Lo({$metadata:Ba(e),...r});return or(o,n)},ci=async(e,t)=>{const n=e.body,r=br(n),o=new Fo({$metadata:Ba(e),...r});return or(o,n)},di=async(e,t)=>{const n=e.body,r=br(n),o=new Mr({$metadata:Ba(e),...r});return or(o,n)},li=async(e,t)=>{const n=e.body,r=br(n),o=new po({$metadata:Ba(e),...r});return or(o,n)},ui=async(e,t)=>{const n=e.body,r=br(n),o=new Vr({$metadata:Ba(e),...r});return or(o,n)},pi=async(e,t)=>{const n=e.body,r=br(n),o=new Ro({$metadata:Ba(e),...r});return or(o,n)},mi=async(e,t)=>{const n=e.body,r=br(n),o=new ro({$metadata:Ba(e),...r});return or(o,n)},hi=async(e,t)=>{const n=e.body,r=br(n),o=new oo({$metadata:Ba(e),...r});return or(o,n)},yi=async(e,t)=>{const n=e.body,r=La(n,t),o=new Uo({$metadata:Ba(e),...r});return or(o,n)},fi=async(e,t)=>{const n=e.body,r=br(n),o=new ho({$metadata:Ba(e),...r});return or(o,n)},gi=async(e,t)=>{const n=e.body,r=br(n),o=new To({$metadata:Ba(e),...r});return or(o,n)},wi=(e,t)=>Bo.visit(e,{B:e=>({B:t.base64Encoder(e)}),BOOL:e=>({BOOL:e}),BS:e=>({BS:Ii(e,t)}),L:e=>({L:Di(e,t)}),M:e=>({M:Ri(e,t)}),N:e=>({N:e}),NS:e=>({NS:br(e)}),NULL:e=>({NULL:e}),S:e=>({S:e}),SS:e=>({SS:br(e)}),_:(e,t)=>({name:t})}),Ei=(e,t)=>e.filter((e=>null!=e)).map((e=>wi(e,t))),bi=(e,t)=>hr(e,{AutoScalingDisabled:[],AutoScalingRoleArn:[],MaximumUnits:[],MinimumUnits:[],ScalingPolicyUpdate:e=>((e,t)=>hr(e,{PolicyName:[],TargetTrackingScalingPolicyConfiguration:e=>vi(e,t)}))(e,t)}),vi=(e,t)=>hr(e,{DisableScaleIn:[],ScaleInCooldown:[],ScaleOutCooldown:[],TargetValue:Er}),Si=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=ki(r,t)),e)),{}),_i=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Hi(r,t)),e)),{}),Ii=(e,t)=>e.filter((e=>null!=e)).map((e=>t.base64Encoder(e))),xi=(e,t)=>hr(e,{AttributeValueList:e=>Ei(e,t),ComparisonOperator:[]}),Ci=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ti(r,t)),e)),{}),Ti=(e,t)=>hr(e,{AttributeValueList:e=>Ei(e,t),ComparisonOperator:[],Exists:[],Value:e=>wi(e,t)}),Pi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=wi(r,t)),e)),{}),Ni=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=xi(r,t)),e)),{}),Ai=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=wi(r,t)),e)),{}),ki=(e,t)=>hr(e,{AttributesToGet:br,ConsistentRead:[],ExpressionAttributeNames:br,Keys:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>Ai(e,t))))(e,t),ProjectionExpression:[]}),Di=(e,t)=>e.filter((e=>null!=e)).map((e=>wi(e,t))),Ri=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=wi(r,t)),e)),{}),Oi=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Parameters:e=>Fi(e,t),Statement:[]}))(e,t))),Li=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{ConsistentRead:[],Parameters:e=>Fi(e,t),Statement:[]}))(e,t))),Fi=(e,t)=>e.filter((e=>null!=e)).map((e=>wi(e,t))),zi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=wi(r,t)),e)),{}),Bi=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:[],ProvisionedReadCapacityAutoScalingUpdate:e=>bi(e,t)}))(e,t))),Ui=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{RegionName:[],ReplicaGlobalSecondaryIndexSettingsUpdate:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:[],ProvisionedReadCapacityAutoScalingSettingsUpdate:e=>bi(e,t),ProvisionedReadCapacityUnits:[]}))(e,t))))(e,t),ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate:e=>bi(e,t),ReplicaProvisionedReadCapacityUnits:[],ReplicaTableClass:[]}))(e,t))),$i=(e,t)=>hr(e,{ReturnConsumedCapacity:[],TransactItems:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Get:e=>((e,t)=>hr(e,{ExpressionAttributeNames:br,Key:e=>Ai(e,t),ProjectionExpression:[],TableName:[]}))(e,t)}))(e,t))))(e,t)}),Mi=(e,t)=>hr(e,{ClientRequestToken:[!0,e=>e??be()],ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],TransactItems:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{ConditionCheck:e=>((e,t)=>hr(e,{ConditionExpression:[],ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Key:e=>Ai(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[]}))(e,t),Delete:e=>((e,t)=>hr(e,{ConditionExpression:[],ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Key:e=>Ai(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[]}))(e,t),Put:e=>((e,t)=>hr(e,{ConditionExpression:[],ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Item:e=>zi(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[]}))(e,t),Update:e=>ji(e,t)}))(e,t))))(e,t)}),ji=(e,t)=>hr(e,{ConditionExpression:[],ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Key:e=>Ai(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[],UpdateExpression:[]}),qi=(e,t)=>hr(e,{GlobalTableBillingMode:[],GlobalTableGlobalSecondaryIndexSettingsUpdate:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:[],ProvisionedWriteCapacityAutoScalingSettingsUpdate:e=>bi(e,t),ProvisionedWriteCapacityUnits:[]}))(e,t))))(e,t),GlobalTableName:[],GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate:e=>bi(e,t),GlobalTableProvisionedWriteCapacityUnits:[],ReplicaSettingsUpdate:e=>Ui(e,t)}),Vi=(e,t)=>hr(e,{AttributeUpdates:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=((e,t)=>hr(e,{Action:[],Value:e=>wi(e,t)}))(r,t)),e)),{}))(e,t),ConditionExpression:[],ConditionalOperator:[],Expected:e=>Ci(e,t),ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Key:e=>Ai(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],TableName:[],UpdateExpression:[]}),Gi=(e,t)=>hr(e,{GlobalSecondaryIndexUpdates:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:[],ProvisionedWriteCapacityAutoScalingUpdate:e=>bi(e,t)}))(e,t))))(e,t),ProvisionedWriteCapacityAutoScalingUpdate:e=>bi(e,t),ReplicaUpdates:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{RegionName:[],ReplicaGlobalSecondaryIndexUpdates:e=>Bi(e,t),ReplicaProvisionedReadCapacityAutoScalingUpdate:e=>bi(e,t)}))(e,t))))(e,t),TableName:[]}),Hi=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{DeleteRequest:e=>((e,t)=>hr(e,{Key:e=>Ai(e,t)}))(e,t),PutRequest:e=>((e,t)=>hr(e,{Item:e=>zi(e,t)}))(e,t)}))(e,t))),Ki=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Wi(zn(r),t)),e)),{}),Wi=(e,t)=>null!=e.B?{B:t.base64Decoder(e.B)}:void 0!==Tn(e.BOOL)?{BOOL:Tn(e.BOOL)}:null!=e.BS?{BS:ra(e.BS,t)}:null!=e.L?{L:wa(e.L,t)}:null!=e.M?{M:va(e.M,t)}:void 0!==Fn(e.N)?{N:Fn(e.N)}:null!=e.NS?{NS:br(e.NS)}:void 0!==Tn(e.NULL)?{NULL:Tn(e.NULL)}:void 0!==Fn(e.S)?{S:Fn(e.S)}:null!=e.SS?{SS:br(e.SS)}:{$unknown:Object.entries(e)[0]},Ji=(e,t)=>hr(e,{AutoScalingDisabled:Tn,AutoScalingRoleArn:Fn,MaximumUnits:An,MinimumUnits:An,ScalingPolicies:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{PolicyName:Fn,TargetTrackingScalingPolicyConfiguration:e=>Qi(e,t)}))(e,t)));return n})(e,t)}),Qi=(e,t)=>hr(e,{DisableScaleIn:Tn,ScaleInCooldown:kn,ScaleOutCooldown:kn,TargetValue:$n}),Xi=(e,t)=>hr(e,{BackupDetails:e=>Yi(e,t),SourceTableDetails:e=>Na(e,t),SourceTableFeatureDetails:e=>Aa(e,t)}),Yi=(e,t)=>hr(e,{BackupArn:Fn,BackupCreationDateTime:e=>On(Wn(Pn(e))),BackupExpiryDateTime:e=>On(Wn(Pn(e))),BackupName:Fn,BackupSizeBytes:An,BackupStatus:Fn,BackupType:Fn}),Zi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=ga(r,t)),e)),{}),ea=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=ha(r,t)),e)),{}),ta=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=za(r,t)),e)),{}),na=(e,t)=>hr(e,{BillingMode:Fn,LastUpdateToPayPerRequestDateTime:e=>On(Wn(Pn(e)))}),ra=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>t.base64Decoder(e)));return n},oa=(e,t)=>hr(e,{CapacityUnits:$n,ReadCapacityUnits:$n,WriteCapacityUnits:$n}),ia=(e,t)=>hr(e,{CapacityUnits:$n,GlobalSecondaryIndexes:e=>Pa(e,t),LocalSecondaryIndexes:e=>Pa(e,t),ReadCapacityUnits:$n,Table:e=>oa(e),TableName:Fn,WriteCapacityUnits:$n}),aa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>ia(e,t)));return n},sa=(e,t)=>hr(e,{ContinuousBackupsStatus:Fn,PointInTimeRecoveryDescription:e=>_a(e,t)}),ca=(e,t)=>hr(e,{BilledSizeBytes:An,ClientToken:Fn,EndTime:e=>On(Wn(Pn(e))),ExportArn:Fn,ExportFormat:Fn,ExportManifest:Fn,ExportStatus:Fn,ExportTime:e=>On(Wn(Pn(e))),FailureCode:Fn,FailureMessage:Fn,ItemCount:An,S3Bucket:Fn,S3BucketOwner:Fn,S3Prefix:Fn,S3SseAlgorithm:Fn,S3SseKmsKeyId:Fn,StartTime:e=>On(Wn(Pn(e))),TableArn:Fn,TableId:Fn}),da=(e,t)=>hr(e,{CreationDateTime:e=>On(Wn(Pn(e))),GlobalTableArn:Fn,GlobalTableName:Fn,GlobalTableStatus:Fn,ReplicationGroup:e=>xa(e,t)}),la=(e,t)=>hr(e,{ClientToken:Fn,CloudWatchLogGroupArn:Fn,EndTime:e=>On(Wn(Pn(e))),ErrorCount:An,FailureCode:Fn,FailureMessage:Fn,ImportArn:Fn,ImportStatus:Fn,ImportedItemCount:An,InputCompressionType:Fn,InputFormat:Fn,InputFormatOptions:br,ProcessedItemCount:An,ProcessedSizeBytes:An,S3BucketSource:br,StartTime:e=>On(Wn(Pn(e))),TableArn:Fn,TableCreationParameters:br,TableId:Fn}),ua=(e,t)=>hr(e,{ItemCollectionKey:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Wi(zn(r),t)),e)),{}))(e,t),SizeEstimateRangeGB:e=>ma(e,t)}),pa=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>ua(e,t)));return n})(r,t)),e)),{}),ma=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>$n(e)));return n},ha=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>Ki(e,t)));return n},ya=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Item:e=>Ki(e,t)}))(e,t)));return n},fa=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Wi(zn(r),t)),e)),{}),ga=(e,t)=>hr(e,{AttributesToGet:br,ConsistentRead:Tn,ExpressionAttributeNames:br,Keys:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>fa(e,t)));return n})(e,t),ProjectionExpression:Fn}),wa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>Wi(zn(e),t)));return n},Ea=(e,t)=>hr(e,{BackupSummaries:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{BackupArn:Fn,BackupCreationDateTime:e=>On(Wn(Pn(e))),BackupExpiryDateTime:e=>On(Wn(Pn(e))),BackupName:Fn,BackupSizeBytes:An,BackupStatus:Fn,BackupType:Fn,TableArn:Fn,TableId:Fn,TableName:Fn}))(e)));return n})(e),LastEvaluatedBackupArn:Fn}),ba=(e,t)=>hr(e,{ImportSummaryList:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{CloudWatchLogGroupArn:Fn,EndTime:e=>On(Wn(Pn(e))),ImportArn:Fn,ImportStatus:Fn,InputFormat:Fn,S3BucketSource:br,StartTime:e=>On(Wn(Pn(e))),TableArn:Fn}))(e)));return n})(e),NextToken:Fn}),va=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Wi(zn(r),t)),e)),{}),Sa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Error:br,Item:e=>Ki(e,t),TableName:Fn}))(e,t)));return n},_a=(e,t)=>hr(e,{EarliestRestorableDateTime:e=>On(Wn(Pn(e))),LatestRestorableDateTime:e=>On(Wn(Pn(e))),PointInTimeRecoveryStatus:Fn}),Ia=(e,t)=>hr(e,{LastDecreaseDateTime:e=>On(Wn(Pn(e))),LastIncreaseDateTime:e=>On(Wn(Pn(e))),NumberOfDecreasesToday:An,ReadCapacityUnits:An,WriteCapacityUnits:An}),xa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{GlobalSecondaryIndexes:br,KMSMasterKeyId:Fn,ProvisionedThroughputOverride:br,RegionName:Fn,ReplicaInaccessibleDateTime:e=>On(Wn(Pn(e))),ReplicaStatus:Fn,ReplicaStatusDescription:Fn,ReplicaStatusPercentProgress:Fn,ReplicaTableClassSummary:e=>Ra(e,t)}))(e,t)));return n},Ca=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:Fn,IndexStatus:Fn,ProvisionedReadCapacityAutoScalingSettings:e=>Ji(e,t),ProvisionedWriteCapacityAutoScalingSettings:e=>Ji(e,t)}))(e,t)));return n},Ta=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{RegionName:Fn,ReplicaBillingModeSummary:e=>na(e),ReplicaGlobalSecondaryIndexSettings:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:Fn,IndexStatus:Fn,ProvisionedReadCapacityAutoScalingSettings:e=>Ji(e,t),ProvisionedReadCapacityUnits:An,ProvisionedWriteCapacityAutoScalingSettings:e=>Ji(e,t),ProvisionedWriteCapacityUnits:An}))(e,t)));return n})(e,t),ReplicaProvisionedReadCapacityAutoScalingSettings:e=>Ji(e,t),ReplicaProvisionedReadCapacityUnits:An,ReplicaProvisionedWriteCapacityAutoScalingSettings:e=>Ji(e,t),ReplicaProvisionedWriteCapacityUnits:An,ReplicaStatus:Fn,ReplicaTableClassSummary:e=>Ra(e,t)}))(e,t)));return n},Pa=(e,t)=>Object.entries(e).reduce(((e,[t,n])=>(null===n||(e[t]=oa(n)),e)),{}),Na=(e,t)=>hr(e,{BillingMode:Fn,ItemCount:An,KeySchema:br,ProvisionedThroughput:br,TableArn:Fn,TableCreationDateTime:e=>On(Wn(Pn(e))),TableId:Fn,TableName:Fn,TableSizeBytes:An}),Aa=(e,t)=>hr(e,{GlobalSecondaryIndexes:br,LocalSecondaryIndexes:br,SSEDescription:e=>ka(e,t),StreamDescription:br,TimeToLiveDescription:br}),ka=(e,t)=>hr(e,{InaccessibleEncryptionDateTime:e=>On(Wn(Pn(e))),KMSMasterKeyArn:Fn,SSEType:Fn,Status:Fn}),Da=(e,t)=>hr(e,{Replicas:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{GlobalSecondaryIndexes:e=>Ca(e,t),RegionName:Fn,ReplicaProvisionedReadCapacityAutoScalingSettings:e=>Ji(e,t),ReplicaProvisionedWriteCapacityAutoScalingSettings:e=>Ji(e,t),ReplicaStatus:Fn}))(e,t)));return n})(e,t),TableName:Fn,TableStatus:Fn}),Ra=(e,t)=>hr(e,{LastUpdateDateTime:e=>On(Wn(Pn(e))),TableClass:Fn}),Oa=(e,t)=>hr(e,{ArchivalSummary:e=>((e,t)=>hr(e,{ArchivalBackupArn:Fn,ArchivalDateTime:e=>On(Wn(Pn(e))),ArchivalReason:Fn}))(e),AttributeDefinitions:br,BillingModeSummary:e=>na(e),CreationDateTime:e=>On(Wn(Pn(e))),DeletionProtectionEnabled:Tn,GlobalSecondaryIndexes:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Backfilling:Tn,IndexArn:Fn,IndexName:Fn,IndexSizeBytes:An,IndexStatus:Fn,ItemCount:An,KeySchema:br,Projection:br,ProvisionedThroughput:e=>Ia(e,t)}))(e,t)));return n})(e,t),GlobalTableVersion:Fn,ItemCount:An,KeySchema:br,LatestStreamArn:Fn,LatestStreamLabel:Fn,LocalSecondaryIndexes:br,ProvisionedThroughput:e=>Ia(e,t),Replicas:e=>xa(e,t),RestoreSummary:e=>((e,t)=>hr(e,{RestoreDateTime:e=>On(Wn(Pn(e))),RestoreInProgress:Tn,SourceBackupArn:Fn,SourceTableArn:Fn}))(e),SSEDescription:e=>ka(e,t),StreamSpecification:br,TableArn:Fn,TableClassSummary:e=>Ra(e,t),TableId:Fn,TableName:Fn,TableSizeBytes:An,TableStatus:Fn}),La=(e,t)=>hr(e,{CancellationReasons:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Code:Fn,Item:e=>Ki(e,t),Message:Fn}))(e,t)));return n})(e,t),Message:Fn}),Fa=(e,t)=>hr(e,{DeleteRequest:e=>((e,t)=>hr(e,{Key:e=>fa(e,t)}))(e,t),PutRequest:e=>((e,t)=>hr(e,{Item:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Wi(zn(r),t)),e)),{}))(e,t)}))(e,t)}),za=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>Fa(e,t)));return n},Ba=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Ua=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),$a=ir(_r),Ma=async(e,t,n,r,o)=>{const{hostname:i,protocol:a="https",port:s,path:c}=await e.endpoint(),d={protocol:a,hostname:i,port:s,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+n:c+n,headers:t};return void 0!==r&&(d.hostname=r),void 0!==o&&(d.body=o),new Sr(d)};function ja(e){return{"content-type":"application/x-amz-json-1.0","x-amz-target":`DynamoDB_20120810.${e}`}}const qa=(e,t)=>((e,t)=>Ua(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),Va=async(e,t)=>{const n=await qa(e,t);return n.message=n.message??n.Message,n},Ga=(e,t)=>{const n=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(o=e.headers,"x-amzn-errortype",Object.keys(o).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var o;return void 0!==r?n(e.headers[r]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0};class Ha extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ha.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeEndpointsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeEndpoints");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body),o=n.body;return $a({output:e,parsedBody:o,errorCode:r})})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Ka extends rr{constructor(e){super(e),Object.setPrototypeOf(this,Ka.prototype)}}class Wa extends Ka{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,Wa.prototype)}}class Ja extends Ka{constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,Ja.prototype)}}class Qa extends Ka{constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,Qa.prototype)}}class Xa extends Ka{constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,Xa.prototype)}}class Ya extends Ka{constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,Ya.prototype)}}class Za extends Ka{constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,Za.prototype)}}class es extends Ka{constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,es.prototype)}}const ts=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:Cn}}),ns=e=>({...e,...e.Credentials&&{Credentials:ts(e.Credentials)}}),rs=e=>({...e,...e.WebIdentityToken&&{WebIdentityToken:Cn}}),os=e=>({...e,...e.Credentials&&{Credentials:ts(e.Credentials)}});var is=r(6932);const as=async(e,t)=>{const n=e.body,r=Ss(n.Error,t),o=new Wa({$metadata:Ns(e),...r});return or(o,n)},ss=async(e,t)=>{const n=e.body,r=_s(n.Error,t),o=new es({$metadata:Ns(e),...r});return or(o,n)},cs=async(e,t)=>{const n=e.body,r=Is(n.Error,t),o=new Ya({$metadata:Ns(e),...r});return or(o,n)},ds=async(e,t)=>{const n=e.body,r=xs(n.Error,t),o=new Za({$metadata:Ns(e),...r});return or(o,n)},ls=async(e,t)=>{const n=e.body,r=Cs(n.Error,t),o=new Ja({$metadata:Ns(e),...r});return or(o,n)},us=async(e,t)=>{const n=e.body,r=Ts(n.Error,t),o=new Qa({$metadata:Ns(e),...r});return or(o,n)},ps=async(e,t)=>{const n=e.body,r=Ps(n.Error,t),o=new Xa({$metadata:Ns(e),...r});return or(o,n)},ms=(e,t)=>{const n={};if(null!=e.RoleArn&&(n.RoleArn=e.RoleArn),null!=e.RoleSessionName&&(n.RoleSessionName=e.RoleSessionName),null!=e.PolicyArns){const r=ys(e.PolicyArns,t);0===e.PolicyArns?.length&&(n.PolicyArns=[]),Object.entries(r).forEach((([e,t])=>{n[`PolicyArns.${e}`]=t}))}if(null!=e.Policy&&(n.Policy=e.Policy),null!=e.DurationSeconds&&(n.DurationSeconds=e.DurationSeconds),null!=e.Tags){const r=Es(e.Tags,t);0===e.Tags?.length&&(n.Tags=[]),Object.entries(r).forEach((([e,t])=>{n[`Tags.${e}`]=t}))}if(null!=e.TransitiveTagKeys){const r=ws(e.TransitiveTagKeys,t);0===e.TransitiveTagKeys?.length&&(n.TransitiveTagKeys=[]),Object.entries(r).forEach((([e,t])=>{n[`TransitiveTagKeys.${e}`]=t}))}return null!=e.ExternalId&&(n.ExternalId=e.ExternalId),null!=e.SerialNumber&&(n.SerialNumber=e.SerialNumber),null!=e.TokenCode&&(n.TokenCode=e.TokenCode),null!=e.SourceIdentity&&(n.SourceIdentity=e.SourceIdentity),n},hs=(e,t)=>{const n={};if(null!=e.RoleArn&&(n.RoleArn=e.RoleArn),null!=e.RoleSessionName&&(n.RoleSessionName=e.RoleSessionName),null!=e.WebIdentityToken&&(n.WebIdentityToken=e.WebIdentityToken),null!=e.ProviderId&&(n.ProviderId=e.ProviderId),null!=e.PolicyArns){const r=ys(e.PolicyArns,t);0===e.PolicyArns?.length&&(n.PolicyArns=[]),Object.entries(r).forEach((([e,t])=>{n[`PolicyArns.${e}`]=t}))}return null!=e.Policy&&(n.Policy=e.Policy),null!=e.DurationSeconds&&(n.DurationSeconds=e.DurationSeconds),n},ys=(e,t)=>{const n={};let r=1;for(const o of e){if(null===o)continue;const e=fs(o,t);Object.entries(e).forEach((([e,t])=>{n[`member.${r}.${e}`]=t})),r++}return n},fs=(e,t)=>{const n={};return null!=e.arn&&(n.arn=e.arn),n},gs=(e,t)=>{const n={};return null!=e.Key&&(n.Key=e.Key),null!=e.Value&&(n.Value=e.Value),n},ws=(e,t)=>{const n={};let r=1;for(const t of e)null!==t&&(n[`member.${r}`]=t,r++);return n},Es=(e,t)=>{const n={};let r=1;for(const t of e){if(null===t)continue;const e=gs(t);Object.entries(e).forEach((([e,t])=>{n[`member.${r}.${e}`]=t})),r++}return n},bs=(e,t)=>{const n={};return void 0!==e.AssumedRoleId&&(n.AssumedRoleId=Fn(e.AssumedRoleId)),void 0!==e.Arn&&(n.Arn=Fn(e.Arn)),n},vs=(e,t)=>{const n={};return void 0!==e.AccessKeyId&&(n.AccessKeyId=Fn(e.AccessKeyId)),void 0!==e.SecretAccessKey&&(n.SecretAccessKey=Fn(e.SecretAccessKey)),void 0!==e.SessionToken&&(n.SessionToken=Fn(e.SessionToken)),void 0!==e.Expiration&&(n.Expiration=On(Kn(e.Expiration))),n},Ss=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},_s=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},Is=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},xs=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},Cs=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},Ts=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},Ps=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},Ns=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),As=ir(Ka),ks=async(e,t,n,r,o)=>{const{hostname:i,protocol:a="https",port:s,path:c}=await e.endpoint(),d={protocol:a,hostname:i,port:s,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+n:c+n,headers:t};return void 0!==r&&(d.hostname=r),void 0!==o&&(d.body=o),new Sr(d)},Ds={"content-type":"application/x-www-form-urlencoded"},Rs=(e,t)=>((e,t)=>((e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array))(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>{if(e.length){const t=new is.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>""===t.trim()&&t.includes("\n")?"":void 0});t.addEntity("#xD","\r"),t.addEntity("#10","\n");const n=t.parse(e),r="#text",o=Object.keys(n)[0],i=n[o];return i[r]&&(i[o]=i[r],delete i[r]),ur(i)}return{}})),Os=async(e,t)=>{const n=await Rs(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n},Ls=e=>Object.entries(e).map((([e,t])=>lr(e)+"="+lr(t))).join("&"),Fs=(e,t)=>void 0!==t.Error?.Code?t.Error.Code:404==e.statusCode?"NotFound":void 0;class zs extends xn{static getEndpointParameterInstructions(){return{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"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,zs.getEndpointParameterInstructions())),this.middlewareStack.use(St(t));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"STSClient",commandName:"AssumeRoleCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:ns},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=Ds;let r;return r=Ls({...ms(e,t),Action:"AssumeRole",Version:"2011-06-15"}),ks(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Os(e.body,t)},r=Fs(e,n.body);switch(r){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await as(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await ls(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await us(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await ps(n,t);default:const o=n.body;return As({output:e,parsedBody:o.Error,errorCode:r})}})(e,t);let n={};return n=((e,t)=>{const n={};return void 0!==e.Credentials&&(n.Credentials=vs(e.Credentials,t)),void 0!==e.AssumedRoleUser&&(n.AssumedRoleUser=bs(e.AssumedRoleUser)),void 0!==e.PackedPolicySize&&(n.PackedPolicySize=jn(e.PackedPolicySize)),void 0!==e.SourceIdentity&&(n.SourceIdentity=Fn(e.SourceIdentity)),n})((await Rs(e.body,t)).AssumeRoleResult,t),{$metadata:Ns(e),...n}})(e,t)}}class Bs extends xn{static getEndpointParameterInstructions(){return{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"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Bs.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"STSClient",commandName:"AssumeRoleWithWebIdentityCommand",inputFilterSensitiveLog:rs,outputFilterSensitiveLog:os},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=Ds;let r;return r=Ls({...hs(e,t),Action:"AssumeRoleWithWebIdentity",Version:"2011-06-15"}),ks(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Os(e.body,t)},r=Fs(e,n.body);switch(r){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await as(n,t);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await ss(n,t);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await cs(n,t);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await ds(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await ls(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await us(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await ps(n,t);default:const o=n.body;return As({output:e,parsedBody:o.Error,errorCode:r})}})(e,t);let n={};return n=((e,t)=>{const n={};return void 0!==e.Credentials&&(n.Credentials=vs(e.Credentials,t)),void 0!==e.SubjectFromWebIdentityToken&&(n.SubjectFromWebIdentityToken=Fn(e.SubjectFromWebIdentityToken)),void 0!==e.AssumedRoleUser&&(n.AssumedRoleUser=bs(e.AssumedRoleUser)),void 0!==e.PackedPolicySize&&(n.PackedPolicySize=jn(e.PackedPolicySize)),void 0!==e.Provider&&(n.Provider=Fn(e.Provider)),void 0!==e.Audience&&(n.Audience=Fn(e.Audience)),void 0!==e.SourceIdentity&&(n.SourceIdentity=Fn(e.SourceIdentity)),n})((await Rs(e.body,t)).AssumeRoleWithWebIdentityResult,t),{$metadata:Ns(e),...n}})(e,t)}}const Us="us-east-1",$s=e=>"function"!=typeof e?void 0===e?Us:e:async()=>{try{return await e()}catch(e){return Us}},Ms=(e,t)=>{let n,r;return async(o,i)=>{if(r=o,!n){const{logger:o,region:i,requestHandler:a}=e;n=new t({logger:o,credentialDefaultProvider:()=>async()=>r,region:$s(i||e.region),...a?{requestHandler:a}:{}})}const{Credentials:a}=await n.send(new zs(i));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${i.RoleArn}`);return{accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration}}},js=(e,t)=>{let n;return async r=>{if(!n){const{logger:r,region:o,requestHandler:i}=e;n=new t({logger:r,region:$s(o||e.region),...i?{requestHandler:i}:{}})}const{Credentials:o}=await n.send(new Bs(r));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration}}},qs=()=>async()=>{const e=process.env.AWS_ACCESS_KEY_ID,t=process.env.AWS_SECRET_ACCESS_KEY,n=process.env.AWS_SESSION_TOKEN,r=process.env.AWS_CREDENTIAL_EXPIRATION;if(e&&t)return{accessKeyId:e,secretAccessKey:t,...n&&{sessionToken:n},...r&&{expiration:new Date(r)}};throw new Te("Unable to find environment variable credentials.")};var Vs=r(2037),Gs=r(1017);const Hs=()=>{const{HOME:e,USERPROFILE:t,HOMEPATH:n,HOMEDRIVE:r=`C:${Gs.sep}`}=process.env;return e||t||(n?`${r}${n}`:(0,Vs.homedir)())},Ks="AWS_PROFILE",Ws=e=>e.profile||process.env[Ks]||"default",Js=e=>{const t=(0,pe.createHash)("sha1").update(e).digest("hex");return(0,Gs.join)(Hs(),".aws","sso","cache",`${t}.json`)};var Qs=r(7147);const{readFile:Xs}=Qs.promises,Ys=async e=>{const t=Js(e),n=await Xs(t,"utf8");return JSON.parse(n)},Zs=()=>process.env.AWS_CONFIG_FILE||(0,Gs.join)(Hs(),".aws","config"),ec=()=>process.env.AWS_SHARED_CREDENTIALS_FILE||(0,Gs.join)(Hs(),".aws","credentials"),tc=/^profile\s(["'])?([^\1]+)\1$/,nc=e=>Object.entries(e).filter((([e])=>tc.test(e))).reduce(((e,[t,n])=>({...e,[tc.exec(t)[2]]:n})),{...e.default&&{default:e.default}}),rc=["__proto__","profile __proto__"],oc=e=>{const t={};let n;for(let r of e.split(/\r?\n/))if(r=r.split(/(^|\s)[;#]/)[0].trim(),"["===r[0]&&"]"===r[r.length-1]){if(n=r.substring(1,r.length-1),rc.includes(n))throw new Error(`Found invalid profile name "${n}"`)}else if(n){const e=r.indexOf("="),o=0,i=r.length-1;if(-1!==e&&e!==o&&e!==i){const[o,i]=[r.substring(0,e).trim(),r.substring(e+1).trim()];t[n]=t[n]||{},t[n][o]=i}}return t},{readFile:ic}=Qs.promises,ac={},sc=(e,t)=>(ac[e]&&!t?.ignoreCache||(ac[e]=ic(e,"utf8")),ac[e]),cc=()=>({}),dc=async(e={})=>{const{filepath:t=ec(),configFilepath:n=Zs()}=e,r=await Promise.all([sc(n,{ignoreCache:e.ignoreCache}).then(oc).then(nc).catch(cc),sc(t,{ignoreCache:e.ignoreCache}).then(oc).catch(cc)]);return{configFile:r[0],credentialsFile:r[1]}},lc=/^sso-session\s(["'])?([^\1]+)\1$/,uc=e=>Object.entries(e).filter((([e])=>lc.test(e))).reduce(((e,[t,n])=>({...e,[lc.exec(t)[2]]:n})),{}),pc=()=>({}),mc=async(e={})=>sc(e.configFilepath??Zs()).then(oc).then(uc).catch(pc),hc=async e=>{const t=await dc(e);return((...e)=>{const t={};for(const n of e)for(const[e,r]of Object.entries(n))void 0!==t[e]?Object.assign(t[e],r):t[e]=r;return t})(t.configFile,t.credentialsFile)},yc=e(import.meta.url)("url"),fc=e(import.meta.url)("http");function gc(e){return new Promise(((t,n)=>{const r=(0,fc.request)({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});r.on("error",(e=>{n(Object.assign(new Ce("Unable to connect to instance metadata service"),e)),r.destroy()})),r.on("timeout",(()=>{n(new Ce("TimeoutError from instance metadata service")),r.destroy()})),r.on("response",(e=>{const{statusCode:o=400}=e;(o<200||300<=o)&&(n(Object.assign(new Ce("Error response received from instance metadata service"),{statusCode:o})),r.destroy());const i=[];e.on("data",(e=>{i.push(e)})),e.on("end",(()=>{t(Le.Buffer.concat(i)),r.destroy()}))})),r.end()}))}const wc=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.AccessKeyId&&"string"==typeof e.SecretAccessKey&&"string"==typeof e.Token&&"string"==typeof e.Expiration,Ec=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration)}),bc=({maxRetries:e=0,timeout:t=1e3})=>({maxRetries:e,timeout:t}),vc=(e,t)=>{let n=e();for(let r=0;r<t;r++)n=n.catch(e);return n},Sc="AWS_CONTAINER_CREDENTIALS_FULL_URI",_c="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",Ic="AWS_CONTAINER_AUTHORIZATION_TOKEN",xc=(e={})=>{const{timeout:t,maxRetries:n}=bc(e);return()=>vc((async()=>{const e=await Nc(),n=JSON.parse(await Cc(t,e));if(!wc(n))throw new Te("Invalid response received from instance metadata service.");return Ec(n)}),n)},Cc=async(e,t)=>(process.env[Ic]&&(t.headers={...t.headers,Authorization:process.env[Ic]}),(await gc({...t,timeout:e})).toString()),Tc={localhost:!0,"127.0.0.1":!0},Pc={"http:":!0,"https:":!0},Nc=async()=>{if(process.env[_c])return{hostname:"169.254.170.2",path:process.env[_c]};if(process.env[Sc]){const e=(0,yc.parse)(process.env[Sc]);if(!e.hostname||!(e.hostname in Tc))throw new Te(`${e.hostname} is not a valid container metadata service hostname`,!1);if(!e.protocol||!(e.protocol in Pc))throw new Te(`${e.protocol} is not a valid container metadata service protocol`,!1);return{...e,port:e.port?parseInt(e.port,10):void 0}}throw new Te(`The container metadata credential provider cannot be used unless the ${_c} or ${Sc} environment variable is set`,!1)},Ac=({environmentVariableSelector:e,configFileSelector:t,default:n},r={})=>{return Ae(Ne((o=e,async()=>{try{const e=o(process.env);if(void 0===e)throw new Error;return e}catch(e){throw new Te(e.message||`Cannot load config from environment variables with getter: ${o}`)}}),((e,{preferredFile:t="config",...n}={})=>async()=>{const r=Ws(n),{configFile:o,credentialsFile:i}=await dc(n),a=i[r]||{},s=o[r]||{},c="config"===t?{...a,...s}:{...s,...a};try{const t=e(c);if(void 0===t)throw new Error;return t}catch(t){throw new Te(t.message||`Cannot load config for profile ${r} in SDK configuration files with getter: ${e}`)}})(t,r),(e=>{return"function"==typeof e?async()=>await e():(t=e,()=>Promise.resolve(t));var t})(n)));var o};var kc;!function(e){e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]"}(kc||(kc={}));const Dc={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:e=>e.ec2_metadata_service_endpoint,default:void 0};var Rc;!function(e){e.IPv4="IPv4",e.IPv6="IPv6"}(Rc||(Rc={}));const Oc={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE,configFileSelector:e=>e.ec2_metadata_service_endpoint_mode,default:Rc.IPv4},Lc=async()=>R(await Fc()||await zc()),Fc=async()=>Ac(Dc)(),zc=async()=>{const e=await Ac(Oc)();switch(e){case Rc.IPv4:return kc.IPv4;case Rc.IPv6:return kc.IPv6;default:throw new Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(Rc)}`)}},Bc=(e,t)=>{const n=300+Math.floor(300*Math.random()),r=new Date(Date.now()+1e3*n);t.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html");const o=e.originalExpiration??e.expiration;return{...e,...o?{originalExpiration:o}:{},expiration:r}},Uc="/latest/meta-data/iam/security-credentials/",$c=(e={})=>((e,t={})=>{const n=t?.logger||console;let r;return async()=>{let t;try{t=await e(),t.expiration&&t.expiration.getTime()<Date.now()&&(t=Bc(t,n))}catch(e){if(!r)throw e;n.warn("Credential renew failed: ",e),t=Bc(r,n)}return r=t,t}})(Mc(e),{logger:e.logger}),Mc=e=>{let t=!1;const{timeout:n,maxRetries:r}=bc(e),o=async(e,n)=>{const r=(await vc((async()=>{let e;try{e=await qc(n)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e}),e)).trim();return vc((async()=>{let e;try{e=await Vc(r,n)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e}),e)};return async()=>{const e=await Lc();if(t)return o(r,{...e,timeout:n});{let i;try{i=(await jc({...e,timeout:n})).toString()}catch(i){if(400===i?.statusCode)throw Object.assign(i,{message:"EC2 Metadata token request returned error"});return("TimeoutError"===i.message||[403,404,405].includes(i.statusCode))&&(t=!0),o(r,{...e,timeout:n})}return o(r,{...e,headers:{"x-aws-ec2-metadata-token":i},timeout:n})}}},jc=async e=>gc({...e,path:"/latest/api/token",method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),qc=async e=>(await gc({...e,path:Uc})).toString(),Vc=async(e,t)=>{const n=JSON.parse((await gc({...t,path:Uc+e})).toString());if(!wc(n))throw new Te("Invalid response received from instance metadata service.");return Ec(n)},Gc=e(import.meta.url)("child_process"),Hc=e(import.meta.url)("util"),Kc=(e={})=>async()=>{const t=await hc(e);return(async(e,t)=>{const n=t[e];if(!t[e])throw new Te(`Profile ${e} could not be found in shared credentials file.`);{const t=n.credential_process;if(void 0===t)throw new Te(`Profile ${e} did not contain credential_process.`);{const n=(0,Hc.promisify)(Gc.exec);try{const{stdout:r}=await n(t);let o;try{o=JSON.parse(r.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,t)=>{if(1!==t.Version)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(void 0===t.AccessKeyId||void 0===t.SecretAccessKey)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(t.Expiration){const n=new Date;if(new Date(t.Expiration)<n)throw Error(`Profile ${e} credential_process returned expired credentials.`)}return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,...t.SessionToken&&{sessionToken:t.SessionToken},...t.Expiration&&{expiration:new Date(t.Expiration)}}})(e,o)}catch(e){throw new Te(e.message)}}}})(Ws(e),t)},Wc=e=>e&&("string"==typeof e.sso_start_url||"string"==typeof e.sso_account_id||"string"==typeof e.sso_session||"string"==typeof e.sso_region||"string"==typeof e.sso_role_name);class Jc{constructor(e,t){this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update(Ue(Qc(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?(0,pe.createHmac)(this.algorithmIdentifier,Qc(this.secret)):(0,pe.createHash)(this.algorithmIdentifier)}}function Qc(e,t){return Le.Buffer.isBuffer(e)?e:"string"==typeof e?ze(e,t):ArrayBuffer.isView(e)?Fe(e.buffer,e.byteOffset,e.byteLength):Fe(e)}const Xc=e(import.meta.url)("https"),Yc=["ECONNRESET","EPIPE","ETIMEDOUT"],Zc=e=>{const t={};for(const n of Object.keys(e)){const r=e[n];t[n]=Array.isArray(r)?r.join(","):r}return t},ed=e(import.meta.url)("stream");class td{constructor(e){this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise(((t,n)=>{"function"==typeof e?e().then((e=>{t(this.resolveDefaultConfig(e))})).catch(n):t(this.resolveDefaultConfig(e))}))}resolveDefaultConfig(e){const{requestTimeout:t,connectionTimeout:n,socketTimeout:r,httpAgent:o,httpsAgent:i}=e||{};return{connectionTimeout:n,requestTimeout:t??r,httpAgent:o||new fc.Agent({keepAlive:!0,maxSockets:50}),httpsAgent:i||new Xc.Agent({keepAlive:!0,maxSockets:50})}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t}={}){return this.config||(this.config=await this.configProvider),new Promise(((n,r)=>{let o;const i=async e=>{await o,r(e)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t?.aborted){const e=new Error("Request aborted");return e.name="AbortError",void i(e)}const a="https:"===e.protocol,s=function(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=st(n),Array.isArray(r))for(let e=0,o=r.length;e<o;e++)t.push(`${n}=${st(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${st(r)}`),t.push(e)}}return t.join("&")}(e.query||{}),c={headers:e.headers,host:e.hostname,method:e.method,path:s?`${e.path}?${s}`:e.path,port:e.port,agent:a?this.config.httpsAgent:this.config.httpAgent},d=(a?Xc.request:fc.request)(c,(e=>{(async e=>{await o,n(e)})({response:new w({statusCode:e.statusCode||-1,headers:Zc(e.headers),body:e})})}));d.on("error",(e=>{Yc.includes(e.code)?i(Object.assign(e,{name:"TimeoutError"})):i(e)})),((e,t,n=0)=>{n&&e.on("socket",(r=>{if(r.connecting){const o=setTimeout((()=>{e.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${n} ms`),{name:"TimeoutError"}))}),n);r.on("connect",(()=>{clearTimeout(o)}))}}))})(d,i,this.config.connectionTimeout),((e,t,n=0)=>{e.setTimeout(n,(()=>{e.destroy(),t(Object.assign(new Error(`Connection timed out after ${n} ms`),{name:"TimeoutError"}))}))})(d,i,this.config.requestTimeout),t&&(t.onabort=()=>{d.abort();const e=new Error("Request aborted");e.name="AbortError",i(e)});const l=c.agent;"object"==typeof l&&"keepAlive"in l&&((e,{keepAlive:t,keepAliveMsecs:n})=>{!0===t&&e.on("socket",(e=>{e.setKeepAlive(t,n||0)}))})(d,{keepAlive:l.keepAlive,keepAliveMsecs:l.keepAliveMsecs}),o=async function(e,t,n=1e3){const r=t.headers??{};"100-continue"===(r.Expect||r.expect)&&await Promise.race([new Promise((e=>{setTimeout(e,Math.max(1e3,n))})),new Promise((t=>{e.on("continue",(()=>{t()}))}))]),function(e,t){t instanceof ed.Readable?t.pipe(e):t?e.end(Buffer.from(t)):e.end()}(e,t.body)}(d,e,this.config.requestTimeout)}))}}e(import.meta.url)("http2"),Symbol.iterator;class nd extends ed.Writable{constructor(){super(...arguments),this.bufferedBytes=[]}_write(e,t,n){this.bufferedBytes.push(e),n()}}const rd=e=>new Promise(((t,n)=>{const r=new nd;e.pipe(r),e.on("error",(e=>{r.end(),n(e)})),r.on("error",n),r.on("finish",(function(){const e=new Uint8Array(Buffer.concat(this.bufferedBytes));t(e)}))})),od=e=>{if(!e)return 0;if("string"==typeof e)return Buffer.from(e).length;if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;if("string"==typeof e.path||Buffer.isBuffer(e.path))return(0,Qs.lstatSync)(e.path).size;if("number"==typeof e.fd)return(0,Qs.fstatSync)(e.fd).size;throw new Error(`Body Length computation failed for ${e}`)};var id=r(7282);const ad=({serviceId:e,clientVersion:t})=>{const n=[["aws-sdk-js",t],[`os/${(0,Vs.platform)()}`,(0,Vs.release)()],["lang/js"],["md/nodejs",`${id.versions.node}`]],o=(()=>{try{return r(8687)?["md/crt-avail"]:null}catch(e){return null}})();o&&n.push(o),e&&n.push([`api/${e}`,t]),id.env.AWS_EXECUTION_ENV&&n.push([`exec-env/${id.env.AWS_EXECUTION_ENV}`]);const i=Ac({environmentVariableSelector:e=>e.AWS_SDK_UA_APP_ID,configFileSelector:e=>e["sdk-ua-app-id"],default:void 0})();let a;return async()=>{if(!a){const e=await i;a=e?[...n,[`app/${e}`]]:[...n]}return a}},sd=/^[A-Za-z0-9+/]*={0,2}$/,cd=e=>{if(3*e.length%4!=0)throw new TypeError("Incorrect padding on base64 string.");if(!sd.exec(e))throw new TypeError("Invalid base64 string.");const t=ze(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},dd=e=>Fe(e.buffer,e.byteOffset,e.byteLength).toString("base64"),ld="required",ud="fn",pd="argv",md="ref",hd="PartitionResult",yd="tree",fd="error",gd="endpoint",wd={[ld]:!1,type:"String"},Ed={[ld]:!0,default:!1,type:"Boolean"},bd={[md]:"Endpoint"},vd={[ud]:"booleanEquals",[pd]:[{[md]:"UseFIPS"},!0]},Sd={[ud]:"booleanEquals",[pd]:[{[md]:"UseDualStack"},!0]},_d={},Id={[ud]:"booleanEquals",[pd]:[!0,{[ud]:"getAttr",[pd]:[{[md]:hd},"supportsFIPS"]}]},xd={[ud]:"booleanEquals",[pd]:[!0,{[ud]:"getAttr",[pd]:[{[md]:hd},"supportsDualStack"]}]},Cd=[bd],Td=[vd],Pd=[Sd],Nd={version:"1.0",parameters:{Region:wd,UseDualStack:Ed,UseFIPS:Ed,Endpoint:wd},rules:[{conditions:[{[ud]:"aws.partition",[pd]:[{[md]:"Region"}],assign:hd}],type:yd,rules:[{conditions:[{[ud]:"isSet",[pd]:Cd},{[ud]:"parseURL",[pd]:Cd,assign:"url"}],type:yd,rules:[{conditions:Td,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:fd},{type:yd,rules:[{conditions:Pd,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:fd},{endpoint:{url:bd,properties:_d,headers:_d},type:gd}]}]},{conditions:[vd,Sd],type:yd,rules:[{conditions:[Id,xd],type:yd,rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:_d,headers:_d},type:gd}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:fd}]},{conditions:Td,type:yd,rules:[{conditions:[Id],type:yd,rules:[{type:yd,rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:_d,headers:_d},type:gd}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:fd}]},{conditions:Pd,type:yd,rules:[{conditions:[xd],type:yd,rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:_d,headers:_d},type:gd}]},{error:"DualStack is enabled but this partition does not support DualStack",type:fd}]},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:_d,headers:_d},type:gd}]}]},Ad=(e,t={})=>mn(Nd,{endpointParams:e,logger:t.logger}),kd="AWS_REGION",Dd="AWS_DEFAULT_REGION",Rd=["in-region","cross-region","mobile","standard","legacy"],Od={environmentVariableSelector:e=>e.AWS_DEFAULTS_MODE,configFileSelector:e=>e.defaults_mode,default:"legacy"},Ld=({region:e=Ac(l),defaultsMode:t=Ac(Od)}={})=>Ae((async()=>{const n="function"==typeof t?await t():t;switch(n?.toLowerCase()){case"auto":return Fd(e);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(n?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Rd.join(", ")}, got ${n}`)}})),Fd=async e=>{if(e){const t="function"==typeof e?await e():e,n=await zd();return n?t===n?"in-region":"cross-region":"standard"}return"standard"},zd=async()=>{if(process.env.AWS_EXECUTION_ENV&&(process.env[kd]||process.env[Dd]))return process.env[kd]??process.env[Dd];if(!process.env.AWS_EC2_METADATA_DISABLED)try{const e=await Lc();return(await gc({...e,path:"/latest/meta-data/placement/region"})).toString()}catch(e){}};class Bd extends In{constructor(e){const t=(n=(e=>{dr(process.version);const t=Ld(e),n=()=>t().then(sr),r=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??cd,base64Encoder:e?.base64Encoder??dd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ad,logger:e?.logger??new bn,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??R,utf8Decoder:e?.utf8Decoder??Be,utf8Encoder:e?.utf8Encoder??$e}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??od,defaultUserAgentProvider:e?.defaultUserAgentProvider??ad({serviceId:r.serviceId,clientVersion:"3.338.0"}),maxAttempts:e?.maxAttempts??Ac(de),region:e?.region??Ac(l,u),requestHandler:e?.requestHandler??new td(n),retryMode:e?.retryMode??Ac({...ue,default:async()=>(await n()).retryMode||X}),sha256:e?.sha256??Jc.bind(null,"sha256"),streamCollector:e?.streamCollector??rd,useDualstackEndpoint:e?.useDualstackEndpoint??Ac(c),useFipsEndpoint:e?.useFipsEndpoint??Ac(d)}})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"});var n;const r=h(t),o=O(r),i=_t(le(o));super(i),this.config=i,this.middlewareStack.use(Ie(this.config)),this.middlewareStack.use(v(this.config)),this.middlewareStack.use(q(this.config)),this.middlewareStack.use(G(this.config)),this.middlewareStack.use(W(this.config)),this.middlewareStack.use(En(this.config))}destroy(){super.destroy()}}class Ud extends rr{constructor(e){super(e),Object.setPrototypeOf(this,Ud.prototype)}}class $d extends Ud{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,$d.prototype)}}class Md extends Ud{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Md.prototype)}}class jd extends Ud{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,jd.prototype)}}class qd extends Ud{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,qd.prototype)}}const Vd=e=>({...e,...e.accessToken&&{accessToken:Cn}}),Gd=e=>({...e,...e.secretAccessKey&&{secretAccessKey:Cn},...e.sessionToken&&{sessionToken:Cn}}),Hd=e=>({...e,...e.roleCredentials&&{roleCredentials:Gd(e.roleCredentials)}}),Kd=ir(Ud),Wd=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{message:Fn});Object.assign(n,o);const i=new $d({$metadata:Yd(e),...n});return or(i,e.body)},Jd=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{message:Fn});Object.assign(n,o);const i=new Md({$metadata:Yd(e),...n});return or(i,e.body)},Qd=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{message:Fn});Object.assign(n,o);const i=new jd({$metadata:Yd(e),...n});return or(i,e.body)},Xd=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{message:Fn});Object.assign(n,o);const i=new qd({$metadata:Yd(e),...n});return or(i,e.body)},Yd=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Zd=e=>!(null==e||""===e||Object.getOwnPropertyNames(e).includes("length")&&0==e.length||Object.getOwnPropertyNames(e).includes("size")&&0==e.size),el=(e,t)=>((e,t)=>((e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array))(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),tl=async(e,t)=>{const n=await el(e,t);return n.message=n.message??n.Message,n},nl=(e,t)=>{const n=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(o=e.headers,"x-amzn-errortype",Object.keys(o).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var o;return void 0!==r?n(e.headers[r]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0};class rl extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,rl.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"SSOClient",commandName:"GetRoleCredentialsCommand",inputFilterSensitiveLog:Vd,outputFilterSensitiveLog:Hd},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const{hostname:n,protocol:r="https",port:o,path:i}=await t.endpoint(),a=mr({},Zd,{"x-amz-sso_bearer_token":e.accessToken}),s=`${i?.endsWith("/")?i.slice(0,-1):i||""}/federation/credentials`,c=mr({role_name:[,On(e.roleName,"roleName")],account_id:[,On(e.accountId,"accountId")]});return new Sr({protocol:r,hostname:n,port:o,method:"GET",headers:a,path:s,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await tl(e.body,t)},r=nl(e,n.body);switch(r){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await Wd(n,t);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await Jd(n,t);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await Qd(n,t);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await Xd(n,t);default:const o=n.body;return Kd({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=mr({$metadata:Yd(e)}),r=On(Ln(await el(e.body,t)),"body"),o=hr(r,{roleCredentials:br});return Object.assign(n,o),n})(e,t)}}const ol="To refresh this SSO session run 'aws sso login' with the corresponding profile.";class il extends rr{constructor(e){super(e),Object.setPrototypeOf(this,il.prototype)}}class al extends il{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,al.prototype),this.error=e.error,this.error_description=e.error_description}}class sl extends il{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,sl.prototype),this.error=e.error,this.error_description=e.error_description}}class cl extends il{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,cl.prototype),this.error=e.error,this.error_description=e.error_description}}class dl extends il{constructor(e){super({name:"InternalServerException",$fault:"server",...e}),this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,dl.prototype),this.error=e.error,this.error_description=e.error_description}}class ll extends il{constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,ll.prototype),this.error=e.error,this.error_description=e.error_description}}class ul extends il{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,ul.prototype),this.error=e.error,this.error_description=e.error_description}}class pl extends il{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,pl.prototype),this.error=e.error,this.error_description=e.error_description}}class ml extends il{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,ml.prototype),this.error=e.error,this.error_description=e.error_description}}class hl extends il{constructor(e){super({name:"SlowDownException",$fault:"client",...e}),this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,hl.prototype),this.error=e.error,this.error_description=e.error_description}}class yl extends il{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,yl.prototype),this.error=e.error,this.error_description=e.error_description}}class fl extends il{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,fl.prototype),this.error=e.error,this.error_description=e.error_description}}const gl=ir(il),wl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new al({$metadata:Nl(e),...n});return or(i,e.body)},El=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new sl({$metadata:Nl(e),...n});return or(i,e.body)},bl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new cl({$metadata:Nl(e),...n});return or(i,e.body)},vl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new dl({$metadata:Nl(e),...n});return or(i,e.body)},Sl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new ll({$metadata:Nl(e),...n});return or(i,e.body)},_l=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new ul({$metadata:Nl(e),...n});return or(i,e.body)},Il=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new pl({$metadata:Nl(e),...n});return or(i,e.body)},xl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new ml({$metadata:Nl(e),...n});return or(i,e.body)},Cl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new hl({$metadata:Nl(e),...n});return or(i,e.body)},Tl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new yl({$metadata:Nl(e),...n});return or(i,e.body)},Pl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new fl({$metadata:Nl(e),...n});return or(i,e.body)},Nl=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Al=(e,t)=>((e,t)=>((e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array))(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),kl=async(e,t)=>{const n=await Al(e,t);return n.message=n.message??n.Message,n},Dl=(e,t)=>{const n=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(o=e.headers,"x-amzn-errortype",Object.keys(o).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var o;return void 0!==r?n(e.headers[r]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0};class Rl extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Rl.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"SSOOIDCClient",commandName:"CreateTokenCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const{hostname:n,protocol:r="https",port:o,path:i}=await t.endpoint(),a=`${i?.endsWith("/")?i.slice(0,-1):i||""}/token`;let s;return s=JSON.stringify(hr(e,{clientId:[],clientSecret:[],code:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:e=>br(e)})),new Sr({protocol:r,hostname:n,port:o,method:"POST",headers:{"content-type":"application/json"},path:a,body:s})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await kl(e.body,t)},r=Dl(e,n.body);switch(r){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await wl(n,t);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await El(n,t);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await bl(n,t);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await vl(n,t);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await Sl(n,t);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await _l(n,t);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await Il(n,t);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await xl(n,t);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await Cl(n,t);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await Tl(n,t);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await Pl(n,t);default:const o=n.body;return gl({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=mr({$metadata:Nl(e)}),r=On(Ln(await Al(e.body,t)),"body"),o=hr(r,{accessToken:Fn,expiresIn:kn,idToken:Fn,refreshToken:Fn,tokenType:Fn});return Object.assign(n,o),n})(e,t)}}const Ol="required",Ll="fn",Fl="argv",zl="ref",Bl="PartitionResult",Ul="tree",$l="error",Ml="endpoint",jl={[Ol]:!1,type:"String"},ql={[Ol]:!0,default:!1,type:"Boolean"},Vl={[zl]:"Endpoint"},Gl={[Ll]:"booleanEquals",[Fl]:[{[zl]:"UseFIPS"},!0]},Hl={[Ll]:"booleanEquals",[Fl]:[{[zl]:"UseDualStack"},!0]},Kl={},Wl={[Ll]:"booleanEquals",[Fl]:[!0,{[Ll]:"getAttr",[Fl]:[{[zl]:Bl},"supportsFIPS"]}]},Jl={[Ll]:"booleanEquals",[Fl]:[!0,{[Ll]:"getAttr",[Fl]:[{[zl]:Bl},"supportsDualStack"]}]},Ql=[Vl],Xl=[Gl],Yl=[Hl],Zl={version:"1.0",parameters:{Region:jl,UseDualStack:ql,UseFIPS:ql,Endpoint:jl},rules:[{conditions:[{[Ll]:"aws.partition",[Fl]:[{[zl]:"Region"}],assign:Bl}],type:Ul,rules:[{conditions:[{[Ll]:"isSet",[Fl]:Ql},{[Ll]:"parseURL",[Fl]:Ql,assign:"url"}],type:Ul,rules:[{conditions:Xl,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:$l},{type:Ul,rules:[{conditions:Yl,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:$l},{endpoint:{url:Vl,properties:Kl,headers:Kl},type:Ml}]}]},{conditions:[Gl,Hl],type:Ul,rules:[{conditions:[Wl,Jl],type:Ul,rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Kl,headers:Kl},type:Ml}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:$l}]},{conditions:Xl,type:Ul,rules:[{conditions:[Wl],type:Ul,rules:[{type:Ul,rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Kl,headers:Kl},type:Ml}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:$l}]},{conditions:Yl,type:Ul,rules:[{conditions:[Jl],type:Ul,rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Kl,headers:Kl},type:Ml}]},{error:"DualStack is enabled but this partition does not support DualStack",type:$l}]},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:Kl,headers:Kl},type:Ml}]}]},eu=(e,t={})=>mn(Zl,{endpointParams:e,logger:t.logger});class tu extends In{constructor(e){const t=(n=(e=>{dr(process.version);const t=Ld(e),n=()=>t().then(sr),r=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??cd,base64Encoder:e?.base64Encoder??dd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??eu,logger:e?.logger??new bn,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??R,utf8Decoder:e?.utf8Decoder??Be,utf8Encoder:e?.utf8Encoder??$e}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??od,defaultUserAgentProvider:e?.defaultUserAgentProvider??ad({serviceId:r.serviceId,clientVersion:"3.338.0"}),maxAttempts:e?.maxAttempts??Ac(de),region:e?.region??Ac(l,u),requestHandler:e?.requestHandler??new td(n),retryMode:e?.retryMode??Ac({...ue,default:async()=>(await n()).retryMode||X}),sha256:e?.sha256??Jc.bind(null,"sha256"),streamCollector:e?.streamCollector??rd,useDualstackEndpoint:e?.useDualstackEndpoint??Ac(c),useFipsEndpoint:e?.useFipsEndpoint??Ac(d)}})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"awsssooidc"});var n;const r=h(t),o=O(r),i=_t(le(o));super(i),this.config=i,this.middlewareStack.use(Ie(this.config)),this.middlewareStack.use(v(this.config)),this.middlewareStack.use(q(this.config)),this.middlewareStack.use(G(this.config)),this.middlewareStack.use(W(this.config)),this.middlewareStack.use(En(this.config))}destroy(){super.destroy()}}const nu={},ru=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new Pe(`Token is expired. ${ol}`,!1)},ou=(e,t,n=!1)=>{if(void 0===t)throw new Pe(`Value not present for '${e}' in SSO Token${n?". Cannot refresh":""}. ${ol}`,!1)},{writeFile:iu}=Qs.promises,au=new Date(0),su=(e={})=>async()=>{const t=await hc(e),n=Ws(e),r=t[n];if(!r)throw new Pe(`Profile '${n}' could not be found in shared credentials file.`,!1);if(!r.sso_session)throw new Pe(`Profile '${n}' is missing required property 'sso_session'.`);const o=r.sso_session,i=(await mc(e))[o];if(!i)throw new Pe(`Sso session '${o}' could not be found in shared credentials file.`,!1);for(const e of["sso_start_url","sso_region"])if(!i[e])throw new Pe(`Sso session '${o}' is missing required property '${e}'.`,!1);i.sso_start_url;const a=i.sso_region;let s;try{s=await Ys(o)}catch(e){throw new Pe(`The SSO session token associated with profile=${n} was not found or is invalid. ${ol}`,!1)}ou("accessToken",s.accessToken),ou("expiresAt",s.expiresAt);const{accessToken:c,expiresAt:d}=s,l={token:c,expiration:new Date(d)};if(l.expiration.getTime()-Date.now()>3e5)return l;if(Date.now()-au.getTime()<3e4)return ru(l),l;ou("clientId",s.clientId,!0),ou("clientSecret",s.clientSecret,!0),ou("refreshToken",s.refreshToken,!0);try{au.setTime(Date.now());const e=await((e,t)=>{const n=(e=>{if(nu[e])return nu[e];const t=new tu({region:e});return nu[e]=t,t})(t);return n.send(new Rl({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))})(s,a);ou("accessToken",e.accessToken),ou("expiresIn",e.expiresIn);const t=new Date(Date.now()+1e3*e.expiresIn);try{await((e,t)=>{const n=Js(e),r=JSON.stringify(t,null,2);return iu(n,r)})(o,{...s,accessToken:e.accessToken,expiresAt:t.toISOString(),refreshToken:e.refreshToken})}catch(e){}return{token:e.accessToken,expiration:t}}catch(e){return ru(l),l}},cu=!1,du=async({ssoStartUrl:e,ssoSession:t,ssoAccountId:n,ssoRegion:r,ssoRoleName:o,ssoClient:i,profile:a})=>{let s;const c="To refresh this SSO session run aws sso login with the corresponding profile.";if(t)try{const e=await su({profile:a})();s={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new Te(e.message,cu)}else try{s=await Ys(e)}catch(e){throw new Te(`The SSO session associated with this profile is invalid. ${c}`,cu)}if(new Date(s.expiresAt).getTime()-Date.now()<=9e5)throw new Te(`The SSO session associated with this profile has expired. ${c}`,cu);const{accessToken:d}=s,l=i||new Bd({region:r});let u;try{u=await l.send(new rl({accountId:n,roleName:o,accessToken:d}))}catch(e){throw Te.from(e,cu)}const{roleCredentials:{accessKeyId:p,secretAccessKey:m,sessionToken:h,expiration:y}={}}=u;if(!(p&&m&&h&&y))throw new Te("SSO returns an invalid temporary credential.",cu);return{accessKeyId:p,secretAccessKey:m,sessionToken:h,expiration:new Date(y)}},lu=e=>{const{sso_start_url:t,sso_account_id:n,sso_region:r,sso_role_name:o}=e;if(!(t&&n&&r&&o))throw new Te(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,!1);return e},uu=(e={})=>async()=>{const{ssoStartUrl:t,ssoAccountId:n,ssoRegion:r,ssoRoleName:o,ssoClient:i,ssoSession:a}=e,s=Ws(e);if(t||n||r||o||a){if(t&&n&&r&&o)return du({ssoStartUrl:t,ssoSession:a,ssoAccountId:n,ssoRegion:r,ssoRoleName:o,ssoClient:i,profile:s});throw new Te('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"')}{const n=(await hc(e))[s];if(!n)throw new Te(`Profile ${s} was not found.`);if(!Wc(n))throw new Te(`Profile ${s} is not configured with SSO credentials.`);if(n?.sso_session){const o=(await mc(e))[n.sso_session],i=` configurations in profile ${s} and sso-session ${n.sso_session}`;if(r&&r!==o.sso_region)throw new Te("Conflicting SSO region"+i,!1);if(t&&t!==o.sso_start_url)throw new Te("Conflicting SSO start_url"+i,!1);n.sso_region=o.sso_region,n.sso_start_url=o.sso_start_url}const{sso_start_url:o,sso_account_id:a,sso_region:c,sso_role_name:d,sso_session:l}=lu(n);return du({ssoStartUrl:o,ssoSession:l,ssoAccountId:a,ssoRegion:c,ssoRoleName:d,ssoClient:i,profile:s})}},pu=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.aws_access_key_id&&"string"==typeof e.aws_secret_access_key&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1,mu=e=>Promise.resolve({accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token}),hu=(e={})=>async()=>yu(e),yu=e=>{const t=e?.webIdentityTokenFile??process.env.AWS_WEB_IDENTITY_TOKEN_FILE,n=e?.roleArn??process.env.AWS_ROLE_ARN,r=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!t||!n)throw new Te("Web identity configuration not specified");return(e=>()=>{const{roleArn:t,roleSessionName:n,webIdentityToken:r,providerId:o,policyArns:i,policy:a,durationSeconds:s,roleAssumerWithWebIdentity:c}=e;if(!c)throw new Te(`Role Arn '${t}' needs to be assumed with web identity, but no role assumption callback was provided.`,!1);return c({RoleArn:t,RoleSessionName:n??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:r,ProviderId:o,PolicyArns:i,Policy:a,DurationSeconds:s})})({...e,webIdentityToken:(0,Qs.readFileSync)(t,{encoding:"ascii"}),roleArn:n,roleSessionName:r})()},fu=async(e,t,n,r={})=>{const o=t[e];if(Object.keys(r).length>0&&pu(o))return mu(o);if(i=o,Boolean(i)&&"object"==typeof i&&"string"==typeof i.role_arn&&["undefined","string"].indexOf(typeof i.role_session_name)>-1&&["undefined","string"].indexOf(typeof i.external_id)>-1&&["undefined","string"].indexOf(typeof i.mfa_serial)>-1&&((e=>"string"==typeof e.source_profile&&void 0===e.credential_source)(i)||(e=>"string"==typeof e.credential_source&&void 0===e.source_profile)(i)))return(async(e,t,n,r={})=>{const o=t[e];if(!n.roleAssumer)throw new Te(`Profile ${e} requires a role to be assumed, but no role assumption callback was provided.`,!1);const{source_profile:i}=o;if(i&&i in r)throw new Te(`Detected a cycle attempting to resolve credentials for profile ${Ws(n)}. Profiles visited: `+Object.keys(r).join(", "),!1);const a=i?fu(i,t,n,{...r,[i]:!0}):((e,t)=>{const n={EcsContainer:xc,Ec2InstanceMetadata:$c,Environment:qs};if(e in n)return n[e]();throw new Te(`Unsupported credential source in profile ${t}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`)})(o.credential_source,e)(),s={RoleArn:o.role_arn,RoleSessionName:o.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:o.external_id},{mfa_serial:c}=o;if(c){if(!n.mfaCodeProvider)throw new Te(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,!1);s.SerialNumber=c,s.TokenCode=await n.mfaCodeProvider(c)}const d=await a;return n.roleAssumer(d,s)})(e,t,n,r);var i;if(pu(o))return mu(o);if((e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.web_identity_token_file&&"string"==typeof e.role_arn&&["undefined","string"].indexOf(typeof e.role_session_name)>-1)(o))return(async(e,t)=>hu({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:t.roleAssumerWithWebIdentity})())(o,n);if((e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.credential_process)(o))return(async(e,t)=>Kc({...e,profile:t})())(n,e);if(Wc(o))return(e=>{const{sso_start_url:t,sso_account_id:n,sso_session:r,sso_region:o,sso_role_name:i}=lu(e);return uu({ssoStartUrl:t,ssoAccountId:n,ssoSession:r,ssoRegion:o,ssoRoleName:i})()})(o);throw new Te(`Profile ${e} could not be found or parsed in shared credentials file.`)},gu=(e={})=>Ae(Ne(...e.profile||process.env[Ks]?[]:[qs()],uu(e),((e={})=>async()=>{const t=await hc(e);return fu(Ws(e),t,e)})(e),Kc(e),hu(e),(e=>process.env[_c]||process.env[Sc]?xc(e):process.env.AWS_EC2_METADATA_DISABLED?async()=>{throw new Te("EC2 Instance Metadata Service access disabled")}:$c(e))(e),(async()=>{throw new Te("Could not load credentials from any providers",!1)})),(e=>void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5),(e=>void 0!==e.expiration)),wu="required",Eu="type",bu="fn",vu="argv",Su="ref",_u="booleanEquals",Iu="tree",xu="stringEquals",Cu="sigv4",Tu="us-east-1",Pu="endpoint",Nu="https://sts.{Region}.{PartitionResult#dnsSuffix}",Au="error",ku="getAttr",Du={[wu]:!1,[Eu]:"String"},Ru={[wu]:!0,default:!1,[Eu]:"Boolean"},Ou={[Su]:"Endpoint"},Lu={[bu]:"isSet",[vu]:[{[Su]:"Region"}]},Fu={[Su]:"Region"},zu={[bu]:"aws.partition",[vu]:[Fu],assign:"PartitionResult"},Bu={[Su]:"UseFIPS"},Uu={[Su]:"UseDualStack"},$u={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:Cu,signingName:"sts",signingRegion:Tu}]},headers:{}},Mu={},ju={conditions:[{[bu]:xu,[vu]:[Fu,"aws-global"]}],[Pu]:$u,[Eu]:Pu},qu={[bu]:_u,[vu]:[Bu,!0]},Vu={[bu]:_u,[vu]:[Uu,!0]},Gu={[bu]:_u,[vu]:[!0,{[bu]:ku,[vu]:[{[Su]:"PartitionResult"},"supportsFIPS"]}]},Hu={[Su]:"PartitionResult"},Ku={[bu]:_u,[vu]:[!0,{[bu]:ku,[vu]:[Hu,"supportsDualStack"]}]},Wu=[{[bu]:"isSet",[vu]:[Ou]}],Ju=[qu],Qu=[Vu],Xu={version:"1.0",parameters:{Region:Du,UseDualStack:Ru,UseFIPS:Ru,Endpoint:Du,UseGlobalEndpoint:Ru},rules:[{conditions:[{[bu]:_u,[vu]:[{[Su]:"UseGlobalEndpoint"},!0]},{[bu]:"not",[vu]:Wu},Lu,zu,{[bu]:_u,[vu]:[Bu,!1]},{[bu]:_u,[vu]:[Uu,!1]}],[Eu]:Iu,rules:[{conditions:[{[bu]:xu,[vu]:[Fu,"ap-northeast-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"ap-south-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"ap-southeast-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"ap-southeast-2"]}],endpoint:$u,[Eu]:Pu},ju,{conditions:[{[bu]:xu,[vu]:[Fu,"ca-central-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"eu-central-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"eu-north-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"eu-west-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"eu-west-2"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"eu-west-3"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"sa-east-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,Tu]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"us-east-2"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"us-west-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"us-west-2"]}],endpoint:$u,[Eu]:Pu},{endpoint:{url:Nu,properties:{authSchemes:[{name:Cu,signingName:"sts",signingRegion:"{Region}"}]},headers:Mu},[Eu]:Pu}]},{conditions:Wu,[Eu]:Iu,rules:[{conditions:Ju,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Eu]:Au},{[Eu]:Iu,rules:[{conditions:Qu,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Eu]:Au},{endpoint:{url:Ou,properties:Mu,headers:Mu},[Eu]:Pu}]}]},{[Eu]:Iu,rules:[{conditions:[Lu],[Eu]:Iu,rules:[{conditions:[zu],[Eu]:Iu,rules:[{conditions:[qu,Vu],[Eu]:Iu,rules:[{conditions:[Gu,Ku],[Eu]:Iu,rules:[{[Eu]:Iu,rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Mu,headers:Mu},[Eu]:Pu}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Eu]:Au}]},{conditions:Ju,[Eu]:Iu,rules:[{conditions:[Gu],[Eu]:Iu,rules:[{[Eu]:Iu,rules:[{conditions:[{[bu]:xu,[vu]:["aws-us-gov",{[bu]:ku,[vu]:[Hu,"name"]}]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:Mu,headers:Mu},[Eu]:Pu},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Mu,headers:Mu},[Eu]:Pu}]}]},{error:"FIPS is enabled but this partition does not support FIPS",[Eu]:Au}]},{conditions:Qu,[Eu]:Iu,rules:[{conditions:[Ku],[Eu]:Iu,rules:[{[Eu]:Iu,rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Mu,headers:Mu},[Eu]:Pu}]}]},{error:"DualStack is enabled but this partition does not support DualStack",[Eu]:Au}]},{[Eu]:Iu,rules:[ju,{endpoint:{url:Nu,properties:Mu,headers:Mu},[Eu]:Pu}]}]}]},{error:"Invalid Configuration: Missing Region",[Eu]:Au}]}]},Yu=(e,t={})=>mn(Xu,{endpointParams:e,logger:t.logger});class Zu extends In{constructor(e){const t=(n=(e=>{dr(process.version);const t=Ld(e),n=()=>t().then(sr),r=(e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??cd,base64Encoder:e?.base64Encoder??dd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Yu,logger:e?.logger??new bn,serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??R,utf8Decoder:e?.utf8Decoder??Be,utf8Encoder:e?.utf8Encoder??$e}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??od,credentialDefaultProvider:e?.credentialDefaultProvider??(o=gu,e=>o({roleAssumer:Ms(e,e.stsClientCtor),roleAssumerWithWebIdentity:js(e,e.stsClientCtor),...e})),defaultUserAgentProvider:e?.defaultUserAgentProvider??ad({serviceId:r.serviceId,clientVersion:"3.338.0"}),maxAttempts:e?.maxAttempts??Ac(de),region:e?.region??Ac(l,u),requestHandler:e?.requestHandler??new td(n),retryMode:e?.retryMode??Ac({...ue,default:async()=>(await n()).retryMode||X}),sha256:e?.sha256??Jc.bind(null,"sha256"),streamCollector:e?.streamCollector??rd,useDualstackEndpoint:e?.useDualstackEndpoint??Ac(c),useFipsEndpoint:e?.useFipsEndpoint??Ac(d)};var o})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,useGlobalEndpoint:n.useGlobalEndpoint??!1,defaultSigningName:"sts"});var n;const r=h(t),o=O(r),i=_t(((e,{stsClientCtor:t})=>ft({...e,stsClientCtor:t}))(le(o),{stsClientCtor:Zu}));super(i),this.config=i,this.middlewareStack.use(Ie(this.config)),this.middlewareStack.use(v(this.config)),this.middlewareStack.use(q(this.config)),this.middlewareStack.use(G(this.config)),this.middlewareStack.use(W(this.config)),this.middlewareStack.use(En(this.config))}destroy(){super.destroy()}}const ep=(e,t)=>t?class extends e{constructor(e){super(e);for(const e of t)this.middlewareStack.use(e)}}:e,tp=(e={},t)=>Ms(e,ep(Zu,t)),np=(e={},t)=>js(e,ep(Zu,t)),rp="required",op="fn",ip="argv",ap="ref",sp="isSet",cp="tree",dp="error",lp="endpoint",up="PartitionResult",pp="getAttr",mp="stringEquals",hp={[rp]:!1,type:"String"},yp={[rp]:!0,default:!1,type:"Boolean"},fp={[ap]:"Endpoint"},gp={[op]:"booleanEquals",[ip]:[{[ap]:"UseFIPS"},!0]},wp={[op]:"booleanEquals",[ip]:[{[ap]:"UseDualStack"},!0]},Ep={},bp={[ap]:"Region"},vp={[op]:"booleanEquals",[ip]:[!0,{[op]:pp,[ip]:[{[ap]:up},"supportsFIPS"]}]},Sp={[ap]:up},_p={[op]:"booleanEquals",[ip]:[!0,{[op]:pp,[ip]:[Sp,"supportsDualStack"]}]},Ip=[gp],xp=[wp],Cp=[bp],Tp={version:"1.0",parameters:{Region:hp,UseDualStack:yp,UseFIPS:yp,Endpoint:hp},rules:[{conditions:[{[op]:sp,[ip]:[fp]}],type:cp,rules:[{conditions:Ip,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:dp},{type:cp,rules:[{conditions:xp,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:dp},{endpoint:{url:fp,properties:Ep,headers:Ep},type:lp}]}]},{type:cp,rules:[{conditions:[{[op]:sp,[ip]:Cp}],type:cp,rules:[{conditions:[{[op]:"aws.partition",[ip]:Cp,assign:up}],type:cp,rules:[{conditions:[gp,wp],type:cp,rules:[{conditions:[vp,_p],type:cp,rules:[{type:cp,rules:[{endpoint:{url:"https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Ep,headers:Ep},type:lp}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:dp}]},{conditions:Ip,type:cp,rules:[{conditions:[vp],type:cp,rules:[{type:cp,rules:[{conditions:[{[op]:mp,[ip]:["aws-us-gov",{[op]:pp,[ip]:[Sp,"name"]}]}],endpoint:{url:"https://dynamodb.{Region}.amazonaws.com",properties:Ep,headers:Ep},type:lp},{endpoint:{url:"https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Ep,headers:Ep},type:lp}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:dp}]},{conditions:xp,type:cp,rules:[{conditions:[_p],type:cp,rules:[{type:cp,rules:[{endpoint:{url:"https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Ep,headers:Ep},type:lp}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:dp}]},{type:cp,rules:[{conditions:[{[op]:mp,[ip]:[bp,"local"]}],endpoint:{url:"http://localhost:8000",properties:{authSchemes:[{name:"sigv4",signingName:"dynamodb",signingRegion:"us-east-1"}]},headers:Ep},type:lp},{endpoint:{url:"https://dynamodb.{Region}.{PartitionResult#dnsSuffix}",properties:Ep,headers:Ep},type:lp}]}]}]},{error:"Invalid Configuration: Missing Region",type:dp}]}]},Pp=(e,t={})=>mn(Tp,{endpointParams:e,logger:t.logger});class Np extends In{constructor(e){const t=(n=(e=>{dr(process.version);const t=Ld(e),n=()=>t().then(sr),r=(e=>({apiVersion:"2012-08-10",base64Decoder:e?.base64Decoder??cd,base64Encoder:e?.base64Encoder??dd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Pp,logger:e?.logger??new bn,serviceId:e?.serviceId??"DynamoDB",urlParser:e?.urlParser??R,utf8Decoder:e?.utf8Decoder??Be,utf8Encoder:e?.utf8Encoder??$e}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??od,credentialDefaultProvider:e?.credentialDefaultProvider??(o=gu,e=>o({roleAssumer:tp(e),roleAssumerWithWebIdentity:np(e),...e})),defaultUserAgentProvider:e?.defaultUserAgentProvider??ad({serviceId:r.serviceId,clientVersion:"3.338.0"}),endpointDiscoveryEnabledProvider:e?.endpointDiscoveryEnabledProvider??Ac(B),maxAttempts:e?.maxAttempts??Ac(de),region:e?.region??Ac(l,u),requestHandler:e?.requestHandler??new td(n),retryMode:e?.retryMode??Ac({...ue,default:async()=>(await n()).retryMode||X}),sha256:e?.sha256??Jc.bind(null,"sha256"),streamCollector:e?.streamCollector??rd,useDualstackEndpoint:e?.useDualstackEndpoint??Ac(c),useFipsEndpoint:e?.useFipsEndpoint??Ac(d)};var o})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"dynamodb"});var n;const r=h(t),o=O(r),i=le(o),a=((e,{endpointDiscoveryCommandCtor:t})=>({...e,endpointDiscoveryCommandCtor:t,endpointCache:new M(e.endpointCacheSize??1e3),endpointDiscoveryEnabled:void 0!==e.endpointDiscoveryEnabled?()=>Promise.resolve(e.endpointDiscoveryEnabled):e.endpointDiscoveryEnabledProvider,isClientEndpointDiscoveryEnabled:void 0!==e.endpointDiscoveryEnabled}))(_t(ft(i)),{endpointDiscoveryCommandCtor:Ha});super(a),this.config=a,this.middlewareStack.use(Ie(this.config)),this.middlewareStack.use(v(this.config)),this.middlewareStack.use(q(this.config)),this.middlewareStack.use(G(this.config)),this.middlewareStack.use(W(this.config)),this.middlewareStack.use(St(this.config)),this.middlewareStack.use(En(this.config))}destroy(){super.destroy()}}class Ap extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ap.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"BatchExecuteStatementCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("BatchExecuteStatement");let r;return r=JSON.stringify(((e,t)=>hr(e,{ReturnConsumedCapacity:[],Statements:e=>Li(e,t)}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),Responses:e=>Sa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class kp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,kp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"BatchGetItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("BatchGetItem");let r;return r=JSON.stringify(((e,t)=>hr(e,{RequestItems:e=>Si(e,t),ReturnConsumedCapacity:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),Responses:e=>ea(e,t),UnprocessedKeys:e=>Zi(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Dp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Dp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"BatchWriteItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("BatchWriteItem");let r;return r=JSON.stringify(((e,t)=>hr(e,{RequestItems:e=>_i(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ri(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),ItemCollectionMetrics:e=>pa(e,t),UnprocessedItems:e=>ta(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Rp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Rp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"CreateBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("CreateBackup");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"BackupInUseException":case"com.amazonaws.dynamodb#BackupInUseException":throw await $o(n,t);case"ContinuousBackupsUnavailableException":case"com.amazonaws.dynamodb#ContinuousBackupsUnavailableException":throw await qo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"TableInUseException":case"com.amazonaws.dynamodb#TableInUseException":throw await mi(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{BackupDetails:e=>Yi(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Op extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Op.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"CreateGlobalTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("CreateGlobalTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"GlobalTableAlreadyExistsException":case"com.amazonaws.dynamodb#GlobalTableAlreadyExistsException":throw await Ko(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{GlobalTableDescription:e=>da(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Lp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Lp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"CreateTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("CreateTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableDescription:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Fp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Fp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DeleteBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DeleteBackup");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"BackupInUseException":case"com.amazonaws.dynamodb#BackupInUseException":throw await $o(n,t);case"BackupNotFoundException":case"com.amazonaws.dynamodb#BackupNotFoundException":throw await Mo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{BackupDescription:e=>Xi(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class zp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,zp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DeleteItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DeleteItem");let r;return r=JSON.stringify(((e,t)=>hr(e,{ConditionExpression:[],ConditionalOperator:[],Expected:e=>Ci(e,t),ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Key:e=>Ai(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ri(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await fi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{Attributes:e=>Ki(e,t),ConsumedCapacity:e=>ia(e,t),ItemCollectionMetrics:e=>ua(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Bp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Bp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DeleteTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DeleteTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableDescription:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Up extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Up.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeBackup");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"BackupNotFoundException":case"com.amazonaws.dynamodb#BackupNotFoundException":throw await Mo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{BackupDescription:e=>Xi(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class $p extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,$p.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeContinuousBackupsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeContinuousBackups");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ContinuousBackupsDescription:e=>sa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Mp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Mp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeContributorInsightsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeContributorInsights");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ContributorInsightsRuleList:br,ContributorInsightsStatus:Fn,FailureException:br,IndexName:Fn,LastUpdateDateTime:e=>On(Wn(Pn(e))),TableName:Fn}))(await qa(e.body,t)),{$metadata:Ba(e),...n}})(e,t)}}class jp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,jp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeExportCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeExport");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ExportNotFoundException":case"com.amazonaws.dynamodb#ExportNotFoundException":throw await Ho(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ExportDescription:e=>ca(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class qp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,qp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeGlobalTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeGlobalTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Wo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{GlobalTableDescription:e=>da(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Vp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Vp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeGlobalTableSettingsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeGlobalTableSettings");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Wo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{GlobalTableName:Fn,ReplicaSettings:e=>Ta(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Gp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Gp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeImportCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeImport");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ImportNotFoundException":case"com.amazonaws.dynamodb#ImportNotFoundException":throw await Xo(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ImportTableDescription:e=>la(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Hp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Hp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeKinesisStreamingDestinationCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeKinesisStreamingDestination");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Kp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Kp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeLimitsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeLimits");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Wp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Wp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{Table:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Jp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Jp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeTableReplicaAutoScalingCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeTableReplicaAutoScaling");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableAutoScalingDescription:e=>Da(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Qp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Qp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeTimeToLiveCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeTimeToLive");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Xp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Xp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DisableKinesisStreamingDestinationCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DisableKinesisStreamingDestination");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Yp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Yp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"EnableKinesisStreamingDestinationCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("EnableKinesisStreamingDestination");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Zp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Zp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ExecuteStatementCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ExecuteStatement");let r;return r=JSON.stringify(((e,t)=>hr(e,{ConsistentRead:[],Limit:[],NextToken:[],Parameters:e=>Fi(e,t),ReturnConsumedCapacity:[],Statement:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await jo(n,t);case"DuplicateItemException":case"com.amazonaws.dynamodb#DuplicateItemException":throw await Vo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ri(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await fi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>ia(e,t),Items:e=>ha(e,t),LastEvaluatedKey:e=>fa(e,t),NextToken:Fn}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class em extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,em.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ExecuteTransactionCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ExecuteTransaction");let r;return r=JSON.stringify(((e,t)=>hr(e,{ClientRequestToken:[!0,e=>e??be()],ReturnConsumedCapacity:[],TransactStatements:e=>Oi(e,t)}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"IdempotentParameterMismatchException":case"com.amazonaws.dynamodb#IdempotentParameterMismatchException":throw await Jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionCanceledException":case"com.amazonaws.dynamodb#TransactionCanceledException":throw await yi(n,t);case"TransactionInProgressException":case"com.amazonaws.dynamodb#TransactionInProgressException":throw await gi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),Responses:e=>ya(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class tm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,tm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ExportTableToPointInTimeCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ExportTableToPointInTime");let r;return r=JSON.stringify(((e,t)=>hr(e,{ClientToken:[!0,e=>e??be()],ExportFormat:[],ExportTime:e=>Math.round(e.getTime()/1e3),S3Bucket:[],S3BucketOwner:[],S3Prefix:[],S3SseAlgorithm:[],S3SseKmsKeyId:[],TableArn:[]}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ExportConflictException":case"com.amazonaws.dynamodb#ExportConflictException":throw await Go(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidExportTimeException":case"com.amazonaws.dynamodb#InvalidExportTimeException":throw await ti(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"PointInTimeRecoveryUnavailableException":case"com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException":throw await ii(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ExportDescription:e=>ca(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class nm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,nm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"GetItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("GetItem");let r;return r=JSON.stringify(((e,t)=>hr(e,{AttributesToGet:br,ConsistentRead:[],ExpressionAttributeNames:br,Key:e=>Ai(e,t),ProjectionExpression:[],ReturnConsumedCapacity:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>ia(e,t),Item:e=>Ki(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class rm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,rm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ImportTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ImportTable");let r;return r=JSON.stringify(((e,t)=>hr(e,{ClientToken:[!0,e=>e??be()],InputCompressionType:[],InputFormat:[],InputFormatOptions:br,S3BucketSource:br,TableCreationParameters:br}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ImportConflictException":case"com.amazonaws.dynamodb#ImportConflictException":throw await Qo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ImportTableDescription:e=>la(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class om extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,om.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListBackupsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListBackups");let r;return r=JSON.stringify(((e,t)=>hr(e,{BackupType:[],ExclusiveStartBackupArn:[],Limit:[],TableName:[],TimeRangeLowerBound:e=>Math.round(e.getTime()/1e3),TimeRangeUpperBound:e=>Math.round(e.getTime()/1e3)}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=Ea(n),{$metadata:Ba(e),...r}})(e,t)}}class im extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,im.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListContributorInsightsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListContributorInsights");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class am extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,am.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListExportsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListExports");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class sm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,sm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListGlobalTablesCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListGlobalTables");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class cm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,cm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListImportsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListImports");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=ba(n),{$metadata:Ba(e),...r}})(e,t)}}class dm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,dm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListTablesCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListTables");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class lm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,lm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListTagsOfResourceCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListTagsOfResource");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class um extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,um.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"PutItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("PutItem");let r;return r=JSON.stringify(((e,t)=>hr(e,{ConditionExpression:[],ConditionalOperator:[],Expected:e=>Ci(e,t),ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Item:e=>zi(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ri(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await fi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{Attributes:e=>Ki(e,t),ConsumedCapacity:e=>ia(e,t),ItemCollectionMetrics:e=>ua(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class pm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,pm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"QueryCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("Query");let r;return r=JSON.stringify(((e,t)=>hr(e,{AttributesToGet:br,ConditionalOperator:[],ConsistentRead:[],ExclusiveStartKey:e=>Ai(e,t),ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),FilterExpression:[],IndexName:[],KeyConditionExpression:[],KeyConditions:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=xi(r,t)),e)),{}))(e,t),Limit:[],ProjectionExpression:[],QueryFilter:e=>Ni(e,t),ReturnConsumedCapacity:[],ScanIndexForward:[],Select:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>ia(e,t),Count:kn,Items:e=>ha(e,t),LastEvaluatedKey:e=>fa(e,t),ScannedCount:kn}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class mm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,mm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"RestoreTableFromBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("RestoreTableFromBackup");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"BackupInUseException":case"com.amazonaws.dynamodb#BackupInUseException":throw await $o(n,t);case"BackupNotFoundException":case"com.amazonaws.dynamodb#BackupNotFoundException":throw await Mo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"TableAlreadyExistsException":case"com.amazonaws.dynamodb#TableAlreadyExistsException":throw await pi(n,t);case"TableInUseException":case"com.amazonaws.dynamodb#TableInUseException":throw await mi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableDescription:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class hm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,hm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"RestoreTableToPointInTimeCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("RestoreTableToPointInTime");let r;return r=JSON.stringify(((e,t)=>hr(e,{BillingModeOverride:[],GlobalSecondaryIndexOverride:br,LocalSecondaryIndexOverride:br,ProvisionedThroughputOverride:br,RestoreDateTime:e=>Math.round(e.getTime()/1e3),SSESpecificationOverride:br,SourceTableArn:[],SourceTableName:[],TargetTableName:[],UseLatestRestorableTime:[]}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"InvalidRestoreTimeException":case"com.amazonaws.dynamodb#InvalidRestoreTimeException":throw await ni(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"PointInTimeRecoveryUnavailableException":case"com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException":throw await ii(n,t);case"TableAlreadyExistsException":case"com.amazonaws.dynamodb#TableAlreadyExistsException":throw await pi(n,t);case"TableInUseException":case"com.amazonaws.dynamodb#TableInUseException":throw await mi(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableDescription:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class ym extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ym.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ScanCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("Scan");let r;return r=JSON.stringify(((e,t)=>hr(e,{AttributesToGet:br,ConditionalOperator:[],ConsistentRead:[],ExclusiveStartKey:e=>Ai(e,t),ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),FilterExpression:[],IndexName:[],Limit:[],ProjectionExpression:[],ReturnConsumedCapacity:[],ScanFilter:e=>Ni(e,t),Segment:[],Select:[],TableName:[],TotalSegments:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>ia(e,t),Count:kn,Items:e=>ha(e,t),LastEvaluatedKey:e=>fa(e,t),ScannedCount:kn}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class fm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,fm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"TagResourceCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("TagResource");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>e.statusCode>=300?(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t):(await Ua(e.body,t),{$metadata:Ba(e)}))(e,t)}}class gm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,gm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"TransactGetItemsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("TransactGetItems");let r;return r=JSON.stringify($i(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionCanceledException":case"com.amazonaws.dynamodb#TransactionCanceledException":throw await yi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),Responses:e=>ya(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class wm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,wm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"TransactWriteItemsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("TransactWriteItems");let r;return r=JSON.stringify(Mi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"IdempotentParameterMismatchException":case"com.amazonaws.dynamodb#IdempotentParameterMismatchException":throw await Jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionCanceledException":case"com.amazonaws.dynamodb#TransactionCanceledException":throw await yi(n,t);case"TransactionInProgressException":case"com.amazonaws.dynamodb#TransactionInProgressException":throw await gi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),ItemCollectionMetrics:e=>pa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Em extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Em.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UntagResourceCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UntagResource");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>e.statusCode>=300?(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t):(await Ua(e.body,t),{$metadata:Ba(e)}))(e,t)}}class bm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,bm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateContinuousBackupsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateContinuousBackups");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ContinuousBackupsUnavailableException":case"com.amazonaws.dynamodb#ContinuousBackupsUnavailableException":throw await qo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ContinuousBackupsDescription:e=>sa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class vm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,vm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateContributorInsightsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateContributorInsights");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Sm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Sm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateGlobalTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateGlobalTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Wo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ReplicaAlreadyExistsException":case"com.amazonaws.dynamodb#ReplicaAlreadyExistsException":throw await si(n,t);case"ReplicaNotFoundException":case"com.amazonaws.dynamodb#ReplicaNotFoundException":throw await ci(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{GlobalTableDescription:e=>da(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class _m extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,_m.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateGlobalTableSettingsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateGlobalTableSettings");let r;return r=JSON.stringify(qi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Wo(n,t);case"IndexNotFoundException":case"com.amazonaws.dynamodb#IndexNotFoundException":throw await Yo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ReplicaNotFoundException":case"com.amazonaws.dynamodb#ReplicaNotFoundException":throw await ci(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{GlobalTableName:Fn,ReplicaSettings:e=>Ta(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Im extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Im.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateItem");let r;return r=JSON.stringify(Vi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ri(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await fi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{Attributes:e=>Ki(e,t),ConsumedCapacity:e=>ia(e,t),ItemCollectionMetrics:e=>ua(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class xm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,xm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableDescription:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Cm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Cm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateTableReplicaAutoScalingCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateTableReplicaAutoScaling");let r;return r=JSON.stringify(Gi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableAutoScalingDescription:e=>Da(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Tm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Tm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateTimeToLiveCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateTimeToLive");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}const Pm={BatchExecuteStatementCommand:Ap,BatchGetItemCommand:kp,BatchWriteItemCommand:Dp,CreateBackupCommand:Rp,CreateGlobalTableCommand:Op,CreateTableCommand:Lp,DeleteBackupCommand:Fp,DeleteItemCommand:zp,DeleteTableCommand:Bp,DescribeBackupCommand:Up,DescribeContinuousBackupsCommand:$p,DescribeContributorInsightsCommand:Mp,DescribeEndpointsCommand:Ha,DescribeExportCommand:jp,DescribeGlobalTableCommand:qp,DescribeGlobalTableSettingsCommand:Vp,DescribeImportCommand:Gp,DescribeKinesisStreamingDestinationCommand:Hp,DescribeLimitsCommand:Kp,DescribeTableCommand:Wp,DescribeTableReplicaAutoScalingCommand:Jp,DescribeTimeToLiveCommand:Qp,DisableKinesisStreamingDestinationCommand:Xp,EnableKinesisStreamingDestinationCommand:Yp,ExecuteStatementCommand:Zp,ExecuteTransactionCommand:em,ExportTableToPointInTimeCommand:tm,GetItemCommand:nm,ImportTableCommand:rm,ListBackupsCommand:om,ListContributorInsightsCommand:im,ListExportsCommand:am,ListGlobalTablesCommand:sm,ListImportsCommand:cm,ListTablesCommand:dm,ListTagsOfResourceCommand:lm,PutItemCommand:um,QueryCommand:pm,RestoreTableFromBackupCommand:mm,RestoreTableToPointInTimeCommand:hm,ScanCommand:ym,TagResourceCommand:fm,TransactGetItemsCommand:gm,TransactWriteItemsCommand:wm,UntagResourceCommand:Em,UpdateContinuousBackupsCommand:bm,UpdateContributorInsightsCommand:vm,UpdateGlobalTableCommand:Sm,UpdateGlobalTableSettingsCommand:_m,UpdateItemCommand:Im,UpdateTableCommand:xm,UpdateTableReplicaAutoScalingCommand:Cm,UpdateTimeToLiveCommand:Tm};class Nm extends Np{}((e,t)=>{for(const n of Object.keys(e)){const r=e[n],o=async function(e,t,n){const o=new r(e);if("function"==typeof t)this.send(o,t);else{if("function"!=typeof n)return this.send(o,t);if("object"!=typeof t)throw new Error("Expected http options but got "+typeof t);this.send(o,t||{},n)}},i=(n[0].toLowerCase()+n.slice(1)).replace(/Command$/,"");t.prototype[i]=o}})(Pm,Nm);const Am=async(e,t,...n)=>await e.send(new im(t),...n);async function*km(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.NextToken=o,t.MaxResults=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Am(e.client,t,...n),yield r;const a=o;o=r.NextToken,i=!(!o||e.stopOnSameToken&&o===a)}}const Dm=async(e,t,...n)=>await e.send(new am(t),...n);async function*Rm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.NextToken=o,t.MaxResults=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Dm(e.client,t,...n),yield r;const a=o;o=r.NextToken,i=!(!o||e.stopOnSameToken&&o===a)}}const Om=async(e,t,...n)=>await e.send(new cm(t),...n);async function*Lm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.NextToken=o,t.PageSize=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Om(e.client,t,...n),yield r;const a=o;o=r.NextToken,i=!(!o||e.stopOnSameToken&&o===a)}}const Fm=async(e,t,...n)=>await e.send(new dm(t),...n);async function*zm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.ExclusiveStartTableName=o,t.Limit=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Fm(e.client,t,...n),yield r;const a=o;o=r.LastEvaluatedTableName,i=!(!o||e.stopOnSameToken&&o===a)}}const Bm=async(e,t,...n)=>await e.send(new pm(t),...n);async function*Um(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.ExclusiveStartKey=o,t.Limit=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Bm(e.client,t,...n),yield r;const a=o;o=r.LastEvaluatedKey,i=!(!o||e.stopOnSameToken&&o===a)}}const $m=async(e,t,...n)=>await e.send(new ym(t),...n);async function*Mm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.ExclusiveStartKey=o,t.Limit=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await $m(e.client,t,...n),yield r;const a=o;o=r.LastEvaluatedKey,i=!(!o||e.stopOnSameToken&&o===a)}}const jm=e=>new Promise((t=>setTimeout(t,1e3*e))),qm={minDelay:2,maxDelay:120};var Vm;!function(e){e.ABORTED="ABORTED",e.FAILURE="FAILURE",e.SUCCESS="SUCCESS",e.RETRY="RETRY",e.TIMEOUT="TIMEOUT"}(Vm||(Vm={}));const Gm=e=>{if(e.state===Vm.ABORTED){const t=new Error(`${JSON.stringify({...e,reason:"Request was aborted"})}`);throw t.name="AbortError",t}if(e.state===Vm.TIMEOUT){const t=new Error(`${JSON.stringify({...e,reason:"Waiter has timed out"})}`);throw t.name="TimeoutError",t}if(e.state!==Vm.SUCCESS)throw new Error(`${JSON.stringify({result:e})}`);return e},Hm=(e,t,n,r)=>r>n?t:Km(e,e*2**(r-1)),Km=(e,t)=>e+Math.random()*(t-e),Wm=async({minDelay:e,maxDelay:t,maxWaitTime:n,abortController:r,client:o,abortSignal:i},a,s)=>{const{state:c,reason:d}=await s(o,a);if(c!==Vm.RETRY)return{state:c,reason:d};let l=1;const u=Date.now()+1e3*n,p=Math.log(t/e)/Math.log(2)+1;for(;;){if(r?.signal?.aborted||i?.aborted)return{state:Vm.ABORTED};const n=Hm(e,t,p,l);if(Date.now()+1e3*n>u)return{state:Vm.TIMEOUT};await jm(n);const{state:c,reason:d}=await s(o,a);if(c!==Vm.RETRY)return{state:c,reason:d};l+=1}},Jm=async e=>new Promise((t=>{e.onabort=()=>t({state:Vm.ABORTED})})),Qm=async(e,t,n)=>{const r={...qm,...e};(e=>{if(e.maxWaitTime<1)throw new Error("WaiterConfiguration.maxWaitTime must be greater than 0");if(e.minDelay<1)throw new Error("WaiterConfiguration.minDelay must be greater than 0");if(e.maxDelay<1)throw new Error("WaiterConfiguration.maxDelay must be greater than 0");if(e.maxWaitTime<=e.minDelay)throw new Error(`WaiterConfiguration.maxWaitTime [${e.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`);if(e.maxDelay<e.minDelay)throw new Error(`WaiterConfiguration.maxDelay [${e.maxDelay}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`)})(r);const o=[Wm(r,t,n)];return e.abortController&&o.push(Jm(e.abortController.signal)),e.abortSignal&&o.push(Jm(e.abortSignal)),Promise.race(o)},Xm=async(e,t)=>{let n;try{const r=await e.send(new Wp(t));n=r;try{if("ACTIVE"===r.Table.TableStatus)return{state:Vm.SUCCESS,reason:n}}catch(e){}}catch(e){if(n=e,e.name&&"ResourceNotFoundException"==e.name)return{state:Vm.RETRY,reason:n}}return{state:Vm.RETRY,reason:n}},Ym=async(e,t)=>Qm({minDelay:20,maxDelay:120,...e},t,Xm),Zm=async(e,t)=>{const n=await Qm({minDelay:20,maxDelay:120,...e},t,Xm);return Gm(n)},eh=async(e,t)=>{let n;try{n=await e.send(new Wp(t))}catch(e){if(n=e,e.name&&"ResourceNotFoundException"==e.name)return{state:Vm.SUCCESS,reason:n}}return{state:Vm.RETRY,reason:n}},th=async(e,t)=>Qm({minDelay:20,maxDelay:120,...e},t,eh),nh=async(e,t)=>{const n=await Qm({minDelay:20,maxDelay:120,...e},t,eh);return Gm(n)}},5074:(e,t,n)=>{n.r(t),n.d(t,{convertToAttr:()=>r,convertToNative:()=>y,marshall:()=>v,unmarshall:()=>S});const r=(e,t)=>{if(void 0===e)throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(null===e&&"object"==typeof e)return c();if(Array.isArray(e))return o(e,t);if("Set"===e?.constructor?.name)return i(e,t);if("Map"===e?.constructor?.name)return a(e,t);if("Object"===e?.constructor?.name||!e.constructor&&"object"==typeof e)return s(e,t);if(h(e))return 0===e.length&&t?.convertEmptyValues?c():d(e);if("boolean"==typeof e||"Boolean"===e?.constructor?.name)return{BOOL:e.valueOf()};if("number"==typeof e||"Number"===e?.constructor?.name)return m(e);if("bigint"==typeof e)return u(e);if("string"==typeof e||"String"===e?.constructor?.name)return 0===e.length&&t?.convertEmptyValues?c():l(e);if(t?.convertClassInstanceToMap&&"object"==typeof e)return s(e,t);throw new Error(`Unsupported type passed: ${e}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},o=(e,t)=>({L:e.filter((e=>!t?.removeUndefinedValues||t?.removeUndefinedValues&&void 0!==e)).map((e=>r(e,t)))}),i=(e,t)=>{const n=t?.removeUndefinedValues?new Set([...e].filter((e=>void 0!==e))):e;if(!t?.removeUndefinedValues&&n.has(void 0))throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(0===n.size){if(t?.convertEmptyValues)return c();throw new Error("Pass a non-empty set, or options.convertEmptyValues=true.")}const r=n.values().next().value;if("number"==typeof r)return{NS:Array.from(n).map(m).map((e=>e.N))};if("bigint"==typeof r)return{NS:Array.from(n).map(u).map((e=>e.N))};if("string"==typeof r)return{SS:Array.from(n).map(l).map((e=>e.S))};if(h(r))return{BS:Array.from(n).map(d).map((e=>e.B))};throw new Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},a=(e,t)=>({M:(e=>{const n={};for(const[o,i]of e)"function"==typeof i||void 0===i&&t?.removeUndefinedValues||(n[o]=r(i,t));return n})(e)}),s=(e,t)=>({M:(e=>{const n={};for(const o in e){const i=e[o];"function"==typeof i||void 0===i&&t?.removeUndefinedValues||(n[o]=r(i,t))}return n})(e)}),c=()=>({NULL:!0}),d=e=>({B:e}),l=e=>({S:e.toString()}),u=e=>({N:e.toString()}),p=e=>{throw new Error(`${e} ${"function"==typeof BigInt?"Use BigInt.":"Pass string value instead."} `)},m=e=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map((e=>e.toString())).includes(e.toString()))throw new Error(`Special numeric value ${e.toString()} is not allowed`);return e>Number.MAX_SAFE_INTEGER?p(`Number ${e.toString()} is greater than Number.MAX_SAFE_INTEGER.`):e<Number.MIN_SAFE_INTEGER&&p(`Number ${e.toString()} is lesser than Number.MIN_SAFE_INTEGER.`),{N:e.toString()}},h=e=>!!e?.constructor&&["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(e.constructor.name),y=(e,t)=>{for(const[n,r]of Object.entries(e))if(void 0!==r)switch(n){case"NULL":return null;case"BOOL":return Boolean(r);case"N":return f(r,t);case"B":return w(r);case"S":return g(r);case"L":return E(r,t);case"M":return b(r,t);case"NS":return new Set(r.map((e=>f(e,t))));case"BS":return new Set(r.map(w));case"SS":return new Set(r.map(g));default:throw new Error(`Unsupported type passed: ${n}`)}throw new Error(`No value defined: ${JSON.stringify(e)}`)},f=(e,t)=>{if(t?.wrapNumbers)return{value:e};const n=Number(e),r=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)&&!r.includes(n)){if("function"!=typeof BigInt)throw new Error(`${e} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);try{return BigInt(e)}catch(t){throw new Error(`${e} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}}return n},g=e=>e,w=e=>e,E=(e,t)=>e.map((e=>y(e,t))),b=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(e[n]=y(r,t),e)),{});function v(e,t){const n=r(e,t),[o,i]=Object.entries(n)[0];switch(o){case"M":case"L":return i;default:return n}}const S=(e,t)=>y({M:e},t)},4378:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.extractRegionFromEndpoint=t.buildMqtt5FinalUsername=t.populate_username_string_with_custom_authorizer=t.is_string_and_not_empty=t.add_to_username_parameter=void 0;const a=i(n(6843));function s(e,t,n){let r=e;return-1!=r.indexOf("?")?r+="&":r+="?",-1!=t.indexOf(n)?r+t:r+n+t}function c(e){return null!=e&&"string"==typeof e&&""!=e}function d(e,t,n){t&&n.push([e,t])}t.add_to_username_parameter=s,t.is_string_and_not_empty=c,t.populate_username_string_with_custom_authorizer=function(e,t,n,r,o,i,a){let d="";if(e&&(d+=e),0==c(t)?c(o)&&o&&(d+=o):d+=t,c(n)&&n&&(d=s(d,n,"x-amz-customauthorizer-name=")),c(r)&&r&&(d=s(d,r,"x-amz-customauthorizer-signature="),(c(i)&&i||c(a)&&a)&&console.log("Warning: Signed custom authorizers with signature will not work without a token key name and token value. Your connection may be rejected/stalled on the IoT Core side due to this. Please set the token key name and token value to connect to a signed custom authorizer.")),c(r)||c(a)||c(i)){if(!a||!i)throw new Error("Token-based custom authentication requires all token-related properties to be set");d=s(d,a,i+"=")}return d},t.buildMqtt5FinalUsername=function(e){let t="",n=[];if(e){let r=!1;if((e.tokenValue||e.tokenKeyName||e.tokenSignature)&&(r=!0,!e.tokenValue||!e.tokenKeyName||!e.tokenSignature))throw new Error("Token-based custom authentication requires all token-related properties to be set");let o=e.username,i=(null!=o?o:"").split("?"),a=i.slice(1);if(t=i[0],a.length>1)throw new Error("Custom auth username property value is invalid");1==a.length&&a[0].split("&").forEach(((e,t,r)=>{var o;let i=e.split("=");n.push([i[0],null!==(o=i[1])&&void 0!==o?o:""])})),d("x-amz-customauthorizer-name",e.authorizerName,n),r&&(d(e.tokenKeyName,e.tokenValue,n),d("x-amz-customauthorizer-signature",e.tokenSignature,n))}return n.push(["SDK","NodeJSv2"]),n.push(["Version",a.crt_version()]),(null!=t?t:"")+"?"+n.map((e=>`${e[0]}=${e[1]}`)).join("&")},t.extractRegionFromEndpoint=function(e){const t=e.match(/^[\w\-]+\.[\w\-]+\.([\w+\-]+)\./);if(t)return t[1];throw new Error("AWS region could not be extracted from endpoint. Use 'region' property on WebsocketConfig to set manually.")}},7482:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.newCancellablePromiseFromNextEvent=t.CancelController=t.EVENT_NAME=void 0;const a=n(2361),s=i(n(7113));t.EVENT_NAME="cancelled",t.CancelController=class{constructor(e){this.cancelled=!1,e&&e.emitterFactory?this.emitter=e.emitterFactory():this.emitter=new a.EventEmitter}cancel(){this.cancelled||(this.cancelled=!0,this.emitter.emit(t.EVENT_NAME),this.emitter.removeAllListeners(t.EVENT_NAME))}hasBeenCancelled(){return this.cancelled}addListener(e){if(!this.cancelled)return this.emitter.on(t.EVENT_NAME,e),()=>{this.emitter.removeListener(t.EVENT_NAME,e)};e()}},t.newCancellablePromiseFromNextEvent=function(e){let t,n,r=s.newLiftedPromise();return t=t=>{try{e.eventDataTransformer?r.resolve(e.eventDataTransformer(t)):r.resolve(t)}catch(e){r.reject(e)}},e.emitter.addListener(e.eventName,t),e.cancelController&&(n=e.cancelController.addListener((()=>{r.reject(e.cancelMessage)}))),s.makeSelfCleaningPromise(r.promise,(()=>{t&&e.emitter.removeListener(e.eventName,t),n&&n()}))}},9651:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferedEventEmitter=void 0;const r=n(2361);class o{constructor(e,t){this.event=e,this.args=t}}class i extends r.EventEmitter{constructor(){super(),this.corked=!1}cork(){this.corked=!0}uncork(){for(this.corked=!1;this.eventQueue;){const e=this.eventQueue;super.emit(e.event,...e.args),this.eventQueue=this.eventQueue.next}}emit(e,...t){if(this.corked){let n=this.lastQueuedEvent;return this.lastQueuedEvent=new o(e,t),n?n.next=this.lastQueuedEvent:this.eventQueue=this.lastQueuedEvent,this.listeners(e).length>0}return super.emit(e,...t)}}t.BufferedEventEmitter=i},3804:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.CommonHttpProxyOptions=t.HttpProxyAuthenticationType=t.HttpVersion=void 0,(r=t.HttpVersion||(t.HttpVersion={}))[r.Unknown=0]="Unknown",r[r.Http1_0=1]="Http1_0",r[r.Http1_1=2]="Http1_1",r[r.Http2=3]="Http2",function(e){e[e.None=0]="None",e[e.Basic=1]="Basic"}(n=t.HttpProxyAuthenticationType||(t.HttpProxyAuthenticationType={})),t.CommonHttpProxyOptions=class{constructor(e,t,r=n.None,o,i){this.host_name=e,this.port=t,this.auth_method=r,this.auth_username=o,this.auth_password=i}}},9712:(e,t)=>{var n,r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.SocketDomain=t.SocketType=t.TlsVersion=void 0,(o=t.TlsVersion||(t.TlsVersion={}))[o.SSLv3=0]="SSLv3",o[o.TLSv1=1]="TLSv1",o[o.TLSv1_1=2]="TLSv1_1",o[o.TLSv1_2=3]="TLSv1_2",o[o.TLSv1_3=4]="TLSv1_3",o[o.Default=128]="Default",(r=t.SocketType||(t.SocketType={}))[r.STREAM=0]="STREAM",r[r.DGRAM=1]="DGRAM",(n=t.SocketDomain||(t.SocketDomain={}))[n.IPV4=0]="IPV4",n[n.IPV6=1]="IPV6",n[n.LOCAL=2]="LOCAL"},5641:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_RECONNECT_MIN_SEC=t.DEFAULT_RECONNECT_MAX_SEC=t.MqttWill=t.QoS=void 0,(n=t.QoS||(t.QoS={}))[n.AtMostOnce=0]="AtMostOnce",n[n.AtLeastOnce=1]="AtLeastOnce",n[n.ExactlyOnce=2]="ExactlyOnce",t.MqttWill=class{constructor(e,t,n,r=!1){this.topic=e,this.qos=t,this.payload=n,this.retain=r}},t.DEFAULT_RECONNECT_MAX_SEC=128,t.DEFAULT_RECONNECT_MIN_SEC=1},5018:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.RetryJitterType=t.ClientSessionBehavior=void 0,(r=t.ClientSessionBehavior||(t.ClientSessionBehavior={}))[r.Default=0]="Default",r[r.Clean=1]="Clean",r[r.RejoinPostSuccess=2]="RejoinPostSuccess",r[r.RejoinAlways=3]="RejoinAlways",(n=t.RetryJitterType||(t.RetryJitterType={}))[n.Default=0]="Default",n[n.None=1]="None",n[n.Full=2]="Full",n[n.Decorrelated=3]="Decorrelated"},202:(e,t)=>{var n,r,o,i,a,s,c,d,l;Object.defineProperty(t,"__esModule",{value:!0}),t.PacketType=t.RetainHandlingType=t.QoS=t.PayloadFormatIndicator=t.isSuccessfulPubackReasonCode=t.PubackReasonCode=t.isSuccessfulUnsubackReasonCode=t.UnsubackReasonCode=t.isSuccessfulSubackReasonCode=t.SubackReasonCode=t.isSuccessfulDisconnectReasonCode=t.DisconnectReasonCode=t.isSuccessfulConnectReasonCode=t.ConnectReasonCode=void 0,(l=t.ConnectReasonCode||(t.ConnectReasonCode={}))[l.Success=0]="Success",l[l.UnspecifiedError=128]="UnspecifiedError",l[l.MalformedPacket=129]="MalformedPacket",l[l.ProtocolError=130]="ProtocolError",l[l.ImplementationSpecificError=131]="ImplementationSpecificError",l[l.UnsupportedProtocolVersion=132]="UnsupportedProtocolVersion",l[l.ClientIdentifierNotValid=133]="ClientIdentifierNotValid",l[l.BadUsernameOrPassword=134]="BadUsernameOrPassword",l[l.NotAuthorized=135]="NotAuthorized",l[l.ServerUnavailable=136]="ServerUnavailable",l[l.ServerBusy=137]="ServerBusy",l[l.Banned=138]="Banned",l[l.BadAuthenticationMethod=140]="BadAuthenticationMethod",l[l.TopicNameInvalid=144]="TopicNameInvalid",l[l.PacketTooLarge=149]="PacketTooLarge",l[l.QuotaExceeded=151]="QuotaExceeded",l[l.PayloadFormatInvalid=153]="PayloadFormatInvalid",l[l.RetainNotSupported=154]="RetainNotSupported",l[l.QosNotSupported=155]="QosNotSupported",l[l.UseAnotherServer=156]="UseAnotherServer",l[l.ServerMoved=157]="ServerMoved",l[l.ConnectionRateExceeded=159]="ConnectionRateExceeded",t.isSuccessfulConnectReasonCode=function(e){return e<128},(d=t.DisconnectReasonCode||(t.DisconnectReasonCode={}))[d.NormalDisconnection=0]="NormalDisconnection",d[d.DisconnectWithWillMessage=4]="DisconnectWithWillMessage",d[d.UnspecifiedError=128]="UnspecifiedError",d[d.MalformedPacket=129]="MalformedPacket",d[d.ProtocolError=130]="ProtocolError",d[d.ImplementationSpecificError=131]="ImplementationSpecificError",d[d.NotAuthorized=135]="NotAuthorized",d[d.ServerBusy=137]="ServerBusy",d[d.ServerShuttingDown=139]="ServerShuttingDown",d[d.KeepAliveTimeout=141]="KeepAliveTimeout",d[d.SessionTakenOver=142]="SessionTakenOver",d[d.TopicFilterInvalid=143]="TopicFilterInvalid",d[d.TopicNameInvalid=144]="TopicNameInvalid",d[d.ReceiveMaximumExceeded=147]="ReceiveMaximumExceeded",d[d.TopicAliasInvalid=148]="TopicAliasInvalid",d[d.PacketTooLarge=149]="PacketTooLarge",d[d.MessageRateTooHigh=150]="MessageRateTooHigh",d[d.QuotaExceeded=151]="QuotaExceeded",d[d.AdministrativeAction=152]="AdministrativeAction",d[d.PayloadFormatInvalid=153]="PayloadFormatInvalid",d[d.RetainNotSupported=154]="RetainNotSupported",d[d.QosNotSupported=155]="QosNotSupported",d[d.UseAnotherServer=156]="UseAnotherServer",d[d.ServerMoved=157]="ServerMoved",d[d.SharedSubscriptionsNotSupported=158]="SharedSubscriptionsNotSupported",d[d.ConnectionRateExceeded=159]="ConnectionRateExceeded",d[d.MaximumConnectTime=160]="MaximumConnectTime",d[d.SubscriptionIdentifiersNotSupported=161]="SubscriptionIdentifiersNotSupported",d[d.WildcardSubscriptionsNotSupported=162]="WildcardSubscriptionsNotSupported",t.isSuccessfulDisconnectReasonCode=function(e){return e<128},(c=t.SubackReasonCode||(t.SubackReasonCode={}))[c.GrantedQoS0=0]="GrantedQoS0",c[c.GrantedQoS1=1]="GrantedQoS1",c[c.GrantedQoS2=2]="GrantedQoS2",c[c.UnspecifiedError=128]="UnspecifiedError",c[c.ImplementationSpecificError=131]="ImplementationSpecificError",c[c.NotAuthorized=135]="NotAuthorized",c[c.TopicFilterInvalid=143]="TopicFilterInvalid",c[c.PacketIdentifierInUse=145]="PacketIdentifierInUse",c[c.QuotaExceeded=151]="QuotaExceeded",c[c.SharedSubscriptionsNotSupported=158]="SharedSubscriptionsNotSupported",c[c.SubscriptionIdentifiersNotSupported=161]="SubscriptionIdentifiersNotSupported",c[c.WildcardSubscriptionsNotSupported=162]="WildcardSubscriptionsNotSupported",t.isSuccessfulSubackReasonCode=function(e){return e<128},(s=t.UnsubackReasonCode||(t.UnsubackReasonCode={}))[s.Success=0]="Success",s[s.NoSubscriptionExisted=17]="NoSubscriptionExisted",s[s.UnspecifiedError=128]="UnspecifiedError",s[s.ImplementationSpecificError=131]="ImplementationSpecificError",s[s.NotAuthorized=135]="NotAuthorized",s[s.TopicFilterInvalid=143]="TopicFilterInvalid",s[s.PacketIdentifierInUse=145]="PacketIdentifierInUse",t.isSuccessfulUnsubackReasonCode=function(e){return e<128},(a=t.PubackReasonCode||(t.PubackReasonCode={}))[a.Success=0]="Success",a[a.NoMatchingSubscribers=16]="NoMatchingSubscribers",a[a.UnspecifiedError=128]="UnspecifiedError",a[a.ImplementationSpecificError=131]="ImplementationSpecificError",a[a.NotAuthorized=135]="NotAuthorized",a[a.TopicNameInvalid=144]="TopicNameInvalid",a[a.PacketIdentifierInUse=145]="PacketIdentifierInUse",a[a.QuotaExceeded=151]="QuotaExceeded",a[a.PayloadFormatInvalid=153]="PayloadFormatInvalid",t.isSuccessfulPubackReasonCode=function(e){return e<128},(i=t.PayloadFormatIndicator||(t.PayloadFormatIndicator={}))[i.Bytes=0]="Bytes",i[i.Utf8=1]="Utf8",(o=t.QoS||(t.QoS={}))[o.AtMostOnce=0]="AtMostOnce",o[o.AtLeastOnce=1]="AtLeastOnce",o[o.ExactlyOnce=2]="ExactlyOnce",(r=t.RetainHandlingType||(t.RetainHandlingType={}))[r.SendOnSubscribe=0]="SendOnSubscribe",r[r.SendOnSubscribeIfNew=1]="SendOnSubscribeIfNew",r[r.DontSend=2]="DontSend",(n=t.PacketType||(t.PacketType={}))[n.Connect=1]="Connect",n[n.Connack=2]="Connack",n[n.Publish=3]="Publish",n[n.Puback=4]="Puback",n[n.Pubrec=5]="Pubrec",n[n.Pubrel=6]="Pubrel",n[n.Pubcomp=7]="Pubcomp",n[n.Subscribe=8]="Subscribe",n[n.Suback=9]="Suback",n[n.Unsubscribe=10]="Unsubscribe",n[n.Unsuback=11]="Unsuback",n[n.Pingreq=12]="Pingreq",n[n.Pingresp=13]="Pingresp",n[n.Disconnect=14]="Disconnect",n[n.Auth=15]="Auth"},4231:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_KEEP_ALIVE=t.normalize_payload=void 0,t.normalize_payload=function(e){if(e instanceof Buffer)return e;if("string"==typeof e)return e;if(ArrayBuffer.isView(e)){const t=e;return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}if(e instanceof ArrayBuffer)return Buffer.from(e);if("object"==typeof e)return JSON.stringify(e);if(!e)return"";throw new TypeError("payload parameter must be a string, object, or DataView.")},t.DEFAULT_KEEP_ALIVE=1200},6843:(e,t,n)=>{function r(){return"object"==typeof process&&"object"==typeof process.versions&&void 0!==process.versions.node}function o(){try{return n(5062)}catch(e){return{name:"aws-crt-nodejs",version:"UNKNOWN"}}}Object.defineProperty(t,"__esModule",{value:!0}),t.crt_version=t.package_info=t.is_browser=t.is_nodejs=void 0,t.is_nodejs=r,t.is_browser=function(){return!r()},t.package_info=o,t.crt_version=function(){return o().version}},7113:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.newLiftedPromise=t.makeSelfCleaningPromise=void 0,t.makeSelfCleaningPromise=function(e,t){return t?e.finally((()=>{t()})):e},t.newLiftedPromise=function(e){let t,n,r=new Promise(((e,r)=>{t=e,n=r}));if(!t||!n)throw new Error("Failed to bind resolve and reject when making lifted promise");return e&&e(t,n),{promise:r,resolve:t,reject:n}}},4103:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0,t.using=function(e,t){return n(this,void 0,void 0,(function*(){try{yield t(e)}finally{e.close()}}))}},8687:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CrtError=t.resource_safety=t.promise=t.platform=t.mqtt5=t.mqtt=t.iot=t.io=t.http=t.eventstream=t.crt=t.crypto=t.checksums=t.cancel=t.auth=void 0;const a=i(n(7482));t.cancel=a;const s=i(n(6843));t.platform=s;const c=i(n(7113));t.promise=c;const d=i(n(4103));t.resource_safety=d;const l=i(n(7822));t.auth=l;const u=i(n(5988));t.checksums=u;const p=i(n(7227));t.crt=p;const m=i(n(5145));t.crypto=m;const h=i(n(7259));t.eventstream=h;const y=i(n(8415));t.http=y;const f=i(n(3787));t.io=f;const g=i(n(9793));t.iot=g;const w=i(n(799));t.mqtt=w;const E=i(n(2385));t.mqtt5=E;const b=n(2875);Object.defineProperty(t,"CrtError",{enumerable:!0,get:function(){return b.CrtError}})},7822:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.aws_verify_sigv4a_signing=t.aws_sign_request=t.AwsSignedBodyHeaderType=t.AwsSignedBodyValue=t.AwsSignatureType=t.AwsSigningAlgorithm=t.AwsCredentialsProvider=void 0;const i=o(n(1221)),a=n(2875),s=n(3787);class c extends i.default.AwsCredentialsProvider{static newDefault(e=void 0){return super.newDefault(null!=e?e.native_handle():null)}static newStatic(e,t,n){return super.newStatic(e,t,n)}static newCognito(e){if(null==e||null==e)throw new a.CrtError("AwsCredentialsProvider newCognito: Cognito config not defined");return super.newCognito(e,null!=e.tlsContext?e.tlsContext.native_handle():(new s.ClientTlsContext).native_handle(),null!=e.bootstrap?e.bootstrap.native_handle():null,e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null)}static newX509(e){if(null==e||null==e)throw new a.CrtError("AwsCredentialsProvider newX509: X509 config not defined");return super.newX509(e,e.tlsContext.native_handle(),e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null)}}var d,l,u,p;t.AwsCredentialsProvider=c,(p=t.AwsSigningAlgorithm||(t.AwsSigningAlgorithm={}))[p.SigV4=0]="SigV4",p[p.SigV4Asymmetric=1]="SigV4Asymmetric",(u=t.AwsSignatureType||(t.AwsSignatureType={}))[u.HttpRequestViaHeaders=0]="HttpRequestViaHeaders",u[u.HttpRequestViaQueryParams=1]="HttpRequestViaQueryParams",u[u.HttpRequestChunk=2]="HttpRequestChunk",u[u.HttpRequestEvent=3]="HttpRequestEvent",(l=t.AwsSignedBodyValue||(t.AwsSignedBodyValue={})).EmptySha256="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",l.UnsignedPayload="UNSIGNED-PAYLOAD",l.StreamingAws4HmacSha256Payload="STREAMING-AWS4-HMAC-SHA256-PAYLOAD",l.StreamingAws4HmacSha256Events="STREAMING-AWS4-HMAC-SHA256-EVENTS",(d=t.AwsSignedBodyHeaderType||(t.AwsSignedBodyHeaderType={}))[d.None=0]="None",d[d.XAmzContentSha256=1]="XAmzContentSha256",t.aws_sign_request=function(e,t){return r(this,void 0,void 0,(function*(){return new Promise(((n,r)=>{try{i.default.aws_sign_request(e,t,(t=>{0==t?n(e):r(new a.CrtError(t))}))}catch(e){r(e)}}))}))},t.aws_verify_sigv4a_signing=function(e,t,n,r,o,a){return i.default.aws_verify_sigv4a_signing(e,t,n,r,o,a)}},8583:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AwsIotMqttConnectionConfigBuilder=void 0;const s=n(5641),c=i(n(3787)),d=n(3787),l=i(n(6843)),u=n(2875),p=n(7822),m=i(n(4378));class h{constructor(e){this.tls_ctx_options=e,this.params={client_id:"",host_name:"",socket_options:new c.SocketOptions,port:8883,use_websocket:!1,clean_session:!1,keep_alive:void 0,will:void 0,username:"",password:void 0,tls_ctx:void 0,reconnect_min_sec:s.DEFAULT_RECONNECT_MIN_SEC,reconnect_max_sec:s.DEFAULT_RECONNECT_MAX_SEC},this.is_using_custom_authorizer=!1}static new_mtls_builder_from_path(e,t){let n=new h(d.TlsContextOptions.create_client_with_mtls_from_path(e,t));return n.params.port=8883,c.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),n}static new_mtls_builder(e,t){let n=new h(d.TlsContextOptions.create_client_with_mtls(e,t));return n.params.port=8883,c.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),n}static new_mtls_pkcs11_builder(e){let t=new h(d.TlsContextOptions.create_client_with_mtls_pkcs11(e));return t.params.port=8883,c.is_alpn_available()&&t.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),t}static new_mtls_pkcs12_builder(e){let t=new h(d.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(e.pkcs12_file,e.pkcs12_password));return t.params.port=8883,c.is_alpn_available()&&t.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),t}static new_mtls_windows_cert_store_path_builder(e){let t=new h(d.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(e));return t.params.port=8883,c.is_alpn_available()&&t.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),t}static new_default_builder(){let e=new c.TlsContextOptions;return new h(e)}static new_websocket_builder(...e){return this.new_with_websockets(...e)}static configure_websocket_handshake(e,t){if(t){if(null==e||null==e)throw new u.CrtError("AwsIotMqttConnectionConfigBuilder configure_websocket_handshake: builder not defined");e.params.websocket_handshake_transform=(e,n)=>a(this,void 0,void 0,(function*(){var r,o,i;const a=null!==(o=null===(r=t.create_signing_config)||void 0===r?void 0:r.call(t))&&void 0!==o?o:{algorithm:p.AwsSigningAlgorithm.SigV4,signature_type:p.AwsSignatureType.HttpRequestViaQueryParams,provider:t.credentials_provider,region:t.region,service:null!==(i=t.service)&&void 0!==i?i:"iotdevicegateway",signed_body_value:p.AwsSignedBodyValue.EmptySha256,omit_session_token:!0};try{yield(0,p.aws_sign_request)(e,a),n()}catch(e){e instanceof u.CrtError?n(e.error_code):n(3)}}))}return e}static new_with_websockets(e){let t=null==e?void 0:e.tls_ctx_options;t||(t=new d.TlsContextOptions,t.alpn_list=[]);let n=new h(t);return n.params.use_websocket=!0,n.params.proxy_options=null==e?void 0:e.proxy_options,n.tls_ctx_options&&(n.params.port=443),this.configure_websocket_handshake(n,e),n}static new_builder_for_websocket(){return this.new_with_websockets()}with_certificate_authority_from_path(e,t){return this.tls_ctx_options.override_default_trust_store_from_path(e,t),this}with_certificate_authority(e){return this.tls_ctx_options.override_default_trust_store(e),this}with_endpoint(e){return this.params.host_name=e,this}with_port(e){return this.params.port=e,this}with_client_id(e){return this.params.client_id=e,this}with_clean_session(e){return this.params.clean_session=e,this}with_keep_alive_seconds(e){return this.params.keep_alive=e,this}with_timeout_ms(e){return this.with_ping_timeout_ms(e),this}with_ping_timeout_ms(e){return this.params.ping_timeout=e,this}with_protocol_operation_timeout_ms(e){return this.params.protocol_operation_timeout=e,this}with_will(e){return this.params.will=e,this}with_socket_options(e){return this.params.socket_options=e,this}with_credentials(e,t,n,r){return h.configure_websocket_handshake(this,{credentials_provider:p.AwsCredentialsProvider.newStatic(t,n,r),region:e,service:"iotdevicegateway"})}with_http_proxy_options(e){return this.params.proxy_options=e,this}with_custom_authorizer(e,t,n,r,o,i){this.is_using_custom_authorizer=!0;let a=m.populate_username_string_with_custom_authorizer("",e,t,n,this.params.username,o,i);return this.params.username=a,this.params.password=r,this.params.use_websocket||(this.tls_ctx_options.alpn_list=["mqtt"]),this.params.port=443,this}with_username(e){return this.params.username=e,this}with_password(e){return this.params.password=e,this}with_reconnect_max_sec(e){return this.params.reconnect_max_sec=e,this}with_reconnect_min_sec(e){return this.params.reconnect_min_sec=e,this}build(){var e,t,n;if(void 0===this.params.client_id||void 0===this.params.host_name)throw"client_id and endpoint are required";return 0==this.is_using_custom_authorizer&&m.is_string_and_not_empty(this.params.username)&&(-1==(null===(e=this.params.username)||void 0===e?void 0:e.indexOf("x-amz-customauthorizer-name="))&&-1==(null===(t=this.params.username)||void 0===t?void 0:t.indexOf("x-amz-customauthorizer-signature="))||(this.is_using_custom_authorizer=!0)),1==this.is_using_custom_authorizer&&443!=this.params.port&&console.log("Warning: Attempting to connect to authorizer with unsupported port. Port is not 443..."),void 0===this.params.tls_ctx&&(this.params.tls_ctx=new c.ClientTlsContext(this.tls_ctx_options)),0==m.is_string_and_not_empty(this.params.username)?this.params.username="?SDK=NodeJSv2&Version=":-1!=(null===(n=this.params.username)||void 0===n?void 0:n.indexOf("?"))?this.params.username+="&SDK=NodeJSv2&Version=":this.params.username+="?SDK=NodeJSv2&Version=",this.params.username+=l.crt_version(),this.params}}t.AwsIotMqttConnectionConfigBuilder=h},1838:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AwsIotMqtt5ClientConfigBuilder=void 0;const s=i(n(2385)),c=i(n(3787)),d=i(n(7822)),l=n(2875),u=i(n(4378)),p=i(n(4231));class m{constructor(e,t,n){this.tlsContextOptions=n,this.config={hostName:e,port:t,connectProperties:{keepAliveIntervalSeconds:p.DEFAULT_KEEP_ALIVE},extendedValidationAndFlowControlOptions:s.ClientExtendedValidationAndFlowControl.AwsIotCoreDefaults}}static newDirectMqttBuilderWithMtlsFromPath(e,t,n){let r=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_from_path(t,n));return c.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),r}static newDirectMqttBuilderWithMtlsFromMemory(e,t,n){let r=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls(t,n));return c.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),r}static newDirectMqttBuilderWithMtlsFromPkcs11(e,t){let n=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_pkcs11(t));return c.is_alpn_available()&&n.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),n}static newDirectMqttBuilderWithMtlsFromPkcs12(e,t){let n=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(t.pkcs12_file,t.pkcs12_password));return c.is_alpn_available()&&n.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),n}static newDirectMqttBuilderWithMtlsFromWindowsCertStorePath(e,t){let n=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(t));return c.is_alpn_available()&&n.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),n}static newDirectMqttBuilderWithCustomAuth(e,t){let n=new m(e,m.DEFAULT_WEBSOCKET_MQTT_PORT,new c.TlsContextOptions);return n.customAuthConfig=t,n.tlsContextOptions.alpn_list=["mqtt"],n}static newWebsocketMqttBuilderWithSigv4Auth(e,t){let n=new c.TlsContextOptions;n.alpn_list=[];let r=new m(e,m.DEFAULT_WEBSOCKET_MQTT_PORT,n),o=null==t?void 0:t.credentialsProvider;return o||(o=d.AwsCredentialsProvider.newDefault()),r.config.websocketHandshakeTransform=(n,r)=>a(this,void 0,void 0,(function*(){var i;try{const a={algorithm:d.AwsSigningAlgorithm.SigV4,signature_type:d.AwsSignatureType.HttpRequestViaQueryParams,provider:o,region:null!==(i=null==t?void 0:t.region)&&void 0!==i?i:u.extractRegionFromEndpoint(e),service:"iotdevicegateway",signed_body_value:d.AwsSignedBodyValue.EmptySha256,omit_session_token:!0};yield d.aws_sign_request(n,a),r()}catch(e){e instanceof l.CrtError?r(e.error_code):r(3)}})),r}static newWebsocketMqttBuilderWithCustomAuth(e,t){let n=new m(e,m.DEFAULT_WEBSOCKET_MQTT_PORT,new c.TlsContextOptions);return n.customAuthConfig=t,n.config.websocketHandshakeTransform=(e,t)=>a(this,void 0,void 0,(function*(){t(0)})),n}withCertificateAuthorityFromPath(e,t){return this.tlsContextOptions.override_default_trust_store_from_path(e,t),this}withCertificateAuthority(e){return this.tlsContextOptions.override_default_trust_store(e),this}withPort(e){return this.config.port=e,this}withConnectProperties(e){return this.config.connectProperties=e,this}withSessionBehavior(e){return this.config.sessionBehavior=e,this}withRetryJitterMode(e){return this.config.retryJitterMode=e,this}withMinReconnectDelayMs(e){return this.config.minReconnectDelayMs=e,this}withMaxReconnectDelayMs(e){return this.config.maxReconnectDelayMs=e,this}withMinConnectedTimeToResetReconnectDelayMs(e){return this.config.minConnectedTimeToResetReconnectDelayMs=e,this}withConnackTimeoutMs(e){return this.config.connackTimeoutMs=e,this}withOfflineQueueBehavior(e){return this.config.offlineQueueBehavior=e,this}withPingTimeoutMs(e){return this.config.pingTimeoutMs=e,this}withAckTimeoutSeconds(e){return this.config.ackTimeoutSeconds=e,this}withSocketOptions(e){return this.config.socketOptions=e,this}withHttpProxyOptions(e){return this.config.httpProxyOptions=e,this}withExtendedValidationAndFlowControlOptions(e){return this.config.extendedValidationAndFlowControlOptions=e,this}build(){var e,t;return void 0===this.config.tlsCtx&&(this.config.tlsCtx=new c.ClientTlsContext(this.tlsContextOptions)),this.config.connectProperties&&(this.config.connectProperties.username=u.buildMqtt5FinalUsername(this.customAuthConfig),(null===(e=this.customAuthConfig)||void 0===e?void 0:e.password)&&(this.config.connectProperties.password=null===(t=this.customAuthConfig)||void 0===t?void 0:t.password)),this.config}}t.AwsIotMqtt5ClientConfigBuilder=m,m.DEFAULT_WEBSOCKET_MQTT_PORT=443,m.DEFAULT_DIRECT_MQTT_PORT=8883},1221:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(1017)),s=n(2037),c=n(7147),d=n(7282),l="Please upgrade to node >=10.16.0, or use the provided browser implementation.";if(!("napi"in d.versions))throw new Error("The current runtime is not reporting an NAPI version. "+l);if(parseInt(d.versions.napi)<4)throw new Error("The AWS CRT native implementation requires that NAPI version 4 be present. "+l);const u=`${s.platform}-${s.arch}`;let p=a.resolve(__dirname,"..","..");const m=a.join(p,"dist");(0,c.existsSync)(m)&&(p=m);const h=a.resolve(p,"bin"),y=[a.join(h,u,"aws-crt-nodejs")];let f;for(const e of y)if((0,c.existsSync)(e+".node")){f=n(1309)(e);break}if(null==f)throw new Error("AWS CRT binary not present in any of the following locations:\n\t"+y.join("\n\t"));t.default=f},5988:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.crc32c=t.crc32=void 0;const o=r(n(1221));t.crc32=function(e,t){return o.default.checksums_crc32(e,t)},t.crc32c=function(e,t){return o.default.checksums_crc32c(e,t)}},7227:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.native_memory_dump=t.native_memory=void 0;const o=r(n(1221));t.native_memory=function(){return o.default.native_memory()},t.native_memory_dump=function(){return o.default.native_memory_dump()}},5145:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hmac_sha256=t.Sha256Hmac=t.hash_sha1=t.Sha1Hash=t.hash_sha256=t.Sha256Hash=t.hash_md5=t.Md5Hash=void 0;const o=r(n(1221)),i=n(8763);class a extends i.NativeResource{update(e){o.default.hash_update(this.native_handle(),e)}finalize(e){return o.default.hash_digest(this.native_handle(),e)}constructor(e){super(e)}}t.Md5Hash=class extends a{constructor(){super(o.default.hash_md5_new())}},t.hash_md5=function(e,t){return o.default.hash_md5_compute(e,t)},t.Sha256Hash=class extends a{constructor(){super(o.default.hash_sha256_new())}},t.hash_sha256=function(e,t){return o.default.hash_sha256_compute(e,t)},t.Sha1Hash=class extends a{constructor(){super(o.default.hash_sha1_new())}},t.hash_sha1=function(e,t){return o.default.hash_sha1_compute(e,t)};class s extends i.NativeResource{update(e){o.default.hmac_update(this.native_handle(),e)}finalize(e){return o.default.hmac_digest(this.native_handle(),e)}constructor(e){super(e)}}t.Sha256Hmac=class extends s{constructor(e){super(o.default.hmac_sha256_new(e))}},t.hmac_sha256=function(e,t,n){return o.default.hmac_sha256_compute(e,t,n)}},2875:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CrtError=void 0;const o=r(n(1221));class i extends Error{constructor(e){super(function(e){return"number"==typeof e?o.default.error_code_to_string(e):e instanceof i?e.message:e.toString()}(e)),this.error=e,this.error_code=function(e){return"number"==typeof e?e:e instanceof i?e.error_code:void 0}(e),this.error_name=function(e){return"number"==typeof e?o.default.error_code_to_name(e):e instanceof i?e.error_name:void 0}(e)}}t.CrtError=i},7259:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientStream=t.ClientConnection=t.MessageType=t.MessageFlags=t.Header=t.HeaderType=void 0;const c=n(8763),d=n(9651),l=n(2875),u=i(n(3787)),p=i(n(6731)),m=i(n(7113)),h=s(n(1221));var y,f,g,w,E;!function(e){e[e.BooleanTrue=0]="BooleanTrue",e[e.BooleanFalse=1]="BooleanFalse",e[e.Byte=2]="Byte",e[e.Int16=3]="Int16",e[e.Int32=4]="Int32",e[e.Int64=5]="Int64",e[e.ByteBuffer=6]="ByteBuffer",e[e.String=7]="String",e[e.Timestamp=8]="Timestamp",e[e.UUID=9]="UUID"}(y=t.HeaderType||(t.HeaderType={}));class b{constructor(e,t,n){this.name=e,this.type=t,this.value=n}static validateHeaderName(e){if(0==e.length||e.length>127)throw new l.CrtError(`Event stream header name (${e}) is not valid`)}static newBoolean(e,t){return b.validateHeaderName(e),new b(e,t?y.BooleanTrue:y.BooleanFalse)}static newByte(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT8&&t<=p.MAX_INT8&&Number.isSafeInteger(t))return new b(e,y.Byte,t);throw new l.CrtError(`Illegal value for eventstream byte-valued header: ${t}`)}static newInt16(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT16&&t<=p.MAX_INT16&&Number.isSafeInteger(t))return new b(e,y.Int16,t);throw new l.CrtError(`Illegal value for eventstream int16-valued header: ${t}`)}static newInt32(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT32&&t<=p.MAX_INT32&&Number.isSafeInteger(t))return new b(e,y.Int32,t);throw new l.CrtError(`Illegal value for eventstream int32-valued header: ${t}`)}static newInt64FromNumber(e,t){if(b.validateHeaderName(e),Number.isSafeInteger(t))return new b(e,y.Int64,p.marshalInt64BigintAsBuffer(BigInt(t)));throw new l.CrtError(`Illegal value for eventstream int64-valued header: ${t}`)}static newInt64FromBigint(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT64&&t<=p.MAX_INT64)return new b(e,y.Int64,p.marshalInt64BigintAsBuffer(t));throw new l.CrtError(`Illegal value for eventstream int64-valued header: ${t}`)}static newByteBuffer(e,t){return b.validateHeaderName(e),new b(e,y.ByteBuffer,t)}static newString(e,t){return b.validateHeaderName(e),new b(e,y.String,t)}static newTimeStampFromSecondsSinceEpoch(e,t){if(b.validateHeaderName(e),Number.isSafeInteger(t)&&t>=0)return new b(e,y.Timestamp,t);throw new l.CrtError(`Illegal value for eventstream timestamp-valued header: ${t}`)}static newTimeStampFromDate(e,t){b.validateHeaderName(e);const n=t.getTime();if(Number.isSafeInteger(n))return new b(e,y.Timestamp,n);throw new l.CrtError(`Illegal value for eventstream timestamp-valued header: ${t}`)}static newUUID(e,t){if(b.validateHeaderName(e),16==t.byteLength)return new b(e,y.UUID,t);throw new l.CrtError(`Illegal value for eventstream uuid-valued header: ${t}`)}toValue(e){if(e!=this.type)throw new l.CrtError(`Header of type (${this.type}) cannot be converted to type (${e})`);return this.value}asBoolean(){switch(this.type){case y.BooleanFalse:return!1;case y.BooleanTrue:return!0;default:throw new l.CrtError(`Header of type (${this.type}) cannot be converted to type (boolean)`)}}asByte(){return this.toValue(y.Byte)}asInt16(){return this.toValue(y.Int16)}asInt32(){return this.toValue(y.Int32)}asInt64(){return p.unmarshalInt64BigintFromBuffer(this.toValue(y.Int64))}asByteBuffer(){return this.toValue(y.ByteBuffer)}asString(){return this.toValue(y.String)}asTimestamp(){return this.toValue(y.Timestamp)}asUUID(){return this.toValue(y.UUID)}}function v(e){let t={type:e.type,flags:e.flags,payload:e.payload};var n;return e.headers&&(t.headers=(n=e.headers,Array.from(n,(e=>new b(e.name,e.type,e.value))))),t}t.Header=b,(E=t.MessageFlags||(t.MessageFlags={}))[E.None=0]="None",E[E.ConnectionAccepted=1]="ConnectionAccepted",E[E.TerminateStream=2]="TerminateStream",(w=t.MessageType||(t.MessageType={}))[w.ApplicationMessage=0]="ApplicationMessage",w[w.ApplicationError=1]="ApplicationError",w[w.Ping=2]="Ping",w[w.PingResponse=3]="PingResponse",w[w.Connect=4]="Connect",w[w.ConnectAck=5]="ConnectAck",w[w.ProtocolError=6]="ProtocolError",w[w.InternalError=7]="InternalError",function(e){e[e.None=0]="None",e[e.Connecting=1]="Connecting",e[e.Connected=2]="Connected",e[e.Disconnected=3]="Disconnected",e[e.Closed=4]="Closed"}(f||(f={}));class S extends((0,c.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e){if(void 0===e)throw new l.CrtError("Invalid configuration passed to eventstream ClientConnection constructor");super(),this.state=f.None,this._super(h.default.event_stream_client_connection_new(this,e,((e,t)=>{S._s_on_disconnect(e,t)}),((e,t)=>{S._s_on_protocol_message(e,t)}),e.socketOptions?e.socketOptions.native_handle():null,e.tlsCtx?e.tlsCtx.native_handle():null))}close(){this.state!=f.Closed&&(this.state=f.Closed,h.default.event_stream_client_connection_close(this.native_handle()))}connect(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{if(e)if(this.state==f.None){if(this.state=f.Connecting,e.cancelController){let n=()=>{r(new l.CrtError("Event stream connection connect() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(n),!t)return}try{h.default.event_stream_client_connection_connect(this.native_handle(),(function(e,t){return S._s_on_connection_setup(n,r,e,t)}))}catch(e){this.state=f.Disconnected,r(e)}}else r(new l.CrtError(`Event stream connection in a state (${this.state}) where connect() is not allowed.`));else r(new l.CrtError("Invalid options passed to event stream ClientConnection.connect"))}));return m.makeSelfCleaningPromise(n,t)}))}sendProtocolMessage(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{try{if(!e)return void r(new l.CrtError("Invalid options passed to event stream ClientConnection.sendProtocolMessage"));if(!this.isConnected())return void r(new l.CrtError(`Event stream connection in a state (${this.state}) where sending protocol messages is not allowed.`));if(e.cancelController){let i=()=>{r(new l.CrtError("Event stream connection sendProtocolMessage() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(i),!t)return}function o(e){return S._s_on_connection_send_protocol_message_completion(n,r,e)}h.default.event_stream_client_connection_send_protocol_message(this.native_handle(),e,o)}catch(a){r(a)}}));return m.makeSelfCleaningPromise(n,t)}))}isConnected(){return this.state==f.Connected}newStream(){if(!this.isConnected())throw new l.CrtError(`Event stream connection in a state (${this.state}) where creating new streams is forbidden.`);return new _(this)}on(e,t){return super.on(e,t),this}static _s_on_connection_setup(e,t,n,r){0==r&&n.state==f.Connecting?(n.state=f.Connected,e()):(n.state!=f.Closed&&(n.state=f.Disconnected),t(u.error_code_to_string(r)))}static _s_on_disconnect(e,t){e.state!=f.Closed&&(e.state=f.Disconnected),process.nextTick((()=>{e.emit("disconnection",{errorCode:t})}))}static _s_on_protocol_message(e,t){process.nextTick((()=>{e.emit("protocolMessage",{message:v(t)})}))}static _s_on_connection_send_protocol_message_completion(e,t,n){0==n?e():t(u.error_code_to_string(n))}}t.ClientConnection=S,S.DISCONNECTION="disconnection",S.PROTOCOL_MESSAGE="protocolMessage",function(e){e[e.None=0]="None",e[e.Activating=1]="Activating",e[e.Activated=2]="Activated",e[e.Ended=3]="Ended",e[e.Closed=4]="Closed"}(g||(g={}));class _ extends((0,c.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e){super(),this._super(h.default.event_stream_client_stream_new(this,e.native_handle(),(e=>{_._s_on_stream_ended(e)}),((e,t)=>{_._s_on_stream_message(e,t)}))),this.state=g.None}close(){this.state!=g.Closed&&(this.state=g.Closed,h.default.event_stream_client_stream_close(this.native_handle()))}activate(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{try{if(this.state!=g.None)return void r(new l.CrtError(`Event stream in a state (${this.state}) where activation is not allowed.`));if(void 0===e)return this.state=g.Ended,void r(new l.CrtError("Invalid options passed to ClientStream.activate"));if(this.state=g.Activating,e.cancelController){let i=()=>{r(new l.CrtError("Event stream activate() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(i),!t)return}function o(e,t){return _._s_on_stream_activated(n,r,e,t)}h.default.event_stream_client_stream_activate(this.native_handle(),e,o)}catch(a){this.state=g.Ended,r(a)}}));return m.makeSelfCleaningPromise(n,t)}))}sendMessage(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{try{if(!e)return void r(new l.CrtError("Invalid options passed to ClientStream.sendMessage"));if(this.state!=g.Activated)return void r(new l.CrtError(`Event stream in a state (${this.state}) where sending messages is not allowed.`));if(e.cancelController){let i=()=>{r(new l.CrtError("Event stream sendMessage() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(i),!t)return}function o(e){return _._s_on_stream_send_message_completion(n,r,e)}h.default.event_stream_client_stream_send_message(this.native_handle(),e,o)}catch(a){r(a)}}));return m.makeSelfCleaningPromise(n,t)}))}isActive(){return this.state==g.Activated}on(e,t){return super.on(e,t),this}static _s_on_stream_activated(e,t,n,r){0==r&&n.state==g.Activating?(n.state=g.Activated,e()):(n.state!=g.Closed&&(n.state=g.Ended),t(u.error_code_to_string(r)))}static _s_on_stream_send_message_completion(e,t,n){0==n?e():t(u.error_code_to_string(n))}static _s_on_stream_ended(e){process.nextTick((()=>{e.emit(_.ENDED,{})}))}static _s_on_stream_message(e,t){process.nextTick((()=>{e.emit(_.MESSAGE,{message:v(t)})}))}}t.ClientStream=_,_.ENDED="ended",_.MESSAGE="message"},6731:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unmarshalInt64BigintFromBuffer=t.marshalInt64BigintAsBuffer=t.MIN_INT64=t.MAX_INT64=t.MIN_INT32=t.MAX_INT32=t.MIN_INT16=t.MAX_INT16=t.MIN_INT8=t.MAX_INT8=void 0;const r=n(2875);t.MAX_INT8=127,t.MIN_INT8=-128,t.MAX_INT16=32767,t.MIN_INT16=-32768,t.MAX_INT32=2147483647,t.MIN_INT32=-2147483648,t.MAX_INT64=BigInt("9223372036854775807"),t.MIN_INT64=BigInt("-9223372036854775808");const o=BigInt("256");t.marshalInt64BigintAsBuffer=function(e){if(e<t.MIN_INT64||e>t.MAX_INT64)throw new r.CrtError("marshalInt64BigintAsBuffer expects a value that can fit in 8 bytes");let n=new Uint8Array(8);if(e<0){e=-e-BigInt(1);for(let t=0;t<8;++t)n[t]=255-Number(e%o),e/=o}else for(let t=0;t<8;++t)n[t]=Number(e%o),e/=o;return n},t.unmarshalInt64BigintFromBuffer=function(e){let t=BigInt(0),n=new Uint8Array(e);if(8!=n.length)throw new r.CrtError("unmarshalInt64BigintFromBuffer expects a byte buffer of length 8");let i=BigInt(1);if(0!=(128&n[7])){for(let e=0;e<n.length;++e)t+=BigInt(255-n[e])*i,i*=o;t+=BigInt(1),t=-t}else for(let e=0;e<n.length;++e)t+=BigInt(n[e])*i,i*=o;return t}},8415:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpClientConnectionManager=t.HttpClientStream=t.HttpStream=t.HttpClientConnection=t.HttpProxyOptions=t.HttpProxyConnectionType=t.HttpConnection=t.HttpRequest=t.HttpHeaders=t.HttpProxyAuthenticationType=void 0;const o=r(n(1221)),i=n(8763),a=n(2875),s=n(3804);var c=n(3804);Object.defineProperty(t,"HttpProxyAuthenticationType",{enumerable:!0,get:function(){return c.HttpProxyAuthenticationType}});const d=n(9651);t.HttpHeaders=o.default.HttpHeaders;const l=o.default.HttpRequest;t.HttpRequest=class extends l{constructor(e,t,n,r){super(e,t,n,null==r?void 0:r.native_handle())}};class u extends((0,i.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e){super(),this._super(e)}close(){o.default.http_connection_close(this.native_handle())}on(e,t){return super.on(e,t),"connect"==e&&process.nextTick((()=>{this.uncork()})),this}}var p;t.HttpConnection=u,u.CONNECT="connect",u.ERROR="error",u.CLOSE="close",function(e){e[e.Legacy=0]="Legacy",e[e.Forwarding=1]="Forwarding",e[e.Tunneling=2]="Tunneling"}(p=t.HttpProxyConnectionType||(t.HttpProxyConnectionType={}));class m extends s.CommonHttpProxyOptions{constructor(e,t,n=s.HttpProxyAuthenticationType.None,r,o,i,a){super(e,t,n,r,o),this.tls_opts=i,this.connection_type=a}create_native_handle(){return o.default.http_proxy_options_new(this.host_name,this.port,this.auth_method,this.auth_username,this.auth_password,this.tls_opts?this.tls_opts.native_handle():void 0,this.connection_type?this.connection_type:p.Legacy)}}t.HttpProxyOptions=m;class h extends u{constructor(e,t,n,r,i,s,c){if(null==r||null==r)throw new a.CrtError("HttpClientConnection constructor: socket_options not defined");super(c||o.default.http_connection_new(null!=e?e.native_handle():null,((e,t)=>{this._on_setup(e,t)}),((e,t)=>{this._on_shutdown(e,t)}),t,n,r.native_handle(),i?i.native_handle():void 0,s?s.create_native_handle():void 0)),this.bootstrap=e,this.socket_options=r,this.tls_opts=i}_on_setup(e,t){t?this.emit("error",new a.CrtError(t)):this.emit("connect")}_on_shutdown(e,t){t?this.emit("error",new a.CrtError(t)):this.emit("close")}request(e){let t;const n=o.default.http_stream_new(this.native_handle(),e,(e=>{t._on_complete(e)}),((e,n)=>{t._on_response(e,n)}),(e=>{t._on_body(e)}));return t=new f(n,this,e)}}t.HttpClientConnection=h;class y extends((0,i.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e,t){super(),this.connection=t,this._super(e),this.cork()}activate(){o.default.http_stream_activate(this.native_handle())}close(){o.default.http_stream_close(this.native_handle())}_on_body(e){this.emit("data",e)}_on_complete(e){if(e)return this.emit("error",new a.CrtError(e)),void this.close();this.on("end",(()=>{this.close()})),this.emit("end")}}t.HttpStream=y;class f extends y{constructor(e,t,n){super(e,t),this.request=n}status_code(){return this.response_status_code}on(e,t){return super.on(e,t),"response"==e&&process.nextTick((()=>{this.uncork()})),this}_on_response(e,n){this.response_status_code=e;let r=new t.HttpHeaders(n);this.emit("response",e,r)}}t.HttpClientStream=f,f.RESPONSE="response",f.DATA="data",f.ERROR="error",f.END="end",f.HEADERS="headers";class g extends i.NativeResource{constructor(e,t,n,r,i,s,c,d){if(null==s||null==s)throw new a.CrtError("HttpClientConnectionManager constructor: socket_options not defined");super(o.default.http_connection_manager_new(null!=e?e.native_handle():null,t,n,r,i,s.native_handle(),c?c.native_handle():void 0,d?d.create_native_handle():void 0,void 0)),this.bootstrap=e,this.host=t,this.port=n,this.max_connections=r,this.initial_window_size=i,this.socket_options=s,this.tls_opts=c,this.proxy_options=d,this.connections=new Map}acquire(){return new Promise(((e,t)=>{o.default.http_connection_manager_acquire(this.native_handle(),((n,r)=>{if(r)return void t(new a.CrtError(r));let o=this.connections.get(n);o||(o=new h(this.bootstrap,this.host,this.port,this.socket_options,this.tls_opts,this.proxy_options,n),this.connections.set(n,o),o.on("close",(()=>{this.connections.delete(n)}))),e(o)}))}))}release(e){if(null==e||null==e)throw new a.CrtError("HttpClientConnectionManager release: connection not defined");o.default.http_connection_manager_release(this.native_handle(),e.native_handle())}close(){o.default.http_connection_manager_close(this.native_handle())}}t.HttpClientConnectionManager=g},3787:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pkcs11Lib=t.TlsConnectionOptions=t.ServerTlsContext=t.ClientTlsContext=t.TlsContext=t.TlsContextOptions=t.SocketOptions=t.ClientBootstrap=t.InputStream=t.is_alpn_available=t.enable_logging=t.LogLevel=t.error_code_to_name=t.error_code_to_string=t.SocketDomain=t.SocketType=t.TlsVersion=void 0;const o=r(n(1221)),i=n(8763),a=n(9712);var s=n(9712);Object.defineProperty(t,"TlsVersion",{enumerable:!0,get:function(){return s.TlsVersion}}),Object.defineProperty(t,"SocketType",{enumerable:!0,get:function(){return s.SocketType}}),Object.defineProperty(t,"SocketDomain",{enumerable:!0,get:function(){return s.SocketDomain}});const c=n(2875);var d;t.error_code_to_string=function(e){return o.default.error_code_to_string(e)},t.error_code_to_name=function(e){return o.default.error_code_to_name(e)},(d=t.LogLevel||(t.LogLevel={}))[d.NONE=0]="NONE",d[d.FATAL=1]="FATAL",d[d.ERROR=2]="ERROR",d[d.WARN=3]="WARN",d[d.INFO=4]="INFO",d[d.DEBUG=5]="DEBUG",d[d.TRACE=6]="TRACE",t.enable_logging=function(e){o.default.io_logging_enable(e)},t.is_alpn_available=function(){return o.default.is_alpn_available()};class l extends i.NativeResource{constructor(e){super(o.default.io_input_stream_new(16384)),this.source=e,this.source.on("data",(e=>{e=Buffer.isBuffer(e)?e:Buffer.from(e.toString()),o.default.io_input_stream_append(this.native_handle(),e)})),this.source.on("end",(()=>{o.default.io_input_stream_append(this.native_handle(),void 0)}))}}t.InputStream=l;class u extends i.NativeResource{constructor(){super(o.default.io_client_bootstrap_new())}}t.ClientBootstrap=u;class p extends i.NativeResource{constructor(e=a.SocketType.STREAM,t=a.SocketDomain.IPV6,n=5e3,r=!1,i=0,s=0,c=0){super(o.default.io_socket_options_new(e,t,n,i,s,c,r))}}t.SocketOptions=p;class m{constructor(){this.min_tls_version=a.TlsVersion.Default,this.alpn_list=[],this.verify_peer=!0}override_default_trust_store_from_path(e,t){this.ca_dirpath=e,this.ca_filepath=t}override_default_trust_store(e){this.certificate_authority=e}static create_client_with_mtls(e,t){let n=new m;return n.certificate=e,n.private_key=t,n.verify_peer=!0,n}static create_client_with_mtls_from_path(e,t){let n=new m;return n.certificate_filepath=e,n.private_key_filepath=t,n.verify_peer=!0,n}static create_client_with_mtls_pkcs12_from_path(e,t){let n=new m;return n.pkcs12_filepath=e,n.pkcs12_password=t,n.verify_peer=!0,n}static create_client_with_mtls_pkcs_from_path(e,t){return this.create_client_with_mtls_pkcs12_from_path(e,t)}static create_client_with_mtls_pkcs11(e){let t=new m;return t.pkcs11_options=e,t.verify_peer=!0,t}static create_client_with_mtls_windows_cert_store_path(e){let t=new m;return t.windows_cert_store_path=e,t.verify_peer=!0,t}static create_server_with_mtls_from_path(e,t){let n=new m;return n.certificate_filepath=e,n.private_key_filepath=t,n.verify_peer=!1,n}static create_server_with_mtls_pkcs_from_path(e,t){let n=new m;return n.pkcs12_filepath=e,n.pkcs12_password=t,n.verify_peer=!1,n}}t.TlsContextOptions=m;class h extends i.NativeResource{constructor(e){if(null==e||null==e)throw new c.CrtError("TlsContext constructor: ctx_opt not defined");super(o.default.io_tls_ctx_new(e.min_tls_version,e.ca_filepath,e.ca_dirpath,e.certificate_authority,e.alpn_list&&e.alpn_list.length>0?e.alpn_list.join(";"):void 0,e.certificate_filepath,e.certificate,e.private_key_filepath,e.private_key,e.pkcs12_filepath,e.pkcs12_password,e.pkcs11_options,e.windows_cert_store_path,e.verify_peer))}}t.TlsContext=h,t.ClientTlsContext=class extends h{constructor(e){e||((e=new m).verify_peer=!0),super(e)}},t.ServerTlsContext=class extends h{constructor(e){e||((e=new m).verify_peer=!1),super(e)}};class y extends i.NativeResource{constructor(e,t,n=[]){if(null==e||null==e)throw new c.CrtError("TlsConnectionOptions constructor: tls_ctx not defined");super(o.default.io_tls_connection_options_new(e.native_handle(),t,n&&n.length>0?n.join(";"):void 0)),this.tls_ctx=e,this.server_name=t,this.alpn_list=n}}t.TlsConnectionOptions=y;class f extends i.NativeResource{constructor(e,t=f.InitializeFinalizeBehavior.DEFAULT){super(o.default.io_pkcs11_lib_new(e,t))}close(){o.default.io_pkcs11_lib_close(this.native_handle())}}t.Pkcs11Lib=f,function(e){let t;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.OMIT=1]="OMIT",e[e.STRICT=2]="STRICT"}(t=e.InitializeFinalizeBehavior||(e.InitializeFinalizeBehavior={}))}(f=t.Pkcs11Lib||(t.Pkcs11Lib={}))},9793:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(8583),t),o(n(1838),t)},799:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MqttClientConnection=t.MqttClient=t.MqttWill=t.QoS=t.HttpProxyOptions=void 0;const c=s(n(1221)),d=n(8763),l=n(9651),u=i(n(4231)),p=n(2875),m=i(n(3787));var h=n(8415);Object.defineProperty(t,"HttpProxyOptions",{enumerable:!0,get:function(){return h.HttpProxyOptions}});const y=n(5641);var f=n(5641);Object.defineProperty(t,"QoS",{enumerable:!0,get:function(){return f.QoS}}),Object.defineProperty(t,"MqttWill",{enumerable:!0,get:function(){return f.MqttWill}});class g extends d.NativeResource{constructor(e=void 0){super(c.default.mqtt_client_new(null!=e?e.native_handle():null)),this.bootstrap=e}new_connection(e){return new w(this,e)}}t.MqttClient=g;class w extends((0,d.NativeResourceMixin)(l.BufferedEventEmitter)){constructor(e,t){if(super(),this.client=e,this.config=t,null==t||null==t)throw new p.CrtError("MqttClientConnection constructor: config not defined");const n=t.will?{topic:t.will.topic,qos:t.will.qos,payload:u.normalize_payload(t.will.payload),retain:t.will.retain}:void 0;var r=y.DEFAULT_RECONNECT_MIN_SEC,o=y.DEFAULT_RECONNECT_MAX_SEC;if(t.reconnect_min_sec&&(r=t.reconnect_min_sec,o=Math.max(r,o)),t.reconnect_max_sec&&(o=t.reconnect_max_sec,r=Math.min(r,o)),null==e||null==e)throw new p.CrtError("MqttClientConnection constructor: client not defined");if(null==t.socket_options||null==t.socket_options)throw new p.CrtError("MqttClientConnection constructor: socket_options in configuration not defined");this._super(c.default.mqtt_client_connection_new(e.native_handle(),(e=>{this._on_connection_interrupted(e)}),((e,t)=>{this._on_connection_resumed(e,t)}),t.tls_ctx?t.tls_ctx.native_handle():null,n,t.username,t.password,t.use_websocket,t.proxy_options?t.proxy_options.create_native_handle():void 0,t.websocket_handshake_transform,r,o)),this.tls_ctx=t.tls_ctx,c.default.mqtt_client_connection_on_message(this.native_handle(),this._on_any_publish.bind(this)),this.on("error",(e=>{}))}close(){c.default.mqtt_client_connection_close(this.native_handle())}on(e,t){return super.on(e,t),"connect"==e&&process.nextTick((()=>{this.uncork()})),this}connect(){return a(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{if(t=this._reject(t),null==this.config.socket_options||null==this.config.socket_options)throw new p.CrtError("MqttClientConnection connect: socket_options in configuration not defined");try{c.default.mqtt_client_connection_connect(this.native_handle(),this.config.client_id,this.config.host_name,this.config.port,this.config.socket_options.native_handle(),this.config.keep_alive,this.config.ping_timeout,this.config.protocol_operation_timeout,this.config.clean_session,this._on_connect_callback.bind(this,e,t))}catch(e){t(e)}}))}))}reconnect(){return a(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{t=this._reject(t);try{c.default.mqtt_client_connection_reconnect(this.native_handle(),this._on_connect_callback.bind(this,e,t))}catch(e){t(e)}}))}))}publish(e,t,n,r=!1){return a(this,void 0,void 0,(function*(){return new Promise(((o,i)=>{i=this._reject(i);try{c.default.mqtt_client_connection_publish(this.native_handle(),e,u.normalize_payload(t),n,r,this._on_puback_callback.bind(this,o,i))}catch(e){i(e)}}))}))}subscribe(e,t,n){return a(this,void 0,void 0,(function*(){return new Promise(((r,o)=>{o=this._reject(o);try{c.default.mqtt_client_connection_subscribe(this.native_handle(),e,t,n,this._on_suback_callback.bind(this,r,o))}catch(e){o(e)}}))}))}unsubscribe(e){return a(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{n=this._reject(n);try{c.default.mqtt_client_connection_unsubscribe(this.native_handle(),e,this._on_unsuback_callback.bind(this,t,n))}catch(e){n(e)}}))}))}disconnect(){return a(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{t=this._reject(t);try{c.default.mqtt_client_connection_disconnect(this.native_handle(),this._on_disconnect_callback.bind(this,e))}catch(e){t(e)}}))}))}getQueueStatistics(){return c.default.mqtt_client_connection_get_queue_statistics(this.native_handle())}_reject(e){return t=>{e(t),process.nextTick((()=>{this.emit("error",new p.CrtError(t))}))}}_on_connection_interrupted(e){this.emit("interrupt",new p.CrtError(e))}_on_connection_resumed(e,t){this.emit("resume",e,t)}_on_any_publish(e,t,n,r,o){this.emit("message",e,t,n,r,o)}_on_connect_callback(e,t,n,r,o){0==n&&0==r?(e(o),this.emit("connect",o)):t(0!=n?"Failed to connect: "+m.error_code_to_string(n):"Server rejected connection.")}_on_puback_callback(e,t,n,r){0==r?e({packet_id:n}):t("Failed to publish: "+m.error_code_to_string(r))}_on_suback_callback(e,t,n,r,o,i){0==i?e({packet_id:n,topic:r,qos:o,error_code:i}):t("Failed to subscribe: "+m.error_code_to_string(i))}_on_unsuback_callback(e,t,n,r){0==r?e({packet_id:n}):t("Failed to unsubscribe: "+m.error_code_to_string(r))}_on_disconnect_callback(e){e(),this.emit("disconnect"),this.close()}}t.MqttClientConnection=w,w.CONNECT="connect",w.DISCONNECT="disconnect",w.ERROR="error",w.INTERRUPT="interrupt",w.RESUME="resume",w.MESSAGE="message"},2385:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Mqtt5Client=t.ClientExtendedValidationAndFlowControl=t.ClientOperationQueueBehavior=t.HttpProxyOptions=void 0;const d=c(n(1221)),l=n(8763),u=n(9651),p=i(n(3787)),m=i(n(4231)),h=n(2875);var y,f,g=n(8415);Object.defineProperty(t,"HttpProxyOptions",{enumerable:!0,get:function(){return g.HttpProxyOptions}}),a(n(5018),t),a(n(202),t),(f=t.ClientOperationQueueBehavior||(t.ClientOperationQueueBehavior={}))[f.Default=0]="Default",f[f.FailNonQos1PublishOnDisconnect=1]="FailNonQos1PublishOnDisconnect",f[f.FailQos0PublishOnDisconnect=2]="FailQos0PublishOnDisconnect",f[f.FailAllOnDisconnect=3]="FailAllOnDisconnect",(y=t.ClientExtendedValidationAndFlowControl||(t.ClientExtendedValidationAndFlowControl={}))[y.None=0]="None",y[y.AwsIotCoreDefaults=1]="AwsIotCoreDefaults";class w extends((0,l.NativeResourceMixin)(u.BufferedEventEmitter)){constructor(e){super(),this._super(d.default.mqtt5_client_new(this,e,(e=>{w._s_on_stopped(e)}),(e=>{w._s_on_attempting_connect(e)}),((e,t,n)=>{w._s_on_connection_success(e,t,n)}),((e,t,n)=>{w._s_on_connection_failure(e,new h.CrtError(t),n)}),((e,t,n)=>{w._s_on_disconnection(e,new h.CrtError(t),n)}),((e,t)=>{w._s_on_message_received(e,t)}),e.clientBootstrap?e.clientBootstrap.native_handle():null,e.socketOptions?e.socketOptions.native_handle():null,e.tlsCtx?e.tlsCtx.native_handle():null,e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null))}close(){d.default.mqtt5_client_close(this.native_handle())}start(){d.default.mqtt5_client_start(this.native_handle())}stop(e){d.default.mqtt5_client_stop(this.native_handle(),e)}subscribe(e){return s(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{try{d.default.mqtt5_client_subscribe(this.native_handle(),e,(function(e,r,o){return w._s_on_suback_callback(t,n,e,r,o)}))}catch(e){n(e)}}))}))}unsubscribe(e){return s(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{try{d.default.mqtt5_client_unsubscribe(this.native_handle(),e,(function(e,r,o){return w._s_on_unsuback_callback(t,n,e,r,o)}))}catch(e){n(e)}}))}))}publish(e){return s(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{e&&e.payload&&(e.payload=m.normalize_payload(e.payload));try{d.default.mqtt5_client_publish(this.native_handle(),e,(function(e,r,o){return w._s_on_puback_callback(t,n,e,r,o)}))}catch(e){n(e)}}))}))}getQueueStatistics(){return d.default.mqtt5_client_get_queue_statistics(this.native_handle())}on(e,t){return super.on(e,t),this}static _s_on_stopped(e){process.nextTick((()=>{e.emit(w.STOPPED,{})}))}static _s_on_attempting_connect(e){process.nextTick((()=>{e.emit(w.ATTEMPTING_CONNECT,{})}))}static _s_on_connection_success(e,t,n){let r={connack:t,settings:n};process.nextTick((()=>{e.emit(w.CONNECTION_SUCCESS,r)}))}static _s_on_connection_failure(e,t,n){let r={error:t};null!=n&&(r.connack=n),process.nextTick((()=>{e.emit(w.CONNECTION_FAILURE,r)}))}static _s_on_disconnection(e,t,n){let r={error:t};null!=n&&(r.disconnect=n),process.nextTick((()=>{e.emit(w.DISCONNECTION,r)}))}static _s_on_suback_callback(e,t,n,r,o){0==r&&void 0!==o?e(o):t(p.error_code_to_string(r))}static _s_on_unsuback_callback(e,t,n,r,o){0==r&&void 0!==o?e(o):t(p.error_code_to_string(r))}static _s_on_puback_callback(e,t,n,r,o){0==r?e(o):t(p.error_code_to_string(r))}static _s_on_message_received(e,t){let n={message:t};process.nextTick((()=>{e.emit(w.MESSAGE_RECEIVED,n)}))}}t.Mqtt5Client=w,w.ERROR="error",w.MESSAGE_RECEIVED="messageReceived",w.ATTEMPTING_CONNECT="attemptingConnect",w.CONNECTION_SUCCESS="connectionSuccess",w.CONNECTION_FAILURE="connectionFailure",w.DISCONNECTION="disconnection",w.STOPPED="stopped"},8763:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NativeResourceMixin=t.NativeResource=void 0,t.NativeResource=class{constructor(e){this.handle=e}native_handle(){return this.handle}},t.NativeResourceMixin=function(e){return class extends e{constructor(...e){const t=e.shift();super(...e),this._handle=t}_super(e){this._handle=e}native_handle(){return this._handle}}}},1309:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=1309,e.exports=t},5371:(e,t,n)=>{n(9738).config(Object.assign({},n(2547),n(2962)(process.argv)))},2962:e=>{const t=/^dotenv_config_(encoding|path|debug|override)=(.+)$/;e.exports=function(e){return e.reduce((function(e,n){const r=n.match(t);return r&&(e[r[1]]=r[2]),e}),{})}},2547:e=>{const t={};null!=process.env.DOTENV_CONFIG_ENCODING&&(t.encoding=process.env.DOTENV_CONFIG_ENCODING),null!=process.env.DOTENV_CONFIG_PATH&&(t.path=process.env.DOTENV_CONFIG_PATH),null!=process.env.DOTENV_CONFIG_DEBUG&&(t.debug=process.env.DOTENV_CONFIG_DEBUG),null!=process.env.DOTENV_CONFIG_OVERRIDE&&(t.override=process.env.DOTENV_CONFIG_OVERRIDE),e.exports=t},9738:(e,t,n)=>{const r=n(7147),o=n(1017),i=n(2037),a=n(9968).version,s=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function c(e){console.log(`[dotenv@${a}][DEBUG] ${e}`)}const d={config:function(e){let t=o.resolve(process.cwd(),".env"),n="utf8";const a=Boolean(e&&e.debug),s=Boolean(e&&e.override);var l;e&&(null!=e.path&&(t="~"===(l=e.path)[0]?o.join(i.homedir(),l.slice(1)):l),null!=e.encoding&&(n=e.encoding));try{const e=d.parse(r.readFileSync(t,{encoding:n}));return Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(process.env,t)?(!0===s&&(process.env[t]=e[t]),a&&c(!0===s?`"${t}" is already defined in \`process.env\` and WAS overwritten`:`"${t}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[t]=e[t]})),{parsed:e}}catch(e){return a&&c(`Failed to load ${t} ${e.message}`),{error:e}}},parse:function(e){const t={};let n,r=e.toString();for(r=r.replace(/\r\n?/gm,"\n");null!=(n=s.exec(r));){const e=n[1];let r=n[2]||"";r=r.trim();const o=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),'"'===o&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[e]=r}return t}};e.exports.config=d.config,e.exports.parse=d.parse,e.exports=d},6932:(e,t,n)=>{const r=n(8501),o=n(8844),i=n(1192);e.exports={XMLParser:o,XMLValidator:r,XMLBuilder:i}},7849:(e,t)=>{const n=":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",r="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+r+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t){const r=Object.keys(t),o=r.length;for(let i=0;i<o;i++)e[r[i]]="strict"===n?[t[r[i]]]:t[r[i]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(e){return!(null==o.exec(e))},t.getAllMatches=function(e,t){const n=[];let r=t.exec(e);for(;r;){const o=[];o.startIndex=t.lastIndex-r[0].length;const i=r.length;for(let e=0;e<i;e++)o.push(r[e]);n.push(o),r=t.exec(e)}return n},t.nameRegexp=r},8501:(e,t,n)=>{const r=n(7849),o={allowBooleanAttributes:!1,unpairedTags:[]};function i(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function a(e,t){const n=t;for(;t<e.length;t++)if("?"!=e[t]&&" "!=e[t]);else{const r=e.substr(n,t-n);if(t>5&&"xml"===r)return h("InvalidXml","XML declaration allowed only at the start of the document.",f(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function s(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},o,t);const n=[];let c=!1,d=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let o=0;o<e.length;o++)if("<"===e[o]&&"?"===e[o+1]){if(o+=2,o=a(e,o),o.err)return o}else{if("<"!==e[o]){if(i(e[o]))continue;return h("InvalidChar","char '"+e[o]+"' is not expected.",f(e,o))}{let y=o;if(o++,"!"===e[o]){o=s(e,o);continue}{let g=!1;"/"===e[o]&&(g=!0,o++);let w="";for(;o<e.length&&">"!==e[o]&&" "!==e[o]&&"\t"!==e[o]&&"\n"!==e[o]&&"\r"!==e[o];o++)w+=e[o];if(w=w.trim(),"/"===w[w.length-1]&&(w=w.substring(0,w.length-1),o--),u=w,!r.isName(u)){let t;return t=0===w.trim().length?"Invalid space after '<'.":"Tag '"+w+"' is an invalid name.",h("InvalidTag",t,f(e,o))}const E=l(e,o);if(!1===E)return h("InvalidAttr","Attributes for '"+w+"' have open quote.",f(e,o));let b=E.value;if(o=E.index,"/"===b[b.length-1]){const n=o-b.length;b=b.substring(0,b.length-1);const r=p(b,t);if(!0!==r)return h(r.err.code,r.err.msg,f(e,n+r.err.line));c=!0}else if(g){if(!E.tagClosed)return h("InvalidTag","Closing tag '"+w+"' doesn't have proper closing.",f(e,o));if(b.trim().length>0)return h("InvalidTag","Closing tag '"+w+"' can't have attributes or invalid starting.",f(e,y));{const t=n.pop();if(w!==t.tagName){let n=f(e,t.tagStartPos);return h("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+w+"'.",f(e,y))}0==n.length&&(d=!0)}}else{const r=p(b,t);if(!0!==r)return h(r.err.code,r.err.msg,f(e,o-b.length+r.err.line));if(!0===d)return h("InvalidXml","Multiple possible root nodes found.",f(e,o));-1!==t.unpairedTags.indexOf(w)||n.push({tagName:w,tagStartPos:y}),c=!0}for(o++;o<e.length;o++)if("<"===e[o]){if("!"===e[o+1]){o++,o=s(e,o);continue}if("?"!==e[o+1])break;if(o=a(e,++o),o.err)return o}else if("&"===e[o]){const t=m(e,o);if(-1==t)return h("InvalidChar","char '&' is not expected.",f(e,o));o=t}else if(!0===d&&!i(e[o]))return h("InvalidXml","Extra text at the end",f(e,o));"<"===e[o]&&o--}}}var u;return c?1==n.length?h("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",f(e,n[0].tagStartPos)):!(n.length>0)||h("InvalidXml","Invalid '"+JSON.stringify(n.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):h("InvalidXml","Start tag expected.",1)};const c='"',d="'";function l(e,t){let n="",r="",o=!1;for(;t<e.length;t++){if(e[t]===c||e[t]===d)""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){o=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:o}}const u=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function p(e,t){const n=r.getAllMatches(e,u),o={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return h("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",g(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return h("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",g(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return h("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",g(n[e]));const r=n[e][2];if(!y(r))return h("InvalidAttr","Attribute '"+r+"' is an invalid name.",g(n[e]));if(o.hasOwnProperty(r))return h("InvalidAttr","Attribute '"+r+"' is repeated.",g(n[e]));o[r]=1}return!0}function m(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function h(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function y(e){return r.isName(e)}function f(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function g(e){return e.startIndex+e[1].length}},1192:(e,t,n)=>{const r=n(2592),o={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[]};function i(e){this.options=Object.assign({},o,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=c),this.processTextOrObjNode=a,this.options.format?(this.indentate=s,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(e,t,n){const r=this.j2x(e,n+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,r.attrStr,n):this.buildObjectNode(r.val,t,r.attrStr,n)}function s(e){return this.options.indentBy.repeat(e)}function c(e){return!!e.startsWith(this.options.attributeNamePrefix)&&e.substr(this.attrPrefixLen)}i.prototype.build=function(e){return this.options.preserveOrder?r(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)},i.prototype.j2x=function(e,t){let n="",r="";for(let o in e)if(void 0===e[o]);else if(null===e[o])"?"===o[0]?r+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(e[o]instanceof Date)r+=this.buildTextValNode(e[o],o,"",t);else if("object"!=typeof e[o]){const i=this.isAttribute(o);if(i)n+=this.buildAttrPairStr(i,""+e[o]);else if(o===this.options.textNodeName){let t=this.options.tagValueProcessor(o,""+e[o]);r+=this.replaceEntitiesValue(t)}else r+=this.buildTextValNode(e[o],o,"",t)}else if(Array.isArray(e[o])){const n=e[o].length;for(let i=0;i<n;i++){const n=e[o][i];void 0===n||(null===n?"?"===o[0]?r+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+o+"/"+this.tagEndChar:r+="object"==typeof n?this.processTextOrObjNode(n,o,t):this.buildTextValNode(n,o,"",t))}}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const t=Object.keys(e[o]),r=t.length;for(let i=0;i<r;i++)n+=this.buildAttrPairStr(t[i],""+e[o][t[i]])}else r+=this.processTextOrObjNode(e[o],o,t);return{attrStr:n,val:r}},i.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},i.prototype.buildObjectNode=function(e,t,n,r){if(""===e)return"?"===t[0]?this.indentate(r)+"<"+t+n+"?"+this.tagEndChar:this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let o="</"+t+this.tagEndChar,i="";return"?"===t[0]&&(i="?",o=""),n&&-1===e.indexOf("<")?this.indentate(r)+"<"+t+n+i+">"+e+o:!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===i.length?this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(r)+"<"+t+n+i+this.tagEndChar+e+this.indentate(r)+o}},i.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},i.prototype.buildTextValNode=function(e,t,n,r){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(r)+"<"+t+n+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(t,e);return o=this.replaceEntitiesValue(o),""===o?this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+n+">"+o+"</"+t+this.tagEndChar}},i.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e},e.exports=i},2592:e=>{function t(e,a,s,c){let d="",l=!1;for(let u=0;u<e.length;u++){const p=e[u],m=n(p);let h="";if(h=0===s.length?m:`${s}.${m}`,m===a.textNodeName){let e=p[m];o(h,a)||(e=a.tagValueProcessor(m,e),e=i(e,a)),l&&(d+=c),d+=e,l=!1;continue}if(m===a.cdataPropName){l&&(d+=c),d+=`<![CDATA[${p[m][0][a.textNodeName]}]]>`,l=!1;continue}if(m===a.commentPropName){d+=c+`\x3c!--${p[m][0][a.textNodeName]}--\x3e`,l=!0;continue}if("?"===m[0]){const e=r(p[":@"],a),t="?xml"===m?"":c;let n=p[m][0][a.textNodeName];n=0!==n.length?" "+n:"",d+=t+`<${m}${n}${e}?>`,l=!0;continue}let y=c;""!==y&&(y+=a.indentBy);const f=c+`<${m}${r(p[":@"],a)}`,g=t(p[m],a,h,y);-1!==a.unpairedTags.indexOf(m)?a.suppressUnpairedNode?d+=f+">":d+=f+"/>":g&&0!==g.length||!a.suppressEmptyNode?g&&g.endsWith(">")?d+=f+`>${g}${c}</${m}>`:(d+=f+">",g&&""!==c&&(g.includes("/>")||g.includes("</"))?d+=c+a.indentBy+g+c:d+=g,d+=`</${m}>`):d+=f+"/>",l=!0}return d}function n(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function r(e,t){let n="";if(e&&!t.ignoreAttributes)for(let r in e){let o=t.attributeValueProcessor(r,e[r]);o=i(o,t),!0===o&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${o}"`}return n}function o(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let r in t.stopNodes)if(t.stopNodes[r]===e||t.stopNodes[r]==="*."+n)return!0;return!1}function i(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const r=t.entities[n];e=e.replace(r.regex,r.val)}return e}e.exports=function(e,n){let r="";return n.format&&n.indentBy.length>0&&(r="\n"),t(e,n,"",r)}},4780:e=>{const t=RegExp("^\\s([a-zA-z0-0]+)[ \t](['\"])([^&]+)\\2");function n(e,n){const r=t.exec(e);r&&(n[r[1]]={regx:RegExp(`&${r[1]};`,"g"),val:r[3]})}e.exports=function(e,t){const r={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let o=1,i=!1,a=!1,s=!1,c="";for(;t<e.length;t++)if("<"!==e[t]||s)if(">"===e[t]){if(s?"-"===e[t-1]&&"-"===e[t-2]&&(s=!1,o--):(a&&(n(c,r),a=!1),o--),0===o)break}else"["===e[t]?i=!0:c+=e[t];else{if(i&&"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7])t+=7,a=!0;else if(i&&"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8])t+=8;else if(i&&"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8])t+=8;else if(i&&"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9])t+=9;else{if("!"!==e[t+1]||"-"!==e[t+2]||"-"!==e[t+3])throw new Error("Invalid DOCTYPE");s=!0}o++,c=""}if(0!==o)throw new Error("Unclosed DOCTYPE")}return{entities:r,i:t}}},6745:(e,t)=>{const n={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(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1};t.buildOptions=function(e){return Object.assign({},n,e)},t.defaultOptions=n},1078:(e,t,n)=>{const r=n(7849),o=n(6311),i=n(4780),a=n(4153);function s(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:e[r]}}}function c(e,t,n,r,o,i,a){if(void 0!==e&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){a||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,o,i);return null==r?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?E(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function d(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,r.nameRegexp);const l=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function u(e,t){if(!this.options.ignoreAttributes&&"string"==typeof e){const n=r.getAllMatches(e,l),o=n.length,i={};for(let e=0;e<o;e++){const r=this.resolveNameSpace(n[e][1]);let o=n[e][4],a=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(a=this.options.transformAttributeName(a)),"__proto__"===a&&(a="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);const e=this.options.attributeValueProcessor(r,o,t);i[a]=null==e?o:typeof e!=typeof o||e!==o?e:E(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[a]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=i,e}return i}}const p=function(e){e=e.replace(/\r\n?/g,"\n");const t=new o("!xml");let n=t,r="",a="";for(let s=0;s<e.length;s++)if("<"===e[s])if("/"===e[s+1]){const t=f(e,">",s,"Closing Tag is not closed.");let o=e.substring(s+2,t).trim();if(this.options.removeNSPrefix){const e=o.indexOf(":");-1!==e&&(o=o.substr(e+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(r=this.saveTextToParentTag(r,n,a)),a=a.substr(0,a.lastIndexOf(".")),n=this.tagsNodeStack.pop(),r="",s=t}else if("?"===e[s+1]){let t=g(e,s,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,a),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new o(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,a)),n.addChild(e)}s=t.closeIndex+1}else if("!--"===e.substr(s+1,3)){const t=f(e,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const o=e.substring(s+4,t-2);r=this.saveTextToParentTag(r,n,a),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}s=t}else if("!D"===e.substr(s+1,2)){const t=i(e,s);this.docTypeEntities=t.entities,s=t.i}else if("!["===e.substr(s+1,2)){const t=f(e,"]]>",s,"CDATA is not closed.")-2,o=e.substring(s+9,t);if(r=this.saveTextToParentTag(r,n,a),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let e=this.parseTextData(o,n.tagname,a,!0,!1,!0);null==e&&(e=""),n.add(this.options.textNodeName,e)}s=t+2}else{let i=g(e,s,this.options.removeNSPrefix),c=i.tagName,d=i.tagExp,l=i.attrExpPresent,u=i.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,a,!1)),c!==t.tagname&&(a+=a?"."+c:c);const p=n;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop()),this.isItStopNode(this.options.stopNodes,a,c)){let t="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)s=i.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(c))s=i.closeIndex;else{const n=this.readStopNodeData(e,c,u+1);if(!n)throw new Error(`Unexpected end of ${c}`);s=n.i,t=n.tagContent}const r=new o(c);c!==d&&l&&(r[":@"]=this.buildAttributesMap(d,a)),t&&(t=this.parseTextData(t,c,a,!0,l,!0,!0)),a=a.substr(0,a.lastIndexOf(".")),r.add(this.options.textNodeName,t),n.addChild(r)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){"/"===c[c.length-1]?(c=c.substr(0,c.length-1),d=c):d=d.substr(0,d.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const e=new o(c);c!==d&&l&&(e[":@"]=this.buildAttributesMap(d,a)),a=a.substr(0,a.lastIndexOf(".")),n.addChild(e)}else{const e=new o(c);this.tagsNodeStack.push(n),c!==d&&l&&(e[":@"]=this.buildAttributesMap(d,a)),n.addChild(e),n=e}r="",s=u}}else r+=e[s];return t.child},m=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function h(e,t,n,r){return e&&(void 0===r&&(r=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function y(e,t,n){const r="*."+n;for(const n in e){const o=e[n];if(r===o||t===o)return!0}return!1}function f(e,t,n,r){const o=e.indexOf(t,n);if(-1===o)throw new Error(r);return o+t.length-1}function g(e,t,n,r=">"){const o=function(e,t,n=">"){let r,o="";for(let i=t;i<e.length;i++){let t=e[i];if(r)t===r&&(r="");else if('"'===t||"'"===t)r=t;else if(t===n[0]){if(!n[1])return{data:o,index:i};if(e[i+1]===n[1])return{data:o,index:i}}else"\t"===t&&(t=" ");o+=t}}(e,t+1,r);if(!o)return;let i=o.data;const a=o.index,s=i.search(/\s/);let c=i,d=!0;if(-1!==s&&(c=i.substr(0,s).replace(/\s\s*$/,""),i=i.substr(s+1)),n){const e=c.indexOf(":");-1!==e&&(c=c.substr(e+1),d=c!==o.data.substr(e+1))}return{tagName:c,tagExp:i,closeIndex:a,attrExpPresent:d}}function w(e,t,n){const r=n;let o=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const i=f(e,">",n,`${t} is not closed`);if(e.substring(n+2,i).trim()===t&&(o--,0===o))return{tagContent:e.substring(r,n),i};n=i}else if("?"===e[n+1])n=f(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=f(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=f(e,"]]>",n,"StopNode is not closed.")-2;else{const r=g(e,n,">");r&&((r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&o++,n=r.closeIndex)}}function E(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&a(e,n)}return r.isExist(e)?e:""}e.exports=class{constructor(e){this.options=e,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:"₹"}},this.addExternalEntities=s,this.parseXml=p,this.parseTextData=c,this.resolveNameSpace=d,this.buildAttributesMap=u,this.isItStopNode=y,this.replaceEntitiesValue=m,this.readStopNodeData=w,this.saveTextToParentTag=h}}},8844:(e,t,n)=>{const{buildOptions:r}=n(6745),o=n(1078),{prettify:i}=n(6997),a=n(8501);e.exports=class{constructor(e){this.externalEntities={},this.options=r(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=a.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new o(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:i(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}},6997:(e,t)=>{function n(e,t,a){let s;const c={};for(let d=0;d<e.length;d++){const l=e[d],u=r(l);let p="";if(p=void 0===a?u:a+"."+u,u===t.textNodeName)void 0===s?s=l[u]:s+=""+l[u];else{if(void 0===u)continue;if(l[u]){let e=n(l[u],t,p);const r=i(e,t);l[":@"]?o(e,l[":@"],p,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==c[u]&&c.hasOwnProperty(u)?(Array.isArray(c[u])||(c[u]=[c[u]]),c[u].push(e)):t.isArray(u,p,r)?c[u]=[e]:c[u]=e}}}return"string"==typeof s?s.length>0&&(c[t.textNodeName]=s):void 0!==s&&(c[t.textNodeName]=s),c}function r(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function o(e,t,n,r){if(t){const o=Object.keys(t),i=o.length;for(let a=0;a<i;a++){const i=o[a];r.isArray(i,n+"."+i,!0,!0)?e[i]=[t[i]]:e[i]=t[i]}}}function i(e,t){const n=Object.keys(e).length;return!!(0===n||1===n&&e[t.textNodeName])}t.prettify=function(e,t){return n(e,t)}},6311:e=>{e.exports=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}},6675:(e,t,n)=>{var r=n(4993),o=n(113),i=n(3801),a=n(650);function s(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,"number"!=typeof this.capacity||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");var r=i.getPointerArray(n);this.forward=new r(n),this.backward=new r(n),this.K="function"==typeof e?new e(n):new Array(n),this.V="function"==typeof t?new t(n):new Array(n),this.size=0,this.head=0,this.tail=0,this.items={}}s.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},s.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var n=this.backward[e],r=this.forward[e];return this.tail===e?this.tail=n:this.backward[r]=n,this.forward[n]=r,this.backward[t]=e,this.head=e,this.forward[e]=t,this},s.prototype.set=function(e,t){var n=this.items[e];if(void 0!==n)return this.splayOnTop(n),void(this.V[n]=t);this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],delete this.items[this.K[n]]),this.items[e]=n,this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n},s.prototype.setpop=function(e,t){var n=null,r=null,o=this.items[e];return void 0!==o?(this.splayOnTop(o),n=this.V[o],this.V[o]=t,{evicted:!1,key:e,value:n}):(this.size<this.capacity?o=this.size++:(o=this.tail,this.tail=this.backward[o],n=this.V[o],r=this.K[o],delete this.items[this.K[o]]),this.items[e]=o,this.K[o]=e,this.V[o]=t,this.forward[o]=this.head,this.backward[this.head]=o,this.head=o,r?{evicted:!0,key:r,value:n}:null)},s.prototype.has=function(e){return e in this.items},s.prototype.get=function(e){var t=this.items[e];if(void 0!==t)return this.splayOnTop(t),this.V[t]},s.prototype.peek=function(e){var t=this.items[e];if(void 0!==t)return this.V[t]},s.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=0,r=this.size,o=this.head,i=this.K,a=this.V,s=this.forward;n<r;)e.call(t,a[o],i[o],this),o=s[o],n++},s.prototype.keys=function(){var e=0,t=this.size,n=this.head,o=this.K,i=this.forward;return new r((function(){if(e>=t)return{done:!0};var r=o[n];return++e<t&&(n=i[n]),{done:!1,value:r}}))},s.prototype.values=function(){var e=0,t=this.size,n=this.head,o=this.V,i=this.forward;return new r((function(){if(e>=t)return{done:!0};var r=o[n];return++e<t&&(n=i[n]),{done:!1,value:r}}))},s.prototype.entries=function(){var e=0,t=this.size,n=this.head,o=this.K,i=this.V,a=this.forward;return new r((function(){if(e>=t)return{done:!0};var r=o[n],s=i[n];return++e<t&&(n=a[n]),{done:!1,value:[r,s]}}))},"undefined"!=typeof Symbol&&(s.prototype[Symbol.iterator]=s.prototype.entries),s.prototype.inspect=function(){for(var e,t=new Map,n=this.entries();!(e=n.next()).done;)t.set(e.value[0],e.value[1]);return Object.defineProperty(t,"constructor",{value:s,enumerable:!1}),t},"undefined"!=typeof Symbol&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.from=function(e,t,n,r){if(arguments.length<2){if("number"!=typeof(r=a.guessLength(e)))throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else 2===arguments.length&&(r=t,t=null,n=null);var i=new s(t,n,r);return o(e,(function(e,t){i.set(t,e)})),i},e.exports=s},650:(e,t,n)=>{var r=n(113),o=n(3801);function i(e){return"number"==typeof e.length?e.length:"number"==typeof e.size?e.size:void 0}t.isArrayLike=function(e){return Array.isArray(e)||o.isTypedArray(e)},t.guessLength=i,t.toArray=function(e){var t=i(e),n="number"==typeof t?new Array(t):[],o=0;return r(e,(function(e){n[o++]=e})),n},t.toArrayWithIndices=function(e){var t=i(e),n="number"==typeof t?o.getPointerArray(t):Array,a="number"==typeof t?new Array(t):[],s="number"==typeof t?new n(t):[],c=0;return r(e,(function(e){a[c]=e,s[c]=c++})),[a,s]}},3801:(e,t)=>{var n=Math.pow(2,8)-1,r=Math.pow(2,16)-1,o=Math.pow(2,32)-1,i=Math.pow(2,7)-1,a=Math.pow(2,15)-1,s=Math.pow(2,31)-1;t.getPointerArray=function(e){var t=e-1;return t<=n?Uint8Array:t<=r?Uint16Array:t<=o?Uint32Array:Float64Array},t.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=s?Int32Array:Float64Array},t.getNumberType=function(e){return e===(0|e)?-1===Math.sign(e)?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var c={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(e,n){var r,o,i,a,s,d=null,l=0;for(a=0,s=e.length;a<s;a++)i=n?n(e[a]):e[a],o=t.getNumberType(i),(r=c[o.name])>l&&(l=r,d=o);return d},t.isTypedArray=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)},t.concat=function(){var e,t,n,r=0;for(e=0,n=arguments.length;e<n;e++)r+=arguments[e].length;var o=new arguments[0].constructor(r);for(e=0,t=0;e<n;e++)o.set(arguments[e],t),t+=arguments[e].length;return o},t.indices=function(e){for(var n=new(t.getPointerArray(e))(e),r=0;r<e;r++)n[r]=r;return n}},113:e=>{var t="undefined"!=typeof ArrayBuffer,n="undefined"!=typeof Symbol;function r(e,r){var o,i,a,s,c;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof r)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(a=0,s=e.length;a<s;a++)r(e[a],a);else if("function"!=typeof e.forEach)if(n&&Symbol.iterator in e&&"function"!=typeof e.next&&(e=e[Symbol.iterator]()),"function"!=typeof e.next)for(i in e)e.hasOwnProperty(i)&&r(e[i],i);else for(o=e,a=0;!0!==(c=o.next()).done;)r(c.value,a),a++;else e.forEach(r)}r.forEachWithNullKeys=function(e,r){var o,i,a,s,c;if(!e)throw new Error("obliterator/forEachWithNullKeys: invalid iterable.");if("function"!=typeof r)throw new Error("obliterator/forEachWithNullKeys: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(a=0,s=e.length;a<s;a++)r(e[a],null);else if(e instanceof Set)e.forEach((function(e){r(e,null)}));else if("function"!=typeof e.forEach)if(n&&Symbol.iterator in e&&"function"!=typeof e.next&&(e=e[Symbol.iterator]()),"function"!=typeof e.next)for(i in e)e.hasOwnProperty(i)&&r(e[i],i);else for(o=e,a=0;!0!==(c=o.next()).done;)r(c.value,null),a++;else e.forEach(r)},e.exports=r},4993:e=>{function t(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}t.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(t.prototype[Symbol.iterator]=function(){return this}),t.of=function(){var e=arguments,n=e.length,r=0;return new t((function(){return r>=n?{done:!0}:{done:!1,value:e[r++]}}))},t.empty=function(){var e=new t(null);return e.done=!0,e},t.is=function(e){return e instanceof t||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=t},4153:e=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(e,o={}){if(o=Object.assign({},r,o),!e||"string"!=typeof e)return e;let i=e.trim();if(void 0!==o.skipLike&&o.skipLike.test(i))return e;if(o.hex&&t.test(i))return Number.parseInt(i,16);{const t=n.exec(i);if(t){const n=t[1],r=t[2];let s=(a=t[3])&&-1!==a.indexOf(".")?("."===(a=a.replace(/0+$/,""))?a="0":"."===a[0]?a="0"+a:"."===a[a.length-1]&&(a=a.substr(0,a.length-1)),a):a;const c=t[4]||t[6];if(!o.leadingZeros&&r.length>0&&n&&"."!==i[2])return e;if(!o.leadingZeros&&r.length>0&&!n&&"."!==i[1])return e;{const t=Number(i),a=""+t;return-1!==a.search(/[eE]/)||c?o.eNotation?t:e:-1!==i.indexOf(".")?"0"===a&&""===s||a===s||n&&a==="-"+s?t:e:r?s===a||n+s===a?t:e:i===a||i===n+a?t:e}}return e}var a}},3607:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(9031),t),o(n(9615),t),o(n(6278),t)},9615:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableName=t.client=void 0;const r=n(2311);n(5371),t.client=new r.DynamoDBClient({region:process.env.AWS_REGION||"eu-central-1"}),t.TableName=process.env.DYNAMODB_TABLE},6278:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getAttributesFromExpression=t.getAttributeNames=t.getAttributeValues=t.splitEvery=t.stripKey=void 0;const r=n(5074);t.stripKey=function(e){return(0,r.marshall)({PK:e.PK,SK:e.SK})},t.splitEvery=function(e,t=25){const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n},t.getAttributeValues=function(e,t){return(0,r.marshall)((t||Object.keys(e)).reduce(((t,n)=>(t[`:${n}`]=e[n],t)),{}))},t.getAttributeNames=function(e,t){return(t||Object.keys(e)).reduce(((e,t)=>(e[`#${t}`]=t,e)),{})},t.getAttributesFromExpression=function(e,t="#"){return e.match(new RegExp(`${t}\\w+`,"g"))?.map((e=>e.slice(1)))||[]}},3581:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteItems=t.deleteItem=void 0;const r=n(2311),o=n(9615),i=n(6278);t.deleteItem=async function(e,t={}){return o.client.send(new r.DeleteItemCommand({TableName:o.TableName,Key:(0,i.stripKey)(e),...t}))},t.deleteItems=async function e(t,n={},a=0){return new Promise((async(s,c)=>{const d=(0,i.splitEvery)(t);if(!(a>3)){for(const t of d)await o.client.send(new r.BatchWriteItemCommand({RequestItems:{[o.TableName]:t.map((e=>({DeleteRequest:{Key:(0,i.stripKey)(e)}})))},...n})).then((t=>{if(t?.UnprocessedItems?.[o.TableName]?.length)return a+1>3?c(t):e(t.UnprocessedItems[o.TableName],n,a+1)})).catch(c);s()}}))}},5362:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getAllItems=t.getItems=t.getItem=void 0;const r=n(2311),o=n(5074),i=n(9615),a=n(6278);t.getItem=async function(e,t={}){return i.client.send(new r.GetItemCommand({TableName:i.TableName,Key:(0,a.stripKey)(e),...t})).then((e=>e?.Item&&(0,o.unmarshall)(e.Item)))},t.getItems=async function e(t,n={},s=0){if(s>3)return[];const c=Object.values(t.reduce(((e,t)=>{const n=`${t.PK}#${t.SK}`;return e[n]||(e[n]=t),e}),{})),d=(0,a.splitEvery)(c,100),l=[];if(s>2)return l;await Promise.all(d.map((async t=>{await i.client.send(new r.BatchGetItemCommand({RequestItems:{[i.TableName]:{Keys:t.map(a.stripKey),...n}}})).then((t=>{const r=t?.UnprocessedKeys?.[i.TableName],a=t?.Responses?.[i.TableName]||[];return r?e(r.Keys,n,s+1).then((e=>a.concat(e))):a.map((e=>e&&(0,o.unmarshall)(e)))})).then((e=>l.push(...e)))})));const u=l.reduce(((e,t)=>(e[`${t?.PK}#${t?.SK}`]=t,e)),{});return t.map((e=>u[`${e.PK}#${e.SK}`]||void 0))},t.getAllItems=async function(e={}){return i.client.send(new r.ScanCommand({TableName:i.TableName,...e})).then((e=>e.Items.map((e=>e&&(0,o.unmarshall)(e)))))}},9031:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(3581),t),o(n(5362),t),o(n(3391),t),o(n(1853),t),o(n(5585),t),o(n(5666),t)},3391:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getNewId=t.itemExists=void 0;const r=n(5362),o=n(5585);t.itemExists=async function(e,t={}){return null!=await(0,r.getItem)(e,t)},t.getNewId=async function({PK:e,SK:t,length:n=8}){if(!e)throw new Error("Cannot generate new ID: PK");let r="0";if(t){const n=t+(t.endsWith("/")?"":"/"),i=(await(0,o.queryItems)("#PK = :PK and begins_with(#SK, :SK)",{PK:e,SK:n},{Limit:1,ScanIndexForward:!1}))?.[0],a=i?.SK?.split("/")||[];r=a?.[n.split("/").length-1]||"0"}else{const t=(await(0,o.queryItems)("#PK = :PK",{PK:e},{Limit:1,ScanIndexForward:!1}))?.[0],n=t?.SK?.split("/")||[];r=n?.[n.length-1]||"0"}const i=(parseInt(r)+1+"").padStart(n||0,"0");return t?`${t}${t.endsWith("/")?"":"/"}${i}`:i}},1853:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.putItems=t.putItem=void 0;const r=n(2311),o=n(5074),i=n(9615),a=n(6278);t.putItem=async function(e,t={}){return Object.keys(e).includes("createdAt")||(e.createdAt=Date.now()),i.client.send(new r.PutItemCommand({TableName:i.TableName,Item:(0,o.marshall)(e),...t}))},t.putItems=async function(e,t={}){return new Promise((async(n,s)=>{const c=(0,a.splitEvery)(e);for(const e of c){const n=Date.now();e.forEach((e=>{Object.keys(e).includes("createdAt")||(e.createdAt=n)})),await i.client.send(new r.BatchWriteItemCommand({RequestItems:{[i.TableName]:e.map((e=>({PutRequest:{Item:(0,o.marshall)(e)}})))},...t})).catch(s)}n()}))}},5585:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.queryAllItems=t.queryItems=t.query=void 0;const r=n(2311),o=n(5074),i=n(9615),a=n(6278);async function s(e,t,n={}){return i.client.send(new r.QueryCommand({TableName:i.TableName,KeyConditionExpression:e,ExpressionAttributeValues:(0,a.getAttributeValues)(t),ExpressionAttributeNames:(0,a.getAttributeNames)(t,[...(0,a.getAttributesFromExpression)(e),...(0,a.getAttributesFromExpression)(n?.FilterExpression||"")]),...n}))}t.query=s,t.queryItems=async function(e,t,n={}){const r=e&&n?.AttributesToGet;return r&&delete n.AttributesToGet,s(e,t,n).then((e=>{const t=(e?.Items||[]).map((e=>e&&(0,o.unmarshall)(e)));return r?t.map((e=>r.reduce(((t,n)=>({...t,[n]:e[n]})),{}))):t}))},t.queryAllItems=async function(e,t,n={}){const r=e&&n?.AttributesToGet;r&&delete n.AttributesToGet;let i=await s(e,t,n);for(;i.LastEvaluatedKey;)if(i.LastEvaluatedKey){let r=await s(e,t,{...n,ExclusiveStartKey:i.LastEvaluatedKey});r?.Items&&i?.Items&&i.Items.push(...r.Items),i&&(i.LastEvaluatedKey=r.LastEvaluatedKey)}const a=(i?.Items||[]).map((e=>e&&(0,o.unmarshall)(e)));return r?a.map((e=>r.reduce(((t,n)=>({...t,[n]:e[n]})),{}))):a}},5666:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeAttributes=t.updateItem=void 0;const r=n(2311),o=n(9615),i=n(6278);t.updateItem=async function(e,t,n={}){Object.keys(t).includes("updatedAt")||(t.updatedAt=Date.now());const a="SET "+Object.keys(t).map((e=>`#${e} = :${e}`)).join(", ");return o.client.send(new r.UpdateItemCommand({TableName:o.TableName,Key:(0,i.stripKey)(e),UpdateExpression:a,ExpressionAttributeValues:(0,i.getAttributeValues)(t),ExpressionAttributeNames:(0,i.getAttributeNames)(t),...n}))},t.removeAttributes=async function(e,t){const n="REMOVE "+t.map((e=>`#${e}`)).join(", ");return o.client.send(new r.UpdateItemCommand({TableName:o.TableName,Key:(0,i.stripKey)(e),UpdateExpression:n,ExpressionAttributeNames:(0,i.getAttributeNames)(t.reduce(((e,t)=>(e[t]=t,e)),{}))}))}},2361:t=>{t.exports=e(import.meta.url)("events")},7147:t=>{t.exports=e(import.meta.url)("fs")},2037:t=>{t.exports=e(import.meta.url)("os")},1017:t=>{t.exports=e(import.meta.url)("path")},7282:t=>{t.exports=e(import.meta.url)("process")},5062:e=>{e.exports=JSON.parse('{"name":"aws-crt","version":"1.15.16","description":"NodeJS/browser bindings to the aws-c-* libraries","homepage":"https://github.com/awslabs/aws-crt-nodejs","repository":{"type":"git","url":"git+https://github.com/awslabs/aws-crt-nodejs.git"},"contributors":["AWS Common Runtime Team <aws-sdk-common-runtime@amazon.com>"],"license":"Apache-2.0","main":"./dist/index.js","browser":"./dist.browser/browser.js","types":"./dist/index.d.ts","scripts":{"tsc":"node ./scripts/tsc.js","test":"npm run test:native","test:node":"npm run test:native","test:native":"npx jest --runInBand --verbose --config test/native/jest.config.js --forceExit","test:browser":"npx jest --runInBand --verbose --config test/browser/jest.config.js --forceExit","test:browser:ci":"npm run install:puppeteer && npm run test:browser","install:puppeteer":"npm install --save-dev jest-puppeteer puppeteer @types/puppeteer","prepare":"node ./scripts/tsc.js && node ./scripts/install.js","install":"node ./scripts/install.js"},"devDependencies":{"@types/crypto-js":"^3.1.43","@types/jest":"^27.0.1","@types/node":"^10.17.54","@types/prettier":"2.6.0","@types/puppeteer":"^5.4.7","@types/uuid":"^3.4.8","@types/ws":"^7.4.7","aws-sdk":"^2.848.0","cmake-js":"^6.3.2","https-proxy-agent":"^5.0.1","jest":"^27.2.1","jest-puppeteer":"^5.0.4","jest-runtime":"^27.2.1","puppeteer":"^3.3.0","tar":"^6.1.11","ts-jest":"^27.0.5","typedoc":"^0.22.18","typedoc-plugin-merge-modules":"^3.1.0","typescript":"^4.7.4","uuid":"^8.3.2","yargs":"^17.2.1"},"dependencies":{"@aws-sdk/util-utf8-browser":"^3.109.0","@httptoolkit/websocket-stream":"^6.0.0","axios":"^0.24.0","buffer":"^6.0.3","cmake-js":"^6.3.2","crypto-js":"^4.0.0","mqtt":"^4.3.7","process":"^0.11.10","tar":"^6.1.11"}}')},9968:e=>{e.exports=JSON.parse('{"name":"dotenv","version":"16.0.3","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"require":"./lib/main.js","types":"./lib/main.d.ts","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^17.0.9","decache":"^4.6.1","dtslint":"^3.7.0","sinon":"^12.0.1","standard":"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2","tap":"^15.1.6","tar":"^6.1.11","typescript":"^4.5.4"},"engines":{"node":">=12"}}')}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(3607);
|
|
1
|
+
import{createRequire as e}from"module";var t={2311:(t,n,r)=>{r.r(n),r.d(n,{$Command:()=>xn,AttributeAction:()=>Ir,AttributeValue:()=>Bo,BackupInUseException:()=>Lr,BackupNotFoundException:()=>Fr,BackupStatus:()=>Cr,BackupType:()=>Tr,BackupTypeFilter:()=>zr,BatchExecuteStatementCommand:()=>Ap,BatchGetItemCommand:()=>kp,BatchStatementErrorCodeEnum:()=>Ur,BatchWriteItemCommand:()=>Dp,BillingMode:()=>Pr,ComparisonOperator:()=>Kr,ConditionalCheckFailedException:()=>Wr,ConditionalOperator:()=>Jr,ContinuousBackupsStatus:()=>Xr,ContinuousBackupsUnavailableException:()=>Zr,ContributorInsightsAction:()=>eo,ContributorInsightsStatus:()=>to,CreateBackupCommand:()=>Rp,CreateGlobalTableCommand:()=>Op,CreateTableCommand:()=>Lp,DeleteBackupCommand:()=>Fp,DeleteItemCommand:()=>zp,DeleteTableCommand:()=>Bp,DescribeBackupCommand:()=>Up,DescribeContinuousBackupsCommand:()=>$p,DescribeContributorInsightsCommand:()=>Mp,DescribeEndpointsCommand:()=>Ha,DescribeExportCommand:()=>jp,DescribeGlobalTableCommand:()=>qp,DescribeGlobalTableSettingsCommand:()=>Vp,DescribeImportCommand:()=>Gp,DescribeKinesisStreamingDestinationCommand:()=>Hp,DescribeLimitsCommand:()=>Kp,DescribeTableCommand:()=>Wp,DescribeTableReplicaAutoScalingCommand:()=>Jp,DescribeTimeToLiveCommand:()=>Qp,DestinationStatus:()=>Io,DisableKinesisStreamingDestinationCommand:()=>Xp,DuplicateItemException:()=>xo,DynamoDB:()=>Nm,DynamoDBClient:()=>Np,DynamoDBServiceException:()=>_r,EnableKinesisStreamingDestinationCommand:()=>Yp,ExecuteStatementCommand:()=>Zp,ExecuteTransactionCommand:()=>em,ExportConflictException:()=>Po,ExportFormat:()=>yo,ExportNotFoundException:()=>wo,ExportStatus:()=>fo,ExportTableToPointInTimeCommand:()=>tm,GetItemCommand:()=>nm,GlobalTableAlreadyExistsException:()=>co,GlobalTableNotFoundException:()=>Eo,GlobalTableStatus:()=>io,IdempotentParameterMismatchException:()=>Co,ImportConflictException:()=>ko,ImportNotFoundException:()=>_o,ImportStatus:()=>bo,ImportTableCommand:()=>rm,IndexNotFoundException:()=>zo,IndexStatus:()=>lo,InputCompressionType:()=>vo,InputFormat:()=>So,InternalServerError:()=>$r,InvalidEndpointException:()=>jr,InvalidExportTimeException:()=>No,InvalidRestoreTimeException:()=>Oo,ItemCollectionSizeLimitExceededException:()=>Hr,KeyType:()=>Nr,LimitExceededException:()=>no,ListBackupsCommand:()=>om,ListContributorInsightsCommand:()=>im,ListExportsCommand:()=>am,ListGlobalTablesCommand:()=>sm,ListImportsCommand:()=>cm,ListTablesCommand:()=>dm,ListTagsOfResourceCommand:()=>lm,PointInTimeRecoveryStatus:()=>Yr,PointInTimeRecoveryUnavailableException:()=>Ao,ProjectionType:()=>Ar,ProvisionedThroughputExceededException:()=>qr,PutItemCommand:()=>um,QueryCommand:()=>pm,ReplicaAlreadyExistsException:()=>Lo,ReplicaNotFoundException:()=>Fo,ReplicaStatus:()=>ao,RequestLimitExceeded:()=>Mr,ResourceInUseException:()=>po,ResourceNotFoundException:()=>Vr,RestoreTableFromBackupCommand:()=>mm,RestoreTableToPointInTimeCommand:()=>hm,ReturnConsumedCapacity:()=>Br,ReturnItemCollectionMetrics:()=>Gr,ReturnValue:()=>mo,ReturnValuesOnConditionCheckFailure:()=>Qr,S3SseAlgorithm:()=>go,SSEStatus:()=>Dr,SSEType:()=>kr,ScalarAttributeType:()=>xr,ScanCommand:()=>ym,Select:()=>Do,StreamViewType:()=>Rr,TableAlreadyExistsException:()=>Ro,TableClass:()=>so,TableInUseException:()=>ro,TableNotFoundException:()=>oo,TableStatus:()=>uo,TagResourceCommand:()=>fm,TimeToLiveStatus:()=>Or,TransactGetItemsCommand:()=>gm,TransactWriteItemsCommand:()=>wm,TransactionCanceledException:()=>Uo,TransactionConflictException:()=>ho,TransactionInProgressException:()=>To,UntagResourceCommand:()=>Em,UpdateContinuousBackupsCommand:()=>bm,UpdateContributorInsightsCommand:()=>vm,UpdateGlobalTableCommand:()=>Sm,UpdateGlobalTableSettingsCommand:()=>_m,UpdateItemCommand:()=>Im,UpdateTableCommand:()=>xm,UpdateTableReplicaAutoScalingCommand:()=>Cm,UpdateTimeToLiveCommand:()=>Tm,__Client:()=>In,paginateListContributorInsights:()=>km,paginateListExports:()=>Rm,paginateListImports:()=>Lm,paginateListTables:()=>zm,paginateQuery:()=>Um,paginateScan:()=>Mm,waitForTableExists:()=>Ym,waitForTableNotExists:()=>th,waitUntilTableExists:()=>Zm,waitUntilTableNotExists:()=>nh});var o={};r.r(o),r.d(o,{getUserAgentPrefix:()=>At,isVirtualHostableS3Bucket:()=>Bt,parseArn:()=>Ut,partition:()=>Tt,setPartitionInfo:()=>Pt,useDefaultPartitionInfo:()=>Nt});var i,a={};r.r(a),r.d(a,{aws:()=>o,booleanEquals:()=>$t,getAttr:()=>Mt,isSet:()=>jt,isValidHostLabel:()=>zt,not:()=>qt,parseURL:()=>Jt,stringEquals:()=>Qt,substring:()=>Xt,uriEncode:()=>Yt}),function(e){e.ENV="env",e.CONFIG="shared config entry"}(i||(i={}));const s=(e,t,n)=>{if(t in e){if("true"===e[t])return!0;if("false"===e[t])return!1;throw new Error(`Cannot load ${n} "${t}". Expected "true" or "false", got ${e[t]}.`)}},c={environmentVariableSelector:e=>s(e,"AWS_USE_DUALSTACK_ENDPOINT",i.ENV),configFileSelector:e=>s(e,"use_dualstack_endpoint",i.CONFIG),default:!1},d={environmentVariableSelector:e=>s(e,"AWS_USE_FIPS_ENDPOINT",i.ENV),configFileSelector:e=>s(e,"use_fips_endpoint",i.CONFIG),default:!1},l={environmentVariableSelector:e=>e.AWS_REGION,configFileSelector:e=>e.region,default:()=>{throw new Error("Region is missing")}},u={preferredFile:"credentials"},p=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips")),m=e=>p(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,h=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return{...e,region:async()=>{if("string"==typeof t)return m(t);const e=await t();return m(e)},useFipsEndpoint:async()=>{const e="string"==typeof t?t:await t();return!!p(e)||("function"!=typeof n?Promise.resolve(!!n):n())}}};var y,f;(f=y||(y={}))[f.HEADER=0]="HEADER",f[f.TRAILER=1]="TRAILER";class g{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/"}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){const e=new g({...this,headers:{...this.headers}});var t;return e.query&&(e.query=(t=e.query,Object.keys(t).reduce(((e,n)=>{const r=t[n];return{...e,[n]:Array.isArray(r)?[...r]:r}}),{}))),e}}class w{constructor(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}const E="content-length",b={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},v=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const r=t.request;if(g.isInstance(r)){const{body:e,headers:t}=r;if(e&&-1===Object.keys(t).map((e=>e.toLowerCase())).indexOf(E))try{const t=n(e);r.headers={...r.headers,[E]:String(t)}}catch(e){}}return e({...t,request:r})}),b)}}),S={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},_={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function I(e,t,n){return{applyToStack:r=>{r.add(((e,t)=>(n,r)=>async r=>{const{response:o}=await n(r);try{return{response:o,output:await t(o,e)}}catch(e){if(Object.defineProperty(e,"$response",{value:o}),!("$metadata"in e)){const t="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";e.message+="\n "+t}throw e}})(e,n),S),r.add(((e,t)=>(n,r)=>async o=>{const i=r.endpointV2?.url&&e.urlParser?async()=>e.urlParser(r.endpointV2.url):e.endpoint;if(!i)throw new Error("No valid endpoint provider available.");const a=await t(o.input,{...e,endpoint:i});return n({...o,request:a})})(e,t),_)}}}const x=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,C=/(\d+\.){3}\d+/,T=/\.\./,P=(e,t,n)=>{const r=async()=>{const r=n[e]??n[t];return"function"==typeof r?r():r};return"endpoint"===e||"endpoint"===t?async()=>{const e=await r();if(e&&"object"==typeof e){if("url"in e)return e.url.href;if("hostname"in e){const{protocol:t,hostname:n,port:r,path:o}=e;return`${t}//${n}${r?":"+r:""}${o}`}}return e}:r},N=async(e,t,n)=>{const r={},o=t?.getEndpointParameterInstructions?.()||{};for(const[t,i]of Object.entries(o))switch(i.type){case"staticContextParams":r[t]=i.value;break;case"contextParams":r[t]=e[i.name];break;case"clientContextParams":case"builtInParams":r[t]=await P(i.name,t,n)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(i))}return 0===Object.keys(o).length&&Object.assign(r,n),"s3"===String(n.serviceId).toLowerCase()&&await(async e=>{const t=e?.Bucket||"";if("string"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),(e=>{const[t,n,r,o,i,a]=e.split(":"),s="arn"===t&&e.split(":").length>=6,c=5===[t,n,r,i,a].filter(Boolean).length;if(s&&!c)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return!!("arn"===t&&n&&r&&i&&a)})(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else n=t,(!x.test(n)||C.test(n)||T.test(n)||-1!==t.indexOf(".")&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);var n;return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e})(r),r},A={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:_.name},k=(e,t)=>({applyToStack:n=>{n.addRelativeTo((({config:e,instructions:t})=>(n,r)=>async o=>{const i=await(async(e,t,n,r)=>{const o=await N(e,t,n);if("function"!=typeof n.endpointProvider)throw new Error("config.endpointProvider is not set.");return n.endpointProvider(o,r)})(o.input,{getEndpointParameterInstructions:()=>t},{...e},r);r.endpointV2=i,r.authSchemes=i.properties?.authSchemes;const a=r.authSchemes?.[0];return a&&(r.signing_region=a.signingRegion,r.signing_service=a.signingName),n({...o})})({config:e,instructions:t}),A)}}),D=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t},R=e=>{if("string"==typeof e)return R(new URL(e));const{hostname:t,pathname:n,port:r,protocol:o,search:i}=e;let a;return i&&(a=function(e){const t={};if(e=e.replace(/^\?/,""))for(const n of e.split("&")){let[e,r=null]=n.split("=");e=decodeURIComponent(e),r&&(r=decodeURIComponent(r)),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}(i)),{hostname:t,port:r?parseInt(r):void 0,protocol:o,path:n,query:a}},O=e=>{const t=e.tls??!0,{endpoint:n}=e,r=null!=n?async()=>(e=>"object"==typeof e?"url"in e?R(e.url):e:R(e))(await D(n)()):void 0,o=!!n;return{...e,endpoint:r,tls:t,isCustomEndpoint:o,useDualstackEndpoint:D(e.useDualstackEndpoint??!1),useFipsEndpoint:D(e.useFipsEndpoint??!1)}},L=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"],F="endpoint_discovery_enabled",z=e=>["false","0"].indexOf(e)>=0,B={environmentVariableSelector:e=>{for(let t=0;t<L.length;t++){const n=L[t];if(n in e){const t=e[n];if(""===t)throw Error(`Environment variable ${n} can't be empty of undefined, got "${t}"`);return!z(t)}}},configFileSelector:e=>{if(F in e){const t=e[F];if(void 0===t)throw Error(`Shared config entry ${F} can't be undefined, got "${t}"`);return!z(t)}},default:void 0};var U=r(6675),$=r.n(U);class M{constructor(e){this.cache=new($())(e)}getEndpoint(e){const t=this.get(e);if(!t||0===t.length)return;const n=t.map((e=>e.Address));return n[Math.floor(Math.random()*n.length)]}get(e){if(!this.has(e))return;const t=this.cache.get(e);if(!t)return;const n=Date.now(),r=t.filter((e=>n<e.Expires));if(0!==r.length)return r;this.delete(e)}set(e,t){const n=Date.now();this.cache.set(e,t.map((({Address:e,CachePeriodInMinutes:t})=>({Address:e,Expires:n+60*t*1e3}))))}delete(e){this.cache.set(e,[])}has(e){if(!this.cache.has(e))return!1;const t=this.cache.peek(e);return!!t&&t.length>0}clear(){this.cache.clear()}}const j={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},q=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{if(!g.isInstance(n.request))return t(n);const{request:r}=n,{handlerProtocol:o=""}=e.requestHandler.metadata||{};if(o.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]="";else if(!r.headers.host){let e=r.hostname;null!=r.port&&(e+=`:${r.port}`),r.headers.host=e}return t(n)})(e),j)}}),V={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},G=e=>({applyToStack:e=>{e.add(((e,t)=>async n=>{try{const r=await e(n),{clientName:o,commandName:i,logger:a,dynamoDbDocumentClientOptions:s={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:d}=s,l=c??t.inputFilterSensitiveLog,u=d??t.outputFilterSensitiveLog,{$metadata:p,...m}=r.output;return a?.info?.({clientName:o,commandName:i,input:l(n.input),output:u(m),metadata:p}),r}catch(e){const{clientName:r,commandName:o,logger:i,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:s}=a,c=s??t.inputFilterSensitiveLog;throw i?.error?.({clientName:r,commandName:o,input:c(n.input),error:e,metadata:e.$metadata}),e}}),V)}}),H="X-Amzn-Trace-Id",K={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},W=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{const{request:r}=n;if(!g.isInstance(r)||"node"!==e.runtime||r.headers.hasOwnProperty(H))return t(n);const o=process.env.AWS_LAMBDA_FUNCTION_NAME,i=process.env._X_AMZN_TRACE_ID,a=e=>"string"==typeof e&&e.length>0;return a(o)&&a(i)&&(r.headers[H]=i),t({...n,request:r})})(e),K)}});var J,Q;(Q=J||(J={})).STANDARD="standard",Q.ADAPTIVE="adaptive";const X=J.STANDARD,Y=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Z=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],ee=[500,502,503,504],te=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],ne=e=>429===e.$metadata?.httpStatusCode||Y.includes(e.name)||1==e.$retryable?.throttling,re=e=>Z.includes(e.name)||te.includes(e?.code||"")||ee.includes(e.$metadata?.httpStatusCode||0);class oe{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;const t=this.getCurrentTimeInSeconds();this.lastThrottleTime=t,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const t=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise((e=>setTimeout(e,t)))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp)return void(this.lastTimestamp=e);const t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}updateClientSendingRate(e){let t;if(this.updateMeasuredRate(),ne(e)){const e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){const e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}class ie{constructor(e){this.maxAttempts=e,this.mode=J.STANDARD,this.retryToken=((e,t,n,r)=>{const o=e,i=r?.retryCost??5,a=r?.timeoutRetryCost??10,s=r?.retryBackoffStrategy??(()=>{let e=100;return{computeNextBackoffDelay:t=>Math.floor(Math.min(2e4,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}})();let c,d=e,l=Math.min(2e4,t),u=n??0;const p=e=>"TRANSIENT"===e?a:i,m=e=>p(e)<=d;return{getRetryCount:()=>u,getRetryDelay:()=>l,getLastRetryCost:()=>c,hasRetryTokens:m,getRetryTokenCount:e=>{const t=e.errorType;if(!m(t))throw new Error("No retry token available");const n=p(t),r="THROTTLING"===t?500:100;s.setDelayBase(r);const o=s.computeNextBackoffDelay(u);if(e.retryAfterHint){const t=e.retryAfterHint.getTime()-Date.now();l=Math.max(t||0,o)}else l=o;return u++,c=n,d-=n,n},releaseRetryTokens:e=>{d+=e??1,d=Math.min(d,o)}}})(500,100),this.maxAttemptsProvider="function"==typeof e?e:async()=>e}async acquireInitialRetryToken(e){return this.retryToken}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts();if(this.shouldRetry(e,t,n))return e.getRetryTokenCount(t),e;throw new Error("No retry token available")}recordSuccess(e){this.retryToken.releaseRetryTokens(e.getLastRetryCost())}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn("Max attempts provider could not resolve. Using default of 3"),3}}shouldRetry(e,t,n){return e.getRetryCount()<n&&e.hasRetryTokens(t.errorType)&&this.isRetryableError(t.errorType)}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}}class ae{constructor(e,t){this.maxAttemptsProvider=e,this.mode=J.ADAPTIVE;const{rateLimiter:n}=t??{};this.rateLimiter=n??new oe,this.standardRetryStrategy=new ie(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}const se="AWS_MAX_ATTEMPTS",ce="max_attempts",de={environmentVariableSelector:e=>{const t=e[se];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Environment variable ${se} mast be a number, got "${t}"`);return n},configFileSelector:e=>{const t=e[ce];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Shared config file entry ${ce} mast be a number, got "${t}"`);return n},default:3},le=e=>{const{retryStrategy:t}=e,n=D(e.maxAttempts??3);return{...e,maxAttempts:n,retryStrategy:async()=>t||(await D(e.retryMode)()===J.ADAPTIVE?new ae(n):new ie(n))}},ue={environmentVariableSelector:e=>e.AWS_RETRY_MODE,configFileSelector:e=>e.retry_mode,default:X},pe=e(import.meta.url)("crypto");var me=r.n(pe);const he=new Uint8Array(256);let ye=he.length;function fe(){return ye>he.length-16&&(me().randomFillSync(he),ye=0),he.slice(ye,ye+=16)}const ge=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,we=[];for(let e=0;e<256;++e)we.push((e+256).toString(16).substr(1));const Ee=function(e,t=0){const n=(we[e[t+0]]+we[e[t+1]]+we[e[t+2]]+we[e[t+3]]+"-"+we[e[t+4]]+we[e[t+5]]+"-"+we[e[t+6]]+we[e[t+7]]+"-"+we[e[t+8]]+we[e[t+9]]+"-"+we[e[t+10]]+we[e[t+11]]+we[e[t+12]]+we[e[t+13]]+we[e[t+14]]+we[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&ge.test(e)}(n))throw TypeError("Stringified UUID is invalid");return n},be=function(e,t,n){const r=(e=e||{}).random||(e.rng||fe)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Ee(r)},ve=e=>{const t={errorType:Se(e)},n=xe(e.$response);return n&&(t.retryAfterHint=n),t},Se=e=>ne(e)?"THROTTLING":re(e)?"TRANSIENT":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!re(e)}return!1})(e)?"SERVER_ERROR":"CLIENT_ERROR",_e={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Ie=e=>({applyToStack:t=>{t.add((e=>(t,n)=>async r=>{let o=await e.retryStrategy();const i=await e.maxAttempts();if(!(e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess)(o))return o?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",o.mode]]),o.retry(t,r);{let e=await o.acquireInitialRetryToken(n.partition_id),s=new Error,c=0,d=0;const{request:l}=r;for(g.isInstance(l)&&(l.headers["amz-sdk-invocation-id"]=be());;)try{g.isInstance(l)&&(l.headers["amz-sdk-request"]=`attempt=${c+1}; max=${i}`);const{response:n,output:a}=await t(r);return o.recordSuccess(e),a.$metadata.attempts=c+1,a.$metadata.totalRetryDelay=d,{response:n,output:a}}catch(t){const n=ve(t);s=(a=t)instanceof Error?a:a instanceof Object?Object.assign(new Error,a):"string"==typeof a?new Error(a):new Error(`AWS SDK error wrapper for ${a}`);try{e=await o.refreshRetryTokenForRetry(e,n)}catch(e){throw s.$metadata||(s.$metadata={}),s.$metadata.attempts=c+1,s.$metadata.totalRetryDelay=d,s}c=e.getRetryCount();const r=e.getRetryDelay();d+=r,await new Promise((e=>setTimeout(e,r)))}}var a})(e),_e)}}),xe=e=>{if(!w.isInstance(e))return;const t=Object.keys(e.headers).find((e=>"retry-after"===e.toLowerCase()));if(!t)return;const n=e.headers[t],r=Number(n);return Number.isNaN(r)?new Date(n):new Date(1e3*r)};class Ce extends Error{constructor(e,t=!0){super(e),this.tryNextLink=t,this.name="ProviderError",Object.setPrototypeOf(this,Ce.prototype)}static from(e,t=!0){return Object.assign(new this(e.message,t),e)}}class Te extends Ce{constructor(e,t=!0){super(e,t),this.tryNextLink=t,this.name="CredentialsProviderError",Object.setPrototypeOf(this,Te.prototype)}}class Pe extends Ce{constructor(e,t=!0){super(e,t),this.tryNextLink=t,this.name="TokenProviderError",Object.setPrototypeOf(this,Pe.prototype)}}function Ne(...e){return()=>{let t=Promise.reject(new Ce("No providers in chain"));for(const n of e)t=t.catch((e=>{if(e?.tryNextLink)return n();throw e}));return t}}const Ae=(e,t,n)=>{let r,o,i,a=!1;const s=async()=>{o||(o=e());try{r=await o,i=!0,a=!1}finally{o=void 0}return r};return void 0===t?async e=>(i&&!e?.forceRefresh||(r=await s()),r):async e=>(i&&!e?.forceRefresh||(r=await s()),a?r:n&&!n(r)?(a=!0,r):t(r)?(await s(),r):r)},ke={},De={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),ke[e]=t,De[t]=e}function Re(e){let t="";for(let n=0;n<e.byteLength;n++)t+=ke[e[n]];return t}const Oe=e=>"function"==typeof ArrayBuffer&&e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e),Le=e(import.meta.url)("buffer"),Fe=(e,t=0,n=e.byteLength-t)=>{if(!Oe(e))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return Le.Buffer.from(e,t,n)},ze=(e,t)=>{if("string"!=typeof e)throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?Le.Buffer.from(e,t):Le.Buffer.from(e)},Be=e=>{const t=ze(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},Ue=e=>"string"==typeof e?Be(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),$e=e=>Fe(e.buffer,e.byteOffset,e.byteLength).toString("utf8"),Me="X-Amz-Date",je="X-Amz-Signature",qe="X-Amz-Security-Token",Ve="authorization",Ge=Me.toLowerCase(),He=[Ve,Ge,"date"],Ke=je.toLowerCase(),We="x-amz-content-sha256",Je=qe.toLowerCase(),Qe={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Xe=/^proxy-/,Ye=/^sec-/,Ze="AWS4-HMAC-SHA256",et="AWS4-HMAC-SHA256-PAYLOAD",tt="aws4_request",nt={},rt=[],ot=(e,t,n)=>`${e}/${t}/${n}/${tt}`,it=(e,t,n)=>{const r=new e(t);return r.update(Ue(n)),r.digest()},at=({headers:e},t,n)=>{const r={};for(const o of Object.keys(e).sort()){if(null==e[o])continue;const i=o.toLowerCase();(i in Qe||t?.has(i)||Xe.test(i)||Ye.test(i))&&(!n||n&&!n.has(i))||(r[i]=e[o].trim().replace(/\s+/g," "))}return r},st=e=>encodeURIComponent(e).replace(/[!'()*]/g,ct),ct=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,dt=async({headers:e,body:t},n)=>{for(const t of Object.keys(e))if(t.toLowerCase()===We)return e[t];if(null==t)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof t||ArrayBuffer.isView(t)||Oe(t)){const e=new n;return e.update(Ue(t)),Re(await e.digest())}return"UNSIGNED-PAYLOAD"},lt=({headers:e,query:t,...n})=>({...n,headers:{...e},query:t?ut(t):void 0}),ut=e=>Object.keys(e).reduce(((t,n)=>{const r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}}),{}),pt=e=>{e="function"==typeof e.clone?e.clone():lt(e);for(const t of Object.keys(e.headers))He.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e};class mt{constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:o,uriEscapePath:i=!0}){this.service=r,this.sha256=o,this.uriEscapePath=i,this.applyChecksum="boolean"!=typeof e||e,this.regionProvider=D(n),this.credentialProvider=D(t)}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:o,unhoistableHeaders:i,signableHeaders:a,signingRegion:s,signingService:c}=t,d=await this.credentialProvider();this.validateResolvedCredentials(d);const l=s??await this.regionProvider(),{longDate:u,shortDate:p}=ht(n);if(r>604800)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const m=ot(p,l,c??this.service),h=((e,t={})=>{const{headers:n,query:r={}}="function"==typeof e.clone?e.clone():lt(e);for(const e of Object.keys(n)){const o=e.toLowerCase();"x-amz-"!==o.slice(0,6)||t.unhoistableHeaders?.has(o)||(r[e]=n[e],delete n[e])}return{...e,headers:n,query:r}})(pt(e),{unhoistableHeaders:i});d.sessionToken&&(h.query[qe]=d.sessionToken),h.query["X-Amz-Algorithm"]=Ze,h.query["X-Amz-Credential"]=`${d.accessKeyId}/${m}`,h.query[Me]=u,h.query["X-Amz-Expires"]=r.toString(10);const y=at(h,o,a);return h.query["X-Amz-SignedHeaders"]=yt(y),h.query[je]=await this.getSignature(u,m,this.getSigningKey(d,l,p,c),this.createCanonicalRequest(h,y,await dt(e,this.sha256))),h}async sign(e,t){return"string"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:r,signingRegion:o,signingService:i}){const a=o??await this.regionProvider(),{shortDate:s,longDate:c}=ht(n),d=ot(s,a,i??this.service),l=await dt({headers:{},body:t},this.sha256),u=new this.sha256;u.update(e);const p=Re(await u.digest()),m=[et,c,d,r,p,l].join("\n");return this.signString(m,{signingDate:n,signingRegion:a,signingService:i})}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:r}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const i=n??await this.regionProvider(),{shortDate:a}=ht(t),s=new this.sha256(await this.getSigningKey(o,i,a,r));return s.update(Ue(e)),Re(await s.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:o,signingService:i}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const s=o??await this.regionProvider(),c=pt(e),{longDate:d,shortDate:l}=ht(t),u=ot(l,s,i??this.service);c.headers[Ge]=d,a.sessionToken&&(c.headers[Je]=a.sessionToken);const p=await dt(c,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(We,c.headers)&&this.applyChecksum&&(c.headers[We]=p);const m=at(c,r,n),h=await this.getSignature(d,u,this.getSigningKey(a,s,l,i),this.createCanonicalRequest(c,m,p));return c.headers[Ve]=`${Ze} Credential=${a.accessKeyId}/${u}, SignedHeaders=${yt(m)}, Signature=${h}`,c}createCanonicalRequest(e,t,n){const r=Object.keys(t).sort();return`${e.method}\n${this.getCanonicalPath(e)}\n${(({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e).sort()){if(r.toLowerCase()===Ke)continue;t.push(r);const o=e[r];"string"==typeof o?n[r]=`${st(r)}=${st(o)}`:Array.isArray(o)&&(n[r]=o.slice(0).sort().reduce(((e,t)=>e.concat([`${st(r)}=${st(t)}`])),[]).join("&"))}return t.map((e=>n[e])).filter((e=>e)).join("&")})(e)}\n${r.map((e=>`${e}:${t[e]}`)).join("\n")}\n\n${r.join(";")}\n${n}`}async createStringToSign(e,t,n){const r=new this.sha256;r.update(Ue(n));const o=await r.digest();return`${Ze}\n${e}\n${t}\n${Re(o)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const n of e.split("/"))0!==n?.length&&"."!==n&&(".."===n?t.pop():t.push(n));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return encodeURIComponent(n).replace(/%2F/g,"/")}return e}async getSignature(e,t,n,r){const o=await this.createStringToSign(e,t,r),i=new this.sha256(await n);return i.update(Ue(o)),Re(await i.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,o)=>{const i=`${n}:${r}:${o}:${Re(await it(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(i in nt)return nt[i];for(rt.push(i);rt.length>50;)delete nt[rt.shift()];let a=`AWS4${t.secretAccessKey}`;for(const t of[n,r,o,tt])a=await it(e,a,t);return nt[i]=a})(this.sha256,e,n,t,r||this.service)}validateResolvedCredentials(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")}}const ht=e=>{const t=(n=e,(e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e)(n).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");var n;return{longDate:t,shortDate:t.slice(0,8)}},yt=e=>Object.keys(e).sort().join(";"),ft=e=>{const t=e.credentials?gt(e.credentials):e.credentialDefaultProvider(e),{signingEscapePath:n=!0,systemClockOffset:r=e.systemClockOffset||0,sha256:o}=e;let i;return i=e.signer?D(e.signer):e.regionInfoProvider?()=>D(e.region)().then((async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t])).then((([r,i])=>{const{signingRegion:a,signingService:s}=r;e.signingRegion=e.signingRegion||a||i,e.signingName=e.signingName||s||e.serviceId;const c={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:n};return new(e.signerConstructor||mt)(c)})):async r=>{const i=(r=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await D(e.region)(),properties:{}},r)).signingRegion,a=r.signingName;e.signingRegion=e.signingRegion||i,e.signingName=e.signingName||a||e.serviceId;const s={...e,credentials:t,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:n};return new(e.signerConstructor||mt)(s)},{...e,systemClockOffset:r,signingEscapePath:n,credentials:t,signer:i}},gt=e=>"function"==typeof e?Ae(e,(e=>void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5),(e=>void 0!==e.expiration)):D(e),wt=e=>new Date(Date.now()+e),Et=(e,t)=>{const n=Date.parse(e);return((e,t)=>Math.abs(wt(t).getTime()-e)>=3e5)(n,t)?n-Date.now():t},bt=e=>w.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,vt={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},St=e=>({applyToStack:t=>{t.addRelativeTo((e=>(t,n)=>async function(r){if(!g.isInstance(r.request))return t(r);const o=n.endpointV2?.properties?.authSchemes?.[0],i="sigv4a"===o?.name?o?.signingRegionSet?.join(","):void 0,a=await e.signer(o),s=await t({...r,request:await a.sign(r.request,{signingDate:wt(e.systemClockOffset),signingRegion:i||n.signing_region,signingService:n.signing_service})}).catch((t=>{const n=t.ServerTime??bt(t.$response);throw n&&(e.systemClockOffset=Et(n,e.systemClockOffset)),t})),c=bt(s.response);return c&&(e.systemClockOffset=Et(c,e.systemClockOffset)),s})(e),vt)}});function _t(e){return{...e,customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent}}const It=JSON.parse('{"partitions":[{"id":"aws","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","name":"aws","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^(us|eu|ap|sa|ca|me|af)\\\\-\\\\w+\\\\-\\\\d+$","regions":{"af-south-1":{"description":"Africa (Cape Town)"},"ap-east-1":{"description":"Asia Pacific (Hong Kong)"},"ap-northeast-1":{"description":"Asia Pacific (Tokyo)"},"ap-northeast-2":{"description":"Asia Pacific (Seoul)"},"ap-northeast-3":{"description":"Asia Pacific (Osaka)"},"ap-south-1":{"description":"Asia Pacific (Mumbai)"},"ap-south-2":{"description":"Asia Pacific (Hyderabad)"},"ap-southeast-1":{"description":"Asia Pacific (Singapore)"},"ap-southeast-2":{"description":"Asia Pacific (Sydney)"},"ap-southeast-3":{"description":"Asia Pacific (Jakarta)"},"ap-southeast-4":{"description":"Asia Pacific (Melbourne)"},"aws-global":{"description":"AWS Standard global region"},"ca-central-1":{"description":"Canada (Central)"},"eu-central-1":{"description":"Europe (Frankfurt)"},"eu-central-2":{"description":"Europe (Zurich)"},"eu-north-1":{"description":"Europe (Stockholm)"},"eu-south-1":{"description":"Europe (Milan)"},"eu-south-2":{"description":"Europe (Spain)"},"eu-west-1":{"description":"Europe (Ireland)"},"eu-west-2":{"description":"Europe (London)"},"eu-west-3":{"description":"Europe (Paris)"},"me-central-1":{"description":"Middle East (UAE)"},"me-south-1":{"description":"Middle East (Bahrain)"},"sa-east-1":{"description":"South America (Sao Paulo)"},"us-east-1":{"description":"US East (N. Virginia)"},"us-east-2":{"description":"US East (Ohio)"},"us-west-1":{"description":"US West (N. California)"},"us-west-2":{"description":"US West (Oregon)"}}},{"id":"aws-cn","outputs":{"dnsSuffix":"amazonaws.com.cn","dualStackDnsSuffix":"api.amazonwebservices.com.cn","name":"aws-cn","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^cn\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-cn-global":{"description":"AWS China global region"},"cn-north-1":{"description":"China (Beijing)"},"cn-northwest-1":{"description":"China (Ningxia)"}}},{"id":"aws-us-gov","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","name":"aws-us-gov","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-us-gov-global":{"description":"AWS GovCloud (US) global region"},"us-gov-east-1":{"description":"AWS GovCloud (US-East)"},"us-gov-west-1":{"description":"AWS GovCloud (US-West)"}}},{"id":"aws-iso","outputs":{"dnsSuffix":"c2s.ic.gov","dualStackDnsSuffix":"c2s.ic.gov","name":"aws-iso","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-global":{"description":"AWS ISO (US) global region"},"us-iso-east-1":{"description":"US ISO East"},"us-iso-west-1":{"description":"US ISO WEST"}}},{"id":"aws-iso-b","outputs":{"dnsSuffix":"sc2s.sgov.gov","dualStackDnsSuffix":"sc2s.sgov.gov","name":"aws-iso-b","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-b-global":{"description":"AWS ISOB (US) global region"},"us-isob-east-1":{"description":"US ISOB East (Ohio)"}}},{"id":"aws-iso-e","outputs":{"dnsSuffix":"cloud.adc-e.uk","dualStackDnsSuffix":"cloud.adc-e.uk","name":"aws-iso-e","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$","regions":{}}],"version":"1.1"}');let xt=It,Ct="";const Tt=e=>{const{partitions:t}=xt;for(const n of t){const{regions:t,outputs:r}=n;for(const[n,o]of Object.entries(t))if(n===e)return{...r,...o}}for(const n of t){const{regionRegex:t,outputs:r}=n;if(new RegExp(t).test(e))return{...r}}const n=t.find((e=>"aws"===e.id));if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},Pt=(e,t="")=>{xt=e,Ct=t},Nt=()=>{Pt(It,"")},At=()=>Ct,kt="endpoints";function Dt(e){return"object"!=typeof e||null==e?e:"ref"in e?`$${Dt(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(Dt).join(", ")})`:JSON.stringify(e,null,2)}class Rt extends Error{constructor(e){super(e),this.name="EndpointError"}}const Ot=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),Lt=e=>Ot.test(e)||e.startsWith("[")&&e.endsWith("]"),Ft=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),zt=(e,t=!1)=>{if(!t)return Ft.test(e);const n=e.split(".");for(const e of n)if(!zt(e))return!1;return!0},Bt=(e,t=!1)=>{if(t){for(const t of e.split("."))if(!Bt(t))return!1;return!0}return!(!zt(e)||e.length<3||e.length>63||e!==e.toLowerCase()||Lt(e))},Ut=e=>{const t=e.split(":");if(t.length<6)return null;const[n,r,o,i,a,...s]=t;return"arn"!==n||""===r||""===o||""===s[0]?null:{partition:r,service:o,region:i,accountId:a,resourceId:s[0].includes("/")?s[0].split("/"):s}},$t=(e,t)=>e===t,Mt=(e,t)=>(e=>{const t=e.split("."),n=[];for(const r of t){const t=r.indexOf("[");if(-1!==t){if(r.indexOf("]")!==r.length-1)throw new Rt(`Path: '${e}' does not end with ']'`);const o=r.slice(t+1,-1);if(Number.isNaN(parseInt(o)))throw new Rt(`Invalid array index: '${o}' in path: '${e}'`);0!==t&&n.push(r.slice(0,t)),n.push(o)}else n.push(r)}return n})(t).reduce(((n,r)=>{if("object"!=typeof n)throw new Rt(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(n)?n[parseInt(r)]:n[r]}),e),jt=e=>null!=e,qt=e=>!e;var Vt,Gt,Ht,Kt;!function(e){e.HEADER="header",e.QUERY="query"}(Vt||(Vt={})),function(e){e.AAAA="AAAA",e.A="A"}(Gt||(Gt={})),function(e){e.HTTP="http",e.HTTPS="https"}(Ht||(Ht={})),function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"}(Kt||(Kt={}));const Wt={[Ht.HTTP]:80,[Ht.HTTPS]:443},Jt=e=>{const t=(()=>{try{if(e instanceof URL)return e;if("object"==typeof e&&"hostname"in e){const{hostname:t,port:n,protocol:r="",path:o="",query:i={}}=e,a=new URL(`${r}//${t}${n?`:${n}`:""}${o}`);return a.search=Object.entries(i).map((([e,t])=>`${e}=${t}`)).join("&"),a}return new URL(e)}catch(e){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const n=t.href,{host:r,hostname:o,pathname:i,protocol:a,search:s}=t;if(s)return null;const c=a.slice(0,-1);if(!Object.values(Ht).includes(c))return null;const d=Lt(o);return{scheme:c,authority:`${r}${n.includes(`${r}:${Wt[c]}`)||"string"==typeof e&&e.includes(`${r}:${Wt[c]}`)?`:${Wt[c]}`:""}`,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:d}},Qt=(e,t)=>e===t,Xt=(e,t,n,r)=>t>=n||e.length<n?null:r?e.substring(e.length-n,e.length-t):e.substring(t,n),Yt=e=>encodeURIComponent(e).replace(/[!*'()]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),Zt=(e,t)=>{const n=[],r={...t.endpointParams,...t.referenceRecord};let o=0;for(;o<e.length;){const t=e.indexOf("{",o);if(-1===t){n.push(e.slice(o));break}n.push(e.slice(o,t));const i=e.indexOf("}",t);if(-1===i){n.push(e.slice(t));break}"{"===e[t+1]&&"}"===e[i+1]&&(n.push(e.slice(t+1,i)),o=i+2);const a=e.substring(t+1,i);if(a.includes("#")){const[e,t]=a.split("#");n.push(Mt(r[e],t))}else n.push(r[a]);o=i+1}return n.join("")},en=(e,t,n)=>{if("string"==typeof e)return Zt(e,n);if(e.fn)return tn(e,n);if(e.ref)return(({ref:e},t)=>({...t.endpointParams,...t.referenceRecord}[e]))(e,n);throw new Rt(`'${t}': ${String(e)} is not a string, function or reference.`)},tn=({fn:e,argv:t},n)=>{const r=t.map((e=>["boolean","number"].includes(typeof e)?e:en(e,"arg",n)));return e.split(".").reduce(((e,t)=>e[t]),a)(...r)},nn=({assign:e,...t},n)=>{if(e&&e in n.referenceRecord)throw new Rt(`'${e}' is already defined in Reference Record.`);const r=tn(t,n);return n.logger?.debug?.(kt,`evaluateCondition: ${Dt(t)} = ${Dt(r)}`),{result:""===r||!!r,...null!=e&&{toAssign:{name:e,value:r}}}},rn=(e=[],t)=>{const n={};for(const r of e){const{result:e,toAssign:o}=nn(r,{...t,referenceRecord:{...t.referenceRecord,...n}});if(!e)return{result:e};o&&(n[o.name]=o.value,t.logger?.debug?.(kt,`assign: ${o.name} := ${Dt(o.value)}`))}return{result:!0,referenceRecord:n}},on=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>({...e,[n]:r.map((e=>{const r=en(e,"Header value entry",t);if("string"!=typeof r)throw new Rt(`Header '${n}' value '${r}' is not a string`);return r}))})),{}),an=(e,t)=>{if(Array.isArray(e))return e.map((e=>an(e,t)));switch(typeof e){case"string":return Zt(e,t);case"object":if(null===e)throw new Rt(`Unexpected endpoint property: ${e}`);return sn(e,t);case"boolean":return e;default:throw new Rt("Unexpected endpoint property type: "+typeof e)}},sn=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>({...e,[n]:an(r,t)})),{}),cn=(e,t)=>{const n=en(e,"Endpoint URL",t);if("string"==typeof n)try{return new URL(n)}catch(e){throw console.error(`Failed to construct URL with ${n}`,e),e}throw new Rt("Endpoint URL must be a string, got "+typeof n)},dn=(e,t)=>{const{conditions:n,endpoint:r}=e,{result:o,referenceRecord:i}=rn(n,t);if(!o)return;const a={...t,referenceRecord:{...t.referenceRecord,...i}},{url:s,properties:c,headers:d}=r;return t.logger?.debug?.(kt,`Resolving endpoint from template: ${Dt(r)}`),{...null!=d&&{headers:on(d,a)},...null!=c&&{properties:sn(c,a)},url:cn(s,a)}},ln=(e,t)=>{const{conditions:n,error:r}=e,{result:o,referenceRecord:i}=rn(n,t);if(o)throw new Rt(en(r,"Error",{...t,referenceRecord:{...t.referenceRecord,...i}}))},un=(e,t)=>{const{conditions:n,rules:r}=e,{result:o,referenceRecord:i}=rn(n,t);if(o)return pn(r,{...t,referenceRecord:{...t.referenceRecord,...i}})},pn=(e,t)=>{for(const n of e)if("endpoint"===n.type){const e=dn(n,t);if(e)return e}else if("error"===n.type)ln(n,t);else{if("tree"!==n.type)throw new Rt(`Unknown endpoint rule: ${n}`);{const e=un(n,t);if(e)return e}}throw new Rt("Rules evaluation failed")},mn=(e,t)=>{const{endpointParams:n,logger:r}=t,{parameters:o,rules:i}=e;t.logger?.debug?.(`${kt} Initial EndpointParams: ${Dt(n)}`);const a=Object.entries(o).filter((([,e])=>null!=e.default)).map((([e,t])=>[e,t.default]));if(a.length>0)for(const[e,t]of a)n[e]=n[e]??t;const s=Object.entries(o).filter((([,e])=>e.required)).map((([e])=>e));for(const e of s)if(null==n[e])throw new Rt(`Missing required parameter: '${e}'`);const c=pn(i,{endpointParams:n,logger:r,referenceRecord:{}});if(t.endpointParams?.Endpoint)try{const e=new URL(t.endpointParams.Endpoint),{protocol:n,port:r}=e;c.url.protocol=n,c.url.port=r}catch(e){}return t.logger?.debug?.(`${kt} Resolved endpoint: ${Dt(c)}`),c},hn="user-agent",yn="x-amz-user-agent",fn=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,gn=([e,t])=>{const n=e.indexOf("/"),r=e.substring(0,n);let o=e.substring(n+1);return"api"===r&&(o=o.toLowerCase()),[r,o,t].filter((e=>e&&e.length>0)).map((e=>e?.replace(fn,"_"))).join("/")},wn={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},En=e=>({applyToStack:t=>{var n;t.add((n=e,(e,t)=>async r=>{const{request:o}=r;if(!g.isInstance(o))return e(r);const{headers:i}=o,a=t?.userAgent?.map(gn)||[],s=(await n.defaultUserAgentProvider()).map(gn),c=n?.customUserAgent?.map(gn)||[],d=At(),l=(d?[d]:[]).concat([...s,...a,...c]).join(" "),u=[...s.filter((e=>e.startsWith("aws-sdk-"))),...c].join(" ");return"browser"!==n.runtime?(u&&(i[yn]=i[yn]?`${i[hn]} ${u}`:u),i[hn]=l):i[yn]=l,e({...r,request:o})}),wn)}});class bn{trace(){}debug(){}info(){}warn(){}error(){}}const vn=()=>{let e=[],t=[];const n=new Set,r=n=>(e.forEach((e=>{n.add(e.middleware,{...e})})),t.forEach((e=>{n.addRelativeTo(e.middleware,{...e})})),n),o=e=>{const t=[];return e.before.forEach((e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...o(e))})),t.push(e),e.after.reverse().forEach((e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...o(e))})),t},i=(n=!1)=>{const r=[],i=[],a={};e.forEach((e=>{const t={...e,before:[],after:[]};t.name&&(a[t.name]=t),r.push(t)})),t.forEach((e=>{const t={...e,before:[],after:[]};t.name&&(a[t.name]=t),i.push(t)})),i.forEach((e=>{if(e.toMiddleware){const t=a[e.toMiddleware];if(void 0===t){if(n)return;throw new Error(`${e.toMiddleware} is not found when adding ${e.name||"anonymous"} middleware ${e.relation} ${e.toMiddleware}`)}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}}));const s=(c=r,c.sort(((e,t)=>Sn[t.step]-Sn[e.step]||_n[t.priority||"normal"]-_n[e.priority||"normal"]))).map(o).reduce(((e,t)=>(e.push(...t),e)),[]);var c;return s},a={add:(t,r={})=>{const{name:o,override:i}=r,a={step:"initialize",priority:"normal",middleware:t,...r};if(o){if(n.has(o)){if(!i)throw new Error(`Duplicate middleware name '${o}'`);const t=e.findIndex((e=>e.name===o)),n=e[t];if(n.step!==a.step||n.priority!==a.priority)throw new Error(`"${o}" middleware with ${n.priority} priority in ${n.step} step cannot be overridden by same-name middleware with ${a.priority} priority in ${a.step} step.`);e.splice(t,1)}n.add(o)}e.push(a)},addRelativeTo:(e,r)=>{const{name:o,override:i}=r,a={middleware:e,...r};if(o){if(n.has(o)){if(!i)throw new Error(`Duplicate middleware name '${o}'`);const e=t.findIndex((e=>e.name===o)),n=t[e];if(n.toMiddleware!==a.toMiddleware||n.relation!==a.relation)throw new Error(`"${o}" middleware ${n.relation} "${n.toMiddleware}" middleware cannot be overridden by same-name middleware ${a.relation} "${a.toMiddleware}" middleware.`);t.splice(e,1)}n.add(o)}t.push(a)},clone:()=>r(vn()),use:e=>{e.applyToStack(a)},remove:r=>"string"==typeof r?(r=>{let o=!1;const i=e=>!e.name||e.name!==r||(o=!0,n.delete(r),!1);return e=e.filter(i),t=t.filter(i),o})(r):(r=>{let o=!1;const i=e=>e.middleware!==r||(o=!0,e.name&&n.delete(e.name),!1);return e=e.filter(i),t=t.filter(i),o})(r),removeByTag:r=>{let o=!1;const i=e=>{const{tags:t,name:i}=e;return!t||!t.includes(r)||(i&&n.delete(i),o=!0,!1)};return e=e.filter(i),t=t.filter(i),o},concat:e=>{const t=r(vn());return t.use(e),t},applyToStack:r,identify:()=>i(!0).map((e=>e.name+": "+(e.tags||[]).join(","))),resolve:(e,t)=>{for(const n of i().map((e=>e.middleware)).reverse())e=n(e,t);return e}};return a},Sn={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},_n={high:3,normal:2,low:1};class In{constructor(e){this.middlewareStack=vn(),this.config=e}send(e,t,n){const r="function"!=typeof t?t:void 0,o="function"==typeof t?t:n,i=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!o)return i(e).then((e=>e.output));i(e).then((e=>o(null,e.output)),(e=>o(e))).catch((()=>{}))}destroy(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()}}class xn{constructor(){this.middlewareStack=vn()}}const Cn="***SensitiveInformation***",Tn=e=>{if(null!=e){if("number"==typeof e){if(0!==e&&1!==e||Vn.warn(qn(`Expected boolean, got ${typeof e}: ${e}`)),0===e)return!1;if(1===e)return!0}if("string"==typeof e){const t=e.toLowerCase();if("false"!==t&&"true"!==t||Vn.warn(qn(`Expected boolean, got ${typeof e}: ${e}`)),"false"===t)return!1;if("true"===t)return!0}if("boolean"==typeof e)return e;throw new TypeError(`Expected boolean, got ${typeof e}: ${e}`)}},Pn=e=>{if(null!=e){if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&Vn.warn(qn(`Expected number but observed string: ${e}`)),t}if("number"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},Nn=Math.ceil(2**127*(2-2**-23)),An=e=>{if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},kn=e=>Dn(e,32),Dn=(e,t)=>{const n=An(e);if(void 0!==n&&Rn(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},Rn=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},On=(e,t)=>{if(null==e){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError("Expected a non-null value")}return e},Ln=e=>{if(null==e)return;if("object"==typeof e&&!Array.isArray(e))return e;const t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},Fn=e=>{if(null!=e){if("string"==typeof e)return e;if(["boolean","number","bigint"].includes(typeof e))return Vn.warn(qn(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},zn=e=>{if(null==e)return;const t=Ln(e),n=Object.entries(t).filter((([,e])=>null!=e)).map((([e])=>e));if(0===n.length)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(n.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${n} were not null.`);return t},Bn=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,Un=e=>{const t=e.match(Bn);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},$n=e=>"string"==typeof e?Mn(e):Pn(e),Mn=e=>{switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${e}`)}},jn=e=>kn("string"==typeof e?Un(e):e),qn=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter((e=>!e.includes("stackTraceWarning"))).join("\n"),Vn={warn:console.warn},Gn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Hn=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Kn=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=Hn.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[n,r,o,i,a,s,c,d,l]=t,u=(e=>(e=>Dn(e,16))("string"==typeof e?Un(e):e))(nr(r)),p=Zn(o,"month",1,12),m=Zn(i,"day",1,31),h=Jn(u,p,m,{hours:a,minutes:s,seconds:c,fractionalMilliseconds:d});return"Z"!=l.toUpperCase()&&h.setTime(h.getTime()-tr(l)),h},Wn=e=>{if(null==e)return;let t;if("number"==typeof e)t=e;else{if("string"!=typeof e)throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");t=(e=>Pn("string"==typeof e?Un(e):e))(e)}if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(1e3*t))},Jn=(e,t,n,r)=>{const o=t-1;return Xn(e,o,n),new Date(Date.UTC(e,o,n,Zn(r.hours,"hour",0,23),Zn(r.minutes,"minute",0,59),Zn(r.seconds,"seconds",0,60),er(r.fractionalMilliseconds)))},Qn=[31,28,31,30,31,30,31,31,30,31,30,31],Xn=(e,t,n)=>{let r=Qn[t];if(1===t&&Yn(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${Gn[t]} in ${e}: ${n}`)},Yn=e=>e%4==0&&(e%100!=0||e%400==0),Zn=(e,t,n,r)=>{const o=(e=>(e=>Dn(e,8))("string"==typeof e?Un(e):e))(nr(e));if(o<n||o>r)throw new TypeError(`${t} must be between ${n} and ${r}, inclusive`);return o},er=e=>null==e?0:1e3*(e=>(e=>{const t=Pn(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>Nn)throw new TypeError(`Expected 32-bit float, got ${e}`);return t})("string"==typeof e?Un(e):e))("0."+e),tr=e=>{const t=e[0];let n=1;if("+"==t)n=1;else{if("-"!=t)throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);n=-1}return n*(60*Number(e.substring(1,3))+Number(e.substring(4,6)))*60*1e3},nr=e=>{let t=0;for(;t<e.length-1&&"0"===e.charAt(t);)t++;return 0===t?e:e.slice(t)};class rr extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,rr.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}const or=(e,t={})=>{Object.entries(t).filter((([,e])=>void 0!==e)).forEach((([t,n])=>{null!=e[t]&&""!==e[t]||(e[t]=n)}));const n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e},ir=e=>({output:t,parsedBody:n,errorCode:r})=>{(({output:e,parsedBody:t,exceptionCtor:n,errorCode:r})=>{const o=ar(e),i=o.httpStatusCode?o.httpStatusCode+"":void 0,a=new n({name:t?.code||t?.Code||r||i||"UnknownError",$fault:"client",$metadata:o});throw or(a,t)})({output:t,parsedBody:n,exceptionCtor:e,errorCode:r})},ar=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),sr=e=>{switch(e){case"standard":case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}};let cr=!1;const dr=e=>{e&&!cr&&parseInt(e.substring(1,e.indexOf(".")))<14&&(cr=!0)};function lr(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}const ur=e=>{const t="#text";for(const n in e)e.hasOwnProperty(n)&&void 0!==e[n][t]?e[n]=e[n][t]:"object"==typeof e[n]&&null!==e[n]&&(e[n]=ur(e[n]));return e},pr=function(){const e=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(t,e.prototype),t};function mr(e,t,n){let r,o,i;if(void 0===t&&void 0===n)r={},i=e;else{if(r=e,"function"==typeof t)return o=t,i=n,yr(r,o,i);i=t}for(const e of Object.keys(i))Array.isArray(i[e])?fr(r,null,i,e):r[e]=i[e];return r}pr.prototype=Object.create(String.prototype,{constructor:{value:pr,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(pr,String);const hr=(e,t)=>{const n={};for(const r in t)fr(n,e,t,r);return n},yr=(e,t,n)=>mr(e,Object.entries(n).reduce(((e,[n,r])=>(Array.isArray(r)?e[n]=r:e[n]="function"==typeof r?[t,r()]:[t,r],e)),{})),fr=(e,t,n,r)=>{if(null!==t){let o=n[r];"function"==typeof o&&(o=[,o]);const[i=gr,a=wr,s=r]=o;return void(("function"==typeof i&&i(t[s])||"function"!=typeof i&&i)&&(e[r]=a(t[s])))}let[o,i]=n[r];if("function"==typeof i){let t;const n=void 0===o&&null!=(t=i()),a="function"==typeof o&&!!o(void 0)||"function"!=typeof o&&!!o;n?e[r]=t:a&&(e[r]=i())}else{const t=void 0===o&&null!=i,n="function"==typeof o&&!!o(i)||"function"!=typeof o&&!!o;(t||n)&&(e[r]=i)}},gr=e=>null!=e,wr=e=>e,Er=e=>{if(e!=e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}},br=e=>{if(null==e)return{};if(Array.isArray(e))return e.filter((e=>null!=e));if("object"==typeof e){const t={};for(const n of Object.keys(e))null!=e[n]&&(t[n]=br(e[n]));return t}return e};var vr;!function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"}(vr||(vr={}));class Sr{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/"}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){const e=new Sr({...this,headers:{...this.headers}});var t;return e.query&&(e.query=(t=e.query,Object.keys(t).reduce(((e,n)=>{const r=t[n];return{...e,[n]:Array.isArray(r)?[...r]:r}}),{}))),e}}class _r extends rr{constructor(e){super(e),Object.setPrototypeOf(this,_r.prototype)}}const Ir={ADD:"ADD",DELETE:"DELETE",PUT:"PUT"},xr={B:"B",N:"N",S:"S"},Cr={AVAILABLE:"AVAILABLE",CREATING:"CREATING",DELETED:"DELETED"},Tr={AWS_BACKUP:"AWS_BACKUP",SYSTEM:"SYSTEM",USER:"USER"},Pr={PAY_PER_REQUEST:"PAY_PER_REQUEST",PROVISIONED:"PROVISIONED"},Nr={HASH:"HASH",RANGE:"RANGE"},Ar={ALL:"ALL",INCLUDE:"INCLUDE",KEYS_ONLY:"KEYS_ONLY"},kr={AES256:"AES256",KMS:"KMS"},Dr={DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLED:"ENABLED",ENABLING:"ENABLING",UPDATING:"UPDATING"},Rr={KEYS_ONLY:"KEYS_ONLY",NEW_AND_OLD_IMAGES:"NEW_AND_OLD_IMAGES",NEW_IMAGE:"NEW_IMAGE",OLD_IMAGE:"OLD_IMAGE"},Or={DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLED:"ENABLED",ENABLING:"ENABLING"};class Lr extends _r{constructor(e){super({name:"BackupInUseException",$fault:"client",...e}),this.name="BackupInUseException",this.$fault="client",Object.setPrototypeOf(this,Lr.prototype)}}class Fr extends _r{constructor(e){super({name:"BackupNotFoundException",$fault:"client",...e}),this.name="BackupNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Fr.prototype)}}const zr={ALL:"ALL",AWS_BACKUP:"AWS_BACKUP",SYSTEM:"SYSTEM",USER:"USER"},Br={INDEXES:"INDEXES",NONE:"NONE",TOTAL:"TOTAL"},Ur={AccessDenied:"AccessDenied",ConditionalCheckFailed:"ConditionalCheckFailed",DuplicateItem:"DuplicateItem",InternalServerError:"InternalServerError",ItemCollectionSizeLimitExceeded:"ItemCollectionSizeLimitExceeded",ProvisionedThroughputExceeded:"ProvisionedThroughputExceeded",RequestLimitExceeded:"RequestLimitExceeded",ResourceNotFound:"ResourceNotFound",ThrottlingError:"ThrottlingError",TransactionConflict:"TransactionConflict",ValidationError:"ValidationError"};class $r extends _r{constructor(e){super({name:"InternalServerError",$fault:"server",...e}),this.name="InternalServerError",this.$fault="server",Object.setPrototypeOf(this,$r.prototype)}}class Mr extends _r{constructor(e){super({name:"RequestLimitExceeded",$fault:"client",...e}),this.name="RequestLimitExceeded",this.$fault="client",Object.setPrototypeOf(this,Mr.prototype)}}class jr extends _r{constructor(e){super({name:"InvalidEndpointException",$fault:"client",...e}),this.name="InvalidEndpointException",this.$fault="client",Object.setPrototypeOf(this,jr.prototype),this.Message=e.Message}}class qr extends _r{constructor(e){super({name:"ProvisionedThroughputExceededException",$fault:"client",...e}),this.name="ProvisionedThroughputExceededException",this.$fault="client",Object.setPrototypeOf(this,qr.prototype)}}class Vr extends _r{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Vr.prototype)}}const Gr={NONE:"NONE",SIZE:"SIZE"};class Hr extends _r{constructor(e){super({name:"ItemCollectionSizeLimitExceededException",$fault:"client",...e}),this.name="ItemCollectionSizeLimitExceededException",this.$fault="client",Object.setPrototypeOf(this,Hr.prototype)}}const Kr={BEGINS_WITH:"BEGINS_WITH",BETWEEN:"BETWEEN",CONTAINS:"CONTAINS",EQ:"EQ",GE:"GE",GT:"GT",IN:"IN",LE:"LE",LT:"LT",NE:"NE",NOT_CONTAINS:"NOT_CONTAINS",NOT_NULL:"NOT_NULL",NULL:"NULL"};class Wr extends _r{constructor(e){super({name:"ConditionalCheckFailedException",$fault:"client",...e}),this.name="ConditionalCheckFailedException",this.$fault="client",Object.setPrototypeOf(this,Wr.prototype)}}const Jr={AND:"AND",OR:"OR"},Qr={ALL_OLD:"ALL_OLD",NONE:"NONE"},Xr={DISABLED:"DISABLED",ENABLED:"ENABLED"},Yr={DISABLED:"DISABLED",ENABLED:"ENABLED"};class Zr extends _r{constructor(e){super({name:"ContinuousBackupsUnavailableException",$fault:"client",...e}),this.name="ContinuousBackupsUnavailableException",this.$fault="client",Object.setPrototypeOf(this,Zr.prototype)}}const eo={DISABLE:"DISABLE",ENABLE:"ENABLE"},to={DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLED:"ENABLED",ENABLING:"ENABLING",FAILED:"FAILED"};class no extends _r{constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),this.name="LimitExceededException",this.$fault="client",Object.setPrototypeOf(this,no.prototype)}}class ro extends _r{constructor(e){super({name:"TableInUseException",$fault:"client",...e}),this.name="TableInUseException",this.$fault="client",Object.setPrototypeOf(this,ro.prototype)}}class oo extends _r{constructor(e){super({name:"TableNotFoundException",$fault:"client",...e}),this.name="TableNotFoundException",this.$fault="client",Object.setPrototypeOf(this,oo.prototype)}}const io={ACTIVE:"ACTIVE",CREATING:"CREATING",DELETING:"DELETING",UPDATING:"UPDATING"},ao={ACTIVE:"ACTIVE",CREATING:"CREATING",CREATION_FAILED:"CREATION_FAILED",DELETING:"DELETING",INACCESSIBLE_ENCRYPTION_CREDENTIALS:"INACCESSIBLE_ENCRYPTION_CREDENTIALS",REGION_DISABLED:"REGION_DISABLED",UPDATING:"UPDATING"},so={STANDARD:"STANDARD",STANDARD_INFREQUENT_ACCESS:"STANDARD_INFREQUENT_ACCESS"};class co extends _r{constructor(e){super({name:"GlobalTableAlreadyExistsException",$fault:"client",...e}),this.name="GlobalTableAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,co.prototype)}}const lo={ACTIVE:"ACTIVE",CREATING:"CREATING",DELETING:"DELETING",UPDATING:"UPDATING"},uo={ACTIVE:"ACTIVE",ARCHIVED:"ARCHIVED",ARCHIVING:"ARCHIVING",CREATING:"CREATING",DELETING:"DELETING",INACCESSIBLE_ENCRYPTION_CREDENTIALS:"INACCESSIBLE_ENCRYPTION_CREDENTIALS",UPDATING:"UPDATING"};class po extends _r{constructor(e){super({name:"ResourceInUseException",$fault:"client",...e}),this.name="ResourceInUseException",this.$fault="client",Object.setPrototypeOf(this,po.prototype)}}const mo={ALL_NEW:"ALL_NEW",ALL_OLD:"ALL_OLD",NONE:"NONE",UPDATED_NEW:"UPDATED_NEW",UPDATED_OLD:"UPDATED_OLD"};class ho extends _r{constructor(e){super({name:"TransactionConflictException",$fault:"client",...e}),this.name="TransactionConflictException",this.$fault="client",Object.setPrototypeOf(this,ho.prototype)}}const yo={DYNAMODB_JSON:"DYNAMODB_JSON",ION:"ION"},fo={COMPLETED:"COMPLETED",FAILED:"FAILED",IN_PROGRESS:"IN_PROGRESS"},go={AES256:"AES256",KMS:"KMS"};class wo extends _r{constructor(e){super({name:"ExportNotFoundException",$fault:"client",...e}),this.name="ExportNotFoundException",this.$fault="client",Object.setPrototypeOf(this,wo.prototype)}}class Eo extends _r{constructor(e){super({name:"GlobalTableNotFoundException",$fault:"client",...e}),this.name="GlobalTableNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Eo.prototype)}}const bo={CANCELLED:"CANCELLED",CANCELLING:"CANCELLING",COMPLETED:"COMPLETED",FAILED:"FAILED",IN_PROGRESS:"IN_PROGRESS"},vo={GZIP:"GZIP",NONE:"NONE",ZSTD:"ZSTD"},So={CSV:"CSV",DYNAMODB_JSON:"DYNAMODB_JSON",ION:"ION"};class _o extends _r{constructor(e){super({name:"ImportNotFoundException",$fault:"client",...e}),this.name="ImportNotFoundException",this.$fault="client",Object.setPrototypeOf(this,_o.prototype)}}const Io={ACTIVE:"ACTIVE",DISABLED:"DISABLED",DISABLING:"DISABLING",ENABLE_FAILED:"ENABLE_FAILED",ENABLING:"ENABLING"};class xo extends _r{constructor(e){super({name:"DuplicateItemException",$fault:"client",...e}),this.name="DuplicateItemException",this.$fault="client",Object.setPrototypeOf(this,xo.prototype)}}class Co extends _r{constructor(e){super({name:"IdempotentParameterMismatchException",$fault:"client",...e}),this.name="IdempotentParameterMismatchException",this.$fault="client",Object.setPrototypeOf(this,Co.prototype),this.Message=e.Message}}class To extends _r{constructor(e){super({name:"TransactionInProgressException",$fault:"client",...e}),this.name="TransactionInProgressException",this.$fault="client",Object.setPrototypeOf(this,To.prototype),this.Message=e.Message}}class Po extends _r{constructor(e){super({name:"ExportConflictException",$fault:"client",...e}),this.name="ExportConflictException",this.$fault="client",Object.setPrototypeOf(this,Po.prototype)}}class No extends _r{constructor(e){super({name:"InvalidExportTimeException",$fault:"client",...e}),this.name="InvalidExportTimeException",this.$fault="client",Object.setPrototypeOf(this,No.prototype)}}class Ao extends _r{constructor(e){super({name:"PointInTimeRecoveryUnavailableException",$fault:"client",...e}),this.name="PointInTimeRecoveryUnavailableException",this.$fault="client",Object.setPrototypeOf(this,Ao.prototype)}}class ko extends _r{constructor(e){super({name:"ImportConflictException",$fault:"client",...e}),this.name="ImportConflictException",this.$fault="client",Object.setPrototypeOf(this,ko.prototype)}}const Do={ALL_ATTRIBUTES:"ALL_ATTRIBUTES",ALL_PROJECTED_ATTRIBUTES:"ALL_PROJECTED_ATTRIBUTES",COUNT:"COUNT",SPECIFIC_ATTRIBUTES:"SPECIFIC_ATTRIBUTES"};class Ro extends _r{constructor(e){super({name:"TableAlreadyExistsException",$fault:"client",...e}),this.name="TableAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,Ro.prototype)}}class Oo extends _r{constructor(e){super({name:"InvalidRestoreTimeException",$fault:"client",...e}),this.name="InvalidRestoreTimeException",this.$fault="client",Object.setPrototypeOf(this,Oo.prototype)}}class Lo extends _r{constructor(e){super({name:"ReplicaAlreadyExistsException",$fault:"client",...e}),this.name="ReplicaAlreadyExistsException",this.$fault="client",Object.setPrototypeOf(this,Lo.prototype)}}class Fo extends _r{constructor(e){super({name:"ReplicaNotFoundException",$fault:"client",...e}),this.name="ReplicaNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Fo.prototype)}}class zo extends _r{constructor(e){super({name:"IndexNotFoundException",$fault:"client",...e}),this.name="IndexNotFoundException",this.$fault="client",Object.setPrototypeOf(this,zo.prototype)}}var Bo;!function(e){e.visit=(e,t)=>void 0!==e.S?t.S(e.S):void 0!==e.N?t.N(e.N):void 0!==e.B?t.B(e.B):void 0!==e.SS?t.SS(e.SS):void 0!==e.NS?t.NS(e.NS):void 0!==e.BS?t.BS(e.BS):void 0!==e.M?t.M(e.M):void 0!==e.L?t.L(e.L):void 0!==e.NULL?t.NULL(e.NULL):void 0!==e.BOOL?t.BOOL(e.BOOL):t._(e.$unknown[0],e.$unknown[1])}(Bo||(Bo={}));class Uo extends _r{constructor(e){super({name:"TransactionCanceledException",$fault:"client",...e}),this.name="TransactionCanceledException",this.$fault="client",Object.setPrototypeOf(this,Uo.prototype),this.Message=e.Message,this.CancellationReasons=e.CancellationReasons}}const $o=async(e,t)=>{const n=e.body,r=br(n),o=new Lr({$metadata:Ba(e),...r});return or(o,n)},Mo=async(e,t)=>{const n=e.body,r=br(n),o=new Fr({$metadata:Ba(e),...r});return or(o,n)},jo=async(e,t)=>{const n=e.body,r=br(n),o=new Wr({$metadata:Ba(e),...r});return or(o,n)},qo=async(e,t)=>{const n=e.body,r=br(n),o=new Zr({$metadata:Ba(e),...r});return or(o,n)},Vo=async(e,t)=>{const n=e.body,r=br(n),o=new xo({$metadata:Ba(e),...r});return or(o,n)},Go=async(e,t)=>{const n=e.body,r=br(n),o=new Po({$metadata:Ba(e),...r});return or(o,n)},Ho=async(e,t)=>{const n=e.body,r=br(n),o=new wo({$metadata:Ba(e),...r});return or(o,n)},Ko=async(e,t)=>{const n=e.body,r=br(n),o=new co({$metadata:Ba(e),...r});return or(o,n)},Wo=async(e,t)=>{const n=e.body,r=br(n),o=new Eo({$metadata:Ba(e),...r});return or(o,n)},Jo=async(e,t)=>{const n=e.body,r=br(n),o=new Co({$metadata:Ba(e),...r});return or(o,n)},Qo=async(e,t)=>{const n=e.body,r=br(n),o=new ko({$metadata:Ba(e),...r});return or(o,n)},Xo=async(e,t)=>{const n=e.body,r=br(n),o=new _o({$metadata:Ba(e),...r});return or(o,n)},Yo=async(e,t)=>{const n=e.body,r=br(n),o=new zo({$metadata:Ba(e),...r});return or(o,n)},Zo=async(e,t)=>{const n=e.body,r=br(n),o=new $r({$metadata:Ba(e),...r});return or(o,n)},ei=async(e,t)=>{const n=e.body,r=br(n),o=new jr({$metadata:Ba(e),...r});return or(o,n)},ti=async(e,t)=>{const n=e.body,r=br(n),o=new No({$metadata:Ba(e),...r});return or(o,n)},ni=async(e,t)=>{const n=e.body,r=br(n),o=new Oo({$metadata:Ba(e),...r});return or(o,n)},ri=async(e,t)=>{const n=e.body,r=br(n),o=new Hr({$metadata:Ba(e),...r});return or(o,n)},oi=async(e,t)=>{const n=e.body,r=br(n),o=new no({$metadata:Ba(e),...r});return or(o,n)},ii=async(e,t)=>{const n=e.body,r=br(n),o=new Ao({$metadata:Ba(e),...r});return or(o,n)},ai=async(e,t)=>{const n=e.body,r=br(n),o=new qr({$metadata:Ba(e),...r});return or(o,n)},si=async(e,t)=>{const n=e.body,r=br(n),o=new Lo({$metadata:Ba(e),...r});return or(o,n)},ci=async(e,t)=>{const n=e.body,r=br(n),o=new Fo({$metadata:Ba(e),...r});return or(o,n)},di=async(e,t)=>{const n=e.body,r=br(n),o=new Mr({$metadata:Ba(e),...r});return or(o,n)},li=async(e,t)=>{const n=e.body,r=br(n),o=new po({$metadata:Ba(e),...r});return or(o,n)},ui=async(e,t)=>{const n=e.body,r=br(n),o=new Vr({$metadata:Ba(e),...r});return or(o,n)},pi=async(e,t)=>{const n=e.body,r=br(n),o=new Ro({$metadata:Ba(e),...r});return or(o,n)},mi=async(e,t)=>{const n=e.body,r=br(n),o=new ro({$metadata:Ba(e),...r});return or(o,n)},hi=async(e,t)=>{const n=e.body,r=br(n),o=new oo({$metadata:Ba(e),...r});return or(o,n)},yi=async(e,t)=>{const n=e.body,r=La(n,t),o=new Uo({$metadata:Ba(e),...r});return or(o,n)},fi=async(e,t)=>{const n=e.body,r=br(n),o=new ho({$metadata:Ba(e),...r});return or(o,n)},gi=async(e,t)=>{const n=e.body,r=br(n),o=new To({$metadata:Ba(e),...r});return or(o,n)},wi=(e,t)=>Bo.visit(e,{B:e=>({B:t.base64Encoder(e)}),BOOL:e=>({BOOL:e}),BS:e=>({BS:Ii(e,t)}),L:e=>({L:Di(e,t)}),M:e=>({M:Ri(e,t)}),N:e=>({N:e}),NS:e=>({NS:br(e)}),NULL:e=>({NULL:e}),S:e=>({S:e}),SS:e=>({SS:br(e)}),_:(e,t)=>({name:t})}),Ei=(e,t)=>e.filter((e=>null!=e)).map((e=>wi(e,t))),bi=(e,t)=>hr(e,{AutoScalingDisabled:[],AutoScalingRoleArn:[],MaximumUnits:[],MinimumUnits:[],ScalingPolicyUpdate:e=>((e,t)=>hr(e,{PolicyName:[],TargetTrackingScalingPolicyConfiguration:e=>vi(e,t)}))(e,t)}),vi=(e,t)=>hr(e,{DisableScaleIn:[],ScaleInCooldown:[],ScaleOutCooldown:[],TargetValue:Er}),Si=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=ki(r,t)),e)),{}),_i=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Hi(r,t)),e)),{}),Ii=(e,t)=>e.filter((e=>null!=e)).map((e=>t.base64Encoder(e))),xi=(e,t)=>hr(e,{AttributeValueList:e=>Ei(e,t),ComparisonOperator:[]}),Ci=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Ti(r,t)),e)),{}),Ti=(e,t)=>hr(e,{AttributeValueList:e=>Ei(e,t),ComparisonOperator:[],Exists:[],Value:e=>wi(e,t)}),Pi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=wi(r,t)),e)),{}),Ni=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=xi(r,t)),e)),{}),Ai=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=wi(r,t)),e)),{}),ki=(e,t)=>hr(e,{AttributesToGet:br,ConsistentRead:[],ExpressionAttributeNames:br,Keys:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>Ai(e,t))))(e,t),ProjectionExpression:[]}),Di=(e,t)=>e.filter((e=>null!=e)).map((e=>wi(e,t))),Ri=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=wi(r,t)),e)),{}),Oi=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Parameters:e=>Fi(e,t),Statement:[]}))(e,t))),Li=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{ConsistentRead:[],Parameters:e=>Fi(e,t),Statement:[]}))(e,t))),Fi=(e,t)=>e.filter((e=>null!=e)).map((e=>wi(e,t))),zi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=wi(r,t)),e)),{}),Bi=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:[],ProvisionedReadCapacityAutoScalingUpdate:e=>bi(e,t)}))(e,t))),Ui=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{RegionName:[],ReplicaGlobalSecondaryIndexSettingsUpdate:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:[],ProvisionedReadCapacityAutoScalingSettingsUpdate:e=>bi(e,t),ProvisionedReadCapacityUnits:[]}))(e,t))))(e,t),ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate:e=>bi(e,t),ReplicaProvisionedReadCapacityUnits:[],ReplicaTableClass:[]}))(e,t))),$i=(e,t)=>hr(e,{ReturnConsumedCapacity:[],TransactItems:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Get:e=>((e,t)=>hr(e,{ExpressionAttributeNames:br,Key:e=>Ai(e,t),ProjectionExpression:[],TableName:[]}))(e,t)}))(e,t))))(e,t)}),Mi=(e,t)=>hr(e,{ClientRequestToken:[!0,e=>e??be()],ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],TransactItems:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{ConditionCheck:e=>((e,t)=>hr(e,{ConditionExpression:[],ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Key:e=>Ai(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[]}))(e,t),Delete:e=>((e,t)=>hr(e,{ConditionExpression:[],ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Key:e=>Ai(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[]}))(e,t),Put:e=>((e,t)=>hr(e,{ConditionExpression:[],ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Item:e=>zi(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[]}))(e,t),Update:e=>ji(e,t)}))(e,t))))(e,t)}),ji=(e,t)=>hr(e,{ConditionExpression:[],ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Key:e=>Ai(e,t),ReturnValuesOnConditionCheckFailure:[],TableName:[],UpdateExpression:[]}),qi=(e,t)=>hr(e,{GlobalTableBillingMode:[],GlobalTableGlobalSecondaryIndexSettingsUpdate:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:[],ProvisionedWriteCapacityAutoScalingSettingsUpdate:e=>bi(e,t),ProvisionedWriteCapacityUnits:[]}))(e,t))))(e,t),GlobalTableName:[],GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate:e=>bi(e,t),GlobalTableProvisionedWriteCapacityUnits:[],ReplicaSettingsUpdate:e=>Ui(e,t)}),Vi=(e,t)=>hr(e,{AttributeUpdates:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=((e,t)=>hr(e,{Action:[],Value:e=>wi(e,t)}))(r,t)),e)),{}))(e,t),ConditionExpression:[],ConditionalOperator:[],Expected:e=>Ci(e,t),ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Key:e=>Ai(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],TableName:[],UpdateExpression:[]}),Gi=(e,t)=>hr(e,{GlobalSecondaryIndexUpdates:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:[],ProvisionedWriteCapacityAutoScalingUpdate:e=>bi(e,t)}))(e,t))))(e,t),ProvisionedWriteCapacityAutoScalingUpdate:e=>bi(e,t),ReplicaUpdates:e=>((e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{RegionName:[],ReplicaGlobalSecondaryIndexUpdates:e=>Bi(e,t),ReplicaProvisionedReadCapacityAutoScalingUpdate:e=>bi(e,t)}))(e,t))))(e,t),TableName:[]}),Hi=(e,t)=>e.filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{DeleteRequest:e=>((e,t)=>hr(e,{Key:e=>Ai(e,t)}))(e,t),PutRequest:e=>((e,t)=>hr(e,{Item:e=>zi(e,t)}))(e,t)}))(e,t))),Ki=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Wi(zn(r),t)),e)),{}),Wi=(e,t)=>null!=e.B?{B:t.base64Decoder(e.B)}:void 0!==Tn(e.BOOL)?{BOOL:Tn(e.BOOL)}:null!=e.BS?{BS:ra(e.BS,t)}:null!=e.L?{L:wa(e.L,t)}:null!=e.M?{M:va(e.M,t)}:void 0!==Fn(e.N)?{N:Fn(e.N)}:null!=e.NS?{NS:br(e.NS)}:void 0!==Tn(e.NULL)?{NULL:Tn(e.NULL)}:void 0!==Fn(e.S)?{S:Fn(e.S)}:null!=e.SS?{SS:br(e.SS)}:{$unknown:Object.entries(e)[0]},Ji=(e,t)=>hr(e,{AutoScalingDisabled:Tn,AutoScalingRoleArn:Fn,MaximumUnits:An,MinimumUnits:An,ScalingPolicies:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{PolicyName:Fn,TargetTrackingScalingPolicyConfiguration:e=>Qi(e,t)}))(e,t)));return n})(e,t)}),Qi=(e,t)=>hr(e,{DisableScaleIn:Tn,ScaleInCooldown:kn,ScaleOutCooldown:kn,TargetValue:$n}),Xi=(e,t)=>hr(e,{BackupDetails:e=>Yi(e,t),SourceTableDetails:e=>Na(e,t),SourceTableFeatureDetails:e=>Aa(e,t)}),Yi=(e,t)=>hr(e,{BackupArn:Fn,BackupCreationDateTime:e=>On(Wn(Pn(e))),BackupExpiryDateTime:e=>On(Wn(Pn(e))),BackupName:Fn,BackupSizeBytes:An,BackupStatus:Fn,BackupType:Fn}),Zi=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=ga(r,t)),e)),{}),ea=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=ha(r,t)),e)),{}),ta=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=za(r,t)),e)),{}),na=(e,t)=>hr(e,{BillingMode:Fn,LastUpdateToPayPerRequestDateTime:e=>On(Wn(Pn(e)))}),ra=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>t.base64Decoder(e)));return n},oa=(e,t)=>hr(e,{CapacityUnits:$n,ReadCapacityUnits:$n,WriteCapacityUnits:$n}),ia=(e,t)=>hr(e,{CapacityUnits:$n,GlobalSecondaryIndexes:e=>Pa(e,t),LocalSecondaryIndexes:e=>Pa(e,t),ReadCapacityUnits:$n,Table:e=>oa(e),TableName:Fn,WriteCapacityUnits:$n}),aa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>ia(e,t)));return n},sa=(e,t)=>hr(e,{ContinuousBackupsStatus:Fn,PointInTimeRecoveryDescription:e=>_a(e,t)}),ca=(e,t)=>hr(e,{BilledSizeBytes:An,ClientToken:Fn,EndTime:e=>On(Wn(Pn(e))),ExportArn:Fn,ExportFormat:Fn,ExportManifest:Fn,ExportStatus:Fn,ExportTime:e=>On(Wn(Pn(e))),FailureCode:Fn,FailureMessage:Fn,ItemCount:An,S3Bucket:Fn,S3BucketOwner:Fn,S3Prefix:Fn,S3SseAlgorithm:Fn,S3SseKmsKeyId:Fn,StartTime:e=>On(Wn(Pn(e))),TableArn:Fn,TableId:Fn}),da=(e,t)=>hr(e,{CreationDateTime:e=>On(Wn(Pn(e))),GlobalTableArn:Fn,GlobalTableName:Fn,GlobalTableStatus:Fn,ReplicationGroup:e=>xa(e,t)}),la=(e,t)=>hr(e,{ClientToken:Fn,CloudWatchLogGroupArn:Fn,EndTime:e=>On(Wn(Pn(e))),ErrorCount:An,FailureCode:Fn,FailureMessage:Fn,ImportArn:Fn,ImportStatus:Fn,ImportedItemCount:An,InputCompressionType:Fn,InputFormat:Fn,InputFormatOptions:br,ProcessedItemCount:An,ProcessedSizeBytes:An,S3BucketSource:br,StartTime:e=>On(Wn(Pn(e))),TableArn:Fn,TableCreationParameters:br,TableId:Fn}),ua=(e,t)=>hr(e,{ItemCollectionKey:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Wi(zn(r),t)),e)),{}))(e,t),SizeEstimateRangeGB:e=>ma(e,t)}),pa=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>ua(e,t)));return n})(r,t)),e)),{}),ma=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>$n(e)));return n},ha=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>Ki(e,t)));return n},ya=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Item:e=>Ki(e,t)}))(e,t)));return n},fa=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Wi(zn(r),t)),e)),{}),ga=(e,t)=>hr(e,{AttributesToGet:br,ConsistentRead:Tn,ExpressionAttributeNames:br,Keys:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>fa(e,t)));return n})(e,t),ProjectionExpression:Fn}),wa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>Wi(zn(e),t)));return n},Ea=(e,t)=>hr(e,{BackupSummaries:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{BackupArn:Fn,BackupCreationDateTime:e=>On(Wn(Pn(e))),BackupExpiryDateTime:e=>On(Wn(Pn(e))),BackupName:Fn,BackupSizeBytes:An,BackupStatus:Fn,BackupType:Fn,TableArn:Fn,TableId:Fn,TableName:Fn}))(e)));return n})(e),LastEvaluatedBackupArn:Fn}),ba=(e,t)=>hr(e,{ImportSummaryList:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{CloudWatchLogGroupArn:Fn,EndTime:e=>On(Wn(Pn(e))),ImportArn:Fn,ImportStatus:Fn,InputFormat:Fn,S3BucketSource:br,StartTime:e=>On(Wn(Pn(e))),TableArn:Fn}))(e)));return n})(e),NextToken:Fn}),va=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Wi(zn(r),t)),e)),{}),Sa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Error:br,Item:e=>Ki(e,t),TableName:Fn}))(e,t)));return n},_a=(e,t)=>hr(e,{EarliestRestorableDateTime:e=>On(Wn(Pn(e))),LatestRestorableDateTime:e=>On(Wn(Pn(e))),PointInTimeRecoveryStatus:Fn}),Ia=(e,t)=>hr(e,{LastDecreaseDateTime:e=>On(Wn(Pn(e))),LastIncreaseDateTime:e=>On(Wn(Pn(e))),NumberOfDecreasesToday:An,ReadCapacityUnits:An,WriteCapacityUnits:An}),xa=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{GlobalSecondaryIndexes:br,KMSMasterKeyId:Fn,ProvisionedThroughputOverride:br,RegionName:Fn,ReplicaInaccessibleDateTime:e=>On(Wn(Pn(e))),ReplicaStatus:Fn,ReplicaStatusDescription:Fn,ReplicaStatusPercentProgress:Fn,ReplicaTableClassSummary:e=>Ra(e,t)}))(e,t)));return n},Ca=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:Fn,IndexStatus:Fn,ProvisionedReadCapacityAutoScalingSettings:e=>Ji(e,t),ProvisionedWriteCapacityAutoScalingSettings:e=>Ji(e,t)}))(e,t)));return n},Ta=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{RegionName:Fn,ReplicaBillingModeSummary:e=>na(e),ReplicaGlobalSecondaryIndexSettings:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{IndexName:Fn,IndexStatus:Fn,ProvisionedReadCapacityAutoScalingSettings:e=>Ji(e,t),ProvisionedReadCapacityUnits:An,ProvisionedWriteCapacityAutoScalingSettings:e=>Ji(e,t),ProvisionedWriteCapacityUnits:An}))(e,t)));return n})(e,t),ReplicaProvisionedReadCapacityAutoScalingSettings:e=>Ji(e,t),ReplicaProvisionedReadCapacityUnits:An,ReplicaProvisionedWriteCapacityAutoScalingSettings:e=>Ji(e,t),ReplicaProvisionedWriteCapacityUnits:An,ReplicaStatus:Fn,ReplicaTableClassSummary:e=>Ra(e,t)}))(e,t)));return n},Pa=(e,t)=>Object.entries(e).reduce(((e,[t,n])=>(null===n||(e[t]=oa(n)),e)),{}),Na=(e,t)=>hr(e,{BillingMode:Fn,ItemCount:An,KeySchema:br,ProvisionedThroughput:br,TableArn:Fn,TableCreationDateTime:e=>On(Wn(Pn(e))),TableId:Fn,TableName:Fn,TableSizeBytes:An}),Aa=(e,t)=>hr(e,{GlobalSecondaryIndexes:br,LocalSecondaryIndexes:br,SSEDescription:e=>ka(e,t),StreamDescription:br,TimeToLiveDescription:br}),ka=(e,t)=>hr(e,{InaccessibleEncryptionDateTime:e=>On(Wn(Pn(e))),KMSMasterKeyArn:Fn,SSEType:Fn,Status:Fn}),Da=(e,t)=>hr(e,{Replicas:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{GlobalSecondaryIndexes:e=>Ca(e,t),RegionName:Fn,ReplicaProvisionedReadCapacityAutoScalingSettings:e=>Ji(e,t),ReplicaProvisionedWriteCapacityAutoScalingSettings:e=>Ji(e,t),ReplicaStatus:Fn}))(e,t)));return n})(e,t),TableName:Fn,TableStatus:Fn}),Ra=(e,t)=>hr(e,{LastUpdateDateTime:e=>On(Wn(Pn(e))),TableClass:Fn}),Oa=(e,t)=>hr(e,{ArchivalSummary:e=>((e,t)=>hr(e,{ArchivalBackupArn:Fn,ArchivalDateTime:e=>On(Wn(Pn(e))),ArchivalReason:Fn}))(e),AttributeDefinitions:br,BillingModeSummary:e=>na(e),CreationDateTime:e=>On(Wn(Pn(e))),DeletionProtectionEnabled:Tn,GlobalSecondaryIndexes:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Backfilling:Tn,IndexArn:Fn,IndexName:Fn,IndexSizeBytes:An,IndexStatus:Fn,ItemCount:An,KeySchema:br,Projection:br,ProvisionedThroughput:e=>Ia(e,t)}))(e,t)));return n})(e,t),GlobalTableVersion:Fn,ItemCount:An,KeySchema:br,LatestStreamArn:Fn,LatestStreamLabel:Fn,LocalSecondaryIndexes:br,ProvisionedThroughput:e=>Ia(e,t),Replicas:e=>xa(e,t),RestoreSummary:e=>((e,t)=>hr(e,{RestoreDateTime:e=>On(Wn(Pn(e))),RestoreInProgress:Tn,SourceBackupArn:Fn,SourceTableArn:Fn}))(e),SSEDescription:e=>ka(e,t),StreamSpecification:br,TableArn:Fn,TableClassSummary:e=>Ra(e,t),TableId:Fn,TableName:Fn,TableSizeBytes:An,TableStatus:Fn}),La=(e,t)=>hr(e,{CancellationReasons:e=>((e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>((e,t)=>hr(e,{Code:Fn,Item:e=>Ki(e,t),Message:Fn}))(e,t)));return n})(e,t),Message:Fn}),Fa=(e,t)=>hr(e,{DeleteRequest:e=>((e,t)=>hr(e,{Key:e=>fa(e,t)}))(e,t),PutRequest:e=>((e,t)=>hr(e,{Item:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=Wi(zn(r),t)),e)),{}))(e,t)}))(e,t)}),za=(e,t)=>{const n=(e||[]).filter((e=>null!=e)).map((e=>Fa(e,t)));return n},Ba=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Ua=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),$a=ir(_r),Ma=async(e,t,n,r,o)=>{const{hostname:i,protocol:a="https",port:s,path:c}=await e.endpoint(),d={protocol:a,hostname:i,port:s,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+n:c+n,headers:t};return void 0!==r&&(d.hostname=r),void 0!==o&&(d.body=o),new Sr(d)};function ja(e){return{"content-type":"application/x-amz-json-1.0","x-amz-target":`DynamoDB_20120810.${e}`}}const qa=(e,t)=>((e,t)=>Ua(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),Va=async(e,t)=>{const n=await qa(e,t);return n.message=n.message??n.Message,n},Ga=(e,t)=>{const n=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(o=e.headers,"x-amzn-errortype",Object.keys(o).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var o;return void 0!==r?n(e.headers[r]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0};class Ha extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ha.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeEndpointsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeEndpoints");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body),o=n.body;return $a({output:e,parsedBody:o,errorCode:r})})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Ka extends rr{constructor(e){super(e),Object.setPrototypeOf(this,Ka.prototype)}}class Wa extends Ka{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,Wa.prototype)}}class Ja extends Ka{constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,Ja.prototype)}}class Qa extends Ka{constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,Qa.prototype)}}class Xa extends Ka{constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,Xa.prototype)}}class Ya extends Ka{constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,Ya.prototype)}}class Za extends Ka{constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,Za.prototype)}}class es extends Ka{constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,es.prototype)}}const ts=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:Cn}}),ns=e=>({...e,...e.Credentials&&{Credentials:ts(e.Credentials)}}),rs=e=>({...e,...e.WebIdentityToken&&{WebIdentityToken:Cn}}),os=e=>({...e,...e.Credentials&&{Credentials:ts(e.Credentials)}});var is=r(6932);const as=async(e,t)=>{const n=e.body,r=Ss(n.Error,t),o=new Wa({$metadata:Ns(e),...r});return or(o,n)},ss=async(e,t)=>{const n=e.body,r=_s(n.Error,t),o=new es({$metadata:Ns(e),...r});return or(o,n)},cs=async(e,t)=>{const n=e.body,r=Is(n.Error,t),o=new Ya({$metadata:Ns(e),...r});return or(o,n)},ds=async(e,t)=>{const n=e.body,r=xs(n.Error,t),o=new Za({$metadata:Ns(e),...r});return or(o,n)},ls=async(e,t)=>{const n=e.body,r=Cs(n.Error,t),o=new Ja({$metadata:Ns(e),...r});return or(o,n)},us=async(e,t)=>{const n=e.body,r=Ts(n.Error,t),o=new Qa({$metadata:Ns(e),...r});return or(o,n)},ps=async(e,t)=>{const n=e.body,r=Ps(n.Error,t),o=new Xa({$metadata:Ns(e),...r});return or(o,n)},ms=(e,t)=>{const n={};if(null!=e.RoleArn&&(n.RoleArn=e.RoleArn),null!=e.RoleSessionName&&(n.RoleSessionName=e.RoleSessionName),null!=e.PolicyArns){const r=ys(e.PolicyArns,t);0===e.PolicyArns?.length&&(n.PolicyArns=[]),Object.entries(r).forEach((([e,t])=>{n[`PolicyArns.${e}`]=t}))}if(null!=e.Policy&&(n.Policy=e.Policy),null!=e.DurationSeconds&&(n.DurationSeconds=e.DurationSeconds),null!=e.Tags){const r=Es(e.Tags,t);0===e.Tags?.length&&(n.Tags=[]),Object.entries(r).forEach((([e,t])=>{n[`Tags.${e}`]=t}))}if(null!=e.TransitiveTagKeys){const r=ws(e.TransitiveTagKeys,t);0===e.TransitiveTagKeys?.length&&(n.TransitiveTagKeys=[]),Object.entries(r).forEach((([e,t])=>{n[`TransitiveTagKeys.${e}`]=t}))}return null!=e.ExternalId&&(n.ExternalId=e.ExternalId),null!=e.SerialNumber&&(n.SerialNumber=e.SerialNumber),null!=e.TokenCode&&(n.TokenCode=e.TokenCode),null!=e.SourceIdentity&&(n.SourceIdentity=e.SourceIdentity),n},hs=(e,t)=>{const n={};if(null!=e.RoleArn&&(n.RoleArn=e.RoleArn),null!=e.RoleSessionName&&(n.RoleSessionName=e.RoleSessionName),null!=e.WebIdentityToken&&(n.WebIdentityToken=e.WebIdentityToken),null!=e.ProviderId&&(n.ProviderId=e.ProviderId),null!=e.PolicyArns){const r=ys(e.PolicyArns,t);0===e.PolicyArns?.length&&(n.PolicyArns=[]),Object.entries(r).forEach((([e,t])=>{n[`PolicyArns.${e}`]=t}))}return null!=e.Policy&&(n.Policy=e.Policy),null!=e.DurationSeconds&&(n.DurationSeconds=e.DurationSeconds),n},ys=(e,t)=>{const n={};let r=1;for(const o of e){if(null===o)continue;const e=fs(o,t);Object.entries(e).forEach((([e,t])=>{n[`member.${r}.${e}`]=t})),r++}return n},fs=(e,t)=>{const n={};return null!=e.arn&&(n.arn=e.arn),n},gs=(e,t)=>{const n={};return null!=e.Key&&(n.Key=e.Key),null!=e.Value&&(n.Value=e.Value),n},ws=(e,t)=>{const n={};let r=1;for(const t of e)null!==t&&(n[`member.${r}`]=t,r++);return n},Es=(e,t)=>{const n={};let r=1;for(const t of e){if(null===t)continue;const e=gs(t);Object.entries(e).forEach((([e,t])=>{n[`member.${r}.${e}`]=t})),r++}return n},bs=(e,t)=>{const n={};return void 0!==e.AssumedRoleId&&(n.AssumedRoleId=Fn(e.AssumedRoleId)),void 0!==e.Arn&&(n.Arn=Fn(e.Arn)),n},vs=(e,t)=>{const n={};return void 0!==e.AccessKeyId&&(n.AccessKeyId=Fn(e.AccessKeyId)),void 0!==e.SecretAccessKey&&(n.SecretAccessKey=Fn(e.SecretAccessKey)),void 0!==e.SessionToken&&(n.SessionToken=Fn(e.SessionToken)),void 0!==e.Expiration&&(n.Expiration=On(Kn(e.Expiration))),n},Ss=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},_s=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},Is=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},xs=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},Cs=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},Ts=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},Ps=(e,t)=>{const n={};return void 0!==e.message&&(n.message=Fn(e.message)),n},Ns=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),As=ir(Ka),ks=async(e,t,n,r,o)=>{const{hostname:i,protocol:a="https",port:s,path:c}=await e.endpoint(),d={protocol:a,hostname:i,port:s,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+n:c+n,headers:t};return void 0!==r&&(d.hostname=r),void 0!==o&&(d.body=o),new Sr(d)},Ds={"content-type":"application/x-www-form-urlencoded"},Rs=(e,t)=>((e,t)=>((e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array))(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>{if(e.length){const t=new is.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>""===t.trim()&&t.includes("\n")?"":void 0});t.addEntity("#xD","\r"),t.addEntity("#10","\n");const n=t.parse(e),r="#text",o=Object.keys(n)[0],i=n[o];return i[r]&&(i[o]=i[r],delete i[r]),ur(i)}return{}})),Os=async(e,t)=>{const n=await Rs(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n},Ls=e=>Object.entries(e).map((([e,t])=>lr(e)+"="+lr(t))).join("&"),Fs=(e,t)=>void 0!==t.Error?.Code?t.Error.Code:404==e.statusCode?"NotFound":void 0;class zs extends xn{static getEndpointParameterInstructions(){return{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"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,zs.getEndpointParameterInstructions())),this.middlewareStack.use(St(t));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"STSClient",commandName:"AssumeRoleCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:ns},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=Ds;let r;return r=Ls({...ms(e,t),Action:"AssumeRole",Version:"2011-06-15"}),ks(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Os(e.body,t)},r=Fs(e,n.body);switch(r){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await as(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await ls(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await us(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await ps(n,t);default:const o=n.body;return As({output:e,parsedBody:o.Error,errorCode:r})}})(e,t);let n={};return n=((e,t)=>{const n={};return void 0!==e.Credentials&&(n.Credentials=vs(e.Credentials,t)),void 0!==e.AssumedRoleUser&&(n.AssumedRoleUser=bs(e.AssumedRoleUser)),void 0!==e.PackedPolicySize&&(n.PackedPolicySize=jn(e.PackedPolicySize)),void 0!==e.SourceIdentity&&(n.SourceIdentity=Fn(e.SourceIdentity)),n})((await Rs(e.body,t)).AssumeRoleResult,t),{$metadata:Ns(e),...n}})(e,t)}}class Bs extends xn{static getEndpointParameterInstructions(){return{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"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Bs.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"STSClient",commandName:"AssumeRoleWithWebIdentityCommand",inputFilterSensitiveLog:rs,outputFilterSensitiveLog:os},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=Ds;let r;return r=Ls({...hs(e,t),Action:"AssumeRoleWithWebIdentity",Version:"2011-06-15"}),ks(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Os(e.body,t)},r=Fs(e,n.body);switch(r){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await as(n,t);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await ss(n,t);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await cs(n,t);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await ds(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await ls(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await us(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await ps(n,t);default:const o=n.body;return As({output:e,parsedBody:o.Error,errorCode:r})}})(e,t);let n={};return n=((e,t)=>{const n={};return void 0!==e.Credentials&&(n.Credentials=vs(e.Credentials,t)),void 0!==e.SubjectFromWebIdentityToken&&(n.SubjectFromWebIdentityToken=Fn(e.SubjectFromWebIdentityToken)),void 0!==e.AssumedRoleUser&&(n.AssumedRoleUser=bs(e.AssumedRoleUser)),void 0!==e.PackedPolicySize&&(n.PackedPolicySize=jn(e.PackedPolicySize)),void 0!==e.Provider&&(n.Provider=Fn(e.Provider)),void 0!==e.Audience&&(n.Audience=Fn(e.Audience)),void 0!==e.SourceIdentity&&(n.SourceIdentity=Fn(e.SourceIdentity)),n})((await Rs(e.body,t)).AssumeRoleWithWebIdentityResult,t),{$metadata:Ns(e),...n}})(e,t)}}const Us="us-east-1",$s=e=>"function"!=typeof e?void 0===e?Us:e:async()=>{try{return await e()}catch(e){return Us}},Ms=(e,t)=>{let n,r;return async(o,i)=>{if(r=o,!n){const{logger:o,region:i,requestHandler:a}=e;n=new t({logger:o,credentialDefaultProvider:()=>async()=>r,region:$s(i||e.region),...a?{requestHandler:a}:{}})}const{Credentials:a}=await n.send(new zs(i));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${i.RoleArn}`);return{accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration}}},js=(e,t)=>{let n;return async r=>{if(!n){const{logger:r,region:o,requestHandler:i}=e;n=new t({logger:r,region:$s(o||e.region),...i?{requestHandler:i}:{}})}const{Credentials:o}=await n.send(new Bs(r));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration}}},qs=()=>async()=>{const e=process.env.AWS_ACCESS_KEY_ID,t=process.env.AWS_SECRET_ACCESS_KEY,n=process.env.AWS_SESSION_TOKEN,r=process.env.AWS_CREDENTIAL_EXPIRATION;if(e&&t)return{accessKeyId:e,secretAccessKey:t,...n&&{sessionToken:n},...r&&{expiration:new Date(r)}};throw new Te("Unable to find environment variable credentials.")};var Vs=r(2037),Gs=r(1017);const Hs=()=>{const{HOME:e,USERPROFILE:t,HOMEPATH:n,HOMEDRIVE:r=`C:${Gs.sep}`}=process.env;return e||t||(n?`${r}${n}`:(0,Vs.homedir)())},Ks="AWS_PROFILE",Ws=e=>e.profile||process.env[Ks]||"default",Js=e=>{const t=(0,pe.createHash)("sha1").update(e).digest("hex");return(0,Gs.join)(Hs(),".aws","sso","cache",`${t}.json`)};var Qs=r(7147);const{readFile:Xs}=Qs.promises,Ys=async e=>{const t=Js(e),n=await Xs(t,"utf8");return JSON.parse(n)},Zs=()=>process.env.AWS_CONFIG_FILE||(0,Gs.join)(Hs(),".aws","config"),ec=()=>process.env.AWS_SHARED_CREDENTIALS_FILE||(0,Gs.join)(Hs(),".aws","credentials"),tc=/^profile\s(["'])?([^\1]+)\1$/,nc=e=>Object.entries(e).filter((([e])=>tc.test(e))).reduce(((e,[t,n])=>({...e,[tc.exec(t)[2]]:n})),{...e.default&&{default:e.default}}),rc=["__proto__","profile __proto__"],oc=e=>{const t={};let n;for(let r of e.split(/\r?\n/))if(r=r.split(/(^|\s)[;#]/)[0].trim(),"["===r[0]&&"]"===r[r.length-1]){if(n=r.substring(1,r.length-1),rc.includes(n))throw new Error(`Found invalid profile name "${n}"`)}else if(n){const e=r.indexOf("="),o=0,i=r.length-1;if(-1!==e&&e!==o&&e!==i){const[o,i]=[r.substring(0,e).trim(),r.substring(e+1).trim()];t[n]=t[n]||{},t[n][o]=i}}return t},{readFile:ic}=Qs.promises,ac={},sc=(e,t)=>(ac[e]&&!t?.ignoreCache||(ac[e]=ic(e,"utf8")),ac[e]),cc=()=>({}),dc=async(e={})=>{const{filepath:t=ec(),configFilepath:n=Zs()}=e,r=await Promise.all([sc(n,{ignoreCache:e.ignoreCache}).then(oc).then(nc).catch(cc),sc(t,{ignoreCache:e.ignoreCache}).then(oc).catch(cc)]);return{configFile:r[0],credentialsFile:r[1]}},lc=/^sso-session\s(["'])?([^\1]+)\1$/,uc=e=>Object.entries(e).filter((([e])=>lc.test(e))).reduce(((e,[t,n])=>({...e,[lc.exec(t)[2]]:n})),{}),pc=()=>({}),mc=async(e={})=>sc(e.configFilepath??Zs()).then(oc).then(uc).catch(pc),hc=async e=>{const t=await dc(e);return((...e)=>{const t={};for(const n of e)for(const[e,r]of Object.entries(n))void 0!==t[e]?Object.assign(t[e],r):t[e]=r;return t})(t.configFile,t.credentialsFile)},yc=e(import.meta.url)("url"),fc=e(import.meta.url)("http");function gc(e){return new Promise(((t,n)=>{const r=(0,fc.request)({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});r.on("error",(e=>{n(Object.assign(new Ce("Unable to connect to instance metadata service"),e)),r.destroy()})),r.on("timeout",(()=>{n(new Ce("TimeoutError from instance metadata service")),r.destroy()})),r.on("response",(e=>{const{statusCode:o=400}=e;(o<200||300<=o)&&(n(Object.assign(new Ce("Error response received from instance metadata service"),{statusCode:o})),r.destroy());const i=[];e.on("data",(e=>{i.push(e)})),e.on("end",(()=>{t(Le.Buffer.concat(i)),r.destroy()}))})),r.end()}))}const wc=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.AccessKeyId&&"string"==typeof e.SecretAccessKey&&"string"==typeof e.Token&&"string"==typeof e.Expiration,Ec=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration)}),bc=({maxRetries:e=0,timeout:t=1e3})=>({maxRetries:e,timeout:t}),vc=(e,t)=>{let n=e();for(let r=0;r<t;r++)n=n.catch(e);return n},Sc="AWS_CONTAINER_CREDENTIALS_FULL_URI",_c="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",Ic="AWS_CONTAINER_AUTHORIZATION_TOKEN",xc=(e={})=>{const{timeout:t,maxRetries:n}=bc(e);return()=>vc((async()=>{const e=await Nc(),n=JSON.parse(await Cc(t,e));if(!wc(n))throw new Te("Invalid response received from instance metadata service.");return Ec(n)}),n)},Cc=async(e,t)=>(process.env[Ic]&&(t.headers={...t.headers,Authorization:process.env[Ic]}),(await gc({...t,timeout:e})).toString()),Tc={localhost:!0,"127.0.0.1":!0},Pc={"http:":!0,"https:":!0},Nc=async()=>{if(process.env[_c])return{hostname:"169.254.170.2",path:process.env[_c]};if(process.env[Sc]){const e=(0,yc.parse)(process.env[Sc]);if(!e.hostname||!(e.hostname in Tc))throw new Te(`${e.hostname} is not a valid container metadata service hostname`,!1);if(!e.protocol||!(e.protocol in Pc))throw new Te(`${e.protocol} is not a valid container metadata service protocol`,!1);return{...e,port:e.port?parseInt(e.port,10):void 0}}throw new Te(`The container metadata credential provider cannot be used unless the ${_c} or ${Sc} environment variable is set`,!1)},Ac=({environmentVariableSelector:e,configFileSelector:t,default:n},r={})=>{return Ae(Ne((o=e,async()=>{try{const e=o(process.env);if(void 0===e)throw new Error;return e}catch(e){throw new Te(e.message||`Cannot load config from environment variables with getter: ${o}`)}}),((e,{preferredFile:t="config",...n}={})=>async()=>{const r=Ws(n),{configFile:o,credentialsFile:i}=await dc(n),a=i[r]||{},s=o[r]||{},c="config"===t?{...a,...s}:{...s,...a};try{const t=e(c);if(void 0===t)throw new Error;return t}catch(t){throw new Te(t.message||`Cannot load config for profile ${r} in SDK configuration files with getter: ${e}`)}})(t,r),(e=>{return"function"==typeof e?async()=>await e():(t=e,()=>Promise.resolve(t));var t})(n)));var o};var kc;!function(e){e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]"}(kc||(kc={}));const Dc={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:e=>e.ec2_metadata_service_endpoint,default:void 0};var Rc;!function(e){e.IPv4="IPv4",e.IPv6="IPv6"}(Rc||(Rc={}));const Oc={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE,configFileSelector:e=>e.ec2_metadata_service_endpoint_mode,default:Rc.IPv4},Lc=async()=>R(await Fc()||await zc()),Fc=async()=>Ac(Dc)(),zc=async()=>{const e=await Ac(Oc)();switch(e){case Rc.IPv4:return kc.IPv4;case Rc.IPv6:return kc.IPv6;default:throw new Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(Rc)}`)}},Bc=(e,t)=>{const n=300+Math.floor(300*Math.random()),r=new Date(Date.now()+1e3*n);t.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html");const o=e.originalExpiration??e.expiration;return{...e,...o?{originalExpiration:o}:{},expiration:r}},Uc="/latest/meta-data/iam/security-credentials/",$c=(e={})=>((e,t={})=>{const n=t?.logger||console;let r;return async()=>{let t;try{t=await e(),t.expiration&&t.expiration.getTime()<Date.now()&&(t=Bc(t,n))}catch(e){if(!r)throw e;n.warn("Credential renew failed: ",e),t=Bc(r,n)}return r=t,t}})(Mc(e),{logger:e.logger}),Mc=e=>{let t=!1;const{timeout:n,maxRetries:r}=bc(e),o=async(e,n)=>{const r=(await vc((async()=>{let e;try{e=await qc(n)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e}),e)).trim();return vc((async()=>{let e;try{e=await Vc(r,n)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e}),e)};return async()=>{const e=await Lc();if(t)return o(r,{...e,timeout:n});{let i;try{i=(await jc({...e,timeout:n})).toString()}catch(i){if(400===i?.statusCode)throw Object.assign(i,{message:"EC2 Metadata token request returned error"});return("TimeoutError"===i.message||[403,404,405].includes(i.statusCode))&&(t=!0),o(r,{...e,timeout:n})}return o(r,{...e,headers:{"x-aws-ec2-metadata-token":i},timeout:n})}}},jc=async e=>gc({...e,path:"/latest/api/token",method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),qc=async e=>(await gc({...e,path:Uc})).toString(),Vc=async(e,t)=>{const n=JSON.parse((await gc({...t,path:Uc+e})).toString());if(!wc(n))throw new Te("Invalid response received from instance metadata service.");return Ec(n)},Gc=e(import.meta.url)("child_process"),Hc=e(import.meta.url)("util"),Kc=(e={})=>async()=>{const t=await hc(e);return(async(e,t)=>{const n=t[e];if(!t[e])throw new Te(`Profile ${e} could not be found in shared credentials file.`);{const t=n.credential_process;if(void 0===t)throw new Te(`Profile ${e} did not contain credential_process.`);{const n=(0,Hc.promisify)(Gc.exec);try{const{stdout:r}=await n(t);let o;try{o=JSON.parse(r.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,t)=>{if(1!==t.Version)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(void 0===t.AccessKeyId||void 0===t.SecretAccessKey)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(t.Expiration){const n=new Date;if(new Date(t.Expiration)<n)throw Error(`Profile ${e} credential_process returned expired credentials.`)}return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,...t.SessionToken&&{sessionToken:t.SessionToken},...t.Expiration&&{expiration:new Date(t.Expiration)}}})(e,o)}catch(e){throw new Te(e.message)}}}})(Ws(e),t)},Wc=e=>e&&("string"==typeof e.sso_start_url||"string"==typeof e.sso_account_id||"string"==typeof e.sso_session||"string"==typeof e.sso_region||"string"==typeof e.sso_role_name);class Jc{constructor(e,t){this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update(Ue(Qc(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?(0,pe.createHmac)(this.algorithmIdentifier,Qc(this.secret)):(0,pe.createHash)(this.algorithmIdentifier)}}function Qc(e,t){return Le.Buffer.isBuffer(e)?e:"string"==typeof e?ze(e,t):ArrayBuffer.isView(e)?Fe(e.buffer,e.byteOffset,e.byteLength):Fe(e)}const Xc=e(import.meta.url)("https"),Yc=["ECONNRESET","EPIPE","ETIMEDOUT"],Zc=e=>{const t={};for(const n of Object.keys(e)){const r=e[n];t[n]=Array.isArray(r)?r.join(","):r}return t},ed=e(import.meta.url)("stream");class td{constructor(e){this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise(((t,n)=>{"function"==typeof e?e().then((e=>{t(this.resolveDefaultConfig(e))})).catch(n):t(this.resolveDefaultConfig(e))}))}resolveDefaultConfig(e){const{requestTimeout:t,connectionTimeout:n,socketTimeout:r,httpAgent:o,httpsAgent:i}=e||{};return{connectionTimeout:n,requestTimeout:t??r,httpAgent:o||new fc.Agent({keepAlive:!0,maxSockets:50}),httpsAgent:i||new Xc.Agent({keepAlive:!0,maxSockets:50})}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t}={}){return this.config||(this.config=await this.configProvider),new Promise(((n,r)=>{let o;const i=async e=>{await o,r(e)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t?.aborted){const e=new Error("Request aborted");return e.name="AbortError",void i(e)}const a="https:"===e.protocol,s=function(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=st(n),Array.isArray(r))for(let e=0,o=r.length;e<o;e++)t.push(`${n}=${st(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${st(r)}`),t.push(e)}}return t.join("&")}(e.query||{}),c={headers:e.headers,host:e.hostname,method:e.method,path:s?`${e.path}?${s}`:e.path,port:e.port,agent:a?this.config.httpsAgent:this.config.httpAgent},d=(a?Xc.request:fc.request)(c,(e=>{(async e=>{await o,n(e)})({response:new w({statusCode:e.statusCode||-1,headers:Zc(e.headers),body:e})})}));d.on("error",(e=>{Yc.includes(e.code)?i(Object.assign(e,{name:"TimeoutError"})):i(e)})),((e,t,n=0)=>{n&&e.on("socket",(r=>{if(r.connecting){const o=setTimeout((()=>{e.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${n} ms`),{name:"TimeoutError"}))}),n);r.on("connect",(()=>{clearTimeout(o)}))}}))})(d,i,this.config.connectionTimeout),((e,t,n=0)=>{e.setTimeout(n,(()=>{e.destroy(),t(Object.assign(new Error(`Connection timed out after ${n} ms`),{name:"TimeoutError"}))}))})(d,i,this.config.requestTimeout),t&&(t.onabort=()=>{d.abort();const e=new Error("Request aborted");e.name="AbortError",i(e)});const l=c.agent;"object"==typeof l&&"keepAlive"in l&&((e,{keepAlive:t,keepAliveMsecs:n})=>{!0===t&&e.on("socket",(e=>{e.setKeepAlive(t,n||0)}))})(d,{keepAlive:l.keepAlive,keepAliveMsecs:l.keepAliveMsecs}),o=async function(e,t,n=1e3){const r=t.headers??{};"100-continue"===(r.Expect||r.expect)&&await Promise.race([new Promise((e=>{setTimeout(e,Math.max(1e3,n))})),new Promise((t=>{e.on("continue",(()=>{t()}))}))]),function(e,t){t instanceof ed.Readable?t.pipe(e):t?e.end(Buffer.from(t)):e.end()}(e,t.body)}(d,e,this.config.requestTimeout)}))}}e(import.meta.url)("http2"),Symbol.iterator;class nd extends ed.Writable{constructor(){super(...arguments),this.bufferedBytes=[]}_write(e,t,n){this.bufferedBytes.push(e),n()}}const rd=e=>new Promise(((t,n)=>{const r=new nd;e.pipe(r),e.on("error",(e=>{r.end(),n(e)})),r.on("error",n),r.on("finish",(function(){const e=new Uint8Array(Buffer.concat(this.bufferedBytes));t(e)}))})),od=e=>{if(!e)return 0;if("string"==typeof e)return Buffer.from(e).length;if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;if("string"==typeof e.path||Buffer.isBuffer(e.path))return(0,Qs.lstatSync)(e.path).size;if("number"==typeof e.fd)return(0,Qs.fstatSync)(e.fd).size;throw new Error(`Body Length computation failed for ${e}`)};var id=r(7282);const ad=({serviceId:e,clientVersion:t})=>{const n=[["aws-sdk-js",t],[`os/${(0,Vs.platform)()}`,(0,Vs.release)()],["lang/js"],["md/nodejs",`${id.versions.node}`]],o=(()=>{try{return r(8687)?["md/crt-avail"]:null}catch(e){return null}})();o&&n.push(o),e&&n.push([`api/${e}`,t]),id.env.AWS_EXECUTION_ENV&&n.push([`exec-env/${id.env.AWS_EXECUTION_ENV}`]);const i=Ac({environmentVariableSelector:e=>e.AWS_SDK_UA_APP_ID,configFileSelector:e=>e["sdk-ua-app-id"],default:void 0})();let a;return async()=>{if(!a){const e=await i;a=e?[...n,[`app/${e}`]]:[...n]}return a}},sd=/^[A-Za-z0-9+/]*={0,2}$/,cd=e=>{if(3*e.length%4!=0)throw new TypeError("Incorrect padding on base64 string.");if(!sd.exec(e))throw new TypeError("Invalid base64 string.");const t=ze(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},dd=e=>Fe(e.buffer,e.byteOffset,e.byteLength).toString("base64"),ld="required",ud="fn",pd="argv",md="ref",hd="PartitionResult",yd="tree",fd="error",gd="endpoint",wd={[ld]:!1,type:"String"},Ed={[ld]:!0,default:!1,type:"Boolean"},bd={[md]:"Endpoint"},vd={[ud]:"booleanEquals",[pd]:[{[md]:"UseFIPS"},!0]},Sd={[ud]:"booleanEquals",[pd]:[{[md]:"UseDualStack"},!0]},_d={},Id={[ud]:"booleanEquals",[pd]:[!0,{[ud]:"getAttr",[pd]:[{[md]:hd},"supportsFIPS"]}]},xd={[ud]:"booleanEquals",[pd]:[!0,{[ud]:"getAttr",[pd]:[{[md]:hd},"supportsDualStack"]}]},Cd=[bd],Td=[vd],Pd=[Sd],Nd={version:"1.0",parameters:{Region:wd,UseDualStack:Ed,UseFIPS:Ed,Endpoint:wd},rules:[{conditions:[{[ud]:"aws.partition",[pd]:[{[md]:"Region"}],assign:hd}],type:yd,rules:[{conditions:[{[ud]:"isSet",[pd]:Cd},{[ud]:"parseURL",[pd]:Cd,assign:"url"}],type:yd,rules:[{conditions:Td,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:fd},{type:yd,rules:[{conditions:Pd,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:fd},{endpoint:{url:bd,properties:_d,headers:_d},type:gd}]}]},{conditions:[vd,Sd],type:yd,rules:[{conditions:[Id,xd],type:yd,rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:_d,headers:_d},type:gd}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:fd}]},{conditions:Td,type:yd,rules:[{conditions:[Id],type:yd,rules:[{type:yd,rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:_d,headers:_d},type:gd}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:fd}]},{conditions:Pd,type:yd,rules:[{conditions:[xd],type:yd,rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:_d,headers:_d},type:gd}]},{error:"DualStack is enabled but this partition does not support DualStack",type:fd}]},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:_d,headers:_d},type:gd}]}]},Ad=(e,t={})=>mn(Nd,{endpointParams:e,logger:t.logger}),kd="AWS_REGION",Dd="AWS_DEFAULT_REGION",Rd=["in-region","cross-region","mobile","standard","legacy"],Od={environmentVariableSelector:e=>e.AWS_DEFAULTS_MODE,configFileSelector:e=>e.defaults_mode,default:"legacy"},Ld=({region:e=Ac(l),defaultsMode:t=Ac(Od)}={})=>Ae((async()=>{const n="function"==typeof t?await t():t;switch(n?.toLowerCase()){case"auto":return Fd(e);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(n?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Rd.join(", ")}, got ${n}`)}})),Fd=async e=>{if(e){const t="function"==typeof e?await e():e,n=await zd();return n?t===n?"in-region":"cross-region":"standard"}return"standard"},zd=async()=>{if(process.env.AWS_EXECUTION_ENV&&(process.env[kd]||process.env[Dd]))return process.env[kd]??process.env[Dd];if(!process.env.AWS_EC2_METADATA_DISABLED)try{const e=await Lc();return(await gc({...e,path:"/latest/meta-data/placement/region"})).toString()}catch(e){}};class Bd extends In{constructor(e){const t=(n=(e=>{dr(process.version);const t=Ld(e),n=()=>t().then(sr),r=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??cd,base64Encoder:e?.base64Encoder??dd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ad,logger:e?.logger??new bn,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??R,utf8Decoder:e?.utf8Decoder??Be,utf8Encoder:e?.utf8Encoder??$e}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??od,defaultUserAgentProvider:e?.defaultUserAgentProvider??ad({serviceId:r.serviceId,clientVersion:"3.338.0"}),maxAttempts:e?.maxAttempts??Ac(de),region:e?.region??Ac(l,u),requestHandler:e?.requestHandler??new td(n),retryMode:e?.retryMode??Ac({...ue,default:async()=>(await n()).retryMode||X}),sha256:e?.sha256??Jc.bind(null,"sha256"),streamCollector:e?.streamCollector??rd,useDualstackEndpoint:e?.useDualstackEndpoint??Ac(c),useFipsEndpoint:e?.useFipsEndpoint??Ac(d)}})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"});var n;const r=h(t),o=O(r),i=_t(le(o));super(i),this.config=i,this.middlewareStack.use(Ie(this.config)),this.middlewareStack.use(v(this.config)),this.middlewareStack.use(q(this.config)),this.middlewareStack.use(G(this.config)),this.middlewareStack.use(W(this.config)),this.middlewareStack.use(En(this.config))}destroy(){super.destroy()}}class Ud extends rr{constructor(e){super(e),Object.setPrototypeOf(this,Ud.prototype)}}class $d extends Ud{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,$d.prototype)}}class Md extends Ud{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Md.prototype)}}class jd extends Ud{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,jd.prototype)}}class qd extends Ud{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,qd.prototype)}}const Vd=e=>({...e,...e.accessToken&&{accessToken:Cn}}),Gd=e=>({...e,...e.secretAccessKey&&{secretAccessKey:Cn},...e.sessionToken&&{sessionToken:Cn}}),Hd=e=>({...e,...e.roleCredentials&&{roleCredentials:Gd(e.roleCredentials)}}),Kd=ir(Ud),Wd=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{message:Fn});Object.assign(n,o);const i=new $d({$metadata:Yd(e),...n});return or(i,e.body)},Jd=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{message:Fn});Object.assign(n,o);const i=new Md({$metadata:Yd(e),...n});return or(i,e.body)},Qd=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{message:Fn});Object.assign(n,o);const i=new jd({$metadata:Yd(e),...n});return or(i,e.body)},Xd=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{message:Fn});Object.assign(n,o);const i=new qd({$metadata:Yd(e),...n});return or(i,e.body)},Yd=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Zd=e=>!(null==e||""===e||Object.getOwnPropertyNames(e).includes("length")&&0==e.length||Object.getOwnPropertyNames(e).includes("size")&&0==e.size),el=(e,t)=>((e,t)=>((e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array))(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),tl=async(e,t)=>{const n=await el(e,t);return n.message=n.message??n.Message,n},nl=(e,t)=>{const n=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(o=e.headers,"x-amzn-errortype",Object.keys(o).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var o;return void 0!==r?n(e.headers[r]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0};class rl extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,rl.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"SSOClient",commandName:"GetRoleCredentialsCommand",inputFilterSensitiveLog:Vd,outputFilterSensitiveLog:Hd},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const{hostname:n,protocol:r="https",port:o,path:i}=await t.endpoint(),a=mr({},Zd,{"x-amz-sso_bearer_token":e.accessToken}),s=`${i?.endsWith("/")?i.slice(0,-1):i||""}/federation/credentials`,c=mr({role_name:[,On(e.roleName,"roleName")],account_id:[,On(e.accountId,"accountId")]});return new Sr({protocol:r,hostname:n,port:o,method:"GET",headers:a,path:s,query:c,body:void 0})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await tl(e.body,t)},r=nl(e,n.body);switch(r){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await Wd(n,t);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await Jd(n,t);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await Qd(n,t);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await Xd(n,t);default:const o=n.body;return Kd({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=mr({$metadata:Yd(e)}),r=On(Ln(await el(e.body,t)),"body"),o=hr(r,{roleCredentials:br});return Object.assign(n,o),n})(e,t)}}const ol="To refresh this SSO session run 'aws sso login' with the corresponding profile.";class il extends rr{constructor(e){super(e),Object.setPrototypeOf(this,il.prototype)}}class al extends il{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,al.prototype),this.error=e.error,this.error_description=e.error_description}}class sl extends il{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,sl.prototype),this.error=e.error,this.error_description=e.error_description}}class cl extends il{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,cl.prototype),this.error=e.error,this.error_description=e.error_description}}class dl extends il{constructor(e){super({name:"InternalServerException",$fault:"server",...e}),this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,dl.prototype),this.error=e.error,this.error_description=e.error_description}}class ll extends il{constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,ll.prototype),this.error=e.error,this.error_description=e.error_description}}class ul extends il{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,ul.prototype),this.error=e.error,this.error_description=e.error_description}}class pl extends il{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,pl.prototype),this.error=e.error,this.error_description=e.error_description}}class ml extends il{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,ml.prototype),this.error=e.error,this.error_description=e.error_description}}class hl extends il{constructor(e){super({name:"SlowDownException",$fault:"client",...e}),this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,hl.prototype),this.error=e.error,this.error_description=e.error_description}}class yl extends il{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,yl.prototype),this.error=e.error,this.error_description=e.error_description}}class fl extends il{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,fl.prototype),this.error=e.error,this.error_description=e.error_description}}const gl=ir(il),wl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new al({$metadata:Nl(e),...n});return or(i,e.body)},El=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new sl({$metadata:Nl(e),...n});return or(i,e.body)},bl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new cl({$metadata:Nl(e),...n});return or(i,e.body)},vl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new dl({$metadata:Nl(e),...n});return or(i,e.body)},Sl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new ll({$metadata:Nl(e),...n});return or(i,e.body)},_l=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new ul({$metadata:Nl(e),...n});return or(i,e.body)},Il=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new pl({$metadata:Nl(e),...n});return or(i,e.body)},xl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new ml({$metadata:Nl(e),...n});return or(i,e.body)},Cl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new hl({$metadata:Nl(e),...n});return or(i,e.body)},Tl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new yl({$metadata:Nl(e),...n});return or(i,e.body)},Pl=async(e,t)=>{const n=mr({}),r=e.body,o=hr(r,{error:Fn,error_description:Fn});Object.assign(n,o);const i=new fl({$metadata:Nl(e),...n});return or(i,e.body)},Nl=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),Al=(e,t)=>((e,t)=>((e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array))(e,t).then((e=>t.utf8Encoder(e))))(e,t).then((e=>e.length?JSON.parse(e):{})),kl=async(e,t)=>{const n=await Al(e,t);return n.message=n.message??n.Message,n},Dl=(e,t)=>{const n=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(o=e.headers,"x-amzn-errortype",Object.keys(o).find((e=>e.toLowerCase()==="x-amzn-errortype".toLowerCase())));var o;return void 0!==r?n(e.headers[r]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0};class Rl extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Rl.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"SSOOIDCClient",commandName:"CreateTokenCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const{hostname:n,protocol:r="https",port:o,path:i}=await t.endpoint(),a=`${i?.endsWith("/")?i.slice(0,-1):i||""}/token`;let s;return s=JSON.stringify(hr(e,{clientId:[],clientSecret:[],code:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:e=>br(e)})),new Sr({protocol:r,hostname:n,port:o,method:"POST",headers:{"content-type":"application/json"},path:a,body:s})})(e,t)}deserialize(e,t){return(async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await kl(e.body,t)},r=Dl(e,n.body);switch(r){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await wl(n,t);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await El(n,t);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await bl(n,t);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await vl(n,t);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await Sl(n,t);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await _l(n,t);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await Il(n,t);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await xl(n,t);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await Cl(n,t);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await Tl(n,t);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await Pl(n,t);default:const o=n.body;return gl({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=mr({$metadata:Nl(e)}),r=On(Ln(await Al(e.body,t)),"body"),o=hr(r,{accessToken:Fn,expiresIn:kn,idToken:Fn,refreshToken:Fn,tokenType:Fn});return Object.assign(n,o),n})(e,t)}}const Ol="required",Ll="fn",Fl="argv",zl="ref",Bl="PartitionResult",Ul="tree",$l="error",Ml="endpoint",jl={[Ol]:!1,type:"String"},ql={[Ol]:!0,default:!1,type:"Boolean"},Vl={[zl]:"Endpoint"},Gl={[Ll]:"booleanEquals",[Fl]:[{[zl]:"UseFIPS"},!0]},Hl={[Ll]:"booleanEquals",[Fl]:[{[zl]:"UseDualStack"},!0]},Kl={},Wl={[Ll]:"booleanEquals",[Fl]:[!0,{[Ll]:"getAttr",[Fl]:[{[zl]:Bl},"supportsFIPS"]}]},Jl={[Ll]:"booleanEquals",[Fl]:[!0,{[Ll]:"getAttr",[Fl]:[{[zl]:Bl},"supportsDualStack"]}]},Ql=[Vl],Xl=[Gl],Yl=[Hl],Zl={version:"1.0",parameters:{Region:jl,UseDualStack:ql,UseFIPS:ql,Endpoint:jl},rules:[{conditions:[{[Ll]:"aws.partition",[Fl]:[{[zl]:"Region"}],assign:Bl}],type:Ul,rules:[{conditions:[{[Ll]:"isSet",[Fl]:Ql},{[Ll]:"parseURL",[Fl]:Ql,assign:"url"}],type:Ul,rules:[{conditions:Xl,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:$l},{type:Ul,rules:[{conditions:Yl,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:$l},{endpoint:{url:Vl,properties:Kl,headers:Kl},type:Ml}]}]},{conditions:[Gl,Hl],type:Ul,rules:[{conditions:[Wl,Jl],type:Ul,rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Kl,headers:Kl},type:Ml}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:$l}]},{conditions:Xl,type:Ul,rules:[{conditions:[Wl],type:Ul,rules:[{type:Ul,rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Kl,headers:Kl},type:Ml}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:$l}]},{conditions:Yl,type:Ul,rules:[{conditions:[Jl],type:Ul,rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Kl,headers:Kl},type:Ml}]},{error:"DualStack is enabled but this partition does not support DualStack",type:$l}]},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:Kl,headers:Kl},type:Ml}]}]},eu=(e,t={})=>mn(Zl,{endpointParams:e,logger:t.logger});class tu extends In{constructor(e){const t=(n=(e=>{dr(process.version);const t=Ld(e),n=()=>t().then(sr),r=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??cd,base64Encoder:e?.base64Encoder??dd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??eu,logger:e?.logger??new bn,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??R,utf8Decoder:e?.utf8Decoder??Be,utf8Encoder:e?.utf8Encoder??$e}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??od,defaultUserAgentProvider:e?.defaultUserAgentProvider??ad({serviceId:r.serviceId,clientVersion:"3.338.0"}),maxAttempts:e?.maxAttempts??Ac(de),region:e?.region??Ac(l,u),requestHandler:e?.requestHandler??new td(n),retryMode:e?.retryMode??Ac({...ue,default:async()=>(await n()).retryMode||X}),sha256:e?.sha256??Jc.bind(null,"sha256"),streamCollector:e?.streamCollector??rd,useDualstackEndpoint:e?.useDualstackEndpoint??Ac(c),useFipsEndpoint:e?.useFipsEndpoint??Ac(d)}})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"awsssooidc"});var n;const r=h(t),o=O(r),i=_t(le(o));super(i),this.config=i,this.middlewareStack.use(Ie(this.config)),this.middlewareStack.use(v(this.config)),this.middlewareStack.use(q(this.config)),this.middlewareStack.use(G(this.config)),this.middlewareStack.use(W(this.config)),this.middlewareStack.use(En(this.config))}destroy(){super.destroy()}}const nu={},ru=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new Pe(`Token is expired. ${ol}`,!1)},ou=(e,t,n=!1)=>{if(void 0===t)throw new Pe(`Value not present for '${e}' in SSO Token${n?". Cannot refresh":""}. ${ol}`,!1)},{writeFile:iu}=Qs.promises,au=new Date(0),su=(e={})=>async()=>{const t=await hc(e),n=Ws(e),r=t[n];if(!r)throw new Pe(`Profile '${n}' could not be found in shared credentials file.`,!1);if(!r.sso_session)throw new Pe(`Profile '${n}' is missing required property 'sso_session'.`);const o=r.sso_session,i=(await mc(e))[o];if(!i)throw new Pe(`Sso session '${o}' could not be found in shared credentials file.`,!1);for(const e of["sso_start_url","sso_region"])if(!i[e])throw new Pe(`Sso session '${o}' is missing required property '${e}'.`,!1);i.sso_start_url;const a=i.sso_region;let s;try{s=await Ys(o)}catch(e){throw new Pe(`The SSO session token associated with profile=${n} was not found or is invalid. ${ol}`,!1)}ou("accessToken",s.accessToken),ou("expiresAt",s.expiresAt);const{accessToken:c,expiresAt:d}=s,l={token:c,expiration:new Date(d)};if(l.expiration.getTime()-Date.now()>3e5)return l;if(Date.now()-au.getTime()<3e4)return ru(l),l;ou("clientId",s.clientId,!0),ou("clientSecret",s.clientSecret,!0),ou("refreshToken",s.refreshToken,!0);try{au.setTime(Date.now());const e=await((e,t)=>{const n=(e=>{if(nu[e])return nu[e];const t=new tu({region:e});return nu[e]=t,t})(t);return n.send(new Rl({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))})(s,a);ou("accessToken",e.accessToken),ou("expiresIn",e.expiresIn);const t=new Date(Date.now()+1e3*e.expiresIn);try{await((e,t)=>{const n=Js(e),r=JSON.stringify(t,null,2);return iu(n,r)})(o,{...s,accessToken:e.accessToken,expiresAt:t.toISOString(),refreshToken:e.refreshToken})}catch(e){}return{token:e.accessToken,expiration:t}}catch(e){return ru(l),l}},cu=!1,du=async({ssoStartUrl:e,ssoSession:t,ssoAccountId:n,ssoRegion:r,ssoRoleName:o,ssoClient:i,profile:a})=>{let s;const c="To refresh this SSO session run aws sso login with the corresponding profile.";if(t)try{const e=await su({profile:a})();s={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new Te(e.message,cu)}else try{s=await Ys(e)}catch(e){throw new Te(`The SSO session associated with this profile is invalid. ${c}`,cu)}if(new Date(s.expiresAt).getTime()-Date.now()<=9e5)throw new Te(`The SSO session associated with this profile has expired. ${c}`,cu);const{accessToken:d}=s,l=i||new Bd({region:r});let u;try{u=await l.send(new rl({accountId:n,roleName:o,accessToken:d}))}catch(e){throw Te.from(e,cu)}const{roleCredentials:{accessKeyId:p,secretAccessKey:m,sessionToken:h,expiration:y}={}}=u;if(!(p&&m&&h&&y))throw new Te("SSO returns an invalid temporary credential.",cu);return{accessKeyId:p,secretAccessKey:m,sessionToken:h,expiration:new Date(y)}},lu=e=>{const{sso_start_url:t,sso_account_id:n,sso_region:r,sso_role_name:o}=e;if(!(t&&n&&r&&o))throw new Te(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,!1);return e},uu=(e={})=>async()=>{const{ssoStartUrl:t,ssoAccountId:n,ssoRegion:r,ssoRoleName:o,ssoClient:i,ssoSession:a}=e,s=Ws(e);if(t||n||r||o||a){if(t&&n&&r&&o)return du({ssoStartUrl:t,ssoSession:a,ssoAccountId:n,ssoRegion:r,ssoRoleName:o,ssoClient:i,profile:s});throw new Te('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"')}{const n=(await hc(e))[s];if(!n)throw new Te(`Profile ${s} was not found.`);if(!Wc(n))throw new Te(`Profile ${s} is not configured with SSO credentials.`);if(n?.sso_session){const o=(await mc(e))[n.sso_session],i=` configurations in profile ${s} and sso-session ${n.sso_session}`;if(r&&r!==o.sso_region)throw new Te("Conflicting SSO region"+i,!1);if(t&&t!==o.sso_start_url)throw new Te("Conflicting SSO start_url"+i,!1);n.sso_region=o.sso_region,n.sso_start_url=o.sso_start_url}const{sso_start_url:o,sso_account_id:a,sso_region:c,sso_role_name:d,sso_session:l}=lu(n);return du({ssoStartUrl:o,ssoSession:l,ssoAccountId:a,ssoRegion:c,ssoRoleName:d,ssoClient:i,profile:s})}},pu=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.aws_access_key_id&&"string"==typeof e.aws_secret_access_key&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1,mu=e=>Promise.resolve({accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token}),hu=(e={})=>async()=>yu(e),yu=e=>{const t=e?.webIdentityTokenFile??process.env.AWS_WEB_IDENTITY_TOKEN_FILE,n=e?.roleArn??process.env.AWS_ROLE_ARN,r=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!t||!n)throw new Te("Web identity configuration not specified");return(e=>()=>{const{roleArn:t,roleSessionName:n,webIdentityToken:r,providerId:o,policyArns:i,policy:a,durationSeconds:s,roleAssumerWithWebIdentity:c}=e;if(!c)throw new Te(`Role Arn '${t}' needs to be assumed with web identity, but no role assumption callback was provided.`,!1);return c({RoleArn:t,RoleSessionName:n??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:r,ProviderId:o,PolicyArns:i,Policy:a,DurationSeconds:s})})({...e,webIdentityToken:(0,Qs.readFileSync)(t,{encoding:"ascii"}),roleArn:n,roleSessionName:r})()},fu=async(e,t,n,r={})=>{const o=t[e];if(Object.keys(r).length>0&&pu(o))return mu(o);if(i=o,Boolean(i)&&"object"==typeof i&&"string"==typeof i.role_arn&&["undefined","string"].indexOf(typeof i.role_session_name)>-1&&["undefined","string"].indexOf(typeof i.external_id)>-1&&["undefined","string"].indexOf(typeof i.mfa_serial)>-1&&((e=>"string"==typeof e.source_profile&&void 0===e.credential_source)(i)||(e=>"string"==typeof e.credential_source&&void 0===e.source_profile)(i)))return(async(e,t,n,r={})=>{const o=t[e];if(!n.roleAssumer)throw new Te(`Profile ${e} requires a role to be assumed, but no role assumption callback was provided.`,!1);const{source_profile:i}=o;if(i&&i in r)throw new Te(`Detected a cycle attempting to resolve credentials for profile ${Ws(n)}. Profiles visited: `+Object.keys(r).join(", "),!1);const a=i?fu(i,t,n,{...r,[i]:!0}):((e,t)=>{const n={EcsContainer:xc,Ec2InstanceMetadata:$c,Environment:qs};if(e in n)return n[e]();throw new Te(`Unsupported credential source in profile ${t}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`)})(o.credential_source,e)(),s={RoleArn:o.role_arn,RoleSessionName:o.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:o.external_id},{mfa_serial:c}=o;if(c){if(!n.mfaCodeProvider)throw new Te(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,!1);s.SerialNumber=c,s.TokenCode=await n.mfaCodeProvider(c)}const d=await a;return n.roleAssumer(d,s)})(e,t,n,r);var i;if(pu(o))return mu(o);if((e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.web_identity_token_file&&"string"==typeof e.role_arn&&["undefined","string"].indexOf(typeof e.role_session_name)>-1)(o))return(async(e,t)=>hu({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:t.roleAssumerWithWebIdentity})())(o,n);if((e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.credential_process)(o))return(async(e,t)=>Kc({...e,profile:t})())(n,e);if(Wc(o))return(e=>{const{sso_start_url:t,sso_account_id:n,sso_session:r,sso_region:o,sso_role_name:i}=lu(e);return uu({ssoStartUrl:t,ssoAccountId:n,ssoSession:r,ssoRegion:o,ssoRoleName:i})()})(o);throw new Te(`Profile ${e} could not be found or parsed in shared credentials file.`)},gu=(e={})=>Ae(Ne(...e.profile||process.env[Ks]?[]:[qs()],uu(e),((e={})=>async()=>{const t=await hc(e);return fu(Ws(e),t,e)})(e),Kc(e),hu(e),(e=>process.env[_c]||process.env[Sc]?xc(e):process.env.AWS_EC2_METADATA_DISABLED?async()=>{throw new Te("EC2 Instance Metadata Service access disabled")}:$c(e))(e),(async()=>{throw new Te("Could not load credentials from any providers",!1)})),(e=>void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5),(e=>void 0!==e.expiration)),wu="required",Eu="type",bu="fn",vu="argv",Su="ref",_u="booleanEquals",Iu="tree",xu="stringEquals",Cu="sigv4",Tu="us-east-1",Pu="endpoint",Nu="https://sts.{Region}.{PartitionResult#dnsSuffix}",Au="error",ku="getAttr",Du={[wu]:!1,[Eu]:"String"},Ru={[wu]:!0,default:!1,[Eu]:"Boolean"},Ou={[Su]:"Endpoint"},Lu={[bu]:"isSet",[vu]:[{[Su]:"Region"}]},Fu={[Su]:"Region"},zu={[bu]:"aws.partition",[vu]:[Fu],assign:"PartitionResult"},Bu={[Su]:"UseFIPS"},Uu={[Su]:"UseDualStack"},$u={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:Cu,signingName:"sts",signingRegion:Tu}]},headers:{}},Mu={},ju={conditions:[{[bu]:xu,[vu]:[Fu,"aws-global"]}],[Pu]:$u,[Eu]:Pu},qu={[bu]:_u,[vu]:[Bu,!0]},Vu={[bu]:_u,[vu]:[Uu,!0]},Gu={[bu]:_u,[vu]:[!0,{[bu]:ku,[vu]:[{[Su]:"PartitionResult"},"supportsFIPS"]}]},Hu={[Su]:"PartitionResult"},Ku={[bu]:_u,[vu]:[!0,{[bu]:ku,[vu]:[Hu,"supportsDualStack"]}]},Wu=[{[bu]:"isSet",[vu]:[Ou]}],Ju=[qu],Qu=[Vu],Xu={version:"1.0",parameters:{Region:Du,UseDualStack:Ru,UseFIPS:Ru,Endpoint:Du,UseGlobalEndpoint:Ru},rules:[{conditions:[{[bu]:_u,[vu]:[{[Su]:"UseGlobalEndpoint"},!0]},{[bu]:"not",[vu]:Wu},Lu,zu,{[bu]:_u,[vu]:[Bu,!1]},{[bu]:_u,[vu]:[Uu,!1]}],[Eu]:Iu,rules:[{conditions:[{[bu]:xu,[vu]:[Fu,"ap-northeast-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"ap-south-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"ap-southeast-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"ap-southeast-2"]}],endpoint:$u,[Eu]:Pu},ju,{conditions:[{[bu]:xu,[vu]:[Fu,"ca-central-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"eu-central-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"eu-north-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"eu-west-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"eu-west-2"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"eu-west-3"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"sa-east-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,Tu]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"us-east-2"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"us-west-1"]}],endpoint:$u,[Eu]:Pu},{conditions:[{[bu]:xu,[vu]:[Fu,"us-west-2"]}],endpoint:$u,[Eu]:Pu},{endpoint:{url:Nu,properties:{authSchemes:[{name:Cu,signingName:"sts",signingRegion:"{Region}"}]},headers:Mu},[Eu]:Pu}]},{conditions:Wu,[Eu]:Iu,rules:[{conditions:Ju,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Eu]:Au},{[Eu]:Iu,rules:[{conditions:Qu,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Eu]:Au},{endpoint:{url:Ou,properties:Mu,headers:Mu},[Eu]:Pu}]}]},{[Eu]:Iu,rules:[{conditions:[Lu],[Eu]:Iu,rules:[{conditions:[zu],[Eu]:Iu,rules:[{conditions:[qu,Vu],[Eu]:Iu,rules:[{conditions:[Gu,Ku],[Eu]:Iu,rules:[{[Eu]:Iu,rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Mu,headers:Mu},[Eu]:Pu}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Eu]:Au}]},{conditions:Ju,[Eu]:Iu,rules:[{conditions:[Gu],[Eu]:Iu,rules:[{[Eu]:Iu,rules:[{conditions:[{[bu]:xu,[vu]:["aws-us-gov",{[bu]:ku,[vu]:[Hu,"name"]}]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:Mu,headers:Mu},[Eu]:Pu},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Mu,headers:Mu},[Eu]:Pu}]}]},{error:"FIPS is enabled but this partition does not support FIPS",[Eu]:Au}]},{conditions:Qu,[Eu]:Iu,rules:[{conditions:[Ku],[Eu]:Iu,rules:[{[Eu]:Iu,rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Mu,headers:Mu},[Eu]:Pu}]}]},{error:"DualStack is enabled but this partition does not support DualStack",[Eu]:Au}]},{[Eu]:Iu,rules:[ju,{endpoint:{url:Nu,properties:Mu,headers:Mu},[Eu]:Pu}]}]}]},{error:"Invalid Configuration: Missing Region",[Eu]:Au}]}]},Yu=(e,t={})=>mn(Xu,{endpointParams:e,logger:t.logger});class Zu extends In{constructor(e){const t=(n=(e=>{dr(process.version);const t=Ld(e),n=()=>t().then(sr),r=(e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??cd,base64Encoder:e?.base64Encoder??dd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Yu,logger:e?.logger??new bn,serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??R,utf8Decoder:e?.utf8Decoder??Be,utf8Encoder:e?.utf8Encoder??$e}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??od,credentialDefaultProvider:e?.credentialDefaultProvider??(o=gu,e=>o({roleAssumer:Ms(e,e.stsClientCtor),roleAssumerWithWebIdentity:js(e,e.stsClientCtor),...e})),defaultUserAgentProvider:e?.defaultUserAgentProvider??ad({serviceId:r.serviceId,clientVersion:"3.338.0"}),maxAttempts:e?.maxAttempts??Ac(de),region:e?.region??Ac(l,u),requestHandler:e?.requestHandler??new td(n),retryMode:e?.retryMode??Ac({...ue,default:async()=>(await n()).retryMode||X}),sha256:e?.sha256??Jc.bind(null,"sha256"),streamCollector:e?.streamCollector??rd,useDualstackEndpoint:e?.useDualstackEndpoint??Ac(c),useFipsEndpoint:e?.useFipsEndpoint??Ac(d)};var o})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,useGlobalEndpoint:n.useGlobalEndpoint??!1,defaultSigningName:"sts"});var n;const r=h(t),o=O(r),i=_t(((e,{stsClientCtor:t})=>ft({...e,stsClientCtor:t}))(le(o),{stsClientCtor:Zu}));super(i),this.config=i,this.middlewareStack.use(Ie(this.config)),this.middlewareStack.use(v(this.config)),this.middlewareStack.use(q(this.config)),this.middlewareStack.use(G(this.config)),this.middlewareStack.use(W(this.config)),this.middlewareStack.use(En(this.config))}destroy(){super.destroy()}}const ep=(e,t)=>t?class extends e{constructor(e){super(e);for(const e of t)this.middlewareStack.use(e)}}:e,tp=(e={},t)=>Ms(e,ep(Zu,t)),np=(e={},t)=>js(e,ep(Zu,t)),rp="required",op="fn",ip="argv",ap="ref",sp="isSet",cp="tree",dp="error",lp="endpoint",up="PartitionResult",pp="getAttr",mp="stringEquals",hp={[rp]:!1,type:"String"},yp={[rp]:!0,default:!1,type:"Boolean"},fp={[ap]:"Endpoint"},gp={[op]:"booleanEquals",[ip]:[{[ap]:"UseFIPS"},!0]},wp={[op]:"booleanEquals",[ip]:[{[ap]:"UseDualStack"},!0]},Ep={},bp={[ap]:"Region"},vp={[op]:"booleanEquals",[ip]:[!0,{[op]:pp,[ip]:[{[ap]:up},"supportsFIPS"]}]},Sp={[ap]:up},_p={[op]:"booleanEquals",[ip]:[!0,{[op]:pp,[ip]:[Sp,"supportsDualStack"]}]},Ip=[gp],xp=[wp],Cp=[bp],Tp={version:"1.0",parameters:{Region:hp,UseDualStack:yp,UseFIPS:yp,Endpoint:hp},rules:[{conditions:[{[op]:sp,[ip]:[fp]}],type:cp,rules:[{conditions:Ip,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:dp},{type:cp,rules:[{conditions:xp,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:dp},{endpoint:{url:fp,properties:Ep,headers:Ep},type:lp}]}]},{type:cp,rules:[{conditions:[{[op]:sp,[ip]:Cp}],type:cp,rules:[{conditions:[{[op]:"aws.partition",[ip]:Cp,assign:up}],type:cp,rules:[{conditions:[gp,wp],type:cp,rules:[{conditions:[vp,_p],type:cp,rules:[{type:cp,rules:[{endpoint:{url:"https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Ep,headers:Ep},type:lp}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:dp}]},{conditions:Ip,type:cp,rules:[{conditions:[vp],type:cp,rules:[{type:cp,rules:[{conditions:[{[op]:mp,[ip]:["aws-us-gov",{[op]:pp,[ip]:[Sp,"name"]}]}],endpoint:{url:"https://dynamodb.{Region}.amazonaws.com",properties:Ep,headers:Ep},type:lp},{endpoint:{url:"https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Ep,headers:Ep},type:lp}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:dp}]},{conditions:xp,type:cp,rules:[{conditions:[_p],type:cp,rules:[{type:cp,rules:[{endpoint:{url:"https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Ep,headers:Ep},type:lp}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:dp}]},{type:cp,rules:[{conditions:[{[op]:mp,[ip]:[bp,"local"]}],endpoint:{url:"http://localhost:8000",properties:{authSchemes:[{name:"sigv4",signingName:"dynamodb",signingRegion:"us-east-1"}]},headers:Ep},type:lp},{endpoint:{url:"https://dynamodb.{Region}.{PartitionResult#dnsSuffix}",properties:Ep,headers:Ep},type:lp}]}]}]},{error:"Invalid Configuration: Missing Region",type:dp}]}]},Pp=(e,t={})=>mn(Tp,{endpointParams:e,logger:t.logger});class Np extends In{constructor(e){const t=(n=(e=>{dr(process.version);const t=Ld(e),n=()=>t().then(sr),r=(e=>({apiVersion:"2012-08-10",base64Decoder:e?.base64Decoder??cd,base64Encoder:e?.base64Encoder??dd,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Pp,logger:e?.logger??new bn,serviceId:e?.serviceId??"DynamoDB",urlParser:e?.urlParser??R,utf8Decoder:e?.utf8Decoder??Be,utf8Encoder:e?.utf8Encoder??$e}))(e);return{...r,...e,runtime:"node",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??od,credentialDefaultProvider:e?.credentialDefaultProvider??(o=gu,e=>o({roleAssumer:tp(e),roleAssumerWithWebIdentity:np(e),...e})),defaultUserAgentProvider:e?.defaultUserAgentProvider??ad({serviceId:r.serviceId,clientVersion:"3.338.0"}),endpointDiscoveryEnabledProvider:e?.endpointDiscoveryEnabledProvider??Ac(B),maxAttempts:e?.maxAttempts??Ac(de),region:e?.region??Ac(l,u),requestHandler:e?.requestHandler??new td(n),retryMode:e?.retryMode??Ac({...ue,default:async()=>(await n()).retryMode||X}),sha256:e?.sha256??Jc.bind(null,"sha256"),streamCollector:e?.streamCollector??rd,useDualstackEndpoint:e?.useDualstackEndpoint??Ac(c),useFipsEndpoint:e?.useFipsEndpoint??Ac(d)};var o})(e),{...n,useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"dynamodb"});var n;const r=h(t),o=O(r),i=le(o),a=((e,{endpointDiscoveryCommandCtor:t})=>({...e,endpointDiscoveryCommandCtor:t,endpointCache:new M(e.endpointCacheSize??1e3),endpointDiscoveryEnabled:void 0!==e.endpointDiscoveryEnabled?()=>Promise.resolve(e.endpointDiscoveryEnabled):e.endpointDiscoveryEnabledProvider,isClientEndpointDiscoveryEnabled:void 0!==e.endpointDiscoveryEnabled}))(_t(ft(i)),{endpointDiscoveryCommandCtor:Ha});super(a),this.config=a,this.middlewareStack.use(Ie(this.config)),this.middlewareStack.use(v(this.config)),this.middlewareStack.use(q(this.config)),this.middlewareStack.use(G(this.config)),this.middlewareStack.use(W(this.config)),this.middlewareStack.use(St(this.config)),this.middlewareStack.use(En(this.config))}destroy(){super.destroy()}}class Ap extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Ap.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"BatchExecuteStatementCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("BatchExecuteStatement");let r;return r=JSON.stringify(((e,t)=>hr(e,{ReturnConsumedCapacity:[],Statements:e=>Li(e,t)}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),Responses:e=>Sa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class kp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,kp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"BatchGetItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("BatchGetItem");let r;return r=JSON.stringify(((e,t)=>hr(e,{RequestItems:e=>Si(e,t),ReturnConsumedCapacity:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),Responses:e=>ea(e,t),UnprocessedKeys:e=>Zi(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Dp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Dp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"BatchWriteItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("BatchWriteItem");let r;return r=JSON.stringify(((e,t)=>hr(e,{RequestItems:e=>_i(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ri(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),ItemCollectionMetrics:e=>pa(e,t),UnprocessedItems:e=>ta(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Rp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Rp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"CreateBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("CreateBackup");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"BackupInUseException":case"com.amazonaws.dynamodb#BackupInUseException":throw await $o(n,t);case"ContinuousBackupsUnavailableException":case"com.amazonaws.dynamodb#ContinuousBackupsUnavailableException":throw await qo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"TableInUseException":case"com.amazonaws.dynamodb#TableInUseException":throw await mi(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{BackupDetails:e=>Yi(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Op extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Op.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"CreateGlobalTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("CreateGlobalTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"GlobalTableAlreadyExistsException":case"com.amazonaws.dynamodb#GlobalTableAlreadyExistsException":throw await Ko(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{GlobalTableDescription:e=>da(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Lp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Lp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"CreateTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("CreateTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableDescription:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Fp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Fp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DeleteBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DeleteBackup");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"BackupInUseException":case"com.amazonaws.dynamodb#BackupInUseException":throw await $o(n,t);case"BackupNotFoundException":case"com.amazonaws.dynamodb#BackupNotFoundException":throw await Mo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{BackupDescription:e=>Xi(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class zp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,zp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DeleteItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DeleteItem");let r;return r=JSON.stringify(((e,t)=>hr(e,{ConditionExpression:[],ConditionalOperator:[],Expected:e=>Ci(e,t),ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Key:e=>Ai(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ri(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await fi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{Attributes:e=>Ki(e,t),ConsumedCapacity:e=>ia(e,t),ItemCollectionMetrics:e=>ua(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Bp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Bp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DeleteTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DeleteTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableDescription:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Up extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Up.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeBackup");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"BackupNotFoundException":case"com.amazonaws.dynamodb#BackupNotFoundException":throw await Mo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{BackupDescription:e=>Xi(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class $p extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,$p.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeContinuousBackupsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeContinuousBackups");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ContinuousBackupsDescription:e=>sa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Mp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Mp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeContributorInsightsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeContributorInsights");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ContributorInsightsRuleList:br,ContributorInsightsStatus:Fn,FailureException:br,IndexName:Fn,LastUpdateDateTime:e=>On(Wn(Pn(e))),TableName:Fn}))(await qa(e.body,t)),{$metadata:Ba(e),...n}})(e,t)}}class jp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,jp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeExportCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeExport");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ExportNotFoundException":case"com.amazonaws.dynamodb#ExportNotFoundException":throw await Ho(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ExportDescription:e=>ca(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class qp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,qp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeGlobalTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeGlobalTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Wo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{GlobalTableDescription:e=>da(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Vp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Vp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeGlobalTableSettingsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeGlobalTableSettings");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Wo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{GlobalTableName:Fn,ReplicaSettings:e=>Ta(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Gp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Gp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeImportCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeImport");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ImportNotFoundException":case"com.amazonaws.dynamodb#ImportNotFoundException":throw await Xo(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ImportTableDescription:e=>la(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Hp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Hp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeKinesisStreamingDestinationCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeKinesisStreamingDestination");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Kp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Kp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeLimitsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeLimits");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Wp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Wp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{Table:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Jp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Jp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeTableReplicaAutoScalingCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeTableReplicaAutoScaling");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableAutoScalingDescription:e=>Da(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Qp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Qp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DescribeTimeToLiveCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DescribeTimeToLive");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Xp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Xp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"DisableKinesisStreamingDestinationCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("DisableKinesisStreamingDestination");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Yp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Yp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"EnableKinesisStreamingDestinationCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("EnableKinesisStreamingDestination");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Zp extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Zp.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ExecuteStatementCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ExecuteStatement");let r;return r=JSON.stringify(((e,t)=>hr(e,{ConsistentRead:[],Limit:[],NextToken:[],Parameters:e=>Fi(e,t),ReturnConsumedCapacity:[],Statement:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await jo(n,t);case"DuplicateItemException":case"com.amazonaws.dynamodb#DuplicateItemException":throw await Vo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ri(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await fi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>ia(e,t),Items:e=>ha(e,t),LastEvaluatedKey:e=>fa(e,t),NextToken:Fn}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class em extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,em.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ExecuteTransactionCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ExecuteTransaction");let r;return r=JSON.stringify(((e,t)=>hr(e,{ClientRequestToken:[!0,e=>e??be()],ReturnConsumedCapacity:[],TransactStatements:e=>Oi(e,t)}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"IdempotentParameterMismatchException":case"com.amazonaws.dynamodb#IdempotentParameterMismatchException":throw await Jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionCanceledException":case"com.amazonaws.dynamodb#TransactionCanceledException":throw await yi(n,t);case"TransactionInProgressException":case"com.amazonaws.dynamodb#TransactionInProgressException":throw await gi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),Responses:e=>ya(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class tm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,tm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ExportTableToPointInTimeCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ExportTableToPointInTime");let r;return r=JSON.stringify(((e,t)=>hr(e,{ClientToken:[!0,e=>e??be()],ExportFormat:[],ExportTime:e=>Math.round(e.getTime()/1e3),S3Bucket:[],S3BucketOwner:[],S3Prefix:[],S3SseAlgorithm:[],S3SseKmsKeyId:[],TableArn:[]}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ExportConflictException":case"com.amazonaws.dynamodb#ExportConflictException":throw await Go(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidExportTimeException":case"com.amazonaws.dynamodb#InvalidExportTimeException":throw await ti(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"PointInTimeRecoveryUnavailableException":case"com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException":throw await ii(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ExportDescription:e=>ca(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class nm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,nm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"GetItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("GetItem");let r;return r=JSON.stringify(((e,t)=>hr(e,{AttributesToGet:br,ConsistentRead:[],ExpressionAttributeNames:br,Key:e=>Ai(e,t),ProjectionExpression:[],ReturnConsumedCapacity:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>ia(e,t),Item:e=>Ki(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class rm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,rm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ImportTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ImportTable");let r;return r=JSON.stringify(((e,t)=>hr(e,{ClientToken:[!0,e=>e??be()],InputCompressionType:[],InputFormat:[],InputFormatOptions:br,S3BucketSource:br,TableCreationParameters:br}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ImportConflictException":case"com.amazonaws.dynamodb#ImportConflictException":throw await Qo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ImportTableDescription:e=>la(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class om extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,om.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListBackupsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListBackups");let r;return r=JSON.stringify(((e,t)=>hr(e,{BackupType:[],ExclusiveStartBackupArn:[],Limit:[],TableName:[],TimeRangeLowerBound:e=>Math.round(e.getTime()/1e3),TimeRangeUpperBound:e=>Math.round(e.getTime()/1e3)}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=Ea(n),{$metadata:Ba(e),...r}})(e,t)}}class im extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,im.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListContributorInsightsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListContributorInsights");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class am extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,am.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListExportsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListExports");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class sm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,sm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListGlobalTablesCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListGlobalTables");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class cm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,cm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListImportsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListImports");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=ba(n),{$metadata:Ba(e),...r}})(e,t)}}class dm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,dm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListTablesCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListTables");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class lm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,lm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ListTagsOfResourceCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("ListTagsOfResource");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class um extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,um.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"PutItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("PutItem");let r;return r=JSON.stringify(((e,t)=>hr(e,{ConditionExpression:[],ConditionalOperator:[],Expected:e=>Ci(e,t),ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),Item:e=>zi(e,t),ReturnConsumedCapacity:[],ReturnItemCollectionMetrics:[],ReturnValues:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ri(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await fi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{Attributes:e=>Ki(e,t),ConsumedCapacity:e=>ia(e,t),ItemCollectionMetrics:e=>ua(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class pm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,pm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"QueryCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("Query");let r;return r=JSON.stringify(((e,t)=>hr(e,{AttributesToGet:br,ConditionalOperator:[],ConsistentRead:[],ExclusiveStartKey:e=>Ai(e,t),ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),FilterExpression:[],IndexName:[],KeyConditionExpression:[],KeyConditions:e=>((e,t)=>Object.entries(e).reduce(((e,[n,r])=>(null===r||(e[n]=xi(r,t)),e)),{}))(e,t),Limit:[],ProjectionExpression:[],QueryFilter:e=>Ni(e,t),ReturnConsumedCapacity:[],ScanIndexForward:[],Select:[],TableName:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>ia(e,t),Count:kn,Items:e=>ha(e,t),LastEvaluatedKey:e=>fa(e,t),ScannedCount:kn}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class mm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,mm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"RestoreTableFromBackupCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("RestoreTableFromBackup");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"BackupInUseException":case"com.amazonaws.dynamodb#BackupInUseException":throw await $o(n,t);case"BackupNotFoundException":case"com.amazonaws.dynamodb#BackupNotFoundException":throw await Mo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"TableAlreadyExistsException":case"com.amazonaws.dynamodb#TableAlreadyExistsException":throw await pi(n,t);case"TableInUseException":case"com.amazonaws.dynamodb#TableInUseException":throw await mi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableDescription:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class hm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,hm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"RestoreTableToPointInTimeCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("RestoreTableToPointInTime");let r;return r=JSON.stringify(((e,t)=>hr(e,{BillingModeOverride:[],GlobalSecondaryIndexOverride:br,LocalSecondaryIndexOverride:br,ProvisionedThroughputOverride:br,RestoreDateTime:e=>Math.round(e.getTime()/1e3),SSESpecificationOverride:br,SourceTableArn:[],SourceTableName:[],TargetTableName:[],UseLatestRestorableTime:[]}))(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"InvalidRestoreTimeException":case"com.amazonaws.dynamodb#InvalidRestoreTimeException":throw await ni(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"PointInTimeRecoveryUnavailableException":case"com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException":throw await ii(n,t);case"TableAlreadyExistsException":case"com.amazonaws.dynamodb#TableAlreadyExistsException":throw await pi(n,t);case"TableInUseException":case"com.amazonaws.dynamodb#TableInUseException":throw await mi(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableDescription:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class ym extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,ym.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"ScanCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("Scan");let r;return r=JSON.stringify(((e,t)=>hr(e,{AttributesToGet:br,ConditionalOperator:[],ConsistentRead:[],ExclusiveStartKey:e=>Ai(e,t),ExpressionAttributeNames:br,ExpressionAttributeValues:e=>Pi(e,t),FilterExpression:[],IndexName:[],Limit:[],ProjectionExpression:[],ReturnConsumedCapacity:[],ScanFilter:e=>Ni(e,t),Segment:[],Select:[],TableName:[],TotalSegments:[]}))(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>ia(e,t),Count:kn,Items:e=>ha(e,t),LastEvaluatedKey:e=>fa(e,t),ScannedCount:kn}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class fm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,fm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"TagResourceCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("TagResource");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>e.statusCode>=300?(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t):(await Ua(e.body,t),{$metadata:Ba(e)}))(e,t)}}class gm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,gm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"TransactGetItemsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("TransactGetItems");let r;return r=JSON.stringify($i(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionCanceledException":case"com.amazonaws.dynamodb#TransactionCanceledException":throw await yi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),Responses:e=>ya(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class wm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,wm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"TransactWriteItemsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("TransactWriteItems");let r;return r=JSON.stringify(Mi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"IdempotentParameterMismatchException":case"com.amazonaws.dynamodb#IdempotentParameterMismatchException":throw await Jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionCanceledException":case"com.amazonaws.dynamodb#TransactionCanceledException":throw await yi(n,t);case"TransactionInProgressException":case"com.amazonaws.dynamodb#TransactionInProgressException":throw await gi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ConsumedCapacity:e=>aa(e,t),ItemCollectionMetrics:e=>pa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Em extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Em.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UntagResourceCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UntagResource");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>e.statusCode>=300?(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t):(await Ua(e.body,t),{$metadata:Ba(e)}))(e,t)}}class bm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,bm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateContinuousBackupsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateContinuousBackups");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ContinuousBackupsUnavailableException":case"com.amazonaws.dynamodb#ContinuousBackupsUnavailableException":throw await qo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{ContinuousBackupsDescription:e=>sa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class vm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,vm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateContributorInsightsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateContributorInsights");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}class Sm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Sm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateGlobalTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateGlobalTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Wo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ReplicaAlreadyExistsException":case"com.amazonaws.dynamodb#ReplicaAlreadyExistsException":throw await si(n,t);case"ReplicaNotFoundException":case"com.amazonaws.dynamodb#ReplicaNotFoundException":throw await ci(n,t);case"TableNotFoundException":case"com.amazonaws.dynamodb#TableNotFoundException":throw await hi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{GlobalTableDescription:e=>da(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class _m extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,_m.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateGlobalTableSettingsCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateGlobalTableSettings");let r;return r=JSON.stringify(qi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"GlobalTableNotFoundException":case"com.amazonaws.dynamodb#GlobalTableNotFoundException":throw await Wo(n,t);case"IndexNotFoundException":case"com.amazonaws.dynamodb#IndexNotFoundException":throw await Yo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ReplicaNotFoundException":case"com.amazonaws.dynamodb#ReplicaNotFoundException":throw await ci(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{GlobalTableName:Fn,ReplicaSettings:e=>Ta(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Im extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Im.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateItemCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateItem");let r;return r=JSON.stringify(Vi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"ConditionalCheckFailedException":case"com.amazonaws.dynamodb#ConditionalCheckFailedException":throw await jo(n,t);case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"ItemCollectionSizeLimitExceededException":case"com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException":throw await ri(n,t);case"ProvisionedThroughputExceededException":case"com.amazonaws.dynamodb#ProvisionedThroughputExceededException":throw await ai(n,t);case"RequestLimitExceeded":case"com.amazonaws.dynamodb#RequestLimitExceeded":throw await di(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);case"TransactionConflictException":case"com.amazonaws.dynamodb#TransactionConflictException":throw await fi(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{Attributes:e=>Ki(e,t),ConsumedCapacity:e=>ia(e,t),ItemCollectionMetrics:e=>ua(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class xm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,xm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateTableCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateTable");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableDescription:e=>Oa(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Cm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Cm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateTableReplicaAutoScalingCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateTableReplicaAutoScaling");let r;return r=JSON.stringify(Gi(e,t)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);let n={};return n=((e,t)=>hr(e,{TableAutoScalingDescription:e=>Da(e,t)}))(await qa(e.body,t),t),{$metadata:Ba(e),...n}})(e,t)}}class Tm extends xn{static getEndpointParameterInstructions(){return{UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}}constructor(e){super(),this.input=e}resolveMiddleware(e,t,n){this.middlewareStack.use(I(t,this.serialize,this.deserialize)),this.middlewareStack.use(k(t,Tm.getEndpointParameterInstructions()));const r=e.concat(this.middlewareStack),{logger:o}=t,i={logger:o,clientName:"DynamoDBClient",commandName:"UpdateTimeToLiveCommand",inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:a}=t;return r.resolve((e=>a.handle(e.request,n||{})),i)}serialize(e,t){return(async(e,t)=>{const n=ja("UpdateTimeToLive");let r;return r=JSON.stringify(br(e)),Ma(t,n,"/",void 0,r)})(e,t)}deserialize(e,t){return(async(e,t)=>{if(e.statusCode>=300)return(async(e,t)=>{const n={...e,body:await Va(e.body,t)},r=Ga(e,n.body);switch(r){case"InternalServerError":case"com.amazonaws.dynamodb#InternalServerError":throw await Zo(n,t);case"InvalidEndpointException":case"com.amazonaws.dynamodb#InvalidEndpointException":throw await ei(n,t);case"LimitExceededException":case"com.amazonaws.dynamodb#LimitExceededException":throw await oi(n,t);case"ResourceInUseException":case"com.amazonaws.dynamodb#ResourceInUseException":throw await li(n,t);case"ResourceNotFoundException":case"com.amazonaws.dynamodb#ResourceNotFoundException":throw await ui(n,t);default:const o=n.body;return $a({output:e,parsedBody:o,errorCode:r})}})(e,t);const n=await qa(e.body,t);let r={};return r=br(n),{$metadata:Ba(e),...r}})(e,t)}}const Pm={BatchExecuteStatementCommand:Ap,BatchGetItemCommand:kp,BatchWriteItemCommand:Dp,CreateBackupCommand:Rp,CreateGlobalTableCommand:Op,CreateTableCommand:Lp,DeleteBackupCommand:Fp,DeleteItemCommand:zp,DeleteTableCommand:Bp,DescribeBackupCommand:Up,DescribeContinuousBackupsCommand:$p,DescribeContributorInsightsCommand:Mp,DescribeEndpointsCommand:Ha,DescribeExportCommand:jp,DescribeGlobalTableCommand:qp,DescribeGlobalTableSettingsCommand:Vp,DescribeImportCommand:Gp,DescribeKinesisStreamingDestinationCommand:Hp,DescribeLimitsCommand:Kp,DescribeTableCommand:Wp,DescribeTableReplicaAutoScalingCommand:Jp,DescribeTimeToLiveCommand:Qp,DisableKinesisStreamingDestinationCommand:Xp,EnableKinesisStreamingDestinationCommand:Yp,ExecuteStatementCommand:Zp,ExecuteTransactionCommand:em,ExportTableToPointInTimeCommand:tm,GetItemCommand:nm,ImportTableCommand:rm,ListBackupsCommand:om,ListContributorInsightsCommand:im,ListExportsCommand:am,ListGlobalTablesCommand:sm,ListImportsCommand:cm,ListTablesCommand:dm,ListTagsOfResourceCommand:lm,PutItemCommand:um,QueryCommand:pm,RestoreTableFromBackupCommand:mm,RestoreTableToPointInTimeCommand:hm,ScanCommand:ym,TagResourceCommand:fm,TransactGetItemsCommand:gm,TransactWriteItemsCommand:wm,UntagResourceCommand:Em,UpdateContinuousBackupsCommand:bm,UpdateContributorInsightsCommand:vm,UpdateGlobalTableCommand:Sm,UpdateGlobalTableSettingsCommand:_m,UpdateItemCommand:Im,UpdateTableCommand:xm,UpdateTableReplicaAutoScalingCommand:Cm,UpdateTimeToLiveCommand:Tm};class Nm extends Np{}((e,t)=>{for(const n of Object.keys(e)){const r=e[n],o=async function(e,t,n){const o=new r(e);if("function"==typeof t)this.send(o,t);else{if("function"!=typeof n)return this.send(o,t);if("object"!=typeof t)throw new Error("Expected http options but got "+typeof t);this.send(o,t||{},n)}},i=(n[0].toLowerCase()+n.slice(1)).replace(/Command$/,"");t.prototype[i]=o}})(Pm,Nm);const Am=async(e,t,...n)=>await e.send(new im(t),...n);async function*km(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.NextToken=o,t.MaxResults=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Am(e.client,t,...n),yield r;const a=o;o=r.NextToken,i=!(!o||e.stopOnSameToken&&o===a)}}const Dm=async(e,t,...n)=>await e.send(new am(t),...n);async function*Rm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.NextToken=o,t.MaxResults=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Dm(e.client,t,...n),yield r;const a=o;o=r.NextToken,i=!(!o||e.stopOnSameToken&&o===a)}}const Om=async(e,t,...n)=>await e.send(new cm(t),...n);async function*Lm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.NextToken=o,t.PageSize=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Om(e.client,t,...n),yield r;const a=o;o=r.NextToken,i=!(!o||e.stopOnSameToken&&o===a)}}const Fm=async(e,t,...n)=>await e.send(new dm(t),...n);async function*zm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.ExclusiveStartTableName=o,t.Limit=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Fm(e.client,t,...n),yield r;const a=o;o=r.LastEvaluatedTableName,i=!(!o||e.stopOnSameToken&&o===a)}}const Bm=async(e,t,...n)=>await e.send(new pm(t),...n);async function*Um(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.ExclusiveStartKey=o,t.Limit=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await Bm(e.client,t,...n),yield r;const a=o;o=r.LastEvaluatedKey,i=!(!o||e.stopOnSameToken&&o===a)}}const $m=async(e,t,...n)=>await e.send(new ym(t),...n);async function*Mm(e,t,...n){let r,o=e.startingToken||void 0,i=!0;for(;i;){if(t.ExclusiveStartKey=o,t.Limit=e.pageSize,!(e.client instanceof Np))throw new Error("Invalid client, expected DynamoDB | DynamoDBClient");r=await $m(e.client,t,...n),yield r;const a=o;o=r.LastEvaluatedKey,i=!(!o||e.stopOnSameToken&&o===a)}}const jm=e=>new Promise((t=>setTimeout(t,1e3*e))),qm={minDelay:2,maxDelay:120};var Vm;!function(e){e.ABORTED="ABORTED",e.FAILURE="FAILURE",e.SUCCESS="SUCCESS",e.RETRY="RETRY",e.TIMEOUT="TIMEOUT"}(Vm||(Vm={}));const Gm=e=>{if(e.state===Vm.ABORTED){const t=new Error(`${JSON.stringify({...e,reason:"Request was aborted"})}`);throw t.name="AbortError",t}if(e.state===Vm.TIMEOUT){const t=new Error(`${JSON.stringify({...e,reason:"Waiter has timed out"})}`);throw t.name="TimeoutError",t}if(e.state!==Vm.SUCCESS)throw new Error(`${JSON.stringify({result:e})}`);return e},Hm=(e,t,n,r)=>r>n?t:Km(e,e*2**(r-1)),Km=(e,t)=>e+Math.random()*(t-e),Wm=async({minDelay:e,maxDelay:t,maxWaitTime:n,abortController:r,client:o,abortSignal:i},a,s)=>{const{state:c,reason:d}=await s(o,a);if(c!==Vm.RETRY)return{state:c,reason:d};let l=1;const u=Date.now()+1e3*n,p=Math.log(t/e)/Math.log(2)+1;for(;;){if(r?.signal?.aborted||i?.aborted)return{state:Vm.ABORTED};const n=Hm(e,t,p,l);if(Date.now()+1e3*n>u)return{state:Vm.TIMEOUT};await jm(n);const{state:c,reason:d}=await s(o,a);if(c!==Vm.RETRY)return{state:c,reason:d};l+=1}},Jm=async e=>new Promise((t=>{e.onabort=()=>t({state:Vm.ABORTED})})),Qm=async(e,t,n)=>{const r={...qm,...e};(e=>{if(e.maxWaitTime<1)throw new Error("WaiterConfiguration.maxWaitTime must be greater than 0");if(e.minDelay<1)throw new Error("WaiterConfiguration.minDelay must be greater than 0");if(e.maxDelay<1)throw new Error("WaiterConfiguration.maxDelay must be greater than 0");if(e.maxWaitTime<=e.minDelay)throw new Error(`WaiterConfiguration.maxWaitTime [${e.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`);if(e.maxDelay<e.minDelay)throw new Error(`WaiterConfiguration.maxDelay [${e.maxDelay}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`)})(r);const o=[Wm(r,t,n)];return e.abortController&&o.push(Jm(e.abortController.signal)),e.abortSignal&&o.push(Jm(e.abortSignal)),Promise.race(o)},Xm=async(e,t)=>{let n;try{const r=await e.send(new Wp(t));n=r;try{if("ACTIVE"===r.Table.TableStatus)return{state:Vm.SUCCESS,reason:n}}catch(e){}}catch(e){if(n=e,e.name&&"ResourceNotFoundException"==e.name)return{state:Vm.RETRY,reason:n}}return{state:Vm.RETRY,reason:n}},Ym=async(e,t)=>Qm({minDelay:20,maxDelay:120,...e},t,Xm),Zm=async(e,t)=>{const n=await Qm({minDelay:20,maxDelay:120,...e},t,Xm);return Gm(n)},eh=async(e,t)=>{let n;try{n=await e.send(new Wp(t))}catch(e){if(n=e,e.name&&"ResourceNotFoundException"==e.name)return{state:Vm.SUCCESS,reason:n}}return{state:Vm.RETRY,reason:n}},th=async(e,t)=>Qm({minDelay:20,maxDelay:120,...e},t,eh),nh=async(e,t)=>{const n=await Qm({minDelay:20,maxDelay:120,...e},t,eh);return Gm(n)}},5074:(e,t,n)=>{n.r(t),n.d(t,{convertToAttr:()=>r,convertToNative:()=>y,marshall:()=>v,unmarshall:()=>S});const r=(e,t)=>{if(void 0===e)throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(null===e&&"object"==typeof e)return c();if(Array.isArray(e))return o(e,t);if("Set"===e?.constructor?.name)return i(e,t);if("Map"===e?.constructor?.name)return a(e,t);if("Object"===e?.constructor?.name||!e.constructor&&"object"==typeof e)return s(e,t);if(h(e))return 0===e.length&&t?.convertEmptyValues?c():d(e);if("boolean"==typeof e||"Boolean"===e?.constructor?.name)return{BOOL:e.valueOf()};if("number"==typeof e||"Number"===e?.constructor?.name)return m(e);if("bigint"==typeof e)return u(e);if("string"==typeof e||"String"===e?.constructor?.name)return 0===e.length&&t?.convertEmptyValues?c():l(e);if(t?.convertClassInstanceToMap&&"object"==typeof e)return s(e,t);throw new Error(`Unsupported type passed: ${e}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},o=(e,t)=>({L:e.filter((e=>!t?.removeUndefinedValues||t?.removeUndefinedValues&&void 0!==e)).map((e=>r(e,t)))}),i=(e,t)=>{const n=t?.removeUndefinedValues?new Set([...e].filter((e=>void 0!==e))):e;if(!t?.removeUndefinedValues&&n.has(void 0))throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(0===n.size){if(t?.convertEmptyValues)return c();throw new Error("Pass a non-empty set, or options.convertEmptyValues=true.")}const r=n.values().next().value;if("number"==typeof r)return{NS:Array.from(n).map(m).map((e=>e.N))};if("bigint"==typeof r)return{NS:Array.from(n).map(u).map((e=>e.N))};if("string"==typeof r)return{SS:Array.from(n).map(l).map((e=>e.S))};if(h(r))return{BS:Array.from(n).map(d).map((e=>e.B))};throw new Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},a=(e,t)=>({M:(e=>{const n={};for(const[o,i]of e)"function"==typeof i||void 0===i&&t?.removeUndefinedValues||(n[o]=r(i,t));return n})(e)}),s=(e,t)=>({M:(e=>{const n={};for(const o in e){const i=e[o];"function"==typeof i||void 0===i&&t?.removeUndefinedValues||(n[o]=r(i,t))}return n})(e)}),c=()=>({NULL:!0}),d=e=>({B:e}),l=e=>({S:e.toString()}),u=e=>({N:e.toString()}),p=e=>{throw new Error(`${e} ${"function"==typeof BigInt?"Use BigInt.":"Pass string value instead."} `)},m=e=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map((e=>e.toString())).includes(e.toString()))throw new Error(`Special numeric value ${e.toString()} is not allowed`);return e>Number.MAX_SAFE_INTEGER?p(`Number ${e.toString()} is greater than Number.MAX_SAFE_INTEGER.`):e<Number.MIN_SAFE_INTEGER&&p(`Number ${e.toString()} is lesser than Number.MIN_SAFE_INTEGER.`),{N:e.toString()}},h=e=>!!e?.constructor&&["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(e.constructor.name),y=(e,t)=>{for(const[n,r]of Object.entries(e))if(void 0!==r)switch(n){case"NULL":return null;case"BOOL":return Boolean(r);case"N":return f(r,t);case"B":return w(r);case"S":return g(r);case"L":return E(r,t);case"M":return b(r,t);case"NS":return new Set(r.map((e=>f(e,t))));case"BS":return new Set(r.map(w));case"SS":return new Set(r.map(g));default:throw new Error(`Unsupported type passed: ${n}`)}throw new Error(`No value defined: ${JSON.stringify(e)}`)},f=(e,t)=>{if(t?.wrapNumbers)return{value:e};const n=Number(e),r=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)&&!r.includes(n)){if("function"!=typeof BigInt)throw new Error(`${e} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);try{return BigInt(e)}catch(t){throw new Error(`${e} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}}return n},g=e=>e,w=e=>e,E=(e,t)=>e.map((e=>y(e,t))),b=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>(e[n]=y(r,t),e)),{});function v(e,t){const n=r(e,t),[o,i]=Object.entries(n)[0];switch(o){case"M":case"L":return i;default:return n}}const S=(e,t)=>y({M:e},t)},4378:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.extractRegionFromEndpoint=t.buildMqtt5FinalUsername=t.populate_username_string_with_custom_authorizer=t.is_string_and_not_empty=t.add_to_username_parameter=void 0;const a=i(n(6843));function s(e,t,n){let r=e;return-1!=r.indexOf("?")?r+="&":r+="?",-1!=t.indexOf(n)?r+t:r+n+t}function c(e){return null!=e&&"string"==typeof e&&""!=e}function d(e,t,n){t&&n.push([e,t])}t.add_to_username_parameter=s,t.is_string_and_not_empty=c,t.populate_username_string_with_custom_authorizer=function(e,t,n,r,o,i,a){let d="";if(e&&(d+=e),0==c(t)?c(o)&&o&&(d+=o):d+=t,c(n)&&n&&(d=s(d,n,"x-amz-customauthorizer-name=")),c(r)&&r&&(d=s(d,r,"x-amz-customauthorizer-signature="),(c(i)&&i||c(a)&&a)&&console.log("Warning: Signed custom authorizers with signature will not work without a token key name and token value. Your connection may be rejected/stalled on the IoT Core side due to this. Please set the token key name and token value to connect to a signed custom authorizer.")),c(r)||c(a)||c(i)){if(!a||!i)throw new Error("Token-based custom authentication requires all token-related properties to be set");d=s(d,a,i+"=")}return d},t.buildMqtt5FinalUsername=function(e){let t="",n=[];if(e){let r=!1;if((e.tokenValue||e.tokenKeyName||e.tokenSignature)&&(r=!0,!e.tokenValue||!e.tokenKeyName||!e.tokenSignature))throw new Error("Token-based custom authentication requires all token-related properties to be set");let o=e.username,i=(null!=o?o:"").split("?"),a=i.slice(1);if(t=i[0],a.length>1)throw new Error("Custom auth username property value is invalid");1==a.length&&a[0].split("&").forEach(((e,t,r)=>{var o;let i=e.split("=");n.push([i[0],null!==(o=i[1])&&void 0!==o?o:""])})),d("x-amz-customauthorizer-name",e.authorizerName,n),r&&(d(e.tokenKeyName,e.tokenValue,n),d("x-amz-customauthorizer-signature",e.tokenSignature,n))}return n.push(["SDK","NodeJSv2"]),n.push(["Version",a.crt_version()]),(null!=t?t:"")+"?"+n.map((e=>`${e[0]}=${e[1]}`)).join("&")},t.extractRegionFromEndpoint=function(e){const t=e.match(/^[\w\-]+\.[\w\-]+\.([\w+\-]+)\./);if(t)return t[1];throw new Error("AWS region could not be extracted from endpoint. Use 'region' property on WebsocketConfig to set manually.")}},7482:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.newCancellablePromiseFromNextEvent=t.CancelController=t.EVENT_NAME=void 0;const a=n(2361),s=i(n(7113));t.EVENT_NAME="cancelled",t.CancelController=class{constructor(e){this.cancelled=!1,e&&e.emitterFactory?this.emitter=e.emitterFactory():this.emitter=new a.EventEmitter}cancel(){this.cancelled||(this.cancelled=!0,this.emitter.emit(t.EVENT_NAME),this.emitter.removeAllListeners(t.EVENT_NAME))}hasBeenCancelled(){return this.cancelled}addListener(e){if(!this.cancelled)return this.emitter.on(t.EVENT_NAME,e),()=>{this.emitter.removeListener(t.EVENT_NAME,e)};e()}},t.newCancellablePromiseFromNextEvent=function(e){let t,n,r=s.newLiftedPromise();return t=t=>{try{e.eventDataTransformer?r.resolve(e.eventDataTransformer(t)):r.resolve(t)}catch(e){r.reject(e)}},e.emitter.addListener(e.eventName,t),e.cancelController&&(n=e.cancelController.addListener((()=>{r.reject(e.cancelMessage)}))),s.makeSelfCleaningPromise(r.promise,(()=>{t&&e.emitter.removeListener(e.eventName,t),n&&n()}))}},9651:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferedEventEmitter=void 0;const r=n(2361);class o{constructor(e,t){this.event=e,this.args=t}}class i extends r.EventEmitter{constructor(){super(),this.corked=!1}cork(){this.corked=!0}uncork(){for(this.corked=!1;this.eventQueue;){const e=this.eventQueue;super.emit(e.event,...e.args),this.eventQueue=this.eventQueue.next}}emit(e,...t){if(this.corked){let n=this.lastQueuedEvent;return this.lastQueuedEvent=new o(e,t),n?n.next=this.lastQueuedEvent:this.eventQueue=this.lastQueuedEvent,this.listeners(e).length>0}return super.emit(e,...t)}}t.BufferedEventEmitter=i},3804:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.CommonHttpProxyOptions=t.HttpProxyAuthenticationType=t.HttpVersion=void 0,(r=t.HttpVersion||(t.HttpVersion={}))[r.Unknown=0]="Unknown",r[r.Http1_0=1]="Http1_0",r[r.Http1_1=2]="Http1_1",r[r.Http2=3]="Http2",function(e){e[e.None=0]="None",e[e.Basic=1]="Basic"}(n=t.HttpProxyAuthenticationType||(t.HttpProxyAuthenticationType={})),t.CommonHttpProxyOptions=class{constructor(e,t,r=n.None,o,i){this.host_name=e,this.port=t,this.auth_method=r,this.auth_username=o,this.auth_password=i}}},9712:(e,t)=>{var n,r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.SocketDomain=t.SocketType=t.TlsVersion=void 0,(o=t.TlsVersion||(t.TlsVersion={}))[o.SSLv3=0]="SSLv3",o[o.TLSv1=1]="TLSv1",o[o.TLSv1_1=2]="TLSv1_1",o[o.TLSv1_2=3]="TLSv1_2",o[o.TLSv1_3=4]="TLSv1_3",o[o.Default=128]="Default",(r=t.SocketType||(t.SocketType={}))[r.STREAM=0]="STREAM",r[r.DGRAM=1]="DGRAM",(n=t.SocketDomain||(t.SocketDomain={}))[n.IPV4=0]="IPV4",n[n.IPV6=1]="IPV6",n[n.LOCAL=2]="LOCAL"},5641:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_RECONNECT_MIN_SEC=t.DEFAULT_RECONNECT_MAX_SEC=t.MqttWill=t.QoS=void 0,(n=t.QoS||(t.QoS={}))[n.AtMostOnce=0]="AtMostOnce",n[n.AtLeastOnce=1]="AtLeastOnce",n[n.ExactlyOnce=2]="ExactlyOnce",t.MqttWill=class{constructor(e,t,n,r=!1){this.topic=e,this.qos=t,this.payload=n,this.retain=r}},t.DEFAULT_RECONNECT_MAX_SEC=128,t.DEFAULT_RECONNECT_MIN_SEC=1},5018:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.RetryJitterType=t.ClientSessionBehavior=void 0,(r=t.ClientSessionBehavior||(t.ClientSessionBehavior={}))[r.Default=0]="Default",r[r.Clean=1]="Clean",r[r.RejoinPostSuccess=2]="RejoinPostSuccess",r[r.RejoinAlways=3]="RejoinAlways",(n=t.RetryJitterType||(t.RetryJitterType={}))[n.Default=0]="Default",n[n.None=1]="None",n[n.Full=2]="Full",n[n.Decorrelated=3]="Decorrelated"},202:(e,t)=>{var n,r,o,i,a,s,c,d,l;Object.defineProperty(t,"__esModule",{value:!0}),t.PacketType=t.RetainHandlingType=t.QoS=t.PayloadFormatIndicator=t.isSuccessfulPubackReasonCode=t.PubackReasonCode=t.isSuccessfulUnsubackReasonCode=t.UnsubackReasonCode=t.isSuccessfulSubackReasonCode=t.SubackReasonCode=t.isSuccessfulDisconnectReasonCode=t.DisconnectReasonCode=t.isSuccessfulConnectReasonCode=t.ConnectReasonCode=void 0,(l=t.ConnectReasonCode||(t.ConnectReasonCode={}))[l.Success=0]="Success",l[l.UnspecifiedError=128]="UnspecifiedError",l[l.MalformedPacket=129]="MalformedPacket",l[l.ProtocolError=130]="ProtocolError",l[l.ImplementationSpecificError=131]="ImplementationSpecificError",l[l.UnsupportedProtocolVersion=132]="UnsupportedProtocolVersion",l[l.ClientIdentifierNotValid=133]="ClientIdentifierNotValid",l[l.BadUsernameOrPassword=134]="BadUsernameOrPassword",l[l.NotAuthorized=135]="NotAuthorized",l[l.ServerUnavailable=136]="ServerUnavailable",l[l.ServerBusy=137]="ServerBusy",l[l.Banned=138]="Banned",l[l.BadAuthenticationMethod=140]="BadAuthenticationMethod",l[l.TopicNameInvalid=144]="TopicNameInvalid",l[l.PacketTooLarge=149]="PacketTooLarge",l[l.QuotaExceeded=151]="QuotaExceeded",l[l.PayloadFormatInvalid=153]="PayloadFormatInvalid",l[l.RetainNotSupported=154]="RetainNotSupported",l[l.QosNotSupported=155]="QosNotSupported",l[l.UseAnotherServer=156]="UseAnotherServer",l[l.ServerMoved=157]="ServerMoved",l[l.ConnectionRateExceeded=159]="ConnectionRateExceeded",t.isSuccessfulConnectReasonCode=function(e){return e<128},(d=t.DisconnectReasonCode||(t.DisconnectReasonCode={}))[d.NormalDisconnection=0]="NormalDisconnection",d[d.DisconnectWithWillMessage=4]="DisconnectWithWillMessage",d[d.UnspecifiedError=128]="UnspecifiedError",d[d.MalformedPacket=129]="MalformedPacket",d[d.ProtocolError=130]="ProtocolError",d[d.ImplementationSpecificError=131]="ImplementationSpecificError",d[d.NotAuthorized=135]="NotAuthorized",d[d.ServerBusy=137]="ServerBusy",d[d.ServerShuttingDown=139]="ServerShuttingDown",d[d.KeepAliveTimeout=141]="KeepAliveTimeout",d[d.SessionTakenOver=142]="SessionTakenOver",d[d.TopicFilterInvalid=143]="TopicFilterInvalid",d[d.TopicNameInvalid=144]="TopicNameInvalid",d[d.ReceiveMaximumExceeded=147]="ReceiveMaximumExceeded",d[d.TopicAliasInvalid=148]="TopicAliasInvalid",d[d.PacketTooLarge=149]="PacketTooLarge",d[d.MessageRateTooHigh=150]="MessageRateTooHigh",d[d.QuotaExceeded=151]="QuotaExceeded",d[d.AdministrativeAction=152]="AdministrativeAction",d[d.PayloadFormatInvalid=153]="PayloadFormatInvalid",d[d.RetainNotSupported=154]="RetainNotSupported",d[d.QosNotSupported=155]="QosNotSupported",d[d.UseAnotherServer=156]="UseAnotherServer",d[d.ServerMoved=157]="ServerMoved",d[d.SharedSubscriptionsNotSupported=158]="SharedSubscriptionsNotSupported",d[d.ConnectionRateExceeded=159]="ConnectionRateExceeded",d[d.MaximumConnectTime=160]="MaximumConnectTime",d[d.SubscriptionIdentifiersNotSupported=161]="SubscriptionIdentifiersNotSupported",d[d.WildcardSubscriptionsNotSupported=162]="WildcardSubscriptionsNotSupported",t.isSuccessfulDisconnectReasonCode=function(e){return e<128},(c=t.SubackReasonCode||(t.SubackReasonCode={}))[c.GrantedQoS0=0]="GrantedQoS0",c[c.GrantedQoS1=1]="GrantedQoS1",c[c.GrantedQoS2=2]="GrantedQoS2",c[c.UnspecifiedError=128]="UnspecifiedError",c[c.ImplementationSpecificError=131]="ImplementationSpecificError",c[c.NotAuthorized=135]="NotAuthorized",c[c.TopicFilterInvalid=143]="TopicFilterInvalid",c[c.PacketIdentifierInUse=145]="PacketIdentifierInUse",c[c.QuotaExceeded=151]="QuotaExceeded",c[c.SharedSubscriptionsNotSupported=158]="SharedSubscriptionsNotSupported",c[c.SubscriptionIdentifiersNotSupported=161]="SubscriptionIdentifiersNotSupported",c[c.WildcardSubscriptionsNotSupported=162]="WildcardSubscriptionsNotSupported",t.isSuccessfulSubackReasonCode=function(e){return e<128},(s=t.UnsubackReasonCode||(t.UnsubackReasonCode={}))[s.Success=0]="Success",s[s.NoSubscriptionExisted=17]="NoSubscriptionExisted",s[s.UnspecifiedError=128]="UnspecifiedError",s[s.ImplementationSpecificError=131]="ImplementationSpecificError",s[s.NotAuthorized=135]="NotAuthorized",s[s.TopicFilterInvalid=143]="TopicFilterInvalid",s[s.PacketIdentifierInUse=145]="PacketIdentifierInUse",t.isSuccessfulUnsubackReasonCode=function(e){return e<128},(a=t.PubackReasonCode||(t.PubackReasonCode={}))[a.Success=0]="Success",a[a.NoMatchingSubscribers=16]="NoMatchingSubscribers",a[a.UnspecifiedError=128]="UnspecifiedError",a[a.ImplementationSpecificError=131]="ImplementationSpecificError",a[a.NotAuthorized=135]="NotAuthorized",a[a.TopicNameInvalid=144]="TopicNameInvalid",a[a.PacketIdentifierInUse=145]="PacketIdentifierInUse",a[a.QuotaExceeded=151]="QuotaExceeded",a[a.PayloadFormatInvalid=153]="PayloadFormatInvalid",t.isSuccessfulPubackReasonCode=function(e){return e<128},(i=t.PayloadFormatIndicator||(t.PayloadFormatIndicator={}))[i.Bytes=0]="Bytes",i[i.Utf8=1]="Utf8",(o=t.QoS||(t.QoS={}))[o.AtMostOnce=0]="AtMostOnce",o[o.AtLeastOnce=1]="AtLeastOnce",o[o.ExactlyOnce=2]="ExactlyOnce",(r=t.RetainHandlingType||(t.RetainHandlingType={}))[r.SendOnSubscribe=0]="SendOnSubscribe",r[r.SendOnSubscribeIfNew=1]="SendOnSubscribeIfNew",r[r.DontSend=2]="DontSend",(n=t.PacketType||(t.PacketType={}))[n.Connect=1]="Connect",n[n.Connack=2]="Connack",n[n.Publish=3]="Publish",n[n.Puback=4]="Puback",n[n.Pubrec=5]="Pubrec",n[n.Pubrel=6]="Pubrel",n[n.Pubcomp=7]="Pubcomp",n[n.Subscribe=8]="Subscribe",n[n.Suback=9]="Suback",n[n.Unsubscribe=10]="Unsubscribe",n[n.Unsuback=11]="Unsuback",n[n.Pingreq=12]="Pingreq",n[n.Pingresp=13]="Pingresp",n[n.Disconnect=14]="Disconnect",n[n.Auth=15]="Auth"},4231:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_KEEP_ALIVE=t.normalize_payload=void 0,t.normalize_payload=function(e){if(e instanceof Buffer)return e;if("string"==typeof e)return e;if(ArrayBuffer.isView(e)){const t=e;return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}if(e instanceof ArrayBuffer)return Buffer.from(e);if("object"==typeof e)return JSON.stringify(e);if(!e)return"";throw new TypeError("payload parameter must be a string, object, or DataView.")},t.DEFAULT_KEEP_ALIVE=1200},6843:(e,t,n)=>{function r(){return"object"==typeof process&&"object"==typeof process.versions&&void 0!==process.versions.node}function o(){try{return n(5062)}catch(e){return{name:"aws-crt-nodejs",version:"UNKNOWN"}}}Object.defineProperty(t,"__esModule",{value:!0}),t.crt_version=t.package_info=t.is_browser=t.is_nodejs=void 0,t.is_nodejs=r,t.is_browser=function(){return!r()},t.package_info=o,t.crt_version=function(){return o().version}},7113:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.newLiftedPromise=t.makeSelfCleaningPromise=void 0,t.makeSelfCleaningPromise=function(e,t){return t?e.finally((()=>{t()})):e},t.newLiftedPromise=function(e){let t,n,r=new Promise(((e,r)=>{t=e,n=r}));if(!t||!n)throw new Error("Failed to bind resolve and reject when making lifted promise");return e&&e(t,n),{promise:r,resolve:t,reject:n}}},4103:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0,t.using=function(e,t){return n(this,void 0,void 0,(function*(){try{yield t(e)}finally{e.close()}}))}},8687:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CrtError=t.resource_safety=t.promise=t.platform=t.mqtt5=t.mqtt=t.iot=t.io=t.http=t.eventstream=t.crt=t.crypto=t.checksums=t.cancel=t.auth=void 0;const a=i(n(7482));t.cancel=a;const s=i(n(6843));t.platform=s;const c=i(n(7113));t.promise=c;const d=i(n(4103));t.resource_safety=d;const l=i(n(7822));t.auth=l;const u=i(n(5988));t.checksums=u;const p=i(n(7227));t.crt=p;const m=i(n(5145));t.crypto=m;const h=i(n(7259));t.eventstream=h;const y=i(n(8415));t.http=y;const f=i(n(3787));t.io=f;const g=i(n(9793));t.iot=g;const w=i(n(799));t.mqtt=w;const E=i(n(2385));t.mqtt5=E;const b=n(2875);Object.defineProperty(t,"CrtError",{enumerable:!0,get:function(){return b.CrtError}})},7822:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.aws_verify_sigv4a_signing=t.aws_sign_request=t.AwsSignedBodyHeaderType=t.AwsSignedBodyValue=t.AwsSignatureType=t.AwsSigningAlgorithm=t.AwsCredentialsProvider=void 0;const i=o(n(1221)),a=n(2875),s=n(3787);class c extends i.default.AwsCredentialsProvider{static newDefault(e=void 0){return super.newDefault(null!=e?e.native_handle():null)}static newStatic(e,t,n){return super.newStatic(e,t,n)}static newCognito(e){if(null==e||null==e)throw new a.CrtError("AwsCredentialsProvider newCognito: Cognito config not defined");return super.newCognito(e,null!=e.tlsContext?e.tlsContext.native_handle():(new s.ClientTlsContext).native_handle(),null!=e.bootstrap?e.bootstrap.native_handle():null,e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null)}static newX509(e){if(null==e||null==e)throw new a.CrtError("AwsCredentialsProvider newX509: X509 config not defined");return super.newX509(e,e.tlsContext.native_handle(),e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null)}}var d,l,u,p;t.AwsCredentialsProvider=c,(p=t.AwsSigningAlgorithm||(t.AwsSigningAlgorithm={}))[p.SigV4=0]="SigV4",p[p.SigV4Asymmetric=1]="SigV4Asymmetric",(u=t.AwsSignatureType||(t.AwsSignatureType={}))[u.HttpRequestViaHeaders=0]="HttpRequestViaHeaders",u[u.HttpRequestViaQueryParams=1]="HttpRequestViaQueryParams",u[u.HttpRequestChunk=2]="HttpRequestChunk",u[u.HttpRequestEvent=3]="HttpRequestEvent",(l=t.AwsSignedBodyValue||(t.AwsSignedBodyValue={})).EmptySha256="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",l.UnsignedPayload="UNSIGNED-PAYLOAD",l.StreamingAws4HmacSha256Payload="STREAMING-AWS4-HMAC-SHA256-PAYLOAD",l.StreamingAws4HmacSha256Events="STREAMING-AWS4-HMAC-SHA256-EVENTS",(d=t.AwsSignedBodyHeaderType||(t.AwsSignedBodyHeaderType={}))[d.None=0]="None",d[d.XAmzContentSha256=1]="XAmzContentSha256",t.aws_sign_request=function(e,t){return r(this,void 0,void 0,(function*(){return new Promise(((n,r)=>{try{i.default.aws_sign_request(e,t,(t=>{0==t?n(e):r(new a.CrtError(t))}))}catch(e){r(e)}}))}))},t.aws_verify_sigv4a_signing=function(e,t,n,r,o,a){return i.default.aws_verify_sigv4a_signing(e,t,n,r,o,a)}},8583:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AwsIotMqttConnectionConfigBuilder=void 0;const s=n(5641),c=i(n(3787)),d=n(3787),l=i(n(6843)),u=n(2875),p=n(7822),m=i(n(4378));class h{constructor(e){this.tls_ctx_options=e,this.params={client_id:"",host_name:"",socket_options:new c.SocketOptions,port:8883,use_websocket:!1,clean_session:!1,keep_alive:void 0,will:void 0,username:"",password:void 0,tls_ctx:void 0,reconnect_min_sec:s.DEFAULT_RECONNECT_MIN_SEC,reconnect_max_sec:s.DEFAULT_RECONNECT_MAX_SEC},this.is_using_custom_authorizer=!1}static new_mtls_builder_from_path(e,t){let n=new h(d.TlsContextOptions.create_client_with_mtls_from_path(e,t));return n.params.port=8883,c.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),n}static new_mtls_builder(e,t){let n=new h(d.TlsContextOptions.create_client_with_mtls(e,t));return n.params.port=8883,c.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),n}static new_mtls_pkcs11_builder(e){let t=new h(d.TlsContextOptions.create_client_with_mtls_pkcs11(e));return t.params.port=8883,c.is_alpn_available()&&t.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),t}static new_mtls_pkcs12_builder(e){let t=new h(d.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(e.pkcs12_file,e.pkcs12_password));return t.params.port=8883,c.is_alpn_available()&&t.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),t}static new_mtls_windows_cert_store_path_builder(e){let t=new h(d.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(e));return t.params.port=8883,c.is_alpn_available()&&t.tls_ctx_options.alpn_list.unshift("x-amzn-mqtt-ca"),t}static new_default_builder(){let e=new c.TlsContextOptions;return new h(e)}static new_websocket_builder(...e){return this.new_with_websockets(...e)}static configure_websocket_handshake(e,t){if(t){if(null==e||null==e)throw new u.CrtError("AwsIotMqttConnectionConfigBuilder configure_websocket_handshake: builder not defined");e.params.websocket_handshake_transform=(e,n)=>a(this,void 0,void 0,(function*(){var r,o,i;const a=null!==(o=null===(r=t.create_signing_config)||void 0===r?void 0:r.call(t))&&void 0!==o?o:{algorithm:p.AwsSigningAlgorithm.SigV4,signature_type:p.AwsSignatureType.HttpRequestViaQueryParams,provider:t.credentials_provider,region:t.region,service:null!==(i=t.service)&&void 0!==i?i:"iotdevicegateway",signed_body_value:p.AwsSignedBodyValue.EmptySha256,omit_session_token:!0};try{yield(0,p.aws_sign_request)(e,a),n()}catch(e){e instanceof u.CrtError?n(e.error_code):n(3)}}))}return e}static new_with_websockets(e){let t=null==e?void 0:e.tls_ctx_options;t||(t=new d.TlsContextOptions,t.alpn_list=[]);let n=new h(t);return n.params.use_websocket=!0,n.params.proxy_options=null==e?void 0:e.proxy_options,n.tls_ctx_options&&(n.params.port=443),this.configure_websocket_handshake(n,e),n}static new_builder_for_websocket(){return this.new_with_websockets()}with_certificate_authority_from_path(e,t){return this.tls_ctx_options.override_default_trust_store_from_path(e,t),this}with_certificate_authority(e){return this.tls_ctx_options.override_default_trust_store(e),this}with_endpoint(e){return this.params.host_name=e,this}with_port(e){return this.params.port=e,this}with_client_id(e){return this.params.client_id=e,this}with_clean_session(e){return this.params.clean_session=e,this}with_keep_alive_seconds(e){return this.params.keep_alive=e,this}with_timeout_ms(e){return this.with_ping_timeout_ms(e),this}with_ping_timeout_ms(e){return this.params.ping_timeout=e,this}with_protocol_operation_timeout_ms(e){return this.params.protocol_operation_timeout=e,this}with_will(e){return this.params.will=e,this}with_socket_options(e){return this.params.socket_options=e,this}with_credentials(e,t,n,r){return h.configure_websocket_handshake(this,{credentials_provider:p.AwsCredentialsProvider.newStatic(t,n,r),region:e,service:"iotdevicegateway"})}with_http_proxy_options(e){return this.params.proxy_options=e,this}with_custom_authorizer(e,t,n,r,o,i){this.is_using_custom_authorizer=!0;let a=m.populate_username_string_with_custom_authorizer("",e,t,n,this.params.username,o,i);return this.params.username=a,this.params.password=r,this.params.use_websocket||(this.tls_ctx_options.alpn_list=["mqtt"]),this.params.port=443,this}with_username(e){return this.params.username=e,this}with_password(e){return this.params.password=e,this}with_reconnect_max_sec(e){return this.params.reconnect_max_sec=e,this}with_reconnect_min_sec(e){return this.params.reconnect_min_sec=e,this}build(){var e,t,n;if(void 0===this.params.client_id||void 0===this.params.host_name)throw"client_id and endpoint are required";return 0==this.is_using_custom_authorizer&&m.is_string_and_not_empty(this.params.username)&&(-1==(null===(e=this.params.username)||void 0===e?void 0:e.indexOf("x-amz-customauthorizer-name="))&&-1==(null===(t=this.params.username)||void 0===t?void 0:t.indexOf("x-amz-customauthorizer-signature="))||(this.is_using_custom_authorizer=!0)),1==this.is_using_custom_authorizer&&443!=this.params.port&&console.log("Warning: Attempting to connect to authorizer with unsupported port. Port is not 443..."),void 0===this.params.tls_ctx&&(this.params.tls_ctx=new c.ClientTlsContext(this.tls_ctx_options)),0==m.is_string_and_not_empty(this.params.username)?this.params.username="?SDK=NodeJSv2&Version=":-1!=(null===(n=this.params.username)||void 0===n?void 0:n.indexOf("?"))?this.params.username+="&SDK=NodeJSv2&Version=":this.params.username+="?SDK=NodeJSv2&Version=",this.params.username+=l.crt_version(),this.params}}t.AwsIotMqttConnectionConfigBuilder=h},1838:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AwsIotMqtt5ClientConfigBuilder=void 0;const s=i(n(2385)),c=i(n(3787)),d=i(n(7822)),l=n(2875),u=i(n(4378)),p=i(n(4231));class m{constructor(e,t,n){this.tlsContextOptions=n,this.config={hostName:e,port:t,connectProperties:{keepAliveIntervalSeconds:p.DEFAULT_KEEP_ALIVE},extendedValidationAndFlowControlOptions:s.ClientExtendedValidationAndFlowControl.AwsIotCoreDefaults}}static newDirectMqttBuilderWithMtlsFromPath(e,t,n){let r=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_from_path(t,n));return c.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),r}static newDirectMqttBuilderWithMtlsFromMemory(e,t,n){let r=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls(t,n));return c.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),r}static newDirectMqttBuilderWithMtlsFromPkcs11(e,t){let n=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_pkcs11(t));return c.is_alpn_available()&&n.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),n}static newDirectMqttBuilderWithMtlsFromPkcs12(e,t){let n=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(t.pkcs12_file,t.pkcs12_password));return c.is_alpn_available()&&n.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),n}static newDirectMqttBuilderWithMtlsFromWindowsCertStorePath(e,t){let n=new m(e,m.DEFAULT_DIRECT_MQTT_PORT,c.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(t));return c.is_alpn_available()&&n.tlsContextOptions.alpn_list.unshift("x-amzn-mqtt-ca"),n}static newDirectMqttBuilderWithCustomAuth(e,t){let n=new m(e,m.DEFAULT_WEBSOCKET_MQTT_PORT,new c.TlsContextOptions);return n.customAuthConfig=t,n.tlsContextOptions.alpn_list=["mqtt"],n}static newWebsocketMqttBuilderWithSigv4Auth(e,t){let n=new c.TlsContextOptions;n.alpn_list=[];let r=new m(e,m.DEFAULT_WEBSOCKET_MQTT_PORT,n),o=null==t?void 0:t.credentialsProvider;return o||(o=d.AwsCredentialsProvider.newDefault()),r.config.websocketHandshakeTransform=(n,r)=>a(this,void 0,void 0,(function*(){var i;try{const a={algorithm:d.AwsSigningAlgorithm.SigV4,signature_type:d.AwsSignatureType.HttpRequestViaQueryParams,provider:o,region:null!==(i=null==t?void 0:t.region)&&void 0!==i?i:u.extractRegionFromEndpoint(e),service:"iotdevicegateway",signed_body_value:d.AwsSignedBodyValue.EmptySha256,omit_session_token:!0};yield d.aws_sign_request(n,a),r()}catch(e){e instanceof l.CrtError?r(e.error_code):r(3)}})),r}static newWebsocketMqttBuilderWithCustomAuth(e,t){let n=new m(e,m.DEFAULT_WEBSOCKET_MQTT_PORT,new c.TlsContextOptions);return n.customAuthConfig=t,n.config.websocketHandshakeTransform=(e,t)=>a(this,void 0,void 0,(function*(){t(0)})),n}withCertificateAuthorityFromPath(e,t){return this.tlsContextOptions.override_default_trust_store_from_path(e,t),this}withCertificateAuthority(e){return this.tlsContextOptions.override_default_trust_store(e),this}withPort(e){return this.config.port=e,this}withConnectProperties(e){return this.config.connectProperties=e,this}withSessionBehavior(e){return this.config.sessionBehavior=e,this}withRetryJitterMode(e){return this.config.retryJitterMode=e,this}withMinReconnectDelayMs(e){return this.config.minReconnectDelayMs=e,this}withMaxReconnectDelayMs(e){return this.config.maxReconnectDelayMs=e,this}withMinConnectedTimeToResetReconnectDelayMs(e){return this.config.minConnectedTimeToResetReconnectDelayMs=e,this}withConnackTimeoutMs(e){return this.config.connackTimeoutMs=e,this}withOfflineQueueBehavior(e){return this.config.offlineQueueBehavior=e,this}withPingTimeoutMs(e){return this.config.pingTimeoutMs=e,this}withAckTimeoutSeconds(e){return this.config.ackTimeoutSeconds=e,this}withSocketOptions(e){return this.config.socketOptions=e,this}withHttpProxyOptions(e){return this.config.httpProxyOptions=e,this}withExtendedValidationAndFlowControlOptions(e){return this.config.extendedValidationAndFlowControlOptions=e,this}build(){var e,t;return void 0===this.config.tlsCtx&&(this.config.tlsCtx=new c.ClientTlsContext(this.tlsContextOptions)),this.config.connectProperties&&(this.config.connectProperties.username=u.buildMqtt5FinalUsername(this.customAuthConfig),(null===(e=this.customAuthConfig)||void 0===e?void 0:e.password)&&(this.config.connectProperties.password=null===(t=this.customAuthConfig)||void 0===t?void 0:t.password)),this.config}}t.AwsIotMqtt5ClientConfigBuilder=m,m.DEFAULT_WEBSOCKET_MQTT_PORT=443,m.DEFAULT_DIRECT_MQTT_PORT=8883},1221:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(1017)),s=n(2037),c=n(7147),d=n(7282),l="Please upgrade to node >=10.16.0, or use the provided browser implementation.";if(!("napi"in d.versions))throw new Error("The current runtime is not reporting an NAPI version. "+l);if(parseInt(d.versions.napi)<4)throw new Error("The AWS CRT native implementation requires that NAPI version 4 be present. "+l);const u=`${s.platform}-${s.arch}`;let p=a.resolve(__dirname,"..","..");const m=a.join(p,"dist");(0,c.existsSync)(m)&&(p=m);const h=a.resolve(p,"bin"),y=[a.join(h,u,"aws-crt-nodejs")];let f;for(const e of y)if((0,c.existsSync)(e+".node")){f=n(1309)(e);break}if(null==f)throw new Error("AWS CRT binary not present in any of the following locations:\n\t"+y.join("\n\t"));t.default=f},5988:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.crc32c=t.crc32=void 0;const o=r(n(1221));t.crc32=function(e,t){return o.default.checksums_crc32(e,t)},t.crc32c=function(e,t){return o.default.checksums_crc32c(e,t)}},7227:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.native_memory_dump=t.native_memory=void 0;const o=r(n(1221));t.native_memory=function(){return o.default.native_memory()},t.native_memory_dump=function(){return o.default.native_memory_dump()}},5145:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hmac_sha256=t.Sha256Hmac=t.hash_sha1=t.Sha1Hash=t.hash_sha256=t.Sha256Hash=t.hash_md5=t.Md5Hash=void 0;const o=r(n(1221)),i=n(8763);class a extends i.NativeResource{update(e){o.default.hash_update(this.native_handle(),e)}finalize(e){return o.default.hash_digest(this.native_handle(),e)}constructor(e){super(e)}}t.Md5Hash=class extends a{constructor(){super(o.default.hash_md5_new())}},t.hash_md5=function(e,t){return o.default.hash_md5_compute(e,t)},t.Sha256Hash=class extends a{constructor(){super(o.default.hash_sha256_new())}},t.hash_sha256=function(e,t){return o.default.hash_sha256_compute(e,t)},t.Sha1Hash=class extends a{constructor(){super(o.default.hash_sha1_new())}},t.hash_sha1=function(e,t){return o.default.hash_sha1_compute(e,t)};class s extends i.NativeResource{update(e){o.default.hmac_update(this.native_handle(),e)}finalize(e){return o.default.hmac_digest(this.native_handle(),e)}constructor(e){super(e)}}t.Sha256Hmac=class extends s{constructor(e){super(o.default.hmac_sha256_new(e))}},t.hmac_sha256=function(e,t,n){return o.default.hmac_sha256_compute(e,t,n)}},2875:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CrtError=void 0;const o=r(n(1221));class i extends Error{constructor(e){super(function(e){return"number"==typeof e?o.default.error_code_to_string(e):e instanceof i?e.message:e.toString()}(e)),this.error=e,this.error_code=function(e){return"number"==typeof e?e:e instanceof i?e.error_code:void 0}(e),this.error_name=function(e){return"number"==typeof e?o.default.error_code_to_name(e):e instanceof i?e.error_name:void 0}(e)}}t.CrtError=i},7259:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientStream=t.ClientConnection=t.MessageType=t.MessageFlags=t.Header=t.HeaderType=void 0;const c=n(8763),d=n(9651),l=n(2875),u=i(n(3787)),p=i(n(6731)),m=i(n(7113)),h=s(n(1221));var y,f,g,w,E;!function(e){e[e.BooleanTrue=0]="BooleanTrue",e[e.BooleanFalse=1]="BooleanFalse",e[e.Byte=2]="Byte",e[e.Int16=3]="Int16",e[e.Int32=4]="Int32",e[e.Int64=5]="Int64",e[e.ByteBuffer=6]="ByteBuffer",e[e.String=7]="String",e[e.Timestamp=8]="Timestamp",e[e.UUID=9]="UUID"}(y=t.HeaderType||(t.HeaderType={}));class b{constructor(e,t,n){this.name=e,this.type=t,this.value=n}static validateHeaderName(e){if(0==e.length||e.length>127)throw new l.CrtError(`Event stream header name (${e}) is not valid`)}static newBoolean(e,t){return b.validateHeaderName(e),new b(e,t?y.BooleanTrue:y.BooleanFalse)}static newByte(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT8&&t<=p.MAX_INT8&&Number.isSafeInteger(t))return new b(e,y.Byte,t);throw new l.CrtError(`Illegal value for eventstream byte-valued header: ${t}`)}static newInt16(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT16&&t<=p.MAX_INT16&&Number.isSafeInteger(t))return new b(e,y.Int16,t);throw new l.CrtError(`Illegal value for eventstream int16-valued header: ${t}`)}static newInt32(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT32&&t<=p.MAX_INT32&&Number.isSafeInteger(t))return new b(e,y.Int32,t);throw new l.CrtError(`Illegal value for eventstream int32-valued header: ${t}`)}static newInt64FromNumber(e,t){if(b.validateHeaderName(e),Number.isSafeInteger(t))return new b(e,y.Int64,p.marshalInt64BigintAsBuffer(BigInt(t)));throw new l.CrtError(`Illegal value for eventstream int64-valued header: ${t}`)}static newInt64FromBigint(e,t){if(b.validateHeaderName(e),t>=p.MIN_INT64&&t<=p.MAX_INT64)return new b(e,y.Int64,p.marshalInt64BigintAsBuffer(t));throw new l.CrtError(`Illegal value for eventstream int64-valued header: ${t}`)}static newByteBuffer(e,t){return b.validateHeaderName(e),new b(e,y.ByteBuffer,t)}static newString(e,t){return b.validateHeaderName(e),new b(e,y.String,t)}static newTimeStampFromSecondsSinceEpoch(e,t){if(b.validateHeaderName(e),Number.isSafeInteger(t)&&t>=0)return new b(e,y.Timestamp,t);throw new l.CrtError(`Illegal value for eventstream timestamp-valued header: ${t}`)}static newTimeStampFromDate(e,t){b.validateHeaderName(e);const n=t.getTime();if(Number.isSafeInteger(n))return new b(e,y.Timestamp,n);throw new l.CrtError(`Illegal value for eventstream timestamp-valued header: ${t}`)}static newUUID(e,t){if(b.validateHeaderName(e),16==t.byteLength)return new b(e,y.UUID,t);throw new l.CrtError(`Illegal value for eventstream uuid-valued header: ${t}`)}toValue(e){if(e!=this.type)throw new l.CrtError(`Header of type (${this.type}) cannot be converted to type (${e})`);return this.value}asBoolean(){switch(this.type){case y.BooleanFalse:return!1;case y.BooleanTrue:return!0;default:throw new l.CrtError(`Header of type (${this.type}) cannot be converted to type (boolean)`)}}asByte(){return this.toValue(y.Byte)}asInt16(){return this.toValue(y.Int16)}asInt32(){return this.toValue(y.Int32)}asInt64(){return p.unmarshalInt64BigintFromBuffer(this.toValue(y.Int64))}asByteBuffer(){return this.toValue(y.ByteBuffer)}asString(){return this.toValue(y.String)}asTimestamp(){return this.toValue(y.Timestamp)}asUUID(){return this.toValue(y.UUID)}}function v(e){let t={type:e.type,flags:e.flags,payload:e.payload};var n;return e.headers&&(t.headers=(n=e.headers,Array.from(n,(e=>new b(e.name,e.type,e.value))))),t}t.Header=b,(E=t.MessageFlags||(t.MessageFlags={}))[E.None=0]="None",E[E.ConnectionAccepted=1]="ConnectionAccepted",E[E.TerminateStream=2]="TerminateStream",(w=t.MessageType||(t.MessageType={}))[w.ApplicationMessage=0]="ApplicationMessage",w[w.ApplicationError=1]="ApplicationError",w[w.Ping=2]="Ping",w[w.PingResponse=3]="PingResponse",w[w.Connect=4]="Connect",w[w.ConnectAck=5]="ConnectAck",w[w.ProtocolError=6]="ProtocolError",w[w.InternalError=7]="InternalError",function(e){e[e.None=0]="None",e[e.Connecting=1]="Connecting",e[e.Connected=2]="Connected",e[e.Disconnected=3]="Disconnected",e[e.Closed=4]="Closed"}(f||(f={}));class S extends((0,c.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e){if(void 0===e)throw new l.CrtError("Invalid configuration passed to eventstream ClientConnection constructor");super(),this.state=f.None,this._super(h.default.event_stream_client_connection_new(this,e,((e,t)=>{S._s_on_disconnect(e,t)}),((e,t)=>{S._s_on_protocol_message(e,t)}),e.socketOptions?e.socketOptions.native_handle():null,e.tlsCtx?e.tlsCtx.native_handle():null))}close(){this.state!=f.Closed&&(this.state=f.Closed,h.default.event_stream_client_connection_close(this.native_handle()))}connect(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{if(e)if(this.state==f.None){if(this.state=f.Connecting,e.cancelController){let n=()=>{r(new l.CrtError("Event stream connection connect() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(n),!t)return}try{h.default.event_stream_client_connection_connect(this.native_handle(),(function(e,t){return S._s_on_connection_setup(n,r,e,t)}))}catch(e){this.state=f.Disconnected,r(e)}}else r(new l.CrtError(`Event stream connection in a state (${this.state}) where connect() is not allowed.`));else r(new l.CrtError("Invalid options passed to event stream ClientConnection.connect"))}));return m.makeSelfCleaningPromise(n,t)}))}sendProtocolMessage(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{try{if(!e)return void r(new l.CrtError("Invalid options passed to event stream ClientConnection.sendProtocolMessage"));if(!this.isConnected())return void r(new l.CrtError(`Event stream connection in a state (${this.state}) where sending protocol messages is not allowed.`));if(e.cancelController){let i=()=>{r(new l.CrtError("Event stream connection sendProtocolMessage() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(i),!t)return}function o(e){return S._s_on_connection_send_protocol_message_completion(n,r,e)}h.default.event_stream_client_connection_send_protocol_message(this.native_handle(),e,o)}catch(a){r(a)}}));return m.makeSelfCleaningPromise(n,t)}))}isConnected(){return this.state==f.Connected}newStream(){if(!this.isConnected())throw new l.CrtError(`Event stream connection in a state (${this.state}) where creating new streams is forbidden.`);return new _(this)}on(e,t){return super.on(e,t),this}static _s_on_connection_setup(e,t,n,r){0==r&&n.state==f.Connecting?(n.state=f.Connected,e()):(n.state!=f.Closed&&(n.state=f.Disconnected),t(u.error_code_to_string(r)))}static _s_on_disconnect(e,t){e.state!=f.Closed&&(e.state=f.Disconnected),process.nextTick((()=>{e.emit("disconnection",{errorCode:t})}))}static _s_on_protocol_message(e,t){process.nextTick((()=>{e.emit("protocolMessage",{message:v(t)})}))}static _s_on_connection_send_protocol_message_completion(e,t,n){0==n?e():t(u.error_code_to_string(n))}}t.ClientConnection=S,S.DISCONNECTION="disconnection",S.PROTOCOL_MESSAGE="protocolMessage",function(e){e[e.None=0]="None",e[e.Activating=1]="Activating",e[e.Activated=2]="Activated",e[e.Ended=3]="Ended",e[e.Closed=4]="Closed"}(g||(g={}));class _ extends((0,c.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e){super(),this._super(h.default.event_stream_client_stream_new(this,e.native_handle(),(e=>{_._s_on_stream_ended(e)}),((e,t)=>{_._s_on_stream_message(e,t)}))),this.state=g.None}close(){this.state!=g.Closed&&(this.state=g.Closed,h.default.event_stream_client_stream_close(this.native_handle()))}activate(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{try{if(this.state!=g.None)return void r(new l.CrtError(`Event stream in a state (${this.state}) where activation is not allowed.`));if(void 0===e)return this.state=g.Ended,void r(new l.CrtError("Invalid options passed to ClientStream.activate"));if(this.state=g.Activating,e.cancelController){let i=()=>{r(new l.CrtError("Event stream activate() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(i),!t)return}function o(e,t){return _._s_on_stream_activated(n,r,e,t)}h.default.event_stream_client_stream_activate(this.native_handle(),e,o)}catch(a){this.state=g.Ended,r(a)}}));return m.makeSelfCleaningPromise(n,t)}))}sendMessage(e){return a(this,void 0,void 0,(function*(){let t,n=new Promise(((n,r)=>{try{if(!e)return void r(new l.CrtError("Invalid options passed to ClientStream.sendMessage"));if(this.state!=g.Activated)return void r(new l.CrtError(`Event stream in a state (${this.state}) where sending messages is not allowed.`));if(e.cancelController){let i=()=>{r(new l.CrtError("Event stream sendMessage() cancelled by external request.")),setImmediate((()=>{this.close()}))};if(t=e.cancelController.addListener(i),!t)return}function o(e){return _._s_on_stream_send_message_completion(n,r,e)}h.default.event_stream_client_stream_send_message(this.native_handle(),e,o)}catch(a){r(a)}}));return m.makeSelfCleaningPromise(n,t)}))}isActive(){return this.state==g.Activated}on(e,t){return super.on(e,t),this}static _s_on_stream_activated(e,t,n,r){0==r&&n.state==g.Activating?(n.state=g.Activated,e()):(n.state!=g.Closed&&(n.state=g.Ended),t(u.error_code_to_string(r)))}static _s_on_stream_send_message_completion(e,t,n){0==n?e():t(u.error_code_to_string(n))}static _s_on_stream_ended(e){process.nextTick((()=>{e.emit(_.ENDED,{})}))}static _s_on_stream_message(e,t){process.nextTick((()=>{e.emit(_.MESSAGE,{message:v(t)})}))}}t.ClientStream=_,_.ENDED="ended",_.MESSAGE="message"},6731:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unmarshalInt64BigintFromBuffer=t.marshalInt64BigintAsBuffer=t.MIN_INT64=t.MAX_INT64=t.MIN_INT32=t.MAX_INT32=t.MIN_INT16=t.MAX_INT16=t.MIN_INT8=t.MAX_INT8=void 0;const r=n(2875);t.MAX_INT8=127,t.MIN_INT8=-128,t.MAX_INT16=32767,t.MIN_INT16=-32768,t.MAX_INT32=2147483647,t.MIN_INT32=-2147483648,t.MAX_INT64=BigInt("9223372036854775807"),t.MIN_INT64=BigInt("-9223372036854775808");const o=BigInt("256");t.marshalInt64BigintAsBuffer=function(e){if(e<t.MIN_INT64||e>t.MAX_INT64)throw new r.CrtError("marshalInt64BigintAsBuffer expects a value that can fit in 8 bytes");let n=new Uint8Array(8);if(e<0){e=-e-BigInt(1);for(let t=0;t<8;++t)n[t]=255-Number(e%o),e/=o}else for(let t=0;t<8;++t)n[t]=Number(e%o),e/=o;return n},t.unmarshalInt64BigintFromBuffer=function(e){let t=BigInt(0),n=new Uint8Array(e);if(8!=n.length)throw new r.CrtError("unmarshalInt64BigintFromBuffer expects a byte buffer of length 8");let i=BigInt(1);if(0!=(128&n[7])){for(let e=0;e<n.length;++e)t+=BigInt(255-n[e])*i,i*=o;t+=BigInt(1),t=-t}else for(let e=0;e<n.length;++e)t+=BigInt(n[e])*i,i*=o;return t}},8415:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpClientConnectionManager=t.HttpClientStream=t.HttpStream=t.HttpClientConnection=t.HttpProxyOptions=t.HttpProxyConnectionType=t.HttpConnection=t.HttpRequest=t.HttpHeaders=t.HttpProxyAuthenticationType=void 0;const o=r(n(1221)),i=n(8763),a=n(2875),s=n(3804);var c=n(3804);Object.defineProperty(t,"HttpProxyAuthenticationType",{enumerable:!0,get:function(){return c.HttpProxyAuthenticationType}});const d=n(9651);t.HttpHeaders=o.default.HttpHeaders;const l=o.default.HttpRequest;t.HttpRequest=class extends l{constructor(e,t,n,r){super(e,t,n,null==r?void 0:r.native_handle())}};class u extends((0,i.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e){super(),this._super(e)}close(){o.default.http_connection_close(this.native_handle())}on(e,t){return super.on(e,t),"connect"==e&&process.nextTick((()=>{this.uncork()})),this}}var p;t.HttpConnection=u,u.CONNECT="connect",u.ERROR="error",u.CLOSE="close",function(e){e[e.Legacy=0]="Legacy",e[e.Forwarding=1]="Forwarding",e[e.Tunneling=2]="Tunneling"}(p=t.HttpProxyConnectionType||(t.HttpProxyConnectionType={}));class m extends s.CommonHttpProxyOptions{constructor(e,t,n=s.HttpProxyAuthenticationType.None,r,o,i,a){super(e,t,n,r,o),this.tls_opts=i,this.connection_type=a}create_native_handle(){return o.default.http_proxy_options_new(this.host_name,this.port,this.auth_method,this.auth_username,this.auth_password,this.tls_opts?this.tls_opts.native_handle():void 0,this.connection_type?this.connection_type:p.Legacy)}}t.HttpProxyOptions=m;class h extends u{constructor(e,t,n,r,i,s,c){if(null==r||null==r)throw new a.CrtError("HttpClientConnection constructor: socket_options not defined");super(c||o.default.http_connection_new(null!=e?e.native_handle():null,((e,t)=>{this._on_setup(e,t)}),((e,t)=>{this._on_shutdown(e,t)}),t,n,r.native_handle(),i?i.native_handle():void 0,s?s.create_native_handle():void 0)),this.bootstrap=e,this.socket_options=r,this.tls_opts=i}_on_setup(e,t){t?this.emit("error",new a.CrtError(t)):this.emit("connect")}_on_shutdown(e,t){t?this.emit("error",new a.CrtError(t)):this.emit("close")}request(e){let t;const n=o.default.http_stream_new(this.native_handle(),e,(e=>{t._on_complete(e)}),((e,n)=>{t._on_response(e,n)}),(e=>{t._on_body(e)}));return t=new f(n,this,e)}}t.HttpClientConnection=h;class y extends((0,i.NativeResourceMixin)(d.BufferedEventEmitter)){constructor(e,t){super(),this.connection=t,this._super(e),this.cork()}activate(){o.default.http_stream_activate(this.native_handle())}close(){o.default.http_stream_close(this.native_handle())}_on_body(e){this.emit("data",e)}_on_complete(e){if(e)return this.emit("error",new a.CrtError(e)),void this.close();this.on("end",(()=>{this.close()})),this.emit("end")}}t.HttpStream=y;class f extends y{constructor(e,t,n){super(e,t),this.request=n}status_code(){return this.response_status_code}on(e,t){return super.on(e,t),"response"==e&&process.nextTick((()=>{this.uncork()})),this}_on_response(e,n){this.response_status_code=e;let r=new t.HttpHeaders(n);this.emit("response",e,r)}}t.HttpClientStream=f,f.RESPONSE="response",f.DATA="data",f.ERROR="error",f.END="end",f.HEADERS="headers";class g extends i.NativeResource{constructor(e,t,n,r,i,s,c,d){if(null==s||null==s)throw new a.CrtError("HttpClientConnectionManager constructor: socket_options not defined");super(o.default.http_connection_manager_new(null!=e?e.native_handle():null,t,n,r,i,s.native_handle(),c?c.native_handle():void 0,d?d.create_native_handle():void 0,void 0)),this.bootstrap=e,this.host=t,this.port=n,this.max_connections=r,this.initial_window_size=i,this.socket_options=s,this.tls_opts=c,this.proxy_options=d,this.connections=new Map}acquire(){return new Promise(((e,t)=>{o.default.http_connection_manager_acquire(this.native_handle(),((n,r)=>{if(r)return void t(new a.CrtError(r));let o=this.connections.get(n);o||(o=new h(this.bootstrap,this.host,this.port,this.socket_options,this.tls_opts,this.proxy_options,n),this.connections.set(n,o),o.on("close",(()=>{this.connections.delete(n)}))),e(o)}))}))}release(e){if(null==e||null==e)throw new a.CrtError("HttpClientConnectionManager release: connection not defined");o.default.http_connection_manager_release(this.native_handle(),e.native_handle())}close(){o.default.http_connection_manager_close(this.native_handle())}}t.HttpClientConnectionManager=g},3787:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pkcs11Lib=t.TlsConnectionOptions=t.ServerTlsContext=t.ClientTlsContext=t.TlsContext=t.TlsContextOptions=t.SocketOptions=t.ClientBootstrap=t.InputStream=t.is_alpn_available=t.enable_logging=t.LogLevel=t.error_code_to_name=t.error_code_to_string=t.SocketDomain=t.SocketType=t.TlsVersion=void 0;const o=r(n(1221)),i=n(8763),a=n(9712);var s=n(9712);Object.defineProperty(t,"TlsVersion",{enumerable:!0,get:function(){return s.TlsVersion}}),Object.defineProperty(t,"SocketType",{enumerable:!0,get:function(){return s.SocketType}}),Object.defineProperty(t,"SocketDomain",{enumerable:!0,get:function(){return s.SocketDomain}});const c=n(2875);var d;t.error_code_to_string=function(e){return o.default.error_code_to_string(e)},t.error_code_to_name=function(e){return o.default.error_code_to_name(e)},(d=t.LogLevel||(t.LogLevel={}))[d.NONE=0]="NONE",d[d.FATAL=1]="FATAL",d[d.ERROR=2]="ERROR",d[d.WARN=3]="WARN",d[d.INFO=4]="INFO",d[d.DEBUG=5]="DEBUG",d[d.TRACE=6]="TRACE",t.enable_logging=function(e){o.default.io_logging_enable(e)},t.is_alpn_available=function(){return o.default.is_alpn_available()};class l extends i.NativeResource{constructor(e){super(o.default.io_input_stream_new(16384)),this.source=e,this.source.on("data",(e=>{e=Buffer.isBuffer(e)?e:Buffer.from(e.toString()),o.default.io_input_stream_append(this.native_handle(),e)})),this.source.on("end",(()=>{o.default.io_input_stream_append(this.native_handle(),void 0)}))}}t.InputStream=l;class u extends i.NativeResource{constructor(){super(o.default.io_client_bootstrap_new())}}t.ClientBootstrap=u;class p extends i.NativeResource{constructor(e=a.SocketType.STREAM,t=a.SocketDomain.IPV6,n=5e3,r=!1,i=0,s=0,c=0){super(o.default.io_socket_options_new(e,t,n,i,s,c,r))}}t.SocketOptions=p;class m{constructor(){this.min_tls_version=a.TlsVersion.Default,this.alpn_list=[],this.verify_peer=!0}override_default_trust_store_from_path(e,t){this.ca_dirpath=e,this.ca_filepath=t}override_default_trust_store(e){this.certificate_authority=e}static create_client_with_mtls(e,t){let n=new m;return n.certificate=e,n.private_key=t,n.verify_peer=!0,n}static create_client_with_mtls_from_path(e,t){let n=new m;return n.certificate_filepath=e,n.private_key_filepath=t,n.verify_peer=!0,n}static create_client_with_mtls_pkcs12_from_path(e,t){let n=new m;return n.pkcs12_filepath=e,n.pkcs12_password=t,n.verify_peer=!0,n}static create_client_with_mtls_pkcs_from_path(e,t){return this.create_client_with_mtls_pkcs12_from_path(e,t)}static create_client_with_mtls_pkcs11(e){let t=new m;return t.pkcs11_options=e,t.verify_peer=!0,t}static create_client_with_mtls_windows_cert_store_path(e){let t=new m;return t.windows_cert_store_path=e,t.verify_peer=!0,t}static create_server_with_mtls_from_path(e,t){let n=new m;return n.certificate_filepath=e,n.private_key_filepath=t,n.verify_peer=!1,n}static create_server_with_mtls_pkcs_from_path(e,t){let n=new m;return n.pkcs12_filepath=e,n.pkcs12_password=t,n.verify_peer=!1,n}}t.TlsContextOptions=m;class h extends i.NativeResource{constructor(e){if(null==e||null==e)throw new c.CrtError("TlsContext constructor: ctx_opt not defined");super(o.default.io_tls_ctx_new(e.min_tls_version,e.ca_filepath,e.ca_dirpath,e.certificate_authority,e.alpn_list&&e.alpn_list.length>0?e.alpn_list.join(";"):void 0,e.certificate_filepath,e.certificate,e.private_key_filepath,e.private_key,e.pkcs12_filepath,e.pkcs12_password,e.pkcs11_options,e.windows_cert_store_path,e.verify_peer))}}t.TlsContext=h,t.ClientTlsContext=class extends h{constructor(e){e||((e=new m).verify_peer=!0),super(e)}},t.ServerTlsContext=class extends h{constructor(e){e||((e=new m).verify_peer=!1),super(e)}};class y extends i.NativeResource{constructor(e,t,n=[]){if(null==e||null==e)throw new c.CrtError("TlsConnectionOptions constructor: tls_ctx not defined");super(o.default.io_tls_connection_options_new(e.native_handle(),t,n&&n.length>0?n.join(";"):void 0)),this.tls_ctx=e,this.server_name=t,this.alpn_list=n}}t.TlsConnectionOptions=y;class f extends i.NativeResource{constructor(e,t=f.InitializeFinalizeBehavior.DEFAULT){super(o.default.io_pkcs11_lib_new(e,t))}close(){o.default.io_pkcs11_lib_close(this.native_handle())}}t.Pkcs11Lib=f,function(e){let t;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.OMIT=1]="OMIT",e[e.STRICT=2]="STRICT"}(t=e.InitializeFinalizeBehavior||(e.InitializeFinalizeBehavior={}))}(f=t.Pkcs11Lib||(t.Pkcs11Lib={}))},9793:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(8583),t),o(n(1838),t)},799:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MqttClientConnection=t.MqttClient=t.MqttWill=t.QoS=t.HttpProxyOptions=void 0;const c=s(n(1221)),d=n(8763),l=n(9651),u=i(n(4231)),p=n(2875),m=i(n(3787));var h=n(8415);Object.defineProperty(t,"HttpProxyOptions",{enumerable:!0,get:function(){return h.HttpProxyOptions}});const y=n(5641);var f=n(5641);Object.defineProperty(t,"QoS",{enumerable:!0,get:function(){return f.QoS}}),Object.defineProperty(t,"MqttWill",{enumerable:!0,get:function(){return f.MqttWill}});class g extends d.NativeResource{constructor(e=void 0){super(c.default.mqtt_client_new(null!=e?e.native_handle():null)),this.bootstrap=e}new_connection(e){return new w(this,e)}}t.MqttClient=g;class w extends((0,d.NativeResourceMixin)(l.BufferedEventEmitter)){constructor(e,t){if(super(),this.client=e,this.config=t,null==t||null==t)throw new p.CrtError("MqttClientConnection constructor: config not defined");const n=t.will?{topic:t.will.topic,qos:t.will.qos,payload:u.normalize_payload(t.will.payload),retain:t.will.retain}:void 0;var r=y.DEFAULT_RECONNECT_MIN_SEC,o=y.DEFAULT_RECONNECT_MAX_SEC;if(t.reconnect_min_sec&&(r=t.reconnect_min_sec,o=Math.max(r,o)),t.reconnect_max_sec&&(o=t.reconnect_max_sec,r=Math.min(r,o)),null==e||null==e)throw new p.CrtError("MqttClientConnection constructor: client not defined");if(null==t.socket_options||null==t.socket_options)throw new p.CrtError("MqttClientConnection constructor: socket_options in configuration not defined");this._super(c.default.mqtt_client_connection_new(e.native_handle(),(e=>{this._on_connection_interrupted(e)}),((e,t)=>{this._on_connection_resumed(e,t)}),t.tls_ctx?t.tls_ctx.native_handle():null,n,t.username,t.password,t.use_websocket,t.proxy_options?t.proxy_options.create_native_handle():void 0,t.websocket_handshake_transform,r,o)),this.tls_ctx=t.tls_ctx,c.default.mqtt_client_connection_on_message(this.native_handle(),this._on_any_publish.bind(this)),this.on("error",(e=>{}))}close(){c.default.mqtt_client_connection_close(this.native_handle())}on(e,t){return super.on(e,t),"connect"==e&&process.nextTick((()=>{this.uncork()})),this}connect(){return a(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{if(t=this._reject(t),null==this.config.socket_options||null==this.config.socket_options)throw new p.CrtError("MqttClientConnection connect: socket_options in configuration not defined");try{c.default.mqtt_client_connection_connect(this.native_handle(),this.config.client_id,this.config.host_name,this.config.port,this.config.socket_options.native_handle(),this.config.keep_alive,this.config.ping_timeout,this.config.protocol_operation_timeout,this.config.clean_session,this._on_connect_callback.bind(this,e,t))}catch(e){t(e)}}))}))}reconnect(){return a(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{t=this._reject(t);try{c.default.mqtt_client_connection_reconnect(this.native_handle(),this._on_connect_callback.bind(this,e,t))}catch(e){t(e)}}))}))}publish(e,t,n,r=!1){return a(this,void 0,void 0,(function*(){return new Promise(((o,i)=>{i=this._reject(i);try{c.default.mqtt_client_connection_publish(this.native_handle(),e,u.normalize_payload(t),n,r,this._on_puback_callback.bind(this,o,i))}catch(e){i(e)}}))}))}subscribe(e,t,n){return a(this,void 0,void 0,(function*(){return new Promise(((r,o)=>{o=this._reject(o);try{c.default.mqtt_client_connection_subscribe(this.native_handle(),e,t,n,this._on_suback_callback.bind(this,r,o))}catch(e){o(e)}}))}))}unsubscribe(e){return a(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{n=this._reject(n);try{c.default.mqtt_client_connection_unsubscribe(this.native_handle(),e,this._on_unsuback_callback.bind(this,t,n))}catch(e){n(e)}}))}))}disconnect(){return a(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{t=this._reject(t);try{c.default.mqtt_client_connection_disconnect(this.native_handle(),this._on_disconnect_callback.bind(this,e))}catch(e){t(e)}}))}))}getQueueStatistics(){return c.default.mqtt_client_connection_get_queue_statistics(this.native_handle())}_reject(e){return t=>{e(t),process.nextTick((()=>{this.emit("error",new p.CrtError(t))}))}}_on_connection_interrupted(e){this.emit("interrupt",new p.CrtError(e))}_on_connection_resumed(e,t){this.emit("resume",e,t)}_on_any_publish(e,t,n,r,o){this.emit("message",e,t,n,r,o)}_on_connect_callback(e,t,n,r,o){0==n&&0==r?(e(o),this.emit("connect",o)):t(0!=n?"Failed to connect: "+m.error_code_to_string(n):"Server rejected connection.")}_on_puback_callback(e,t,n,r){0==r?e({packet_id:n}):t("Failed to publish: "+m.error_code_to_string(r))}_on_suback_callback(e,t,n,r,o,i){0==i?e({packet_id:n,topic:r,qos:o,error_code:i}):t("Failed to subscribe: "+m.error_code_to_string(i))}_on_unsuback_callback(e,t,n,r){0==r?e({packet_id:n}):t("Failed to unsubscribe: "+m.error_code_to_string(r))}_on_disconnect_callback(e){e(),this.emit("disconnect"),this.close()}}t.MqttClientConnection=w,w.CONNECT="connect",w.DISCONNECT="disconnect",w.ERROR="error",w.INTERRUPT="interrupt",w.RESUME="resume",w.MESSAGE="message"},2385:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Mqtt5Client=t.ClientExtendedValidationAndFlowControl=t.ClientOperationQueueBehavior=t.HttpProxyOptions=void 0;const d=c(n(1221)),l=n(8763),u=n(9651),p=i(n(3787)),m=i(n(4231)),h=n(2875);var y,f,g=n(8415);Object.defineProperty(t,"HttpProxyOptions",{enumerable:!0,get:function(){return g.HttpProxyOptions}}),a(n(5018),t),a(n(202),t),(f=t.ClientOperationQueueBehavior||(t.ClientOperationQueueBehavior={}))[f.Default=0]="Default",f[f.FailNonQos1PublishOnDisconnect=1]="FailNonQos1PublishOnDisconnect",f[f.FailQos0PublishOnDisconnect=2]="FailQos0PublishOnDisconnect",f[f.FailAllOnDisconnect=3]="FailAllOnDisconnect",(y=t.ClientExtendedValidationAndFlowControl||(t.ClientExtendedValidationAndFlowControl={}))[y.None=0]="None",y[y.AwsIotCoreDefaults=1]="AwsIotCoreDefaults";class w extends((0,l.NativeResourceMixin)(u.BufferedEventEmitter)){constructor(e){super(),this._super(d.default.mqtt5_client_new(this,e,(e=>{w._s_on_stopped(e)}),(e=>{w._s_on_attempting_connect(e)}),((e,t,n)=>{w._s_on_connection_success(e,t,n)}),((e,t,n)=>{w._s_on_connection_failure(e,new h.CrtError(t),n)}),((e,t,n)=>{w._s_on_disconnection(e,new h.CrtError(t),n)}),((e,t)=>{w._s_on_message_received(e,t)}),e.clientBootstrap?e.clientBootstrap.native_handle():null,e.socketOptions?e.socketOptions.native_handle():null,e.tlsCtx?e.tlsCtx.native_handle():null,e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null))}close(){d.default.mqtt5_client_close(this.native_handle())}start(){d.default.mqtt5_client_start(this.native_handle())}stop(e){d.default.mqtt5_client_stop(this.native_handle(),e)}subscribe(e){return s(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{try{d.default.mqtt5_client_subscribe(this.native_handle(),e,(function(e,r,o){return w._s_on_suback_callback(t,n,e,r,o)}))}catch(e){n(e)}}))}))}unsubscribe(e){return s(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{try{d.default.mqtt5_client_unsubscribe(this.native_handle(),e,(function(e,r,o){return w._s_on_unsuback_callback(t,n,e,r,o)}))}catch(e){n(e)}}))}))}publish(e){return s(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{e&&e.payload&&(e.payload=m.normalize_payload(e.payload));try{d.default.mqtt5_client_publish(this.native_handle(),e,(function(e,r,o){return w._s_on_puback_callback(t,n,e,r,o)}))}catch(e){n(e)}}))}))}getQueueStatistics(){return d.default.mqtt5_client_get_queue_statistics(this.native_handle())}on(e,t){return super.on(e,t),this}static _s_on_stopped(e){process.nextTick((()=>{e.emit(w.STOPPED,{})}))}static _s_on_attempting_connect(e){process.nextTick((()=>{e.emit(w.ATTEMPTING_CONNECT,{})}))}static _s_on_connection_success(e,t,n){let r={connack:t,settings:n};process.nextTick((()=>{e.emit(w.CONNECTION_SUCCESS,r)}))}static _s_on_connection_failure(e,t,n){let r={error:t};null!=n&&(r.connack=n),process.nextTick((()=>{e.emit(w.CONNECTION_FAILURE,r)}))}static _s_on_disconnection(e,t,n){let r={error:t};null!=n&&(r.disconnect=n),process.nextTick((()=>{e.emit(w.DISCONNECTION,r)}))}static _s_on_suback_callback(e,t,n,r,o){0==r&&void 0!==o?e(o):t(p.error_code_to_string(r))}static _s_on_unsuback_callback(e,t,n,r,o){0==r&&void 0!==o?e(o):t(p.error_code_to_string(r))}static _s_on_puback_callback(e,t,n,r,o){0==r?e(o):t(p.error_code_to_string(r))}static _s_on_message_received(e,t){let n={message:t};process.nextTick((()=>{e.emit(w.MESSAGE_RECEIVED,n)}))}}t.Mqtt5Client=w,w.ERROR="error",w.MESSAGE_RECEIVED="messageReceived",w.ATTEMPTING_CONNECT="attemptingConnect",w.CONNECTION_SUCCESS="connectionSuccess",w.CONNECTION_FAILURE="connectionFailure",w.DISCONNECTION="disconnection",w.STOPPED="stopped"},8763:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NativeResourceMixin=t.NativeResource=void 0,t.NativeResource=class{constructor(e){this.handle=e}native_handle(){return this.handle}},t.NativeResourceMixin=function(e){return class extends e{constructor(...e){const t=e.shift();super(...e),this._handle=t}_super(e){this._handle=e}native_handle(){return this._handle}}}},1309:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=1309,e.exports=t},5371:(e,t,n)=>{n(9738).config(Object.assign({},n(2547),n(2962)(process.argv)))},2962:e=>{const t=/^dotenv_config_(encoding|path|debug|override)=(.+)$/;e.exports=function(e){return e.reduce((function(e,n){const r=n.match(t);return r&&(e[r[1]]=r[2]),e}),{})}},2547:e=>{const t={};null!=process.env.DOTENV_CONFIG_ENCODING&&(t.encoding=process.env.DOTENV_CONFIG_ENCODING),null!=process.env.DOTENV_CONFIG_PATH&&(t.path=process.env.DOTENV_CONFIG_PATH),null!=process.env.DOTENV_CONFIG_DEBUG&&(t.debug=process.env.DOTENV_CONFIG_DEBUG),null!=process.env.DOTENV_CONFIG_OVERRIDE&&(t.override=process.env.DOTENV_CONFIG_OVERRIDE),e.exports=t},9738:(e,t,n)=>{const r=n(7147),o=n(1017),i=n(2037),a=n(9968).version,s=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function c(e){console.log(`[dotenv@${a}][DEBUG] ${e}`)}const d={config:function(e){let t=o.resolve(process.cwd(),".env"),n="utf8";const a=Boolean(e&&e.debug),s=Boolean(e&&e.override);var l;e&&(null!=e.path&&(t="~"===(l=e.path)[0]?o.join(i.homedir(),l.slice(1)):l),null!=e.encoding&&(n=e.encoding));try{const e=d.parse(r.readFileSync(t,{encoding:n}));return Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(process.env,t)?(!0===s&&(process.env[t]=e[t]),a&&c(!0===s?`"${t}" is already defined in \`process.env\` and WAS overwritten`:`"${t}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[t]=e[t]})),{parsed:e}}catch(e){return a&&c(`Failed to load ${t} ${e.message}`),{error:e}}},parse:function(e){const t={};let n,r=e.toString();for(r=r.replace(/\r\n?/gm,"\n");null!=(n=s.exec(r));){const e=n[1];let r=n[2]||"";r=r.trim();const o=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),'"'===o&&(r=r.replace(/\\n/g,"\n"),r=r.replace(/\\r/g,"\r")),t[e]=r}return t}};e.exports.config=d.config,e.exports.parse=d.parse,e.exports=d},6932:(e,t,n)=>{const r=n(8501),o=n(8844),i=n(1192);e.exports={XMLParser:o,XMLValidator:r,XMLBuilder:i}},7849:(e,t)=>{const n=":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",r="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+r+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t){const r=Object.keys(t),o=r.length;for(let i=0;i<o;i++)e[r[i]]="strict"===n?[t[r[i]]]:t[r[i]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(e){return!(null==o.exec(e))},t.getAllMatches=function(e,t){const n=[];let r=t.exec(e);for(;r;){const o=[];o.startIndex=t.lastIndex-r[0].length;const i=r.length;for(let e=0;e<i;e++)o.push(r[e]);n.push(o),r=t.exec(e)}return n},t.nameRegexp=r},8501:(e,t,n)=>{const r=n(7849),o={allowBooleanAttributes:!1,unpairedTags:[]};function i(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function a(e,t){const n=t;for(;t<e.length;t++)if("?"!=e[t]&&" "!=e[t]);else{const r=e.substr(n,t-n);if(t>5&&"xml"===r)return h("InvalidXml","XML declaration allowed only at the start of the document.",f(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function s(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},o,t);const n=[];let c=!1,d=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let o=0;o<e.length;o++)if("<"===e[o]&&"?"===e[o+1]){if(o+=2,o=a(e,o),o.err)return o}else{if("<"!==e[o]){if(i(e[o]))continue;return h("InvalidChar","char '"+e[o]+"' is not expected.",f(e,o))}{let y=o;if(o++,"!"===e[o]){o=s(e,o);continue}{let g=!1;"/"===e[o]&&(g=!0,o++);let w="";for(;o<e.length&&">"!==e[o]&&" "!==e[o]&&"\t"!==e[o]&&"\n"!==e[o]&&"\r"!==e[o];o++)w+=e[o];if(w=w.trim(),"/"===w[w.length-1]&&(w=w.substring(0,w.length-1),o--),u=w,!r.isName(u)){let t;return t=0===w.trim().length?"Invalid space after '<'.":"Tag '"+w+"' is an invalid name.",h("InvalidTag",t,f(e,o))}const E=l(e,o);if(!1===E)return h("InvalidAttr","Attributes for '"+w+"' have open quote.",f(e,o));let b=E.value;if(o=E.index,"/"===b[b.length-1]){const n=o-b.length;b=b.substring(0,b.length-1);const r=p(b,t);if(!0!==r)return h(r.err.code,r.err.msg,f(e,n+r.err.line));c=!0}else if(g){if(!E.tagClosed)return h("InvalidTag","Closing tag '"+w+"' doesn't have proper closing.",f(e,o));if(b.trim().length>0)return h("InvalidTag","Closing tag '"+w+"' can't have attributes or invalid starting.",f(e,y));{const t=n.pop();if(w!==t.tagName){let n=f(e,t.tagStartPos);return h("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+w+"'.",f(e,y))}0==n.length&&(d=!0)}}else{const r=p(b,t);if(!0!==r)return h(r.err.code,r.err.msg,f(e,o-b.length+r.err.line));if(!0===d)return h("InvalidXml","Multiple possible root nodes found.",f(e,o));-1!==t.unpairedTags.indexOf(w)||n.push({tagName:w,tagStartPos:y}),c=!0}for(o++;o<e.length;o++)if("<"===e[o]){if("!"===e[o+1]){o++,o=s(e,o);continue}if("?"!==e[o+1])break;if(o=a(e,++o),o.err)return o}else if("&"===e[o]){const t=m(e,o);if(-1==t)return h("InvalidChar","char '&' is not expected.",f(e,o));o=t}else if(!0===d&&!i(e[o]))return h("InvalidXml","Extra text at the end",f(e,o));"<"===e[o]&&o--}}}var u;return c?1==n.length?h("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",f(e,n[0].tagStartPos)):!(n.length>0)||h("InvalidXml","Invalid '"+JSON.stringify(n.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):h("InvalidXml","Start tag expected.",1)};const c='"',d="'";function l(e,t){let n="",r="",o=!1;for(;t<e.length;t++){if(e[t]===c||e[t]===d)""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){o=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:o}}const u=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function p(e,t){const n=r.getAllMatches(e,u),o={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return h("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",g(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return h("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",g(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return h("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",g(n[e]));const r=n[e][2];if(!y(r))return h("InvalidAttr","Attribute '"+r+"' is an invalid name.",g(n[e]));if(o.hasOwnProperty(r))return h("InvalidAttr","Attribute '"+r+"' is repeated.",g(n[e]));o[r]=1}return!0}function m(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function h(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function y(e){return r.isName(e)}function f(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function g(e){return e.startIndex+e[1].length}},1192:(e,t,n)=>{const r=n(2592),o={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[]};function i(e){this.options=Object.assign({},o,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=c),this.processTextOrObjNode=a,this.options.format?(this.indentate=s,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(e,t,n){const r=this.j2x(e,n+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,r.attrStr,n):this.buildObjectNode(r.val,t,r.attrStr,n)}function s(e){return this.options.indentBy.repeat(e)}function c(e){return!!e.startsWith(this.options.attributeNamePrefix)&&e.substr(this.attrPrefixLen)}i.prototype.build=function(e){return this.options.preserveOrder?r(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)},i.prototype.j2x=function(e,t){let n="",r="";for(let o in e)if(void 0===e[o]);else if(null===e[o])"?"===o[0]?r+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(e[o]instanceof Date)r+=this.buildTextValNode(e[o],o,"",t);else if("object"!=typeof e[o]){const i=this.isAttribute(o);if(i)n+=this.buildAttrPairStr(i,""+e[o]);else if(o===this.options.textNodeName){let t=this.options.tagValueProcessor(o,""+e[o]);r+=this.replaceEntitiesValue(t)}else r+=this.buildTextValNode(e[o],o,"",t)}else if(Array.isArray(e[o])){const n=e[o].length;for(let i=0;i<n;i++){const n=e[o][i];void 0===n||(null===n?"?"===o[0]?r+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+o+"/"+this.tagEndChar:r+="object"==typeof n?this.processTextOrObjNode(n,o,t):this.buildTextValNode(n,o,"",t))}}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const t=Object.keys(e[o]),r=t.length;for(let i=0;i<r;i++)n+=this.buildAttrPairStr(t[i],""+e[o][t[i]])}else r+=this.processTextOrObjNode(e[o],o,t);return{attrStr:n,val:r}},i.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},i.prototype.buildObjectNode=function(e,t,n,r){if(""===e)return"?"===t[0]?this.indentate(r)+"<"+t+n+"?"+this.tagEndChar:this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let o="</"+t+this.tagEndChar,i="";return"?"===t[0]&&(i="?",o=""),n&&-1===e.indexOf("<")?this.indentate(r)+"<"+t+n+i+">"+e+o:!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===i.length?this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(r)+"<"+t+n+i+this.tagEndChar+e+this.indentate(r)+o}},i.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},i.prototype.buildTextValNode=function(e,t,n,r){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(r)+"<"+t+n+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(t,e);return o=this.replaceEntitiesValue(o),""===o?this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+n+">"+o+"</"+t+this.tagEndChar}},i.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e},e.exports=i},2592:e=>{function t(e,a,s,c){let d="",l=!1;for(let u=0;u<e.length;u++){const p=e[u],m=n(p);let h="";if(h=0===s.length?m:`${s}.${m}`,m===a.textNodeName){let e=p[m];o(h,a)||(e=a.tagValueProcessor(m,e),e=i(e,a)),l&&(d+=c),d+=e,l=!1;continue}if(m===a.cdataPropName){l&&(d+=c),d+=`<![CDATA[${p[m][0][a.textNodeName]}]]>`,l=!1;continue}if(m===a.commentPropName){d+=c+`\x3c!--${p[m][0][a.textNodeName]}--\x3e`,l=!0;continue}if("?"===m[0]){const e=r(p[":@"],a),t="?xml"===m?"":c;let n=p[m][0][a.textNodeName];n=0!==n.length?" "+n:"",d+=t+`<${m}${n}${e}?>`,l=!0;continue}let y=c;""!==y&&(y+=a.indentBy);const f=c+`<${m}${r(p[":@"],a)}`,g=t(p[m],a,h,y);-1!==a.unpairedTags.indexOf(m)?a.suppressUnpairedNode?d+=f+">":d+=f+"/>":g&&0!==g.length||!a.suppressEmptyNode?g&&g.endsWith(">")?d+=f+`>${g}${c}</${m}>`:(d+=f+">",g&&""!==c&&(g.includes("/>")||g.includes("</"))?d+=c+a.indentBy+g+c:d+=g,d+=`</${m}>`):d+=f+"/>",l=!0}return d}function n(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function r(e,t){let n="";if(e&&!t.ignoreAttributes)for(let r in e){let o=t.attributeValueProcessor(r,e[r]);o=i(o,t),!0===o&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${o}"`}return n}function o(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let r in t.stopNodes)if(t.stopNodes[r]===e||t.stopNodes[r]==="*."+n)return!0;return!1}function i(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const r=t.entities[n];e=e.replace(r.regex,r.val)}return e}e.exports=function(e,n){let r="";return n.format&&n.indentBy.length>0&&(r="\n"),t(e,n,"",r)}},4780:e=>{const t=RegExp("^\\s([a-zA-z0-0]+)[ \t](['\"])([^&]+)\\2");function n(e,n){const r=t.exec(e);r&&(n[r[1]]={regx:RegExp(`&${r[1]};`,"g"),val:r[3]})}e.exports=function(e,t){const r={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let o=1,i=!1,a=!1,s=!1,c="";for(;t<e.length;t++)if("<"!==e[t]||s)if(">"===e[t]){if(s?"-"===e[t-1]&&"-"===e[t-2]&&(s=!1,o--):(a&&(n(c,r),a=!1),o--),0===o)break}else"["===e[t]?i=!0:c+=e[t];else{if(i&&"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7])t+=7,a=!0;else if(i&&"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8])t+=8;else if(i&&"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8])t+=8;else if(i&&"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9])t+=9;else{if("!"!==e[t+1]||"-"!==e[t+2]||"-"!==e[t+3])throw new Error("Invalid DOCTYPE");s=!0}o++,c=""}if(0!==o)throw new Error("Unclosed DOCTYPE")}return{entities:r,i:t}}},6745:(e,t)=>{const n={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(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1};t.buildOptions=function(e){return Object.assign({},n,e)},t.defaultOptions=n},1078:(e,t,n)=>{const r=n(7849),o=n(6311),i=n(4780),a=n(4153);function s(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:e[r]}}}function c(e,t,n,r,o,i,a){if(void 0!==e&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){a||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,o,i);return null==r?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?E(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function d(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,r.nameRegexp);const l=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function u(e,t){if(!this.options.ignoreAttributes&&"string"==typeof e){const n=r.getAllMatches(e,l),o=n.length,i={};for(let e=0;e<o;e++){const r=this.resolveNameSpace(n[e][1]);let o=n[e][4],a=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(a=this.options.transformAttributeName(a)),"__proto__"===a&&(a="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);const e=this.options.attributeValueProcessor(r,o,t);i[a]=null==e?o:typeof e!=typeof o||e!==o?e:E(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[a]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=i,e}return i}}const p=function(e){e=e.replace(/\r\n?/g,"\n");const t=new o("!xml");let n=t,r="",a="";for(let s=0;s<e.length;s++)if("<"===e[s])if("/"===e[s+1]){const t=f(e,">",s,"Closing Tag is not closed.");let o=e.substring(s+2,t).trim();if(this.options.removeNSPrefix){const e=o.indexOf(":");-1!==e&&(o=o.substr(e+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(r=this.saveTextToParentTag(r,n,a)),a=a.substr(0,a.lastIndexOf(".")),n=this.tagsNodeStack.pop(),r="",s=t}else if("?"===e[s+1]){let t=g(e,s,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,a),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new o(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,a)),n.addChild(e)}s=t.closeIndex+1}else if("!--"===e.substr(s+1,3)){const t=f(e,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const o=e.substring(s+4,t-2);r=this.saveTextToParentTag(r,n,a),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}s=t}else if("!D"===e.substr(s+1,2)){const t=i(e,s);this.docTypeEntities=t.entities,s=t.i}else if("!["===e.substr(s+1,2)){const t=f(e,"]]>",s,"CDATA is not closed.")-2,o=e.substring(s+9,t);if(r=this.saveTextToParentTag(r,n,a),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let e=this.parseTextData(o,n.tagname,a,!0,!1,!0);null==e&&(e=""),n.add(this.options.textNodeName,e)}s=t+2}else{let i=g(e,s,this.options.removeNSPrefix),c=i.tagName,d=i.tagExp,l=i.attrExpPresent,u=i.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,a,!1)),c!==t.tagname&&(a+=a?"."+c:c);const p=n;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop()),this.isItStopNode(this.options.stopNodes,a,c)){let t="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)s=i.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(c))s=i.closeIndex;else{const n=this.readStopNodeData(e,c,u+1);if(!n)throw new Error(`Unexpected end of ${c}`);s=n.i,t=n.tagContent}const r=new o(c);c!==d&&l&&(r[":@"]=this.buildAttributesMap(d,a)),t&&(t=this.parseTextData(t,c,a,!0,l,!0,!0)),a=a.substr(0,a.lastIndexOf(".")),r.add(this.options.textNodeName,t),n.addChild(r)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){"/"===c[c.length-1]?(c=c.substr(0,c.length-1),d=c):d=d.substr(0,d.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const e=new o(c);c!==d&&l&&(e[":@"]=this.buildAttributesMap(d,a)),a=a.substr(0,a.lastIndexOf(".")),n.addChild(e)}else{const e=new o(c);this.tagsNodeStack.push(n),c!==d&&l&&(e[":@"]=this.buildAttributesMap(d,a)),n.addChild(e),n=e}r="",s=u}}else r+=e[s];return t.child},m=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function h(e,t,n,r){return e&&(void 0===r&&(r=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function y(e,t,n){const r="*."+n;for(const n in e){const o=e[n];if(r===o||t===o)return!0}return!1}function f(e,t,n,r){const o=e.indexOf(t,n);if(-1===o)throw new Error(r);return o+t.length-1}function g(e,t,n,r=">"){const o=function(e,t,n=">"){let r,o="";for(let i=t;i<e.length;i++){let t=e[i];if(r)t===r&&(r="");else if('"'===t||"'"===t)r=t;else if(t===n[0]){if(!n[1])return{data:o,index:i};if(e[i+1]===n[1])return{data:o,index:i}}else"\t"===t&&(t=" ");o+=t}}(e,t+1,r);if(!o)return;let i=o.data;const a=o.index,s=i.search(/\s/);let c=i,d=!0;if(-1!==s&&(c=i.substr(0,s).replace(/\s\s*$/,""),i=i.substr(s+1)),n){const e=c.indexOf(":");-1!==e&&(c=c.substr(e+1),d=c!==o.data.substr(e+1))}return{tagName:c,tagExp:i,closeIndex:a,attrExpPresent:d}}function w(e,t,n){const r=n;let o=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const i=f(e,">",n,`${t} is not closed`);if(e.substring(n+2,i).trim()===t&&(o--,0===o))return{tagContent:e.substring(r,n),i};n=i}else if("?"===e[n+1])n=f(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=f(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=f(e,"]]>",n,"StopNode is not closed.")-2;else{const r=g(e,n,">");r&&((r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&o++,n=r.closeIndex)}}function E(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&a(e,n)}return r.isExist(e)?e:""}e.exports=class{constructor(e){this.options=e,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:"₹"}},this.addExternalEntities=s,this.parseXml=p,this.parseTextData=c,this.resolveNameSpace=d,this.buildAttributesMap=u,this.isItStopNode=y,this.replaceEntitiesValue=m,this.readStopNodeData=w,this.saveTextToParentTag=h}}},8844:(e,t,n)=>{const{buildOptions:r}=n(6745),o=n(1078),{prettify:i}=n(6997),a=n(8501);e.exports=class{constructor(e){this.externalEntities={},this.options=r(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=a.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new o(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:i(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}},6997:(e,t)=>{function n(e,t,a){let s;const c={};for(let d=0;d<e.length;d++){const l=e[d],u=r(l);let p="";if(p=void 0===a?u:a+"."+u,u===t.textNodeName)void 0===s?s=l[u]:s+=""+l[u];else{if(void 0===u)continue;if(l[u]){let e=n(l[u],t,p);const r=i(e,t);l[":@"]?o(e,l[":@"],p,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==c[u]&&c.hasOwnProperty(u)?(Array.isArray(c[u])||(c[u]=[c[u]]),c[u].push(e)):t.isArray(u,p,r)?c[u]=[e]:c[u]=e}}}return"string"==typeof s?s.length>0&&(c[t.textNodeName]=s):void 0!==s&&(c[t.textNodeName]=s),c}function r(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function o(e,t,n,r){if(t){const o=Object.keys(t),i=o.length;for(let a=0;a<i;a++){const i=o[a];r.isArray(i,n+"."+i,!0,!0)?e[i]=[t[i]]:e[i]=t[i]}}}function i(e,t){const n=Object.keys(e).length;return!!(0===n||1===n&&e[t.textNodeName])}t.prettify=function(e,t){return n(e,t)}},6311:e=>{e.exports=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}},6675:(e,t,n)=>{var r=n(4993),o=n(113),i=n(3801),a=n(650);function s(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,"number"!=typeof this.capacity||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");var r=i.getPointerArray(n);this.forward=new r(n),this.backward=new r(n),this.K="function"==typeof e?new e(n):new Array(n),this.V="function"==typeof t?new t(n):new Array(n),this.size=0,this.head=0,this.tail=0,this.items={}}s.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},s.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var n=this.backward[e],r=this.forward[e];return this.tail===e?this.tail=n:this.backward[r]=n,this.forward[n]=r,this.backward[t]=e,this.head=e,this.forward[e]=t,this},s.prototype.set=function(e,t){var n=this.items[e];if(void 0!==n)return this.splayOnTop(n),void(this.V[n]=t);this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],delete this.items[this.K[n]]),this.items[e]=n,this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n},s.prototype.setpop=function(e,t){var n=null,r=null,o=this.items[e];return void 0!==o?(this.splayOnTop(o),n=this.V[o],this.V[o]=t,{evicted:!1,key:e,value:n}):(this.size<this.capacity?o=this.size++:(o=this.tail,this.tail=this.backward[o],n=this.V[o],r=this.K[o],delete this.items[this.K[o]]),this.items[e]=o,this.K[o]=e,this.V[o]=t,this.forward[o]=this.head,this.backward[this.head]=o,this.head=o,r?{evicted:!0,key:r,value:n}:null)},s.prototype.has=function(e){return e in this.items},s.prototype.get=function(e){var t=this.items[e];if(void 0!==t)return this.splayOnTop(t),this.V[t]},s.prototype.peek=function(e){var t=this.items[e];if(void 0!==t)return this.V[t]},s.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=0,r=this.size,o=this.head,i=this.K,a=this.V,s=this.forward;n<r;)e.call(t,a[o],i[o],this),o=s[o],n++},s.prototype.keys=function(){var e=0,t=this.size,n=this.head,o=this.K,i=this.forward;return new r((function(){if(e>=t)return{done:!0};var r=o[n];return++e<t&&(n=i[n]),{done:!1,value:r}}))},s.prototype.values=function(){var e=0,t=this.size,n=this.head,o=this.V,i=this.forward;return new r((function(){if(e>=t)return{done:!0};var r=o[n];return++e<t&&(n=i[n]),{done:!1,value:r}}))},s.prototype.entries=function(){var e=0,t=this.size,n=this.head,o=this.K,i=this.V,a=this.forward;return new r((function(){if(e>=t)return{done:!0};var r=o[n],s=i[n];return++e<t&&(n=a[n]),{done:!1,value:[r,s]}}))},"undefined"!=typeof Symbol&&(s.prototype[Symbol.iterator]=s.prototype.entries),s.prototype.inspect=function(){for(var e,t=new Map,n=this.entries();!(e=n.next()).done;)t.set(e.value[0],e.value[1]);return Object.defineProperty(t,"constructor",{value:s,enumerable:!1}),t},"undefined"!=typeof Symbol&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.from=function(e,t,n,r){if(arguments.length<2){if("number"!=typeof(r=a.guessLength(e)))throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else 2===arguments.length&&(r=t,t=null,n=null);var i=new s(t,n,r);return o(e,(function(e,t){i.set(t,e)})),i},e.exports=s},650:(e,t,n)=>{var r=n(113),o=n(3801);function i(e){return"number"==typeof e.length?e.length:"number"==typeof e.size?e.size:void 0}t.isArrayLike=function(e){return Array.isArray(e)||o.isTypedArray(e)},t.guessLength=i,t.toArray=function(e){var t=i(e),n="number"==typeof t?new Array(t):[],o=0;return r(e,(function(e){n[o++]=e})),n},t.toArrayWithIndices=function(e){var t=i(e),n="number"==typeof t?o.getPointerArray(t):Array,a="number"==typeof t?new Array(t):[],s="number"==typeof t?new n(t):[],c=0;return r(e,(function(e){a[c]=e,s[c]=c++})),[a,s]}},3801:(e,t)=>{var n=Math.pow(2,8)-1,r=Math.pow(2,16)-1,o=Math.pow(2,32)-1,i=Math.pow(2,7)-1,a=Math.pow(2,15)-1,s=Math.pow(2,31)-1;t.getPointerArray=function(e){var t=e-1;return t<=n?Uint8Array:t<=r?Uint16Array:t<=o?Uint32Array:Float64Array},t.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=s?Int32Array:Float64Array},t.getNumberType=function(e){return e===(0|e)?-1===Math.sign(e)?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var c={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(e,n){var r,o,i,a,s,d=null,l=0;for(a=0,s=e.length;a<s;a++)i=n?n(e[a]):e[a],o=t.getNumberType(i),(r=c[o.name])>l&&(l=r,d=o);return d},t.isTypedArray=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)},t.concat=function(){var e,t,n,r=0;for(e=0,n=arguments.length;e<n;e++)r+=arguments[e].length;var o=new arguments[0].constructor(r);for(e=0,t=0;e<n;e++)o.set(arguments[e],t),t+=arguments[e].length;return o},t.indices=function(e){for(var n=new(t.getPointerArray(e))(e),r=0;r<e;r++)n[r]=r;return n}},113:e=>{var t="undefined"!=typeof ArrayBuffer,n="undefined"!=typeof Symbol;function r(e,r){var o,i,a,s,c;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if("function"!=typeof r)throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(a=0,s=e.length;a<s;a++)r(e[a],a);else if("function"!=typeof e.forEach)if(n&&Symbol.iterator in e&&"function"!=typeof e.next&&(e=e[Symbol.iterator]()),"function"!=typeof e.next)for(i in e)e.hasOwnProperty(i)&&r(e[i],i);else for(o=e,a=0;!0!==(c=o.next()).done;)r(c.value,a),a++;else e.forEach(r)}r.forEachWithNullKeys=function(e,r){var o,i,a,s,c;if(!e)throw new Error("obliterator/forEachWithNullKeys: invalid iterable.");if("function"!=typeof r)throw new Error("obliterator/forEachWithNullKeys: expecting a callback.");if(Array.isArray(e)||t&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString())for(a=0,s=e.length;a<s;a++)r(e[a],null);else if(e instanceof Set)e.forEach((function(e){r(e,null)}));else if("function"!=typeof e.forEach)if(n&&Symbol.iterator in e&&"function"!=typeof e.next&&(e=e[Symbol.iterator]()),"function"!=typeof e.next)for(i in e)e.hasOwnProperty(i)&&r(e[i],i);else for(o=e,a=0;!0!==(c=o.next()).done;)r(c.value,null),a++;else e.forEach(r)},e.exports=r},4993:e=>{function t(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}t.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(t.prototype[Symbol.iterator]=function(){return this}),t.of=function(){var e=arguments,n=e.length,r=0;return new t((function(){return r>=n?{done:!0}:{done:!1,value:e[r++]}}))},t.empty=function(){var e=new t(null);return e.done=!0,e},t.is=function(e){return e instanceof t||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=t},4153:e=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(e,o={}){if(o=Object.assign({},r,o),!e||"string"!=typeof e)return e;let i=e.trim();if(void 0!==o.skipLike&&o.skipLike.test(i))return e;if(o.hex&&t.test(i))return Number.parseInt(i,16);{const t=n.exec(i);if(t){const n=t[1],r=t[2];let s=(a=t[3])&&-1!==a.indexOf(".")?("."===(a=a.replace(/0+$/,""))?a="0":"."===a[0]?a="0"+a:"."===a[a.length-1]&&(a=a.substr(0,a.length-1)),a):a;const c=t[4]||t[6];if(!o.leadingZeros&&r.length>0&&n&&"."!==i[2])return e;if(!o.leadingZeros&&r.length>0&&!n&&"."!==i[1])return e;{const t=Number(i),a=""+t;return-1!==a.search(/[eE]/)||c?o.eNotation?t:e:-1!==i.indexOf(".")?"0"===a&&""===s||a===s||n&&a==="-"+s?t:e:r?s===a||n+s===a?t:e:i===a||i===n+a?t:e}}return e}var a}},3607:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(9031),t),o(n(9615),t),o(n(6278),t)},9615:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableName=t.client=void 0;const r=n(2311);n(5371),t.client=new r.DynamoDBClient({region:process.env.AWS_REGION||"eu-central-1"}),t.TableName=process.env.DYNAMODB_TABLE},6278:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getAttributesFromExpression=t.getAttributeNames=t.getAttributeValues=t.splitEvery=t.stripKey=void 0;const r=n(5074);t.stripKey=function(e){return(0,r.marshall)({PK:e.PK,SK:e.SK})},t.splitEvery=function(e,t=25){const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n},t.getAttributeValues=function(e,t){return(0,r.marshall)((t||Object.keys(e)).reduce(((t,n)=>(t[`:${n}`]=e[n],t)),{}))},t.getAttributeNames=function(e,t){return(t||Object.keys(e)).reduce(((e,t)=>(e[`#${t}`]=t,e)),{})},t.getAttributesFromExpression=function(e,t="#"){return e.match(new RegExp(`${t}\\w+`,"g"))?.map((e=>e.slice(1)))||[]}},3581:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteItems=t.deleteItem=void 0;const r=n(2311),o=n(9615),i=n(6278);t.deleteItem=async function(e,t={}){return o.client.send(new r.DeleteItemCommand({TableName:o.TableName,Key:(0,i.stripKey)(e),...t}))},t.deleteItems=async function e(t,n={},a=0){return new Promise((async(s,c)=>{const d=(0,i.splitEvery)(t);if(!(a>3)){for(const t of d)await o.client.send(new r.BatchWriteItemCommand({RequestItems:{[o.TableName]:t.map((e=>({DeleteRequest:{Key:(0,i.stripKey)(e)}})))},...n})).then((t=>{if(t?.UnprocessedItems?.[o.TableName]?.length)return a+1>3?c(t):e(t.UnprocessedItems[o.TableName],n,a+1)})).catch(c);s()}}))}},5362:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getAllItems=t.getItems=t.getItem=void 0;const r=n(2311),o=n(5074),i=n(9615),a=n(6278);t.getItem=async function(e,t={}){return i.client.send(new r.GetItemCommand({TableName:i.TableName,Key:(0,a.stripKey)(e),...t})).then((e=>e?.Item&&(0,o.unmarshall)(e.Item)))},t.getItems=async function e(t,n={},s=0){if(s>3)return[];const c=Object.values(t.reduce(((e,t)=>{const n=`${t.PK}#${t.SK}`;return e[n]||(e[n]=t),e}),{})),d=(0,a.splitEvery)(c,100),l=[];if(s>2)return l;await Promise.all(d.map((async t=>{await i.client.send(new r.BatchGetItemCommand({RequestItems:{[i.TableName]:{Keys:t.map(a.stripKey),...n}}})).then((t=>{const r=t?.UnprocessedKeys?.[i.TableName],a=t?.Responses?.[i.TableName]||[];return r?e(r.Keys,n,s+1).then((e=>a.concat(e))):a.map((e=>e&&(0,o.unmarshall)(e)))})).then((e=>l.push(...e)))})));const u=l.reduce(((e,t)=>(e[`${t?.PK}#${t?.SK}`]=t,e)),{});return t.map((e=>u[`${e.PK}#${e.SK}`]||void 0))},t.getAllItems=async function(e={}){return i.client.send(new r.ScanCommand({TableName:i.TableName,...e})).then((e=>e.Items.map((e=>e&&(0,o.unmarshall)(e)))))}},9031:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(3581),t),o(n(5362),t),o(n(3391),t),o(n(1853),t),o(n(5585),t),o(n(5666),t)},3391:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getNewId=t.itemExists=void 0;const r=n(5362),o=n(5585);t.itemExists=async function(e,t={}){return null!=await(0,r.getItem)(e,t)},t.getNewId=async function({PK:e,SK:t,length:n=8}){if(!e)throw new Error("Cannot generate new ID: PK");let r="0";if(t){const n=t+(t.endsWith("/")?"":"/"),i=(await(0,o.queryItems)("#PK = :PK and begins_with(#SK, :SK)",{PK:e,SK:n},{Limit:1,ScanIndexForward:!1}))?.[0],a=i?.SK?.split("/")||[];r=a?.[n.split("/").length-1]||"0"}else{const t=(await(0,o.queryItems)("#PK = :PK",{PK:e},{Limit:1,ScanIndexForward:!1}))?.[0],n=t?.SK?.split("/")||[];r=n?.[n.length-1]||"0"}const i=(parseInt(r)+1+"").padStart(n||0,"0");return t?`${t}${t.endsWith("/")?"":"/"}${i}`:i}},1853:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.putItems=t.putItem=void 0;const r=n(2311),o=n(5074),i=n(9615),a=n(6278);t.putItem=async function(e,t={}){return Object.keys(e).includes("createdAt")||(e.createdAt=Date.now()),i.client.send(new r.PutItemCommand({TableName:i.TableName,Item:(0,o.marshall)(e),...t}))},t.putItems=async function(e,t={}){return new Promise((async(n,s)=>{const c=(0,a.splitEvery)(e),d=Date.now();for(const e of c)e.forEach((e=>{Object.keys(e).includes("createdAt")||(e.createdAt=d)})),await i.client.send(new r.BatchWriteItemCommand({RequestItems:{[i.TableName]:e.map((e=>({PutRequest:{Item:(0,o.marshall)(e)}})))},...t})).catch(s);n()}))}},5585:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.queryAllItems=t.queryItems=t.query=void 0;const r=n(2311),o=n(5074),i=n(9615),a=n(6278);async function s(e,t,n={}){return i.client.send(new r.QueryCommand({TableName:i.TableName,KeyConditionExpression:e,ExpressionAttributeValues:(0,a.getAttributeValues)(t,[...(0,a.getAttributesFromExpression)(e,":"),...(0,a.getAttributesFromExpression)(n?.FilterExpression||"",":")]),ExpressionAttributeNames:(0,a.getAttributeNames)(t,[...(0,a.getAttributesFromExpression)(e),...(0,a.getAttributesFromExpression)(n?.FilterExpression||"")]),...n}))}t.query=s,t.queryItems=async function(e,t,n={}){return s(e,t,n).then((e=>(e?.Items||[]).map((e=>e&&(0,o.unmarshall)(e)))))},t.queryAllItems=async function(e,t,n={}){let r=await s(e,t,n);for(;r.LastEvaluatedKey;)if(r.LastEvaluatedKey){let o=await s(e,t,{...n,ExclusiveStartKey:r.LastEvaluatedKey});o?.Items&&r?.Items&&r.Items.push(...o.Items),r&&(r.LastEvaluatedKey=o.LastEvaluatedKey)}return(r?.Items||[]).map((e=>e&&(0,o.unmarshall)(e)))}},5666:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeAttributes=t.updateItem=void 0;const r=n(2311),o=n(9615),i=n(6278);t.updateItem=async function(e,t,n={}){Object.keys(t).includes("updatedAt")||(t.updatedAt=Date.now());const a="SET "+Object.keys(t).map((e=>`#${e} = :${e}`)).join(", ");return o.client.send(new r.UpdateItemCommand({TableName:o.TableName,Key:(0,i.stripKey)(e),UpdateExpression:a,ExpressionAttributeValues:(0,i.getAttributeValues)(t),ExpressionAttributeNames:(0,i.getAttributeNames)(t),...n}))},t.removeAttributes=async function(e,t){const n="REMOVE "+t.map((e=>`#${e}`)).join(", ");return o.client.send(new r.UpdateItemCommand({TableName:o.TableName,Key:(0,i.stripKey)(e),UpdateExpression:n,ExpressionAttributeNames:(0,i.getAttributeNames)(t.reduce(((e,t)=>(e[t]=t,e)),{}))}))}},2361:t=>{t.exports=e(import.meta.url)("events")},7147:t=>{t.exports=e(import.meta.url)("fs")},2037:t=>{t.exports=e(import.meta.url)("os")},1017:t=>{t.exports=e(import.meta.url)("path")},7282:t=>{t.exports=e(import.meta.url)("process")},5062:e=>{e.exports=JSON.parse('{"name":"aws-crt","version":"1.15.16","description":"NodeJS/browser bindings to the aws-c-* libraries","homepage":"https://github.com/awslabs/aws-crt-nodejs","repository":{"type":"git","url":"git+https://github.com/awslabs/aws-crt-nodejs.git"},"contributors":["AWS Common Runtime Team <aws-sdk-common-runtime@amazon.com>"],"license":"Apache-2.0","main":"./dist/index.js","browser":"./dist.browser/browser.js","types":"./dist/index.d.ts","scripts":{"tsc":"node ./scripts/tsc.js","test":"npm run test:native","test:node":"npm run test:native","test:native":"npx jest --runInBand --verbose --config test/native/jest.config.js --forceExit","test:browser":"npx jest --runInBand --verbose --config test/browser/jest.config.js --forceExit","test:browser:ci":"npm run install:puppeteer && npm run test:browser","install:puppeteer":"npm install --save-dev jest-puppeteer puppeteer @types/puppeteer","prepare":"node ./scripts/tsc.js && node ./scripts/install.js","install":"node ./scripts/install.js"},"devDependencies":{"@types/crypto-js":"^3.1.43","@types/jest":"^27.0.1","@types/node":"^10.17.54","@types/prettier":"2.6.0","@types/puppeteer":"^5.4.7","@types/uuid":"^3.4.8","@types/ws":"^7.4.7","aws-sdk":"^2.848.0","cmake-js":"^6.3.2","https-proxy-agent":"^5.0.1","jest":"^27.2.1","jest-puppeteer":"^5.0.4","jest-runtime":"^27.2.1","puppeteer":"^3.3.0","tar":"^6.1.11","ts-jest":"^27.0.5","typedoc":"^0.22.18","typedoc-plugin-merge-modules":"^3.1.0","typescript":"^4.7.4","uuid":"^8.3.2","yargs":"^17.2.1"},"dependencies":{"@aws-sdk/util-utf8-browser":"^3.109.0","@httptoolkit/websocket-stream":"^6.0.0","axios":"^0.24.0","buffer":"^6.0.3","cmake-js":"^6.3.2","crypto-js":"^4.0.0","mqtt":"^4.3.7","process":"^0.11.10","tar":"^6.1.11"}}')},9968:e=>{e.exports=JSON.parse('{"name":"dotenv","version":"16.0.3","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"require":"./lib/main.js","types":"./lib/main.d.ts","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","lint-readme":"standard-markdown","pretest":"npm run lint && npm run dts-check","test":"tap tests/*.js --100 -Rspec","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^17.0.9","decache":"^4.6.1","dtslint":"^3.7.0","sinon":"^12.0.1","standard":"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2","tap":"^15.1.6","tar":"^6.1.11","typescript":"^4.5.4"},"engines":{"node":">=12"}}')}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(3607);
|