-
Notifications
You must be signed in to change notification settings - Fork 0
/
229.cfa3b40b3863c7e8049e.js
1 lines (1 loc) · 142 KB
/
229.cfa3b40b3863c7e8049e.js
1
"use strict";(self.webpackChunksparkworks_console=self.webpackChunksparkworks_console||[]).push([[229],{43229:function(Y,E,T){T.r(E),T.d(E,{amplify_chatbot:function(){return Gr}});var ce,a,O=T(60332),G=T(8239),k=T(75134),H=T(47289),j=T(88774),L=T.n(j),A=T(65513),R=T(45013),z=T(77),J=T(53799),U=T(33754),V=T(84665),Q=T(96638),ne=function(){return(ne=Object.assign||function(a){for(var e,t=1,r=arguments.length;t<r;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}).apply(this,arguments)},X=new R.k("AbstractInteractionsProvider"),W=function(){function a(e){void 0===e&&(e={}),this._config=e}return a.prototype.configure=function(e){return void 0===e&&(e={}),this._config=ne(ne({},this._config),e),X.debug("configure "+this.getProviderName(),this._config),this.options},a.prototype.getCategory=function(){return"Interactions"},Object.defineProperty(a.prototype,"options",{get:function(){return ne({},this._config)},enumerable:!0,configurable:!0}),a}(),f=T(97582);(a=ce||(ce={})).ENV="env",a.CONFIG="shared config entry";var De,p=function(e){if("function"==typeof e)return e;var t=Promise.resolve(e);return function(){return t}},B=function(e){return"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips"))},Z=function(e){return B(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e},K=function(e,t){var r;void 0===e&&(e=[]);var n=t.useFipsEndpoint,i=t.useDualstackEndpoint;return null===(r=e.find(function(o){var u=o.tags;return n===u.includes("fips")&&i===u.includes("dualstack")}))||void 0===r?void 0:r.hostname},Vr=function(e,t){var r,n,i,o,u,c,l=t.useFipsEndpoint,v=void 0!==l&&l,y=t.useDualstackEndpoint,_=void 0!==y&&y,S=t.signingService,x=t.regionHash,P=t.partitionHash,I=function(e,t){var r,n=t.partitionHash;return null!==(r=Object.keys(n||{}).find(function(i){return n[i].regions.includes(e)}))&&void 0!==r?r:"aws"}(e,{partitionHash:P}),D=e in x?e:null!==(n=null===(r=P[I])||void 0===r?void 0:r.endpoint)&&void 0!==n?n:e,N={useFipsEndpoint:v,useDualstackEndpoint:_},re=function(e,t){var n=t.partitionHostname;return t.regionHostname||(n?n.replace("{region}",e):void 0)}(D,{regionHostname:K(null===(i=x[D])||void 0===i?void 0:i.variants,N),partitionHostname:K(null===(o=P[I])||void 0===o?void 0:o.variants,N)});if(void 0===re)throw new Error("Endpoint resolution failed for: ".concat({resolvedRegion:D,useFipsEndpoint:v,useDualstackEndpoint:_}));var ue=function(e,t){var r=t.signingRegion;if(r)return r;if(t.useFipsEndpoint){var o=t.regionRegex.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),u=e.match(o);if(u)return u[0].slice(1,-1)}}(re,{signingRegion:null===(u=x[D])||void 0===u?void 0:u.signingRegion,regionRegex:P[I].regionRegex,useFipsEndpoint:v});return(0,f.pi)((0,f.pi)({partition:I,signingService:S,hostname:re},ue&&{signingRegion:ue}),(null===(c=x[D])||void 0===c?void 0:c.signingService)&&{signingService:x[D].signingService})},Ae=function(){function a(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)?"".concat(e.protocol,":"):e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/".concat(e.path):e.path:"/"}return a.isInstance=function(e){return!!e&&("method"in e&&"protocol"in e&&"hostname"in e&&"path"in e&&"object"==typeof e.query&&"object"==typeof e.headers)},a.prototype.clone=function(){var e=new a((0,f.pi)((0,f.pi)({},this),{headers:(0,f.pi)({},this.headers)}));return e.query&&(e.query=function(a){return Object.keys(a).reduce(function(e,t){var r,n=a[t];return(0,f.pi)((0,f.pi)({},e),((r={})[t]=Array.isArray(n)?(0,f.ev)([],(0,f.CR)(n),!1):n,r))},{})}(e.query)),e},a}(),rt=function(){function a(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return a.isInstance=function(e){return!!e&&("number"==typeof e.statusCode&&"object"==typeof e.headers)},a}(),Bt="content-length",$r={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Xr={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},tn={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},nn=function(){function a(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)?"".concat(e.protocol,":"):e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/".concat(e.path):e.path:"/"}return a.isInstance=function(e){return!!e&&("method"in e&&"protocol"in e&&"hostname"in e&&"path"in e&&"object"==typeof e.query&&"object"==typeof e.headers)},a.prototype.clone=function(){var e=new a((0,f.pi)((0,f.pi)({},this),{headers:(0,f.pi)({},this.headers)}));return e.query&&(e.query=function(a){return Object.keys(a).reduce(function(e,t){var r,n=a[t];return(0,f.pi)((0,f.pi)({},e),((r={})[t]=Array.isArray(n)?(0,f.ev)([],(0,f.CR)(n),!1):n,r))},{})}(e.query)),e},a}(),kt="X-Amzn-Trace-Id",cn={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"};!function(a){a.STANDARD="standard",a.ADAPTIVE="adaptive"}(De||(De={}));var it,Ut=De.STANDARD,fn=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],dn=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],vn=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],hn=[500,502,503,504],mn=["ECONNRESET","EPIPE","ETIMEDOUT"],_t=function(e){var t,r;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||dn.includes(e.name)||1==(null===(r=e.$retryable)||void 0===r?void 0:r.throttling)},_n=function(){function a(e){var t,r,n,i,o;this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=null!==(t=null==e?void 0:e.beta)&&void 0!==t?t:.7,this.minCapacity=null!==(r=null==e?void 0:e.minCapacity)&&void 0!==r?r:1,this.minFillRate=null!==(n=null==e?void 0:e.minFillRate)&&void 0!==n?n:.5,this.scaleConstant=null!==(i=null==e?void 0:e.scaleConstant)&&void 0!==i?i:.4,this.smooth=null!==(o=null==e?void 0:e.smooth)&&void 0!==o?o:.8;var u=this.getCurrentTimeInSeconds();this.lastThrottleTime=u,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}return a.prototype.getCurrentTimeInSeconds=function(){return Date.now()/1e3},a.prototype.getSendToken=function(){return(0,f.mG)(this,void 0,void 0,function(){return(0,f.Jh)(this,function(e){return[2,this.acquireTokenBucket(1)]})})},a.prototype.acquireTokenBucket=function(e){return(0,f.mG)(this,void 0,void 0,function(){var t;return(0,f.Jh)(this,function(r){switch(r.label){case 0:return this.enabled?(this.refillTokenBucket(),e>this.currentCapacity?(t=(e-this.currentCapacity)/this.fillRate*1e3,[4,new Promise(function(n){return setTimeout(n,t)})]):[3,2]):[2];case 1:r.sent(),r.label=2;case 2:return this.currentCapacity=this.currentCapacity-e,[2]}})})},a.prototype.refillTokenBucket=function(){var e=this.getCurrentTimeInSeconds();this.lastTimestamp?(this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+(e-this.lastTimestamp)*this.fillRate),this.lastTimestamp=e):this.lastTimestamp=e},a.prototype.updateClientSendingRate=function(e){var t;if(this.updateMeasuredRate(),_t(e)){var r=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=r,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(r),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());var n=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(n)},a.prototype.calculateTimeWindow=function(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))},a.prototype.cubicThrottle=function(e){return this.getPrecise(e*this.beta)},a.prototype.cubicSuccess=function(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)},a.prototype.enableTokenBucket=function(){this.enabled=!0},a.prototype.updateTokenBucketRate=function(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)},a.prototype.updateMeasuredRate=function(){var e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;this.requestCount++,t>this.lastTxRateBucket&&(this.measuredTxRate=this.getPrecise(this.requestCount/(t-this.lastTxRateBucket)*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t)},a.prototype.getPrecise=function(e){return parseFloat(e.toFixed(8))},a}(),wn=new Uint8Array(16);function bn(){if(!it&&!(it="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return it(wn)}for(var Sn=/^(?:[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,xn=function(a){return"string"==typeof a&&Sn.test(a)},oe=[],wt=0;wt<256;++wt)oe.push((wt+256).toString(16).substr(1));var Rn=function(a,e,t){var r=(a=a||{}).random||(a.rng||bn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){t=t||0;for(var n=0;n<16;++n)e[t+n]=r[n];return e}return function(a){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(oe[a[e+0]]+oe[a[e+1]]+oe[a[e+2]]+oe[a[e+3]]+"-"+oe[a[e+4]]+oe[a[e+5]]+"-"+oe[a[e+6]]+oe[a[e+7]]+"-"+oe[a[e+8]]+oe[a[e+9]]+"-"+oe[a[e+10]]+oe[a[e+11]]+oe[a[e+12]]+oe[a[e+13]]+oe[a[e+14]]+oe[a[e+15]]).toLowerCase();if(!xn(t))throw TypeError("Stringified UUID is invalid");return t}(r)},kn=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},Un=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return fn.includes(e.name)}(e)||_t(e)||function(e){var t;return vn.includes(e.name)||mn.includes((null==e?void 0:e.code)||"")||hn.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},Ht=function(){function a(e,t){var r,n,i,u,c,l,v,y,_;this.maxAttemptsProvider=e,this.mode=De.STANDARD,this.retryDecider=null!==(r=null==t?void 0:t.retryDecider)&&void 0!==r?r:Un,this.delayDecider=null!==(n=null==t?void 0:t.delayDecider)&&void 0!==n?n:kn,this.retryQuota=null!==(i=null==t?void 0:t.retryQuota)&&void 0!==i?i:(u=1,c=5,l=10,v=500,y=function(I){return"TimeoutError"===I.name?l:c},_=function(I){return y(I)<=v},Object.freeze({hasRetryTokens:_,retrieveRetryTokens:function(I){if(!_(I))throw new Error("No retry token available");var D=y(I);return v-=D,D},releaseRetryTokens:function(I){v+=null!=I?I:u,v=Math.min(v,500)}}))}return a.prototype.shouldRetry=function(e,t,r){return t<r&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},a.prototype.getMaxAttempts=function(){return(0,f.mG)(this,void 0,void 0,function(){var e;return(0,f.Jh)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=r.sent(),[3,3];case 2:return r.sent(),e=3,[3,3];case 3:return[2,e]}})})},a.prototype.retry=function(e,t,r){return(0,f.mG)(this,void 0,void 0,function(){var n,i,o,u,c,l,v,y;return(0,f.Jh)(this,function(_){switch(_.label){case 0:return i=0,o=0,[4,this.getMaxAttempts()];case 1:u=_.sent(),Ae.isInstance(c=t.request)&&(c.headers["amz-sdk-invocation-id"]=Rn()),l=function(){var x,P,I,D,N,F,te,re;return(0,f.Jh)(this,function(ue){switch(ue.label){case 0:return ue.trys.push([0,4,,7]),Ae.isInstance(c)&&(c.headers["amz-sdk-request"]="attempt=".concat(i+1,"; max=").concat(u)),(null==r?void 0:r.beforeRequest)?[4,r.beforeRequest()]:[3,2];case 1:ue.sent(),ue.label=2;case 2:return[4,e(t)];case 3:return x=ue.sent(),P=x.response,I=x.output,(null==r?void 0:r.afterRequest)&&r.afterRequest(P),v.retryQuota.releaseRetryTokens(n),I.$metadata.attempts=i+1,I.$metadata.totalRetryDelay=o,[2,{value:{response:P,output:I}}];case 4:return D=ue.sent(),N=Jn(D),i++,v.shouldRetry(N,i,u)?(n=v.retryQuota.retrieveRetryTokens(N),F=v.delayDecider(_t(N)?500:100,i),te=Hn(N.$response),re=Math.max(te||0,F),o+=re,[4,new Promise(function(Ee){return setTimeout(Ee,re)})]):[3,6];case 5:return ue.sent(),[2,"continue"];case 6:throw N.$metadata||(N.$metadata={}),N.$metadata.attempts=i,N.$metadata.totalRetryDelay=o,N;case 7:return[2]}})},v=this,_.label=2;case 2:return[5,l()];case 3:return"object"==typeof(y=_.sent())?[2,y.value]:[3,2];case 4:return[2]}})})},a}(),Hn=function(e){if(rt.isInstance(e)){var t=Object.keys(e.headers).find(function(o){return"retry-after"===o.toLowerCase()});if(t){var r=e.headers[t],n=Number(r);return Number.isNaN(n)?new Date(r).getTime()-Date.now():1e3*n}}},Jn=function(e){return e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):"string"==typeof e?new Error(e):new Error("AWS SDK error wrapper for ".concat(e))},Gn=function(a){function e(t,r){var n=this,i=null!=r?r:{},o=i.rateLimiter,u=(0,f._T)(i,["rateLimiter"]);return(n=a.call(this,t,u)||this).rateLimiter=null!=o?o:new _n,n.mode=De.ADAPTIVE,n}return(0,f.ZT)(e,a),e.prototype.retry=function(t,r){return(0,f.mG)(this,void 0,void 0,function(){var n=this;return(0,f.Jh)(this,function(i){return[2,a.prototype.retry.call(this,t,r,{beforeRequest:function(){return(0,f.mG)(n,void 0,void 0,function(){return(0,f.Jh)(this,function(u){return[2,this.rateLimiter.getSendToken()]})})},afterRequest:function(u){n.rateLimiter.updateClientSendingRate(u)}})]})})},e}(Ht),Kn={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},jt=function(a){function e(t,r){void 0===r&&(r=!0);var n=a.call(this,t)||this;return n.tryNextLink=r,n.name="ProviderError",Object.setPrototypeOf(n,e.prototype),n}return(0,f.ZT)(e,a),e.from=function(t,r){return void 0===r&&(r=!0),Object.assign(new this(t.message,r),t)},e}(Error);(function(a){(0,f.ZT)(function e(t,r){void 0===r&&(r=!0);var n=a.call(this,t,r)||this;return n.tryNextLink=r,n.name="CredentialsProviderError",Object.setPrototypeOf(n,e.prototype),n},a)})(jt),function(a){(0,f.ZT)(function e(t,r){void 0===r&&(r=!0);var n=a.call(this,t,r)||this;return n.tryNextLink=r,n.name="TokenProviderError",Object.setPrototypeOf(n,e.prototype),n},a)}(jt);for(var Vt={},bt={},He=0;He<256;He++){var Je=He.toString(16).toLowerCase();1===Je.length&&(Je="0".concat(Je)),Vt[He]=Je,bt[Je]=He}function Ne(a){for(var e="",t=0;t<a.byteLength;t++)e+=Vt[a[t]];return e}var qt="X-Amz-Date",Wt="X-Amz-Signature",$t="X-Amz-Security-Token",Zt="authorization",Kt=qt.toLowerCase(),ii=[Zt,Kt,"date"],ai=Wt.toLowerCase(),St="x-amz-content-sha256",oi=$t.toLowerCase(),si={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},ui=/^proxy-/,ci=/^sec-/,Et="AWS4-HMAC-SHA256",li="AWS4-HMAC-SHA256-PAYLOAD",Yt="aws4_request",Me={},at=[],xt=function(e,t,r){return"".concat(e,"/").concat(t,"/").concat(r,"/").concat(Yt)},Xt=function(e,t,r){var n=new e(t);return n.update(r),n.digest()},Qt=function(e,t,r){var n,i,o=e.headers,u={};try{for(var c=(0,f.XA)(Object.keys(o).sort()),l=c.next();!l.done;l=c.next()){var v=l.value;if(null!=o[v]){var y=v.toLowerCase();(y in si||(null==t?void 0:t.has(y))||ui.test(y)||ci.test(y))&&(!r||r&&!r.has(y))||(u[y]=o[v].trim().replace(/\s+/g," "))}}}catch(_){n={error:_}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}return u},Oe=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,mi)},mi=function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())},At=function(e,t){var r=e.headers,n=e.body;return(0,f.mG)(void 0,void 0,void 0,function(){var i,o,u,c,l,v,y;return(0,f.Jh)(this,function(_){switch(_.label){case 0:try{for(i=(0,f.XA)(Object.keys(r)),o=i.next();!o.done;o=i.next())if((u=o.value).toLowerCase()===St)return[2,r[u]]}catch(S){v={error:S}}finally{try{o&&!o.done&&(y=i.return)&&y.call(i)}finally{if(v)throw v.error}}return null!=n?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof n||ArrayBuffer.isView(n)||function(e){return"function"==typeof ArrayBuffer&&e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e)}(n)?((c=new t).update(n),l=Ne,[4,c.digest()]):[3,3];case 2:return[2,l.apply(void 0,[_.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}})})},er=function(e){var t=e.headers,r=e.query,n=(0,f._T)(e,["headers","query"]);return(0,f.pi)((0,f.pi)({},n),{headers:(0,f.pi)({},t),query:r?_i(r):void 0})},_i=function(e){return Object.keys(e).reduce(function(t,r){var n,i=e[r];return(0,f.pi)((0,f.pi)({},t),((n={})[r]=Array.isArray(i)?(0,f.ev)([],(0,f.CR)(i),!1):i,n))},{})},tr=function(e){var t,r;e="function"==typeof e.clone?e.clone():er(e);try{for(var n=(0,f.XA)(Object.keys(e.headers)),i=n.next();!i.done;i=n.next()){var o=i.value;ii.indexOf(o.toLowerCase())>-1&&delete e.headers[o]}}catch(u){t={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return e},rr=function(){function a(e){var t=e.applyChecksum,r=e.credentials,n=e.region,o=e.sha256,u=e.uriEscapePath,c=void 0===u||u;this.service=e.service,this.sha256=o,this.uriEscapePath=c,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=p(n),this.credentialProvider=p(r)}return a.prototype.presign=function(e,t){return void 0===t&&(t={}),(0,f.mG)(this,void 0,void 0,function(){var r,n,i,o,u,c,l,v,y,_,S,x,P,I,D,N,F,te,re,ue,Ee,Pe,tt,yt;return(0,f.Jh)(this,function(ye){switch(ye.label){case 0:return n=void 0===(r=t.signingDate)?new Date:r,o=void 0===(i=t.expiresIn)?3600:i,u=t.unsignableHeaders,c=t.unhoistableHeaders,l=t.signableHeaders,v=t.signingRegion,y=t.signingService,[4,this.credentialProvider()];case 1:return _=ye.sent(),this.validateResolvedCredentials(_),null==v?[3,2]:(x=v,[3,4]);case 2:return[4,this.regionProvider()];case 3:x=ye.sent(),ye.label=4;case 4:return S=x,P=ot(n),I=P.longDate,D=P.shortDate,o>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(N=xt(D,S,null!=y?y:this.service),F=function(e,t){var r,n,i;void 0===t&&(t={});var o="function"==typeof e.clone?e.clone():er(e),u=o.headers,c=o.query,l=void 0===c?{}:c;try{for(var v=(0,f.XA)(Object.keys(u)),y=v.next();!y.done;y=v.next()){var _=y.value,S=_.toLowerCase();"x-amz-"===S.slice(0,6)&&!(null===(i=t.unhoistableHeaders)||void 0===i?void 0:i.has(S))&&(l[_]=u[_],delete u[_])}}catch(x){r={error:x}}finally{try{y&&!y.done&&(n=v.return)&&n.call(v)}finally{if(r)throw r.error}}return(0,f.pi)((0,f.pi)({},e),{headers:u,query:l})}(tr(e),{unhoistableHeaders:c}),_.sessionToken&&(F.query[$t]=_.sessionToken),F.query["X-Amz-Algorithm"]=Et,F.query["X-Amz-Credential"]="".concat(_.accessKeyId,"/").concat(N),F.query[qt]=I,F.query["X-Amz-Expires"]=o.toString(10),te=Qt(F,u,l),F.query["X-Amz-SignedHeaders"]=nr(te),re=F.query,ue=Wt,Ee=this.getSignature,Pe=[I,N,this.getSigningKey(_,S,D,y)],tt=this.createCanonicalRequest,yt=[F,te],[4,At(e,this.sha256)]);case 5:return[4,Ee.apply(this,Pe.concat([tt.apply(this,yt.concat([ye.sent()]))]))];case 6:return re[ue]=ye.sent(),[2,F]}})})},a.prototype.sign=function(e,t){return(0,f.mG)(this,void 0,void 0,function(){return(0,f.Jh)(this,function(r){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]})})},a.prototype.signEvent=function(e,t){var r=e.headers,n=e.payload,i=t.signingDate,o=void 0===i?new Date:i,u=t.priorSignature,c=t.signingRegion,l=t.signingService;return(0,f.mG)(this,void 0,void 0,function(){var v,y,_,x,P,I,D,N,F,te;return(0,f.Jh)(this,function(re){switch(re.label){case 0:return null==c?[3,1]:(y=c,[3,3]);case 1:return[4,this.regionProvider()];case 2:y=re.sent(),re.label=3;case 3:return v=y,_=ot(o),x=_.longDate,P=xt(_.shortDate,v,null!=l?l:this.service),[4,At({headers:{},body:n},this.sha256)];case 4:return I=re.sent(),(D=new this.sha256).update(r),F=Ne,[4,D.digest()];case 5:return N=F.apply(void 0,[re.sent()]),te=[li,x,P,u,N,I].join("\n"),[2,this.signString(te,{signingDate:o,signingRegion:v,signingService:l})]}})})},a.prototype.signString=function(e,t){var r=void 0===t?{}:t,n=r.signingDate,i=void 0===n?new Date:n,o=r.signingRegion,u=r.signingService;return(0,f.mG)(this,void 0,void 0,function(){var c,l,v,y,_,S,x,P;return(0,f.Jh)(this,function(I){switch(I.label){case 0:return[4,this.credentialProvider()];case 1:return c=I.sent(),this.validateResolvedCredentials(c),null==o?[3,2]:(v=o,[3,4]);case 2:return[4,this.regionProvider()];case 3:v=I.sent(),I.label=4;case 4:return l=v,y=ot(i).shortDate,x=(S=this.sha256).bind,[4,this.getSigningKey(c,l,y,u)];case 5:return(_=new(x.apply(S,[void 0,I.sent()]))).update(e),P=Ne,[4,_.digest()];case 6:return[2,P.apply(void 0,[I.sent()])]}})})},a.prototype.signRequest=function(e,t){var r=void 0===t?{}:t,n=r.signingDate,i=void 0===n?new Date:n,o=r.signableHeaders,u=r.unsignableHeaders,c=r.signingRegion,l=r.signingService;return(0,f.mG)(this,void 0,void 0,function(){var v,y,_,S,x,P,I,D,N,F,te;return(0,f.Jh)(this,function(re){switch(re.label){case 0:return[4,this.credentialProvider()];case 1:return v=re.sent(),this.validateResolvedCredentials(v),null==c?[3,2]:(_=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:_=re.sent(),re.label=4;case 4:return y=_,S=tr(e),x=ot(i),P=x.longDate,D=xt(I=x.shortDate,y,null!=l?l:this.service),S.headers[Kt]=P,v.sessionToken&&(S.headers[oi]=v.sessionToken),[4,At(S,this.sha256)];case 5:return N=re.sent(),!function(e,t){var r,n;e=e.toLowerCase();try{for(var i=(0,f.XA)(Object.keys(t)),o=i.next();!o.done;o=i.next())if(e===o.value.toLowerCase())return!0}catch(c){r={error:c}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1}(St,S.headers)&&this.applyChecksum&&(S.headers[St]=N),F=Qt(S,u,o),[4,this.getSignature(P,D,this.getSigningKey(v,y,I,l),this.createCanonicalRequest(S,F,N))];case 6:return te=re.sent(),S.headers[Zt]="".concat(Et," ")+"Credential=".concat(v.accessKeyId,"/").concat(D,", ")+"SignedHeaders=".concat(nr(F),", ")+"Signature=".concat(te),[2,S]}})})},a.prototype.createCanonicalRequest=function(e,t,r){var n=Object.keys(t).sort();return"".concat(e.method,"\n").concat(this.getCanonicalPath(e),"\n").concat(function(e){var t,r,n=e.query,i=void 0===n?{}:n,o=[],u={},c=function(S){if(S.toLowerCase()===ai)return"continue";o.push(S);var x=i[S];"string"==typeof x?u[S]="".concat(Oe(S),"=").concat(Oe(x)):Array.isArray(x)&&(u[S]=x.slice(0).sort().reduce(function(P,I){return P.concat(["".concat(Oe(S),"=").concat(Oe(I))])},[]).join("&"))};try{for(var l=(0,f.XA)(Object.keys(i).sort()),v=l.next();!v.done;v=l.next())c(v.value)}catch(_){t={error:_}}finally{try{v&&!v.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return o.map(function(_){return u[_]}).filter(function(_){return _}).join("&")}(e),"\n").concat(n.map(function(i){return"".concat(i,":").concat(t[i])}).join("\n"),"\n\n").concat(n.join(";"),"\n").concat(r)},a.prototype.createStringToSign=function(e,t,r){return(0,f.mG)(this,void 0,void 0,function(){var n,i;return(0,f.Jh)(this,function(o){switch(o.label){case 0:return(n=new this.sha256).update(r),[4,n.digest()];case 1:return i=o.sent(),[2,"".concat(Et,"\n").concat(e,"\n").concat(t,"\n").concat(Ne(i))]}})})},a.prototype.getCanonicalPath=function(e){var t,r,n=e.path;if(this.uriEscapePath){var i=[];try{for(var o=(0,f.XA)(n.split("/")),u=o.next();!u.done;u=o.next()){var c=u.value;0!==(null==c?void 0:c.length)&&"."!==c&&(".."===c?i.pop():i.push(c))}}catch(y){t={error:y}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}var l="".concat((null==n?void 0:n.startsWith("/"))?"/":"").concat(i.join("/")).concat(i.length>0&&(null==n?void 0:n.endsWith("/"))?"/":"");return encodeURIComponent(l).replace(/%2F/g,"/")}return n},a.prototype.getSignature=function(e,t,r,n){return(0,f.mG)(this,void 0,void 0,function(){var i,o,u,c,l;return(0,f.Jh)(this,function(v){switch(v.label){case 0:return[4,this.createStringToSign(e,t,n)];case 1:return i=v.sent(),c=(u=this.sha256).bind,[4,r];case 2:return(o=new(c.apply(u,[void 0,v.sent()]))).update(i),l=Ne,[4,o.digest()];case 3:return[2,l.apply(void 0,[v.sent()])]}})})},a.prototype.getSigningKey=function(e,t,r,n){return function(e,t,r,n,i){return(0,f.mG)(void 0,void 0,void 0,function(){var o,u,c,l,v,_,S,x;return(0,f.Jh)(this,function(P){switch(P.label){case 0:return[4,Xt(e,t.secretAccessKey,t.accessKeyId)];case 1:if(o=P.sent(),(u="".concat(r,":").concat(n,":").concat(i,":").concat(Ne(o),":").concat(t.sessionToken))in Me)return[2,Me[u]];for(at.push(u);at.length>50;)delete Me[at.shift()];c="AWS4".concat(t.secretAccessKey),P.label=2;case 2:P.trys.push([2,7,8,9]),l=(0,f.XA)([r,n,i,Yt]),v=l.next(),P.label=3;case 3:return v.done?[3,6]:[4,Xt(e,c,v.value)];case 4:c=P.sent(),P.label=5;case 5:return v=l.next(),[3,3];case 6:return[3,9];case 7:return _=P.sent(),S={error:_},[3,9];case 8:try{v&&!v.done&&(x=l.return)&&x.call(l)}finally{if(S)throw S.error}return[7];case 9:return[2,Me[u]=c]}})})}(this.sha256,e,r,t,n||this.service)},a.prototype.validateResolvedCredentials=function(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")},a}(),ot=function(e){var t=function(e){return function(e){return"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e}(e).toISOString().replace(/\.\d{3}Z$/,"Z")}(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}},nr=function(e){return Object.keys(e).sort().join(";")},ar=function(e){return new Date(Date.now()+e)},or=function(e,t){var r=Date.parse(e);return function(e,t){return Math.abs(ar(t).getTime()-e)>=3e5}(r,t)?r-Date.now():t},sr=function(e){var t,r,n;return rt.isInstance(e)?null!==(r=null===(t=e.headers)||void 0===t?void 0:t.date)&&void 0!==r?r:null===(n=e.headers)||void 0===n?void 0:n.Date:void 0},Ci={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},ur="user-agent",Tt="x-amz-user-agent",Pi=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,Ct=function(e){var t=(0,f.CR)(e,2),r=t[0],n=t[1],i=r.indexOf("/"),o=r.substring(0,i),u=r.substring(i+1);return"api"===o&&(u=u.toLowerCase()),[o,u,n].filter(function(c){return c&&c.length>0}).map(function(c){return null==c?void 0:c.replace(Pi,"_")}).join("/")},Di={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},lr=function a(){var e=[],t=[],r=new Set,u=function(_){return e.forEach(function(S){_.add(S.middleware,(0,f.pi)({},S))}),t.forEach(function(S){_.addRelativeTo(S.middleware,(0,f.pi)({},S))}),_},c=function y(_){var S=[];return _.before.forEach(function(x){0===x.before.length&&0===x.after.length?S.push(x):S.push.apply(S,(0,f.ev)([],(0,f.CR)(y(x)),!1))}),S.push(_),_.after.reverse().forEach(function(x){0===x.before.length&&0===x.after.length?S.push(x):S.push.apply(S,(0,f.ev)([],(0,f.CR)(y(x)),!1))}),S},l=function(_){void 0===_&&(_=!1);var S=[],x=[],P={};return e.forEach(function(D){var N=(0,f.pi)((0,f.pi)({},D),{before:[],after:[]});N.name&&(P[N.name]=N),S.push(N)}),t.forEach(function(D){var N=(0,f.pi)((0,f.pi)({},D),{before:[],after:[]});N.name&&(P[N.name]=N),x.push(N)}),x.forEach(function(D){if(D.toMiddleware){var N=P[D.toMiddleware];if(void 0===N){if(_)return;throw new Error("".concat(D.toMiddleware," is not found when adding ").concat(D.name||"anonymous"," middleware ").concat(D.relation," ").concat(D.toMiddleware))}"after"===D.relation&&N.after.push(D),"before"===D.relation&&N.before.push(D)}}),function(_){return _.sort(function(S,x){return fr[x.step]-fr[S.step]||dr[x.priority||"normal"]-dr[S.priority||"normal"]})}(S).map(c).reduce(function(D,N){return D.push.apply(D,(0,f.ev)([],(0,f.CR)(N),!1)),D},[])},v={add:function(_,S){void 0===S&&(S={});var x=S.name,P=S.override,I=(0,f.pi)({step:"initialize",priority:"normal",middleware:_},S);if(x){if(r.has(x)){if(!P)throw new Error("Duplicate middleware name '".concat(x,"'"));var D=e.findIndex(function(F){return F.name===x}),N=e[D];if(N.step!==I.step||N.priority!==I.priority)throw new Error('"'.concat(x,'" middleware with ').concat(N.priority," priority in ").concat(N.step," step cannot be ")+"overridden by same-name middleware with ".concat(I.priority," priority in ").concat(I.step," step."));e.splice(D,1)}r.add(x)}e.push(I)},addRelativeTo:function(_,S){var x=S.name,P=S.override,I=(0,f.pi)({middleware:_},S);if(x){if(r.has(x)){if(!P)throw new Error("Duplicate middleware name '".concat(x,"'"));var D=t.findIndex(function(F){return F.name===x}),N=t[D];if(N.toMiddleware!==I.toMiddleware||N.relation!==I.relation)throw new Error('"'.concat(x,'" middleware ').concat(N.relation,' "').concat(N.toMiddleware,'" middleware cannot be overridden ')+"by same-name middleware ".concat(I.relation,' "').concat(I.toMiddleware,'" middleware.'));t.splice(D,1)}r.add(x)}t.push(I)},clone:function(){return u(a())},use:function(_){_.applyToStack(v)},remove:function(_){return"string"==typeof _?function(_){var S=!1,x=function(I){return!I.name||I.name!==_||(S=!0,r.delete(_),!1)};return e=e.filter(x),t=t.filter(x),S}(_):function(_){var S=!1,x=function(I){return I.middleware!==_||(S=!0,I.name&&r.delete(I.name),!1)};return e=e.filter(x),t=t.filter(x),S}(_)},removeByTag:function(_){var S=!1,x=function(I){var D=I.tags,N=I.name;return!D||!D.includes(_)||(N&&r.delete(N),S=!0,!1)};return e=e.filter(x),t=t.filter(x),S},concat:function(_){var S=u(a());return S.use(_),S},applyToStack:u,identify:function(){return l(!0).map(function(_){return _.name+": "+(_.tags||[]).join(",")})},resolve:function(_,S){var x,P;try{for(var I=(0,f.XA)(l().map(function(F){return F.middleware}).reverse()),D=I.next();!D.done;D=I.next())_=(0,D.value)(_,S)}catch(F){x={error:F}}finally{try{D&&!D.done&&(P=I.return)&&P.call(I)}finally{if(x)throw x.error}}return _}};return v},fr={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},dr={high:3,normal:2,low:1},Mi=function(){function a(e){this.middlewareStack=lr(),this.config=e}return a.prototype.send=function(e,t,r){var i="function"==typeof t?t:r,o=e.resolveMiddleware(this.middlewareStack,this.config,"function"!=typeof t?t:void 0);if(!i)return o(e).then(function(u){return u.output});o(e).then(function(u){return i(null,u.output)},function(u){return i(u)}).catch(function(){})},a.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},a}(),vr=function(){this.middlewareStack=lr()},le="***SensitiveInformation***",It=(Math.ceil(Math.pow(2,127)*(2-Math.pow(2,-23))),function(e){if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError("Expected integer, got ".concat(typeof e,": ").concat(e))}}),ut=function(e){return Pt(e,32)},Pt=function(e,t){var r=It(e);if(void 0!==r&&zi(r,t)!==r)throw new TypeError("Expected ".concat(t,"-bit integer, got ").concat(e));return r},zi=function(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]}},Fi=function(e,t){if(null==e)throw t?new TypeError("Expected a non-null value for ".concat(t)):new TypeError("Expected a non-null value");return e},pr=function(e){if(null!=e){if("object"==typeof e&&!Array.isArray(e))return e;var t=Array.isArray(e)?"array":typeof e;throw new TypeError("Expected object, got ".concat(t,": ").concat(e))}},$=function(e){if(null!=e){if("string"==typeof e)return e;if(["boolean","number","bigint"].includes(typeof e))return lt.warn(ct("Expected string, got ".concat(typeof e,": ").concat(e))),String(e);throw new TypeError("Expected string, got ".concat(typeof e,": ").concat(e))}},ki=function(e){return"string"==typeof e?gr(e):function(e){if(null!=e){if("string"==typeof e){var t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&<.warn(ct("Expected number but observed string: ".concat(e))),t}if("number"==typeof e)return e;throw new TypeError("Expected number, got ".concat(typeof e,": ").concat(e))}}(e)},gr=function(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: ".concat(e))}},ct=function(e){return String(new TypeError(e).stack||e).split("\n").slice(0,5).filter(function(t){return!t.includes("stackTraceWarning")}).join("\n")},lt={warn:console.warn},Xi=function(a){function e(t){var r=a.call(this,t.message)||this;return Object.setPrototypeOf(r,e.prototype),r.name=t.name,r.$fault=t.$fault,r.$metadata=t.$metadata,r}return(0,f.ZT)(e,a),e}(Error),he=function(e,t){return void 0===t&&(t={}),Object.entries(t).filter(function(n){return void 0!==(0,f.CR)(n,2)[1]}).forEach(function(n){var i=(0,f.CR)(n,2),o=i[0];(null==e[o]||""===e[o])&&(e[o]=i[1])}),e.message=e.message||e.Message||"UnknownError",delete e.Message,e},yr=function(e){var r=e.parsedBody,n=e.exceptionCtor,i=e.errorCode,o=Qi(e.output),c=new n({name:r.code||r.Code||i||(o.httpStatusCode?o.httpStatusCode+"":void 0)||"UnknowError",$fault:"client",$metadata:o});throw he(c,r)},Qi=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},ea=function(e){switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},dt=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,(0,f.ev)([null],(0,f.CR)(arguments),!1)),r=new t;return Object.setPrototypeOf(r,e.prototype),r};dt.prototype=Object.create(String.prototype,{constructor:{value:dt,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(dt,String);var Ce=function(a){function e(){return null!==a&&a.apply(this,arguments)||this}return(0,f.ZT)(e,a),e.prototype.deserializeJSON=function(){return JSON.parse(a.prototype.toString.call(this))},e.prototype.toJSON=function(){return a.prototype.toString.call(this)},e.fromObject=function(t){return t instanceof e?t:new e(t instanceof String||"string"==typeof t?t:JSON.stringify(t))},e}(dt);function _r(a,e,t){var r,n,i,u;if(void 0===e&&void 0===t)i={},u=a;else{if(i=a,"function"==typeof e)return ta(i,e,u=t);u=e}try{for(var c=(0,f.XA)(Object.keys(u)),l=c.next();!l.done;l=c.next()){var v=l.value;if(Array.isArray(u[v])){var y=(0,f.CR)(u[v],2),_=y[0],S=y[1];if("function"==typeof S){var x=void 0,P=void 0===_&&null!=(x=S()),I="function"==typeof _&&!!_(void 0)||"function"!=typeof _&&!!_;P?i[v]=x:I&&(i[v]=S())}else P=void 0===_&&null!=S,I="function"==typeof _&&!!_(S)||"function"!=typeof _&&!!_,(P||I)&&(i[v]=S)}else i[v]=u[v]}}catch(D){r={error:D}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return i}var ta=function(e,t,r){return _r(e,Object.entries(r).reduce(function(n,i){var o=(0,f.CR)(i,2),c=o[1];return n[o[0]]=Array.isArray(c)?c:"function"==typeof c?[t,c()]:[t,c],n},{}))};function wr(a){return encodeURIComponent(a).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}var ze=function(e,t,r,n,i,o){if(null==t||void 0===t[r])throw new Error("No value provided for input HTTP label: "+r+".");var u=n();if(u.length<=0)throw new Error("Empty value provided for input HTTP label: "+r+".");return e.replace(i,o?u.split("/").map(function(c){return wr(c)}).join("/"):wr(u))},na=T(11457);function aa(a){return void 0===a&&(a=0),new Promise(function(e,t){a&&setTimeout(function(){var r=new Error("Request did not complete within ".concat(a," ms"));r.name="TimeoutError",t(r)},a)})}for(var oa=function(){function a(e){"function"==typeof e?this.configProvider=e().then(function(t){return t||{}}):(this.config=null!=e?e:{},this.configProvider=Promise.resolve(this.config))}return a.prototype.destroy=function(){},a.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal;return(0,f.mG)(this,void 0,void 0,function(){var i,o,u,c,l,v,y,_,x,P,I;return(0,f.Jh)(this,function(D){switch(D.label){case 0:return this.config?[3,2]:(i=this,[4,this.configProvider]);case 1:i.config=D.sent(),D.label=2;case 2:return o=this.config.requestTimeout,(null==n?void 0:n.aborted)?((u=new Error("Request aborted")).name="AbortError",[2,Promise.reject(u)]):(c=e.path,e.query&&(l=function(a){var e,t,r=[];try{for(var n=(0,f.XA)(Object.keys(a).sort()),i=n.next();!i.done;i=n.next()){var o=i.value,u=a[o];if(o=Oe(o),Array.isArray(u))for(var c=0,l=u.length;c<l;c++)r.push("".concat(o,"=").concat(Oe(u[c])));else{var v=o;(u||"string"==typeof u)&&(v+="=".concat(Oe(u))),r.push(v)}}}catch(y){e={error:y}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r.join("&")}(e.query))&&(c+="?".concat(l)),v=e.port,y=e.method,_="".concat(e.protocol,"//").concat(e.hostname).concat(v?":".concat(v):"").concat(c),x={body:"GET"===y||"HEAD"===y?void 0:e.body,headers:new Headers(e.headers),method:y},"undefined"!=typeof AbortController&&(x.signal=n),P=new Request(_,x),I=[fetch(P).then(function(N){var F,te,re=N.headers,ue={};try{for(var Ee=(0,f.XA)(re.entries()),Pe=Ee.next();!Pe.done;Pe=Ee.next()){var tt=Pe.value;ue[tt[0]]=tt[1]}}catch(ye){F={error:ye}}finally{try{Pe&&!Pe.done&&(te=Ee.return)&&te.call(Ee)}finally{if(F)throw F.error}}return void 0!==N.body?{response:new rt({headers:ue,statusCode:N.status,body:N.body})}:N.blob().then(function(ye){return{response:new rt({headers:ue,statusCode:N.status,body:ye})}})}),aa(o)],n&&I.push(new Promise(function(N,F){n.onabort=function(){var te=new Error("Request aborted");te.name="AbortError",F(te)}})),[2,Promise.race(I)])}})})},a}(),Re={},Fe=new Array(64),se=0,je="A".charCodeAt(0),Nt="Z".charCodeAt(0);se+je<=Nt;se++){var Ie=String.fromCharCode(se+je);Re[Ie]=se,Fe[se]=Ie}for(se=0,je="a".charCodeAt(0),Nt="z".charCodeAt(0);se+je<=Nt;se++)Ie=String.fromCharCode(se+je),Re[Ie]=Ve=se+26,Fe[Ve]=Ie;for(se=0;se<10;se++){var Ve;Re[se.toString(10)]=se+52,Ie=se.toString(10),Re[Ie]=Ve=se+52,Fe[Ve]=Ie}function br(a){var e=a.length/4*3;"=="===a.slice(-2)?e-=2:"="===a.slice(-1)&&e--;for(var t=new ArrayBuffer(e),r=new DataView(t),n=0;n<a.length;n+=4){for(var i=0,o=0,u=n,c=n+3;u<=c;u++)if("="!==a[u]){if(!(a[u]in Re))throw new TypeError("Invalid character ".concat(a[u]," in base64 string."));i|=Re[a[u]]<<6*(c-u),o+=6}else i>>=6;var l=n/4*3;i>>=o%8;for(var v=Math.floor(o/8),y=0;y<v;y++){var _=8*(v-y-1);r.setUint8(l+y,(i&255<<_)>>_)}}return new Uint8Array(t)}function ua(a){for(var e="",t=0;t<a.length;t+=3){for(var r=0,n=0,i=t,o=Math.min(t+3,a.length);i<o;i++)r|=a[i]<<8*(o-i-1),n+=8;var u=Math.ceil(n/6);r<<=6*u-n;for(var c=1;c<=u;c++){var l=6*(u-c);e+=Fe[(r&63<<l)>>l]}e+="==".slice(0,4-u)}return e}Re["+"]=62,Fe[62]="+",Re["/"]=63,Fe[63]="/";var ca=function(e){return"function"==typeof Blob&&e instanceof Blob?function(a){return(0,f.mG)(this,void 0,void 0,function(){var e,t;return(0,f.Jh)(this,function(r){switch(r.label){case 0:return[4,da(a)];case 1:return e=r.sent(),t=br(e),[2,new Uint8Array(t)]}})})}(e):function(a){return(0,f.mG)(this,void 0,void 0,function(){var e,t,r,n,i,o,u;return(0,f.Jh)(this,function(c){switch(c.label){case 0:e=new Uint8Array(0),t=a.getReader(),r=!1,c.label=1;case 1:return r?[3,3]:[4,t.read()];case 2:return n=c.sent(),i=n.done,(o=n.value)&&(u=e,(e=new Uint8Array(u.length+o.length)).set(u),e.set(o,u.length)),r=i,[3,1];case 3:return[2,e]}})})}(e)};function da(a){return new Promise(function(e,t){var r=new FileReader;r.onloadend=function(){var n;if(2!==r.readyState)return t(new Error("Reader aborted too early"));var i=null!==(n=r.result)&&void 0!==n?n:"",o=i.indexOf(",");e(i.substring(o>-1?o+1:i.length))},r.onabort=function(){return t(new Error("Read aborted"))},r.onerror=function(){return t(r.error)},r.readAsDataURL(a)})}var va=function(e){return function(){return Promise.reject(e)}},ha=function(e){if("string"==typeof e){for(var t=e.length,r=t-1;r>=0;r--){var n=e.charCodeAt(r);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&r--}return t}if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;throw new Error("Body Length computation failed for ".concat(e))},ma=T(63841),Sr=T.n(ma),pa=function(e){var t=e.serviceId,r=e.clientVersion;return function(){return(0,f.mG)(void 0,void 0,void 0,function(){var n,i,o,u,c,l,v,y,_;return(0,f.Jh)(this,function(S){return n="undefined"!=typeof window&&(null===(o=null==window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)?Sr().parse(window.navigator.userAgent):void 0,i=[["aws-sdk-js",r],["os/".concat((null===(u=null==n?void 0:n.os)||void 0===u?void 0:u.name)||"other"),null===(c=null==n?void 0:n.os)||void 0===c?void 0:c.version],["lang/js"],["md/browser","".concat(null!==(v=null===(l=null==n?void 0:n.browser)||void 0===l?void 0:l.name)&&void 0!==v?v:"unknown","_").concat(null!==(_=null===(y=null==n?void 0:n.browser)||void 0===y?void 0:y.version)&&void 0!==_?_:"unknown")]],t&&i.push(["api/".concat(t),r]),[2,i]})})}},Er=T(36308),ya=function a(e){if("string"==typeof e)return a(new URL(e));var c,r=e.hostname,n=e.pathname,i=e.port,o=e.protocol,u=e.search;return u&&(c=function(a){var e,t,r={};if(a=a.replace(/^\?/,""))try{for(var n=(0,f.XA)(a.split("&")),i=n.next();!i.done;i=n.next()){var u=(0,f.CR)(i.value.split("="),2),c=u[0],l=u[1],v=void 0===l?null:l;c=decodeURIComponent(c),v&&(v=decodeURIComponent(v)),c in r?Array.isArray(r[c])?r[c].push(v):r[c]=[r[c],v]:r[c]=v}}catch(y){e={error:y}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r}(u)),{hostname:r,port:i?parseInt(i):void 0,protocol:o,path:n,query:c}},_a={"us-east-1":{variants:[{hostname:"runtime-fips.lex.us-east-1.amazonaws.com",tags:["fips"]}]},"us-gov-west-1":{variants:[{hostname:"runtime-fips.lex.us-gov-west-1.amazonaws.com",tags:["fips"]}]},"us-west-2":{variants:[{hostname:"runtime-fips.lex.us-west-2.amazonaws.com",tags:["fips"]}]}},wa={aws:{regions:["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-southeast-1","ap-southeast-2","ap-southeast-3","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-central-1","me-south-1","sa-east-1","us-east-1","us-east-1-fips","us-east-2","us-west-1","us-west-2","us-west-2-fips"],regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",variants:[{hostname:"runtime.lex.{region}.amazonaws.com",tags:[]},{hostname:"runtime-fips.lex.{region}.amazonaws.com",tags:["fips"]},{hostname:"runtime.lex-fips.{region}.api.aws",tags:["dualstack","fips"]},{hostname:"runtime.lex.{region}.api.aws",tags:["dualstack"]}]},"aws-cn":{regions:["cn-north-1","cn-northwest-1"],regionRegex:"^cn\\-\\w+\\-\\d+$",variants:[{hostname:"runtime.lex.{region}.amazonaws.com.cn",tags:[]},{hostname:"runtime.lex-fips.{region}.amazonaws.com.cn",tags:["fips"]},{hostname:"runtime.lex-fips.{region}.api.amazonwebservices.com.cn",tags:["dualstack","fips"]},{hostname:"runtime.lex.{region}.api.amazonwebservices.com.cn",tags:["dualstack"]}]},"aws-iso":{regions:["us-iso-east-1","us-iso-west-1"],regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",variants:[{hostname:"runtime.lex.{region}.c2s.ic.gov",tags:[]},{hostname:"runtime.lex-fips.{region}.c2s.ic.gov",tags:["fips"]}]},"aws-iso-b":{regions:["us-isob-east-1"],regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",variants:[{hostname:"runtime.lex.{region}.sc2s.sgov.gov",tags:[]},{hostname:"runtime.lex-fips.{region}.sc2s.sgov.gov",tags:["fips"]}]},"aws-us-gov":{regions:["us-gov-east-1","us-gov-west-1","us-gov-west-1-fips"],regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",variants:[{hostname:"runtime.lex.{region}.amazonaws.com",tags:[]},{hostname:"runtime-fips.lex.{region}.amazonaws.com",tags:["fips"]},{hostname:"runtime.lex-fips.{region}.api.aws",tags:["dualstack","fips"]},{hostname:"runtime.lex.{region}.api.aws",tags:["dualstack"]}]}},ba=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){return(0,f.Jh)(this,function(r){return[2,Vr(e,(0,f.pi)((0,f.pi)({},t),{signingService:"lex",regionHash:_a,partitionHash:wa}))]})})},xr=function(a){function e(t,r){void 0===r&&(r=!0);var n=a.call(this,t)||this;return n.tryNextLink=r,n.name="ProviderError",Object.setPrototypeOf(n,e.prototype),n}return(0,f.ZT)(e,a),e.from=function(t,r){return void 0===r&&(r=!0),Object.assign(new this(t.message,r),t)},e}(Error);(function(a){(0,f.ZT)(function e(t,r){void 0===r&&(r=!0);var n=a.call(this,t,r)||this;return n.tryNextLink=r,n.name="CredentialsProviderError",Object.setPrototypeOf(n,e.prototype),n},a)})(xr),function(a){(0,f.ZT)(function e(t,r){void 0===r&&(r=!0);var n=a.call(this,t,r)||this;return n.tryNextLink=r,n.name="TokenProviderError",Object.setPrototypeOf(n,e.prototype),n},a)}(xr);var xa=["in-region","cross-region","mobile","standard","legacy"],Ta=function(){var e,t,r="undefined"!=typeof window&&(null===(e=null==window?void 0:window.navigator)||void 0===e?void 0:e.userAgent)?Sr().parse(window.navigator.userAgent):void 0,n=null===(t=null==r?void 0:r.platform)||void 0===t?void 0:t.type;return"tablet"===n||"mobile"===n},Ca=function(e){var t,r,n,i,o,u,c,l,v,y,_,S,x,P,I,D=function(e){var r=(void 0===e?{}:e).defaultsMode;return function(e,t,r){var n,i,o,c=function(){return(0,f.mG)(void 0,void 0,void 0,function(){return(0,f.Jh)(this,function(v){switch(v.label){case 0:i||(i=e()),v.label=1;case 1:return v.trys.push([1,,3,4]),[4,i];case 2:return n=v.sent(),o=!0,[3,4];case 3:return i=void 0,[7];case 4:return[2,n]}})})};return function(l){return(0,f.mG)(void 0,void 0,void 0,function(){return(0,f.Jh)(this,function(v){switch(v.label){case 0:return!o||(null==l?void 0:l.forceRefresh)?[4,c()]:[3,2];case 1:n=v.sent(),v.label=2;case 2:return[2,n]}})})}}(function(){return(0,f.mG)(void 0,void 0,void 0,function(){var n,i;return(0,f.Jh)(this,function(o){switch(o.label){case 0:return"function"!=typeof r?[3,2]:[4,r()];case 1:return i=o.sent(),[3,3];case 2:i=r,o.label=3;case 3:switch(null==(n=i)?void 0:n.toLowerCase()){case"auto":return[2,Promise.resolve(Ta()?"mobile":"standard")];case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return[2,Promise.resolve(null==n?void 0:n.toLocaleLowerCase())];case void 0:return[2,Promise.resolve("legacy")];default:throw new Error('Invalid parameter for "defaultsMode", expect '.concat(xa.join(", "),", got ").concat(n))}return[2]}})})})}(e),N=function(){return D().then(ea)},F=function(e){var t,r,n,i,o;return{apiVersion:"2016-11-28",disableHostPrefix:null!==(t=null==e?void 0:e.disableHostPrefix)&&void 0!==t&&t,logger:null!==(r=null==e?void 0:e.logger)&&void 0!==r?r:{},regionInfoProvider:null!==(n=null==e?void 0:e.regionInfoProvider)&&void 0!==n?n:ba,serviceId:null!==(i=null==e?void 0:e.serviceId)&&void 0!==i?i:"Lex Runtime Service",urlParser:null!==(o=null==e?void 0:e.urlParser)&&void 0!==o?o:ya}}(e);return(0,f.pi)((0,f.pi)((0,f.pi)({},F),e),{runtime:"browser",defaultsMode:D,base64Decoder:null!==(t=null==e?void 0:e.base64Decoder)&&void 0!==t?t:br,base64Encoder:null!==(r=null==e?void 0:e.base64Encoder)&&void 0!==r?r:ua,bodyLengthChecker:null!==(n=null==e?void 0:e.bodyLengthChecker)&&void 0!==n?n:ha,credentialDefaultProvider:null!==(i=null==e?void 0:e.credentialDefaultProvider)&&void 0!==i?i:function(te){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:null!==(o=null==e?void 0:e.defaultUserAgentProvider)&&void 0!==o?o:pa({serviceId:F.serviceId,clientVersion:"3.186.0"}),maxAttempts:null!==(u=null==e?void 0:e.maxAttempts)&&void 0!==u?u:3,region:null!==(c=null==e?void 0:e.region)&&void 0!==c?c:va("Region is missing"),requestHandler:null!==(l=null==e?void 0:e.requestHandler)&&void 0!==l?l:new oa(N),retryMode:null!==(v=null==e?void 0:e.retryMode)&&void 0!==v?v:function(){return(0,f.mG)(void 0,void 0,void 0,function(){return(0,f.Jh)(this,function(te){switch(te.label){case 0:return[4,N()];case 1:return[2,te.sent().retryMode||Ut]}})})},sha256:null!==(y=null==e?void 0:e.sha256)&&void 0!==y?y:na.Sha256,streamCollector:null!==(_=null==e?void 0:e.streamCollector)&&void 0!==_?_:ca,useDualstackEndpoint:null!==(S=null==e?void 0:e.useDualstackEndpoint)&&void 0!==S?S:function(){return Promise.resolve(!1)},useFipsEndpoint:null!==(x=null==e?void 0:e.useFipsEndpoint)&&void 0!==x?x:function(){return Promise.resolve(!1)},utf8Decoder:null!==(P=null==e?void 0:e.utf8Decoder)&&void 0!==P?P:Er.fromUtf8,utf8Encoder:null!==(I=null==e?void 0:e.utf8Encoder)&&void 0!==I?I:Er.toUtf8})},Ra=function(a){function e(t){var r=this,v=function(a){return(0,f.pi)((0,f.pi)({},a),{customUserAgent:"string"==typeof a.customUserAgent?[[a.customUserAgent]]:a.customUserAgent})}(function(e){var c,t=e.credentials?function(e){return"function"==typeof e?function(e,t,r){var n,i,o,u=!1,c=function(){return(0,f.mG)(void 0,void 0,void 0,function(){return(0,f.Jh)(this,function(v){switch(v.label){case 0:i||(i=e()),v.label=1;case 1:return v.trys.push([1,,3,4]),[4,i];case 2:return n=v.sent(),o=!0,u=!1,[3,4];case 3:return i=void 0,[7];case 4:return[2,n]}})})};return void 0===t?function(l){return(0,f.mG)(void 0,void 0,void 0,function(){return(0,f.Jh)(this,function(v){switch(v.label){case 0:return!o||(null==l?void 0:l.forceRefresh)?[4,c()]:[3,2];case 1:n=v.sent(),v.label=2;case 2:return[2,n]}})})}:function(l){return(0,f.mG)(void 0,void 0,void 0,function(){return(0,f.Jh)(this,function(v){switch(v.label){case 0:return!o||(null==l?void 0:l.forceRefresh)?[4,c()]:[3,2];case 1:n=v.sent(),v.label=2;case 2:return u?[2,n]:r&&!r(n)?(u=!0,[2,n]):t(n)?[4,c()]:[3,4];case 3:return v.sent(),[2,n];case 4:return[2,n]}})})}}(e,function(t){return void 0!==t.expiration&&t.expiration.getTime()-Date.now()<3e5},function(t){return void 0!==t.expiration}):p(e)}(e.credentials):e.credentialDefaultProvider(e),r=e.signingEscapePath,n=void 0===r||r,i=e.systemClockOffset,o=void 0===i?e.systemClockOffset||0:i,u=e.sha256;return c=e.signer?p(e.signer):e.regionInfoProvider?function(){return p(e.region)().then(function(v){return(0,f.mG)(void 0,void 0,void 0,function(){var y,_,S,x;return(0,f.Jh)(this,function(P){switch(P.label){case 0:return _=(y=e).regionInfoProvider,S=[v],x={},[4,e.useFipsEndpoint()];case 1:return x.useFipsEndpoint=P.sent(),[4,e.useDualstackEndpoint()];case 2:return[4,_.apply(y,S.concat([(x.useDualstackEndpoint=P.sent(),x)]))];case 3:return[2,[P.sent()||{},v]]}})})}).then(function(v){var y=(0,f.CR)(v,2),_=y[0],P=_.signingService;e.signingRegion=e.signingRegion||_.signingRegion||y[1],e.signingName=e.signingName||P||e.serviceId;var I=(0,f.pi)((0,f.pi)({},e),{credentials:t,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:n});return new(e.signerConstructor||rr)(I)})}:function(v){return(0,f.mG)(void 0,void 0,void 0,function(){var y,_,S;return(0,f.Jh)(this,function(P){if(!v)throw new Error("Unexpected empty auth scheme config");return y=v.signingScope,_=v.signingName,e.signingRegion=e.signingRegion||y,e.signingName=e.signingName||_||e.serviceId,S=(0,f.pi)((0,f.pi)({},e),{credentials:t,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:n}),[2,new(e.signerConstructor||rr)(S)]})})},(0,f.pi)((0,f.pi)({},e),{systemClockOffset:o,signingEscapePath:n,credentials:t,signer:c})}(function(e){var t,r=p(null!==(t=e.maxAttempts)&&void 0!==t?t:3);return(0,f.pi)((0,f.pi)({},e),{maxAttempts:r,retryStrategy:function(){return(0,f.mG)(void 0,void 0,void 0,function(){return(0,f.Jh)(this,function(o){switch(o.label){case 0:return e.retryStrategy?[2,e.retryStrategy]:[4,p(e.retryMode)()];case 1:return o.sent()===De.ADAPTIVE?[2,new Gn(r)]:[2,new Ht(r)]}})})}})}(function(e){var t,r=p(e.useDualstackEndpoint),n=e.endpoint,i=e.useFipsEndpoint,o=e.urlParser;return(0,f.pi)((0,f.pi)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:n?p("string"==typeof n?o(n):n):function(){return function(e){return(0,f.mG)(void 0,void 0,void 0,function(){var t,r,n,o,u,c,l;return(0,f.Jh)(this,function(v){switch(v.label){case 0:return r=void 0===(t=e.tls)||t,[4,e.region()];case 1:if(n=v.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(n))throw new Error("Invalid region in client config");return[4,e.useDualstackEndpoint()];case 2:return o=v.sent(),[4,e.useFipsEndpoint()];case 3:return u=v.sent(),[4,e.regionInfoProvider(n,{useDualstackEndpoint:o,useFipsEndpoint:u})];case 4:if(!(c=(null!==(l=v.sent())&&void 0!==l?l:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser("".concat(r?"https:":"http:","//").concat(c))]}})})}((0,f.pi)((0,f.pi)({},e),{useDualstackEndpoint:r,useFipsEndpoint:i}))},isCustomEndpoint:!!n,useDualstackEndpoint:r})}(function(e){var t=e.region,r=e.useFipsEndpoint;if(!t)throw new Error("Region is missing");return(0,f.pi)((0,f.pi)({},e),{region:function(){return(0,f.mG)(void 0,void 0,void 0,function(){var i;return(0,f.Jh)(this,function(o){switch(o.label){case 0:return"string"==typeof t?[2,Z(t)]:[4,t()];case 1:return i=o.sent(),[2,Z(i)]}})})},useFipsEndpoint:function(){return(0,f.mG)(void 0,void 0,void 0,function(){var o;return(0,f.Jh)(this,function(u){switch(u.label){case 0:return"string"!=typeof t?[3,1]:(o=t,[3,3]);case 1:return[4,t()];case 2:o=u.sent(),u.label=3;case 3:return B(o)?[2,!0]:[2,"boolean"==typeof r?Promise.resolve(r):r()]}})})}})}(Ca(t))))));return(r=a.call(this,v)||this).config=v,r.middlewareStack.use(function(e){return{applyToStack:function(r){r.add(function(e){return function(t,r){return function(n){return(0,f.mG)(void 0,void 0,void 0,function(){var i;return(0,f.Jh)(this,function(o){switch(o.label){case 0:return[4,e.retryStrategy()];case 1:return(null==(i=o.sent())?void 0:i.mode)&&(r.userAgent=(0,f.ev)((0,f.ev)([],(0,f.CR)(r.userAgent||[]),!1),[["cfg/retry-mode",i.mode]],!1)),[2,i.retry(t,n)]}})})}}}(e),Kn)}}}(r.config)),r.middlewareStack.use(function(e){return{applyToStack:function(r){r.add(function(a){var e=this;return function(t){return function(r){return(0,f.mG)(e,void 0,void 0,function(){var n,i,o,u,c;return(0,f.Jh)(this,function(l){if(Ae.isInstance(n=r.request)&&(o=n.headers,(i=n.body)&&-1===Object.keys(o).map(function(v){return v.toLowerCase()}).indexOf(Bt)))try{u=a(i),n.headers=(0,f.pi)((0,f.pi)({},n.headers),((c={})[Bt]=String(u),c))}catch(v){}return[2,t((0,f.pi)((0,f.pi)({},r),{request:n}))]})})}}}(e.bodyLengthChecker),$r)}}}(r.config)),r.middlewareStack.use(function(e){return{applyToStack:function(r){r.add(function(e){return function(t){return function(r){return(0,f.mG)(void 0,void 0,void 0,function(){var n,i;return(0,f.Jh)(this,function(u){return Ae.isInstance(r.request)?(n=r.request,(void 0===(i=(e.requestHandler.metadata||{}).handlerProtocol)?"":i).indexOf("h2")>=0&&!n.headers[":authority"]?(delete n.headers.host,n.headers[":authority"]=""):n.headers.host||(n.headers.host=n.hostname),[2,t(r)]):[2,t(r)]})})}}}(e),Xr)}}}(r.config)),r.middlewareStack.use({applyToStack:function(r){r.add(function(e,t){return function(r){return(0,f.mG)(void 0,void 0,void 0,function(){var n,i,o,u,c,l,v,y,_;return(0,f.Jh)(this,function(S){switch(S.label){case 0:return n=t.clientName,i=t.commandName,o=t.inputFilterSensitiveLog,u=t.logger,c=t.outputFilterSensitiveLog,[4,e(r)];case 1:return l=S.sent(),u?("function"==typeof u.info&&(y=(v=l.output).$metadata,_=(0,f._T)(v,["$metadata"]),u.info({clientName:n,commandName:i,input:o(r.input),output:c(_),metadata:y})),[2,l]):[2,l]}})})}},tn)}}),r.middlewareStack.use(function(e){return{applyToStack:function(r){r.add(function(e){return function(t){return function(r){return(0,f.mG)(void 0,void 0,void 0,function(){var n,i,o,u;return(0,f.Jh)(this,function(c){return!nn.isInstance(n=r.request)||"node"!==e.runtime||n.headers.hasOwnProperty(kt)?[2,t(r)]:(i=process.env.AWS_LAMBDA_FUNCTION_NAME,o=process.env._X_AMZN_TRACE_ID,(u=function(v){return"string"==typeof v&&v.length>0})(i)&&u(o)&&(n.headers[kt]=o),[2,t((0,f.pi)((0,f.pi)({},r),{request:n}))])})})}}}(e),cn)}}}(r.config)),r.middlewareStack.use(function(e){return{applyToStack:function(r){r.addRelativeTo(function(e){return function(t,r){return function(n){var i,o,u;return(0,f.mG)(this,void 0,void 0,function(){var c,l,v,y,_,S,x;return(0,f.Jh)(this,function(P){switch(P.label){case 0:return Ae.isInstance(n.request)?(c=null===(u=null===(o=null===(i=r.endpointV2)||void 0===i?void 0:i.properties)||void 0===o?void 0:o.authSchemes)||void 0===u?void 0:u[0],[4,e.signer(c)]):[2,t(n)];case 1:return l=P.sent(),y=t,_=[(0,f.pi)({},n)],x={},[4,l.sign(n.request,{signingDate:ar(e.systemClockOffset),signingRegion:r.signing_region,signingService:r.signing_service})];case 2:return[4,y.apply(void 0,[f.pi.apply(void 0,_.concat([(x.request=P.sent(),x)]))]).catch(function(I){var D,N=null!==(D=I.ServerTime)&&void 0!==D?D:sr(I.$response);throw N&&(e.systemClockOffset=or(N,e.systemClockOffset)),I})];case 3:return v=P.sent(),(S=sr(v.response))&&(e.systemClockOffset=or(S,e.systemClockOffset)),[2,v]}})})}}}(e),Ci)}}}(r.config)),r.middlewareStack.use(function(e){return{applyToStack:function(r){r.add(function(e){return function(t,r){return function(n){return(0,f.mG)(void 0,void 0,void 0,function(){var i,o,u,c,l,v,y,_,S;return(0,f.Jh)(this,function(x){switch(x.label){case 0:return Ae.isInstance(i=n.request)?(o=i.headers,u=(null===(_=null==r?void 0:r.userAgent)||void 0===_?void 0:_.map(Ct))||[],[4,e.defaultUserAgentProvider()]):[2,t(n)];case 1:return c=x.sent().map(Ct),l=(null===(S=null==e?void 0:e.customUserAgent)||void 0===S?void 0:S.map(Ct))||[],v=(0,f.ev)((0,f.ev)((0,f.ev)([],(0,f.CR)(c),!1),(0,f.CR)(u),!1),(0,f.CR)(l),!1).join(" "),y=(0,f.ev)((0,f.ev)([],(0,f.CR)(c.filter(function(P){return P.startsWith("aws-sdk-")})),!1),(0,f.CR)(l),!1).join(" "),"browser"!==e.runtime?(y&&(o[Tt]=o[Tt]?"".concat(o[ur]," ").concat(y):y),o[ur]=v):o[Tt]=v,[2,t((0,f.pi)((0,f.pi)({},n),{request:i}))]}})})}}}(e),Di)}}}(r.config)),r}return(0,f.ZT)(e,a),e.prototype.destroy=function(){a.prototype.destroy.call(this)},e}(Mi),Oa={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Da={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Ar(a,e,t){return{applyToStack:function(n){n.add(function(e,t){return function(r,n){return function(i){return(0,f.mG)(void 0,void 0,void 0,function(){var o,u,c;return(0,f.Jh)(this,function(l){switch(l.label){case 0:return[4,r(i)];case 1:o=l.sent().response,l.label=2;case 2:return l.trys.push([2,4,,5]),[4,t(o,e)];case 3:return u=l.sent(),[2,{response:o,output:u}];case 4:throw c=l.sent(),Object.defineProperty(c,"$response",{value:o}),c;case 5:return[2]}})})}}}(a,t),Oa),n.add(function(e,t){return function(r,n){return function(i){return(0,f.mG)(void 0,void 0,void 0,function(){var o,u,c;return(0,f.Jh)(this,function(l){switch(l.label){case 0:if(!(o=(null===(c=n.endpointV2)||void 0===c?void 0:c.url)&&e.urlParser?function(){return(0,f.mG)(void 0,void 0,void 0,function(){return(0,f.Jh)(this,function(v){return[2,e.urlParser(n.endpointV2.url)]})})}:e.endpoint))throw new Error("No valid endpoint provider available.");return[4,t(i.input,(0,f.pi)((0,f.pi)({},e),{endpoint:o}))];case 1:return u=l.sent(),[2,r((0,f.pi)((0,f.pi)({},i),{request:u}))]}})})}}}(a,e),Da)}}}var Tr,Cr,Rr,Ir,ve=function(a){function e(t){var r=a.call(this,t)||this;return Object.setPrototypeOf(r,e.prototype),r}return(0,f.ZT)(e,a),e}(Xi),Na=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"BadRequestException",$fault:"client"},t))||this;return r.name="BadRequestException",r.$fault="client",Object.setPrototypeOf(r,e.prototype),r}return(0,f.ZT)(e,a),e}(ve),Ma=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"ConflictException",$fault:"client"},t))||this;return r.name="ConflictException",r.$fault="client",Object.setPrototypeOf(r,e.prototype),r}return(0,f.ZT)(e,a),e}(ve),La=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"InternalFailureException",$fault:"server"},t))||this;return r.name="InternalFailureException",r.$fault="server",Object.setPrototypeOf(r,e.prototype),r}return(0,f.ZT)(e,a),e}(ve),za=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"LimitExceededException",$fault:"client"},t))||this;return r.name="LimitExceededException",r.$fault="client",Object.setPrototypeOf(r,e.prototype),r.retryAfterSeconds=t.retryAfterSeconds,r}return(0,f.ZT)(e,a),e}(ve),Fa=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"NotFoundException",$fault:"client"},t))||this;return r.name="NotFoundException",r.$fault="client",Object.setPrototypeOf(r,e.prototype),r}return(0,f.ZT)(e,a),e}(ve);!function(a){a.FAILED="Failed",a.FULFILLED="Fulfilled",a.READY_FOR_FULFILLMENT="ReadyForFulfillment"}(Tr||(Tr={})),function(a){a.COMPOSITE="Composite",a.CUSTOM_PAYLOAD="CustomPayload",a.PLAIN_TEXT="PlainText",a.SSML="SSML"}(Cr||(Cr={})),function(a){a.CLOSE="Close",a.CONFIRM_INTENT="ConfirmIntent",a.DELEGATE="Delegate",a.ELICIT_INTENT="ElicitIntent",a.ELICIT_SLOT="ElicitSlot"}(Rr||(Rr={})),function(a){a.CONFIRMED="Confirmed",a.DENIED="Denied",a.NONE="None"}(Ir||(Ir={}));var Pr,Ba=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"BadGatewayException",$fault:"server"},t))||this;return r.name="BadGatewayException",r.$fault="server",Object.setPrototypeOf(r,e.prototype),r.Message=t.Message,r}return(0,f.ZT)(e,a),e}(ve),ka=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"DependencyFailedException",$fault:"client"},t))||this;return r.name="DependencyFailedException",r.$fault="client",Object.setPrototypeOf(r,e.prototype),r.Message=t.Message,r}return(0,f.ZT)(e,a),e}(ve),Ua=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"LoopDetectedException",$fault:"server"},t))||this;return r.name="LoopDetectedException",r.$fault="server",Object.setPrototypeOf(r,e.prototype),r.Message=t.Message,r}return(0,f.ZT)(e,a),e}(ve),Ha=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"NotAcceptableException",$fault:"client"},t))||this;return r.name="NotAcceptableException",r.$fault="client",Object.setPrototypeOf(r,e.prototype),r}return(0,f.ZT)(e,a),e}(ve);!function(a){a.CONFIRM_INTENT="ConfirmIntent",a.ELICIT_INTENT="ElicitIntent",a.ELICIT_SLOT="ElicitSlot",a.FAILED="Failed",a.FULFILLED="Fulfilled",a.READY_FOR_FULFILLMENT="ReadyForFulfillment"}(Pr||(Pr={}));var Or,Ja=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"RequestTimeoutException",$fault:"client"},t))||this;return r.name="RequestTimeoutException",r.$fault="client",Object.setPrototypeOf(r,e.prototype),r}return(0,f.ZT)(e,a),e}(ve),Ga=function(a){function e(t){var r=a.call(this,(0,f.pi)({name:"UnsupportedMediaTypeException",$fault:"client"},t))||this;return r.name="UnsupportedMediaTypeException",r.$fault="client",Object.setPrototypeOf(r,e.prototype),r}return(0,f.ZT)(e,a),e}(ve);!function(a){a.GENERIC="application/vnd.amazonaws.card.generic"}(Or||(Or={}));var ja=function(e){return(0,f.pi)((0,f.pi)((0,f.pi)((0,f.pi)({},e),e.sessionAttributes&&{sessionAttributes:le}),e.requestAttributes&&{requestAttributes:le}),e.activeContexts&&{activeContexts:le})},Va=function(e){return(0,f.pi)((0,f.pi)((0,f.pi)((0,f.pi)((0,f.pi)({},e),e.message&&{message:le}),e.encodedMessage&&{encodedMessage:le}),e.encodedInputTranscript&&{encodedInputTranscript:le}),e.activeContexts&&{activeContexts:le})},qa=function(e){return(0,f.pi)((0,f.pi)((0,f.pi)((0,f.pi)((0,f.pi)({},e),e.sessionAttributes&&{sessionAttributes:le}),e.requestAttributes&&{requestAttributes:le}),e.inputText&&{inputText:le}),e.activeContexts&&{activeContexts:le})},$a=function(e){return(0,f.pi)((0,f.pi)((0,f.pi)((0,f.pi)((0,f.pi)((0,f.pi)({},e),e.alternativeIntents&&{alternativeIntents:e.alternativeIntents.map(function(t){return function(e){return(0,f.pi)((0,f.pi)({},e),e.slots&&{slots:le})}(t)})}),e.slots&&{slots:le}),e.sessionAttributes&&{sessionAttributes:le}),e.message&&{message:le}),e.activeContexts&&{activeContexts:le})},eo=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i,c;return(0,f.Jh)(this,function(l){switch(l.label){case 0:return n=[(0,f.pi)({},e)],c={},[4,Qe(e.body,t)];case 1:switch(r=f.pi.apply(void 0,n.concat([(c.body=l.sent(),c)])),i=et(e,r.body)){case"BadGatewayException":case"com.amazonaws.lexruntimeservice#BadGatewayException":return[3,2];case"BadRequestException":case"com.amazonaws.lexruntimeservice#BadRequestException":return[3,4];case"ConflictException":case"com.amazonaws.lexruntimeservice#ConflictException":return[3,6];case"DependencyFailedException":case"com.amazonaws.lexruntimeservice#DependencyFailedException":return[3,8];case"InternalFailureException":case"com.amazonaws.lexruntimeservice#InternalFailureException":return[3,10];case"LimitExceededException":case"com.amazonaws.lexruntimeservice#LimitExceededException":return[3,12];case"LoopDetectedException":case"com.amazonaws.lexruntimeservice#LoopDetectedException":return[3,14];case"NotAcceptableException":case"com.amazonaws.lexruntimeservice#NotAcceptableException":return[3,16];case"NotFoundException":case"com.amazonaws.lexruntimeservice#NotFoundException":return[3,18];case"RequestTimeoutException":case"com.amazonaws.lexruntimeservice#RequestTimeoutException":return[3,20];case"UnsupportedMediaTypeException":case"com.amazonaws.lexruntimeservice#UnsupportedMediaTypeException":return[3,22]}return[3,24];case 2:return[4,Mt(r,t)];case 3:throw l.sent();case 4:return[4,We(r,t)];case 5:throw l.sent();case 6:return[4,vt(r,t)];case 7:throw l.sent();case 8:return[4,Lt(r,t)];case 9:throw l.sent();case 10:return[4,$e(r,t)];case 11:throw l.sent();case 12:return[4,Ze(r,t)];case 13:throw l.sent();case 14:return[4,Mr(r,t)];case 15:throw l.sent();case 16:return[4,Lr(r,t)];case 17:throw l.sent();case 18:return[4,Ke(r,t)];case 19:throw l.sent();case 20:return[4,io(r,t)];case 21:throw l.sent();case 22:return[4,ao(r,t)];case 23:throw l.sent();case 24:yr({output:e,parsedBody:r.body,exceptionCtor:ve,errorCode:i}),l.label=25;case 25:return[2]}})})},ro=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i,c;return(0,f.Jh)(this,function(l){switch(l.label){case 0:return n=[(0,f.pi)({},e)],c={},[4,Qe(e.body,t)];case 1:switch(r=f.pi.apply(void 0,n.concat([(c.body=l.sent(),c)])),i=et(e,r.body)){case"BadGatewayException":case"com.amazonaws.lexruntimeservice#BadGatewayException":return[3,2];case"BadRequestException":case"com.amazonaws.lexruntimeservice#BadRequestException":return[3,4];case"ConflictException":case"com.amazonaws.lexruntimeservice#ConflictException":return[3,6];case"DependencyFailedException":case"com.amazonaws.lexruntimeservice#DependencyFailedException":return[3,8];case"InternalFailureException":case"com.amazonaws.lexruntimeservice#InternalFailureException":return[3,10];case"LimitExceededException":case"com.amazonaws.lexruntimeservice#LimitExceededException":return[3,12];case"LoopDetectedException":case"com.amazonaws.lexruntimeservice#LoopDetectedException":return[3,14];case"NotFoundException":case"com.amazonaws.lexruntimeservice#NotFoundException":return[3,16]}return[3,18];case 2:return[4,Mt(r,t)];case 3:throw l.sent();case 4:return[4,We(r,t)];case 5:throw l.sent();case 6:return[4,vt(r,t)];case 7:throw l.sent();case 8:return[4,Lt(r,t)];case 9:throw l.sent();case 10:return[4,$e(r,t)];case 11:throw l.sent();case 12:return[4,Ze(r,t)];case 13:throw l.sent();case 14:return[4,Mr(r,t)];case 15:throw l.sent();case 16:return[4,Ke(r,t)];case 17:throw l.sent();case 18:yr({output:e,parsedBody:r.body,exceptionCtor:ve,errorCode:i}),l.label=19;case 19:return[2]}})})},ie=_r,Mt=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({}),null!=(n=e.body).Message&&(r.Message=$(n.Message)),i=new Ba((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},We=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({}),null!=(n=e.body).message&&(r.message=$(n.message)),i=new Na((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},vt=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({}),null!=(n=e.body).message&&(r.message=$(n.message)),i=new Ma((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},Lt=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({}),null!=(n=e.body).Message&&(r.Message=$(n.Message)),i=new ka((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},$e=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({}),null!=(n=e.body).message&&(r.message=$(n.message)),i=new La((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},Ze=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({retryAfterSeconds:[,e.headers["retry-after"]]}),null!=(n=e.body).message&&(r.message=$(n.message)),i=new za((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},Mr=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({}),null!=(n=e.body).Message&&(r.Message=$(n.Message)),i=new Ua((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},Lr=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({}),null!=(n=e.body).message&&(r.message=$(n.message)),i=new Ha((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},Ke=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({}),null!=(n=e.body).message&&(r.message=$(n.message)),i=new Fa((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},io=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({}),null!=(n=e.body).message&&(r.message=$(n.message)),i=new Ja((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},ao=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i;return(0,f.Jh)(this,function(o){return r=ie({}),null!=(n=e.body).message&&(r.message=$(n.message)),i=new Ga((0,f.pi)({$metadata:fe(e)},r)),[2,he(i,e.body)]})})},so=function(e,t){return Object.entries(e).reduce(function(r,n){var i,o=(0,f.CR)(n,2),u=o[0],c=o[1];return null===c?r:(0,f.pi)((0,f.pi)({},r),((i={})[u]=c,i))},{})},zr=function(e,t){return e.filter(function(r){return null!=r}).map(function(r){return function(e,t){return(0,f.pi)((0,f.pi)((0,f.pi)({},null!=e.name&&{name:e.name}),null!=e.parameters&&{parameters:so(e.parameters)}),null!=e.timeToLive&&{timeToLive:uo(e.timeToLive,t)})}(r,t)})},uo=function(e,t){return(0,f.pi)((0,f.pi)({},null!=e.timeToLiveInSeconds&&{timeToLiveInSeconds:e.timeToLiveInSeconds}),null!=e.turnsToLive&&{turnsToLive:e.turnsToLive})},Ye=function(e,t){return Object.entries(e).reduce(function(r,n){var i,o=(0,f.CR)(n,2),u=o[0],c=o[1];return null===c?r:(0,f.pi)((0,f.pi)({},r),((i={})[u]=c,i))},{})},ho=function(e,t){return Object.entries(e).reduce(function(r,n){var i,o=(0,f.CR)(n,2),u=o[0],c=o[1];return null===c?r:(0,f.pi)((0,f.pi)({},r),((i={})[u]=$(c),i))},{})},mo=function(e,t){return{timeToLiveInSeconds:ut(e.timeToLiveInSeconds),turnsToLive:ut(e.turnsToLive)}},_o=function(e,t){return(e||[]).filter(function(n){return null!=n}).map(function(n){return null===n?null:function(e,t){return{attachmentLinkUrl:$(e.attachmentLinkUrl),buttons:null!=e.buttons?Eo(e.buttons,t):void 0,imageUrl:$(e.imageUrl),subTitle:$(e.subTitle),title:$(e.title)}}(n,t)})},Br=function(e,t){return{score:ki(e.score)}},Eo=function(e,t){return(e||[]).filter(function(n){return null!=n}).map(function(n){return null===n?null:function(e,t){return{text:$(e.text),value:$(e.value)}}(n)})},xo=function(e,t){return{intentName:$(e.intentName),nluIntentConfidence:null!=e.nluIntentConfidence?Br(e.nluIntentConfidence):void 0,slots:null!=e.slots?ke(e.slots,t):void 0}},ke=function(e,t){return Object.entries(e).reduce(function(r,n){var i,o=(0,f.CR)(n,2),u=o[0],c=o[1];return null===c?r:(0,f.pi)((0,f.pi)({},r),((i={})[u]=$(c),i))},{})},fe=function(e){var t,r;return{httpStatusCode:e.statusCode,requestId:null!==(r=null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"])&&void 0!==r?r:e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},Xe=function(e){return!(null==e||""===e||Object.getOwnPropertyNames(e).includes("length")&&0==e.length||Object.getOwnPropertyNames(e).includes("size")&&0==e.size)},ht=function(e,t){return function(e,t){return function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)}(e,t).then(function(r){return t.utf8Encoder(r)})}(e,t).then(function(r){return r.length?JSON.parse(r):{}})},Qe=function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n;return(0,f.Jh)(this,function(i){switch(i.label){case 0:return[4,ht(e,t)];case 1:return(r=i.sent()).message=null!==(n=r.message)&&void 0!==n?n:r.Message,[2,r]}})})},et=function(e,t){var n=function(u){var c=u;return"number"==typeof c&&(c=c.toString()),c.indexOf(",")>=0&&(c=c.split(",")[0]),c.indexOf(":")>=0&&(c=c.split(":")[0]),c.indexOf("#")>=0&&(c=c.split("#")[1]),c},i=("x-amzn-errortype",Object.keys(e.headers).find(function(l){return l.toLowerCase()==="x-amzn-errortype".toLowerCase()}));return void 0!==i?n(e.headers[i]):void 0!==t.code?n(t.code):void 0!==t.__type?n(t.__type):void 0},Io=function(a){function e(t){var r=a.call(this)||this;return r.input=t,r}return(0,f.ZT)(e,a),e.prototype.resolveMiddleware=function(t,r,n){this.middlewareStack.use(Ar(r,this.serialize,this.deserialize));var i=t.concat(this.middlewareStack),v=r.requestHandler;return i.resolve(function(y){return v.handle(y.request,n||{})},{logger:r.logger,clientName:"LexRuntimeServiceClient",commandName:"PostTextCommand",inputFilterSensitiveLog:qa,outputFilterSensitiveLog:$a})},e.prototype.serialize=function(t,r){return function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i,o,u,c,l,v,y;return(0,f.Jh)(this,function(_){switch(_.label){case 0:return[4,t.endpoint()];case 1:return r=_.sent(),n=r.hostname,o=void 0===(i=r.protocol)?"https":i,u=r.port,l={"content-type":"application/json"},v="".concat((null==(c=r.path)?void 0:c.endsWith("/"))?c.slice(0,-1):c||"")+"/bot/{botName}/alias/{botAlias}/user/{userId}/text",v=ze(v,e,"botName",function(){return e.botName},"{botName}",!1),v=ze(v,e,"botAlias",function(){return e.botAlias},"{botAlias}",!1),v=ze(v,e,"userId",function(){return e.userId},"{userId}",!1),y=JSON.stringify((0,f.pi)((0,f.pi)((0,f.pi)((0,f.pi)({},null!=e.activeContexts&&{activeContexts:zr(e.activeContexts,t)}),null!=e.inputText&&{inputText:e.inputText}),null!=e.requestAttributes&&{requestAttributes:Ye(e.requestAttributes)}),null!=e.sessionAttributes&&{sessionAttributes:Ye(e.sessionAttributes)})),[2,new Ae({protocol:o,hostname:n,port:u,method:"POST",headers:l,path:v,body:y})]}})})}(t,r)},e.prototype.deserialize=function(t,r){return function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i,o;return(0,f.Jh)(this,function(u){switch(u.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,ro(e,t)]:(r=ie({$metadata:fe(e)}),i=Fi,o=pr,[4,ht(e.body,t)]);case 1:return null!=(n=i.apply(void 0,[o.apply(void 0,[u.sent()]),"body"])).activeContexts&&(r.activeContexts=function(e,t){return(e||[]).filter(function(n){return null!=n}).map(function(n){return null===n?null:function(e,t){return{name:$(e.name),parameters:null!=e.parameters?ho(e.parameters):void 0,timeToLive:null!=e.timeToLive?mo(e.timeToLive,t):void 0}}(n,t)})}(n.activeContexts,t)),null!=n.alternativeIntents&&(r.alternativeIntents=function(e,t){return(e||[]).filter(function(n){return null!=n}).map(function(n){return null===n?null:xo(n,t)})}(n.alternativeIntents,t)),null!=n.botVersion&&(r.botVersion=$(n.botVersion)),null!=n.dialogState&&(r.dialogState=$(n.dialogState)),null!=n.intentName&&(r.intentName=$(n.intentName)),null!=n.message&&(r.message=$(n.message)),null!=n.messageFormat&&(r.messageFormat=$(n.messageFormat)),null!=n.nluIntentConfidence&&(r.nluIntentConfidence=Br(n.nluIntentConfidence)),null!=n.responseCard&&(r.responseCard=function(e,t){return{contentType:$(e.contentType),genericAttachments:null!=e.genericAttachments?_o(e.genericAttachments,t):void 0,version:$(e.version)}}(n.responseCard,t)),null!=n.sentimentResponse&&(r.sentimentResponse=function(e,t){return{sentimentLabel:$(e.sentimentLabel),sentimentScore:$(e.sentimentScore)}}(n.sentimentResponse)),null!=n.sessionAttributes&&(r.sessionAttributes=ke(n.sessionAttributes,t)),null!=n.sessionId&&(r.sessionId=$(n.sessionId)),null!=n.slotToElicit&&(r.slotToElicit=$(n.slotToElicit)),null!=n.slots&&(r.slots=ke(n.slots,t)),[2,r]}})})}(t,r)},e}(vr),Po=function(a){function e(t){var r=a.call(this)||this;return r.input=t,r}return(0,f.ZT)(e,a),e.prototype.resolveMiddleware=function(t,r,n){this.middlewareStack.use(Ar(r,this.serialize,this.deserialize));var i=t.concat(this.middlewareStack),v=r.requestHandler;return i.resolve(function(y){return v.handle(y.request,n||{})},{logger:r.logger,clientName:"LexRuntimeServiceClient",commandName:"PostContentCommand",inputFilterSensitiveLog:ja,outputFilterSensitiveLog:Va})},e.prototype.serialize=function(t,r){return function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r,n,i,o,u,c,l,v,y;return(0,f.Jh)(this,function(_){switch(_.label){case 0:return[4,t.endpoint()];case 1:return r=_.sent(),n=r.hostname,o=void 0===(i=r.protocol)?"https":i,u=r.port,c=r.path,l=ie({},Xe,{"x-amz-content-sha256":"UNSIGNED-PAYLOAD","content-type":e.contentType||"application/octet-stream","x-amz-lex-session-attributes":[function(){return Xe(e.sessionAttributes)},function(){return t.base64Encoder(Buffer.from(Ce.fromObject(e.sessionAttributes)))}],"x-amz-lex-request-attributes":[function(){return Xe(e.requestAttributes)},function(){return t.base64Encoder(Buffer.from(Ce.fromObject(e.requestAttributes)))}],accept:e.accept,"x-amz-lex-active-contexts":[function(){return Xe(e.activeContexts)},function(){return t.base64Encoder(Buffer.from(Ce.fromObject(e.activeContexts)))}]}),v="".concat((null==c?void 0:c.endsWith("/"))?c.slice(0,-1):c||"")+"/bot/{botName}/alias/{botAlias}/user/{userId}/content",v=ze(v,e,"botName",function(){return e.botName},"{botName}",!1),v=ze(v,e,"botAlias",function(){return e.botAlias},"{botAlias}",!1),v=ze(v,e,"userId",function(){return e.userId},"{userId}",!1),void 0!==e.inputStream&&(y=e.inputStream),[2,new Ae({protocol:o,hostname:n,port:u,method:"POST",headers:l,path:v,body:y})]}})})}(t,r)},e.prototype.deserialize=function(t,r){return function(e,t){return(0,f.mG)(void 0,void 0,void 0,function(){var r;return(0,f.Jh)(this,function(i){return 200!==e.statusCode&&e.statusCode>=300?[2,eo(e,t)]:((r=ie({$metadata:fe(e),contentType:[,e.headers["content-type"]],intentName:[,e.headers["x-amz-lex-intent-name"]],nluIntentConfidence:[function(){return void 0!==e.headers["x-amz-lex-nlu-intent-confidence"]},function(){return new Ce(Buffer.from(t.base64Decoder(e.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8"))}],alternativeIntents:[function(){return void 0!==e.headers["x-amz-lex-alternative-intents"]},function(){return new Ce(Buffer.from(t.base64Decoder(e.headers["x-amz-lex-alternative-intents"])).toString("utf8"))}],slots:[function(){return void 0!==e.headers["x-amz-lex-slots"]},function(){return new Ce(Buffer.from(t.base64Decoder(e.headers["x-amz-lex-slots"])).toString("utf8"))}],sessionAttributes:[function(){return void 0!==e.headers["x-amz-lex-session-attributes"]},function(){return new Ce(Buffer.from(t.base64Decoder(e.headers["x-amz-lex-session-attributes"])).toString("utf8"))}],sentimentResponse:[,e.headers["x-amz-lex-sentiment"]],message:[,e.headers["x-amz-lex-message"]],encodedMessage:[,e.headers["x-amz-lex-encoded-message"]],messageFormat:[,e.headers["x-amz-lex-message-format"]],dialogState:[,e.headers["x-amz-lex-dialog-state"]],slotToElicit:[,e.headers["x-amz-lex-slot-to-elicit"]],inputTranscript:[,e.headers["x-amz-lex-input-transcript"]],encodedInputTranscript:[,e.headers["x-amz-lex-encoded-input-transcript"]],botVersion:[,e.headers["x-amz-lex-bot-version"]],sessionId:[,e.headers["x-amz-lex-session-id"]],activeContexts:[function(){return void 0!==e.headers["x-amz-lex-active-contexts"]},function(){return new Ce(Buffer.from(t.base64Decoder(e.headers["x-amz-lex-active-contexts"])).toString("utf8"))}]})).audioStream=e.body,[2,r])})})}(t,r)},e}(vr),Oo=T(57857),Do=T(44497),Hr=function(e){return function(a,e,t,r){return new(t||(t=Promise))(function(i,o){function u(v){try{l(r.next(v))}catch(y){o(y)}}function c(v){try{l(r.throw(v))}catch(y){o(y)}}function l(v){v.done?i(v.value):function(i){return i instanceof t?i:new t(function(o){o(i)})}(v.value).then(u,c)}l((r=r.apply(a,e||[])).next())})}(void 0,void 0,void 0,function(){return function(a,e){var r,n,i,o,t={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(l){return function(v){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,n=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(!(i=(i=t.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){t=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){t.label=l[1];break}if(6===l[0]&&t.label<i[1]){t.label=i[1],i=l;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(l);break}i[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(a,t)}catch(v){l=[6,v],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,v])}}}(this,function(t){return e instanceof Blob||e instanceof ReadableStream?[2,new Response(e).arrayBuffer().then(function(r){return new Uint8Array(r)})]:[2,Promise.reject("Invalid content type")]})})},No=function(){var a=function(t,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])})(t,r)};return function(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}(),mt=function(){return(mt=Object.assign||function(a){for(var e,t=1,r=arguments.length;t<r;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}).apply(this,arguments)},zt=new R.k("AWSLexProvider"),zo=function(a){function e(t){void 0===t&&(t={});var r=a.call(this,t)||this;return r._botsCompleteCallback={},r}return No(e,a),e.prototype.getProviderName=function(){return"AWSLexProvider"},e.prototype.configure=function(t){void 0===t&&(t={});var r=["name","alias","region"];return Object.keys(t).forEach(function(n){var i=t[n];if(!r.every(function(o){return o in i}))throw new Error("invalid bot configuration")}),a.prototype.configure.call(this,t)},e.prototype.reportBotStatus=function(t,r){var n=this;zt.debug("postContent state",t.dialogState),("ReadyForFulfillment"===t.dialogState||"Fulfilled"===t.dialogState)&&("function"==typeof this._botsCompleteCallback[r]&&setTimeout(function(){return n._botsCompleteCallback[r](null,t)},0),this._config&&"function"==typeof this._config[r].onComplete&&setTimeout(function(){return n._config[r].onComplete(null,t)},0)),"Failed"===t.dialogState&&("function"==typeof this._botsCompleteCallback[r]&&setTimeout(function(){return n._botsCompleteCallback[r]("Bot conversation failed")},0),this._config&&"function"==typeof this._config[r].onComplete&&setTimeout(function(){return n._config[r].onComplete("Bot conversation failed")},0))},e.prototype.sendMessage=function(t,r){return function(a,e,t,r){return new(t||(t=Promise))(function(i,o){function u(v){try{l(r.next(v))}catch(y){o(y)}}function c(v){try{l(r.throw(v))}catch(y){o(y)}}function l(v){v.done?i(v.value):function(i){return i instanceof t?i:new t(function(o){o(i)})}(v.value).then(u,c)}l((r=r.apply(a,e||[])).next())})}(this,void 0,void 0,function(){var n,o,u,l,v,S,x,c,P,I,D,N;return function(a,e){var r,n,i,o,t={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(l){return function(v){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,n=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(!(i=(i=t.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){t=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){t.label=l[1];break}if(6===l[0]&&t.label<i[1]){t.label=i[1],i=l;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(l);break}i[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(a,t)}catch(v){l=[6,v],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,v])}}}(this,function(F){switch(F.label){case 0:if(!this._config[t])return[2,Promise.reject("Bot "+t+" does not exist")];F.label=1;case 1:return F.trys.push([1,3,,4]),[4,Oo.cN.get()];case 2:return n=F.sent(),[3,4];case 3:return F.sent(),[2,Promise.reject("No credentials")];case 4:if(this.lexRuntimeServiceClient=new Ra({region:this._config[t].region,credentials:n,customUserAgent:(0,Do.Zm)()}),"string"!=typeof r)return[3,9];o={botAlias:this._config[t].alias,botName:t,inputText:r,userId:n.identityId},zt.debug("postText to lex",r),F.label=5;case 5:return F.trys.push([5,7,,8]),u=new Io(o),[4,this.lexRuntimeServiceClient.send(u)];case 6:return c=F.sent(),this.reportBotStatus(c,t),[2,c];case 7:return l=F.sent(),[2,Promise.reject(l)];case 8:return[3,21];case 9:return v=r.content,"voice"!==r.options.messageType?[3,13]:"object"!=typeof v?[2,Promise.reject("invalid content type")]:v instanceof Uint8Array?(S=v,[3,12]):[3,10];case 10:return[4,Hr(v)];case 11:S=F.sent(),F.label=12;case 12:return o={botAlias:this._config[t].alias,botName:t,contentType:"audio/x-l16; sample-rate=16000; channel-count=1",userId:n.identityId,accept:"audio/mpeg",inputStream:S},[3,14];case 13:if("string"!=typeof v)return[2,Promise.reject("invalid content type")];o={botAlias:this._config[t].alias,botName:t,contentType:"text/plain; charset=utf-8",inputStream:v,userId:n.identityId,accept:"audio/mpeg"},F.label=14;case 14:zt.debug("postContent to lex",r),F.label=15;case 15:return F.trys.push([15,20,,21]),x=new Po(o),[4,this.lexRuntimeServiceClient.send(x)];case 16:return(c=F.sent()).audioStream?[4,Hr(c.audioStream)]:[3,18];case 17:return I=F.sent(),[3,19];case 18:I=void 0,F.label=19;case 19:return P=I,D=mt(mt({},c),{audioStream:P}),this.reportBotStatus(D,t),[2,D];case 20:return N=F.sent(),[2,Promise.reject(N)];case 21:return[2]}})})},e.prototype.onComplete=function(t,r){if(!this._config[t])throw new Error("Bot "+t+" does not exist");this._botsCompleteCallback[t]=r},e}(W),pt=function(){return(pt=Object.assign||function(a){for(var e,t=1,r=arguments.length;t<r;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}).apply(this,arguments)},Ft=new R.k("Interactions"),Ue=new(function(){function a(e){void 0===e&&(e={}),this._options=e,Ft.debug("Interactions Options",this._options),this._pluggables={}}return a.prototype.getModuleName=function(){return"Interactions"},a.prototype.configure=function(e){var t=this,r=e?e.Interactions||e:{};Ft.debug("configure Interactions",{opt:r}),this._options=pt(pt({bots:{}},r),r.Interactions);var n=this._options.aws_bots_config,i=this._options.bots;return!Object.keys(i).length&&n&&Array.isArray(n)&&n.forEach(function(o){t._options.bots[o.name]=o}),Object.keys(i).forEach(function(o){var u,c=i[o],l=c.providerName||"AWSLexProvider";!t._pluggables.AWSLexProvider&&"AWSLexProvider"===l&&(t._pluggables.AWSLexProvider=new zo),t._pluggables[l]?t._pluggables[l].configure(((u={})[c.name]=c,u)):Ft.debug("bot "+c.name+" was not configured as "+l+" provider was not found")}),this._options},a.prototype.addPluggable=function(e){var t=this;if(e&&"Interactions"===e.getCategory()){if(this._pluggables[e.getProviderName()])throw new Error("Pluggable "+e.getProviderName()+" already plugged");return Object.keys(this._options.bots).filter(function(r){return t._options.bots[r].providerName===e.getProviderName()}).forEach(function(r){var n,i=t._options.bots[r];e.configure(((n={})[i.name]=i,n))}),void(this._pluggables[e.getProviderName()]=e)}},a.prototype.send=function(e,t){return function(a,e,t,r){return new(t||(t=Promise))(function(i,o){function u(v){try{l(r.next(v))}catch(y){o(y)}}function c(v){try{l(r.throw(v))}catch(y){o(y)}}function l(v){v.done?i(v.value):function(i){return i instanceof t?i:new t(function(o){o(i)})}(v.value).then(u,c)}l((r=r.apply(a,e||[])).next())})}(this,void 0,void 0,function(){var r;return function(a,e){var r,n,i,o,t={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(l){return function(v){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,n=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(!(i=(i=t.trys).length>0&&i[i.length-1])&&(6===l[0]||2===l[0])){t=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){t.label=l[1];break}if(6===l[0]&&t.label<i[1]){t.label=i[1],i=l;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(l);break}i[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(a,t)}catch(v){l=[6,v],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,v])}}}(this,function(n){switch(n.label){case 0:return this._options.bots&&this._options.bots[e]?this._pluggables[r=this._options.bots[e].providerName||"AWSLexProvider"]?[4,this._pluggables[r].sendMessage(e,t)]:[2,Promise.reject("Bot "+r+" does not have valid pluggin did you try addPluggable first?")]:[2,Promise.reject("Bot "+e+" does not exist")];case 1:return[2,n.sent()]}})})},a.prototype.onComplete=function(e,t){if(!this._options.bots||!this._options.bots[e])throw new Error("Bot "+e+" does not exist");var r=this._options.bots[e].providerName||"AWSLexProvider";if(!this._pluggables[r])throw new Error("Bot "+r+" does not have valid pluggin did you try addPluggable first?");this._pluggables[r].onComplete(e,t)},a}());Q.dQ.register(Ue);var ee,pe,ge,gt=function(e,t,r){for(var n=0;n<r.length;n++)e.setUint8(t+n,r.charCodeAt(n))},Ko=function(e,t,r,n){var u=function(e,t){var r=2*e.length,i=8+r,u=new ArrayBuffer(36+i),c=new DataView(u);return gt(c,0,"RIFF"),c.setUint32(4,24+i,!0),gt(c,8,"WAVE"),gt(c,12,"fmt "),c.setUint32(16,16,!0),c.setUint16(20,1,!0),c.setUint16(22,1,!0),c.setUint32(24,t,!0),c.setUint32(28,2*t,!0),c.setUint16(32,2,!0),c.setUint16(34,16,!0),gt(c,36,"data"),c.setUint32(40,r,!0),function(e,t,r){for(var n=44,i=0;i<r.length;i++,n+=2){var o=Math.max(-1,Math.min(1,r[i]));e.setInt16(n,o<0?32768*o:32767*o,!0)}}(c,0,e),c}(function(e,t,r){if(r===t)return e;for(var n=t/r,i=Math.round(e.length/n),o=new Float32Array(i),u=0,c=0;u<o.length;){for(var l=Math.round((u+1)*n),v=0,y=0,_=c;_<l&&_<e.length;_++)v+=e[_],y++;o[u]=v/y,u++,c=l}return o}(function(e,t){for(var r=new Float32Array(t),n=0,i=0;i<e.length;i++)r.set(e[i],n),n+=e[i].length;return r}(e,t),r,n),n);return new Blob([u],{type:"application/octet-stream"})},Jr=new R.k("AudioRecorder"),Yo=function(){function a(e){(0,k.Z)(this,a),this.streamBuffer=[],this.streamBufferLength=0,this.recording=!1,this.options=e}return(0,H.Z)(a,[{key:"init",value:(e=(0,G.Z)(L().mark(function r(){var n=this;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!(0,z.lC)().isBrowser){o.next=7;break}return window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext,o.next=5,navigator.mediaDevices.getUserMedia({audio:!0}).then(function(u){n.audioSupported=!0,n.setupAudioNodes(u)}).catch(function(){return n.audioSupported=!1,Promise.reject("Audio is not supported")});case 5:o.next=9;break;case 7:return this.audioSupported=!1,o.abrupt("return",Promise.reject("Audio is not supported"));case 9:case"end":return o.stop()}},r,this)})),function(){return e.apply(this,arguments)})},{key:"setupAudioNodes",value:function(){var e=(0,G.Z)(L().mark(function r(n){var o,u,c,i=this;return L().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.prev=0,v.next=3,this.audioContext.resume();case 3:v.next=8;break;case 5:v.prev=5,v.t0=v.catch(0),Jr.error(v.t0);case 8:o=this.audioContext.createMediaStreamSource(n),(u=this.audioContext.createScriptProcessor(4096,1,1)).onaudioprocess=function(y){if(i.recording){var _=y.inputBuffer.getChannelData(0);i.streamBuffer.push(new Float32Array(_)),i.streamBufferLength+=_.length,i.analyse()}},(c=this.audioContext.createAnalyser()).minDecibels=-90,c.maxDecibels=-10,c.smoothingTimeConstant=.85,o.connect(c),c.connect(u),u.connect(o.context.destination),this.analyserNode=c;case 19:case"end":return v.stop()}},r,this,[[0,5]])}));return function(r){return e.apply(this,arguments)}}()},{key:"startRecording",value:function(){var e=(0,G.Z)(L().mark(function r(n,i){var o;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!this.recording&&this.audioSupported){c.next=2;break}return c.abrupt("return");case 2:return this.onSilence=n||function(){},this.visualizer=i||function(){},o=this.audioContext,c.prev=5,c.next=8,o.resume();case 8:c.next=13;break;case 10:c.prev=10,c.t0=c.catch(5),Jr.error(c.t0);case 13:this.start=Date.now(),this.recording=!0;case 15:case"end":return c.stop()}},r,this,[[5,10]])}));return function(r,n){return e.apply(this,arguments)}}()},{key:"stopRecording",value:function(){!this.audioSupported||(this.recording=!1)}},{key:"clear",value:function(){this.stopRecording(),this.streamBufferLength=0,this.streamBuffer=[]}},{key:"play",value:function(t){var r=this;if(t&&this.audioSupported){var n=new Blob([t]);return new Promise(function(i,o){var u=new FileReader;u.onload=function(){r.playbackSource&&r.playbackSource.disconnect(),r.playbackSource=r.audioContext.createBufferSource(),r.audioContext.decodeAudioData(u.result,function(y){r.playbackSource.buffer=y,r.playbackSource.connect(r.audioContext.destination),r.playbackSource.onended=function(){return i()},r.playbackSource.start(0)},function(y){return o(y)})},u.onerror=function(){return o()},u.readAsArrayBuffer(n)})}}},{key:"stop",value:function(){this.playbackSource&&this.playbackSource.stop()}},{key:"analyse",value:function(){if(this.audioSupported){var t=this.analyserNode;t.fftSize=2048;var r=t.fftSize,n=new Uint8Array(r),i=this.options.amplitude,o=this.options.time;t.getByteTimeDomainData(n),this.visualizer(n,r);for(var u=0;u<r;u++){var c=n[u]/128-1;(c>i||c<-1*i)&&(this.start=Date.now())}Date.now()-this.start>o&&this.onSilence()}}},{key:"exportWAV",value:function(){var e=(0,G.Z)(L().mark(function r(){var n,o,u=arguments;return L().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(n=u.length>0&&void 0!==u[0]?u[0]:16e3,this.audioSupported){l.next=3;break}return l.abrupt("return");case 3:return o=Ko(this.streamBuffer,this.streamBufferLength,this.audioContext.sampleRate,n),this.clear(),l.abrupt("return",o);case 7:case"end":return l.stop()}},r,this)}));return function(){return e.apply(this,arguments)}}()}]),a;var e}();!function(a){a[a.Initial=0]="Initial",a[a.Listening=1]="Listening",a[a.SendingText=2]="SendingText",a[a.SendingVoice=3]="SendingVoice",a[a.Error=4]="Error"}(ee||(ee={})),function(a){a.Bot="bot",a.User="user"}(pe||(pe={})),function(a){a[a.Recoverable=0]="Recoverable",a[a.Unrecoverable=1]="Unrecoverable"}(ge||(ge={}));var Gr=function(){function a(e){var t=this;(0,k.Z)(this,a),(0,A.r)(this,e),this.clearOnComplete=!1,this.conversationModeOn=!1,this.botTitle=U.T.CHATBOT_TITLE,this.voiceEnabled=!1,this.textEnabled=!0,this.silenceTime=1500,this.silenceThreshold=.2,this.messages=[],this.text="",this.chatState=ee.Initial,this.messageJSX=function(r){var n=r.map(function(o){return(0,A.h)("div",{class:"bubble ".concat(o.from)},o.content)});if(t.chatState===ee.SendingText||t.chatState===ee.SendingVoice){var i=t.chatState===ee.SendingText?pe.Bot:pe.User;n.push((0,A.h)("div",{class:"bubble ".concat(i)},(0,A.h)("div",{class:"dot-flashing ".concat(i)},(0,A.h)("span",{class:"dot left"}),(0,A.h)("span",{class:"dot middle"}),(0,A.h)("span",{class:"dot right"}))))}return n},this.chatCompleted=(0,A.c)(this,"chatCompleted",7)}return(0,H.Z)(a,[{key:"submitHandler",value:function(t){this.sendTextMessage()}},{key:"componentWillLoad",value:function(){if(!Ue||"function"!=typeof Ue.onComplete)throw new Error(V.c);this.validateProps()}},{key:"componentDidRender",value:function(){var t=this.element.shadowRoot.querySelector(".body");t.scrollTop=t.scrollHeight}},{key:"validateProps",value:function(){var t=this;if(this.voiceEnabled||this.textEnabled)if(this.botName){this.welcomeMessage&&this.appendToChat(this.welcomeMessage,pe.Bot),this.voiceEnabled&&(this.audioRecorder=new Yo({time:this.silenceTime,amplitude:this.silenceThreshold}),this.audioRecorder.init().catch(function(n){t.setError(n,ge.Recoverable)}));try{Ue.onComplete(this.botName,function(i,o){t.chatCompleted.emit({data:o,err:i}),t.clearOnComplete?t.reset():t.chatState=ee.Initial})}catch(n){this.setError(n,ge.Unrecoverable)}}else this.setError(U.T.NO_BOT_NAME_ERROR,ge.Unrecoverable);else this.setError(U.T.CHAT_DISABLED_ERROR,ge.Unrecoverable)}},{key:"handleSubmit",value:function(t){t.preventDefault(),this.sendTextMessage()}},{key:"handleMicButton",value:function(){var t=this;this.chatState===ee.Initial&&(this.audioRecorder.stop(),this.chatState=ee.Listening,this.audioRecorder.startRecording(function(){return t.handleSilence()},function(r,n){return t.visualizer(r,n)}))}},{key:"handleSilence",value:function(){var t=this;this.chatState=ee.SendingVoice,this.audioRecorder.stopRecording(),this.audioRecorder.exportWAV().then(function(r){t.sendVoiceMessage(r)})}},{key:"handleTextChange",value:function(t){this.text=t.target.value}},{key:"handleCancelButton",value:function(){this.audioRecorder.clear(),this.chatState=ee.Initial}},{key:"handleToastClose",value:function(t){this.error=void 0,t===ge.Recoverable&&(this.chatState=ee.Initial)}},{key:"visualizer",value:function(t,r){!function(e,t,r){if(r){if(!(0,z.lC)().isBrowser)throw new Error("Visualization is not supported on non-browsers.");var n=r.getBoundingClientRect(),i=n.width,o=n.height;r.width=i,r.height=o;var u=r.getContext("2d");u.fillStyle="white",u.clearRect(0,0,i,o),requestAnimationFrame(function(){u.fillRect(0,0,i,o),u.lineWidth=1;var v=getComputedStyle(document.documentElement).getPropertyValue("--amplify-primary-color");u.strokeStyle=v&&""!==v?v:"#ff9900",u.beginPath();for(var y=1*i/t,_=0,S=0;S<t||S%3==0;S++){var P=e[S]/128*o/2;0===S?u.moveTo(_,P):u.lineTo(_,P),_+=y}u.lineTo(r.width,r.height/2),u.stroke()})}}(t,r,this.element.shadowRoot.querySelector("canvas"))}},{key:"sendTextMessage",value:(e=(0,G.Z)(L().mark(function r(){var n,i;return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(0!==this.text.length&&this.chatState===ee.Initial){u.next=2;break}return u.abrupt("return");case 2:return n=this.text,this.text="",this.appendToChat(n,pe.User),this.chatState=ee.SendingText,u.prev=6,u.next=9,Ue.send(this.botName,n);case 9:i=u.sent,u.next=16;break;case 12:return u.prev=12,u.t0=u.catch(6),this.setError(u.t0,ge.Recoverable),u.abrupt("return");case 16:i.message&&this.appendToChat(i.message,pe.Bot),this.chatState=ee.Initial;case 18:case"end":return u.stop()}},r,this,[[6,12]])})),function(){return e.apply(this,arguments)})},{key:"sendVoiceMessage",value:function(){var e=(0,G.Z)(L().mark(function r(n){var o,u,c,i=this;return L().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return o={content:n,options:{messageType:"voice"}},v.prev=1,v.next=4,Ue.send(this.botName,o);case 4:u=v.sent,v.next=11;break;case 7:return v.prev=7,v.t0=v.catch(1),this.setError(v.t0,ge.Recoverable),v.abrupt("return");case 11:return this.chatState=ee.Initial,c=u.dialogState,u.inputTranscript&&this.appendToChat(u.inputTranscript,pe.User),this.appendToChat(u.message,pe.Bot),v.next=17,this.audioRecorder.play(u.audioStream).then(function(){i.conversationModeOn&&"Fulfilled"!==c&&"Failed"!==c&&i.chatState===ee.Initial&&i.handleMicButton()}).catch(function(y){return i.setError(y,ge.Recoverable)});case 17:case"end":return v.stop()}},r,this,[[1,7]])}));return function(r){return e.apply(this,arguments)}}()},{key:"appendToChat",value:function(t,r){this.messages=[].concat((0,O.Z)(this.messages),[{content:t,from:r}])}},{key:"setError",value:function(t,r){var n="string"==typeof t?t:t.message;this.chatState=ee.Error,this.error={message:n,errorType:r}}},{key:"reset",value:function(){this.chatState=ee.Initial,this.text="",this.error=void 0,this.messages=[],this.welcomeMessage&&this.appendToChat(this.welcomeMessage,pe.Bot),this.audioRecorder&&this.audioRecorder.clear()}},{key:"listeningFooterJSX",value:function(){var t=this;return[(0,A.h)("canvas",{height:"50"}),(0,A.h)("amplify-button",{"data-test":"chatbot-cancel-button",handleButtonClick:function(){return t.handleCancelButton()},class:"icon-button",variant:"icon",icon:"ban"})]}},{key:"footerJSX",value:function(){var t=this;return this.chatState===ee.Listening?this.listeningFooterJSX():[(0,A.h)("amplify-input",{placeholder:J.o.get(this.textEnabled?U.T.TEXT_INPUT_PLACEHOLDER:U.T.VOICE_INPUT_PLACEHOLDER),description:"text",handleInputChange:function(c){return t.handleTextChange(c)},value:this.text,disabled:this.chatState===ee.Error||!this.textEnabled}),this.voiceEnabled&&(0,A.h)("amplify-button",{"data-test":"chatbot-mic-button",handleButtonClick:function(){return t.handleMicButton()},class:"icon-button",variant:"icon",icon:"microphone",disabled:this.chatState===ee.Error||this.chatState!==ee.Initial}),this.textEnabled&&(0,A.h)("amplify-button",{"data-test":"chatbot-send-button",class:"icon-button",variant:"icon",icon:"send",handleButtonClick:function(){return t.sendTextMessage()},disabled:this.chatState===ee.Error||this.chatState!==ee.Initial})]}},{key:"errorToast",value:function(){var t=this;if(this.error){var r=this.error,i=r.errorType;return(0,A.h)("amplify-toast",{message:J.o.get(r.message),handleClose:function(){return t.handleToastClose(i)}})}}},{key:"render",value:function(){var t=this;return(0,A.h)(A.H,null,(0,A.h)("div",{class:"amplify-chatbot"},(0,A.h)("slot",{name:"header"},(0,A.h)("div",{class:"header","data-test":"chatbot-header"},J.o.get(this.botTitle))),(0,A.h)("div",{class:"body","data-test":"chatbot-body"},this.messageJSX(this.messages)),(0,A.h)("form",{onSubmit:function(n){return t.handleSubmit(n)}},(0,A.h)("div",{class:"footer","data-test":"chatbot-footer"},this.footerJSX())),this.errorToast()))}},{key:"element",get:function(){return(0,A.g)(this)}}]),a;var e}();Gr.style=".bot .dot{background-color:var(--bot-dot-color)}.user .dot{background-color:var(--user-dot-color)}.dot-flashing{width:2.625rem}.dot-flashing .dot{display:inline-block;width:0.625rem;height:0.625rem;border-radius:10rem;opacity:0.65}.dot-flashing .left{-webkit-animation:dot-flashing 1s infinite alternate;animation:dot-flashing 1s infinite alternate;-webkit-animation-delay:0s;animation-delay:0s}.dot-flashing .middle{margin-left:0.375rem;margin-right:0.375rem;-webkit-animation:dot-flashing 1s infinite linear alternate;animation:dot-flashing 1s infinite linear alternate;-webkit-animation-delay:0.5s;animation-delay:0.5s}.dot-flashing .right{-webkit-animation:dot-flashing 1s infinite alternate;animation:dot-flashing 1s infinite alternate;-webkit-animation-delay:1s;animation-delay:1s}@-webkit-keyframes dot-flashing{0%{opacity:0.65}50%,100%{opacity:0.1}}@keyframes dot-flashing{0%{opacity:0.65}50%,100%{opacity:0.1}}:host{--width:28.75rem;--height:37.5rem;--header-color:var(--amplify-secondary-color);--header-size:var(--amplify-text-lg);--bot-background-color:rgb(230, 230, 230);--bot-text-color:black;--bot-dot-color:var(--bot-text-color);--user-background-color:var(--amplify-blue);--user-text-color:var(--amplify-white);--user-dot-color:var(--user-text-color)}.amplify-chatbot{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;background-color:var(--background-color);border-radius:0.375rem;-webkit-box-shadow:0.0625rem 0rem 0.25rem 0 rgba(0, 0, 0, 0.15);box-shadow:0.0625rem 0rem 0.25rem 0 rgba(0, 0, 0, 0.15);-webkit-box-sizing:border-box;box-sizing:border-box;font-family:var(--amplify-font-family);margin-bottom:1rem;width:100%;height:var(--height);max-width:var(--width)}@media (min-width: 672px){.amplify-chatbot{width:var(--width)}}.header{padding:1.25rem 0.375rem 1.25rem 0.375rem;color:var(--header-color);font-size:var(--header-size);font-weight:bold;text-align:center;word-wrap:break-word}.body{border-top:0.0625rem solid rgba(0, 0, 0, 0.05);padding:1.5rem 1rem 0 1rem;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-direction:column;flex-direction:column;overflow:auto}.bubble{max-width:100%;padding:0.8em 1.4em;text-align:left;word-wrap:break-word;margin-bottom:0.625rem}.bot{margin-right:auto;background-color:var(--bot-background-color);color:var(--bot-text-color);border-radius:1.5rem 1.5rem 1.5rem 0}.user{margin-left:auto;background-color:var(--user-background-color);color:var(--user-text-color);border-radius:1.5rem 1.5rem 0 1.5rem}.footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top:0.062rem solid rgba(0, 0, 0, 0.05);padding-right:0.625rem;min-height:3.125rem}.footer amplify-input{--border:none;--margin:0;-ms-flex-positive:1;flex-grow:1}canvas{margin-left:0.625rem;margin-right:0.625rem;-ms-flex-positive:1;flex-grow:1;height:3.125rem}.icon-button{--icon-height:1.25rem;--icon-fill:var(--amplify-primary-color);--padding:0.625rem;--width:auto}"},73900:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0})},10054:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0})},15408:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0})},58206:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0})},68646:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0}),E.isMsWindow=void 0;var T=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];E.isMsWindow=function(k){if(function(k){return"MSInputMethodContext"in k&&"msCrypto"in k}(k)&&void 0!==k.msCrypto.subtle){var H=k.msCrypto,j=H.getRandomValues,L=H.subtle;return T.map(function(A){return L[A]}).concat(j).every(function(A){return"function"==typeof A})}return!1}},11402:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0});var O=T(51771);O.__exportStar(T(73900),E),O.__exportStar(T(10054),E),O.__exportStar(T(15408),E),O.__exportStar(T(58206),E),O.__exportStar(T(68646),E)},30160:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0}),E.EMPTY_DATA_SHA_256=E.SHA_256_HMAC_ALGO=E.SHA_256_HASH=void 0,E.SHA_256_HASH={name:"SHA-256"},E.SHA_256_HMAC_ALGO={name:"HMAC",hash:E.SHA_256_HASH},E.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},89168:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),E.Sha256=void 0;var O=T(94158),G=T(39551),k=T(17117),H=T(14980),j=T(11402),L=T(84302),A=function(){function R(z){this.hash=(0,H.supportsWebCrypto)((0,L.locateWindow)())?new G.Sha256(z):(0,j.isMsWindow)((0,L.locateWindow)())?new O.Sha256(z):new k.Sha256(z)}return R.prototype.update=function(z,J){this.hash.update(z,J)},R.prototype.digest=function(){return this.hash.digest()},R}();E.Sha256=A},94158:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),E.Sha256=void 0;var O=T(13575),G=T(30160),k=T(36308),H=T(84302),j=function(){function R(z){z?(this.operation=function(R){return new Promise(function(z,J){var U=(0,H.locateWindow)().msCrypto.subtle.importKey("raw",A(R),G.SHA_256_HMAC_ALGO,!1,["sign"]);U.oncomplete=function(){U.result&&z(U.result),J(new Error("ImportKey completed without importing key."))},U.onerror=function(){J(new Error("ImportKey failed to import key."))}})}(z).then(function(J){return(0,H.locateWindow)().msCrypto.subtle.sign(G.SHA_256_HMAC_ALGO,J)}),this.operation.catch(function(){})):this.operation=Promise.resolve((0,H.locateWindow)().msCrypto.subtle.digest("SHA-256"))}return R.prototype.update=function(z){var J=this;(0,O.isEmptyData)(z)||(this.operation=this.operation.then(function(U){return U.onerror=function(){J.operation=Promise.reject(new Error("Error encountered updating hash"))},U.process(A(z)),U}),this.operation.catch(function(){}))},R.prototype.digest=function(){return this.operation.then(function(z){return new Promise(function(J,U){z.onerror=function(){U(new Error("Error encountered finalizing hash"))},z.oncomplete=function(){z.result&&J(new Uint8Array(z.result)),U(new Error("Error encountered finalizing hash"))},z.finish()})})},R}();function A(R){return"string"==typeof R?(0,k.fromUtf8)(R):ArrayBuffer.isView(R)?new Uint8Array(R.buffer,R.byteOffset,R.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(R)}E.Sha256=j},11457:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),E.WebCryptoSha256=E.Ie11Sha256=void 0,(0,T(68803).__exportStar)(T(89168),E);var G=T(94158);Object.defineProperty(E,"Ie11Sha256",{enumerable:!0,get:function(){return G.Sha256}});var k=T(39551);Object.defineProperty(E,"WebCryptoSha256",{enumerable:!0,get:function(){return k.Sha256}})},13575:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0}),E.isEmptyData=void 0,E.isEmptyData=function(O){return"string"==typeof O?0===O.length:0===O.byteLength}},39551:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),E.Sha256=void 0;var O=T(74531),G=T(30160),k=T(84302),H=function(){function j(L){this.toHash=new Uint8Array(0),void 0!==L&&(this.key=new Promise(function(A,R){(0,k.locateWindow)().crypto.subtle.importKey("raw",(0,O.convertToBuffer)(L),G.SHA_256_HMAC_ALGO,!1,["sign"]).then(A,R)}),this.key.catch(function(){}))}return j.prototype.update=function(L){if(!(0,O.isEmptyData)(L)){var A=(0,O.convertToBuffer)(L),R=new Uint8Array(this.toHash.byteLength+A.byteLength);R.set(this.toHash,0),R.set(A,this.toHash.byteLength),this.toHash=R}},j.prototype.digest=function(){var L=this;return this.key?this.key.then(function(A){return(0,k.locateWindow)().crypto.subtle.sign(G.SHA_256_HMAC_ALGO,A,L.toHash).then(function(R){return new Uint8Array(R)})}):(0,O.isEmptyData)(this.toHash)?Promise.resolve(G.EMPTY_DATA_SHA_256):Promise.resolve().then(function(){return(0,k.locateWindow)().crypto.subtle.digest(G.SHA_256_HASH,L.toHash)}).then(function(A){return Promise.resolve(new Uint8Array(A))})},j}();E.Sha256=H},7106:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),E.RawSha256=void 0;var O=T(37550),G=function(){function k(){this.state=Int32Array.from(O.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return k.prototype.update=function(H){if(this.finished)throw new Error("Attempted to update an already finished hash.");var j=0,L=H.byteLength;if(this.bytesHashed+=L,8*this.bytesHashed>O.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;L>0;)this.buffer[this.bufferLength++]=H[j++],L--,this.bufferLength===O.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},k.prototype.digest=function(){if(!this.finished){var H=8*this.bytesHashed,j=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),L=this.bufferLength;if(j.setUint8(this.bufferLength++,128),L%O.BLOCK_SIZE>=O.BLOCK_SIZE-8){for(var A=this.bufferLength;A<O.BLOCK_SIZE;A++)j.setUint8(A,0);this.hashBuffer(),this.bufferLength=0}for(A=this.bufferLength;A<O.BLOCK_SIZE-8;A++)j.setUint8(A,0);j.setUint32(O.BLOCK_SIZE-8,Math.floor(H/4294967296),!0),j.setUint32(O.BLOCK_SIZE-4,H),this.hashBuffer(),this.finished=!0}var R=new Uint8Array(O.DIGEST_LENGTH);for(A=0;A<8;A++)R[4*A]=this.state[A]>>>24&255,R[4*A+1]=this.state[A]>>>16&255,R[4*A+2]=this.state[A]>>>8&255,R[4*A+3]=this.state[A]>>>0&255;return R},k.prototype.hashBuffer=function(){for(var j=this.buffer,L=this.state,A=L[0],R=L[1],z=L[2],J=L[3],U=L[4],V=L[5],Q=L[6],ne=L[7],X=0;X<O.BLOCK_SIZE;X++){if(X<16)this.temp[X]=(255&j[4*X])<<24|(255&j[4*X+1])<<16|(255&j[4*X+2])<<8|255&j[4*X+3];else{var W=this.temp[X-2];this.temp[X]=(((W>>>17|W<<15)^(W>>>19|W<<13)^W>>>10)+this.temp[X-7]|0)+((((W=this.temp[X-15])>>>7|W<<25)^(W>>>18|W<<14)^W>>>3)+this.temp[X-16]|0)}var de=(((U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7))+(U&V^~U&Q)|0)+(ne+(O.KEY[X]+this.temp[X]|0)|0)|0,me=((A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10))+(A&R^A&z^R&z)|0;ne=Q,Q=V,V=U,U=J+de|0,J=z,z=R,R=A,A=de+me|0}L[0]+=A,L[1]+=R,L[2]+=z,L[3]+=J,L[4]+=U,L[5]+=V,L[6]+=Q,L[7]+=ne},k}();E.RawSha256=G},37550:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0}),E.MAX_HASHABLE_LENGTH=E.INIT=E.KEY=E.DIGEST_LENGTH=E.BLOCK_SIZE=void 0,E.BLOCK_SIZE=64,E.DIGEST_LENGTH=32,E.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),E.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],E.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},17117:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),(0,T(50434).__exportStar)(T(54981),E)},54981:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),E.Sha256=void 0;var O=T(50434),G=T(37550),k=T(7106),H=T(74531),j=function(){function A(R){if(this.hash=new k.RawSha256,R){this.outer=new k.RawSha256;var z=function(A){var R=(0,H.convertToBuffer)(A);if(R.byteLength>G.BLOCK_SIZE){var z=new k.RawSha256;z.update(R),R=z.digest()}var J=new Uint8Array(G.BLOCK_SIZE);return J.set(R),J}(R),J=new Uint8Array(G.BLOCK_SIZE);J.set(z);for(var U=0;U<G.BLOCK_SIZE;U++)z[U]^=54,J[U]^=92;for(this.hash.update(z),this.outer.update(J),U=0;U<z.byteLength;U++)z[U]=0}}return A.prototype.update=function(R){if(!(0,H.isEmptyData)(R)&&!this.error)try{this.hash.update((0,H.convertToBuffer)(R))}catch(z){this.error=z}},A.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},A.prototype.digest=function(){return(0,O.__awaiter)(this,void 0,void 0,function(){return(0,O.__generator)(this,function(R){return[2,this.digestSync()]})})},A}();E.Sha256=j},14980:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),T(53352).__exportStar(T(36461),E)},36461:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),E.supportsZeroByteGCM=E.supportsSubtleCrypto=E.supportsSecureRandom=E.supportsWebCrypto=void 0;var O=T(53352),G=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function H(A){return"object"==typeof A&&"object"==typeof A.crypto&&"function"==typeof A.crypto.getRandomValues}function j(A){return A&&G.every(function(R){return"function"==typeof A[R]})}E.supportsWebCrypto=function(A){return!(!H(A)||"object"!=typeof A.crypto.subtle)&&j(A.crypto.subtle)},E.supportsSecureRandom=H,E.supportsSubtleCrypto=j,E.supportsZeroByteGCM=function(A){return O.__awaiter(this,void 0,void 0,function(){var R;return O.__generator(this,function(U){switch(U.label){case 0:if(!j(A))return[2,!1];U.label=1;case 1:return U.trys.push([1,4,,5]),[4,A.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return R=U.sent(),[4,A.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},R,new Uint8Array(0))];case 3:return[2,16===U.sent().byteLength];case 4:return U.sent(),[2,!1];case 5:return[2]}})})}},11847:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),E.convertToBuffer=void 0;var O=T(36308),G="undefined"!=typeof Buffer&&Buffer.from?function(H){return Buffer.from(H,"utf8")}:O.fromUtf8;E.convertToBuffer=function(H){return H instanceof Uint8Array?H:"string"==typeof H?G(H):ArrayBuffer.isView(H)?new Uint8Array(H.buffer,H.byteOffset,H.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(H)}},74531:function(Y,E,T){Object.defineProperty(E,"__esModule",{value:!0}),E.uint32ArrayFrom=E.numToUint8=E.isEmptyData=E.convertToBuffer=void 0;var O=T(11847);Object.defineProperty(E,"convertToBuffer",{enumerable:!0,get:function(){return O.convertToBuffer}});var G=T(22019);Object.defineProperty(E,"isEmptyData",{enumerable:!0,get:function(){return G.isEmptyData}});var k=T(31263);Object.defineProperty(E,"numToUint8",{enumerable:!0,get:function(){return k.numToUint8}});var H=T(53619);Object.defineProperty(E,"uint32ArrayFrom",{enumerable:!0,get:function(){return H.uint32ArrayFrom}})},22019:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0}),E.isEmptyData=void 0,E.isEmptyData=function(O){return"string"==typeof O?0===O.length:0===O.byteLength}},31263:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0}),E.numToUint8=void 0,E.numToUint8=function(O){return new Uint8Array([(4278190080&O)>>24,(16711680&O)>>16,(65280&O)>>8,255&O])}},53619:function(Y,E){Object.defineProperty(E,"__esModule",{value:!0}),E.uint32ArrayFrom=void 0,E.uint32ArrayFrom=function(O){if(!Uint32Array.from){for(var G=new Uint32Array(O.length),k=0;k<O.length;)G[k]=O[k],k+=1;return G}return Uint32Array.from(O)}},36308:function(Y,E,T){T.r(E),T.d(E,{fromUtf8:function(){return j},toUtf8:function(){return L}});var j=function(R){return"function"==typeof TextEncoder?(A=R,(new TextEncoder).encode(A)):function(R){for(var z=[],J=0,U=R.length;J<U;J++){var V=R.charCodeAt(J);if(V<128)z.push(V);else if(V<2048)z.push(V>>6|192,63&V|128);else if(J+1<R.length&&55296==(64512&V)&&56320==(64512&R.charCodeAt(J+1))){var Q=65536+((1023&V)<<10)+(1023&R.charCodeAt(++J));z.push(Q>>18|240,Q>>12&63|128,Q>>6&63|128,63&Q|128)}else z.push(V>>12|224,V>>6&63|128,63&V|128)}return Uint8Array.from(z)}(R);var A},L=function(R){return"function"==typeof TextDecoder?(A=R,new TextDecoder("utf-8").decode(A)):function(R){for(var z="",J=0,U=R.length;J<U;J++){var V=R[J];if(V<128)z+=String.fromCharCode(V);else if(192<=V&&V<224){var Q=R[++J];z+=String.fromCharCode((31&V)<<6|63&Q)}else if(240<=V&&V<365){var X="%"+[V,R[++J],R[++J],R[++J]].map(function(W){return W.toString(16)}).join("%");z+=decodeURIComponent(X)}else z+=String.fromCharCode((15&V)<<12|(63&R[++J])<<6|63&R[++J])}return z}(R);var A}},51771:function(Y,E,T){T.r(E),T.d(E,{__extends:function(){return G},__assign:function(){return k},__rest:function(){return H},__decorate:function(){return j},__param:function(){return L},__metadata:function(){return A},__awaiter:function(){return R},__generator:function(){return z},__createBinding:function(){return J},__exportStar:function(){return U},__values:function(){return V},__read:function(){return Q},__spread:function(){return ne},__spreadArrays:function(){return X},__await:function(){return W},__asyncGenerator:function(){return f},__asyncDelegator:function(){return ce},__asyncValues:function(){return de},__makeTemplateObject:function(){return me},__importStar:function(){return _e},__importDefault:function(){return we},__classPrivateFieldGet:function(){return xe},__classPrivateFieldSet:function(){return be}});var O=function(s,h){return(O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var g in p)p.hasOwnProperty(g)&&(d[g]=p[g])})(s,h)};function G(s,h){function d(){this.constructor=s}O(s,h),s.prototype=null===h?Object.create(h):(d.prototype=h.prototype,new d)}var k=function(){return(k=Object.assign||function(h){for(var d,p=1,g=arguments.length;p<g;p++)for(var m in d=arguments[p])Object.prototype.hasOwnProperty.call(d,m)&&(h[m]=d[m]);return h}).apply(this,arguments)};function H(s,h){var d={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&h.indexOf(p)<0&&(d[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var g=0;for(p=Object.getOwnPropertySymbols(s);g<p.length;g++)h.indexOf(p[g])<0&&Object.prototype.propertyIsEnumerable.call(s,p[g])&&(d[p[g]]=s[p[g]])}return d}function j(s,h,d,p){var w,g=arguments.length,m=g<3?h:null===p?p=Object.getOwnPropertyDescriptor(h,d):p;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)m=Reflect.decorate(s,h,d,p);else for(var C=s.length-1;C>=0;C--)(w=s[C])&&(m=(g<3?w(m):g>3?w(h,d,m):w(h,d))||m);return g>3&&m&&Object.defineProperty(h,d,m),m}function L(s,h){return function(d,p){h(d,p,s)}}function A(s,h){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(s,h)}function R(s,h,d,p){return new(d||(d=Promise))(function(m,w){function C(B){try{b(p.next(B))}catch(Z){w(Z)}}function q(B){try{b(p.throw(B))}catch(Z){w(Z)}}function b(B){B.done?m(B.value):function(m){return m instanceof d?m:new d(function(w){w(m)})}(B.value).then(C,q)}b((p=p.apply(s,h||[])).next())})}function z(s,h){var p,g,m,w,d={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return w={next:C(0),throw:C(1),return:C(2)},"function"==typeof Symbol&&(w[Symbol.iterator]=function(){return this}),w;function C(b){return function(B){return function(b){if(p)throw new TypeError("Generator is already executing.");for(;d;)try{if(p=1,g&&(m=2&b[0]?g.return:b[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,b[1])).done)return m;switch(g=0,m&&(b=[2&b[0],m.value]),b[0]){case 0:case 1:m=b;break;case 4:return d.label++,{value:b[1],done:!1};case 5:d.label++,g=b[1],b=[0];continue;case 7:b=d.ops.pop(),d.trys.pop();continue;default:if(!(m=(m=d.trys).length>0&&m[m.length-1])&&(6===b[0]||2===b[0])){d=0;continue}if(3===b[0]&&(!m||b[1]>m[0]&&b[1]<m[3])){d.label=b[1];break}if(6===b[0]&&d.label<m[1]){d.label=m[1],m=b;break}if(m&&d.label<m[2]){d.label=m[2],d.ops.push(b);break}m[2]&&d.ops.pop(),d.trys.pop();continue}b=h.call(s,d)}catch(B){b=[6,B],g=0}finally{p=m=0}if(5&b[0])throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}([b,B])}}}function J(s,h,d,p){void 0===p&&(p=d),s[p]=h[d]}function U(s,h){for(var d in s)"default"!==d&&!h.hasOwnProperty(d)&&(h[d]=s[d])}function V(s){var h="function"==typeof Symbol&&Symbol.iterator,d=h&&s[h],p=0;if(d)return d.call(s);if(s&&"number"==typeof s.length)return{next:function(){return s&&p>=s.length&&(s=void 0),{value:s&&s[p++],done:!s}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")}function Q(s,h){var d="function"==typeof Symbol&&s[Symbol.iterator];if(!d)return s;var g,w,p=d.call(s),m=[];try{for(;(void 0===h||h-- >0)&&!(g=p.next()).done;)m.push(g.value)}catch(C){w={error:C}}finally{try{g&&!g.done&&(d=p.return)&&d.call(p)}finally{if(w)throw w.error}}return m}function ne(){for(var s=[],h=0;h<arguments.length;h++)s=s.concat(Q(arguments[h]));return s}function X(){for(var s=0,h=0,d=arguments.length;h<d;h++)s+=arguments[h].length;var p=Array(s),g=0;for(h=0;h<d;h++)for(var m=arguments[h],w=0,C=m.length;w<C;w++,g++)p[g]=m[w];return p}function W(s){return this instanceof W?(this.v=s,this):new W(s)}function f(s,h,d){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g,p=d.apply(s,h||[]),m=[];return g={},w("next"),w("throw"),w("return"),g[Symbol.asyncIterator]=function(){return this},g;function w(M){p[M]&&(g[M]=function(K){return new Promise(function(ae,Se){m.push([M,K,ae,Se])>1||C(M,K)})})}function C(M,K){try{!function(M){M.value instanceof W?Promise.resolve(M.value.v).then(b,B):Z(m[0][2],M)}(p[M](K))}catch(ae){Z(m[0][3],ae)}}function b(M){C("next",M)}function B(M){C("throw",M)}function Z(M,K){M(K),m.shift(),m.length&&C(m[0][0],m[0][1])}}function ce(s){var h,d;return h={},p("next"),p("throw",function(g){throw g}),p("return"),h[Symbol.iterator]=function(){return this},h;function p(g,m){h[g]=s[g]?function(w){return(d=!d)?{value:W(s[g](w)),done:"return"===g}:m?m(w):w}:m}}function de(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var d,h=s[Symbol.asyncIterator];return h?h.call(s):(s=V(s),d={},p("next"),p("throw"),p("return"),d[Symbol.asyncIterator]=function(){return this},d);function p(m){d[m]=s[m]&&function(w){return new Promise(function(C,q){!function(m,w,C,q){Promise.resolve(q).then(function(b){m({value:b,done:C})},w)}(C,q,(w=s[m](w)).done,w.value)})}}}function me(s,h){return Object.defineProperty?Object.defineProperty(s,"raw",{value:h}):s.raw=h,s}function _e(s){if(s&&s.__esModule)return s;var h={};if(null!=s)for(var d in s)Object.hasOwnProperty.call(s,d)&&(h[d]=s[d]);return h.default=s,h}function we(s){return s&&s.__esModule?s:{default:s}}function xe(s,h){if(!h.has(s))throw new TypeError("attempted to get private field on non-instance");return h.get(s)}function be(s,h,d){if(!h.has(s))throw new TypeError("attempted to set private field on non-instance");return h.set(s,d),d}},68803:function(Y,E,T){T.r(E),T.d(E,{__extends:function(){return G},__assign:function(){return k},__rest:function(){return H},__decorate:function(){return j},__param:function(){return L},__metadata:function(){return A},__awaiter:function(){return R},__generator:function(){return z},__createBinding:function(){return J},__exportStar:function(){return U},__values:function(){return V},__read:function(){return Q},__spread:function(){return ne},__spreadArrays:function(){return X},__await:function(){return W},__asyncGenerator:function(){return f},__asyncDelegator:function(){return ce},__asyncValues:function(){return de},__makeTemplateObject:function(){return me},__importStar:function(){return _e},__importDefault:function(){return we},__classPrivateFieldGet:function(){return xe},__classPrivateFieldSet:function(){return be}});var O=function(s,h){return(O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var g in p)p.hasOwnProperty(g)&&(d[g]=p[g])})(s,h)};function G(s,h){function d(){this.constructor=s}O(s,h),s.prototype=null===h?Object.create(h):(d.prototype=h.prototype,new d)}var k=function(){return(k=Object.assign||function(h){for(var d,p=1,g=arguments.length;p<g;p++)for(var m in d=arguments[p])Object.prototype.hasOwnProperty.call(d,m)&&(h[m]=d[m]);return h}).apply(this,arguments)};function H(s,h){var d={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&h.indexOf(p)<0&&(d[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var g=0;for(p=Object.getOwnPropertySymbols(s);g<p.length;g++)h.indexOf(p[g])<0&&Object.prototype.propertyIsEnumerable.call(s,p[g])&&(d[p[g]]=s[p[g]])}return d}function j(s,h,d,p){var w,g=arguments.length,m=g<3?h:null===p?p=Object.getOwnPropertyDescriptor(h,d):p;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)m=Reflect.decorate(s,h,d,p);else for(var C=s.length-1;C>=0;C--)(w=s[C])&&(m=(g<3?w(m):g>3?w(h,d,m):w(h,d))||m);return g>3&&m&&Object.defineProperty(h,d,m),m}function L(s,h){return function(d,p){h(d,p,s)}}function A(s,h){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(s,h)}function R(s,h,d,p){return new(d||(d=Promise))(function(m,w){function C(B){try{b(p.next(B))}catch(Z){w(Z)}}function q(B){try{b(p.throw(B))}catch(Z){w(Z)}}function b(B){B.done?m(B.value):function(m){return m instanceof d?m:new d(function(w){w(m)})}(B.value).then(C,q)}b((p=p.apply(s,h||[])).next())})}function z(s,h){var p,g,m,w,d={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return w={next:C(0),throw:C(1),return:C(2)},"function"==typeof Symbol&&(w[Symbol.iterator]=function(){return this}),w;function C(b){return function(B){return function(b){if(p)throw new TypeError("Generator is already executing.");for(;d;)try{if(p=1,g&&(m=2&b[0]?g.return:b[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,b[1])).done)return m;switch(g=0,m&&(b=[2&b[0],m.value]),b[0]){case 0:case 1:m=b;break;case 4:return d.label++,{value:b[1],done:!1};case 5:d.label++,g=b[1],b=[0];continue;case 7:b=d.ops.pop(),d.trys.pop();continue;default:if(!(m=(m=d.trys).length>0&&m[m.length-1])&&(6===b[0]||2===b[0])){d=0;continue}if(3===b[0]&&(!m||b[1]>m[0]&&b[1]<m[3])){d.label=b[1];break}if(6===b[0]&&d.label<m[1]){d.label=m[1],m=b;break}if(m&&d.label<m[2]){d.label=m[2],d.ops.push(b);break}m[2]&&d.ops.pop(),d.trys.pop();continue}b=h.call(s,d)}catch(B){b=[6,B],g=0}finally{p=m=0}if(5&b[0])throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}([b,B])}}}function J(s,h,d,p){void 0===p&&(p=d),s[p]=h[d]}function U(s,h){for(var d in s)"default"!==d&&!h.hasOwnProperty(d)&&(h[d]=s[d])}function V(s){var h="function"==typeof Symbol&&Symbol.iterator,d=h&&s[h],p=0;if(d)return d.call(s);if(s&&"number"==typeof s.length)return{next:function(){return s&&p>=s.length&&(s=void 0),{value:s&&s[p++],done:!s}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")}function Q(s,h){var d="function"==typeof Symbol&&s[Symbol.iterator];if(!d)return s;var g,w,p=d.call(s),m=[];try{for(;(void 0===h||h-- >0)&&!(g=p.next()).done;)m.push(g.value)}catch(C){w={error:C}}finally{try{g&&!g.done&&(d=p.return)&&d.call(p)}finally{if(w)throw w.error}}return m}function ne(){for(var s=[],h=0;h<arguments.length;h++)s=s.concat(Q(arguments[h]));return s}function X(){for(var s=0,h=0,d=arguments.length;h<d;h++)s+=arguments[h].length;var p=Array(s),g=0;for(h=0;h<d;h++)for(var m=arguments[h],w=0,C=m.length;w<C;w++,g++)p[g]=m[w];return p}function W(s){return this instanceof W?(this.v=s,this):new W(s)}function f(s,h,d){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g,p=d.apply(s,h||[]),m=[];return g={},w("next"),w("throw"),w("return"),g[Symbol.asyncIterator]=function(){return this},g;function w(M){p[M]&&(g[M]=function(K){return new Promise(function(ae,Se){m.push([M,K,ae,Se])>1||C(M,K)})})}function C(M,K){try{!function(M){M.value instanceof W?Promise.resolve(M.value.v).then(b,B):Z(m[0][2],M)}(p[M](K))}catch(ae){Z(m[0][3],ae)}}function b(M){C("next",M)}function B(M){C("throw",M)}function Z(M,K){M(K),m.shift(),m.length&&C(m[0][0],m[0][1])}}function ce(s){var h,d;return h={},p("next"),p("throw",function(g){throw g}),p("return"),h[Symbol.iterator]=function(){return this},h;function p(g,m){h[g]=s[g]?function(w){return(d=!d)?{value:W(s[g](w)),done:"return"===g}:m?m(w):w}:m}}function de(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var d,h=s[Symbol.asyncIterator];return h?h.call(s):(s=V(s),d={},p("next"),p("throw"),p("return"),d[Symbol.asyncIterator]=function(){return this},d);function p(m){d[m]=s[m]&&function(w){return new Promise(function(C,q){!function(m,w,C,q){Promise.resolve(q).then(function(b){m({value:b,done:C})},w)}(C,q,(w=s[m](w)).done,w.value)})}}}function me(s,h){return Object.defineProperty?Object.defineProperty(s,"raw",{value:h}):s.raw=h,s}function _e(s){if(s&&s.__esModule)return s;var h={};if(null!=s)for(var d in s)Object.hasOwnProperty.call(s,d)&&(h[d]=s[d]);return h.default=s,h}function we(s){return s&&s.__esModule?s:{default:s}}function xe(s,h){if(!h.has(s))throw new TypeError("attempted to get private field on non-instance");return h.get(s)}function be(s,h,d){if(!h.has(s))throw new TypeError("attempted to set private field on non-instance");return h.set(s,d),d}},50434:function(Y,E,T){T.r(E),T.d(E,{__extends:function(){return G},__assign:function(){return k},__rest:function(){return H},__decorate:function(){return j},__param:function(){return L},__metadata:function(){return A},__awaiter:function(){return R},__generator:function(){return z},__createBinding:function(){return J},__exportStar:function(){return U},__values:function(){return V},__read:function(){return Q},__spread:function(){return ne},__spreadArrays:function(){return X},__await:function(){return W},__asyncGenerator:function(){return f},__asyncDelegator:function(){return ce},__asyncValues:function(){return de},__makeTemplateObject:function(){return me},__importStar:function(){return _e},__importDefault:function(){return we},__classPrivateFieldGet:function(){return xe},__classPrivateFieldSet:function(){return be}});var O=function(s,h){return(O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var g in p)p.hasOwnProperty(g)&&(d[g]=p[g])})(s,h)};function G(s,h){function d(){this.constructor=s}O(s,h),s.prototype=null===h?Object.create(h):(d.prototype=h.prototype,new d)}var k=function(){return(k=Object.assign||function(h){for(var d,p=1,g=arguments.length;p<g;p++)for(var m in d=arguments[p])Object.prototype.hasOwnProperty.call(d,m)&&(h[m]=d[m]);return h}).apply(this,arguments)};function H(s,h){var d={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&h.indexOf(p)<0&&(d[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var g=0;for(p=Object.getOwnPropertySymbols(s);g<p.length;g++)h.indexOf(p[g])<0&&Object.prototype.propertyIsEnumerable.call(s,p[g])&&(d[p[g]]=s[p[g]])}return d}function j(s,h,d,p){var w,g=arguments.length,m=g<3?h:null===p?p=Object.getOwnPropertyDescriptor(h,d):p;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)m=Reflect.decorate(s,h,d,p);else for(var C=s.length-1;C>=0;C--)(w=s[C])&&(m=(g<3?w(m):g>3?w(h,d,m):w(h,d))||m);return g>3&&m&&Object.defineProperty(h,d,m),m}function L(s,h){return function(d,p){h(d,p,s)}}function A(s,h){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(s,h)}function R(s,h,d,p){return new(d||(d=Promise))(function(m,w){function C(B){try{b(p.next(B))}catch(Z){w(Z)}}function q(B){try{b(p.throw(B))}catch(Z){w(Z)}}function b(B){B.done?m(B.value):function(m){return m instanceof d?m:new d(function(w){w(m)})}(B.value).then(C,q)}b((p=p.apply(s,h||[])).next())})}function z(s,h){var p,g,m,w,d={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return w={next:C(0),throw:C(1),return:C(2)},"function"==typeof Symbol&&(w[Symbol.iterator]=function(){return this}),w;function C(b){return function(B){return function(b){if(p)throw new TypeError("Generator is already executing.");for(;d;)try{if(p=1,g&&(m=2&b[0]?g.return:b[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,b[1])).done)return m;switch(g=0,m&&(b=[2&b[0],m.value]),b[0]){case 0:case 1:m=b;break;case 4:return d.label++,{value:b[1],done:!1};case 5:d.label++,g=b[1],b=[0];continue;case 7:b=d.ops.pop(),d.trys.pop();continue;default:if(!(m=(m=d.trys).length>0&&m[m.length-1])&&(6===b[0]||2===b[0])){d=0;continue}if(3===b[0]&&(!m||b[1]>m[0]&&b[1]<m[3])){d.label=b[1];break}if(6===b[0]&&d.label<m[1]){d.label=m[1],m=b;break}if(m&&d.label<m[2]){d.label=m[2],d.ops.push(b);break}m[2]&&d.ops.pop(),d.trys.pop();continue}b=h.call(s,d)}catch(B){b=[6,B],g=0}finally{p=m=0}if(5&b[0])throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}([b,B])}}}function J(s,h,d,p){void 0===p&&(p=d),s[p]=h[d]}function U(s,h){for(var d in s)"default"!==d&&!h.hasOwnProperty(d)&&(h[d]=s[d])}function V(s){var h="function"==typeof Symbol&&Symbol.iterator,d=h&&s[h],p=0;if(d)return d.call(s);if(s&&"number"==typeof s.length)return{next:function(){return s&&p>=s.length&&(s=void 0),{value:s&&s[p++],done:!s}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")}function Q(s,h){var d="function"==typeof Symbol&&s[Symbol.iterator];if(!d)return s;var g,w,p=d.call(s),m=[];try{for(;(void 0===h||h-- >0)&&!(g=p.next()).done;)m.push(g.value)}catch(C){w={error:C}}finally{try{g&&!g.done&&(d=p.return)&&d.call(p)}finally{if(w)throw w.error}}return m}function ne(){for(var s=[],h=0;h<arguments.length;h++)s=s.concat(Q(arguments[h]));return s}function X(){for(var s=0,h=0,d=arguments.length;h<d;h++)s+=arguments[h].length;var p=Array(s),g=0;for(h=0;h<d;h++)for(var m=arguments[h],w=0,C=m.length;w<C;w++,g++)p[g]=m[w];return p}function W(s){return this instanceof W?(this.v=s,this):new W(s)}function f(s,h,d){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g,p=d.apply(s,h||[]),m=[];return g={},w("next"),w("throw"),w("return"),g[Symbol.asyncIterator]=function(){return this},g;function w(M){p[M]&&(g[M]=function(K){return new Promise(function(ae,Se){m.push([M,K,ae,Se])>1||C(M,K)})})}function C(M,K){try{!function(M){M.value instanceof W?Promise.resolve(M.value.v).then(b,B):Z(m[0][2],M)}(p[M](K))}catch(ae){Z(m[0][3],ae)}}function b(M){C("next",M)}function B(M){C("throw",M)}function Z(M,K){M(K),m.shift(),m.length&&C(m[0][0],m[0][1])}}function ce(s){var h,d;return h={},p("next"),p("throw",function(g){throw g}),p("return"),h[Symbol.iterator]=function(){return this},h;function p(g,m){h[g]=s[g]?function(w){return(d=!d)?{value:W(s[g](w)),done:"return"===g}:m?m(w):w}:m}}function de(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var d,h=s[Symbol.asyncIterator];return h?h.call(s):(s=V(s),d={},p("next"),p("throw"),p("return"),d[Symbol.asyncIterator]=function(){return this},d);function p(m){d[m]=s[m]&&function(w){return new Promise(function(C,q){!function(m,w,C,q){Promise.resolve(q).then(function(b){m({value:b,done:C})},w)}(C,q,(w=s[m](w)).done,w.value)})}}}function me(s,h){return Object.defineProperty?Object.defineProperty(s,"raw",{value:h}):s.raw=h,s}function _e(s){if(s&&s.__esModule)return s;var h={};if(null!=s)for(var d in s)Object.hasOwnProperty.call(s,d)&&(h[d]=s[d]);return h.default=s,h}function we(s){return s&&s.__esModule?s:{default:s}}function xe(s,h){if(!h.has(s))throw new TypeError("attempted to get private field on non-instance");return h.get(s)}function be(s,h,d){if(!h.has(s))throw new TypeError("attempted to set private field on non-instance");return h.set(s,d),d}},53352:function(Y,E,T){T.r(E),T.d(E,{__extends:function(){return G},__assign:function(){return k},__rest:function(){return H},__decorate:function(){return j},__param:function(){return L},__metadata:function(){return A},__awaiter:function(){return R},__generator:function(){return z},__createBinding:function(){return J},__exportStar:function(){return U},__values:function(){return V},__read:function(){return Q},__spread:function(){return ne},__spreadArrays:function(){return X},__await:function(){return W},__asyncGenerator:function(){return f},__asyncDelegator:function(){return ce},__asyncValues:function(){return de},__makeTemplateObject:function(){return me},__importStar:function(){return _e},__importDefault:function(){return we},__classPrivateFieldGet:function(){return xe},__classPrivateFieldSet:function(){return be}});var O=function(s,h){return(O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var g in p)p.hasOwnProperty(g)&&(d[g]=p[g])})(s,h)};function G(s,h){function d(){this.constructor=s}O(s,h),s.prototype=null===h?Object.create(h):(d.prototype=h.prototype,new d)}var k=function(){return(k=Object.assign||function(h){for(var d,p=1,g=arguments.length;p<g;p++)for(var m in d=arguments[p])Object.prototype.hasOwnProperty.call(d,m)&&(h[m]=d[m]);return h}).apply(this,arguments)};function H(s,h){var d={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&h.indexOf(p)<0&&(d[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var g=0;for(p=Object.getOwnPropertySymbols(s);g<p.length;g++)h.indexOf(p[g])<0&&Object.prototype.propertyIsEnumerable.call(s,p[g])&&(d[p[g]]=s[p[g]])}return d}function j(s,h,d,p){var w,g=arguments.length,m=g<3?h:null===p?p=Object.getOwnPropertyDescriptor(h,d):p;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)m=Reflect.decorate(s,h,d,p);else for(var C=s.length-1;C>=0;C--)(w=s[C])&&(m=(g<3?w(m):g>3?w(h,d,m):w(h,d))||m);return g>3&&m&&Object.defineProperty(h,d,m),m}function L(s,h){return function(d,p){h(d,p,s)}}function A(s,h){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(s,h)}function R(s,h,d,p){return new(d||(d=Promise))(function(m,w){function C(B){try{b(p.next(B))}catch(Z){w(Z)}}function q(B){try{b(p.throw(B))}catch(Z){w(Z)}}function b(B){B.done?m(B.value):function(m){return m instanceof d?m:new d(function(w){w(m)})}(B.value).then(C,q)}b((p=p.apply(s,h||[])).next())})}function z(s,h){var p,g,m,w,d={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return w={next:C(0),throw:C(1),return:C(2)},"function"==typeof Symbol&&(w[Symbol.iterator]=function(){return this}),w;function C(b){return function(B){return function(b){if(p)throw new TypeError("Generator is already executing.");for(;d;)try{if(p=1,g&&(m=2&b[0]?g.return:b[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,b[1])).done)return m;switch(g=0,m&&(b=[2&b[0],m.value]),b[0]){case 0:case 1:m=b;break;case 4:return d.label++,{value:b[1],done:!1};case 5:d.label++,g=b[1],b=[0];continue;case 7:b=d.ops.pop(),d.trys.pop();continue;default:if(!(m=(m=d.trys).length>0&&m[m.length-1])&&(6===b[0]||2===b[0])){d=0;continue}if(3===b[0]&&(!m||b[1]>m[0]&&b[1]<m[3])){d.label=b[1];break}if(6===b[0]&&d.label<m[1]){d.label=m[1],m=b;break}if(m&&d.label<m[2]){d.label=m[2],d.ops.push(b);break}m[2]&&d.ops.pop(),d.trys.pop();continue}b=h.call(s,d)}catch(B){b=[6,B],g=0}finally{p=m=0}if(5&b[0])throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}([b,B])}}}function J(s,h,d,p){void 0===p&&(p=d),s[p]=h[d]}function U(s,h){for(var d in s)"default"!==d&&!h.hasOwnProperty(d)&&(h[d]=s[d])}function V(s){var h="function"==typeof Symbol&&Symbol.iterator,d=h&&s[h],p=0;if(d)return d.call(s);if(s&&"number"==typeof s.length)return{next:function(){return s&&p>=s.length&&(s=void 0),{value:s&&s[p++],done:!s}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")}function Q(s,h){var d="function"==typeof Symbol&&s[Symbol.iterator];if(!d)return s;var g,w,p=d.call(s),m=[];try{for(;(void 0===h||h-- >0)&&!(g=p.next()).done;)m.push(g.value)}catch(C){w={error:C}}finally{try{g&&!g.done&&(d=p.return)&&d.call(p)}finally{if(w)throw w.error}}return m}function ne(){for(var s=[],h=0;h<arguments.length;h++)s=s.concat(Q(arguments[h]));return s}function X(){for(var s=0,h=0,d=arguments.length;h<d;h++)s+=arguments[h].length;var p=Array(s),g=0;for(h=0;h<d;h++)for(var m=arguments[h],w=0,C=m.length;w<C;w++,g++)p[g]=m[w];return p}function W(s){return this instanceof W?(this.v=s,this):new W(s)}function f(s,h,d){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g,p=d.apply(s,h||[]),m=[];return g={},w("next"),w("throw"),w("return"),g[Symbol.asyncIterator]=function(){return this},g;function w(M){p[M]&&(g[M]=function(K){return new Promise(function(ae,Se){m.push([M,K,ae,Se])>1||C(M,K)})})}function C(M,K){try{!function(M){M.value instanceof W?Promise.resolve(M.value.v).then(b,B):Z(m[0][2],M)}(p[M](K))}catch(ae){Z(m[0][3],ae)}}function b(M){C("next",M)}function B(M){C("throw",M)}function Z(M,K){M(K),m.shift(),m.length&&C(m[0][0],m[0][1])}}function ce(s){var h,d;return h={},p("next"),p("throw",function(g){throw g}),p("return"),h[Symbol.iterator]=function(){return this},h;function p(g,m){h[g]=s[g]?function(w){return(d=!d)?{value:W(s[g](w)),done:"return"===g}:m?m(w):w}:m}}function de(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var d,h=s[Symbol.asyncIterator];return h?h.call(s):(s=V(s),d={},p("next"),p("throw"),p("return"),d[Symbol.asyncIterator]=function(){return this},d);function p(m){d[m]=s[m]&&function(w){return new Promise(function(C,q){!function(m,w,C,q){Promise.resolve(q).then(function(b){m({value:b,done:C})},w)}(C,q,(w=s[m](w)).done,w.value)})}}}function me(s,h){return Object.defineProperty?Object.defineProperty(s,"raw",{value:h}):s.raw=h,s}function _e(s){if(s&&s.__esModule)return s;var h={};if(null!=s)for(var d in s)Object.hasOwnProperty.call(s,d)&&(h[d]=s[d]);return h.default=s,h}function we(s){return s&&s.__esModule?s:{default:s}}function xe(s,h){if(!h.has(s))throw new TypeError("attempted to get private field on non-instance");return h.get(s)}function be(s,h,d){if(!h.has(s))throw new TypeError("attempted to set private field on non-instance");return h.set(s,d),d}}}]);