@microsoft/ocsdk 0.5.20-main.42b743c → 0.5.20-main.dfb694e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/SDK.min.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=23)}([function(e,t,n){"use strict";(function(e,r,o){var i=n(11);const{toString:a}=Object.prototype,{getPrototypeOf:s}=Object,u=(c=Object.create(null),e=>{const t=a.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const l=e=>(e=e.toLowerCase(),t=>u(t)===e),d=e=>t=>typeof t===e,{isArray:f}=Array,h=d("undefined");const p=l("ArrayBuffer");const g=d("string"),v=d("function"),m=d("number"),E=e=>null!==e&&"object"==typeof e,T=e=>{if("object"!==u(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},y=l("Date"),C=l("File"),w=l("Blob"),S=l("FileList"),R=l("URLSearchParams"),[b,O,I,A]=["ReadableStream","Request","Response","Headers"].map(l);function L(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),f(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function D(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:e,N=e=>!h(e)&&e!==P;const x=(k="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>k&&e instanceof k);var k;const _=l("HTMLFormElement"),U=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),M=l("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};L(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const B=l("AsyncFunction"),j=(G="function"==typeof r,H=v(P.postMessage),G?r:H?(q="axios@"+Math.random(),V=[],P.addEventListener("message",({source:e,data:t})=>{e===P&&t===q&&V.length&&V.shift()()},!1),e=>{V.push(e),P.postMessage(q,"*")}):e=>setTimeout(e));var G,H,q,V;const W="undefined"!=typeof queueMicrotask?queueMicrotask.bind(P):void 0!==o&&o.nextTick||j;t.a={isArray:f,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&v(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||v(e.append)&&("formdata"===(t=u(e))||"object"===t&&v(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:g,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:E,isPlainObject:T,isReadableStream:b,isRequest:O,isResponse:I,isHeaders:A,isUndefined:h,isDate:y,isFile:C,isBlob:w,isRegExp:M,isFunction:v,isStream:e=>E(e)&&v(e.pipe),isURLSearchParams:R,isTypedArray:x,isFileList:S,forEach:L,merge:function e(){const{caseless:t}=N(this)&&this||{},n={},r=(r,o)=>{const i=t&&D(n,o)||o;T(n[i])&&T(r)?n[i]=e(n[i],r):T(r)?n[i]=e({},r):f(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&L(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(L(t,(t,r)=>{n&&v(t)?e[r]=Object(i.a)(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:_,hasOwnProperty:U,hasOwnProp:U,reduceDescriptors:F,freezeMethods:e=>{F(e,(t,n)=>{if(v(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];v(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return f(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:D,global:P,isContextDefined:N,isSpecCompliantForm:function(e){return!!(e&&v(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(E(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=f(e)?[]:{};return L(e,(e,t)=>{const i=n(e,r+1);!h(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:B,isThenable:e=>e&&(E(e)||v(e))&&v(e.then)&&v(e.catch),setImmediate:j,asap:W}}).call(this,n(7),n(33).setImmediate,n(14))},function(e,t,n){"use strict";var r=n(0);function o(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}r.a.inherits(o,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r.a.toJSONObject(this.config),code:this.code,status:this.status}}});const i=o.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{a[e]={value:e}}),Object.defineProperties(o,a),Object.defineProperty(i,"isAxiosError",{value:!0}),o.from=(e,t,n,a,s,u)=>{const c=Object.create(i);return r.a.toFlatObject(e,c,(function(e){return e!==Error.prototype}),e=>"isAxiosError"!==e),o.call(c,e.message,t,n,a,s),c.cause=e,c.name=e.name,u&&Object.assign(c,u),c},t.a=o},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(1),i=n(12);function a(e){return r.a.isPlainObject(e)||r.a.isArray(e)}function s(e){return r.a.endsWith(e,"[]")?e.slice(0,-2):e}function u(e,t,n){return e?e.concat(t).map((function(e,t){return e=s(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const c=r.a.toFlatObject(r.a,{},null,(function(e){return/^is[A-Z]/.test(e)}));t.a=function(t,n,l){if(!r.a.isObject(t))throw new TypeError("target must be an object");n=n||new(i.a||FormData);const d=(l=r.a.toFlatObject(l,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!r.a.isUndefined(t[e])}))).metaTokens,f=l.visitor||m,h=l.dots,p=l.indexes,g=(l.Blob||"undefined"!=typeof Blob&&Blob)&&r.a.isSpecCompliantForm(n);if(!r.a.isFunction(f))throw new TypeError("visitor must be a function");function v(t){if(null===t)return"";if(r.a.isDate(t))return t.toISOString();if(!g&&r.a.isBlob(t))throw new o.a("Blob is not supported. Use a Buffer instead.");return r.a.isArrayBuffer(t)||r.a.isTypedArray(t)?g&&"function"==typeof Blob?new Blob([t]):e.from(t):t}function m(e,t,o){let i=e;if(e&&!o&&"object"==typeof e)if(r.a.endsWith(t,"{}"))t=d?t:t.slice(0,-2),e=JSON.stringify(e);else if(r.a.isArray(e)&&function(e){return r.a.isArray(e)&&!e.some(a)}(e)||(r.a.isFileList(e)||r.a.endsWith(t,"[]"))&&(i=r.a.toArray(e)))return t=s(t),i.forEach((function(e,o){!r.a.isUndefined(e)&&null!==e&&n.append(!0===p?u([t],o,h):null===p?t:t+"[]",v(e))})),!1;return!!a(e)||(n.append(u(o,t,h),v(e)),!1)}const E=[],T=Object.assign(c,{defaultVisitor:m,convertValue:v,isVisitable:a});if(!r.a.isObject(t))throw new TypeError("data must be an object");return function e(t,o){if(!r.a.isUndefined(t)){if(-1!==E.indexOf(t))throw Error("Circular reference detected in "+o.join("."));E.push(t),r.a.forEach(t,(function(t,i){!0===(!(r.a.isUndefined(t)||null===t)&&f.call(n,t,r.a.isString(i)?i.trim():i,o,T))&&e(t,o?o.concat(i):[i])})),E.pop()}}(t),n}}).call(this,n(35).Buffer)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r,o,i,a,s,u,c,l;Object.defineProperty(t,"__esModule",{value:!0}),t.SDKError=t.LiveChatVersion=t.OCSDKTelemetryEvent=t.ChannelId=t.OperatingSystem=t.DeviceType=t.Browser=t.BrowserVendor=void 0,t.BrowserVendor=r,function(e){e.IE="IE",e.CHROME="Chrome",e.FIREFOX="Firefox",e.SAFARI="Safari",e.EDGE="Edge",e.EDGE_CHROMIUM="Edg",e.OPERA="Opera",e.UNKNOWN="Unknown"}(r||(t.BrowserVendor=r={})),t.Browser=o,function(e){e[e.Chrome=0]="Chrome",e[e.Firefox=1]="Firefox",e[e.Ie=2]="Ie",e[e.Edge=3]="Edge",e[e.Safari=4]="Safari",e[e.None=5]="None"}(o||(t.Browser=o={})),t.DeviceType=i,function(e){e.Desktop="Desktop",e.Mobile="Mobile",e.Tablet="Tablet"}(i||(t.DeviceType=i={})),t.OperatingSystem=a,function(e){e.WINDOWS="Windows",e.MACOSX="Mac OS X",e.WINDOWS_PHONE="Windows Phone",e.WINDOWS_RT="Windows RT",e.IOS="iOS",e.ANDROID="Android",e.LINUX="Linux",e.UNKNOWN="Unknown"}(a||(t.OperatingSystem=a={})),t.ChannelId=s,function(e){e.LCW="lcw",e.SMS="sms",e.FACEBOOK="facebook",e.WECHAT="wechat"}(s||(t.ChannelId=s={})),t.OCSDKTelemetryEvent=u,function(e){e.GETLCWFCSDETAILSSTARTED="GetLcwFcsDetailsStarted",e.GETLCWFCSDETAILSSUCCEEDED="GetLcwFcsDetailsSucceeded",e.GETLCWFCSDETAILSFAILED="GetLcwFcsDetailsFailed",e.GETCHATCONFIGFSTARTED="GetChatConfig",e.GETCHATCONFIGSUCCEEDED="GetChatConfigSucceeded",e.GETCHATCONFIGFAILED="GetChatConfigFailed",e.GETRECONNECTABLECHATSSTARTED="GetReconnnectableChatsStarted",e.GETRECONNECTABLECHATSSUCCEEDED="GetReconnnectableChatsSucceeded",e.GETRECONNECTABLECHATSFAILED="GetReconnnectableChatsFailed",e.GETRECONNECTAVAILABILITYSUCCEEDED="GetReconnnectableAvailabilitySucceeded",e.GETRECONNECTAVAILABILITYSTARTED="GetReconnnectableAvailabilityStarted",e.GETRECONNECTAVAILABILITYFAILED="GetReconnnectableAvailabilityFailed",e.GETCHATTOKENSTARTED="GetChatTokenStarted",e.GETCHATTOKENSUCCEEDED="GetChatTokenSucceeded",e.GETCHATTOKENFAILED="GetChatTokenFailed",e.GETLWISTATUSSTARTED="GetLwiStatusStarted",e.GETLWISTATUSSUCCEEDED="GetLwiStatusSucceeded",e.GETLWISTATUSFAILED="GetLwiStatusFailed",e.SESSIONINITSTARTED="SessionInitStarted",e.SESSIONINITSUCCEEDED="SessionInitSucceeded",e.SESSIONINITFAILED="SessionInitFailed",e.CREATESESSIONSTARTED="CreateSessionStarted",e.CREATESESSIONSUCCEEDED="CreateSessionSucceeded",e.CREATESESSIONFAILED="CreateSessionFailed",e.SESSIONCLOSESTARTED="SessionCloseStarted",e.SESSIONCLOSESUCCEEDED="SessionCloseSucceeded",e.SESSIONCLOSEFAILED="SessionCloseFailed",e.SUBMITPOSTCHATSTARTED="SubmitPostChatStarted",e.SUBMITPOSTCHATSUCCEEDED="SubmitPostChatSucceeded",e.SUBMITPOSTCHATFAILED="SubmitPostChatFailed",e.GETCHATTRANSCRIPTSTARTED="GetChatTranscriptStarted",e.GETCHATTRANSCRIPTSUCCEEDED="GetChatTranscriptSucceeded",e.GETCHATTRANSCRIPTFAILED="GetChatTranscriptFailed",e.EMAILTRANSCRIPTSTARTED="EmailTranscriptStarted",e.EMAILTRANSCRIPTSUCCEEDED="EmailTranscriptSucceeded",e.EMAILTRANSCRIPTFAILED="EmailTranscriptFailed",e.FETCHDATAMASKINGSTARTED="FetchDataMaskingStarted",e.FETCHDATAMASKINGSUCCEEDED="FetchDataMaskingSucceeded",e.FETCHDATAMASKINGFAILED="FetchDataMaskingFailed",e.SECONDARYCHANNELEVENTREQUESTSTARTED="SecondaryChannelEventRequestStarted",e.SECONDARYCHANNELEVENTREQUESTSUCCEEDED="SecondaryChannelEventRequestSucceeded",e.SECONDARYCHANNELEVENTREQUESTFAILED="SecondaryChannelEventRequestFailed",e.GETSURVEYINVITELINKSTARTED="GetSurveyInviteLinkStarted",e.GETSURVEYINVITELINKSUCCEEDED="GetSurveyInviteLinkSucceeded",e.GETSURVEYINVITELINKFAILED="GetSurveyInviteLinkFailed",e.VALIDATEAUTHCHATRECORDSTARTED="ValidateAuthChatRecordStarted",e.VALIDATEAUTHCHATRECORDSUCCEEDED="ValidateAuthChatRecordSucceeded",e.VALIDATEAUTHCHATRECORDFAILED="ValidateAuthChatRecordFailed",e.GETAGENTAVAILABILITYSTARTED="GetAgentAvailabilityStarted",e.GETAGENTAVAILABILITYSUCCEEDED="GetAgentAvailabilitySucceeded",e.GETAGENTAVAILABILITYFAILED="GetAgentAvailabilityFailed",e.SENDTYPINGINDICATORFAILED="SendTypingIndicatorFailed",e.SENDTYPINGINDICATORSUCCEEDED="SendTypingIndicatorSucceeded",e.GETPERSISTENTCHATHISTORYSTARTED="GetPersistentChatHistoryStarted",e.GETPERSISTENTCHATHISTORYSUCCEEDED="GetPersistentChatHistorySucceeded",e.GETPERSISTENTCHATHISTORYFAILED="GetPersistentChatHistoryFailed"}(u||(t.OCSDKTelemetryEvent=u={})),t.LiveChatVersion=c,function(e){e[e.V1=1]="V1",e[e.V2=2]="V2",e[e.V3=3]="V3"}(c||(t.LiveChatVersion=c={})),t.SDKError=l,function(e){e.ClientHTTPTimeoutErrorName="ClientHTTPTimeoutError",e.ClientHTTPTimeoutErrorMessage="Server took too long to respond"}(l||(t.SDKError=l={}))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=n(8),s=function e(){(0,o.default)(this,e)};t.default=s,(0,i.default)(s,"requiredOmnichannelConfigurationParameters",["orgUrl","orgId","widgetId"]),(0,i.default)(s,"defaultHeaders",{"Content-Type":"application/json"}),(0,i.default)(s,"bypassCacheHeaders",{"Cache-Control":"no-store, must-revalidate, no-cache","X-Cache-Control":"no-store"}),(0,i.default)(s,"defaultChannelId",a.ChannelId.LCW),(0,i.default)(s,"defaultLocale","en-us"),(0,i.default)(s,"noContentStatusCode",204),(0,i.default)(s,"tooManyRequestsStatusCode",429),(0,i.default)(s,"notFoundStatusCode",404),(0,i.default)(s,"badRequestStatusCode",400),(0,i.default)(s,"outOfOfficeErrorCode",705),(0,i.default)(s,"sensitiveProperties",["AuthenticatedUserToken"]),(0,i.default)(s,"transactionid","transaction-id"),(0,i.default)(s,"customerDisplayName","customerDisplayName"),(0,i.default)(s,"hiddenContentPlaceholder","*content hidden*"),(0,i.default)(s,"axiosTimeoutErrorCode","ECONNABORTED")},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a=null},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=function e(){(0,o.default)(this,e)};t.default=a,(0,i.default)(a,"authenticatedUserToken","AuthenticatedUserToken"),(0,i.default)(a,"authorization","Authorization"),(0,i.default)(a,"organizationId","OrganizationId"),(0,i.default)(a,"widgetAppId","widgetAppId"),(0,i.default)(a,"requestId","Request-Id"),(0,i.default)(a,"authCodeNonce","AuthCodeNonce"),(0,i.default)(a,"ocSessionId","Oc-Sessionid"),(0,i.default)(a,"ocUserAgent","Ms-Oc-User-Agent"),(0,i.default)(a,"correlationId","x-ms-client-request-id"),(0,i.default)(a,"pageToken","PageToken")},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,d=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(2),o=n(10);Object.defineProperty(t,"__esModule",{value:!0}),t.isRetryableError=f,t.axiosRetryHandlerWithNotFound=function(e,t){d(e,{retries:t.retries,waitTimeInMsBetweenRetries:t.waitTimeInMsBetweenRetries,shouldRetry:function(e){var n;return l(e,t.retryOn429)||(null===(n=e.response)||void 0===n?void 0:n.status)===a.default.notFoundStatusCode}})},t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var u=i?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(r,a,u):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(16)),a=r(n(9));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(e,t){var n,r,o;return!((null===(n=e.response)||void 0===n?void 0:n.status)===a.default.tooManyRequestsStatusCode&&!t)&&(f(e)||(0,i.isNetworkError)(e)||0===(null===(r=e.response)||void 0===r?void 0:r.status)||!(null!==(o=e.response)&&void 0!==o&&o.status))},d=function(e,t){void 0!==t.retryOn429&&null!==t.retryOn429||(t.retryOn429=!1),t.shouldRetry||(t.shouldRetry=function(e){return l(e,t.retryOn429)}),(0,i.default)(e,{retries:t.retries,retryCondition:t.shouldRetry,onRetry:function(e,n,r){var o=n.response,i=t.headerOverwrites;if(i&&null!=o&&o.headers){var a,s=u(i);try{for(s.s();!(a=s.n()).done;){var c=a.value,l=null==o?void 0:o.headers[c.toLocaleLowerCase()];l&&r.headers&&(r.headers[c]=l)}}catch(e){s.e(e)}finally{s.f()}}},retryDelay:function(e,n){var r,o,i,s=t.waitTimeInMsBetweenRetries,u=null==n||null===(r=n.response)||void 0===r||null===(o=r.headers)||void 0===o?void 0:o["retry-after"],c=s;if(u){var l=parseInt(u);if(isNaN(l)){var d=new Date(u),f=(new Date).getTime();d&&d instanceof Date&&isFinite(d.getTime())&&(c=Math.max(0,d.getTime()-f))}else c=l*s;return c}return(null===(i=n.response)||void 0===i?void 0:i.status)===a.default.tooManyRequestsStatusCode?5e3:Math.pow(2,e)*s}})};function f(e){return"ECONNABORTED"!==e.code&&(!e.response||429===e.response.status||e.response.status>=500&&e.response.status<=599)}var h=d;t.default=h},function(e,t,n){"use strict";n.r(t),n.d(t,"namespace",(function(){return l})),n.d(t,"isNetworkError",(function(){return d})),n.d(t,"isRetryableError",(function(){return p})),n.d(t,"isSafeRequestError",(function(){return g})),n.d(t,"isIdempotentRequestError",(function(){return v})),n.d(t,"isNetworkOrIdempotentRequestError",(function(){return m})),n.d(t,"exponentialDelay",(function(){return E})),n.d(t,"DEFAULT_OPTIONS",(function(){return T})),n.d(t,"default",(function(){return w}));var r=n(22),o=n.n(r);function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l="axios-retry";function d(e){return!e.response&&Boolean(e.code)&&!["ERR_CANCELED","ECONNABORTED"].includes(e.code)&&o()(e)}var f=["get","head","options"],h=f.concat(["put","delete"]);function p(e){return"ECONNABORTED"!==e.code&&(!e.response||e.response.status>=500&&e.response.status<=599)}function g(e){return!!e.config&&(p(e)&&-1!==f.indexOf(e.config.method))}function v(e){return!!e.config&&(p(e)&&-1!==h.indexOf(e.config.method))}function m(e){return d(e)||v(e)}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,n=Math.pow(2,e)*t,r=.2*n*Math.random();return n+r}var T={retries:3,retryCondition:m,retryDelay:function(){return 0},shouldResetTimeout:!1,onRetry:()=>{}};function y(e,t){var n=function(e,t){return u(u(u({},T),t),e[l])}(e,t);return n.retryCount=n.retryCount||0,e[l]=n,n}function C(){return(C=a((function*(e,t){var{retries:n,retryCondition:r}=e,o=e.retryCount<n&&r(t);if("object"==typeof o)try{return!1!==(yield o)}catch(e){return!1}return o}))).apply(this,arguments)}function w(e,t){return{requestInterceptorId:e.interceptors.request.use(e=>(y(e,t).lastRequestTime=Date.now(),e)),responseInterceptorId:e.interceptors.response.use(null,function(){var n=a((function*(n){var{config:r}=n;if(!r)return Promise.reject(n);var o=y(r,t);if(yield function(e,t){return C.apply(this,arguments)}(o,n)){o.retryCount+=1;var{retryDelay:i,shouldResetTimeout:a,onRetry:s}=o,u=i(o.retryCount,n);if(function(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}(e,r),!a&&r.timeout&&o.lastRequestTime){var c=Date.now()-o.lastRequestTime,l=r.timeout-c-u;if(l<=0)return Promise.reject(n);r.timeout=l}return r.transformRequest=[e=>e],yield s(o.retryCount,n,r),new Promise(t=>setTimeout(()=>t(e(r)),u))}return Promise.reject(n)}));return function(e){return n.apply(this,arguments)}}())}}w.isNetworkError=d,w.isSafeRequestError=g,w.isIdempotentRequestError=v,w.isNetworkOrIdempotentRequestError=m,w.exponentialDelay=E,w.isRetryableError=p},function(e,t,n){(function(t){var r;e.exports=(r=r||function(e,r){var o;if("undefined"!=typeof window&&window.crypto&&(o=window.crypto),"undefined"!=typeof self&&self.crypto&&(o=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(o=globalThis.crypto),!o&&"undefined"!=typeof window&&window.msCrypto&&(o=window.msCrypto),!o&&void 0!==t&&t.crypto&&(o=t.crypto),!o)try{o=n(43)}catch(e){}var i=function(){if(o){if("function"==typeof o.getRandomValues)try{return o.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof o.randomBytes)try{return o.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},u=s.lib={},c=u.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=u.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new l.init(t,e)}}),d=s.enc={},f=d.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},h=d.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},p=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},g=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,c=e.min(4*u,i);if(u){for(var d=0;d<u;d+=a)this._doProcessBlock(o,d);n=o.splice(0,u),r.sigBytes-=c}return new l.init(n,c)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),v=(u.Hasher=g.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new v.HMAC.init(e,n).finalize(t)}}}),s.algo={});return s}(Math),r)}).call(this,n(7))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=function e(){(0,o.default)(this,e)};t.default=a,(0,i.default)(a,"LiveChatConnectorPath","livechatconnector/organization"),(0,i.default)(a,"LiveChatConnectorAuthPath","livechatconnector/auth/organization"),(0,i.default)(a,"LcwFcsDetailsPath","livechatconnector/v2/lcwfcsdetails"),(0,i.default)(a,"LiveChatConfigPath","livechatconnector/config"),(0,i.default)(a,"LiveChatSessionInitPath","livechatconnector/sessioninit"),(0,i.default)(a,"LiveChatAuthSessionInitPath","livechatconnector/auth/sessioninit"),(0,i.default)(a,"LiveChatGetChatTokenPath","livechatconnector/getchattoken"),(0,i.default)(a,"LiveChatv2GetChatTokenPath","livechatconnector/v2/getchattoken"),(0,i.default)(a,"LiveChatv3GetChatTokenPath","livechatconnector/v3/getchattoken"),(0,i.default)(a,"LiveChatv4GetChatTokenPath","livechatconnector/v4/getchattoken"),(0,i.default)(a,"LiveChatv4AuthGetChatTokenPath","livechatconnector/v4/auth/getchattoken"),(0,i.default)(a,"LiveChatAuthGetChatTokenPath","livechatconnector/auth/getchattoken"),(0,i.default)(a,"LiveChatv2AuthGetChatTokenPath","livechatconnector/v2/auth/getchattoken"),(0,i.default)(a,"LiveChatv3AuthGetChatTokenPath","livechatconnector/v3/auth/getchattoken"),(0,i.default)(a,"LiveChatSessionClosePath","livechatconnector/sessionclose"),(0,i.default)(a,"LiveChatAuthSessionClosePath","livechatconnector/auth/sessionclose"),(0,i.default)(a,"LiveChatSubmitPostChatPath","survey/submitpostchat"),(0,i.default)(a,"LiveChatAuthSubmitPostChatPath","survey/auth/submitpostchat"),(0,i.default)(a,"LiveChatGetSurveyInviteLinkPath","livechatconnector/getsurveyinvite"),(0,i.default)(a,"LiveChatAuthGetSurveyInviteLinkPath","livechatconnector/auth/getsurveyinvite"),(0,i.default)(a,"LiveChatGetChatTranscriptPath","livechatconnector/getchattranscripts"),(0,i.default)(a,"LiveChatv2GetChatTranscriptPath","livechatconnector/v2/getchattranscripts"),(0,i.default)(a,"LiveChatAuthGetChatTranscriptPath","livechatconnector/auth/getchattranscripts"),(0,i.default)(a,"LiveChatv2AuthGetChatTranscriptPath","livechatconnector/v2/auth/getchattranscripts"),(0,i.default)(a,"LiveChatTranscriptEmailRequestPath","livechatconnector/createemailrequest"),(0,i.default)(a,"LiveChatAuthTranscriptEmailRequestPath","livechatconnector/auth/createemailrequest"),(0,i.default)(a,"LiveChatFetchDataMaskingInfoPath","livechatconnector/fetchdatamaskinginfo"),(0,i.default)(a,"LiveChatSecondaryChannelEventPath","livechatconnector/secondarychannelevent"),(0,i.default)(a,"LiveChatAuthSecondaryChannelEventPath","livechatconnector/auth/secondarychannelevent"),(0,i.default)(a,"LiveChatLiveWorkItemDetailsPath","livechatconnector/getliveworkitemdetails"),(0,i.default)(a,"LiveChatAuthLiveWorkItemDetailsPath","livechatconnector/auth/getliveworkitemdetails"),(0,i.default)(a,"LiveChatGetReconnectableChatsPath","livechatconnector/auth/reconnectablechats"),(0,i.default)(a,"LiveChatReconnectAvailabilityPath","livechatconnector/reconnect"),(0,i.default)(a,"LiveChatValidateAuthChatMapRecordPath","livechatconnector/auth/validateauthchatmaprecord"),(0,i.default)(a,"GetAgentAvailabilityPath","livechatconnector/auth/getagentavailability"),(0,i.default)(a,"SendTypingIndicatorPath","inbound/typingindicator/livechat/sendtypingindicator"),(0,i.default)(a,"LiveChatAuthGetPersistentChatHistoryPath","livechatconnector/auth/organization")},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidv4=void 0;t.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return Pe})),n.d(t,"Axios",(function(){return Ne})),n.d(t,"AxiosError",(function(){return xe})),n.d(t,"CanceledError",(function(){return ke})),n.d(t,"isCancel",(function(){return _e})),n.d(t,"CancelToken",(function(){return Ue})),n.d(t,"VERSION",(function(){return Me})),n.d(t,"all",(function(){return Fe})),n.d(t,"Cancel",(function(){return Be})),n.d(t,"isAxiosError",(function(){return je})),n.d(t,"spread",(function(){return Ge})),n.d(t,"toFormData",(function(){return He})),n.d(t,"AxiosHeaders",(function(){return qe})),n.d(t,"HttpStatusCode",(function(){return Ve})),n.d(t,"formToJSON",(function(){return We})),n.d(t,"getAdapter",(function(){return Ke})),n.d(t,"mergeConfig",(function(){return Ye}));var r={};n.r(r),n.d(r,"hasBrowserEnv",(function(){return m})),n.d(r,"hasStandardBrowserWebWorkerEnv",(function(){return y})),n.d(r,"hasStandardBrowserEnv",(function(){return T})),n.d(r,"navigator",(function(){return E})),n.d(r,"origin",(function(){return C}));var o=n(0),i=n(11),a=n(6);function s(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function u(e,t){this._pairs=[],e&&Object(a.a)(e,this,t)}const c=u.prototype;c.append=function(e,t){this._pairs.push([e,t])},c.toString=function(e){const t=e?function(t){return e.call(this,t,s)}:s;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var l=u;function d(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function f(e,t,n){if(!t)return e;const r=n&&n.encode||d;o.a.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let a;if(a=i?i(t,n):o.a.isURLSearchParams(t)?t.toString():new l(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}var h=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){o.a.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},p=n(1),g={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},v={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:l,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const m="undefined"!=typeof window&&"undefined"!=typeof document,E="object"==typeof navigator&&navigator||void 0,T=m&&(!E||["ReactNative","NativeScript","NS"].indexOf(E.product)<0),y="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,C=m&&window.location.href||"http://localhost";var w={...r,...v};var S=function(e){function t(e,n,r,i){let a=e[i++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),u=i>=e.length;if(a=!a&&o.a.isArray(r)?r.length:a,u)return o.a.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!s;r[a]&&o.a.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&o.a.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[a])),!s}if(o.a.isFormData(e)&&o.a.isFunction(e.entries)){const n={};return o.a.forEachEntry(e,(e,r)=>{t(function(e){return o.a.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const R={transitional:g,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=o.a.isObject(e);i&&o.a.isHTMLForm(e)&&(e=new FormData(e));if(o.a.isFormData(e))return r?JSON.stringify(S(e)):e;if(o.a.isArrayBuffer(e)||o.a.isBuffer(e)||o.a.isStream(e)||o.a.isFile(e)||o.a.isBlob(e)||o.a.isReadableStream(e))return e;if(o.a.isArrayBufferView(e))return e.buffer;if(o.a.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Object(a.a)(e,new w.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return w.isNode&&o.a.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=o.a.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Object(a.a)(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(o.a.isString(e))try{return(t||JSON.parse)(e),o.a.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||R.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(o.a.isResponse(e)||o.a.isReadableStream(e))return e;if(e&&o.a.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw p.a.from(e,p.a.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:w.classes.FormData,Blob:w.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};o.a.forEach(["delete","get","head","post","put","patch"],e=>{R.headers[e]={}});var b=R;const O=o.a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const I=Symbol("internals");function A(e){return e&&String(e).trim().toLowerCase()}function L(e){return!1===e||null==e?e:o.a.isArray(e)?e.map(L):String(e)}function D(e,t,n,r,i){return o.a.isFunction(r)?r.call(this,t,n):(i&&(t=n),o.a.isString(t)?o.a.isString(r)?-1!==t.indexOf(r):o.a.isRegExp(r)?r.test(t):void 0:void 0)}class P{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=A(t);if(!i)throw new Error("header name must be a non-empty string");const a=o.a.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=L(e))}const a=(e,t)=>o.a.forEach(e,(e,n)=>i(e,n,t));if(o.a.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(o.a.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&O[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(o.a.isHeaders(e))for(const[t,r]of e.entries())i(r,t,n);else null!=e&&i(t,e,n);return this}get(e,t){if(e=A(e)){const n=o.a.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(o.a.isFunction(t))return t.call(this,e,n);if(o.a.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=A(e)){const n=o.a.findKey(this,e);return!(!n||void 0===this[n]||t&&!D(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=A(e)){const i=o.a.findKey(n,e);!i||t&&!D(0,n[i],i,t)||(delete n[i],r=!0)}}return o.a.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!D(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return o.a.forEach(this,(r,i)=>{const a=o.a.findKey(n,i);if(a)return t[a]=L(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=L(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return o.a.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&o.a.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[I]=this[I]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=A(e);t[r]||(!function(e,t){const n=o.a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return o.a.isArray(e)?e.forEach(r):r(e),this}}P.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),o.a.reduceDescriptors(P.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),o.a.freezeMethods(P);var N=P;function x(e,t){const n=this||b,r=t||n,i=N.from(r.headers);let a=r.data;return o.a.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function k(e){return!(!e||!e.__CANCEL__)}function _(e,t,n){p.a.call(this,null==e?"canceled":e,p.a.ERR_CANCELED,t,n),this.name="CanceledError"}o.a.inherits(_,p.a,{__CANCEL__:!0});var U=_,M=n(12);function F(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new p.a("Request failed with status code "+n.status,[p.a.ERR_BAD_REQUEST,p.a.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}var B=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[a];o||(o=u),n[i]=s,r[i]=u;let l=a,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o<t)return;const f=c&&u-c;return f?Math.round(1e3*d/f):void 0}};var j=function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]};const G=(e,t,n=3)=>{let r=0;const o=B(50,250);return j(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,u=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},H=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},q=e=>(...t)=>o.a.asap(()=>e(...t));var V,W,K=w.hasStandardBrowserEnv?(V=new URL(w.origin),W=w.navigator&&/(msie|trident)/i.test(w.navigator.userAgent),e=>(e=new URL(e,w.origin),V.protocol===e.protocol&&V.host===e.host&&(W||V.port===e.port))):()=>!0,Y=w.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const s=[e+"="+encodeURIComponent(t)];o.a.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),o.a.isString(r)&&s.push("path="+r),o.a.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function z(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&r||0==n?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const J=e=>e instanceof N?{...e}:e;function X(e,t){t=t||{};const n={};function r(e,t,n,r){return o.a.isPlainObject(e)&&o.a.isPlainObject(t)?o.a.merge.call({caseless:r},e,t):o.a.isPlainObject(t)?o.a.merge({},t):o.a.isArray(t)?t.slice():t}function i(e,t,n,i){return o.a.isUndefined(t)?o.a.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function a(e,t){if(!o.a.isUndefined(t))return r(void 0,t)}function s(e,t){return o.a.isUndefined(t)?o.a.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function u(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(e,t,n)=>i(J(e),J(t),0,!0)};return o.a.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=c[r]||i,s=a(e[r],t[r],r);o.a.isUndefined(s)&&a!==u||(n[r]=s)})),n}var $=e=>{const t=X({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:a,xsrfCookieName:s,headers:u,auth:c}=t;if(t.headers=u=N.from(u),t.url=f(z(t.baseURL,t.url),e.params,e.paramsSerializer),c&&u.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),o.a.isFormData(r))if(w.hasStandardBrowserEnv||w.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(!1!==(n=u.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];u.setContentType([e||"multipart/form-data",...t].join("; "))}if(w.hasStandardBrowserEnv&&(i&&o.a.isFunction(i)&&(i=i(t)),i||!1!==i&&K(t.url))){const e=a&&s&&Y.read(s);e&&u.set(a,e)}return t};var Q="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=$(e);let i=r.data;const a=N.from(r.headers).normalize();let s,u,c,l,d,{responseType:f,onUploadProgress:h,onDownloadProgress:v}=r;function m(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let E=new XMLHttpRequest;function T(){if(!E)return;const r=N.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders());F((function(e){t(e),m()}),(function(e){n(e),m()}),{data:f&&"text"!==f&&"json"!==f?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:r,config:e,request:E}),E=null}E.open(r.method.toUpperCase(),r.url,!0),E.timeout=r.timeout,"onloadend"in E?E.onloadend=T:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(T)},E.onabort=function(){E&&(n(new p.a("Request aborted",p.a.ECONNABORTED,e,E)),E=null)},E.onerror=function(){n(new p.a("Network Error",p.a.ERR_NETWORK,e,E)),E=null},E.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||g;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new p.a(t,o.clarifyTimeoutError?p.a.ETIMEDOUT:p.a.ECONNABORTED,e,E)),E=null},void 0===i&&a.setContentType(null),"setRequestHeader"in E&&o.a.forEach(a.toJSON(),(function(e,t){E.setRequestHeader(t,e)})),o.a.isUndefined(r.withCredentials)||(E.withCredentials=!!r.withCredentials),f&&"json"!==f&&(E.responseType=r.responseType),v&&([c,d]=G(v,!0),E.addEventListener("progress",c)),h&&E.upload&&([u,l]=G(h),E.upload.addEventListener("progress",u),E.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{E&&(n(!t||t.type?new U(null,e,E):t),E.abort(),E=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===w.protocols.indexOf(y)?n(new p.a("Unsupported protocol "+y+":",p.a.ERR_BAD_REQUEST,e)):E.send(i||null)}))};var Z=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof p.a?t:new U(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,i(new p.a(`timeout ${t} of ms exceeded`,p.a.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=()=>o.a.asap(s),u}};const ee=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},te=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ne=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of te(e))yield*ee(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},re="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,oe=re&&"function"==typeof ReadableStream,ie=re&&("function"==typeof TextEncoder?(ae=new TextEncoder,e=>ae.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var ae;const se=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ue=oe&&se(()=>{let e=!1;const t=new Request(w.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ce=oe&&se(()=>o.a.isReadableStream(new Response("").body)),le={stream:ce&&(e=>e.body)};var de;re&&(de=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!le[e]&&(le[e]=o.a.isFunction(de[e])?t=>t[e]():(t,n)=>{throw new p.a(`Response type '${e}' is not supported`,p.a.ERR_NOT_SUPPORT,n)})}));const fe=async(e,t)=>{const n=o.a.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(o.a.isBlob(e))return e.size;if(o.a.isSpecCompliantForm(e)){const t=new Request(w.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return o.a.isArrayBufferView(e)||o.a.isArrayBuffer(e)?e.byteLength:(o.a.isURLSearchParams(e)&&(e+=""),o.a.isString(e)?(await ie(e)).byteLength:void 0)})(t):n};var he=re&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:s,onDownloadProgress:u,onUploadProgress:c,responseType:l,headers:d,withCredentials:f="same-origin",fetchOptions:h}=$(e);l=l?(l+"").toLowerCase():"text";let g,v=Z([i,a&&a.toAbortSignal()],s);const m=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let E;try{if(c&&ue&&"get"!==n&&"head"!==n&&0!==(E=await fe(d,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(o.a.isFormData(r)&&(e=n.headers.get("content-type"))&&d.setContentType(e),n.body){const[e,t]=H(E,G(q(c)));r=ne(n.body,65536,e,t)}}o.a.isString(f)||(f=f?"include":"omit");const i="credentials"in Request.prototype;g=new Request(t,{...h,signal:v,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:i?f:void 0});let a=await fetch(g);const s=ce&&("stream"===l||"response"===l);if(ce&&(u||s&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=a[t]});const t=o.a.toFiniteNumber(a.headers.get("content-length")),[n,r]=u&&H(t,G(q(u),!0))||[];a=new Response(ne(a.body,65536,n,()=>{r&&r(),m&&m()}),e)}l=l||"text";let p=await le[o.a.findKey(le,l)||"text"](a,e);return!s&&m&&m(),await new Promise((t,n)=>{F(t,n,{data:p,headers:N.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:g})})}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new p.a("Network Error",p.a.ERR_NETWORK,e,g),{cause:t.cause||t});throw p.a.from(t,t&&t.code,e,g)}});const pe={http:M.a,xhr:Q,fetch:he};o.a.forEach(pe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const ge=e=>"- "+e,ve=e=>o.a.isFunction(e)||null===e||!1===e;var me=e=>{e=o.a.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o<t;o++){let t;if(n=e[o],r=n,!ve(n)&&(r=pe[(t=String(n)).toLowerCase()],void 0===r))throw new p.a(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+o]=r}if(!r){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let n=t?e.length>1?"since :\n"+e.map(ge).join("\n"):" "+ge(e[0]):"as no adapter specified";throw new p.a("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new U(null,e)}function Te(e){Ee(e),e.headers=N.from(e.headers),e.data=x.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return me(e.adapter||b.adapter)(e).then((function(t){return Ee(e),t.data=x.call(e,e.transformResponse,t),t.headers=N.from(t.headers),t}),(function(t){return k(t)||(Ee(e),t&&t.response&&(t.response.data=x.call(e,e.transformResponse,t.response),t.response.headers=N.from(t.response.headers))),Promise.reject(t)}))}const ye={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ye[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ce={};ye.transitional=function(e,t,n){function r(e,t){return"[Axios v1.8.2] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new p.a(r(o," has been removed"+(t?" in "+t:"")),p.a.ERR_DEPRECATED);return t&&!Ce[o]&&(Ce[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},ye.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var we={assertOptions:function(e,t,n){if("object"!=typeof e)throw new p.a("options must be an object",p.a.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new p.a("option "+i+" must be "+n,p.a.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new p.a("Unknown option "+i,p.a.ERR_BAD_OPTION)}},validators:ye};const Se=we.validators;class Re{constructor(e){this.defaults=e,this.interceptors={request:new h,response:new h}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=X(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&we.assertOptions(n,{silentJSONParsing:Se.transitional(Se.boolean),forcedJSONParsing:Se.transitional(Se.boolean),clarifyTimeoutError:Se.transitional(Se.boolean)},!1),null!=r&&(o.a.isFunction(r)?t.paramsSerializer={serialize:r}:we.assertOptions(r,{encode:Se.function,serialize:Se.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),we.assertOptions(t,{baseUrl:Se.spelling("baseURL"),withXsrfToken:Se.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&o.a.merge(i.common,i[t.method]);i&&o.a.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=N.concat(a,i);const s=[];let u=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,f=0;if(!u){const e=[Te.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),d=e.length,l=Promise.resolve(t);f<d;)l=l.then(e[f++],e[f++]);return l}d=s.length;let h=t;for(f=0;f<d;){const e=s[f++],t=s[f++];try{h=e(h)}catch(e){t.call(this,e);break}}try{l=Te.call(this,h)}catch(e){return Promise.reject(e)}for(f=0,d=c.length;f<d;)l=l.then(c[f++],c[f++]);return l}getUri(e){return f(z((e=X(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}o.a.forEach(["delete","get","head","options"],(function(e){Re.prototype[e]=function(t,n){return this.request(X(n||{},{method:e,url:t,data:(n||{}).data}))}})),o.a.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(X(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Re.prototype[e]=t(),Re.prototype[e+"Form"]=t(!0)}));var be=Re;class Oe{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new U(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Oe((function(t){e=t})),cancel:e}}}var Ie=Oe;const Ae={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ae).forEach(([e,t])=>{Ae[t]=e});var Le=Ae;const De=function e(t){const n=new be(t),r=Object(i.a)(be.prototype.request,n);return o.a.extend(r,be.prototype,n,{allOwnKeys:!0}),o.a.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(X(t,n))},r}(b);De.Axios=be,De.CanceledError=U,De.CancelToken=Ie,De.isCancel=k,De.VERSION="1.8.2",De.toFormData=a.a,De.AxiosError=p.a,De.Cancel=De.CanceledError,De.all=function(e){return Promise.all(e)},De.spread=function(e){return function(t){return e.apply(null,t)}},De.isAxiosError=function(e){return o.a.isObject(e)&&!0===e.isAxiosError},De.mergeConfig=X,De.AxiosHeaders=N,De.formToJSON=e=>S(o.a.isHTMLForm(e)?new FormData(e):e),De.getAdapter=me,De.HttpStatusCode=Le,De.default=De;var Pe=De;const{Axios:Ne,AxiosError:xe,CanceledError:ke,isCancel:_e,CancelToken:Ue,VERSION:Me,all:Fe,Cancel:Be,isAxiosError:je,spread:Ge,toFormData:He,AxiosHeaders:qe,HttpStatusCode:Ve,formToJSON:We,getAdapter:Ke,mergeConfig:Ye}=Pe},function(e,t,n){"use strict";const r=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);e.exports=e=>!r.has(e&&e.code)},function(e,t,n){"use strict";(function(e){var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"SDKProvider",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"uuidv4",{enumerable:!0,get:function(){return s.uuidv4}});var o=r(n(24)),i=r(n(25)),a=r(n(26)),s=n(20);!function(){if(void 0===e.window&&(e.window=e),!window)throw new Error("window object not found");"Microsoft"in window||(window.Microsoft={}),"CRM"in window.Microsoft||(window.Microsoft.CRM={}),"Omnichannel"in window.Microsoft.CRM||(window.Microsoft.CRM.Omnichannel={}),"SDK"in window.Microsoft.CRM.Omnichannel||(window.Microsoft.CRM.Omnichannel.SDK={SDKProvider:a.default,Util:{uuidv4:s.uuidv4}}),window.document&&o.default.raiseCustomEvent(i.default.OCSDKLOAD)}()}).call(this,n(7))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"raiseCustomEvent",value:function(t,n){var r=e.createCustomEvent(t,n);window.dispatchEvent(r)}},{key:"createCustomEvent",value:function(e,t){var n=t?{detail:t}:void 0,r=null;try{r=new CustomEvent(e,n)}catch(t){(r=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n)}return r}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"OCSDKLOAD",get:function(){return"oc:sdk:load"}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=r(n(9)),s=r(n(27)),u=r(n(29)),c=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getSDK",value:function(e,t,n){var r=new s.default(n);return new u.default({channelId:e.channelId||a.default.defaultChannelId,orgId:e.orgId,orgUrl:e.orgUrl,widgetId:e.widgetId},t||{},r)}}]),e}();t.default=c},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=r(n(5)),s=r(n(28)),u=function(){function e(t){(0,o.default)(this,e),(0,a.default)(this,"logger",void 0),this.logger=t}return(0,i.default)(e,[{key:"log",value:function(e,t,n,r){if(this.isLoggingEnabled()){var o=s.default.GETTELEMETRYEVENTDATA(t,n,r);this.logEvent(e,o)}}},{key:"logEvent",value:function(e,t){this.isLoggingEnabled()&&this.logger.logClientSdkTelemetryEvent(e,t)}},{key:"isLoggingEnabled",value:function(){return!this.isNullOrUndefined(this.logger)}},{key:"isNullOrUndefined",value:function(e){return null==e}}]),e}();t.default=u},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"GETTELEMETRYEVENTDATA",value:function(e,t,n){return{Description:n,ElapsedTimeInMilliseconds:t.ElapsedTimeInMilliseconds,HttpRequestResponseTime:t.HttpRequestResponseTime,Event:e,ExceptionDetails:t.ExceptionDetails,Region:t.Region,RequestId:t.RequestId,TransactionId:t.TransactionId,RequestHeaders:t.RequestHeaders,RequestPayload:t.RequestPayload,RequestPath:t.RequestPath,RequestMethod:t.RequestMethod,ResponseStatusCode:t.ResponseStatusCode,ResponseErrorcode:t.ResponseErrorcode,AuthTokenDetails:t.AuthTokenDetails}}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(2),o=n(10);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(30)),a=r(n(32)),s=r(n(10)),u=r(n(3)),c=r(n(4)),l=r(n(5)),d=n(8),f=r(n(21)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var n=x(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(15)),p=n(39),g=r(n(9)),v=n(40),m=n(41),E=r(n(42)),T=r(n(44)),y=n(45),C=n(46),w=n(47),S=r(n(18)),R=r(n(13)),b=r(n(48)),O=n(49),I=n(50),A=n(57),L=r(n(58)),D=r(n(59)),P=n(20),N=n(60);function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(x=function(e){return e?n:t})(e)}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){(0,l.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var F=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.defaultConfiguration,o=arguments.length>2?arguments[2]:void 0;(0,u.default)(this,e),this.omnichannelConfiguration=t,this.configuration=r,this.logger=o,(0,l.default)(this,"liveChatVersion",void 0),(0,l.default)(this,"sessionId",void 0),(0,l.default)(this,"ocUserAgent",void 0),(0,l.default)(this,"HTTPTimeOutErrorMessage","".concat(d.SDKError.ClientHTTPTimeoutErrorName,": ").concat(d.SDKError.ClientHTTPTimeoutErrorMessage)),(0,l.default)(this,"setAuthCodeNonce",(function(e){null!=e&&e.authcodenonce&&(n.configuration.authCodeNonce=null==e?void 0:e.authcodenonce)})),(0,l.default)(this,"setSessionIdHeader",(function(e,t){e&&(t[R.default.ocSessionId]=e)})),(0,l.default)(this,"setRequestIdHeader",(function(e,t){e&&(t[R.default.requestId]=e)})),(0,l.default)(this,"setCorrelationIdInHeader",(function(e,t){e&&(t[R.default.correlationId]=e)})),Object.keys(this.configuration).length&&"object"===(0,s.default)(r)||(this.configuration=e.defaultConfiguration);for(var i=0,a=Object.keys(e.defaultConfiguration);i<a.length;i++){var c=a[i];this.configuration.hasOwnProperty(c)||(this.configuration["".concat(c)]=e.defaultConfiguration["".concat(c)])}for(var f=0,h=Object.keys(e.defaultConfiguration.requestTimeoutConfig);f<h.length;f++){var p=h[f];this.configuration.requestTimeoutConfig.hasOwnProperty(p)||(this.configuration.requestTimeoutConfig["".concat(p)]=e.defaultConfiguration.requestTimeoutConfig["".concat(p)])}var v=t.channelId;if(!Object.values(d.ChannelId).includes(v))throw new Error("Invalid channelId");var m,E=Object.keys(t),T=U(g.default.requiredOmnichannelConfigurationParameters);try{for(T.s();!(m=T.n()).done;){var y=m.value;if(!E.includes(y))throw new Error("Missing '".concat(y,"' in OmnichannelConfiguration"))}}catch(e){T.e(e)}finally{T.f()}this.ocUserAgent=this.configuration.ocUserAgent,this.liveChatVersion=d.LiveChatVersion.V2}var t,n,r,o,N,x,k,M,F,B,j,G,H,q,V,W,K,Y,z;return(0,c.default)(e,[{key:"getLcwFcsDetails",value:(z=(0,a.default)(i.default.mark((function e(){var t,n,r,o,a,s,u,c,l,p,g,v,m,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLCWFCSDETAILSSTARTED,"Get LCW FCS details started",""),n="/".concat(S.default.LcwFcsDetailsPath,"/").concat(this.omnichannelConfiguration.orgId),r="GET",o="".concat(this.omnichannelConfiguration.orgUrl).concat(n),a=f.default.create(),(0,h.default)(a,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatConfig}),s={},(0,I.addOcUserAgentHeader)(this.ocUserAgent,s),u=O.Timer.TIMER(),e.prev=10,e.next=13,a.get(o,{headers:s,timeout:null!==(c=this.configuration.defaultRequestTimeout)&&void 0!==c?c:this.configuration.requestTimeoutConfig.getChatConfig});case 13:return l=e.sent,p=u.milliSecondsElapsed,g=t.milliSecondsElapsed,v=l.data,this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLCWFCSDETAILSSUCCEEDED,"Get LCW FCS details succeeded","",l,g,n,r,void 0,void 0,s,p),e.abrupt("return",v);case 21:throw e.prev=21,e.t0=e.catch(10),m=u.milliSecondsElapsed,E=t.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETLCWFCSDETAILSFAILED,"Get LCW FCS details failed","",void 0,E,n,r,e.t0,void 0,s,m),e.t0;case 27:case"end":return e.stop()}}),e,this,[[10,21]])}))),function(){return z.apply(this,arguments)})},{key:"getChatConfig",value:(Y=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,s,u,c,l,p,v,m,E,T,C,w,R=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=R.length>1&&void 0!==R[1]&&R[1],r=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATCONFIGFSTARTED,"Get Chat config started",t),t||(t=(0,P.uuidv4)()),o="/".concat(S.default.LiveChatConfigPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"?requestId=").concat(t,"&channelId=").concat(this.omnichannelConfiguration.channelId),a="GET",s="".concat(this.omnichannelConfiguration.orgUrl).concat(o),u=f.default.create(),(0,h.default)(u,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatConfig}),c={},this.addDefaultHeaders(t,c),n&&(c=_(_({},g.default.bypassCacheHeaders),c)),l=O.Timer.TIMER(),e.prev=13,e.next=16,u.get(s,{headers:c,timeout:null!==(p=this.configuration.defaultRequestTimeout)&&void 0!==p?p:this.configuration.requestTimeoutConfig.getChatConfig});case 16:return v=e.sent,m=l.milliSecondsElapsed,E=r.milliSecondsElapsed,(T=v.data).LiveChatVersion&&(this.liveChatVersion=T.LiveChatVersion),T.headers={},v.headers&&v.headers.date&&(T.headers.date=v.headers.date),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATCONFIGSUCCEEDED,"Get Chat config succeeded",t,v,E,o,a,void 0,void 0,c,m),e.abrupt("return",T);case 27:return e.prev=27,e.t0=e.catch(13),C=l.milliSecondsElapsed,w=r.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETCHATCONFIGFAILED,"Get Chat config failed",t,void 0,w,o,a,e.t0,void 0,c,C),e.abrupt("return",Promise.reject(e.t0));case 33:case"end":return e.stop()}}),e,this,[[13,27]])}))),function(e){return Y.apply(this,arguments)})},{key:"getLWIDetails",value:(K=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w=this,b=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLWISTATUSSTARTED,"Get LWI Details Started",t),t||(t=(0,P.uuidv4)()),s="/".concat(S.default.LiveChatLiveWorkItemDetailsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),u=f.default.create(),(0,h.axiosRetryHandlerWithNotFound)(u,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getLWIDetails}),c=r.authenticatedUserToken,l=r.reconnectId,p=g.default.defaultHeaders,c&&(s="/".concat(S.default.LiveChatAuthLiveWorkItemDetailsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),p[R.default.authenticatedUserToken]=c,p[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,p),v=!c&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,l&&(v||(s+="/".concat(l))),m={channelId:this.omnichannelConfiguration.channelId},l&&v&&(m.sig=l),E="".concat(this.omnichannelConfiguration.orgUrl).concat(s),C={headers:p,method:T="GET",url:E,params:m,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getLWIDetails},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,c,l,f,h,v,m,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,u(C);case 4:c=e.sent,l=a.milliSecondsElapsed,f=o.milliSecondsElapsed,h=c.data,v=c.headers,w.setAuthCodeNonce(v),w.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLWISTATUSSUCCEEDED,"Get LWI Details succeeded",t,c,f,s,T,void 0,void 0,p,l),n(h),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),m=a.milliSecondsElapsed,E=o.milliSecondsElapsed,w.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETLWISTATUSFAILED,"Get LWI Details failed",t,void 0,E,s,T,e.t0,void 0,p,m),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(w.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 19:case"end":return e.stop()}}),e,this)}))),function(e){return K.apply(this,arguments)})},{key:"getChatToken",value:(W=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w,S,b,I,D,N,x=this,k=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=k.length>1&&void 0!==k[1]?k[1]:{},o=k.length>2&&void 0!==k[2]?k[2]:0,s=O.Timer.TIMER(),u=r.reconnectId,c=r.authenticatedUserToken,l=r.currentLiveChatVersion,p=r.refreshToken,v=r.MsOcBotApplicationId,m=!!(v&&v.length>0),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTOKENSTARTED,"Get Chat Token Started",t),!(o<0)){e.next=8;break}throw new Error("Invalid currentRetryCount");case 8:return t||(t=(0,P.uuidv4)()),E=g.default.defaultHeaders,this.addDefaultHeaders(t,E),T=(0,A.createGetChatTokenEndpoint)(l||this.liveChatVersion,!!c,m),c&&(E[R.default.authenticatedUserToken]=c,E[R.default.authCodeNonce]=this.configuration.authCodeNonce),C="/".concat(T,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),w=!c&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,u&&(w||(C+="/".concat(u))),S={channelId:this.omnichannelConfiguration.channelId},v&&v.length>0&&(S["Ms-Oc-Bot-Application-Id"]=v),p&&(S.refreshToken="true"),u&&w&&(S.sig=u),b="".concat(this.omnichannelConfiguration.orgUrl).concat(C),D={headers:E,method:I="GET",url:b,params:S,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getChatToken},N=f.default.create(),(0,h.default)(N,{headerOverwrites:[R.default.authCodeNonce],retries:o>this.configuration.maxRequestRetriesOnFailure?o:this.configuration.maxRequestRetriesOnFailure,retryOn429:this.configuration.getChatTokenRetryOn429,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatToken}),e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,c,l,f,h,p,v;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,N(D);case 4:if(a=e.sent,c=o.milliSecondsElapsed,l=s.milliSecondsElapsed,f=a.data,h=a.headers,x.setAuthCodeNonce(h),h&&h[R.default.ocSessionId.toLowerCase()]&&(x.sessionId=h[R.default.ocSessionId.toLowerCase()]),!f){e.next=18;break}if(0!==Object.keys(f).length){e.next=14;break}return r(new Error("Empty data received from getChatToken")),e.abrupt("return");case 14:return f.requestId=t,x.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTOKENSUCCEEDED,"Get Chat Token succeeded",t,a,l,C,I,void 0,void 0,E,c),n(f),e.abrupt("return");case 18:if(!u||a.status!==g.default.noContentStatusCode){e.next=21;break}return r(a),e.abrupt("return");case 21:e.next=30;break;case 23:e.prev=23,e.t0=e.catch(1),p=o.milliSecondsElapsed,v=s.milliSecondsElapsed,x.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETCHATTOKENFAILED,"Get Chat Token failed",t,void 0,v,C,I,e.t0,void 0,E,p),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(x.HTTPTimeOutErrorMessage)),r(e.t0);case 30:case"end":return e.stop()}}),e,null,[[1,23]])})));return function(t,n){return e.apply(this,arguments)}}()));case 26:case"end":return e.stop()}}),e,this)}))),function(e){return W.apply(this,arguments)})},{key:"getReconnectableChats",value:(V=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,h,p,v=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.Timer.TIMER(),o=t.authenticatedUserToken,this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTABLECHATSSTARTED,"Get Reconnectable chat Started"),s=null==t?void 0:t.requestId,u="/".concat(S.default.LiveChatGetReconnectableChatsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(s,"?channelId=").concat(this.omnichannelConfiguration.channelId),(c=g.default.defaultHeaders)[R.default.authenticatedUserToken]=o,c[R.default.authCodeNonce]=this.configuration.authCodeNonce,this.addDefaultHeaders(s,c),l="".concat(this.omnichannelConfiguration.orgUrl).concat(u),h={headers:c,method:"GET",url:l,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getReconnectableChats},p=f.default.create(),e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(t,n){var o,a,l,f,m,E,T,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,p(h);case 4:if(a=e.sent,l=o.milliSecondsElapsed,f=r.milliSecondsElapsed,m=a.data,E=a.headers,v.setAuthCodeNonce(E),!m){e.next=13;break}return v.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTABLECHATSSUCCEEDED,"Get Reconnectable Chats Succeeded and old session returned",s,a,f,u,"GET",void 0,void 0,c,l),t(m),e.abrupt("return");case 13:return t(),e.abrupt("return");case 17:return e.prev=17,e.t0=e.catch(1),T=o.milliSecondsElapsed,C=r.milliSecondsElapsed,v.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETRECONNECTABLECHATSFAILED,"Get Reconnectable Chats failed",s,void 0,C,u,"GET",e.t0,void 0,c,T),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&n(new Error(v.HTTPTimeOutErrorMessage)),n(e.t0),e.abrupt("return");case 25:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t,n){return e.apply(this,arguments)}}()));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return V.apply(this,arguments)})},{key:"getReconnectAvailability",value:(q=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,h,p,v=this,m=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=m.length>1&&void 0!==m[1]?m[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSTARTED,"Get Reconnectable availability Started"),s="/".concat(S.default.LiveChatReconnectAvailabilityPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),u=g.default.defaultHeaders,this.addDefaultHeaders(null==r?void 0:r.requestId,u),c="".concat(this.omnichannelConfiguration.orgUrl).concat(s),h={headers:u,method:l="GET",url:c,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getReconnectAvailability},p=f.default.create(),e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(t,n){var a,c,f,m,E,T,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,p(h);case 4:if(c=e.sent,f=a.milliSecondsElapsed,m=o.milliSecondsElapsed,!(E=c.data)){e.next=12;break}return v.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSUCCEEDED,"Get Reconnect availability succeeded",null==r?void 0:r.requestId,c,m,s,l,void 0,void 0,u,f),t(E),e.abrupt("return");case 12:return v.logWithLogger(y.LogLevel.WARN,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSUCCEEDED,"Get Reconnect availability didn't send any valid data",null==r?void 0:r.requestId,c,m,s,l,void 0,void 0,u,f),t(),e.abrupt("return");case 17:return e.prev=17,e.t0=e.catch(1),T=a.milliSecondsElapsed,C=o.milliSecondsElapsed,v.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYFAILED,"Get Reconnect Availability failed",null==r?void 0:r.requestId,void 0,C,s,l,e.t0,void 0,u,T),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&n(new Error(v.HTTPTimeOutErrorMessage)),n(e.t0),e.abrupt("return");case 25:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t,n){return e.apply(this,arguments)}}()));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return q.apply(this,arguments)})},{key:"getAgentAvailability",value:(H=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,C,I,A,D,P,N,x,k,_=this,U=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=U.length>1&&void 0!==U[1]?U[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETAGENTAVAILABILITYSTARTED,"Get agent availability Started",t),s="/".concat(S.default.GetAgentAvailabilityPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=lcw"),u=f.default.create(),(0,h.default)(u,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getAgentAvailability}),c=r.authenticatedUserToken,l=r.initContext,C=r.getContext,I=g.default.defaultHeaders,c&&(I[R.default.authenticatedUserToken]=c,I[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,I),A=l||{},D={orgId:this.omnichannelConfiguration.orgId,widgetId:this.omnichannelConfiguration.widgetId},A&&A.customContextData&&(P=v.CustomContextData.sort(A.customContextData),Object.assign(D,{customContext:P})),A.portalcontactid&&Object.assign(D,{portalcontactid:A.portalcontactid}),A.cacheKey=(0,b.default)(JSON.stringify(D)).toString(E.default),!C||window.document){e.next=17;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 17:if(C&&(A.browser=p.BrowserInfo.getBrowserName(),A.device=m.DeviceInfo.getDeviceType(),A.originurl=window.location.href,A.os=w.OSInfo.getOsType()),A.locale||(A.locale=g.default.defaultLocale),!A.locale||T.default.supportedLocales.includes(A.locale)){e.next=21;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(A.locale,"'"))));case 21:return N="".concat(this.omnichannelConfiguration.orgUrl).concat(s),k={data:A,headers:I,method:x="POST",url:N,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getAgentAvailability},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,c,l,f,h,p,v,m;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,u(k);case 4:c=e.sent,l=a.milliSecondsElapsed,f=o.milliSecondsElapsed,h=c.data,p=c.headers,_.setAuthCodeNonce(p),h&&(_.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETAGENTAVAILABILITYSUCCEEDED,"Get agent availability succeeded",t,c,f,s,x,void 0,void 0,I,l),n(h)),e.next=21;break;case 12:if(e.prev=12,e.t0=e.catch(1),v=a.milliSecondsElapsed,m=o.milliSecondsElapsed,_.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETAGENTAVAILABILITYFAILED,"Get agent availability failed",t,void 0,m,s,x,e.t0,void 0,I,v),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=20;break}return r(new Error(_.HTTPTimeOutErrorMessage)),e.abrupt("return");case 20:r(e.t0);case 21:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t,n){return e.apply(this,arguments)}}()));case 25:case"end":return e.stop()}}),e,this)}))),function(e){return H.apply(this,arguments)})},{key:"sessionInit",value:(G=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,v,E,C,b,I,A,P,N,x,k,U,M,F,B=this,j=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=j.length>1&&void 0!==j[1]?j[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONINITSTARTED,"Session Init Started",t),s=f.default.create(),u=!0,(0,h.default)(s,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionInit,shouldRetry:function(e){return(0,D.default)(e,u)},headerOverwrites:[R.default.authCodeNonce]}),c=r.reconnectId,v=r.authenticatedUserToken,E=r.initContext,C=r.getContext,b=E||{},I=_({},g.default.defaultHeaders),A=v?S.default.LiveChatAuthSessionInitPath:S.default.LiveChatSessionInitPath,P="/".concat(A,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),v&&Object.assign(I,(N={},(0,l.default)(N,R.default.authenticatedUserToken,v),(0,l.default)(N,R.default.authCodeNonce,this.configuration.authCodeNonce),N)),this.addDefaultHeaders(t,I),this.setRequestIdHeader(t,I),x=!v&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,c&&(x||(P+="/".concat(c))),k={channelId:this.omnichannelConfiguration.channelId},c&&x&&(k.sig=c),!C||window.document){e.next=20;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 20:if(C&&(b.browser=p.BrowserInfo.getBrowserName(),b.device=m.DeviceInfo.getDeviceType(),b.originurl=window.location.href,b.os=w.OSInfo.getOsType()),b.locale||(b.locale=g.default.defaultLocale),!b.locale||T.default.supportedLocales.includes(b.locale)){e.next=24;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(b.locale,"'"))));case 24:return U="".concat(this.omnichannelConfiguration.orgUrl).concat(P),F={data:b,headers:I,method:M="POST",url:U,params:k,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionInit},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,u,c,l,f,h,p;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,s(F);case 4:u=e.sent,c=a.milliSecondsElapsed,l=o.milliSecondsElapsed,f=u.headers,B.setAuthCodeNonce(f),B.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONINITSUCCEEDED,"Session Init Succeeded",t,u,l,P,M,void 0,b,I,c),n(),e.next=22;break;case 13:if(e.prev=13,e.t0=e.catch(1),h=a.milliSecondsElapsed,p=o.milliSecondsElapsed,B.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SESSIONINITFAILED,"Session Init failed",t,void 0,p,P,M,e.t0,b,I,h),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=21;break}return r(new Error(B.HTTPTimeOutErrorMessage)),e.abrupt("return");case 21:r(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 28:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"createConversation",value:(j=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,s,u,c,v,E,C,b,I,A,P,N,x,k,U,M,F,B,j,G,H,q,V=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=V.length>1&&void 0!==V[1]?V[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.CREATESESSIONSTARTED,"Create conversation call Started",t),a=f.default.create(),s=!0,(0,h.default)(a,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionInit,shouldRetry:function(e){return(0,D.default)(e,s)},headerOverwrites:[R.default.authCodeNonce]}),u=r.reconnectId,c=r.authenticatedUserToken,v=r.initContext,E=r.getContext,C=v||{},b=_({},g.default.defaultHeaders),I=c?S.default.LiveChatConnectorAuthPath:S.default.LiveChatConnectorPath,A="/".concat(I,"/").concat(this.omnichannelConfiguration.orgId,"/widgetApp/").concat(this.omnichannelConfiguration.widgetId,"/conversation"),c&&Object.assign(b,(P={},(0,l.default)(P,R.default.authenticatedUserToken,c),(0,l.default)(P,R.default.authCodeNonce,this.configuration.authCodeNonce),P)),this.addDefaultHeaders(t,b),this.setRequestIdHeader(t,b),u&&(C.reconnectId=u),C.channelId=this.omnichannelConfiguration.channelId,!E||window.document){e.next=18;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 18:if(E&&(C.browser=p.BrowserInfo.getBrowserName(),C.device=m.DeviceInfo.getDeviceType(),C.originurl=window.location.href,C.os=w.OSInfo.getOsType()),C.locale||(C.locale=g.default.defaultLocale),!C.locale||T.default.supportedLocales.includes(C.locale)){e.next=22;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(C.locale,"'"))));case 22:return N="".concat(this.omnichannelConfiguration.orgUrl).concat(A),k={data:C,headers:b,method:x="POST",url:N,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionInit},U=O.Timer.TIMER(),e.prev=26,e.next=29,a(k);case 29:if(M=e.sent,F=U.milliSecondsElapsed,B=o.milliSecondsElapsed,j=M.data,G=M.headers,this.setAuthCodeNonce(G),G&&G[R.default.ocSessionId.toLowerCase()]&&(this.sessionId=G[R.default.ocSessionId.toLowerCase()]),0!==Object.keys(j).length){e.next=37;break}throw new Error("Empty data received from getChatToken");case 37:return j.requestId=t,this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.CREATESESSIONSUCCEEDED,"Create coversation call Succeeded",t,M,B,A,x,void 0,void 0,b,F),e.abrupt("return",j);case 42:if(e.prev=42,e.t0=e.catch(26),H=U.milliSecondsElapsed,q=o.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.CREATESESSIONFAILED,"Create conversation call failed",t,void 0,q,A,x,e.t0,C,b,H),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=49;break}throw new Error(this.HTTPTimeOutErrorMessage);case 49:throw e.t0;case 50:case"end":return e.stop()}}),e,this,[[26,42]])}))),function(e){return j.apply(this,arguments)})},{key:"sessionClose",value:(B=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w,b=this,I=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=I.length>1&&void 0!==I[1]?I[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONCLOSESTARTED,"Session Close Started",t),s="/".concat(S.default.LiveChatSessionClosePath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),u=f.default.create(),(0,h.default)(u,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionClose}),c=r.authenticatedUserToken,l=r.isReconnectChat,p=r.isPersistentChat,v=r.chatId,m=g.default.defaultHeaders,(E={}).chatId=v,c&&(s="/".concat(S.default.LiveChatAuthSessionClosePath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),m[R.default.authenticatedUserToken]=c,m[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,m),l&&(s+="&isReconnectChat=true"),p&&(s+="&isPersistentChat=true"),T="".concat(this.omnichannelConfiguration.orgUrl).concat(s),w={data:E,headers:m,method:C="POST",url:T,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionClose},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,c,l,f,h,p,v;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,u(w);case 4:c=e.sent,l=a.milliSecondsElapsed,f=c.headers,b.setAuthCodeNonce(f),h=o.milliSecondsElapsed,b.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONCLOSESUCCEEDED,"Session Close succeeded",t,c,h,s,C,void 0,void 0,m,l),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),p=a.milliSecondsElapsed,v=o.milliSecondsElapsed,b.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SESSIONCLOSEFAILED,"Session close failed",t,void 0,v,s,C,e.t0,void 0,m,p),e.t0.code===g.default.axiosTimeoutErrorCode&&r(new Error(b.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return B.apply(this,arguments)})},{key:"validateAuthChatRecord",value:(F=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDSTARTED,"Validate Auth Chat Record Started",t),s=n.authenticatedUserToken,u=n.chatId,c="/".concat(S.default.LiveChatValidateAuthChatMapRecordPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(u,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=f.default.create(),(0,h.default)(l,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.validateAuthChatRecord}),p=g.default.defaultHeaders,s&&(p[R.default.authenticatedUserToken]=s,p[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,p),v="".concat(this.omnichannelConfiguration.orgUrl).concat(c),m={headers:p,method:"GET",url:v,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.validateAuthChatRecordTimeout},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,s,u,f,h,v,T,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,l(m);case 4:u=e.sent,f=a.milliSecondsElapsed,h=u.headers,E.setAuthCodeNonce(h),v=o.milliSecondsElapsed,!0===(null===(s=u.data)||void 0===s?void 0:s.authChatExist)?(E.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDSUCCEEDED,"Validate Auth Chat Record succeeded",t,u,v,c,"GET",void 0,void 0,p,f),n(u.data)):(E.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDFAILED,"Validate Auth Chat Record Failed. Record is not found or request is not authorized",t,u,v,c,"GET",void 0,void 0,p,f),r(new Error("Validate Auth Chat Record Failed. Record is not found or request is not authorized"))),e.next=19;break;case 12:e.prev=12,e.t0=e.catch(1),T=a.milliSecondsElapsed,C=o.milliSecondsElapsed,E.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDFAILED,"Validate Auth Chat Record failed",t,void 0,C,c,"GET",e.t0,void 0,p,T),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(E.HTTPTimeOutErrorMessage)),"Error: Request failed with status code 404"===e.t0.toString()?n({}):r(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t,n){return e.apply(this,arguments)}}()));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return F.apply(this,arguments)})},{key:"submitPostChatResponse",value:(M=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E,T=this,C=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=C.length>2&&void 0!==C[2]?C[2]:{},s=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SUBMITPOSTCHATSTARTED,"Submit Post Chat Started",t),u="/".concat(S.default.LiveChatSubmitPostChatPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),c=f.default.create(),(0,h.default)(c,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.submitPostChatResponse}),l=o.authenticatedUserToken,p=g.default.defaultHeaders,this.addDefaultHeaders(t,p),l&&(u="/".concat(S.default.LiveChatAuthSubmitPostChatPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),p[R.default.authenticatedUserToken]=l,p[R.default.authCodeNonce]=this.configuration.authCodeNonce),v="".concat(this.omnichannelConfiguration.orgUrl).concat(u),m="POST",E={data:JSON.stringify(n),headers:p,method:m,url:v,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.submitPostChatResponse},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,l,f,h,v,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,c(E);case 4:a=e.sent,l=o.milliSecondsElapsed,f=a.headers,T.setAuthCodeNonce(f),h=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SUBMITPOSTCHATSUCCEEDED,"Submit Post Chat succeeded",t,a,h,u,m,void 0,void 0,p,l),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),v=o.milliSecondsElapsed,C=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SUBMITPOSTCHATFAILED,"Submit Post Chat Failed",t,void 0,C,u,m,e.t0,void 0,p,v),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(T.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return M.apply(this,arguments)})},{key:"getSurveyInviteLink",value:(k=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E,T,C=this,w=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=w.length>2&&void 0!==w[2]?w[2]:{},s=O.Timer.TIMER(),this.logger&&this.logger.log(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETSURVEYINVITELINKSTARTED,{SurveyOwnerId:t},"Get Survey Invite Link Started"),u="/".concat(S.default.LiveChatGetSurveyInviteLinkPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(t),c=f.default.create(),(0,h.default)(c,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getSurveyInviteLink}),l=o.authenticatedUserToken,p=o.requestId,v=g.default.defaultHeaders,l&&(u="/".concat(S.default.LiveChatAuthGetSurveyInviteLinkPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(t),v[R.default.authenticatedUserToken]=l,v[R.default.authCodeNonce]=this.configuration.authCodeNonce,v[R.default.widgetAppId]=this.omnichannelConfiguration.widgetId),this.addDefaultHeaders(p,v),p&&(v[R.default.requestId]=p),m="".concat(this.omnichannelConfiguration.orgUrl).concat(u),E="POST",T={data:JSON.stringify(n),headers:v,method:E,url:m,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.getSurveyInviteLink},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(t,n){var r,o,a,l,f,h,m,w;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.Timer.TIMER(),e.prev=1,e.next=4,c(T);case 4:o=e.sent,a=r.milliSecondsElapsed,l=o.data,f=o.headers,C.setAuthCodeNonce(f),h=s.milliSecondsElapsed,C.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETSURVEYINVITELINKSUCCEEDED,"Get Survey Invite Link Succeeded",p,o,h,u,E,void 0,void 0,v,a),t(l),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),m=r.milliSecondsElapsed,w=s.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETSURVEYINVITELINKFAILED,"Get Survey Invite Link failed",p,void 0,w,u,E,e.t0,void 0,v,m),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&n(new Error(C.HTTPTimeOutErrorMessage)),n(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"getChatTranscripts",value:(x=(0,a.default)(i.default.mark((function e(t,n,r){var o,s,u,c,l,p,v,m,E,T,C,w=this,b=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=b.length>3&&void 0!==b[3]?b[3]:{},u=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTRANSCRIPTSTARTED,"Get Chat Transcript Started",t),c="/".concat(S.default.LiveChatGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=f.default.create(),(0,h.default)(l,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatTranscripts}),p=s.authenticatedUserToken,v=s.currentLiveChatVersion,(m=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,m[R.default.widgetAppId]=this.omnichannelConfiguration.widgetId,m[R.default.authorization]=r,this.liveChatVersion===d.LiveChatVersion.V2||v&&v===d.LiveChatVersion.V2?(c="/".concat(S.default.LiveChatv2GetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),p&&(m[R.default.authenticatedUserToken]=p,m[R.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(S.default.LiveChatv2AuthGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId))):p&&(m[R.default.authenticatedUserToken]=p,m[R.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(S.default.LiveChatAuthGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId)),this.addDefaultHeaders(t,m),E="".concat(this.omnichannelConfiguration.orgUrl).concat(c),C={headers:m,method:T="GET",url:E,timeout:null!==(o=this.configuration.defaultRequestTimeout)&&void 0!==o?o:this.configuration.requestTimeoutConfig.getChatTranscripts},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,s,f,h,p,v,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,l(C);case 4:a=e.sent,s=o.milliSecondsElapsed,f=u.milliSecondsElapsed,h=a.data,p=a.headers,w.setAuthCodeNonce(p),w.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTRANSCRIPTSUCCEEDED,"Get Chat Transcript succeeded",t,a,f,c,T,void 0,void 0,m,s),n(h),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),v=o.milliSecondsElapsed,E=u.milliSecondsElapsed,w.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETCHATTRANSCRIPTFAILED,"Get Chat Transcript failed",t,void 0,E,c,T,e.t0,void 0,m,v),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(w.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 17:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return x.apply(this,arguments)})},{key:"getPersistentChatHistory",value:(N=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w,b=this,I=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=I.length>1&&void 0!==I[1]?I[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYSTARTED,"Get Persistent Chat History Started",t),t||(t=(0,P.uuidv4)()),s=r.authenticatedUserToken,u=r.pageSize,c=r.pageToken,s){e.next=9;break}return l="Authenticated user token is required for persistent chat history",this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYFAILED,"Get Persistent Chat History failed - Missing authenticated user token",t),e.abrupt("return",Promise.reject(new Error(l)));case 9:return p="/".concat(S.default.LiveChatAuthGetPersistentChatHistoryPath,"/").concat(this.omnichannelConfiguration.orgId,"/widgetapp/").concat(this.omnichannelConfiguration.widgetId,"/conversation/history"),v=f.default.create(),(0,h.default)(v,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getPersistentChatHistory}),(m=g.default.defaultHeaders)[R.default.authenticatedUserToken]=s,m[R.default.authCodeNonce]=this.configuration.authCodeNonce,c&&(m[R.default.pageToken]=c),this.addDefaultHeaders(t,m),E={},u&&(E.pageSize=u.toString()),T="".concat(this.omnichannelConfiguration.orgUrl).concat(p),w={headers:m,method:C="GET",url:T,params:E,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getPersistentChatHistory},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,s,u,c,l,f,h,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,v(w);case 4:s=e.sent,u=a.milliSecondsElapsed,c=o.milliSecondsElapsed,l=s.data,f=s.headers,b.setAuthCodeNonce(f),b.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYSUCCEEDED,"Get Persistent Chat History succeeded",t,s,c,p,C,void 0,void 0,m,u),n(l),e.next=22;break;case 13:if(e.prev=13,e.t0=e.catch(1),h=a.milliSecondsElapsed,E=o.milliSecondsElapsed,b.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYFAILED,"Get Persistent Chat History failed",t,void 0,E,p,C,e.t0,void 0,m,h),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=21;break}return r(new Error(b.HTTPTimeOutErrorMessage)),e.abrupt("return");case 21:r(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 23:case"end":return e.stop()}}),e,this)}))),function(e){return N.apply(this,arguments)})},{key:"emailTranscript",value:(o=(0,a.default)(i.default.mark((function e(t,n,r){var o,s,u,c,l,p,v,m,E,T,C=this,w=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=w.length>3&&void 0!==w[3]?w[3]:{},u=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.EMAILTRANSCRIPTSTARTED,"Email Transcript Started",t),c="/".concat(S.default.LiveChatTranscriptEmailRequestPath,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=f.default.create(),(0,h.default)(l,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.emailTranscript}),p=s.authenticatedUserToken,(v=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,v[R.default.widgetAppId]=this.omnichannelConfiguration.widgetId,v[R.default.authorization]=n,p&&(v[R.default.authenticatedUserToken]=p,v[R.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(S.default.LiveChatAuthTranscriptEmailRequestPath,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId)),this.addDefaultHeaders(t,v),m="".concat(this.omnichannelConfiguration.orgUrl).concat(c),E="POST",T={data:JSON.stringify(r),headers:v,method:E,url:m,timeout:null!==(o=this.configuration.defaultRequestTimeout)&&void 0!==o?o:this.configuration.requestTimeoutConfig.emailTranscript},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,s,f,h,p,m;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,l(T);case 4:a=e.sent,s=o.milliSecondsElapsed,f=a.headers,C.setAuthCodeNonce(f),h=u.milliSecondsElapsed,C.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.EMAILTRANSCRIPTSUCCEEDED,"Email Transcript succeeded",t,a,h,c,E,void 0,void 0,v,s),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),p=o.milliSecondsElapsed,m=u.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.EMAILTRANSCRIPTFAILED,"Email Transcript Failed",t,void 0,m,c,E,e.t0,void 0,v,p),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(C.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 17:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"fetchDataMaskingInfo",value:(r=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.FETCHDATAMASKINGSTARTED,"Fetch Data Masking Started",t),t||(t=(0,P.uuidv4)()),o="/".concat(S.default.LiveChatFetchDataMaskingInfoPath,"/").concat(this.omnichannelConfiguration.orgId),s=f.default.create(),(0,h.default)(s,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.fetchDataMaskingInfo}),(u=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,u[R.default.requestId]=t,this.addDefaultHeaders(t,u),c="".concat(this.omnichannelConfiguration.orgUrl).concat(o),l={headers:u,method:"GET",url:c,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.fetchDataMaskingInfo},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,a){var c,f,h,v,m,E,T;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=O.Timer.TIMER(),e.prev=1,e.next=4,s(l);case 4:f=e.sent,h=c.milliSecondsElapsed,v=r.milliSecondsElapsed,m=f.data,p.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.FETCHDATAMASKINGSUCCEEDED,"Fetch Data Masking succeeded",t,f,v,o,"GET",void 0,void 0,u,h),n(m),e.next=19;break;case 12:e.prev=12,e.t0=e.catch(1),E=c.milliSecondsElapsed,T=r.milliSecondsElapsed,p.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.FETCHDATAMASKINGFAILED,"Fetch Data Masking Failed",t,void 0,T,o,"GET",e.t0,void 0,u,E),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&a(new Error(p.HTTPTimeOutErrorMessage)),a(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t,n){return e.apply(this,arguments)}}()));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"makeSecondaryChannelEventRequest",value:(n=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E,T=this,C=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=C.length>2&&void 0!==C[2]?C[2]:{},s=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTSTARTED,"Secondary Channel Event Request Started",t),u="/".concat(S.default.LiveChatSecondaryChannelEventPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),c=f.default.create(),(0,h.default)(c,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.makeSecondaryChannelEventRequest}),l=o.authenticatedUserToken,(p=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,l&&(p[R.default.authenticatedUserToken]=l,p[R.default.authCodeNonce]=this.configuration.authCodeNonce,u="/".concat(S.default.LiveChatAuthSecondaryChannelEventPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t)),this.addDefaultHeaders(t,p),u+="?channelId="+g.default.defaultChannelId,v="".concat(this.omnichannelConfiguration.orgUrl).concat(u),m="POST",E={data:JSON.stringify(n),headers:p,method:m,url:v,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.makeSecondaryChannelEventRequest},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,l,f,h,v,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,c(E);case 4:a=e.sent,l=o.milliSecondsElapsed,f=a.headers,T.setAuthCodeNonce(f),h=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTSUCCEEDED,"Secondary Channel Event Request Succeeded",t,a,h,u,m,void 0,void 0,p,l),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),v=o.milliSecondsElapsed,C=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTFAILED,"Secondary Channel Event Request Failed",t,void 0,C,u,m,e.t0,void 0,p,v),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(T.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"sendTypingIndicator",value:(t=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,h,p,v,m,E=this,T=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=T.length>2&&void 0!==T[2]?T[2]:{},n&&n===d.LiveChatVersion.V2){e.next=3;break}return e.abrupt("return",Promise.resolve());case 3:if(s=O.Timer.TIMER(),u=o.customerDisplayName,n&&n===d.LiveChatVersion.V2){e.next=7;break}throw new Error("Typing indicator is only supported on v2");case 7:return c="/".concat(S.default.SendTypingIndicatorPath,"/").concat(t),l=f.default.create(),(h=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,u&&(h[g.default.customerDisplayName]=u),this.addDefaultHeaders(t,h),p="".concat(this.omnichannelConfiguration.orgUrl).concat(c),m={headers:h,method:v="POST",url:p,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.sendTypingIndicator},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,u,f,p,T;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,l(m);case 4:a=e.sent,u=o.milliSecondsElapsed,f=s.milliSecondsElapsed,E.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SENDTYPINGINDICATORSUCCEEDED,"Send Typing Indicator Succeeded",t,a,f,c,v,void 0,void 0,h,u),n(),e.next=18;break;case 11:e.prev=11,e.t0=e.catch(1),p=o.milliSecondsElapsed,T=s.milliSecondsElapsed,E.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SENDTYPINGINDICATORFAILED,"Send Typing Indicator Failed",t,void 0,T,c,v,e.t0,void 0,h,p),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(E.HTTPTimeOutErrorMessage)),r(e.t0);case 18:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t,n){return e.apply(this,arguments)}}()));case 17:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"logWithLogger",value:function(e,t,n,r,o,i,a,s,u,c,l,d){var f,h,p,v;if(this.logger){u&&C.LoggingSanitizer.stripErrorSensitiveProperties(u);var m=void 0;c&&((m=_({},c)).customContextData&&C.LoggingSanitizer.stripCustomContextDataValues(m.customContextData),m.preChatResponse&&C.LoggingSanitizer.stripPreChatResponse(m.preChatResponse),C.LoggingSanitizer.stripGeolocation(m));var E=void 0,T=void 0;if(l&&(E=_({},l),C.LoggingSanitizer.stripRequestHeadersSensitiveProperties(E),l[R.default.authenticatedUserToken]&&window.document&&window.atob))try{var y=l[R.default.authenticatedUserToken].split(".")[1],w=window.atob(y),S=JSON.parse(w),b=S.lwicontexts;if(T={sub:S.sub,exp:S.exp},b){var O=JSON.parse(b);C.LoggingSanitizer.stripCustomContextDataValues(O),T.lwiContexts=O}}catch(e){}var I={RequestId:r,Region:null==o?void 0:o.data.Region,ElapsedTimeInMilliseconds:i,HttpRequestResponseTime:d,TransactionId:null==o?void 0:o.headers[g.default.transactionid],RequestPath:a,RequestMethod:s,ResponseStatusCode:o?o.status:u?null===(f=u.response)||void 0===f?void 0:f.status:void 0,ExceptionDetails:u?(null===(h=u.response)||void 0===h?void 0:h.data)||u:void 0,RequestPayload:m,RequestHeaders:E,ResponseErrorcode:u?null===(p=u.response)||void 0===p||null===(v=p.headers)||void 0===v?void 0:v.errorcode:void 0,AuthTokenDetails:T};this.logger.log(e,t,I,n)}}},{key:"addDefaultHeaders",value:function(e,t){this.setSessionIdHeader(this.sessionId,t),(0,I.addOcUserAgentHeader)(this.ocUserAgent,t),this.setCorrelationIdInHeader(e,t)}}]),e}();t.default=F,(0,l.default)(F,"defaultRequestTimeoutConfig",{getChatConfig:12e4,getLWIDetails:15e3,getChatToken:15e3,sessionInit:15e3,sessionClose:15e3,getReconnectableChats:15e3,getReconnectAvailability:15e3,submitPostChatResponse:15e3,getSurveyInviteLink:15e3,getChatTranscripts:3e4,emailTranscript:5e3,fetchDataMaskingInfo:5e3,makeSecondaryChannelEventRequest:15e3,getAgentAvailability:15e3,sendTypingIndicator:5e3,validateAuthChatRecordTimeout:15e3,getPersistentChatHistory:15e3}),(0,l.default)(F,"defaultConfiguration",{authCodeNonce:(0,P.uuidv4)().substring(0,8),getChatTokenRetryCount:10,getChatTokenTimeBetweenRetriesOnFailure:1e4,getChatTokenRetryOn429:!0,maxRequestRetriesOnFailure:5,defaultRequestTimeout:void 0,requestTimeoutConfig:F.defaultRequestTimeoutConfig,useUnauthReconnectIdSigQueryParam:!1,waitTimeBetweenRetriesConfig:N.waitTimeBetweenRetriesConfigs,ocUserAgent:[]})},function(e,t,n){e.exports=n(31)},function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new S(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return b()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=y(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function d(){}function f(){}function h(){}var p={};s(p,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(R([])));v&&v!==t&&n.call(v,o)&&(p=v);var m=h.prototype=d.prototype=Object.create(p);function E(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,s){var u=c(e[o],e,i);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function y(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function R(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:b}}function b(){return{value:void 0,done:!0}}return f.prototype=h,s(m,"constructor",h),s(h,"constructor",f),f.displayName=s(h,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},E(T.prototype),s(T.prototype,i,(function(){return this})),e.AsyncIterator=T,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new T(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(m),s(m,a,"Generator"),s(m,o,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=R,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;w(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(e,t){function n(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function s(e){n(a,o,i,s,u,"next",e)}function u(e){n(a,o,i,s,u,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(34),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(7))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},f.clearImmediate=h}function h(e){delete c[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(7),n(14))},function(e,t,n){"use strict";(function(e){
1
+ !function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=23)}([function(e,t,n){"use strict";(function(e,r,o){var i=n(11);const{toString:a}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:u,toStringTag:c}=Symbol,l=(d=Object.create(null),e=>{const t=a.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const f=e=>(e=e.toLowerCase(),t=>l(t)===e),h=e=>t=>typeof t===e,{isArray:p}=Array,g=h("undefined");function v(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&T(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const m=f("ArrayBuffer");const E=h("string"),T=h("function"),y=h("number"),C=e=>null!==e&&"object"==typeof e,w=e=>{if("object"!==l(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||c in e||u in e)},S=f("Date"),R=f("File"),b=f("Blob"),O=f("FileList"),I=f("URLSearchParams"),[A,L,D,P]=["ReadableStream","Request","Response","Headers"].map(f);function N(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),p(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(v(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function x(e,t){if(v(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:e,_=e=>!g(e)&&e!==k;const U=(M="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>M&&e instanceof M);var M;const F=f("HTMLFormElement"),B=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),j=f("RegExp"),G=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};N(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const H=f("AsyncFunction"),q=(V="function"==typeof r,W=T(k.postMessage),V?r:W?(K="axios@"+Math.random(),Y=[],k.addEventListener("message",({source:e,data:t})=>{e===k&&t===K&&Y.length&&Y.shift()()},!1),e=>{Y.push(e),k.postMessage(K,"*")}):e=>setTimeout(e));var V,W,K,Y;const z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(k):void 0!==o&&o.nextTick||q;t.a={isArray:p,isArrayBuffer:m,isBuffer:v,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||T(e.append)&&("formdata"===(t=l(e))||"object"===t&&T(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:E,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:C,isPlainObject:w,isEmptyObject:e=>{if(!C(e)||v(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:A,isRequest:L,isResponse:D,isHeaders:P,isUndefined:g,isDate:S,isFile:R,isBlob:b,isRegExp:j,isFunction:T,isStream:e=>C(e)&&T(e.pipe),isURLSearchParams:I,isTypedArray:U,isFileList:O,forEach:N,merge:function e(){const{caseless:t,skipUndefined:n}=_(this)&&this||{},r={},o=(o,i)=>{const a=t&&x(r,i)||i;w(r[a])&&w(o)?r[a]=e(r[a],o):w(o)?r[a]=e({},o):p(o)?r[a]=o.slice():n&&g(o)||(r[a]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&N(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(N(t,(t,r)=>{n&&T(t)?e[r]=Object(i.a)(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:f,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!y(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[u]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:F,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:G,freezeMethods:e=>{G(e,(t,n)=>{if(T(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];T(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return p(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:x,global:k,isContextDefined:_,isSpecCompliantForm:function(e){return!!(e&&T(e.append)&&"FormData"===e[c]&&e[u])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(C(e)){if(t.indexOf(e)>=0)return;if(v(e))return e;if(!("toJSON"in e)){t[r]=e;const o=p(e)?[]:{};return N(e,(e,t)=>{const i=n(e,r+1);!g(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:H,isThenable:e=>e&&(C(e)||T(e))&&T(e.then)&&T(e.catch),setImmediate:q,asap:z,isIterable:e=>null!=e&&T(e[u])}}).call(this,n(7),n(33).setImmediate,n(14))},function(e,t,n){"use strict";var r=n(0);function o(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}r.a.inherits(o,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r.a.toJSONObject(this.config),code:this.code,status:this.status}}});const i=o.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{a[e]={value:e}}),Object.defineProperties(o,a),Object.defineProperty(i,"isAxiosError",{value:!0}),o.from=(e,t,n,a,s,u)=>{const c=Object.create(i);r.a.toFlatObject(e,c,(function(e){return e!==Error.prototype}),e=>"isAxiosError"!==e);const l=e&&e.message?e.message:"Error",d=null==t&&e?e.code:t;return o.call(c,l,d,n,a,s),e&&null==c.cause&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",u&&Object.assign(c,u),c},t.a=o},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(1),i=n(12);function a(e){return r.a.isPlainObject(e)||r.a.isArray(e)}function s(e){return r.a.endsWith(e,"[]")?e.slice(0,-2):e}function u(e,t,n){return e?e.concat(t).map((function(e,t){return e=s(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const c=r.a.toFlatObject(r.a,{},null,(function(e){return/^is[A-Z]/.test(e)}));t.a=function(t,n,l){if(!r.a.isObject(t))throw new TypeError("target must be an object");n=n||new(i.a||FormData);const d=(l=r.a.toFlatObject(l,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!r.a.isUndefined(t[e])}))).metaTokens,f=l.visitor||m,h=l.dots,p=l.indexes,g=(l.Blob||"undefined"!=typeof Blob&&Blob)&&r.a.isSpecCompliantForm(n);if(!r.a.isFunction(f))throw new TypeError("visitor must be a function");function v(t){if(null===t)return"";if(r.a.isDate(t))return t.toISOString();if(r.a.isBoolean(t))return t.toString();if(!g&&r.a.isBlob(t))throw new o.a("Blob is not supported. Use a Buffer instead.");return r.a.isArrayBuffer(t)||r.a.isTypedArray(t)?g&&"function"==typeof Blob?new Blob([t]):e.from(t):t}function m(e,t,o){let i=e;if(e&&!o&&"object"==typeof e)if(r.a.endsWith(t,"{}"))t=d?t:t.slice(0,-2),e=JSON.stringify(e);else if(r.a.isArray(e)&&function(e){return r.a.isArray(e)&&!e.some(a)}(e)||(r.a.isFileList(e)||r.a.endsWith(t,"[]"))&&(i=r.a.toArray(e)))return t=s(t),i.forEach((function(e,o){!r.a.isUndefined(e)&&null!==e&&n.append(!0===p?u([t],o,h):null===p?t:t+"[]",v(e))})),!1;return!!a(e)||(n.append(u(o,t,h),v(e)),!1)}const E=[],T=Object.assign(c,{defaultVisitor:m,convertValue:v,isVisitable:a});if(!r.a.isObject(t))throw new TypeError("data must be an object");return function e(t,o){if(!r.a.isUndefined(t)){if(-1!==E.indexOf(t))throw Error("Circular reference detected in "+o.join("."));E.push(t),r.a.forEach(t,(function(t,i){!0===(!(r.a.isUndefined(t)||null===t)&&f.call(n,t,r.a.isString(i)?i.trim():i,o,T))&&e(t,o?o.concat(i):[i])})),E.pop()}}(t),n}}).call(this,n(35).Buffer)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r,o,i,a,s,u,c,l;Object.defineProperty(t,"__esModule",{value:!0}),t.SDKError=t.LiveChatVersion=t.OCSDKTelemetryEvent=t.ChannelId=t.OperatingSystem=t.DeviceType=t.Browser=t.BrowserVendor=void 0,t.BrowserVendor=r,function(e){e.IE="IE",e.CHROME="Chrome",e.FIREFOX="Firefox",e.SAFARI="Safari",e.EDGE="Edge",e.EDGE_CHROMIUM="Edg",e.OPERA="Opera",e.UNKNOWN="Unknown"}(r||(t.BrowserVendor=r={})),t.Browser=o,function(e){e[e.Chrome=0]="Chrome",e[e.Firefox=1]="Firefox",e[e.Ie=2]="Ie",e[e.Edge=3]="Edge",e[e.Safari=4]="Safari",e[e.None=5]="None"}(o||(t.Browser=o={})),t.DeviceType=i,function(e){e.Desktop="Desktop",e.Mobile="Mobile",e.Tablet="Tablet"}(i||(t.DeviceType=i={})),t.OperatingSystem=a,function(e){e.WINDOWS="Windows",e.MACOSX="Mac OS X",e.WINDOWS_PHONE="Windows Phone",e.WINDOWS_RT="Windows RT",e.IOS="iOS",e.ANDROID="Android",e.LINUX="Linux",e.UNKNOWN="Unknown"}(a||(t.OperatingSystem=a={})),t.ChannelId=s,function(e){e.LCW="lcw",e.SMS="sms",e.FACEBOOK="facebook",e.WECHAT="wechat"}(s||(t.ChannelId=s={})),t.OCSDKTelemetryEvent=u,function(e){e.GETLCWFCSDETAILSSTARTED="GetLcwFcsDetailsStarted",e.GETLCWFCSDETAILSSUCCEEDED="GetLcwFcsDetailsSucceeded",e.GETLCWFCSDETAILSFAILED="GetLcwFcsDetailsFailed",e.GETCHATCONFIGFSTARTED="GetChatConfig",e.GETCHATCONFIGSUCCEEDED="GetChatConfigSucceeded",e.GETCHATCONFIGFAILED="GetChatConfigFailed",e.GETRECONNECTABLECHATSSTARTED="GetReconnnectableChatsStarted",e.GETRECONNECTABLECHATSSUCCEEDED="GetReconnnectableChatsSucceeded",e.GETRECONNECTABLECHATSFAILED="GetReconnnectableChatsFailed",e.GETRECONNECTAVAILABILITYSUCCEEDED="GetReconnnectableAvailabilitySucceeded",e.GETRECONNECTAVAILABILITYSTARTED="GetReconnnectableAvailabilityStarted",e.GETRECONNECTAVAILABILITYFAILED="GetReconnnectableAvailabilityFailed",e.GETCHATTOKENSTARTED="GetChatTokenStarted",e.GETCHATTOKENSUCCEEDED="GetChatTokenSucceeded",e.GETCHATTOKENFAILED="GetChatTokenFailed",e.GETLWISTATUSSTARTED="GetLwiStatusStarted",e.GETLWISTATUSSUCCEEDED="GetLwiStatusSucceeded",e.GETLWISTATUSFAILED="GetLwiStatusFailed",e.SESSIONINITSTARTED="SessionInitStarted",e.SESSIONINITSUCCEEDED="SessionInitSucceeded",e.SESSIONINITFAILED="SessionInitFailed",e.CREATESESSIONSTARTED="CreateSessionStarted",e.CREATESESSIONSUCCEEDED="CreateSessionSucceeded",e.CREATESESSIONFAILED="CreateSessionFailed",e.SESSIONCLOSESTARTED="SessionCloseStarted",e.SESSIONCLOSESUCCEEDED="SessionCloseSucceeded",e.SESSIONCLOSEFAILED="SessionCloseFailed",e.SUBMITPOSTCHATSTARTED="SubmitPostChatStarted",e.SUBMITPOSTCHATSUCCEEDED="SubmitPostChatSucceeded",e.SUBMITPOSTCHATFAILED="SubmitPostChatFailed",e.GETCHATTRANSCRIPTSTARTED="GetChatTranscriptStarted",e.GETCHATTRANSCRIPTSUCCEEDED="GetChatTranscriptSucceeded",e.GETCHATTRANSCRIPTFAILED="GetChatTranscriptFailed",e.EMAILTRANSCRIPTSTARTED="EmailTranscriptStarted",e.EMAILTRANSCRIPTSUCCEEDED="EmailTranscriptSucceeded",e.EMAILTRANSCRIPTFAILED="EmailTranscriptFailed",e.FETCHDATAMASKINGSTARTED="FetchDataMaskingStarted",e.FETCHDATAMASKINGSUCCEEDED="FetchDataMaskingSucceeded",e.FETCHDATAMASKINGFAILED="FetchDataMaskingFailed",e.SECONDARYCHANNELEVENTREQUESTSTARTED="SecondaryChannelEventRequestStarted",e.SECONDARYCHANNELEVENTREQUESTSUCCEEDED="SecondaryChannelEventRequestSucceeded",e.SECONDARYCHANNELEVENTREQUESTFAILED="SecondaryChannelEventRequestFailed",e.GETSURVEYINVITELINKSTARTED="GetSurveyInviteLinkStarted",e.GETSURVEYINVITELINKSUCCEEDED="GetSurveyInviteLinkSucceeded",e.GETSURVEYINVITELINKFAILED="GetSurveyInviteLinkFailed",e.VALIDATEAUTHCHATRECORDSTARTED="ValidateAuthChatRecordStarted",e.VALIDATEAUTHCHATRECORDSUCCEEDED="ValidateAuthChatRecordSucceeded",e.VALIDATEAUTHCHATRECORDFAILED="ValidateAuthChatRecordFailed",e.GETAGENTAVAILABILITYSTARTED="GetAgentAvailabilityStarted",e.GETAGENTAVAILABILITYSUCCEEDED="GetAgentAvailabilitySucceeded",e.GETAGENTAVAILABILITYFAILED="GetAgentAvailabilityFailed",e.SENDTYPINGINDICATORFAILED="SendTypingIndicatorFailed",e.SENDTYPINGINDICATORSUCCEEDED="SendTypingIndicatorSucceeded",e.GETPERSISTENTCHATHISTORYSTARTED="GetPersistentChatHistoryStarted",e.GETPERSISTENTCHATHISTORYSUCCEEDED="GetPersistentChatHistorySucceeded",e.GETPERSISTENTCHATHISTORYFAILED="GetPersistentChatHistoryFailed"}(u||(t.OCSDKTelemetryEvent=u={})),t.LiveChatVersion=c,function(e){e[e.V1=1]="V1",e[e.V2=2]="V2",e[e.V3=3]="V3"}(c||(t.LiveChatVersion=c={})),t.SDKError=l,function(e){e.ClientHTTPTimeoutErrorName="ClientHTTPTimeoutError",e.ClientHTTPTimeoutErrorMessage="Server took too long to respond"}(l||(t.SDKError=l={}))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=n(8),s=function e(){(0,o.default)(this,e)};t.default=s,(0,i.default)(s,"requiredOmnichannelConfigurationParameters",["orgUrl","orgId","widgetId"]),(0,i.default)(s,"defaultHeaders",{"Content-Type":"application/json"}),(0,i.default)(s,"bypassCacheHeaders",{"Cache-Control":"no-store, must-revalidate, no-cache","X-Cache-Control":"no-store"}),(0,i.default)(s,"defaultChannelId",a.ChannelId.LCW),(0,i.default)(s,"defaultLocale","en-us"),(0,i.default)(s,"noContentStatusCode",204),(0,i.default)(s,"tooManyRequestsStatusCode",429),(0,i.default)(s,"notFoundStatusCode",404),(0,i.default)(s,"badRequestStatusCode",400),(0,i.default)(s,"outOfOfficeErrorCode",705),(0,i.default)(s,"sensitiveProperties",["AuthenticatedUserToken"]),(0,i.default)(s,"transactionid","transaction-id"),(0,i.default)(s,"customerDisplayName","customerDisplayName"),(0,i.default)(s,"hiddenContentPlaceholder","*content hidden*"),(0,i.default)(s,"axiosTimeoutErrorCode","ECONNABORTED")},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a=null},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=function e(){(0,o.default)(this,e)};t.default=a,(0,i.default)(a,"authenticatedUserToken","AuthenticatedUserToken"),(0,i.default)(a,"authorization","Authorization"),(0,i.default)(a,"organizationId","OrganizationId"),(0,i.default)(a,"widgetAppId","widgetAppId"),(0,i.default)(a,"requestId","Request-Id"),(0,i.default)(a,"authCodeNonce","AuthCodeNonce"),(0,i.default)(a,"ocSessionId","Oc-Sessionid"),(0,i.default)(a,"ocUserAgent","Ms-Oc-User-Agent"),(0,i.default)(a,"correlationId","x-ms-client-request-id"),(0,i.default)(a,"pageToken","PageToken")},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,d=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(2),o=n(10);Object.defineProperty(t,"__esModule",{value:!0}),t.isRetryableError=f,t.axiosRetryHandlerWithNotFound=function(e,t){d(e,{retries:t.retries,waitTimeInMsBetweenRetries:t.waitTimeInMsBetweenRetries,shouldRetry:function(e){var n;return l(e,t.retryOn429)||(null===(n=e.response)||void 0===n?void 0:n.status)===a.default.notFoundStatusCode}})},t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var u=i?Object.getOwnPropertyDescriptor(e,a):null;u&&(u.get||u.set)?Object.defineProperty(r,a,u):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(16)),a=r(n(9));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(e,t){var n,r,o;return!((null===(n=e.response)||void 0===n?void 0:n.status)===a.default.tooManyRequestsStatusCode&&!t)&&(f(e)||(0,i.isNetworkError)(e)||0===(null===(r=e.response)||void 0===r?void 0:r.status)||!(null!==(o=e.response)&&void 0!==o&&o.status))},d=function(e,t){void 0!==t.retryOn429&&null!==t.retryOn429||(t.retryOn429=!1),t.shouldRetry||(t.shouldRetry=function(e){return l(e,t.retryOn429)}),(0,i.default)(e,{retries:t.retries,retryCondition:t.shouldRetry,onRetry:function(e,n,r){var o=n.response,i=t.headerOverwrites;if(i&&null!=o&&o.headers){var a,s=u(i);try{for(s.s();!(a=s.n()).done;){var c=a.value,l=null==o?void 0:o.headers[c.toLocaleLowerCase()];l&&r.headers&&(r.headers[c]=l)}}catch(e){s.e(e)}finally{s.f()}}},retryDelay:function(e,n){var r,o,i,s=t.waitTimeInMsBetweenRetries,u=null==n||null===(r=n.response)||void 0===r||null===(o=r.headers)||void 0===o?void 0:o["retry-after"],c=s;if(u){var l=parseInt(u);if(isNaN(l)){var d=new Date(u),f=(new Date).getTime();d&&d instanceof Date&&isFinite(d.getTime())&&(c=Math.max(0,d.getTime()-f))}else c=l*s;return c}return(null===(i=n.response)||void 0===i?void 0:i.status)===a.default.tooManyRequestsStatusCode?5e3:Math.pow(2,e)*s}})};function f(e){return"ECONNABORTED"!==e.code&&(!e.response||429===e.response.status||e.response.status>=500&&e.response.status<=599)}var h=d;t.default=h},function(e,t,n){"use strict";n.r(t),n.d(t,"namespace",(function(){return l})),n.d(t,"isNetworkError",(function(){return d})),n.d(t,"isRetryableError",(function(){return p})),n.d(t,"isSafeRequestError",(function(){return g})),n.d(t,"isIdempotentRequestError",(function(){return v})),n.d(t,"isNetworkOrIdempotentRequestError",(function(){return m})),n.d(t,"exponentialDelay",(function(){return E})),n.d(t,"DEFAULT_OPTIONS",(function(){return T})),n.d(t,"default",(function(){return w}));var r=n(22),o=n.n(r);function i(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l="axios-retry";function d(e){return!e.response&&Boolean(e.code)&&!["ERR_CANCELED","ECONNABORTED"].includes(e.code)&&o()(e)}var f=["get","head","options"],h=f.concat(["put","delete"]);function p(e){return"ECONNABORTED"!==e.code&&(!e.response||e.response.status>=500&&e.response.status<=599)}function g(e){return!!e.config&&(p(e)&&-1!==f.indexOf(e.config.method))}function v(e){return!!e.config&&(p(e)&&-1!==h.indexOf(e.config.method))}function m(e){return d(e)||v(e)}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,n=Math.pow(2,e)*t,r=.2*n*Math.random();return n+r}var T={retries:3,retryCondition:m,retryDelay:function(){return 0},shouldResetTimeout:!1,onRetry:()=>{}};function y(e,t){var n=function(e,t){return u(u(u({},T),t),e[l])}(e,t);return n.retryCount=n.retryCount||0,e[l]=n,n}function C(){return(C=a((function*(e,t){var{retries:n,retryCondition:r}=e,o=e.retryCount<n&&r(t);if("object"==typeof o)try{return!1!==(yield o)}catch(e){return!1}return o}))).apply(this,arguments)}function w(e,t){return{requestInterceptorId:e.interceptors.request.use(e=>(y(e,t).lastRequestTime=Date.now(),e)),responseInterceptorId:e.interceptors.response.use(null,function(){var n=a((function*(n){var{config:r}=n;if(!r)return Promise.reject(n);var o=y(r,t);if(yield function(e,t){return C.apply(this,arguments)}(o,n)){o.retryCount+=1;var{retryDelay:i,shouldResetTimeout:a,onRetry:s}=o,u=i(o.retryCount,n);if(function(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}(e,r),!a&&r.timeout&&o.lastRequestTime){var c=Date.now()-o.lastRequestTime,l=r.timeout-c-u;if(l<=0)return Promise.reject(n);r.timeout=l}return r.transformRequest=[e=>e],yield s(o.retryCount,n,r),new Promise(t=>setTimeout(()=>t(e(r)),u))}return Promise.reject(n)}));return function(e){return n.apply(this,arguments)}}())}}w.isNetworkError=d,w.isSafeRequestError=g,w.isIdempotentRequestError=v,w.isNetworkOrIdempotentRequestError=m,w.exponentialDelay=E,w.isRetryableError=p},function(e,t,n){(function(t){var r;e.exports=(r=r||function(e,r){var o;if("undefined"!=typeof window&&window.crypto&&(o=window.crypto),"undefined"!=typeof self&&self.crypto&&(o=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(o=globalThis.crypto),!o&&"undefined"!=typeof window&&window.msCrypto&&(o=window.msCrypto),!o&&void 0!==t&&t.crypto&&(o=t.crypto),!o)try{o=n(43)}catch(e){}var i=function(){if(o){if("function"==typeof o.getRandomValues)try{return o.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof o.randomBytes)try{return o.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},u=s.lib={},c=u.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=u.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new l.init(t,e)}}),d=s.enc={},f=d.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},h=d.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},p=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},g=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,c=e.min(4*u,i);if(u){for(var d=0;d<u;d+=a)this._doProcessBlock(o,d);n=o.splice(0,u),r.sigBytes-=c}return new l.init(n,c)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),v=(u.Hasher=g.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new v.HMAC.init(e,n).finalize(t)}}}),s.algo={});return s}(Math),r)}).call(this,n(7))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=function e(){(0,o.default)(this,e)};t.default=a,(0,i.default)(a,"LiveChatConnectorPath","livechatconnector/organization"),(0,i.default)(a,"LiveChatConnectorAuthPath","livechatconnector/auth/organization"),(0,i.default)(a,"LcwFcsDetailsPath","livechatconnector/v2/lcwfcsdetails"),(0,i.default)(a,"LiveChatConfigPath","livechatconnector/config"),(0,i.default)(a,"LiveChatSessionInitPath","livechatconnector/sessioninit"),(0,i.default)(a,"LiveChatAuthSessionInitPath","livechatconnector/auth/sessioninit"),(0,i.default)(a,"LiveChatGetChatTokenPath","livechatconnector/getchattoken"),(0,i.default)(a,"LiveChatv2GetChatTokenPath","livechatconnector/v2/getchattoken"),(0,i.default)(a,"LiveChatv3GetChatTokenPath","livechatconnector/v3/getchattoken"),(0,i.default)(a,"LiveChatv4GetChatTokenPath","livechatconnector/v4/getchattoken"),(0,i.default)(a,"LiveChatv4AuthGetChatTokenPath","livechatconnector/v4/auth/getchattoken"),(0,i.default)(a,"LiveChatAuthGetChatTokenPath","livechatconnector/auth/getchattoken"),(0,i.default)(a,"LiveChatv2AuthGetChatTokenPath","livechatconnector/v2/auth/getchattoken"),(0,i.default)(a,"LiveChatv3AuthGetChatTokenPath","livechatconnector/v3/auth/getchattoken"),(0,i.default)(a,"LiveChatSessionClosePath","livechatconnector/sessionclose"),(0,i.default)(a,"LiveChatAuthSessionClosePath","livechatconnector/auth/sessionclose"),(0,i.default)(a,"LiveChatSubmitPostChatPath","survey/submitpostchat"),(0,i.default)(a,"LiveChatAuthSubmitPostChatPath","survey/auth/submitpostchat"),(0,i.default)(a,"LiveChatGetSurveyInviteLinkPath","livechatconnector/getsurveyinvite"),(0,i.default)(a,"LiveChatAuthGetSurveyInviteLinkPath","livechatconnector/auth/getsurveyinvite"),(0,i.default)(a,"LiveChatGetChatTranscriptPath","livechatconnector/getchattranscripts"),(0,i.default)(a,"LiveChatv2GetChatTranscriptPath","livechatconnector/v2/getchattranscripts"),(0,i.default)(a,"LiveChatAuthGetChatTranscriptPath","livechatconnector/auth/getchattranscripts"),(0,i.default)(a,"LiveChatv2AuthGetChatTranscriptPath","livechatconnector/v2/auth/getchattranscripts"),(0,i.default)(a,"LiveChatTranscriptEmailRequestPath","livechatconnector/createemailrequest"),(0,i.default)(a,"LiveChatAuthTranscriptEmailRequestPath","livechatconnector/auth/createemailrequest"),(0,i.default)(a,"LiveChatFetchDataMaskingInfoPath","livechatconnector/fetchdatamaskinginfo"),(0,i.default)(a,"LiveChatSecondaryChannelEventPath","livechatconnector/secondarychannelevent"),(0,i.default)(a,"LiveChatAuthSecondaryChannelEventPath","livechatconnector/auth/secondarychannelevent"),(0,i.default)(a,"LiveChatLiveWorkItemDetailsPath","livechatconnector/getliveworkitemdetails"),(0,i.default)(a,"LiveChatAuthLiveWorkItemDetailsPath","livechatconnector/auth/getliveworkitemdetails"),(0,i.default)(a,"LiveChatGetReconnectableChatsPath","livechatconnector/auth/reconnectablechats"),(0,i.default)(a,"LiveChatReconnectAvailabilityPath","livechatconnector/reconnect"),(0,i.default)(a,"LiveChatValidateAuthChatMapRecordPath","livechatconnector/auth/validateauthchatmaprecord"),(0,i.default)(a,"GetAgentAvailabilityPath","livechatconnector/auth/getagentavailability"),(0,i.default)(a,"SendTypingIndicatorPath","inbound/typingindicator/livechat/sendtypingindicator"),(0,i.default)(a,"LiveChatAuthGetPersistentChatHistoryPath","livechatconnector/auth/organization")},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidv4=void 0;t.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return Ae})),n.d(t,"Axios",(function(){return Le})),n.d(t,"AxiosError",(function(){return De})),n.d(t,"CanceledError",(function(){return Pe})),n.d(t,"isCancel",(function(){return Ne})),n.d(t,"CancelToken",(function(){return xe})),n.d(t,"VERSION",(function(){return ke})),n.d(t,"all",(function(){return _e})),n.d(t,"Cancel",(function(){return Ue})),n.d(t,"isAxiosError",(function(){return Me})),n.d(t,"spread",(function(){return Fe})),n.d(t,"toFormData",(function(){return Be})),n.d(t,"AxiosHeaders",(function(){return je})),n.d(t,"HttpStatusCode",(function(){return Ge})),n.d(t,"formToJSON",(function(){return He})),n.d(t,"getAdapter",(function(){return qe})),n.d(t,"mergeConfig",(function(){return Ve}));var r={};n.r(r),n.d(r,"hasBrowserEnv",(function(){return m})),n.d(r,"hasStandardBrowserWebWorkerEnv",(function(){return y})),n.d(r,"hasStandardBrowserEnv",(function(){return T})),n.d(r,"navigator",(function(){return E})),n.d(r,"origin",(function(){return C}));var o=n(0),i=n(11),a=n(6);function s(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function u(e,t){this._pairs=[],e&&Object(a.a)(e,this,t)}const c=u.prototype;c.append=function(e,t){this._pairs.push([e,t])},c.toString=function(e){const t=e?function(t){return e.call(this,t,s)}:s;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var l=u;function d(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function f(e,t,n){if(!t)return e;const r=n&&n.encode||d;o.a.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let a;if(a=i?i(t,n):o.a.isURLSearchParams(t)?t.toString():new l(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}var h=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){o.a.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},p=n(1),g={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},v={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:l,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const m="undefined"!=typeof window&&"undefined"!=typeof document,E="object"==typeof navigator&&navigator||void 0,T=m&&(!E||["ReactNative","NativeScript","NS"].indexOf(E.product)<0),y="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,C=m&&window.location.href||"http://localhost";var w={...r,...v};var S=function(e){function t(e,n,r,i){let a=e[i++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),u=i>=e.length;if(a=!a&&o.a.isArray(r)?r.length:a,u)return o.a.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!s;r[a]&&o.a.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&o.a.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[a])),!s}if(o.a.isFormData(e)&&o.a.isFunction(e.entries)){const n={};return o.a.forEachEntry(e,(e,r)=>{t(function(e){return o.a.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const R={transitional:g,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=o.a.isObject(e);i&&o.a.isHTMLForm(e)&&(e=new FormData(e));if(o.a.isFormData(e))return r?JSON.stringify(S(e)):e;if(o.a.isArrayBuffer(e)||o.a.isBuffer(e)||o.a.isStream(e)||o.a.isFile(e)||o.a.isBlob(e)||o.a.isReadableStream(e))return e;if(o.a.isArrayBufferView(e))return e.buffer;if(o.a.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Object(a.a)(e,new w.classes.URLSearchParams,{visitor:function(e,t,n,r){return w.isNode&&o.a.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=o.a.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Object(a.a)(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(o.a.isString(e))try{return(t||JSON.parse)(e),o.a.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||R.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(o.a.isResponse(e)||o.a.isReadableStream(e))return e;if(e&&o.a.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw p.a.from(e,p.a.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:w.classes.FormData,Blob:w.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};o.a.forEach(["delete","get","head","post","put","patch"],e=>{R.headers[e]={}});var b=R;const O=o.a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const I=Symbol("internals");function A(e){return e&&String(e).trim().toLowerCase()}function L(e){return!1===e||null==e?e:o.a.isArray(e)?e.map(L):String(e)}function D(e,t,n,r,i){return o.a.isFunction(r)?r.call(this,t,n):(i&&(t=n),o.a.isString(t)?o.a.isString(r)?-1!==t.indexOf(r):o.a.isRegExp(r)?r.test(t):void 0:void 0)}class P{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=A(t);if(!i)throw new Error("header name must be a non-empty string");const a=o.a.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=L(e))}const a=(e,t)=>o.a.forEach(e,(e,n)=>i(e,n,t));if(o.a.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(o.a.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&O[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(o.a.isObject(e)&&o.a.isIterable(e)){let n,r,i={};for(const t of e){if(!o.a.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?o.a.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=A(e)){const n=o.a.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(o.a.isFunction(t))return t.call(this,e,n);if(o.a.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=A(e)){const n=o.a.findKey(this,e);return!(!n||void 0===this[n]||t&&!D(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=A(e)){const i=o.a.findKey(n,e);!i||t&&!D(0,n[i],i,t)||(delete n[i],r=!0)}}return o.a.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!D(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return o.a.forEach(this,(r,i)=>{const a=o.a.findKey(n,i);if(a)return t[a]=L(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=L(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return o.a.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&o.a.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[I]=this[I]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=A(e);t[r]||(!function(e,t){const n=o.a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return o.a.isArray(e)?e.forEach(r):r(e),this}}P.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),o.a.reduceDescriptors(P.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),o.a.freezeMethods(P);var N=P;function x(e,t){const n=this||b,r=t||n,i=N.from(r.headers);let a=r.data;return o.a.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function k(e){return!(!e||!e.__CANCEL__)}function _(e,t,n){p.a.call(this,null==e?"canceled":e,p.a.ERR_CANCELED,t,n),this.name="CanceledError"}o.a.inherits(_,p.a,{__CANCEL__:!0});var U=_,M=n(12);function F(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new p.a("Request failed with status code "+n.status,[p.a.ERR_BAD_REQUEST,p.a.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}var B=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[a];o||(o=u),n[i]=s,r[i]=u;let l=a,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o<t)return;const f=c&&u-c;return f?Math.round(1e3*d/f):void 0}};var j=function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]};const G=(e,t,n=3)=>{let r=0;const o=B(50,250);return j(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,u=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},H=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},q=e=>(...t)=>o.a.asap(()=>e(...t));var V,W,K=w.hasStandardBrowserEnv?(V=new URL(w.origin),W=w.navigator&&/(msie|trident)/i.test(w.navigator.userAgent),e=>(e=new URL(e,w.origin),V.protocol===e.protocol&&V.host===e.host&&(W||V.port===e.port))):()=>!0,Y=w.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const s=[e+"="+encodeURIComponent(t)];o.a.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),o.a.isString(r)&&s.push("path="+r),o.a.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function z(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const J=e=>e instanceof N?{...e}:e;function X(e,t){t=t||{};const n={};function r(e,t,n,r){return o.a.isPlainObject(e)&&o.a.isPlainObject(t)?o.a.merge.call({caseless:r},e,t):o.a.isPlainObject(t)?o.a.merge({},t):o.a.isArray(t)?t.slice():t}function i(e,t,n,i){return o.a.isUndefined(t)?o.a.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function a(e,t){if(!o.a.isUndefined(t))return r(void 0,t)}function s(e,t){return o.a.isUndefined(t)?o.a.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function u(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(e,t,n)=>i(J(e),J(t),0,!0)};return o.a.forEach(Object.keys({...e,...t}),(function(r){const a=c[r]||i,s=a(e[r],t[r],r);o.a.isUndefined(s)&&a!==u||(n[r]=s)})),n}var $=e=>{const t=X({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:u}=t;if(t.headers=s=N.from(s),t.url=f(z(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&s.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),o.a.isFormData(n))if(w.hasStandardBrowserEnv||w.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(o.a.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(w.hasStandardBrowserEnv&&(r&&o.a.isFunction(r)&&(r=r(t)),r||!1!==r&&K(t.url))){const e=i&&a&&Y.read(a);e&&s.set(i,e)}return t};var Q="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=$(e);let i=r.data;const a=N.from(r.headers).normalize();let s,u,c,l,d,{responseType:f,onUploadProgress:h,onDownloadProgress:v}=r;function m(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let E=new XMLHttpRequest;function T(){if(!E)return;const r=N.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders());F((function(e){t(e),m()}),(function(e){n(e),m()}),{data:f&&"text"!==f&&"json"!==f?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:r,config:e,request:E}),E=null}E.open(r.method.toUpperCase(),r.url,!0),E.timeout=r.timeout,"onloadend"in E?E.onloadend=T:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(T)},E.onabort=function(){E&&(n(new p.a("Request aborted",p.a.ECONNABORTED,e,E)),E=null)},E.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new p.a(r,p.a.ERR_NETWORK,e,E);o.event=t||null,n(o),E=null},E.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||g;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new p.a(t,o.clarifyTimeoutError?p.a.ETIMEDOUT:p.a.ECONNABORTED,e,E)),E=null},void 0===i&&a.setContentType(null),"setRequestHeader"in E&&o.a.forEach(a.toJSON(),(function(e,t){E.setRequestHeader(t,e)})),o.a.isUndefined(r.withCredentials)||(E.withCredentials=!!r.withCredentials),f&&"json"!==f&&(E.responseType=r.responseType),v&&([c,d]=G(v,!0),E.addEventListener("progress",c)),h&&E.upload&&([u,l]=G(h),E.upload.addEventListener("progress",u),E.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{E&&(n(!t||t.type?new U(null,e,E):t),E.abort(),E=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===w.protocols.indexOf(y)?n(new p.a("Unsupported protocol "+y+":",p.a.ERR_BAD_REQUEST,e)):E.send(i||null)}))};var Z=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof p.a?t:new U(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,i(new p.a(`timeout ${t} of ms exceeded`,p.a.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=()=>o.a.asap(s),u}};const ee=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},te=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ne=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of te(e))yield*ee(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:re}=o.a,oe=(({Request:e,Response:t})=>({Request:e,Response:t}))(o.a.global),{ReadableStream:ie,TextEncoder:ae}=o.a.global,se=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ue=e=>{e=o.a.merge.call({skipUndefined:!0},oe,e);const{fetch:t,Request:n,Response:r}=e,i=t?re(t):"function"==typeof fetch,a=re(n),s=re(r);if(!i)return!1;const u=i&&re(ie),c=i&&("function"==typeof ae?(l=new ae,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const d=a&&u&&se(()=>{let e=!1;const t=new n(w.origin,{body:new ie,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=s&&u&&se(()=>o.a.isReadableStream(new r("").body)),h={stream:f&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new p.a(`Response type '${e}' is not supported`,p.a.ERR_NOT_SUPPORT,n)})});const g=async(e,t)=>{const r=o.a.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(o.a.isBlob(e))return e.size;if(o.a.isSpecCompliantForm(e)){const t=new n(w.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return o.a.isArrayBufferView(e)||o.a.isArrayBuffer(e)?e.byteLength:(o.a.isURLSearchParams(e)&&(e+=""),o.a.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:i,method:s,data:u,signal:c,cancelToken:l,timeout:v,onDownloadProgress:m,onUploadProgress:E,responseType:T,headers:y,withCredentials:C="same-origin",fetchOptions:w}=$(e),S=t||fetch;T=T?(T+"").toLowerCase():"text";let R=Z([c,l&&l.toAbortSignal()],v),b=null;const O=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let I;try{if(E&&d&&"get"!==s&&"head"!==s&&0!==(I=await g(y,u))){let e,t=new n(i,{method:"POST",body:u,duplex:"half"});if(o.a.isFormData(u)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=H(I,G(q(E)));u=ne(t.body,65536,e,n)}}o.a.isString(C)||(C=C?"include":"omit");const t=a&&"credentials"in n.prototype,c={...w,signal:R,method:s.toUpperCase(),headers:y.normalize().toJSON(),body:u,duplex:"half",credentials:t?C:void 0};b=a&&new n(i,c);let l=await(a?S(b,w):S(i,c));const p=f&&("stream"===T||"response"===T);if(f&&(m||p&&O)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=o.a.toFiniteNumber(l.headers.get("content-length")),[n,i]=m&&H(t,G(q(m),!0))||[];l=new r(ne(l.body,65536,n,()=>{i&&i(),O&&O()}),e)}T=T||"text";let v=await h[o.a.findKey(h,T)||"text"](l,e);return!p&&O&&O(),await new Promise((t,n)=>{F(t,n,{data:v,headers:N.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:b})})}catch(t){if(O&&O(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new p.a("Network Error",p.a.ERR_NETWORK,e,b),{cause:t.cause||t});throw p.a.from(t,t&&t.code,e,b)}}},ce=new Map,le=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let a,s,u=i.length,c=ce;for(;u--;)a=i[u],s=c.get(a),void 0===s&&c.set(a,s=u?new Map:ue(t)),c=s;return s};le();const de={http:M.a,xhr:Q,fetch:{get:le}};o.a.forEach(de,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const fe=e=>"- "+e,he=e=>o.a.isFunction(e)||null===e||!1===e;var pe=(e,t)=>{e=o.a.isArray(e)?e:[e];const{length:n}=e;let r,i;const a={};for(let s=0;s<n;s++){let n;if(r=e[s],i=r,!he(r)&&(i=de[(n=String(r)).toLowerCase()],void 0===i))throw new p.a(`Unknown adapter '${n}'`);if(i&&(o.a.isFunction(i)||(i=i.get(t))))break;a[n||"#"+s]=i}if(!i){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(fe).join("\n"):" "+fe(e[0]):"as no adapter specified";throw new p.a("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return i};function ge(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new U(null,e)}function ve(e){ge(e),e.headers=N.from(e.headers),e.data=x.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return pe(e.adapter||b.adapter,e)(e).then((function(t){return ge(e),t.data=x.call(e,e.transformResponse,t),t.headers=N.from(t.headers),t}),(function(t){return k(t)||(ge(e),t&&t.response&&(t.response.data=x.call(e,e.transformResponse,t.response),t.response.headers=N.from(t.response.headers))),Promise.reject(t)}))}const me={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{me[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ee={};me.transitional=function(e,t,n){function r(e,t){return"[Axios v1.12.2] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new p.a(r(o," has been removed"+(t?" in "+t:"")),p.a.ERR_DEPRECATED);return t&&!Ee[o]&&(Ee[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},me.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Te={assertOptions:function(e,t,n){if("object"!=typeof e)throw new p.a("options must be an object",p.a.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new p.a("option "+i+" must be "+n,p.a.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new p.a("Unknown option "+i,p.a.ERR_BAD_OPTION)}},validators:me};const ye=Te.validators;class Ce{constructor(e){this.defaults=e||{},this.interceptors={request:new h,response:new h}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=X(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Te.assertOptions(n,{silentJSONParsing:ye.transitional(ye.boolean),forcedJSONParsing:ye.transitional(ye.boolean),clarifyTimeoutError:ye.transitional(ye.boolean)},!1),null!=r&&(o.a.isFunction(r)?t.paramsSerializer={serialize:r}:Te.assertOptions(r,{encode:ye.function,serialize:ye.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Te.assertOptions(t,{baseUrl:ye.spelling("baseURL"),withXsrfToken:ye.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&o.a.merge(i.common,i[t.method]);i&&o.a.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=N.concat(a,i);const s=[];let u=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,f=0;if(!u){const e=[ve.bind(this),void 0];for(e.unshift(...s),e.push(...c),d=e.length,l=Promise.resolve(t);f<d;)l=l.then(e[f++],e[f++]);return l}d=s.length;let h=t;for(;f<d;){const e=s[f++],t=s[f++];try{h=e(h)}catch(e){t.call(this,e);break}}try{l=ve.call(this,h)}catch(e){return Promise.reject(e)}for(f=0,d=c.length;f<d;)l=l.then(c[f++],c[f++]);return l}getUri(e){return f(z((e=X(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}o.a.forEach(["delete","get","head","options"],(function(e){Ce.prototype[e]=function(t,n){return this.request(X(n||{},{method:e,url:t,data:(n||{}).data}))}})),o.a.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(X(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ce.prototype[e]=t(),Ce.prototype[e+"Form"]=t(!0)}));var we=Ce;class Se{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new U(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Se((function(t){e=t})),cancel:e}}}var Re=Se;const be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(be).forEach(([e,t])=>{be[t]=e});var Oe=be;const Ie=function e(t){const n=new we(t),r=Object(i.a)(we.prototype.request,n);return o.a.extend(r,we.prototype,n,{allOwnKeys:!0}),o.a.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(X(t,n))},r}(b);Ie.Axios=we,Ie.CanceledError=U,Ie.CancelToken=Re,Ie.isCancel=k,Ie.VERSION="1.12.2",Ie.toFormData=a.a,Ie.AxiosError=p.a,Ie.Cancel=Ie.CanceledError,Ie.all=function(e){return Promise.all(e)},Ie.spread=function(e){return function(t){return e.apply(null,t)}},Ie.isAxiosError=function(e){return o.a.isObject(e)&&!0===e.isAxiosError},Ie.mergeConfig=X,Ie.AxiosHeaders=N,Ie.formToJSON=e=>S(o.a.isHTMLForm(e)?new FormData(e):e),Ie.getAdapter=pe,Ie.HttpStatusCode=Oe,Ie.default=Ie;var Ae=Ie;const{Axios:Le,AxiosError:De,CanceledError:Pe,isCancel:Ne,CancelToken:xe,VERSION:ke,all:_e,Cancel:Ue,isAxiosError:Me,spread:Fe,toFormData:Be,AxiosHeaders:je,HttpStatusCode:Ge,formToJSON:He,getAdapter:qe,mergeConfig:Ve}=Ae},function(e,t,n){"use strict";const r=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);e.exports=e=>!r.has(e&&e.code)},function(e,t,n){"use strict";(function(e){var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"SDKProvider",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"uuidv4",{enumerable:!0,get:function(){return s.uuidv4}});var o=r(n(24)),i=r(n(25)),a=r(n(26)),s=n(20);!function(){if(void 0===e.window&&(e.window=e),!window)throw new Error("window object not found");"Microsoft"in window||(window.Microsoft={}),"CRM"in window.Microsoft||(window.Microsoft.CRM={}),"Omnichannel"in window.Microsoft.CRM||(window.Microsoft.CRM.Omnichannel={}),"SDK"in window.Microsoft.CRM.Omnichannel||(window.Microsoft.CRM.Omnichannel.SDK={SDKProvider:a.default,Util:{uuidv4:s.uuidv4}}),window.document&&o.default.raiseCustomEvent(i.default.OCSDKLOAD)}()}).call(this,n(7))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"raiseCustomEvent",value:function(t,n){var r=e.createCustomEvent(t,n);window.dispatchEvent(r)}},{key:"createCustomEvent",value:function(e,t){var n=t?{detail:t}:void 0,r=null;try{r=new CustomEvent(e,n)}catch(t){(r=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n)}return r}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"OCSDKLOAD",get:function(){return"oc:sdk:load"}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=r(n(9)),s=r(n(27)),u=r(n(29)),c=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getSDK",value:function(e,t,n){var r=new s.default(n);return new u.default({channelId:e.channelId||a.default.defaultChannelId,orgId:e.orgId,orgUrl:e.orgUrl,widgetId:e.widgetId},t||{},r)}}]),e}();t.default=c},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=r(n(5)),s=r(n(28)),u=function(){function e(t){(0,o.default)(this,e),(0,a.default)(this,"logger",void 0),this.logger=t}return(0,i.default)(e,[{key:"log",value:function(e,t,n,r){if(this.isLoggingEnabled()){var o=s.default.GETTELEMETRYEVENTDATA(t,n,r);this.logEvent(e,o)}}},{key:"logEvent",value:function(e,t){this.isLoggingEnabled()&&this.logger.logClientSdkTelemetryEvent(e,t)}},{key:"isLoggingEnabled",value:function(){return!this.isNullOrUndefined(this.logger)}},{key:"isNullOrUndefined",value:function(e){return null==e}}]),e}();t.default=u},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"GETTELEMETRYEVENTDATA",value:function(e,t,n){return{Description:n,ElapsedTimeInMilliseconds:t.ElapsedTimeInMilliseconds,HttpRequestResponseTime:t.HttpRequestResponseTime,Event:e,ExceptionDetails:t.ExceptionDetails,Region:t.Region,RequestId:t.RequestId,TransactionId:t.TransactionId,RequestHeaders:t.RequestHeaders,RequestPayload:t.RequestPayload,RequestPath:t.RequestPath,RequestMethod:t.RequestMethod,ResponseStatusCode:t.ResponseStatusCode,ResponseErrorcode:t.ResponseErrorcode,AuthTokenDetails:t.AuthTokenDetails}}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(2),o=n(10);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(30)),a=r(n(32)),s=r(n(10)),u=r(n(3)),c=r(n(4)),l=r(n(5)),d=n(8),f=r(n(21)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var n=x(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(15)),p=n(39),g=r(n(9)),v=n(40),m=n(41),E=r(n(42)),T=r(n(44)),y=n(45),C=n(46),w=n(47),S=r(n(18)),R=r(n(13)),b=r(n(48)),O=n(49),I=n(50),A=n(57),L=r(n(58)),D=r(n(59)),P=n(20),N=n(60);function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(x=function(e){return e?n:t})(e)}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){(0,l.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var F=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.defaultConfiguration,o=arguments.length>2?arguments[2]:void 0;(0,u.default)(this,e),this.omnichannelConfiguration=t,this.configuration=r,this.logger=o,(0,l.default)(this,"liveChatVersion",void 0),(0,l.default)(this,"sessionId",void 0),(0,l.default)(this,"ocUserAgent",void 0),(0,l.default)(this,"HTTPTimeOutErrorMessage","".concat(d.SDKError.ClientHTTPTimeoutErrorName,": ").concat(d.SDKError.ClientHTTPTimeoutErrorMessage)),(0,l.default)(this,"setAuthCodeNonce",(function(e){null!=e&&e.authcodenonce&&(n.configuration.authCodeNonce=null==e?void 0:e.authcodenonce)})),(0,l.default)(this,"setSessionIdHeader",(function(e,t){e&&(t[R.default.ocSessionId]=e)})),(0,l.default)(this,"setRequestIdHeader",(function(e,t){e&&(t[R.default.requestId]=e)})),(0,l.default)(this,"setCorrelationIdInHeader",(function(e,t){e&&(t[R.default.correlationId]=e)})),Object.keys(this.configuration).length&&"object"===(0,s.default)(r)||(this.configuration=e.defaultConfiguration);for(var i=0,a=Object.keys(e.defaultConfiguration);i<a.length;i++){var c=a[i];this.configuration.hasOwnProperty(c)||(this.configuration["".concat(c)]=e.defaultConfiguration["".concat(c)])}for(var f=0,h=Object.keys(e.defaultConfiguration.requestTimeoutConfig);f<h.length;f++){var p=h[f];this.configuration.requestTimeoutConfig.hasOwnProperty(p)||(this.configuration.requestTimeoutConfig["".concat(p)]=e.defaultConfiguration.requestTimeoutConfig["".concat(p)])}var v=t.channelId;if(!Object.values(d.ChannelId).includes(v))throw new Error("Invalid channelId");var m,E=Object.keys(t),T=U(g.default.requiredOmnichannelConfigurationParameters);try{for(T.s();!(m=T.n()).done;){var y=m.value;if(!E.includes(y))throw new Error("Missing '".concat(y,"' in OmnichannelConfiguration"))}}catch(e){T.e(e)}finally{T.f()}this.ocUserAgent=this.configuration.ocUserAgent,this.liveChatVersion=d.LiveChatVersion.V2}var t,n,r,o,N,x,k,M,F,B,j,G,H,q,V,W,K,Y,z;return(0,c.default)(e,[{key:"getLcwFcsDetails",value:(z=(0,a.default)(i.default.mark((function e(){var t,n,r,o,a,s,u,c,l,p,g,v,m,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLCWFCSDETAILSSTARTED,"Get LCW FCS details started",""),n="/".concat(S.default.LcwFcsDetailsPath,"/").concat(this.omnichannelConfiguration.orgId),r="GET",o="".concat(this.omnichannelConfiguration.orgUrl).concat(n),a=f.default.create(),(0,h.default)(a,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatConfig}),s={},(0,I.addOcUserAgentHeader)(this.ocUserAgent,s),u=O.Timer.TIMER(),e.prev=10,e.next=13,a.get(o,{headers:s,timeout:null!==(c=this.configuration.defaultRequestTimeout)&&void 0!==c?c:this.configuration.requestTimeoutConfig.getChatConfig});case 13:return l=e.sent,p=u.milliSecondsElapsed,g=t.milliSecondsElapsed,v=l.data,this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLCWFCSDETAILSSUCCEEDED,"Get LCW FCS details succeeded","",l,g,n,r,void 0,void 0,s,p),e.abrupt("return",v);case 21:throw e.prev=21,e.t0=e.catch(10),m=u.milliSecondsElapsed,E=t.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETLCWFCSDETAILSFAILED,"Get LCW FCS details failed","",void 0,E,n,r,e.t0,void 0,s,m),e.t0;case 27:case"end":return e.stop()}}),e,this,[[10,21]])}))),function(){return z.apply(this,arguments)})},{key:"getChatConfig",value:(Y=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,s,u,c,l,p,v,m,E,T,C,w,R=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=R.length>1&&void 0!==R[1]&&R[1],r=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATCONFIGFSTARTED,"Get Chat config started",t),t||(t=(0,P.uuidv4)()),o="/".concat(S.default.LiveChatConfigPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"?requestId=").concat(t,"&channelId=").concat(this.omnichannelConfiguration.channelId),a="GET",s="".concat(this.omnichannelConfiguration.orgUrl).concat(o),u=f.default.create(),(0,h.default)(u,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatConfig}),c={},this.addDefaultHeaders(t,c),n&&(c=_(_({},g.default.bypassCacheHeaders),c)),l=O.Timer.TIMER(),e.prev=13,e.next=16,u.get(s,{headers:c,timeout:null!==(p=this.configuration.defaultRequestTimeout)&&void 0!==p?p:this.configuration.requestTimeoutConfig.getChatConfig});case 16:return v=e.sent,m=l.milliSecondsElapsed,E=r.milliSecondsElapsed,(T=v.data).LiveChatVersion&&(this.liveChatVersion=T.LiveChatVersion),T.headers={},v.headers&&v.headers.date&&(T.headers.date=v.headers.date),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATCONFIGSUCCEEDED,"Get Chat config succeeded",t,v,E,o,a,void 0,void 0,c,m),e.abrupt("return",T);case 27:return e.prev=27,e.t0=e.catch(13),C=l.milliSecondsElapsed,w=r.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETCHATCONFIGFAILED,"Get Chat config failed",t,void 0,w,o,a,e.t0,void 0,c,C),e.abrupt("return",Promise.reject(e.t0));case 33:case"end":return e.stop()}}),e,this,[[13,27]])}))),function(e){return Y.apply(this,arguments)})},{key:"getLWIDetails",value:(K=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w=this,b=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLWISTATUSSTARTED,"Get LWI Details Started",t),t||(t=(0,P.uuidv4)()),s="/".concat(S.default.LiveChatLiveWorkItemDetailsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),u=f.default.create(),(0,h.axiosRetryHandlerWithNotFound)(u,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getLWIDetails}),c=r.authenticatedUserToken,l=r.reconnectId,p=g.default.defaultHeaders,c&&(s="/".concat(S.default.LiveChatAuthLiveWorkItemDetailsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),p[R.default.authenticatedUserToken]=c,p[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,p),v=!c&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,l&&(v||(s+="/".concat(l))),m={channelId:this.omnichannelConfiguration.channelId},l&&v&&(m.sig=l),E="".concat(this.omnichannelConfiguration.orgUrl).concat(s),C={headers:p,method:T="GET",url:E,params:m,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getLWIDetails},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,c,l,f,h,v,m,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,u(C);case 4:c=e.sent,l=a.milliSecondsElapsed,f=o.milliSecondsElapsed,h=c.data,v=c.headers,w.setAuthCodeNonce(v),w.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETLWISTATUSSUCCEEDED,"Get LWI Details succeeded",t,c,f,s,T,void 0,void 0,p,l),n(h),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),m=a.milliSecondsElapsed,E=o.milliSecondsElapsed,w.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETLWISTATUSFAILED,"Get LWI Details failed",t,void 0,E,s,T,e.t0,void 0,p,m),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(w.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 19:case"end":return e.stop()}}),e,this)}))),function(e){return K.apply(this,arguments)})},{key:"getChatToken",value:(W=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w,S,b,I,D,N,x=this,k=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=k.length>1&&void 0!==k[1]?k[1]:{},o=k.length>2&&void 0!==k[2]?k[2]:0,s=O.Timer.TIMER(),u=r.reconnectId,c=r.authenticatedUserToken,l=r.currentLiveChatVersion,p=r.refreshToken,v=r.MsOcBotApplicationId,m=!!(v&&v.length>0),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTOKENSTARTED,"Get Chat Token Started",t),!(o<0)){e.next=8;break}throw new Error("Invalid currentRetryCount");case 8:return t||(t=(0,P.uuidv4)()),E=g.default.defaultHeaders,this.addDefaultHeaders(t,E),T=(0,A.createGetChatTokenEndpoint)(l||this.liveChatVersion,!!c,m),c&&(E[R.default.authenticatedUserToken]=c,E[R.default.authCodeNonce]=this.configuration.authCodeNonce),C="/".concat(T,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),w=!c&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,u&&(w||(C+="/".concat(u))),S={channelId:this.omnichannelConfiguration.channelId},v&&v.length>0&&(S["Ms-Oc-Bot-Application-Id"]=v),p&&(S.refreshToken="true"),u&&w&&(S.sig=u),b="".concat(this.omnichannelConfiguration.orgUrl).concat(C),D={headers:E,method:I="GET",url:b,params:S,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getChatToken},N=f.default.create(),(0,h.default)(N,{headerOverwrites:[R.default.authCodeNonce],retries:o>this.configuration.maxRequestRetriesOnFailure?o:this.configuration.maxRequestRetriesOnFailure,retryOn429:this.configuration.getChatTokenRetryOn429,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatToken}),e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,c,l,f,h,p,v;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,N(D);case 4:if(a=e.sent,c=o.milliSecondsElapsed,l=s.milliSecondsElapsed,f=a.data,h=a.headers,x.setAuthCodeNonce(h),h&&h[R.default.ocSessionId.toLowerCase()]&&(x.sessionId=h[R.default.ocSessionId.toLowerCase()]),!f){e.next=18;break}if(0!==Object.keys(f).length){e.next=14;break}return r(new Error("Empty data received from getChatToken")),e.abrupt("return");case 14:return f.requestId=t,x.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTOKENSUCCEEDED,"Get Chat Token succeeded",t,a,l,C,I,void 0,void 0,E,c),n(f),e.abrupt("return");case 18:if(!u||a.status!==g.default.noContentStatusCode){e.next=21;break}return r(a),e.abrupt("return");case 21:e.next=30;break;case 23:e.prev=23,e.t0=e.catch(1),p=o.milliSecondsElapsed,v=s.milliSecondsElapsed,x.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETCHATTOKENFAILED,"Get Chat Token failed",t,void 0,v,C,I,e.t0,void 0,E,p),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(x.HTTPTimeOutErrorMessage)),r(e.t0);case 30:case"end":return e.stop()}}),e,null,[[1,23]])})));return function(t,n){return e.apply(this,arguments)}}()));case 26:case"end":return e.stop()}}),e,this)}))),function(e){return W.apply(this,arguments)})},{key:"getReconnectableChats",value:(V=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,h,p,v=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.Timer.TIMER(),o=t.authenticatedUserToken,this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTABLECHATSSTARTED,"Get Reconnectable chat Started"),s=null==t?void 0:t.requestId,u="/".concat(S.default.LiveChatGetReconnectableChatsPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(s,"?channelId=").concat(this.omnichannelConfiguration.channelId),(c=g.default.defaultHeaders)[R.default.authenticatedUserToken]=o,c[R.default.authCodeNonce]=this.configuration.authCodeNonce,this.addDefaultHeaders(s,c),l="".concat(this.omnichannelConfiguration.orgUrl).concat(u),h={headers:c,method:"GET",url:l,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getReconnectableChats},p=f.default.create(),e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(t,n){var o,a,l,f,m,E,T,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,p(h);case 4:if(a=e.sent,l=o.milliSecondsElapsed,f=r.milliSecondsElapsed,m=a.data,E=a.headers,v.setAuthCodeNonce(E),!m){e.next=13;break}return v.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTABLECHATSSUCCEEDED,"Get Reconnectable Chats Succeeded and old session returned",s,a,f,u,"GET",void 0,void 0,c,l),t(m),e.abrupt("return");case 13:return t(),e.abrupt("return");case 17:return e.prev=17,e.t0=e.catch(1),T=o.milliSecondsElapsed,C=r.milliSecondsElapsed,v.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETRECONNECTABLECHATSFAILED,"Get Reconnectable Chats failed",s,void 0,C,u,"GET",e.t0,void 0,c,T),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&n(new Error(v.HTTPTimeOutErrorMessage)),n(e.t0),e.abrupt("return");case 25:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t,n){return e.apply(this,arguments)}}()));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return V.apply(this,arguments)})},{key:"getReconnectAvailability",value:(q=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,h,p,v=this,m=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=m.length>1&&void 0!==m[1]?m[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSTARTED,"Get Reconnectable availability Started"),s="/".concat(S.default.LiveChatReconnectAvailabilityPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),u=g.default.defaultHeaders,this.addDefaultHeaders(null==r?void 0:r.requestId,u),c="".concat(this.omnichannelConfiguration.orgUrl).concat(s),h={headers:u,method:l="GET",url:c,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getReconnectAvailability},p=f.default.create(),e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(t,n){var a,c,f,m,E,T,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,p(h);case 4:if(c=e.sent,f=a.milliSecondsElapsed,m=o.milliSecondsElapsed,!(E=c.data)){e.next=12;break}return v.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSUCCEEDED,"Get Reconnect availability succeeded",null==r?void 0:r.requestId,c,m,s,l,void 0,void 0,u,f),t(E),e.abrupt("return");case 12:return v.logWithLogger(y.LogLevel.WARN,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYSUCCEEDED,"Get Reconnect availability didn't send any valid data",null==r?void 0:r.requestId,c,m,s,l,void 0,void 0,u,f),t(),e.abrupt("return");case 17:return e.prev=17,e.t0=e.catch(1),T=a.milliSecondsElapsed,C=o.milliSecondsElapsed,v.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETRECONNECTAVAILABILITYFAILED,"Get Reconnect Availability failed",null==r?void 0:r.requestId,void 0,C,s,l,e.t0,void 0,u,T),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&n(new Error(v.HTTPTimeOutErrorMessage)),n(e.t0),e.abrupt("return");case 25:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t,n){return e.apply(this,arguments)}}()));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return q.apply(this,arguments)})},{key:"getAgentAvailability",value:(H=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,C,I,A,D,P,N,x,k,_=this,U=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=U.length>1&&void 0!==U[1]?U[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETAGENTAVAILABILITYSTARTED,"Get agent availability Started",t),s="/".concat(S.default.GetAgentAvailabilityPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=lcw"),u=f.default.create(),(0,h.default)(u,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getAgentAvailability}),c=r.authenticatedUserToken,l=r.initContext,C=r.getContext,I=g.default.defaultHeaders,c&&(I[R.default.authenticatedUserToken]=c,I[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,I),A=l||{},D={orgId:this.omnichannelConfiguration.orgId,widgetId:this.omnichannelConfiguration.widgetId},A&&A.customContextData&&(P=v.CustomContextData.sort(A.customContextData),Object.assign(D,{customContext:P})),A.portalcontactid&&Object.assign(D,{portalcontactid:A.portalcontactid}),A.cacheKey=(0,b.default)(JSON.stringify(D)).toString(E.default),!C||window.document){e.next=17;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 17:if(C&&(A.browser=p.BrowserInfo.getBrowserName(),A.device=m.DeviceInfo.getDeviceType(),A.originurl=window.location.href,A.os=w.OSInfo.getOsType()),A.locale||(A.locale=g.default.defaultLocale),!A.locale||T.default.supportedLocales.includes(A.locale)){e.next=21;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(A.locale,"'"))));case 21:return N="".concat(this.omnichannelConfiguration.orgUrl).concat(s),k={data:A,headers:I,method:x="POST",url:N,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getAgentAvailability},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,c,l,f,h,p,v,m;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,u(k);case 4:c=e.sent,l=a.milliSecondsElapsed,f=o.milliSecondsElapsed,h=c.data,p=c.headers,_.setAuthCodeNonce(p),h&&(_.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETAGENTAVAILABILITYSUCCEEDED,"Get agent availability succeeded",t,c,f,s,x,void 0,void 0,I,l),n(h)),e.next=21;break;case 12:if(e.prev=12,e.t0=e.catch(1),v=a.milliSecondsElapsed,m=o.milliSecondsElapsed,_.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETAGENTAVAILABILITYFAILED,"Get agent availability failed",t,void 0,m,s,x,e.t0,void 0,I,v),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=20;break}return r(new Error(_.HTTPTimeOutErrorMessage)),e.abrupt("return");case 20:r(e.t0);case 21:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t,n){return e.apply(this,arguments)}}()));case 25:case"end":return e.stop()}}),e,this)}))),function(e){return H.apply(this,arguments)})},{key:"sessionInit",value:(G=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,v,E,C,b,I,A,P,N,x,k,U,M,F,B=this,j=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=j.length>1&&void 0!==j[1]?j[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONINITSTARTED,"Session Init Started",t),s=f.default.create(),u=!0,(0,h.default)(s,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionInit,shouldRetry:function(e){return(0,D.default)(e,u)},headerOverwrites:[R.default.authCodeNonce]}),c=r.reconnectId,v=r.authenticatedUserToken,E=r.initContext,C=r.getContext,b=E||{},I=_({},g.default.defaultHeaders),A=v?S.default.LiveChatAuthSessionInitPath:S.default.LiveChatSessionInitPath,P="/".concat(A,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),v&&Object.assign(I,(N={},(0,l.default)(N,R.default.authenticatedUserToken,v),(0,l.default)(N,R.default.authCodeNonce,this.configuration.authCodeNonce),N)),this.addDefaultHeaders(t,I),this.setRequestIdHeader(t,I),x=!v&&!0===this.configuration.useUnauthReconnectIdSigQueryParam,c&&(x||(P+="/".concat(c))),k={channelId:this.omnichannelConfiguration.channelId},c&&x&&(k.sig=c),!C||window.document){e.next=20;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 20:if(C&&(b.browser=p.BrowserInfo.getBrowserName(),b.device=m.DeviceInfo.getDeviceType(),b.originurl=window.location.href,b.os=w.OSInfo.getOsType()),b.locale||(b.locale=g.default.defaultLocale),!b.locale||T.default.supportedLocales.includes(b.locale)){e.next=24;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(b.locale,"'"))));case 24:return U="".concat(this.omnichannelConfiguration.orgUrl).concat(P),F={data:b,headers:I,method:M="POST",url:U,params:k,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionInit},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,u,c,l,f,h,p;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,s(F);case 4:u=e.sent,c=a.milliSecondsElapsed,l=o.milliSecondsElapsed,f=u.headers,B.setAuthCodeNonce(f),B.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONINITSUCCEEDED,"Session Init Succeeded",t,u,l,P,M,void 0,b,I,c),n(),e.next=22;break;case 13:if(e.prev=13,e.t0=e.catch(1),h=a.milliSecondsElapsed,p=o.milliSecondsElapsed,B.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SESSIONINITFAILED,"Session Init failed",t,void 0,p,P,M,e.t0,b,I,h),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=21;break}return r(new Error(B.HTTPTimeOutErrorMessage)),e.abrupt("return");case 21:r(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 28:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"createConversation",value:(j=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,s,u,c,v,E,C,b,I,A,P,N,x,k,U,M,F,B,j,G,H,q,V=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=V.length>1&&void 0!==V[1]?V[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.CREATESESSIONSTARTED,"Create conversation call Started",t),a=f.default.create(),s=!0,(0,h.default)(a,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionInit,shouldRetry:function(e){return(0,D.default)(e,s)},headerOverwrites:[R.default.authCodeNonce]}),u=r.reconnectId,c=r.authenticatedUserToken,v=r.initContext,E=r.getContext,C=v||{},b=_({},g.default.defaultHeaders),I=c?S.default.LiveChatConnectorAuthPath:S.default.LiveChatConnectorPath,A="/".concat(I,"/").concat(this.omnichannelConfiguration.orgId,"/widgetApp/").concat(this.omnichannelConfiguration.widgetId,"/conversation"),c&&Object.assign(b,(P={},(0,l.default)(P,R.default.authenticatedUserToken,c),(0,l.default)(P,R.default.authCodeNonce,this.configuration.authCodeNonce),P)),this.addDefaultHeaders(t,b),this.setRequestIdHeader(t,b),u&&(C.reconnectId=u),C.channelId=this.omnichannelConfiguration.channelId,!E||window.document){e.next=18;break}return e.abrupt("return",Promise.reject(new Error("getContext is only supported on web browsers")));case 18:if(E&&(C.browser=p.BrowserInfo.getBrowserName(),C.device=m.DeviceInfo.getDeviceType(),C.originurl=window.location.href,C.os=w.OSInfo.getOsType()),C.locale||(C.locale=g.default.defaultLocale),!C.locale||T.default.supportedLocales.includes(C.locale)){e.next=22;break}return e.abrupt("return",Promise.reject(new Error("Unsupported locale: '".concat(C.locale,"'"))));case 22:return N="".concat(this.omnichannelConfiguration.orgUrl).concat(A),k={data:C,headers:b,method:x="POST",url:N,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionInit},U=O.Timer.TIMER(),e.prev=26,e.next=29,a(k);case 29:if(M=e.sent,F=U.milliSecondsElapsed,B=o.milliSecondsElapsed,j=M.data,G=M.headers,this.setAuthCodeNonce(G),G&&G[R.default.ocSessionId.toLowerCase()]&&(this.sessionId=G[R.default.ocSessionId.toLowerCase()]),0!==Object.keys(j).length){e.next=37;break}throw new Error("Empty data received from getChatToken");case 37:return j.requestId=t,this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.CREATESESSIONSUCCEEDED,"Create coversation call Succeeded",t,M,B,A,x,void 0,void 0,b,F),e.abrupt("return",j);case 42:if(e.prev=42,e.t0=e.catch(26),H=U.milliSecondsElapsed,q=o.milliSecondsElapsed,this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.CREATESESSIONFAILED,"Create conversation call failed",t,void 0,q,A,x,e.t0,C,b,H),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=49;break}throw new Error(this.HTTPTimeOutErrorMessage);case 49:throw e.t0;case 50:case"end":return e.stop()}}),e,this,[[26,42]])}))),function(e){return j.apply(this,arguments)})},{key:"sessionClose",value:(B=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w,b=this,I=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=I.length>1&&void 0!==I[1]?I[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONCLOSESTARTED,"Session Close Started",t),s="/".concat(S.default.LiveChatSessionClosePath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),u=f.default.create(),(0,h.default)(u,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.sessionClose}),c=r.authenticatedUserToken,l=r.isReconnectChat,p=r.isPersistentChat,v=r.chatId,m=g.default.defaultHeaders,(E={}).chatId=v,c&&(s="/".concat(S.default.LiveChatAuthSessionClosePath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),m[R.default.authenticatedUserToken]=c,m[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,m),l&&(s+="&isReconnectChat=true"),p&&(s+="&isPersistentChat=true"),T="".concat(this.omnichannelConfiguration.orgUrl).concat(s),w={data:E,headers:m,method:C="POST",url:T,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.sessionClose},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,c,l,f,h,p,v;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,u(w);case 4:c=e.sent,l=a.milliSecondsElapsed,f=c.headers,b.setAuthCodeNonce(f),h=o.milliSecondsElapsed,b.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SESSIONCLOSESUCCEEDED,"Session Close succeeded",t,c,h,s,C,void 0,void 0,m,l),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),p=a.milliSecondsElapsed,v=o.milliSecondsElapsed,b.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SESSIONCLOSEFAILED,"Session close failed",t,void 0,v,s,C,e.t0,void 0,m,p),e.t0.code===g.default.axiosTimeoutErrorCode&&r(new Error(b.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return B.apply(this,arguments)})},{key:"validateAuthChatRecord",value:(F=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDSTARTED,"Validate Auth Chat Record Started",t),s=n.authenticatedUserToken,u=n.chatId,c="/".concat(S.default.LiveChatValidateAuthChatMapRecordPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(u,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=f.default.create(),(0,h.default)(l,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.validateAuthChatRecord}),p=g.default.defaultHeaders,s&&(p[R.default.authenticatedUserToken]=s,p[R.default.authCodeNonce]=this.configuration.authCodeNonce),this.addDefaultHeaders(t,p),v="".concat(this.omnichannelConfiguration.orgUrl).concat(c),m={headers:p,method:"GET",url:v,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.validateAuthChatRecordTimeout},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,s,u,f,h,v,T,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,l(m);case 4:u=e.sent,f=a.milliSecondsElapsed,h=u.headers,E.setAuthCodeNonce(h),v=o.milliSecondsElapsed,!0===(null===(s=u.data)||void 0===s?void 0:s.authChatExist)?(E.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDSUCCEEDED,"Validate Auth Chat Record succeeded",t,u,v,c,"GET",void 0,void 0,p,f),n(u.data)):(E.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDFAILED,"Validate Auth Chat Record Failed. Record is not found or request is not authorized",t,u,v,c,"GET",void 0,void 0,p,f),r(new Error("Validate Auth Chat Record Failed. Record is not found or request is not authorized"))),e.next=19;break;case 12:e.prev=12,e.t0=e.catch(1),T=a.milliSecondsElapsed,C=o.milliSecondsElapsed,E.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.VALIDATEAUTHCHATRECORDFAILED,"Validate Auth Chat Record failed",t,void 0,C,c,"GET",e.t0,void 0,p,T),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(E.HTTPTimeOutErrorMessage)),"Error: Request failed with status code 404"===e.t0.toString()?n({}):r(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t,n){return e.apply(this,arguments)}}()));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return F.apply(this,arguments)})},{key:"submitPostChatResponse",value:(M=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E,T=this,C=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=C.length>2&&void 0!==C[2]?C[2]:{},s=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SUBMITPOSTCHATSTARTED,"Submit Post Chat Started",t),u="/".concat(S.default.LiveChatSubmitPostChatPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),c=f.default.create(),(0,h.default)(c,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.submitPostChatResponse}),l=o.authenticatedUserToken,p=g.default.defaultHeaders,this.addDefaultHeaders(t,p),l&&(u="/".concat(S.default.LiveChatAuthSubmitPostChatPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),p[R.default.authenticatedUserToken]=l,p[R.default.authCodeNonce]=this.configuration.authCodeNonce),v="".concat(this.omnichannelConfiguration.orgUrl).concat(u),m="POST",E={data:JSON.stringify(n),headers:p,method:m,url:v,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.submitPostChatResponse},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,l,f,h,v,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,c(E);case 4:a=e.sent,l=o.milliSecondsElapsed,f=a.headers,T.setAuthCodeNonce(f),h=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SUBMITPOSTCHATSUCCEEDED,"Submit Post Chat succeeded",t,a,h,u,m,void 0,void 0,p,l),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),v=o.milliSecondsElapsed,C=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SUBMITPOSTCHATFAILED,"Submit Post Chat Failed",t,void 0,C,u,m,e.t0,void 0,p,v),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(T.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return M.apply(this,arguments)})},{key:"getSurveyInviteLink",value:(k=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E,T,C=this,w=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=w.length>2&&void 0!==w[2]?w[2]:{},s=O.Timer.TIMER(),this.logger&&this.logger.log(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETSURVEYINVITELINKSTARTED,{SurveyOwnerId:t},"Get Survey Invite Link Started"),u="/".concat(S.default.LiveChatGetSurveyInviteLinkPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(t),c=f.default.create(),(0,h.default)(c,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getSurveyInviteLink}),l=o.authenticatedUserToken,p=o.requestId,v=g.default.defaultHeaders,l&&(u="/".concat(S.default.LiveChatAuthGetSurveyInviteLinkPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(t),v[R.default.authenticatedUserToken]=l,v[R.default.authCodeNonce]=this.configuration.authCodeNonce,v[R.default.widgetAppId]=this.omnichannelConfiguration.widgetId),this.addDefaultHeaders(p,v),p&&(v[R.default.requestId]=p),m="".concat(this.omnichannelConfiguration.orgUrl).concat(u),E="POST",T={data:JSON.stringify(n),headers:v,method:E,url:m,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.getSurveyInviteLink},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(t,n){var r,o,a,l,f,h,m,w;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.Timer.TIMER(),e.prev=1,e.next=4,c(T);case 4:o=e.sent,a=r.milliSecondsElapsed,l=o.data,f=o.headers,C.setAuthCodeNonce(f),h=s.milliSecondsElapsed,C.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETSURVEYINVITELINKSUCCEEDED,"Get Survey Invite Link Succeeded",p,o,h,u,E,void 0,void 0,v,a),t(l),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),m=r.milliSecondsElapsed,w=s.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETSURVEYINVITELINKFAILED,"Get Survey Invite Link failed",p,void 0,w,u,E,e.t0,void 0,v,m),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&n(new Error(C.HTTPTimeOutErrorMessage)),n(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"getChatTranscripts",value:(x=(0,a.default)(i.default.mark((function e(t,n,r){var o,s,u,c,l,p,v,m,E,T,C,w=this,b=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=b.length>3&&void 0!==b[3]?b[3]:{},u=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTRANSCRIPTSTARTED,"Get Chat Transcript Started",t),c="/".concat(S.default.LiveChatGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=f.default.create(),(0,h.default)(l,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getChatTranscripts}),p=s.authenticatedUserToken,v=s.currentLiveChatVersion,(m=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,m[R.default.widgetAppId]=this.omnichannelConfiguration.widgetId,m[R.default.authorization]=r,this.liveChatVersion===d.LiveChatVersion.V2||v&&v===d.LiveChatVersion.V2?(c="/".concat(S.default.LiveChatv2GetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),p&&(m[R.default.authenticatedUserToken]=p,m[R.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(S.default.LiveChatv2AuthGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId))):p&&(m[R.default.authenticatedUserToken]=p,m[R.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(S.default.LiveChatAuthGetChatTranscriptPath,"/").concat(n,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId)),this.addDefaultHeaders(t,m),E="".concat(this.omnichannelConfiguration.orgUrl).concat(c),C={headers:m,method:T="GET",url:E,timeout:null!==(o=this.configuration.defaultRequestTimeout)&&void 0!==o?o:this.configuration.requestTimeoutConfig.getChatTranscripts},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,s,f,h,p,v,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,l(C);case 4:a=e.sent,s=o.milliSecondsElapsed,f=u.milliSecondsElapsed,h=a.data,p=a.headers,w.setAuthCodeNonce(p),w.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETCHATTRANSCRIPTSUCCEEDED,"Get Chat Transcript succeeded",t,a,f,c,T,void 0,void 0,m,s),n(h),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),v=o.milliSecondsElapsed,E=u.milliSecondsElapsed,w.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETCHATTRANSCRIPTFAILED,"Get Chat Transcript failed",t,void 0,E,c,T,e.t0,void 0,m,v),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(w.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 17:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return x.apply(this,arguments)})},{key:"getPersistentChatHistory",value:(N=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p,v,m,E,T,C,w,b=this,I=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=I.length>1&&void 0!==I[1]?I[1]:{},o=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYSTARTED,"Get Persistent Chat History Started",t),s=r.authenticatedUserToken,u=r.pageSize,c=r.pageToken,s){e.next=8;break}return l="Authenticated user token is required for persistent chat history",this.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYFAILED,"Get Persistent Chat History failed - Missing authenticated user token",t),e.abrupt("return",Promise.reject(new Error(l)));case 8:return p="/".concat(S.default.LiveChatAuthGetPersistentChatHistoryPath,"/").concat(this.omnichannelConfiguration.orgId,"/widgetapp/").concat(this.omnichannelConfiguration.widgetId,"/conversation/history"),v=f.default.create(),(0,h.default)(v,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.getPersistentChatHistory}),(m=_({},g.default.defaultHeaders))[R.default.authenticatedUserToken]=s,m[R.default.authCodeNonce]=this.configuration.authCodeNonce,c&&(m[R.default.pageToken]=c),this.addDefaultHeaders(t,m),E={},u&&(E.pageSize=u.toString()),T="".concat(this.omnichannelConfiguration.orgUrl).concat(p),w={headers:m,method:C="GET",url:T,params:E,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.getPersistentChatHistory},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var a,s,u,c,l,f,h,E;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=O.Timer.TIMER(),e.prev=1,e.next=4,v(w);case 4:s=e.sent,u=a.milliSecondsElapsed,c=o.milliSecondsElapsed,l=s.data,f=s.headers,b.setAuthCodeNonce(f),b.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYSUCCEEDED,"Get Persistent Chat History succeeded",t,s,c,p,C,void 0,void 0,m,u),n(l),e.next=22;break;case 13:if(e.prev=13,e.t0=e.catch(1),h=a.milliSecondsElapsed,E=o.milliSecondsElapsed,b.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.GETPERSISTENTCHATHISTORYFAILED,"Get Persistent Chat History failed",t,void 0,E,p,C,e.t0,void 0,m,h),!(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)){e.next=21;break}return r(new Error(b.HTTPTimeOutErrorMessage)),e.abrupt("return");case 21:r(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 22:case"end":return e.stop()}}),e,this)}))),function(e){return N.apply(this,arguments)})},{key:"emailTranscript",value:(o=(0,a.default)(i.default.mark((function e(t,n,r){var o,s,u,c,l,p,v,m,E,T,C=this,w=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=w.length>3&&void 0!==w[3]?w[3]:{},u=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.EMAILTRANSCRIPTSTARTED,"Email Transcript Started",t),c="/".concat(S.default.LiveChatTranscriptEmailRequestPath,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId),l=f.default.create(),(0,h.default)(l,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.emailTranscript}),p=s.authenticatedUserToken,(v=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,v[R.default.widgetAppId]=this.omnichannelConfiguration.widgetId,v[R.default.authorization]=n,p&&(v[R.default.authenticatedUserToken]=p,v[R.default.authCodeNonce]=this.configuration.authCodeNonce,c="/".concat(S.default.LiveChatAuthTranscriptEmailRequestPath,"/").concat(t,"?channelId=").concat(this.omnichannelConfiguration.channelId)),this.addDefaultHeaders(t,v),m="".concat(this.omnichannelConfiguration.orgUrl).concat(c),E="POST",T={data:JSON.stringify(r),headers:v,method:E,url:m,timeout:null!==(o=this.configuration.defaultRequestTimeout)&&void 0!==o?o:this.configuration.requestTimeoutConfig.emailTranscript},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,s,f,h,p,m;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,l(T);case 4:a=e.sent,s=o.milliSecondsElapsed,f=a.headers,C.setAuthCodeNonce(f),h=u.milliSecondsElapsed,C.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.EMAILTRANSCRIPTSUCCEEDED,"Email Transcript succeeded",t,a,h,c,E,void 0,void 0,v,s),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),p=o.milliSecondsElapsed,m=u.milliSecondsElapsed,C.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.EMAILTRANSCRIPTFAILED,"Email Transcript Failed",t,void 0,m,c,E,e.t0,void 0,v,p),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(C.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 17:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"fetchDataMaskingInfo",value:(r=(0,a.default)(i.default.mark((function e(t){var n,r,o,s,u,c,l,p=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.FETCHDATAMASKINGSTARTED,"Fetch Data Masking Started",t),t||(t=(0,P.uuidv4)()),o="/".concat(S.default.LiveChatFetchDataMaskingInfoPath,"/").concat(this.omnichannelConfiguration.orgId),s=f.default.create(),(0,h.default)(s,{retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.fetchDataMaskingInfo}),(u=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,u[R.default.requestId]=t,this.addDefaultHeaders(t,u),c="".concat(this.omnichannelConfiguration.orgUrl).concat(o),l={headers:u,method:"GET",url:c,timeout:null!==(n=this.configuration.defaultRequestTimeout)&&void 0!==n?n:this.configuration.requestTimeoutConfig.fetchDataMaskingInfo},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,a){var c,f,h,v,m,E,T;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=O.Timer.TIMER(),e.prev=1,e.next=4,s(l);case 4:f=e.sent,h=c.milliSecondsElapsed,v=r.milliSecondsElapsed,m=f.data,p.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.FETCHDATAMASKINGSUCCEEDED,"Fetch Data Masking succeeded",t,f,v,o,"GET",void 0,void 0,u,h),n(m),e.next=19;break;case 12:e.prev=12,e.t0=e.catch(1),E=c.milliSecondsElapsed,T=r.milliSecondsElapsed,p.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.FETCHDATAMASKINGFAILED,"Fetch Data Masking Failed",t,void 0,T,o,"GET",e.t0,void 0,u,E),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&a(new Error(p.HTTPTimeOutErrorMessage)),a(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t,n){return e.apply(this,arguments)}}()));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"makeSecondaryChannelEventRequest",value:(n=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,p,v,m,E,T=this,C=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=C.length>2&&void 0!==C[2]?C[2]:{},s=O.Timer.TIMER(),this.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTSTARTED,"Secondary Channel Event Request Started",t),u="/".concat(S.default.LiveChatSecondaryChannelEventPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t),c=f.default.create(),(0,h.default)(c,{headerOverwrites:[R.default.authCodeNonce],retries:this.configuration.maxRequestRetriesOnFailure,waitTimeInMsBetweenRetries:this.configuration.waitTimeBetweenRetriesConfig.makeSecondaryChannelEventRequest}),l=o.authenticatedUserToken,(p=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,l&&(p[R.default.authenticatedUserToken]=l,p[R.default.authCodeNonce]=this.configuration.authCodeNonce,u="/".concat(S.default.LiveChatAuthSecondaryChannelEventPath,"/").concat(this.omnichannelConfiguration.orgId,"/").concat(this.omnichannelConfiguration.widgetId,"/").concat(t)),this.addDefaultHeaders(t,p),u+="?channelId="+g.default.defaultChannelId,v="".concat(this.omnichannelConfiguration.orgUrl).concat(u),m="POST",E={data:JSON.stringify(n),headers:p,method:m,url:v,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.makeSecondaryChannelEventRequest},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,l,f,h,v,C;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,c(E);case 4:a=e.sent,l=o.milliSecondsElapsed,f=a.headers,T.setAuthCodeNonce(f),h=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTSUCCEEDED,"Secondary Channel Event Request Succeeded",t,a,h,u,m,void 0,void 0,p,l),n(),e.next=20;break;case 13:e.prev=13,e.t0=e.catch(1),v=o.milliSecondsElapsed,C=s.milliSecondsElapsed,T.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SECONDARYCHANNELEVENTREQUESTFAILED,"Secondary Channel Event Request Failed",t,void 0,C,u,m,e.t0,void 0,p,v),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(T.HTTPTimeOutErrorMessage)),r(e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"sendTypingIndicator",value:(t=(0,a.default)(i.default.mark((function e(t,n){var r,o,s,u,c,l,h,p,v,m,E=this,T=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=T.length>2&&void 0!==T[2]?T[2]:{},n&&n===d.LiveChatVersion.V2){e.next=3;break}return e.abrupt("return",Promise.resolve());case 3:if(s=O.Timer.TIMER(),u=o.customerDisplayName,n&&n===d.LiveChatVersion.V2){e.next=7;break}throw new Error("Typing indicator is only supported on v2");case 7:return c="/".concat(S.default.SendTypingIndicatorPath,"/").concat(t),l=f.default.create(),(h=g.default.defaultHeaders)[R.default.organizationId]=this.omnichannelConfiguration.orgId,u&&(h[g.default.customerDisplayName]=u),this.addDefaultHeaders(t,h),p="".concat(this.omnichannelConfiguration.orgUrl).concat(c),m={headers:h,method:v="POST",url:p,timeout:null!==(r=this.configuration.defaultRequestTimeout)&&void 0!==r?r:this.configuration.requestTimeoutConfig.sendTypingIndicator},e.abrupt("return",new Promise(function(){var e=(0,a.default)(i.default.mark((function e(n,r){var o,a,u,f,p,T;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=O.Timer.TIMER(),e.prev=1,e.next=4,l(m);case 4:a=e.sent,u=o.milliSecondsElapsed,f=s.milliSecondsElapsed,E.logWithLogger(y.LogLevel.INFO,d.OCSDKTelemetryEvent.SENDTYPINGINDICATORSUCCEEDED,"Send Typing Indicator Succeeded",t,a,f,c,v,void 0,void 0,h,u),n(),e.next=18;break;case 11:e.prev=11,e.t0=e.catch(1),p=o.milliSecondsElapsed,T=s.milliSecondsElapsed,E.logWithLogger(y.LogLevel.ERROR,d.OCSDKTelemetryEvent.SENDTYPINGINDICATORFAILED,"Send Typing Indicator Failed",t,void 0,T,c,v,e.t0,void 0,h,p),(0,L.default)(e.t0,g.default.axiosTimeoutErrorCode)&&r(new Error(E.HTTPTimeOutErrorMessage)),r(e.t0);case 18:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t,n){return e.apply(this,arguments)}}()));case 17:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"logWithLogger",value:function(e,t,n,r,o,i,a,s,u,c,l,d){var f,h,p,v;if(this.logger){u&&C.LoggingSanitizer.stripErrorSensitiveProperties(u);var m=void 0;c&&((m=_({},c)).customContextData&&C.LoggingSanitizer.stripCustomContextDataValues(m.customContextData),m.preChatResponse&&C.LoggingSanitizer.stripPreChatResponse(m.preChatResponse),C.LoggingSanitizer.stripGeolocation(m));var E=void 0,T=void 0;if(l&&(E=_({},l),C.LoggingSanitizer.stripRequestHeadersSensitiveProperties(E),l[R.default.authenticatedUserToken]&&window.document&&window.atob))try{var y=l[R.default.authenticatedUserToken].split(".")[1],w=window.atob(y),S=JSON.parse(w),b=S.lwicontexts;if(T={sub:S.sub,exp:S.exp},b){var O=JSON.parse(b);C.LoggingSanitizer.stripCustomContextDataValues(O),T.lwiContexts=O}}catch(e){}var I={RequestId:r,Region:null==o?void 0:o.data.Region,ElapsedTimeInMilliseconds:i,HttpRequestResponseTime:d,TransactionId:null==o?void 0:o.headers[g.default.transactionid],RequestPath:a,RequestMethod:s,ResponseStatusCode:o?o.status:u?null===(f=u.response)||void 0===f?void 0:f.status:void 0,ExceptionDetails:u?(null===(h=u.response)||void 0===h?void 0:h.data)||u:void 0,RequestPayload:m,RequestHeaders:E,ResponseErrorcode:u?null===(p=u.response)||void 0===p||null===(v=p.headers)||void 0===v?void 0:v.errorcode:void 0,AuthTokenDetails:T};this.logger.log(e,t,I,n)}}},{key:"addDefaultHeaders",value:function(e,t){this.setSessionIdHeader(this.sessionId,t),(0,I.addOcUserAgentHeader)(this.ocUserAgent,t),this.setCorrelationIdInHeader(e,t)}}]),e}();t.default=F,(0,l.default)(F,"defaultRequestTimeoutConfig",{getChatConfig:12e4,getLWIDetails:15e3,getChatToken:15e3,sessionInit:15e3,sessionClose:15e3,getReconnectableChats:15e3,getReconnectAvailability:15e3,submitPostChatResponse:15e3,getSurveyInviteLink:15e3,getChatTranscripts:3e4,emailTranscript:5e3,fetchDataMaskingInfo:5e3,makeSecondaryChannelEventRequest:15e3,getAgentAvailability:15e3,sendTypingIndicator:5e3,validateAuthChatRecordTimeout:15e3,getPersistentChatHistory:15e3}),(0,l.default)(F,"defaultConfiguration",{authCodeNonce:(0,P.uuidv4)().substring(0,8),getChatTokenRetryCount:10,getChatTokenTimeBetweenRetriesOnFailure:1e4,getChatTokenRetryOn429:!0,maxRequestRetriesOnFailure:5,defaultRequestTimeout:void 0,requestTimeoutConfig:F.defaultRequestTimeoutConfig,useUnauthReconnectIdSigQueryParam:!1,waitTimeBetweenRetriesConfig:N.waitTimeBetweenRetriesConfigs,ocUserAgent:[]})},function(e,t,n){e.exports=n(31)},function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new S(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return b()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=y(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function d(){}function f(){}function h(){}var p={};s(p,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(R([])));v&&v!==t&&n.call(v,o)&&(p=v);var m=h.prototype=d.prototype=Object.create(p);function E(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,s){var u=c(e[o],e,i);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function y(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,y(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function R(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:b}}function b(){return{value:void 0,done:!0}}return f.prototype=h,s(m,"constructor",h),s(h,"constructor",f),f.displayName=s(h,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},E(T.prototype),s(T.prototype,i,(function(){return this})),e.AsyncIterator=T,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new T(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(m),s(m,a,"Generator"),s(m,o,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=R,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;w(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(e,t){function n(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function s(e){n(a,o,i,s,u,"next",e)}function u(e){n(a,o,i,s,u,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(34),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(7))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},f.clearImmediate=h}function h(e){delete c[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(7),n(14))},function(e,t,n){"use strict";(function(e){
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *
@@ -7,4 +7,4 @@
7
7
  */
8
8
  var r=n(36),o=n(37),i=n(38);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&i(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(l(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(e).length;default:if(r)return j(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return b(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var d=!0,f=0;f<u;f++)if(c(e,i+f)!==c(t,f)){d=!1;break}if(d)return i}return-1}function T(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function y(e,t,n,r){return H(j(t,e.length-n),e,n,r)}function C(e,t,n,r){return H(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function w(e,t,n,r){return C(e,t,n,r)}function S(e,t,n,r){return H(G(t),e,n,r)}function R(e,t,n,r){return H(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function b(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,u,c=e[o],l=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),d=0;d<s;++d)if(c[d]!==l[d]){i=c[d],a=l[d];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return T(this,e,t,n);case"utf8":case"utf-8":return y(this,e,t,n);case"ascii":return C(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function A(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function L(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=B(e[i]);return o}function D(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function x(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function k(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function _(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,r,i){return i||_(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,i){return i||_(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;n=new u(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||N(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):k(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):k(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);N(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);N(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):k(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):k(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=u.isBuffer(e)?e:j(new u(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function j(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function G(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(7))},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,d=s>0?a-4:a;for(n=0;n<d;n+=4)t=o[e.charCodeAt(n)]<<18|o[e.charCodeAt(n+1)]<<12|o[e.charCodeAt(n+2)]<<6|o[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(l(e,a,a+16383>s?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){
9
9
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
- t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserInfo=t.UNKNOWN_VERSION=void 0;var o=r(n(3)),i=r(n(4)),a=r(n(5)),s=n(8);t.UNKNOWN_VERSION="U";var u=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getUserAgent",value:function(){return this.userAgent()}},{key:"userAgentContainsString",value:function(e){return this.getUserAgent().indexOf(e)>-1}},{key:"isChrome",value:function(){return this.userAgentContainsString(s.BrowserVendor.CHROME)&&!this.userAgentContainsString(s.BrowserVendor.EDGE)&&!this.userAgentContainsString(s.BrowserVendor.EDGE_CHROMIUM)}},{key:"isIe",value:function(){return this.userAgentContainsString("Trident")}},{key:"isEdge",value:function(){return this.userAgentContainsString(s.BrowserVendor.EDGE)||this.userAgentContainsString(s.BrowserVendor.EDGE_CHROMIUM)}},{key:"isOpera",value:function(){return this.userAgentContainsString("OPR/")}},{key:"getBrowserName",value:function(){return this.isOpera()?s.BrowserVendor.OPERA:this.isEdge()?s.BrowserVendor.EDGE:this.isChrome()?s.BrowserVendor.CHROME:this.userAgentContainsString(s.BrowserVendor.FIREFOX)?s.BrowserVendor.FIREFOX:this.userAgentContainsString(s.BrowserVendor.SAFARI)?s.BrowserVendor.SAFARI:this.isIe()?s.BrowserVendor.IE:s.BrowserVendor.UNKNOWN}},{key:"getBrowserVersion",value:function(){var e=this;return this.isIe()?function(){var t=e.getUserAgent(),n=t.match(new RegExp(s.BrowserVendor.IE+" ([\\d,.]+)"));if(n)return n[1];var r=t.match(new RegExp("rv:([\\d,.]+)"));return r?r[1]:void 0}():function(t){t===s.BrowserVendor.SAFARI&&(t="Version"),t===s.BrowserVendor.OPERA&&(t="OPR"),t===s.BrowserVendor.EDGE&&(t="Edge?");var n=e.getUserAgent().match(new RegExp(t+"/([\\d,.]+)"));return n?n[1]:"U"}(this.getBrowserName())}}]),e}();t.BrowserInfo=u,(0,a.default)(u,"userAgent",(function(){return window.navigator.userAgent}))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CustomContextData=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"sort",value:function(e){var t=new Array;return Object.keys(e).forEach((function(n){if(e&&e["".concat(n)]){var r={key:n,value:e["".concat(n)]};t.push(r)}})),t.sort((function(e,t){var n=e.key.toUpperCase(),r=t.key.toUpperCase();return n<r?-1:n>r?1:0})),t}}]),e}();t.CustomContextData=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceInfo=void 0;var o=r(n(3)),i=r(n(4)),a=n(8),s=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getDeviceType",value:function(){return window.navigator.userAgent.match(/(android|ipod|windows phone|wpdesktop|windows ce|blackberry\w*|meego|webos|palm|symbian|pda|\w*?mobile\w*?|\w*?phone\w*?)/i)?a.DeviceType.Mobile:window.navigator.userAgent.match(/tablet|ipad/i)?a.DeviceType.Tablet:a.DeviceType.Desktop}}]),e}();t.DeviceInfo=s},function(e,t,n){var r;e.exports=(r=n(17),r.enc.Hex)},function(e,t){},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=function e(){(0,o.default)(this,e)};t.default=a,(0,i.default)(a,"supportedLocales",["ar-sa","bg-bg","ca-es","cs-cz","da-dk","de-de","el-gr","en-us","es-es","et-ee","eu-es","fi-fi","fr-fr","gl-es","he-il","hi-in","hr-hr","hu-hu","id-id","it-it","ja-jp","kk-kz","ko-kr","lt-lt","lv-lv","ms-my","nb-no","nl-nl","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sk-sk","sl-si","sr-cyrl-cs","sr-latn-cs","sv-se","th-th","tr-tr","uk-ua","vi-vn","zh-cn","zh-hk","zh-tw"])},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=void 0,t.LogLevel=r,function(e){e.INFO="INFO",e.DEBUG="DEBUG",e.WARN="WARN",e.ERROR="ERROR"}(r||(t.LogLevel=r={}))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingSanitizer=void 0;var o=r(n(10)),i=r(n(3)),a=r(n(4)),s=r(n(5)),u=r(n(9)),c=r(n(13)),l=function(){function e(){(0,i.default)(this,e)}return(0,a.default)(e,null,[{key:"stripCustomContextDataValues",value:function(e){var t;e&&(null===(t=Object.keys(e))||void 0===t||t.forEach((function(t){var n;null!==(n=e["".concat(t)])&&void 0!==n&&n.value&&(e["".concat(t)].value=u.default.hiddenContentPlaceholder)})))}},{key:"stripPreChatResponse",value:function(e){e&&Object.keys(e).forEach((function(t){e["".concat(t)]&&"Type"!==t&&(e["".concat(t)]=u.default.hiddenContentPlaceholder)}))}},{key:"stripGeolocation",value:function(e){e&&(Object.keys(e).includes("longitude")&&(e.longitude=u.default.hiddenContentPlaceholder),Object.keys(e).includes("latitude")&&(e.latitude=u.default.hiddenContentPlaceholder))}},{key:"stripAuthenticationUserToken",value:function(e){e&&(Object.keys(e).includes(c.default.authenticatedUserToken)&&(e[c.default.authenticatedUserToken]=u.default.hiddenContentPlaceholder),Object.keys(e).includes(c.default.authCodeNonce)&&(e[c.default.authCodeNonce]=u.default.hiddenContentPlaceholder),Object.keys(e).includes(c.default.authorization)&&(e[c.default.authorization]=u.default.hiddenContentPlaceholder))}},{key:"stripRequestHeadersSensitiveProperties",value:function(t){e.stripAuthenticationUserToken(t),Object.keys(t).includes(c.default.authorization)&&(t[c.default.authorization]=u.default.hiddenContentPlaceholder)}},{key:"stripRequestPayloadData",value:function(t){if(null!=t&&t.data){var n;if("string"==typeof t.data)try{n=JSON.parse(t.data)}catch(e){n=void 0}n&&(Object.keys(n).includes("preChatResponse")&&e.stripPreChatResponse(n.preChatResponse),Object.keys(n).includes("customContextData")&&e.stripCustomContextDataValues(n.customContextData),e.stripGeolocation(n),t.data=JSON.stringify(n),t.data=e.stripEmailDataFromError(t.data))}}},{key:"stripEmailDataFromError",value:function(e){return e=e.replace(this.emailRegex,u.default.hiddenContentPlaceholder)}},{key:"stripAxiosErrorSensitiveProperties",value:function(t){if(t.isAxiosError){var n,r,o,i,a,s,u,c,l,d;if(null!=t&&null!==(n=t.config)&&void 0!==n&&n.headers)e.stripAuthenticationUserToken(null==t||null===(u=t.config)||void 0===u?void 0:u.headers);if(null!=t&&null!==(r=t.config)&&void 0!==r&&r.data&&this.stripRequestPayloadData(null==t?void 0:t.config),null!=t&&null!==(o=t.response)&&void 0!==o&&null!==(i=o.config)&&void 0!==i&&i.data)this.stripRequestPayloadData(null==t||null===(c=t.response)||void 0===c?void 0:c.config);if(null!=t&&null!==(a=t.response)&&void 0!==a&&null!==(s=a.config)&&void 0!==s&&s.headers)e.stripAuthenticationUserToken(null==t||null===(l=t.response)||void 0===l||null===(d=l.config)||void 0===d?void 0:d.headers)}}},{key:"stripErrorSensitiveProperties",value:function(e){var t;e&&"object"===(0,o.default)(e)&&(null===(t=Object.keys(e))||void 0===t?void 0:t.length)>0&&this.stripAxiosErrorSensitiveProperties(e)}}]),e}();t.LoggingSanitizer=l,(0,s.default)(l,"emailRegex",/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g)},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.OSInfo=void 0;var o=r(n(3)),i=r(n(4)),a=n(8),s=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getOsType",value:function(){var e=function(){return window.navigator.userAgent};return e().match(/windows\sphone\s\d+\.\d+/i)?a.OperatingSystem.WINDOWS_PHONE:e().match(/ arm;/i)?a.OperatingSystem.WINDOWS_RT:e().match(/(iPad|iPhone|iPod)(?=.*like Mac OS X)/i)?a.OperatingSystem.IOS:e().match(/android/i)?a.OperatingSystem.ANDROID:e().match(/(linux|joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|cros)/i)?a.OperatingSystem.LINUX:e().match(/(macintosh|mac os x)/i)?a.OperatingSystem.MACOSX:e().match(/(windows|win32)/i)?a.OperatingSystem.WINDOWS:a.OperatingSystem.UNKNOWN}}]),e}();t.OSInfo=s},function(e,t,n){var r;e.exports=(r=n(17),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),u[o]=n(e.pow(r,1/3)),o++),r++}();var c=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],d=n[6],f=n[7],h=0;h<64;h++){if(h<16)c[h]=0|e[t+h];else{var p=c[h-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=c[h-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[h]=g+c[h-7]+m+c[h-16]}var E=r&o^r&i^o&i,T=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),y=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+u[h]+c[h];f=d,d=l,l=s,s=a+y|0,a=i,i=o,o=r,r=y+(T+E)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),r.SHA256)},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"TIMER",value:function(){var e=(new Date).getTime();return{get milliSecondsElapsed(){return(new Date).getTime()-e}}}}]),e}();t.Timer=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.addOcUserAgentHeader=void 0;var o=r(n(51)),i=r(n(13));t.addOcUserAgentHeader=function(e,t){var r=n(56).version,a="ocsdk/".concat(r);t["".concat(i.default.ocUserAgent)]=[].concat((0,o.default)(e),[a]).join(" ")}},function(e,t,n){var r=n(52),o=n(53),i=n(54),a=n(55);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(19);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(19);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e){e.exports=JSON.parse('{"name":"@microsoft/ocsdk","version":"0.5.20-main.42b743c","description":"Microsoft Omnichannel SDK","files":["dist/**/*","lib/**/*"],"main":"lib/index.js","types":"lib/index.d.ts","scripts":{"test":"karma start karma.conf.js","start":"webpack-dev-server","watch":"webpack --watch --config webpack.config.js --mode development","build:tsc":"tsc --project tsconfig.json","build:babel":"babel src --extensions .js,.ts --out-dir lib --verbose","build:dev":"webpack --config webpack.config.js --mode development","build:prod":"export NODE_OPTIONS=--openssl-legacy-provider && npm run build:tsc && npm run build:babel && webpack --config webpack.config.js --mode production","format":"prettier --write \\"src/**/*.ts\\" \\"src/**/*.js\\"","lint":"eslint src --ext .ts"},"repository":{"type":"git","url":"https://github.com/microsoft/omnichannel-sdk.git"},"keywords":[],"author":"Microsoft Corporation","license":"MIT","devDependencies":{"@babel/cli":"^7.15.7","@babel/core":"^7.15.5","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-runtime":"^7.15.0","@babel/preset-env":"^7.15.6","@babel/preset-typescript":"^7.15.0","@dhigroup/karma-vsts-reporter":"^1.3.0","@types/crypto-js":"^4.2.2","@types/jasmine":"^3.9.1","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","axios-mock-adapter":"^2.0.0","danger":"^13.0.4","eslint":"^7.32.0","eslint-plugin-security":"^1.4.0","istanbul-instrumenter-loader":"^3.0.1","jasmine":"^3.9.0","karma":"^6.3.16","karma-chrome-launcher":"^3.1.0","karma-cli":"^2.0.0","karma-coverage-istanbul-reporter":"^2.1.1","karma-jasmine":"^2.0.1","karma-spec-reporter":"0.0.32","karma-webpack":"^4.0.2","prettier":"^1.19.1","ts-loader":"^8.4.0","typescript":"^4.9.5","webpack":"^4.47.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.2","webpack-merge":"^4.2.2"},"dependencies":{"@babel/runtime":"^7.15.4","@types/node":"^22.13.10","axios":"^1.8.2","axios-retry":"^3.9.1","crypto-js":"^4.2.0"}}')},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.createGetChatTokenEndpoint=void 0;var o=r(n(5)),i=n(8),a=r(n(18));t.createGetChatTokenEndpoint=function(e,t,n){var r,s,u=(r={},(0,o.default)(r,i.LiveChatVersion.V1,a.default.LiveChatGetChatTokenPath),(0,o.default)(r,i.LiveChatVersion.V2,a.default.LiveChatv2GetChatTokenPath),(0,o.default)(r,i.LiveChatVersion.V3,a.default.LiveChatv3GetChatTokenPath),r),c=(s={},(0,o.default)(s,i.LiveChatVersion.V1,a.default.LiveChatAuthGetChatTokenPath),(0,o.default)(s,i.LiveChatVersion.V2,a.default.LiveChatv2AuthGetChatTokenPath),(0,o.default)(s,i.LiveChatVersion.V3,a.default.LiveChatv3AuthGetChatTokenPath),s);return n?t?a.default.LiveChatv4AuthGetChatTokenPath:a.default.LiveChatv4GetChatTokenPath:Object.values(i.LiveChatVersion).includes(e)?t?c[e]:u[e]:t?c[i.LiveChatVersion.V2]:u[i.LiveChatVersion.V2]}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(21)),i=function(e,t){try{if(o.default.isAxiosError(e)&&e.code==t)return!0}catch(e){return!1}return!1};t.default=i},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(9)),i=n(16),a=n(15),s=function(e,t){var n,r,s,u,c,l,d;if(null!=e&&null!==(n=e.response)&&void 0!==n&&n.status)switch(e.response.status){case o.default.tooManyRequestsStatusCode:if(!1===t)return!1;break;case o.default.badRequestStatusCode:if(null!==(r=e.response)&&void 0!==r&&null!==(s=r.headers)&&void 0!==s&&s.errorcode&&parseInt(e.response.headers.errorcode)===o.default.outOfOfficeErrorCode)return!1;break;default:return(0,a.isRetryableError)(e)||(0,i.isNetworkError)(e)||0==(null===(u=e.response)||void 0===u?void 0:u.status)||!(null!==(c=e.response)&&void 0!==c&&c.status)}return(0,a.isRetryableError)(e)||(0,i.isNetworkError)(e)||0==(null===(l=e.response)||void 0===l?void 0:l.status)||!(null!==(d=e.response)&&void 0!==d&&d.status)};t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.waitTimeBetweenRetriesConfigs=void 0;t.waitTimeBetweenRetriesConfigs={getChatConfig:1e3,getLWIDetails:3e3,getChatToken:1e3,sessionInit:1e3,sessionClose:1e3,getReconnectableChats:1e3,getReconnectAvailability:1e3,submitPostChatResponse:1e3,getSurveyInviteLink:1e3,getChatTranscripts:1e3,emailTranscript:1e3,fetchDataMaskingInfo:1e3,makeSecondaryChannelEventRequest:1e3,getAgentAvailability:1e3,sendTypingIndicator:1e3,validateAuthChatRecordTimeout:1e3,getPersistentChatHistory:1e3}}]));
10
+ t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserInfo=t.UNKNOWN_VERSION=void 0;var o=r(n(3)),i=r(n(4)),a=r(n(5)),s=n(8);t.UNKNOWN_VERSION="U";var u=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getUserAgent",value:function(){return this.userAgent()}},{key:"userAgentContainsString",value:function(e){return this.getUserAgent().indexOf(e)>-1}},{key:"isChrome",value:function(){return this.userAgentContainsString(s.BrowserVendor.CHROME)&&!this.userAgentContainsString(s.BrowserVendor.EDGE)&&!this.userAgentContainsString(s.BrowserVendor.EDGE_CHROMIUM)}},{key:"isIe",value:function(){return this.userAgentContainsString("Trident")}},{key:"isEdge",value:function(){return this.userAgentContainsString(s.BrowserVendor.EDGE)||this.userAgentContainsString(s.BrowserVendor.EDGE_CHROMIUM)}},{key:"isOpera",value:function(){return this.userAgentContainsString("OPR/")}},{key:"getBrowserName",value:function(){return this.isOpera()?s.BrowserVendor.OPERA:this.isEdge()?s.BrowserVendor.EDGE:this.isChrome()?s.BrowserVendor.CHROME:this.userAgentContainsString(s.BrowserVendor.FIREFOX)?s.BrowserVendor.FIREFOX:this.userAgentContainsString(s.BrowserVendor.SAFARI)?s.BrowserVendor.SAFARI:this.isIe()?s.BrowserVendor.IE:s.BrowserVendor.UNKNOWN}},{key:"getBrowserVersion",value:function(){var e=this;return this.isIe()?function(){var t=e.getUserAgent(),n=t.match(new RegExp(s.BrowserVendor.IE+" ([\\d,.]+)"));if(n)return n[1];var r=t.match(new RegExp("rv:([\\d,.]+)"));return r?r[1]:void 0}():function(t){t===s.BrowserVendor.SAFARI&&(t="Version"),t===s.BrowserVendor.OPERA&&(t="OPR"),t===s.BrowserVendor.EDGE&&(t="Edge?");var n=e.getUserAgent().match(new RegExp(t+"/([\\d,.]+)"));return n?n[1]:"U"}(this.getBrowserName())}}]),e}();t.BrowserInfo=u,(0,a.default)(u,"userAgent",(function(){return window.navigator.userAgent}))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CustomContextData=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"sort",value:function(e){var t=new Array;return Object.keys(e).forEach((function(n){if(e&&e["".concat(n)]){var r={key:n,value:e["".concat(n)]};t.push(r)}})),t.sort((function(e,t){var n=e.key.toUpperCase(),r=t.key.toUpperCase();return n<r?-1:n>r?1:0})),t}}]),e}();t.CustomContextData=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceInfo=void 0;var o=r(n(3)),i=r(n(4)),a=n(8),s=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getDeviceType",value:function(){return window.navigator.userAgent.match(/(android|ipod|windows phone|wpdesktop|windows ce|blackberry\w*|meego|webos|palm|symbian|pda|\w*?mobile\w*?|\w*?phone\w*?)/i)?a.DeviceType.Mobile:window.navigator.userAgent.match(/tablet|ipad/i)?a.DeviceType.Tablet:a.DeviceType.Desktop}}]),e}();t.DeviceInfo=s},function(e,t,n){var r;e.exports=(r=n(17),r.enc.Hex)},function(e,t){},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),i=r(n(5)),a=function e(){(0,o.default)(this,e)};t.default=a,(0,i.default)(a,"supportedLocales",["ar-sa","bg-bg","ca-es","cs-cz","da-dk","de-de","el-gr","en-us","es-es","et-ee","eu-es","fi-fi","fr-fr","gl-es","he-il","hi-in","hr-hr","hu-hu","id-id","it-it","ja-jp","kk-kz","ko-kr","lt-lt","lv-lv","ms-my","nb-no","nl-nl","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sk-sk","sl-si","sr-cyrl-cs","sr-latn-cs","sv-se","th-th","tr-tr","uk-ua","vi-vn","zh-cn","zh-hk","zh-tw"])},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=void 0,t.LogLevel=r,function(e){e.INFO="INFO",e.DEBUG="DEBUG",e.WARN="WARN",e.ERROR="ERROR"}(r||(t.LogLevel=r={}))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingSanitizer=void 0;var o=r(n(10)),i=r(n(3)),a=r(n(4)),s=r(n(5)),u=r(n(9)),c=r(n(13)),l=function(){function e(){(0,i.default)(this,e)}return(0,a.default)(e,null,[{key:"stripCustomContextDataValues",value:function(e){var t;e&&(null===(t=Object.keys(e))||void 0===t||t.forEach((function(t){var n;null!==(n=e["".concat(t)])&&void 0!==n&&n.value&&(e["".concat(t)].value=u.default.hiddenContentPlaceholder)})))}},{key:"stripPreChatResponse",value:function(e){e&&Object.keys(e).forEach((function(t){e["".concat(t)]&&"Type"!==t&&(e["".concat(t)]=u.default.hiddenContentPlaceholder)}))}},{key:"stripGeolocation",value:function(e){e&&(Object.keys(e).includes("longitude")&&(e.longitude=u.default.hiddenContentPlaceholder),Object.keys(e).includes("latitude")&&(e.latitude=u.default.hiddenContentPlaceholder))}},{key:"stripAuthenticationUserToken",value:function(e){e&&(Object.keys(e).includes(c.default.authenticatedUserToken)&&(e[c.default.authenticatedUserToken]=u.default.hiddenContentPlaceholder),Object.keys(e).includes(c.default.authCodeNonce)&&(e[c.default.authCodeNonce]=u.default.hiddenContentPlaceholder),Object.keys(e).includes(c.default.authorization)&&(e[c.default.authorization]=u.default.hiddenContentPlaceholder))}},{key:"stripRequestHeadersSensitiveProperties",value:function(t){e.stripAuthenticationUserToken(t),Object.keys(t).includes(c.default.authorization)&&(t[c.default.authorization]=u.default.hiddenContentPlaceholder)}},{key:"stripRequestPayloadData",value:function(t){if(null!=t&&t.data){var n;if("string"==typeof t.data)try{n=JSON.parse(t.data)}catch(e){n=void 0}n&&(Object.keys(n).includes("preChatResponse")&&e.stripPreChatResponse(n.preChatResponse),Object.keys(n).includes("customContextData")&&e.stripCustomContextDataValues(n.customContextData),e.stripGeolocation(n),t.data=JSON.stringify(n),t.data=e.stripEmailDataFromError(t.data))}}},{key:"stripEmailDataFromError",value:function(e){return e=e.replace(this.emailRegex,u.default.hiddenContentPlaceholder)}},{key:"stripAxiosErrorSensitiveProperties",value:function(t){if(t.isAxiosError){var n,r,o,i,a,s,u,c,l,d;if(null!=t&&null!==(n=t.config)&&void 0!==n&&n.headers)e.stripAuthenticationUserToken(null==t||null===(u=t.config)||void 0===u?void 0:u.headers);if(null!=t&&null!==(r=t.config)&&void 0!==r&&r.data&&this.stripRequestPayloadData(null==t?void 0:t.config),null!=t&&null!==(o=t.response)&&void 0!==o&&null!==(i=o.config)&&void 0!==i&&i.data)this.stripRequestPayloadData(null==t||null===(c=t.response)||void 0===c?void 0:c.config);if(null!=t&&null!==(a=t.response)&&void 0!==a&&null!==(s=a.config)&&void 0!==s&&s.headers)e.stripAuthenticationUserToken(null==t||null===(l=t.response)||void 0===l||null===(d=l.config)||void 0===d?void 0:d.headers)}}},{key:"stripErrorSensitiveProperties",value:function(e){var t;e&&"object"===(0,o.default)(e)&&(null===(t=Object.keys(e))||void 0===t?void 0:t.length)>0&&this.stripAxiosErrorSensitiveProperties(e)}}]),e}();t.LoggingSanitizer=l,(0,s.default)(l,"emailRegex",/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g)},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.OSInfo=void 0;var o=r(n(3)),i=r(n(4)),a=n(8),s=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"getOsType",value:function(){var e=function(){return window.navigator.userAgent};return e().match(/windows\sphone\s\d+\.\d+/i)?a.OperatingSystem.WINDOWS_PHONE:e().match(/ arm;/i)?a.OperatingSystem.WINDOWS_RT:e().match(/(iPad|iPhone|iPod)(?=.*like Mac OS X)/i)?a.OperatingSystem.IOS:e().match(/android/i)?a.OperatingSystem.ANDROID:e().match(/(linux|joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|cros)/i)?a.OperatingSystem.LINUX:e().match(/(macintosh|mac os x)/i)?a.OperatingSystem.MACOSX:e().match(/(windows|win32)/i)?a.OperatingSystem.WINDOWS:a.OperatingSystem.UNKNOWN}}]),e}();t.OSInfo=s},function(e,t,n){var r;e.exports=(r=n(17),function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),u[o]=n(e.pow(r,1/3)),o++),r++}();var c=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],d=n[6],f=n[7],h=0;h<64;h++){if(h<16)c[h]=0|e[t+h];else{var p=c[h-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=c[h-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[h]=g+c[h-7]+m+c[h-16]}var E=r&o^r&i^o&i,T=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),y=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+u[h]+c[h];f=d,d=l,l=s,s=a+y|0,a=i,i=o,o=r,r=y+(T+E)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),r.SHA256)},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var o=r(n(3)),i=r(n(4)),a=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"TIMER",value:function(){var e=(new Date).getTime();return{get milliSecondsElapsed(){return(new Date).getTime()-e}}}}]),e}();t.Timer=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.addOcUserAgentHeader=void 0;var o=r(n(51)),i=r(n(13));t.addOcUserAgentHeader=function(e,t){var r=n(56).version,a="ocsdk/".concat(r);t["".concat(i.default.ocUserAgent)]=[].concat((0,o.default)(e),[a]).join(" ")}},function(e,t,n){var r=n(52),o=n(53),i=n(54),a=n(55);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(19);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(19);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e){e.exports=JSON.parse('{"name":"@microsoft/ocsdk","version":"0.5.20-main.dfb694e","description":"Microsoft Omnichannel SDK","files":["dist/**/*","lib/**/*"],"main":"lib/index.js","types":"lib/index.d.ts","scripts":{"test":"karma start karma.conf.js","start":"webpack-dev-server","watch":"webpack --watch --config webpack.config.js --mode development","build:tsc":"tsc --project tsconfig.json","build:babel":"babel src --extensions .js,.ts --out-dir lib --verbose","build:dev":"webpack --config webpack.config.js --mode development","build:prod":"export NODE_OPTIONS=--openssl-legacy-provider && npm run build:tsc && npm run build:babel && webpack --config webpack.config.js --mode production","format":"prettier --write \\"src/**/*.ts\\" \\"src/**/*.js\\"","lint":"eslint src --ext .ts"},"repository":{"type":"git","url":"https://github.com/microsoft/omnichannel-sdk.git"},"keywords":[],"author":"Microsoft Corporation","license":"MIT","devDependencies":{"@babel/cli":"^7.15.7","@babel/core":"^7.15.5","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-runtime":"^7.15.0","@babel/preset-env":"^7.15.6","@babel/preset-typescript":"^7.15.0","@dhigroup/karma-vsts-reporter":"^1.3.0","@types/crypto-js":"^4.2.2","@types/jasmine":"^3.9.1","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","axios-mock-adapter":"^2.0.0","danger":"^13.0.4","eslint":"^7.32.0","eslint-plugin-security":"^1.4.0","istanbul-instrumenter-loader":"^3.0.1","jasmine":"^3.9.0","karma":"^6.3.16","karma-chrome-launcher":"^3.1.0","karma-cli":"^2.0.0","karma-coverage-istanbul-reporter":"^2.1.1","karma-jasmine":"^2.0.1","karma-spec-reporter":"0.0.32","karma-webpack":"^4.0.2","prettier":"^1.19.1","ts-loader":"^8.4.0","typescript":"^4.9.5","webpack":"^4.47.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.2","webpack-merge":"^4.2.2"},"dependencies":{"@babel/runtime":"^7.15.4","@types/node":"^22.13.10","axios":"^1.12.0","axios-retry":"^3.9.1","crypto-js":"^4.2.0"}}')},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.createGetChatTokenEndpoint=void 0;var o=r(n(5)),i=n(8),a=r(n(18));t.createGetChatTokenEndpoint=function(e,t,n){var r,s,u=(r={},(0,o.default)(r,i.LiveChatVersion.V1,a.default.LiveChatGetChatTokenPath),(0,o.default)(r,i.LiveChatVersion.V2,a.default.LiveChatv2GetChatTokenPath),(0,o.default)(r,i.LiveChatVersion.V3,a.default.LiveChatv3GetChatTokenPath),r),c=(s={},(0,o.default)(s,i.LiveChatVersion.V1,a.default.LiveChatAuthGetChatTokenPath),(0,o.default)(s,i.LiveChatVersion.V2,a.default.LiveChatv2AuthGetChatTokenPath),(0,o.default)(s,i.LiveChatVersion.V3,a.default.LiveChatv3AuthGetChatTokenPath),s);return n?t?a.default.LiveChatv4AuthGetChatTokenPath:a.default.LiveChatv4GetChatTokenPath:Object.values(i.LiveChatVersion).includes(e)?t?c[e]:u[e]:t?c[i.LiveChatVersion.V2]:u[i.LiveChatVersion.V2]}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(21)),i=function(e,t){try{if(o.default.isAxiosError(e)&&e.code==t)return!0}catch(e){return!1}return!1};t.default=i},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(9)),i=n(16),a=n(15),s=function(e,t){var n,r,s,u,c,l,d;if(null!=e&&null!==(n=e.response)&&void 0!==n&&n.status)switch(e.response.status){case o.default.tooManyRequestsStatusCode:if(!1===t)return!1;break;case o.default.badRequestStatusCode:if(null!==(r=e.response)&&void 0!==r&&null!==(s=r.headers)&&void 0!==s&&s.errorcode&&parseInt(e.response.headers.errorcode)===o.default.outOfOfficeErrorCode)return!1;break;default:return(0,a.isRetryableError)(e)||(0,i.isNetworkError)(e)||0==(null===(u=e.response)||void 0===u?void 0:u.status)||!(null!==(c=e.response)&&void 0!==c&&c.status)}return(0,a.isRetryableError)(e)||(0,i.isNetworkError)(e)||0==(null===(l=e.response)||void 0===l?void 0:l.status)||!(null!==(d=e.response)&&void 0!==d&&d.status)};t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.waitTimeBetweenRetriesConfigs=void 0;t.waitTimeBetweenRetriesConfigs={getChatConfig:1e3,getLWIDetails:3e3,getChatToken:1e3,sessionInit:1e3,sessionClose:1e3,getReconnectableChats:1e3,getReconnectAvailability:1e3,submitPostChatResponse:1e3,getSurveyInviteLink:1e3,getChatTranscripts:1e3,emailTranscript:1e3,fetchDataMaskingInfo:1e3,makeSecondaryChannelEventRequest:1e3,getAgentAvailability:1e3,sendTypingIndicator:1e3,validateAuthChatRecordTimeout:1e3,getPersistentChatHistory:1e3}}]));