(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-178e9a21"],{"0881":function(e){e.exports=JSON.parse('{"name":"@aws-sdk/client-lex-runtime-service","description":"AWS SDK for JavaScript Lex Runtime Service Client for Node.js, Browser and React Native","version":"3.6.1","scripts":{"clean":"yarn remove-definitions && yarn remove-dist && yarn remove-documentation","build-documentation":"yarn remove-documentation && typedoc ./","prepublishOnly":"yarn build","pretest":"yarn build:cjs","remove-definitions":"rimraf ./types","remove-dist":"rimraf ./dist","remove-documentation":"rimraf ./docs","test:unit":"mocha **/cjs/**/*.spec.js","test":"yarn test:unit","build:cjs":"tsc -p tsconfig.json","build:es":"tsc -p tsconfig.es.json","build":"yarn build:cjs && yarn build:es","postbuild":"downlevel-dts types types/ts3.4"},"main":"./dist/cjs/index.js","types":"./types/index.d.ts","module":"./dist/es/index.js","browser":{"./runtimeConfig":"./runtimeConfig.browser"},"react-native":{"./runtimeConfig":"./runtimeConfig.native"},"sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"^1.0.0","@aws-crypto/sha256-js":"^1.0.0","@aws-sdk/config-resolver":"3.6.1","@aws-sdk/credential-provider-node":"3.6.1","@aws-sdk/fetch-http-handler":"3.6.1","@aws-sdk/hash-node":"3.6.1","@aws-sdk/invalid-dependency":"3.6.1","@aws-sdk/middleware-content-length":"3.6.1","@aws-sdk/middleware-host-header":"3.6.1","@aws-sdk/middleware-logger":"3.6.1","@aws-sdk/middleware-retry":"3.6.1","@aws-sdk/middleware-serde":"3.6.1","@aws-sdk/middleware-signing":"3.6.1","@aws-sdk/middleware-stack":"3.6.1","@aws-sdk/middleware-user-agent":"3.6.1","@aws-sdk/node-config-provider":"3.6.1","@aws-sdk/node-http-handler":"3.6.1","@aws-sdk/protocol-http":"3.6.1","@aws-sdk/smithy-client":"3.6.1","@aws-sdk/types":"3.6.1","@aws-sdk/url-parser":"3.6.1","@aws-sdk/url-parser-native":"3.6.1","@aws-sdk/util-base64-browser":"3.6.1","@aws-sdk/util-base64-node":"3.6.1","@aws-sdk/util-body-length-browser":"3.6.1","@aws-sdk/util-body-length-node":"3.6.1","@aws-sdk/util-user-agent-browser":"3.6.1","@aws-sdk/util-user-agent-node":"3.6.1","@aws-sdk/util-utf8-browser":"3.6.1","@aws-sdk/util-utf8-node":"3.6.1","tslib":"^2.0.0"},"devDependencies":{"@aws-sdk/client-documentation-generator":"3.6.1","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^12.7.5","downlevel-dts":"0.7.0","jest":"^26.1.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.1.2"},"engines":{"node":">=10.0.0"},"typesVersions":{"<4.0":{"types/*":["types/ts3.4/*"]}},"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lex-runtime-service","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-lex-runtime-service"}}')},"1e35":function(e,t,n){"use strict";n.d(t,"a",(function(){return v})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return f})),n.d(t,"e",(function(){return d})),n.d(t,"f",(function(){return y})),n.d(t,"g",(function(){return g})),n.d(t,"h",(function(){return E})),n.d(t,"i",(function(){return a})),n.d(t,"j",(function(){return m})),n.d(t,"k",(function(){return p})),n.d(t,"l",(function(){return h})),n.d(t,"m",(function(){return b})),n.d(t,"n",(function(){return u})),n.d(t,"o",(function(){return l})),n.d(t,"p",(function(){return r})),n.d(t,"q",(function(){return s})),n.d(t,"r",(function(){return i}));var i="username",o="email",r="code",a="phone",s="password",c="country-dial-code-select",u="+1",l="amplify-auth-source",d="Phone number can not be empty",f="No Auth module found, please ensure @aws-amplify/auth is imported",p="No Storage module found, please ensure @aws-amplify/storage is imported",m="No Interactions module found, please ensure @aws-amplify/interactions is imported",h="User has not set up software token mfa",b="User has not verified software token mfa",v="auth",g="UI Auth",y="ToastAuthError",E="AuthStateChange"},2482:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n("36de"),o=new i["a"]("I18n"),r=function(){function e(e){this._options=null,this._lang=null,this._dict={},this._options=Object.assign({},e),this._lang=this._options.language,!this._lang&&"undefined"!==typeof window&&window&&window.navigator&&(this._lang=window.navigator.language),o.debug(this._lang)}return e.prototype.setLanguage=function(e){this._lang=e},e.prototype.get=function(e,t){if(void 0===t&&(t=void 0),!this._lang)return"undefined"!==typeof t?t:e;var n=this._lang,i=this.getByLanguage(e,n);return i||(n.indexOf("-")>0&&(i=this.getByLanguage(e,n.split("-")[0])),i||("undefined"!==typeof t?t:e))},e.prototype.getByLanguage=function(e,t,n){if(void 0===n&&(n=null),!t)return n;var i=this._dict[t];return i?i[e]:n},e.prototype.putVocabulariesForLanguage=function(e,t){var n=this._dict[e];n||(n=this._dict[e]={}),Object.assign(n,t)},e.prototype.putVocabularies=function(e){var t=this;Object.keys(e).map((function(n){t.putVocabulariesForLanguage(n,e[n])}))},e}(),a=n("7d03"),s=new i["a"]("I18n"),c=null,u=null,l=function(){function e(){}return e.configure=function(t){return s.debug("configure I18n"),t?(c=Object.assign({},c,t.I18n||t),e.createInstance(),c):c},e.getModuleName=function(){return"I18n"},e.createInstance=function(){s.debug("create I18n instance"),u||(u=new r(c))},e.setLanguage=function(t){return e.checkConfig(),u.setLanguage(t)},e.get=function(t,n){return e.checkConfig()?u.get(t,n):"undefined"===typeof n?t:n},e.putVocabulariesForLanguage=function(t,n){return e.checkConfig(),u.putVocabulariesForLanguage(t,n)},e.putVocabularies=function(t){return e.checkConfig(),u.putVocabularies(t)},e.checkConfig=function(){return u||(u=new r(c)),!0},e}();a["a"].register(l)},"6c18":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i,o,r=n("60ac");(function(e){e["BACK_TO_SIGN_IN"]="Back to Sign In",e["CHANGE_PASSWORD_ACTION"]="Change",e["CHANGE_PASSWORD"]="Change Password",e["CODE_LABEL"]="Verification code",e["CODE_PLACEHOLDER"]="Enter code",e["CONFIRM_SIGN_UP_CODE_LABEL"]="Confirmation Code",e["CONFIRM_SIGN_UP_CODE_PLACEHOLDER"]="Enter your code",e["CONFIRM_SIGN_UP_HEADER_TEXT"]="Confirm Sign up",e["CONFIRM_SIGN_UP_LOST_CODE"]="Lost your code?",e["CONFIRM_SIGN_UP_RESEND_CODE"]="Resend Code",e["CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT"]="Confirm",e["CONFIRM_SMS_CODE"]="Confirm SMS Code",e["CONFIRM_TOTP_CODE"]="Confirm TOTP Code",e["CONFIRM"]="Confirm",e["CREATE_ACCOUNT_TEXT"]="Create account",e["EMAIL_LABEL"]="Email Address *",e["EMAIL_PLACEHOLDER"]="Enter your email address",e["FORGOT_PASSWORD_TEXT"]="Forgot your password?",e["LESS_THAN_TWO_MFA_VALUES_MESSAGE"]="Less than two MFA types available",e["NEW_PASSWORD_LABEL"]="New password",e["NEW_PASSWORD_PLACEHOLDER"]="Enter your new password",e["NO_ACCOUNT_TEXT"]="No account?",e["USERNAME_REMOVE_WHITESPACE"]="Username cannot contain whitespace",e["PASSWORD_REMOVE_WHITESPACE"]="Password cannot start or end with whitespace",e["PASSWORD_LABEL"]="Password *",e["PASSWORD_PLACEHOLDER"]="Enter your password",e["PHONE_LABEL"]="Phone Number *",e["PHONE_PLACEHOLDER"]="(555) 555-1212",e["QR_CODE_ALT"]="qrcode",e["RESET_PASSWORD_TEXT"]="Reset password",e["RESET_YOUR_PASSWORD"]="Reset your password",e["SELECT_MFA_TYPE_HEADER_TEXT"]="Select MFA Type",e["SELECT_MFA_TYPE_SUBMIT_BUTTON_TEXT"]="Verify",e["SEND_CODE"]="Send Code",e["SUBMIT"]="Submit",e["SETUP_TOTP_REQUIRED"]="TOTP needs to be configured",e["SIGN_IN_ACTION"]="Sign In",e["SIGN_IN_HEADER_TEXT"]="Sign in to your account",e["SIGN_IN_TEXT"]="Sign in",e["SIGN_IN_WITH_AMAZON"]="Sign in with Amazon",e["SIGN_IN_WITH_AUTH0"]="Sign in with Auth0",e["SIGN_IN_WITH_AWS"]="Sign in with AWS",e["SIGN_IN_WITH_FACEBOOK"]="Sign in with Facebook",e["SIGN_IN_WITH_GOOGLE"]="Sign in with Google",e["SIGN_OUT"]="Sign Out",e["SIGN_UP_EMAIL_PLACEHOLDER"]="Email",e["SIGN_UP_HAVE_ACCOUNT_TEXT"]="Have an account?",e["SIGN_UP_HEADER_TEXT"]="Create a new account",e["SIGN_UP_PASSWORD_PLACEHOLDER"]="Password",e["SIGN_UP_SUBMIT_BUTTON_TEXT"]="Create Account",e["SIGN_UP_USERNAME_PLACEHOLDER"]="Username",e["SUCCESS_MFA_TYPE"]="Success! Your MFA Type is now:",e["TOTP_HEADER_TEXT"]="Scan then enter verification code",e["TOTP_LABEL"]="Enter Security Code:",e["TOTP_ISSUER"]="AWSCognito",e["TOTP_SETUP_FAILURE"]="TOTP Setup has failed",e["TOTP_SUBMIT_BUTTON_TEXT"]="Verify Security Token",e["TOTP_SUCCESS_MESSAGE"]="Setup TOTP successfully!",e["UNABLE_TO_SETUP_MFA_AT_THIS_TIME"]="Failed! Unable to configure MFA at this time",e["USERNAME_LABEL"]="Username *",e["USERNAME_PLACEHOLDER"]="Enter your username",e["VERIFY_CONTACT_EMAIL_LABEL"]="Email",e["VERIFY_CONTACT_HEADER_TEXT"]="Account recovery requires verified contact information",e["VERIFY_CONTACT_PHONE_LABEL"]="Phone Number",e["VERIFY_CONTACT_SUBMIT_LABEL"]="Submit",e["VERIFY_CONTACT_VERIFY_LABEL"]="Verify",e["ADDRESS_LABEL"]="Address",e["ADDRESS_PLACEHOLDER"]="Enter your address",e["NICKNAME_LABEL"]="Nickname",e["NICKNAME_PLACEHOLDER"]="Enter your nickname",e["BIRTHDATE_LABEL"]="Birthday",e["BIRTHDATE_PLACEHOLDER"]="Enter your birthday",e["PICTURE_LABEL"]="Picture URL",e["PICTURE_PLACEHOLDER"]="Enter your picture URL",e["FAMILY_NAME_LABEL"]="Family Name",e["FAMILY_NAME_PLACEHOLDER"]="Enter your family name",e["PREFERRED_USERNAME_LABEL"]="Preferred Username",e["PREFERRED_USERNAME_PLACEHOLDER"]="Enter your preferred username",e["GENDER_LABEL"]="Gender",e["GENDER_PLACEHOLDER"]="Enter your gender",e["PROFILE_LABEL"]="Profile URL",e["PROFILE_PLACEHOLDER"]="Enter your profile URL",e["GIVEN_NAME_LABEL"]="First Name",e["GIVEN_NAME_PLACEHOLDER"]="Enter your first name",e["ZONEINFO_LABEL"]="Time zone",e["ZONEINFO_PLACEHOLDER"]="Enter your time zone",e["LOCALE_LABEL"]="Locale",e["LOCALE_PLACEHOLDER"]="Enter your locale",e["UPDATED_AT_LABEL"]="Updated At",e["UPDATED_AT_PLACEHOLDER"]="Enter the time the information was last updated",e["MIDDLE_NAME_LABEL"]="Middle Name",e["MIDDLE_NAME_PLACEHOLDER"]="Enter your middle name",e["WEBSITE_LABEL"]="Website",e["WEBSITE_PLACEHOLDER"]="Enter your website",e["NAME_LABEL"]="Full Name",e["NAME_PLACEHOLDER"]="Enter your full name",e["PHOTO_PICKER_TITLE"]="Picker Title",e["PHOTO_PICKER_HINT"]="Ancillary text or content may occupy this space here",e["PHOTO_PICKER_PLACEHOLDER_HINT"]="Placeholder hint",e["PHOTO_PICKER_BUTTON_TEXT"]="Button",e["IMAGE_PICKER_TITLE"]="Add Profile Photo",e["IMAGE_PICKER_HINT"]="Preview the image before upload",e["IMAGE_PICKER_PLACEHOLDER_HINT"]="Tap to image select",e["IMAGE_PICKER_BUTTON_TEXT"]="Upload",e["PICKER_TEXT"]="Pick a file",e["TEXT_FALLBACK_CONTENT"]="Fallback Content",e["CONFIRM_SIGN_UP_FAILED"]="Confirm Sign Up Failed",e["SIGN_UP_FAILED"]="Sign Up Failed"})(i||(i={})),function(e){e["CHATBOT_TITLE"]="ChatBot Lex",e["TEXT_INPUT_PLACEHOLDER"]="Write a message",e["VOICE_INPUT_PLACEHOLDER"]="Click mic to speak",e["CHAT_DISABLED_ERROR"]="Error: Either voice or text must be enabled for the chatbot",e["NO_BOT_NAME_ERROR"]="Error: Bot name must be provided to ChatBot"}(o||(o={}));var a=Object.assign(Object.assign(Object.assign({},i),r["a"]),o)},"9b2c":function(e,t,n){"use strict";n.r(t),n.d(t,"amplify_chatbot",(function(){return N}));var i,o,r,a=n("6260"),s=n("36de"),c=n("1f3a"),u=n("2482"),l=n("6c18"),d=n("1e35"),f=n("b597"),p=function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{c(i.next(e))}catch(t){r(t)}}function s(e){try{c(i["throw"](e))}catch(t){r(t)}}function c(e){e.done?n(e.value):o(e.value).then(a,s)}c((i=i.apply(e,t||[])).next())}))},m=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(e){return function(t){return c([e,t])}}function c(r){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,i&&(o=2&r[0]?i["return"]:r[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]i||a<-1*i)&&(this.start=Date.now())}var s=Date.now(),c=s-this.start;c>o&&this.onSilence()}},e.prototype.exportWAV=function(e){return void 0===e&&(e=v),p(this,void 0,void 0,(function(){var t,n;return m(this,(function(i){return this.audioSupported?(t=this.audioContext.sampleRate,n=L(this.streamBuffer,this.streamBufferLength,t,e),this.clear(),[2,n]):[2]}))}))},e}(),I=function(e,t,n){if(n){if(!Object(c["b"])().isBrowser)throw new Error("Visualization is not supported on non-browsers.");var i=n.getBoundingClientRect(),o=i.width,r=i.height;n.width=o,n.height=r;var a=n.getContext("2d");a.fillStyle="white",a.clearRect(0,0,o,r);var s=function(){a.fillRect(0,0,o,r),a.lineWidth=1;var i=getComputedStyle(document.documentElement).getPropertyValue("--amplify-primary-color");a.strokeStyle=i&&""!==i?i:"#ff9900",a.beginPath();for(var s=1*o/t,c=0,u=0;u0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0)&&!(i=r.next()).done)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(o)throw o.error}}return a}Object.create},ddfb:function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l}));var i=n("be27"),o=n("1279"),r=n("108d"),a=function(t,n){return Object(i["b"])(void 0,void 0,void 0,(function(){var a,s,c,u,l,d,f,p,m;return Object(i["d"])(this,(function(h){switch(h.label){case 0:if(a=Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])({"content-type":"application/octet-stream","x-amz-content-sha256":"UNSIGNED-PAYLOAD"},$(t.sessionAttributes)&&{"x-amz-lex-session-attributes":e.from(r["c"].fromObject(t.sessionAttributes)).toString("base64")}),$(t.requestAttributes)&&{"x-amz-lex-request-attributes":e.from(r["c"].fromObject(t.requestAttributes)).toString("base64")}),$(t.contentType)&&{"content-type":t.contentType}),$(t.accept)&&{accept:t.accept}),$(t.activeContexts)&&{"x-amz-lex-active-contexts":e.from(r["c"].fromObject(t.activeContexts)).toString("base64")}),s="/bot/{botName}/alias/{botAlias}/user/{userId}/content",void 0===t.botName)throw new Error("No value provided for input HTTP label: botName.");if(c=t.botName,c.length<=0)throw new Error("Empty value provided for input HTTP label: botName.");if(s=s.replace("{botName}",Object(r["f"])(c)),void 0===t.botAlias)throw new Error("No value provided for input HTTP label: botAlias.");if(c=t.botAlias,c.length<=0)throw new Error("Empty value provided for input HTTP label: botAlias.");if(s=s.replace("{botAlias}",Object(r["f"])(c)),void 0===t.userId)throw new Error("No value provided for input HTTP label: userId.");if(c=t.userId,c.length<=0)throw new Error("Empty value provided for input HTTP label: userId.");return s=s.replace("{userId}",Object(r["f"])(c)),void 0!==t.inputStream&&(u=t.inputStream),[4,n.endpoint()];case 1:return l=h.sent(),d=l.hostname,f=l.protocol,p=void 0===f?"https":f,m=l.port,[2,new o["a"]({protocol:p,hostname:d,port:m,method:"POST",headers:a,path:s,body:u})]}}))}))},s=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var n,a,s,c,u,l,d,f,p;return Object(i["d"])(this,(function(m){switch(m.label){case 0:if(n={"content-type":"application/json"},a="/bot/{botName}/alias/{botAlias}/user/{userId}/text",void 0===e.botName)throw new Error("No value provided for input HTTP label: botName.");if(s=e.botName,s.length<=0)throw new Error("Empty value provided for input HTTP label: botName.");if(a=a.replace("{botName}",Object(r["f"])(s)),void 0===e.botAlias)throw new Error("No value provided for input HTTP label: botAlias.");if(s=e.botAlias,s.length<=0)throw new Error("Empty value provided for input HTTP label: botAlias.");if(a=a.replace("{botAlias}",Object(r["f"])(s)),void 0===e.userId)throw new Error("No value provided for input HTTP label: userId.");if(s=e.userId,s.length<=0)throw new Error("Empty value provided for input HTTP label: userId.");return a=a.replace("{userId}",Object(r["f"])(s)),c=JSON.stringify(Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])({},void 0!==e.activeContexts&&null!==e.activeContexts&&{activeContexts:_(e.activeContexts,t)}),void 0!==e.inputText&&null!==e.inputText&&{inputText:e.inputText}),void 0!==e.requestAttributes&&null!==e.requestAttributes&&{requestAttributes:L(e.requestAttributes,t)}),void 0!==e.sessionAttributes&&null!==e.sessionAttributes&&{sessionAttributes:L(e.sessionAttributes,t)})),[4,t.endpoint()];case 1:return u=m.sent(),l=u.hostname,d=u.protocol,f=void 0===d?"https":d,p=u.port,[2,new o["a"]({protocol:f,hostname:l,port:p,method:"POST",headers:n,path:a,body:c})]}}))}))},c=function(t,n){return Object(i["b"])(void 0,void 0,void 0,(function(){var o,a;return Object(i["d"])(this,(function(i){return 200!==t.statusCode&&t.statusCode>=300?[2,u(t,n)]:(o={$metadata:H(t),activeContexts:void 0,alternativeIntents:void 0,audioStream:void 0,botVersion:void 0,contentType:void 0,dialogState:void 0,inputTranscript:void 0,intentName:void 0,message:void 0,messageFormat:void 0,nluIntentConfidence:void 0,sentimentResponse:void 0,sessionAttributes:void 0,sessionId:void 0,slotToElicit:void 0,slots:void 0},void 0!==t.headers["content-type"]&&(o.contentType=t.headers["content-type"]),void 0!==t.headers["x-amz-lex-intent-name"]&&(o.intentName=t.headers["x-amz-lex-intent-name"]),void 0!==t.headers["x-amz-lex-nlu-intent-confidence"]&&(o.nluIntentConfidence=new r["c"](e.from(t.headers["x-amz-lex-nlu-intent-confidence"],"base64").toString("ascii"))),void 0!==t.headers["x-amz-lex-alternative-intents"]&&(o.alternativeIntents=new r["c"](e.from(t.headers["x-amz-lex-alternative-intents"],"base64").toString("ascii"))),void 0!==t.headers["x-amz-lex-slots"]&&(o.slots=new r["c"](e.from(t.headers["x-amz-lex-slots"],"base64").toString("ascii"))),void 0!==t.headers["x-amz-lex-session-attributes"]&&(o.sessionAttributes=new r["c"](e.from(t.headers["x-amz-lex-session-attributes"],"base64").toString("ascii"))),void 0!==t.headers["x-amz-lex-sentiment"]&&(o.sentimentResponse=t.headers["x-amz-lex-sentiment"]),void 0!==t.headers["x-amz-lex-message"]&&(o.message=t.headers["x-amz-lex-message"]),void 0!==t.headers["x-amz-lex-message-format"]&&(o.messageFormat=t.headers["x-amz-lex-message-format"]),void 0!==t.headers["x-amz-lex-dialog-state"]&&(o.dialogState=t.headers["x-amz-lex-dialog-state"]),void 0!==t.headers["x-amz-lex-slot-to-elicit"]&&(o.slotToElicit=t.headers["x-amz-lex-slot-to-elicit"]),void 0!==t.headers["x-amz-lex-input-transcript"]&&(o.inputTranscript=t.headers["x-amz-lex-input-transcript"]),void 0!==t.headers["x-amz-lex-bot-version"]&&(o.botVersion=t.headers["x-amz-lex-bot-version"]),void 0!==t.headers["x-amz-lex-session-id"]&&(o.sessionId=t.headers["x-amz-lex-session-id"]),void 0!==t.headers["x-amz-lex-active-contexts"]&&(o.activeContexts=new r["c"](e.from(t.headers["x-amz-lex-active-contexts"],"base64").toString("ascii"))),a=t.body,o.audioStream=a,[2,Promise.resolve(o)])}))}))},u=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var n,o,r,a,s,c,u,l,d,S,x,_,T,L,A,C,I,j,N;return Object(i["d"])(this,(function(P){switch(P.label){case 0:return o=[Object(i["a"])({},e)],N={},[4,W(e.body,t)];case 1:switch(n=i["a"].apply(void 0,o.concat([(N.body=P.sent(),N)])),a="UnknownError",a=q(e,n.body),s=a,s){case"BadGatewayException":return[3,2];case"com.amazonaws.lexruntimeservice#BadGatewayException":return[3,2];case"BadRequestException":return[3,4];case"com.amazonaws.lexruntimeservice#BadRequestException":return[3,4];case"ConflictException":return[3,6];case"com.amazonaws.lexruntimeservice#ConflictException":return[3,6];case"DependencyFailedException":return[3,8];case"com.amazonaws.lexruntimeservice#DependencyFailedException":return[3,8];case"InternalFailureException":return[3,10];case"com.amazonaws.lexruntimeservice#InternalFailureException":return[3,10];case"LimitExceededException":return[3,12];case"com.amazonaws.lexruntimeservice#LimitExceededException":return[3,12];case"LoopDetectedException":return[3,14];case"com.amazonaws.lexruntimeservice#LoopDetectedException":return[3,14];case"NotAcceptableException":return[3,16];case"com.amazonaws.lexruntimeservice#NotAcceptableException":return[3,16];case"NotFoundException":return[3,18];case"com.amazonaws.lexruntimeservice#NotFoundException":return[3,18];case"RequestTimeoutException":return[3,20];case"com.amazonaws.lexruntimeservice#RequestTimeoutException":return[3,20];case"UnsupportedMediaTypeException":return[3,22];case"com.amazonaws.lexruntimeservice#UnsupportedMediaTypeException":return[3,22]}return[3,24];case 2:return c=[{}],[4,f(n,t)];case 3:return r=i["a"].apply(void 0,[i["a"].apply(void 0,c.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 4:return u=[{}],[4,p(n,t)];case 5:return r=i["a"].apply(void 0,[i["a"].apply(void 0,u.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 6:return l=[{}],[4,m(n,t)];case 7:return r=i["a"].apply(void 0,[i["a"].apply(void 0,l.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 8:return d=[{}],[4,h(n,t)];case 9:return r=i["a"].apply(void 0,[i["a"].apply(void 0,d.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 10:return S=[{}],[4,b(n,t)];case 11:return r=i["a"].apply(void 0,[i["a"].apply(void 0,S.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 12:return x=[{}],[4,v(n,t)];case 13:return r=i["a"].apply(void 0,[i["a"].apply(void 0,x.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 14:return _=[{}],[4,g(n,t)];case 15:return r=i["a"].apply(void 0,[i["a"].apply(void 0,_.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 16:return T=[{}],[4,y(n,t)];case 17:return r=i["a"].apply(void 0,[i["a"].apply(void 0,T.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 18:return L=[{}],[4,E(n,t)];case 19:return r=i["a"].apply(void 0,[i["a"].apply(void 0,L.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 20:return A=[{}],[4,w(n,t)];case 21:return r=i["a"].apply(void 0,[i["a"].apply(void 0,A.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 22:return C=[{}],[4,O(n,t)];case 23:return r=i["a"].apply(void 0,[i["a"].apply(void 0,C.concat([P.sent()])),{name:a,$metadata:H(e)}]),[3,25];case 24:I=n.body,a=I.code||I.Code||a,r=Object(i["a"])(Object(i["a"])({},I),{name:""+a,message:I.message||I.Message||a,$fault:"client",$metadata:H(e)}),P.label=25;case 25:return j=r.message||r.Message||a,r.message=j,delete r.Message,[2,Promise.reject(Object.assign(new Error(j),r))]}}))}))},l=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var n,o;return Object(i["d"])(this,(function(i){switch(i.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,d(e,t)]:(n={$metadata:H(e),activeContexts:void 0,alternativeIntents:void 0,botVersion:void 0,dialogState:void 0,intentName:void 0,message:void 0,messageFormat:void 0,nluIntentConfidence:void 0,responseCard:void 0,sentimentResponse:void 0,sessionAttributes:void 0,sessionId:void 0,slotToElicit:void 0,slots:void 0},[4,W(e.body,t)]);case 1:return o=i.sent(),void 0!==o.activeContexts&&null!==o.activeContexts&&(n.activeContexts=I(o.activeContexts,t)),void 0!==o.alternativeIntents&&null!==o.alternativeIntents&&(n.alternativeIntents=D(o.alternativeIntents,t)),void 0!==o.botVersion&&null!==o.botVersion&&(n.botVersion=o.botVersion),void 0!==o.dialogState&&null!==o.dialogState&&(n.dialogState=o.dialogState),void 0!==o.intentName&&null!==o.intentName&&(n.intentName=o.intentName),void 0!==o.message&&null!==o.message&&(n.message=o.message),void 0!==o.messageFormat&&null!==o.messageFormat&&(n.messageFormat=o.messageFormat),void 0!==o.nluIntentConfidence&&null!==o.nluIntentConfidence&&(n.nluIntentConfidence=k(o.nluIntentConfidence,t)),void 0!==o.responseCard&&null!==o.responseCard&&(n.responseCard=U(o.responseCard,t)),void 0!==o.sentimentResponse&&null!==o.sentimentResponse&&(n.sentimentResponse=F(o.sentimentResponse,t)),void 0!==o.sessionAttributes&&null!==o.sessionAttributes&&(n.sessionAttributes=z(o.sessionAttributes,t)),void 0!==o.sessionId&&null!==o.sessionId&&(n.sessionId=o.sessionId),void 0!==o.slotToElicit&&null!==o.slotToElicit&&(n.slotToElicit=o.slotToElicit),void 0!==o.slots&&null!==o.slots&&(n.slots=z(o.slots,t)),[2,Promise.resolve(n)]}}))}))},d=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var n,o,r,a,s,c,u,l,d,y,w,O,S,x,_,T;return Object(i["d"])(this,(function(L){switch(L.label){case 0:return o=[Object(i["a"])({},e)],T={},[4,W(e.body,t)];case 1:switch(n=i["a"].apply(void 0,o.concat([(T.body=L.sent(),T)])),a="UnknownError",a=q(e,n.body),s=a,s){case"BadGatewayException":return[3,2];case"com.amazonaws.lexruntimeservice#BadGatewayException":return[3,2];case"BadRequestException":return[3,4];case"com.amazonaws.lexruntimeservice#BadRequestException":return[3,4];case"ConflictException":return[3,6];case"com.amazonaws.lexruntimeservice#ConflictException":return[3,6];case"DependencyFailedException":return[3,8];case"com.amazonaws.lexruntimeservice#DependencyFailedException":return[3,8];case"InternalFailureException":return[3,10];case"com.amazonaws.lexruntimeservice#InternalFailureException":return[3,10];case"LimitExceededException":return[3,12];case"com.amazonaws.lexruntimeservice#LimitExceededException":return[3,12];case"LoopDetectedException":return[3,14];case"com.amazonaws.lexruntimeservice#LoopDetectedException":return[3,14];case"NotFoundException":return[3,16];case"com.amazonaws.lexruntimeservice#NotFoundException":return[3,16]}return[3,18];case 2:return c=[{}],[4,f(n,t)];case 3:return r=i["a"].apply(void 0,[i["a"].apply(void 0,c.concat([L.sent()])),{name:a,$metadata:H(e)}]),[3,19];case 4:return u=[{}],[4,p(n,t)];case 5:return r=i["a"].apply(void 0,[i["a"].apply(void 0,u.concat([L.sent()])),{name:a,$metadata:H(e)}]),[3,19];case 6:return l=[{}],[4,m(n,t)];case 7:return r=i["a"].apply(void 0,[i["a"].apply(void 0,l.concat([L.sent()])),{name:a,$metadata:H(e)}]),[3,19];case 8:return d=[{}],[4,h(n,t)];case 9:return r=i["a"].apply(void 0,[i["a"].apply(void 0,d.concat([L.sent()])),{name:a,$metadata:H(e)}]),[3,19];case 10:return y=[{}],[4,b(n,t)];case 11:return r=i["a"].apply(void 0,[i["a"].apply(void 0,y.concat([L.sent()])),{name:a,$metadata:H(e)}]),[3,19];case 12:return w=[{}],[4,v(n,t)];case 13:return r=i["a"].apply(void 0,[i["a"].apply(void 0,w.concat([L.sent()])),{name:a,$metadata:H(e)}]),[3,19];case 14:return O=[{}],[4,g(n,t)];case 15:return r=i["a"].apply(void 0,[i["a"].apply(void 0,O.concat([L.sent()])),{name:a,$metadata:H(e)}]),[3,19];case 16:return S=[{}],[4,E(n,t)];case 17:return r=i["a"].apply(void 0,[i["a"].apply(void 0,S.concat([L.sent()])),{name:a,$metadata:H(e)}]),[3,19];case 18:x=n.body,a=x.code||x.Code||a,r=Object(i["a"])(Object(i["a"])({},x),{name:""+a,message:x.message||x.Message||a,$fault:"client",$metadata:H(e)}),L.label=19;case 19:return _=r.message||r.Message||a,r.message=_,delete r.Message,[2,Promise.reject(Object.assign(new Error(_),r))]}}))}))},f=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"BadGatewayException",$fault:"server",$metadata:H(e),Message:void 0},n=e.body,void 0!==n.Message&&null!==n.Message&&(t.Message=n.Message),[2,t]}))}))},p=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"BadRequestException",$fault:"client",$metadata:H(e),message:void 0},n=e.body,void 0!==n.message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},m=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"ConflictException",$fault:"client",$metadata:H(e),message:void 0},n=e.body,void 0!==n.message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},h=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"DependencyFailedException",$fault:"client",$metadata:H(e),Message:void 0},n=e.body,void 0!==n.Message&&null!==n.Message&&(t.Message=n.Message),[2,t]}))}))},b=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"InternalFailureException",$fault:"server",$metadata:H(e),message:void 0},n=e.body,void 0!==n.message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},v=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"LimitExceededException",$fault:"client",$metadata:H(e),message:void 0,retryAfterSeconds:void 0},void 0!==e.headers["retry-after"]&&(t.retryAfterSeconds=e.headers["retry-after"]),n=e.body,void 0!==n.message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},g=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"LoopDetectedException",$fault:"server",$metadata:H(e),Message:void 0},n=e.body,void 0!==n.Message&&null!==n.Message&&(t.Message=n.Message),[2,t]}))}))},y=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"NotAcceptableException",$fault:"client",$metadata:H(e),message:void 0},n=e.body,void 0!==n.message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},E=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"NotFoundException",$fault:"client",$metadata:H(e),message:void 0},n=e.body,void 0!==n.message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},w=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"RequestTimeoutException",$fault:"client",$metadata:H(e),message:void 0},n=e.body,void 0!==n.message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},O=function(e,t){return Object(i["b"])(void 0,void 0,void 0,(function(){var t,n;return Object(i["d"])(this,(function(i){return t={name:"UnsupportedMediaTypeException",$fault:"client",$metadata:H(e),message:void 0},n=e.body,void 0!==n.message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},S=function(e,t){return Object(i["a"])(Object(i["a"])(Object(i["a"])({},void 0!==e.name&&null!==e.name&&{name:e.name}),void 0!==e.parameters&&null!==e.parameters&&{parameters:x(e.parameters,t)}),void 0!==e.timeToLive&&null!==e.timeToLive&&{timeToLive:T(e.timeToLive,t)})},x=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(i["e"])(t,2),r=o[0],a=o[1];return null===a?e:Object(i["a"])(Object(i["a"])({},e),(n={},n[r]=a,n))}),{})},_=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:S(e,t)}))},T=function(e,t){return Object(i["a"])(Object(i["a"])({},void 0!==e.timeToLiveInSeconds&&null!==e.timeToLiveInSeconds&&{timeToLiveInSeconds:e.timeToLiveInSeconds}),void 0!==e.turnsToLive&&null!==e.turnsToLive&&{turnsToLive:e.turnsToLive})},L=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(i["e"])(t,2),r=o[0],a=o[1];return null===a?e:Object(i["a"])(Object(i["a"])({},e),(n={},n[r]=a,n))}),{})},A=function(e,t){return{name:void 0!==e.name&&null!==e.name?e.name:void 0,parameters:void 0!==e.parameters&&null!==e.parameters?C(e.parameters,t):void 0,timeToLive:void 0!==e.timeToLive&&null!==e.timeToLive?j(e.timeToLive,t):void 0}},C=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(i["e"])(t,2),r=o[0],a=o[1];return null===a?e:Object(i["a"])(Object(i["a"])({},e),(n={},n[r]=a,n))}),{})},I=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:A(e,t)}))},j=function(e,t){return{timeToLiveInSeconds:void 0!==e.timeToLiveInSeconds&&null!==e.timeToLiveInSeconds?e.timeToLiveInSeconds:void 0,turnsToLive:void 0!==e.turnsToLive&&null!==e.turnsToLive?e.turnsToLive:void 0}},N=function(e,t){return{text:void 0!==e.text&&null!==e.text?e.text:void 0,value:void 0!==e.value&&null!==e.value?e.value:void 0}},P=function(e,t){return{attachmentLinkUrl:void 0!==e.attachmentLinkUrl&&null!==e.attachmentLinkUrl?e.attachmentLinkUrl:void 0,buttons:void 0!==e.buttons&&null!==e.buttons?M(e.buttons,t):void 0,imageUrl:void 0!==e.imageUrl&&null!==e.imageUrl?e.imageUrl:void 0,subTitle:void 0!==e.subTitle&&null!==e.subTitle?e.subTitle:void 0,title:void 0!==e.title&&null!==e.title?e.title:void 0}},R=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:P(e,t)}))},k=function(e,t){return{score:void 0!==e.score&&null!==e.score?e.score:void 0}},D=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:B(e,t)}))},M=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:N(e,t)}))},B=function(e,t){return{intentName:void 0!==e.intentName&&null!==e.intentName?e.intentName:void 0,nluIntentConfidence:void 0!==e.nluIntentConfidence&&null!==e.nluIntentConfidence?k(e.nluIntentConfidence,t):void 0,slots:void 0!==e.slots&&null!==e.slots?z(e.slots,t):void 0}},U=function(e,t){return{contentType:void 0!==e.contentType&&null!==e.contentType?e.contentType:void 0,genericAttachments:void 0!==e.genericAttachments&&null!==e.genericAttachments?R(e.genericAttachments,t):void 0,version:void 0!==e.version&&null!==e.version?e.version:void 0}},F=function(e,t){return{sentimentLabel:void 0!==e.sentimentLabel&&null!==e.sentimentLabel?e.sentimentLabel:void 0,sentimentScore:void 0!==e.sentimentScore&&null!==e.sentimentScore?e.sentimentScore:void 0}},z=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(i["e"])(t,2),r=o[0],a=o[1];return null===a?e:Object(i["a"])(Object(i["a"])({},e),(n={},n[r]=a,n))}),{})},H=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"]}},G=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},V=function(e,t){return G(e,t).then((function(e){return t.utf8Encoder(e)}))},$=function(e){return void 0!==e&&null!==e&&""!==e&&(!Object.getOwnPropertyNames(e).includes("length")||0!=e.length)&&(!Object.getOwnPropertyNames(e).includes("size")||0!=e.size)},W=function(e,t){return V(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},q=function(e,t){var n=function(e,t){return Object.keys(e).find((function(e){return e.toLowerCase()===t.toLowerCase()}))},i=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=n(e.headers,"x-amzn-errortype");return void 0!==o?i(e.headers[o]):void 0!==t.code?i(t.code):void 0!==t["__type"]?i(t["__type"]):""}}).call(this,n("1c35").Buffer)}}]); //# sourceMappingURL=chunk-178e9a21.609beb66.js.map